import { w as bD, h as xD, _ as wD, K as _D, E as Ev } from "./index-B-W0fnek.js";
import { C as SD } from "./ContentMixin-Bvii7mm_.js";
import { ref as we, defineComponent as Le, computed as ee, openBlock as Q, createElementBlock as be, mergeProps as Nr, unref as N, renderSlot as Fe, useAttrs as AT, useSlots as co, shallowRef as mr, watch as ze, nextTick as st, onMounted as Lt, toRef as pr, createCommentVNode as Pe, Fragment as pt, normalizeClass as xe, createElementVNode as Ee, createBlock as Re, withCtx as le, resolveDynamicComponent as Yt, withModifiers as Tt, createVNode as oe, toDisplayString as Ze, normalizeStyle as yt, provide as Dt, reactive as _r, onActivated as LT, onUpdated as jh, inject as Ye, onBeforeUnmount as Sr, withDirectives as ht, cloneVNode as kT, Text as sg, Comment as PT, Transition as Zn, vShow as Ot, readonly as U1, onDeactivated as RT, createTextVNode as et, isRef as cn, vModelCheckbox as Sm, toRefs as Zi, toHandlers as OT, getCurrentInstance as Ct, watchEffect as lg, withKeys as ti, h as an, warn as DT, onBeforeMount as IT, onUnmounted as j1, toRaw as gl, getCurrentScope as H1, onScopeDispose as G1, Teleport as NT, renderList as ir, resolveComponent as qt, resolveDirective as BT, toHandlerKey as FT, vModelText as zT, pushScopeId as Hh, popScopeId as Gh, createApp as $T, createSlots as MD, markRaw as Si, isVNode as oy, hasInjectionContext as ED, effectScope as TD, isReactive as W1 } from "vue";
const $a = (t, e, { checkForDefaultPrevented: r = !0 } = {}) => (i) => {
const n = t == null ? void 0 : t(i);
if (r === !1 || !n)
return e == null ? void 0 : e(i);
};
var Pw;
const $r = typeof window < "u", CD = (t) => typeof t == "string", VT = () => {
}, sy = $r && ((Pw = window == null ? void 0 : window.navigator) == null ? void 0 : Pw.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function UT(t) {
return typeof t == "function" ? t() : N(t);
}
function AD(t) {
return t;
}
function cg(t) {
return H1() ? (G1(t), !0) : !1;
}
function LD(t, e = !0) {
Ct() ? Lt(t) : e ? t() : st(t);
}
function qa(t) {
var e;
const r = UT(t);
return (e = r == null ? void 0 : r.$el) != null ? e : r;
}
const ug = $r ? window : void 0;
function xn(...t) {
let e, r, i, n;
if (CD(t[0]) || Array.isArray(t[0]) ? ([r, i, n] = t, e = ug) : [e, r, i, n] = t, !e)
return VT;
Array.isArray(r) || (r = [r]), Array.isArray(i) || (i = [i]);
const a = [], o = () => {
a.forEach((u) => u()), a.length = 0;
}, s = (u, d, h, f) => (u.addEventListener(d, h, f), () => u.removeEventListener(d, h, f)), c = ze(() => [qa(e), UT(n)], ([u, d]) => {
o(), u && a.push(...r.flatMap((h) => i.map((f) => s(u, h, f, d))));
}, { immediate: !0, flush: "post" }), l = () => {
c(), o();
};
return cg(l), l;
}
let Rw = !1;
function kD(t, e, r = {}) {
const { window: i = ug, ignore: n = [], capture: a = !0, detectIframe: o = !1 } = r;
if (!i)
return;
sy && !Rw && (Rw = !0, Array.from(i.document.body.children).forEach((u) => u.addEventListener("click", VT)));
let s = !0;
const c = (u) => n.some((d) => {
if (typeof d == "string")
return Array.from(i.document.querySelectorAll(d)).some((h) => h === u.target || u.composedPath().includes(h));
{
const h = qa(d);
return h && (u.target === h || u.composedPath().includes(h));
}
}), l = [
xn(i, "click", (u) => {
const d = qa(t);
if (!(!d || d === u.target || u.composedPath().includes(d))) {
if (u.detail === 0 && (s = !c(u)), !s) {
s = !0;
return;
}
e(u);
}
}, { passive: !0, capture: a }),
xn(i, "pointerdown", (u) => {
const d = qa(t);
d && (s = !u.composedPath().includes(d) && !c(u));
}, { passive: !0 }),
o && xn(i, "blur", (u) => {
var d;
const h = qa(t);
((d = i.document.activeElement) == null ? void 0 : d.tagName) === "IFRAME" && !(h != null && h.contains(i.document.activeElement)) && e(u);
})
].filter(Boolean);
return () => l.forEach((u) => u());
}
function jT(t, e = !1) {
const r = we(), i = () => r.value = !!t();
return i(), LD(i, e), r;
}
const Ow = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Dw = "__vueuse_ssr_handlers__";
Ow[Dw] = Ow[Dw] || {};
var Iw = Object.getOwnPropertySymbols, PD = Object.prototype.hasOwnProperty, RD = Object.prototype.propertyIsEnumerable, OD = (t, e) => {
var r = {};
for (var i in t)
PD.call(t, i) && e.indexOf(i) < 0 && (r[i] = t[i]);
if (t != null && Iw)
for (var i of Iw(t))
e.indexOf(i) < 0 && RD.call(t, i) && (r[i] = t[i]);
return r;
};
function Ua(t, e, r = {}) {
const i = r, { window: n = ug } = i, a = OD(i, ["window"]);
let o;
const s = jT(() => n && "ResizeObserver" in n), c = () => {
o && (o.disconnect(), o = void 0);
}, l = ze(() => qa(t), (d) => {
c(), s.value && n && d && (o = new ResizeObserver(e), o.observe(d, a));
}, { immediate: !0, flush: "post" }), u = () => {
c(), l();
};
return cg(u), {
isSupported: s,
stop: u
};
}
var Nw = Object.getOwnPropertySymbols, DD = Object.prototype.hasOwnProperty, ID = Object.prototype.propertyIsEnumerable, ND = (t, e) => {
var r = {};
for (var i in t)
DD.call(t, i) && e.indexOf(i) < 0 && (r[i] = t[i]);
if (t != null && Nw)
for (var i of Nw(t))
e.indexOf(i) < 0 && ID.call(t, i) && (r[i] = t[i]);
return r;
};
function BD(t, e, r = {}) {
const i = r, { window: n = ug } = i, a = ND(i, ["window"]);
let o;
const s = jT(() => n && "MutationObserver" in n), c = () => {
o && (o.disconnect(), o = void 0);
}, l = ze(() => qa(t), (d) => {
c(), s.value && n && d && (o = new MutationObserver(e), o.observe(d, a));
}, { immediate: !0 }), u = () => {
c(), l();
};
return cg(u), {
isSupported: s,
stop: u
};
}
var Bw;
(function(t) {
t.UP = "UP", t.RIGHT = "RIGHT", t.DOWN = "DOWN", t.LEFT = "LEFT", t.NONE = "NONE";
})(Bw || (Bw = {}));
var FD = Object.defineProperty, Fw = Object.getOwnPropertySymbols, zD = Object.prototype.hasOwnProperty, $D = Object.prototype.propertyIsEnumerable, zw = (t, e, r) => e in t ? FD(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, VD = (t, e) => {
for (var r in e || (e = {}))
zD.call(e, r) && zw(t, r, e[r]);
if (Fw)
for (var r of Fw(e))
$D.call(e, r) && zw(t, r, e[r]);
return t;
};
const UD = {
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]
};
VD({
linear: AD
}, UD);
const jD = () => $r && /firefox/i.test(window.navigator.userAgent), q1 = (t) => {
let e, r;
return t.type === "touchend" ? (r = t.changedTouches[0].clientY, e = t.changedTouches[0].clientX) : t.type.startsWith("touch") ? (r = t.touches[0].clientY, e = t.touches[0].clientX) : (r = t.clientY, e = t.clientX), {
clientX: e,
clientY: r
};
};
/**
* @vue/shared v3.4.27
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
process.env.NODE_ENV !== "production" && Object.freeze({});
process.env.NODE_ENV !== "production" && Object.freeze([]);
const oh = () => {
}, HD = Object.prototype.hasOwnProperty, vl = (t, e) => HD.call(t, e), Ui = Array.isArray, Di = (t) => typeof t == "function", Ei = (t) => typeof t == "string", di = (t) => t !== null && typeof t == "object", GD = Object.prototype.toString, WD = (t) => GD.call(t), Tv = (t) => WD(t).slice(8, -1), HT = (t) => {
const e = /* @__PURE__ */ Object.create(null);
return (r) => e[r] || (e[r] = t(r));
}, qD = /-(\w)/g, XD = HT((t) => t.replace(qD, (e, r) => r ? r.toUpperCase() : "")), ZD = /\B([A-Z])/g, YD = HT(
(t) => t.replace(ZD, "-$1").toLowerCase()
);
var GT = typeof global == "object" && global && global.Object === Object && global, KD = typeof self == "object" && self && self.Object === Object && self, Ma = GT || KD || Function("return this")(), ga = Ma.Symbol, WT = Object.prototype, JD = WT.hasOwnProperty, QD = WT.toString, ld = ga ? ga.toStringTag : void 0;
function eI(t) {
var e = JD.call(t, ld), r = t[ld];
try {
t[ld] = void 0;
var i = !0;
} catch {
}
var n = QD.call(t);
return i && (e ? t[ld] = r : delete t[ld]), n;
}
var tI = Object.prototype, rI = tI.toString;
function iI(t) {
return rI.call(t);
}
var nI = "[object Null]", aI = "[object Undefined]", $w = ga ? ga.toStringTag : void 0;
function Ou(t) {
return t == null ? t === void 0 ? aI : nI : $w && $w in Object(t) ? eI(t) : iI(t);
}
function Xc(t) {
return t != null && typeof t == "object";
}
var oI = "[object Symbol]";
function dg(t) {
return typeof t == "symbol" || Xc(t) && Ou(t) == oI;
}
function sI(t, e) {
for (var r = -1, i = t == null ? 0 : t.length, n = Array(i); ++r < i; )
n[r] = e(t[r], r, t);
return n;
}
var Gn = Array.isArray, lI = 1 / 0, Vw = ga ? ga.prototype : void 0, Uw = Vw ? Vw.toString : void 0;
function qT(t) {
if (typeof t == "string")
return t;
if (Gn(t))
return sI(t, qT) + "";
if (dg(t))
return Uw ? Uw.call(t) : "";
var e = t + "";
return e == "0" && 1 / t == -lI ? "-0" : e;
}
var cI = /\s/;
function uI(t) {
for (var e = t.length; e-- && cI.test(t.charAt(e)); )
;
return e;
}
var dI = /^\s+/;
function hI(t) {
return t && t.slice(0, uI(t) + 1).replace(dI, "");
}
function ls(t) {
var e = typeof t;
return t != null && (e == "object" || e == "function");
}
var jw = NaN, pI = /^[-+]0x[0-9a-f]+$/i, fI = /^0b[01]+$/i, mI = /^0o[0-7]+$/i, gI = parseInt;
function Hw(t) {
if (typeof t == "number")
return t;
if (dg(t))
return jw;
if (ls(t)) {
var e = typeof t.valueOf == "function" ? t.valueOf() : t;
t = ls(e) ? e + "" : e;
}
if (typeof t != "string")
return t === 0 ? t : +t;
t = hI(t);
var r = fI.test(t);
return r || mI.test(t) ? gI(t.slice(2), r ? 2 : 8) : pI.test(t) ? jw : +t;
}
function XT(t) {
return t;
}
var vI = "[object AsyncFunction]", yI = "[object Function]", bI = "[object GeneratorFunction]", xI = "[object Proxy]";
function ZT(t) {
if (!ls(t))
return !1;
var e = Ou(t);
return e == yI || e == bI || e == vI || e == xI;
}
var Cv = Ma["__core-js_shared__"], Gw = function() {
var t = /[^.]+$/.exec(Cv && Cv.keys && Cv.keys.IE_PROTO || "");
return t ? "Symbol(src)_1." + t : "";
}();
function wI(t) {
return !!Gw && Gw in t;
}
var _I = Function.prototype, SI = _I.toString;
function Bl(t) {
if (t != null) {
try {
return SI.call(t);
} catch {
}
try {
return t + "";
} catch {
}
}
return "";
}
var MI = /[\\^$.*+?()[\]{}|]/g, EI = /^\[object .+?Constructor\]$/, TI = Function.prototype, CI = Object.prototype, AI = TI.toString, LI = CI.hasOwnProperty, kI = RegExp(
"^" + AI.call(LI).replace(MI, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function PI(t) {
if (!ls(t) || wI(t))
return !1;
var e = ZT(t) ? kI : EI;
return e.test(Bl(t));
}
function RI(t, e) {
return t == null ? void 0 : t[e];
}
function Fl(t, e) {
var r = RI(t, e);
return PI(r) ? r : void 0;
}
var ly = Fl(Ma, "WeakMap");
function OI(t, e, r) {
switch (r.length) {
case 0:
return t.call(e);
case 1:
return t.call(e, r[0]);
case 2:
return t.call(e, r[0], r[1]);
case 3:
return t.call(e, r[0], r[1], r[2]);
}
return t.apply(e, r);
}
var DI = 800, II = 16, NI = Date.now;
function BI(t) {
var e = 0, r = 0;
return function() {
var i = NI(), n = II - (i - r);
if (r = i, n > 0) {
if (++e >= DI)
return arguments[0];
} else
e = 0;
return t.apply(void 0, arguments);
};
}
function FI(t) {
return function() {
return t;
};
}
var Mm = function() {
try {
var t = Fl(Object, "defineProperty");
return t({}, "", {}), t;
} catch {
}
}(), zI = Mm ? function(t, e) {
return Mm(t, "toString", {
configurable: !0,
enumerable: !1,
value: FI(e),
writable: !0
});
} : XT, $I = BI(zI);
function VI(t, e, r, i) {
t.length;
for (var n = r + 1; n--; )
if (e(t[n], n, t))
return n;
return -1;
}
var UI = 9007199254740991, jI = /^(?:0|[1-9]\d*)$/;
function X1(t, e) {
var r = typeof t;
return e = e ?? UI, !!e && (r == "number" || r != "symbol" && jI.test(t)) && t > -1 && t % 1 == 0 && t < e;
}
function HI(t, e, r) {
e == "__proto__" && Mm ? Mm(t, e, {
configurable: !0,
enumerable: !0,
value: r,
writable: !0
}) : t[e] = r;
}
function Z1(t, e) {
return t === e || t !== t && e !== e;
}
var GI = Object.prototype, WI = GI.hasOwnProperty;
function qI(t, e, r) {
var i = t[e];
(!(WI.call(t, e) && Z1(i, r)) || r === void 0 && !(e in t)) && HI(t, e, r);
}
var Ww = Math.max;
function XI(t, e, r) {
return e = Ww(e === void 0 ? t.length - 1 : e, 0), function() {
for (var i = arguments, n = -1, a = Ww(i.length - e, 0), o = Array(a); ++n < a; )
o[n] = i[e + n];
n = -1;
for (var s = Array(e + 1); ++n < e; )
s[n] = i[n];
return s[e] = r(o), OI(t, this, s);
};
}
var ZI = 9007199254740991;
function Y1(t) {
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= ZI;
}
function YI(t) {
return t != null && Y1(t.length) && !ZT(t);
}
var KI = Object.prototype;
function JI(t) {
var e = t && t.constructor, r = typeof e == "function" && e.prototype || KI;
return t === r;
}
function QI(t, e) {
for (var r = -1, i = Array(t); ++r < t; )
i[r] = e(r);
return i;
}
var eN = "[object Arguments]";
function qw(t) {
return Xc(t) && Ou(t) == eN;
}
var YT = Object.prototype, tN = YT.hasOwnProperty, rN = YT.propertyIsEnumerable, K1 = qw(/* @__PURE__ */ function() {
return arguments;
}()) ? qw : function(t) {
return Xc(t) && tN.call(t, "callee") && !rN.call(t, "callee");
};
function iN() {
return !1;
}
var KT = typeof exports == "object" && exports && !exports.nodeType && exports, Xw = KT && typeof module == "object" && module && !module.nodeType && module, nN = Xw && Xw.exports === KT, Zw = nN ? Ma.Buffer : void 0, aN = Zw ? Zw.isBuffer : void 0, cy = aN || iN, oN = "[object Arguments]", sN = "[object Array]", lN = "[object Boolean]", cN = "[object Date]", uN = "[object Error]", dN = "[object Function]", hN = "[object Map]", pN = "[object Number]", fN = "[object Object]", mN = "[object RegExp]", gN = "[object Set]", vN = "[object String]", yN = "[object WeakMap]", bN = "[object ArrayBuffer]", xN = "[object DataView]", wN = "[object Float32Array]", _N = "[object Float64Array]", SN = "[object Int8Array]", MN = "[object Int16Array]", EN = "[object Int32Array]", TN = "[object Uint8Array]", CN = "[object Uint8ClampedArray]", AN = "[object Uint16Array]", LN = "[object Uint32Array]", ur = {};
ur[wN] = ur[_N] = ur[SN] = ur[MN] = ur[EN] = ur[TN] = ur[CN] = ur[AN] = ur[LN] = !0;
ur[oN] = ur[sN] = ur[bN] = ur[lN] = ur[xN] = ur[cN] = ur[uN] = ur[dN] = ur[hN] = ur[pN] = ur[fN] = ur[mN] = ur[gN] = ur[vN] = ur[yN] = !1;
function kN(t) {
return Xc(t) && Y1(t.length) && !!ur[Ou(t)];
}
function PN(t) {
return function(e) {
return t(e);
};
}
var JT = typeof exports == "object" && exports && !exports.nodeType && exports, Hd = JT && typeof module == "object" && module && !module.nodeType && module, RN = Hd && Hd.exports === JT, Av = RN && GT.process, Yw = function() {
try {
var t = Hd && Hd.require && Hd.require("util").types;
return t || Av && Av.binding && Av.binding("util");
} catch {
}
}(), Kw = Yw && Yw.isTypedArray, QT = Kw ? PN(Kw) : kN, ON = Object.prototype, DN = ON.hasOwnProperty;
function IN(t, e) {
var r = Gn(t), i = !r && K1(t), n = !r && !i && cy(t), a = !r && !i && !n && QT(t), o = r || i || n || a, s = o ? QI(t.length, String) : [], c = s.length;
for (var l in t)
DN.call(t, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
(l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
n && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
X1(l, c))) && s.push(l);
return s;
}
function NN(t, e) {
return function(r) {
return t(e(r));
};
}
var BN = NN(Object.keys, Object), FN = Object.prototype, zN = FN.hasOwnProperty;
function $N(t) {
if (!JI(t))
return BN(t);
var e = [];
for (var r in Object(t))
zN.call(t, r) && r != "constructor" && e.push(r);
return e;
}
function eC(t) {
return YI(t) ? IN(t) : $N(t);
}
var VN = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, UN = /^\w*$/;
function J1(t, e) {
if (Gn(t))
return !1;
var r = typeof t;
return r == "number" || r == "symbol" || r == "boolean" || t == null || dg(t) ? !0 : UN.test(t) || !VN.test(t) || e != null && t in Object(e);
}
var sh = Fl(Object, "create");
function jN() {
this.__data__ = sh ? sh(null) : {}, this.size = 0;
}
function HN(t) {
var e = this.has(t) && delete this.__data__[t];
return this.size -= e ? 1 : 0, e;
}
var GN = "__lodash_hash_undefined__", WN = Object.prototype, qN = WN.hasOwnProperty;
function XN(t) {
var e = this.__data__;
if (sh) {
var r = e[t];
return r === GN ? void 0 : r;
}
return qN.call(e, t) ? e[t] : void 0;
}
var ZN = Object.prototype, YN = ZN.hasOwnProperty;
function KN(t) {
var e = this.__data__;
return sh ? e[t] !== void 0 : YN.call(e, t);
}
var JN = "__lodash_hash_undefined__";
function QN(t, e) {
var r = this.__data__;
return this.size += this.has(t) ? 0 : 1, r[t] = sh && e === void 0 ? JN : e, this;
}
function yl(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var i = t[e];
this.set(i[0], i[1]);
}
}
yl.prototype.clear = jN;
yl.prototype.delete = HN;
yl.prototype.get = XN;
yl.prototype.has = KN;
yl.prototype.set = QN;
function e4() {
this.__data__ = [], this.size = 0;
}
function hg(t, e) {
for (var r = t.length; r--; )
if (Z1(t[r][0], e))
return r;
return -1;
}
var t4 = Array.prototype, r4 = t4.splice;
function i4(t) {
var e = this.__data__, r = hg(e, t);
if (r < 0)
return !1;
var i = e.length - 1;
return r == i ? e.pop() : r4.call(e, r, 1), --this.size, !0;
}
function n4(t) {
var e = this.__data__, r = hg(e, t);
return r < 0 ? void 0 : e[r][1];
}
function a4(t) {
return hg(this.__data__, t) > -1;
}
function o4(t, e) {
var r = this.__data__, i = hg(r, t);
return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this;
}
function uo(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var i = t[e];
this.set(i[0], i[1]);
}
}
uo.prototype.clear = e4;
uo.prototype.delete = i4;
uo.prototype.get = n4;
uo.prototype.has = a4;
uo.prototype.set = o4;
var lh = Fl(Ma, "Map");
function s4() {
this.size = 0, this.__data__ = {
hash: new yl(),
map: new (lh || uo)(),
string: new yl()
};
}
function l4(t) {
var e = typeof t;
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
}
function pg(t, e) {
var r = t.__data__;
return l4(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
function c4(t) {
var e = pg(this, t).delete(t);
return this.size -= e ? 1 : 0, e;
}
function u4(t) {
return pg(this, t).get(t);
}
function d4(t) {
return pg(this, t).has(t);
}
function h4(t, e) {
var r = pg(this, t), i = r.size;
return r.set(t, e), this.size += r.size == i ? 0 : 1, this;
}
function ho(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var i = t[e];
this.set(i[0], i[1]);
}
}
ho.prototype.clear = s4;
ho.prototype.delete = c4;
ho.prototype.get = u4;
ho.prototype.has = d4;
ho.prototype.set = h4;
var p4 = "Expected a function";
function Q1(t, e) {
if (typeof t != "function" || e != null && typeof e != "function")
throw new TypeError(p4);
var r = function() {
var i = arguments, n = e ? e.apply(this, i) : i[0], a = r.cache;
if (a.has(n))
return a.get(n);
var o = t.apply(this, i);
return r.cache = a.set(n, o) || a, o;
};
return r.cache = new (Q1.Cache || ho)(), r;
}
Q1.Cache = ho;
var f4 = 500;
function m4(t) {
var e = Q1(t, function(i) {
return r.size === f4 && r.clear(), i;
}), r = e.cache;
return e;
}
var g4 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, v4 = /\\(\\)?/g, y4 = m4(function(t) {
var e = [];
return t.charCodeAt(0) === 46 && e.push(""), t.replace(g4, function(r, i, n, a) {
e.push(n ? a.replace(v4, "$1") : i || r);
}), e;
});
function b4(t) {
return t == null ? "" : qT(t);
}
function fg(t, e) {
return Gn(t) ? t : J1(t, e) ? [t] : y4(b4(t));
}
var x4 = 1 / 0;
function Wh(t) {
if (typeof t == "string" || dg(t))
return t;
var e = t + "";
return e == "0" && 1 / t == -x4 ? "-0" : e;
}
function eb(t, e) {
e = fg(e, t);
for (var r = 0, i = e.length; t != null && r < i; )
t = t[Wh(e[r++])];
return r && r == i ? t : void 0;
}
function ja(t, e, r) {
var i = t == null ? void 0 : eb(t, e);
return i === void 0 ? r : i;
}
function tC(t, e) {
for (var r = -1, i = e.length, n = t.length; ++r < i; )
t[n + r] = e[r];
return t;
}
var Jw = ga ? ga.isConcatSpreadable : void 0;
function w4(t) {
return Gn(t) || K1(t) || !!(Jw && t && t[Jw]);
}
function _4(t, e, r, i, n) {
var a = -1, o = t.length;
for (r || (r = w4), n || (n = []); ++a < o; ) {
var s = t[a];
r(s) ? tC(n, s) : n[n.length] = s;
}
return n;
}
function S4(t) {
var e = t == null ? 0 : t.length;
return e ? _4(t) : [];
}
function M4(t) {
return $I(XI(t, void 0, S4), t + "");
}
function qo() {
if (!arguments.length)
return [];
var t = arguments[0];
return Gn(t) ? t : [t];
}
function E4() {
this.__data__ = new uo(), this.size = 0;
}
function T4(t) {
var e = this.__data__, r = e.delete(t);
return this.size = e.size, r;
}
function C4(t) {
return this.__data__.get(t);
}
function A4(t) {
return this.__data__.has(t);
}
var L4 = 200;
function k4(t, e) {
var r = this.__data__;
if (r instanceof uo) {
var i = r.__data__;
if (!lh || i.length < L4 - 1)
return i.push([t, e]), this.size = ++r.size, this;
r = this.__data__ = new ho(i);
}
return r.set(t, e), this.size = r.size, this;
}
function Za(t) {
var e = this.__data__ = new uo(t);
this.size = e.size;
}
Za.prototype.clear = E4;
Za.prototype.delete = T4;
Za.prototype.get = C4;
Za.prototype.has = A4;
Za.prototype.set = k4;
function P4(t, e) {
for (var r = -1, i = t == null ? 0 : t.length, n = 0, a = []; ++r < i; ) {
var o = t[r];
e(o, r, t) && (a[n++] = o);
}
return a;
}
function R4() {
return [];
}
var O4 = Object.prototype, D4 = O4.propertyIsEnumerable, Qw = Object.getOwnPropertySymbols, I4 = Qw ? function(t) {
return t == null ? [] : (t = Object(t), P4(Qw(t), function(e) {
return D4.call(t, e);
}));
} : R4;
function N4(t, e, r) {
var i = e(t);
return Gn(t) ? i : tC(i, r(t));
}
function e2(t) {
return N4(t, eC, I4);
}
var uy = Fl(Ma, "DataView"), dy = Fl(Ma, "Promise"), hy = Fl(Ma, "Set"), t2 = "[object Map]", B4 = "[object Object]", r2 = "[object Promise]", i2 = "[object Set]", n2 = "[object WeakMap]", a2 = "[object DataView]", F4 = Bl(uy), z4 = Bl(lh), $4 = Bl(dy), V4 = Bl(hy), U4 = Bl(ly), Ho = Ou;
(uy && Ho(new uy(new ArrayBuffer(1))) != a2 || lh && Ho(new lh()) != t2 || dy && Ho(dy.resolve()) != r2 || hy && Ho(new hy()) != i2 || ly && Ho(new ly()) != n2) && (Ho = function(t) {
var e = Ou(t), r = e == B4 ? t.constructor : void 0, i = r ? Bl(r) : "";
if (i)
switch (i) {
case F4:
return a2;
case z4:
return t2;
case $4:
return r2;
case V4:
return i2;
case U4:
return n2;
}
return e;
});
var o2 = Ma.Uint8Array, j4 = "__lodash_hash_undefined__";
function H4(t) {
return this.__data__.set(t, j4), this;
}
function G4(t) {
return this.__data__.has(t);
}
function Em(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.__data__ = new ho(); ++e < r; )
this.add(t[e]);
}
Em.prototype.add = Em.prototype.push = H4;
Em.prototype.has = G4;
function W4(t, e) {
for (var r = -1, i = t == null ? 0 : t.length; ++r < i; )
if (e(t[r], r, t))
return !0;
return !1;
}
function q4(t, e) {
return t.has(e);
}
var X4 = 1, Z4 = 2;
function rC(t, e, r, i, n, a) {
var o = r & X4, s = t.length, c = e.length;
if (s != c && !(o && c > s))
return !1;
var l = a.get(t), u = a.get(e);
if (l && u)
return l == e && u == t;
var d = -1, h = !0, f = r & Z4 ? new Em() : void 0;
for (a.set(t, e), a.set(e, t); ++d < s; ) {
var p = t[d], m = e[d];
if (i)
var y = o ? i(m, p, d, e, t, a) : i(p, m, d, t, e, a);
if (y !== void 0) {
if (y)
continue;
h = !1;
break;
}
if (f) {
if (!W4(e, function(g, v) {
if (!q4(f, v) && (p === g || n(p, g, r, i, a)))
return f.push(v);
})) {
h = !1;
break;
}
} else if (!(p === m || n(p, m, r, i, a))) {
h = !1;
break;
}
}
return a.delete(t), a.delete(e), h;
}
function Y4(t) {
var e = -1, r = Array(t.size);
return t.forEach(function(i, n) {
r[++e] = [n, i];
}), r;
}
function K4(t) {
var e = -1, r = Array(t.size);
return t.forEach(function(i) {
r[++e] = i;
}), r;
}
var J4 = 1, Q4 = 2, e5 = "[object Boolean]", t5 = "[object Date]", r5 = "[object Error]", i5 = "[object Map]", n5 = "[object Number]", a5 = "[object RegExp]", o5 = "[object Set]", s5 = "[object String]", l5 = "[object Symbol]", c5 = "[object ArrayBuffer]", u5 = "[object DataView]", s2 = ga ? ga.prototype : void 0, Lv = s2 ? s2.valueOf : void 0;
function d5(t, e, r, i, n, a, o) {
switch (r) {
case u5:
if (t.byteLength != e.byteLength || t.byteOffset != e.byteOffset)
return !1;
t = t.buffer, e = e.buffer;
case c5:
return !(t.byteLength != e.byteLength || !a(new o2(t), new o2(e)));
case e5:
case t5:
case n5:
return Z1(+t, +e);
case r5:
return t.name == e.name && t.message == e.message;
case a5:
case s5:
return t == e + "";
case i5:
var s = Y4;
case o5:
var c = i & J4;
if (s || (s = K4), t.size != e.size && !c)
return !1;
var l = o.get(t);
if (l)
return l == e;
i |= Q4, o.set(t, e);
var u = rC(s(t), s(e), i, n, a, o);
return o.delete(t), u;
case l5:
if (Lv)
return Lv.call(t) == Lv.call(e);
}
return !1;
}
var h5 = 1, p5 = Object.prototype, f5 = p5.hasOwnProperty;
function m5(t, e, r, i, n, a) {
var o = r & h5, s = e2(t), c = s.length, l = e2(e), u = l.length;
if (c != u && !o)
return !1;
for (var d = c; d--; ) {
var h = s[d];
if (!(o ? h in e : f5.call(e, h)))
return !1;
}
var f = a.get(t), p = a.get(e);
if (f && p)
return f == e && p == t;
var m = !0;
a.set(t, e), a.set(e, t);
for (var y = o; ++d < c; ) {
h = s[d];
var g = t[h], v = e[h];
if (i)
var x = o ? i(v, g, h, e, t, a) : i(g, v, h, t, e, a);
if (!(x === void 0 ? g === v || n(g, v, r, i, a) : x)) {
m = !1;
break;
}
y || (y = h == "constructor");
}
if (m && !y) {
var w = t.constructor, S = e.constructor;
w != S && "constructor" in t && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof S == "function" && S instanceof S) && (m = !1);
}
return a.delete(t), a.delete(e), m;
}
var g5 = 1, l2 = "[object Arguments]", c2 = "[object Array]", Rp = "[object Object]", v5 = Object.prototype, u2 = v5.hasOwnProperty;
function y5(t, e, r, i, n, a) {
var o = Gn(t), s = Gn(e), c = o ? c2 : Ho(t), l = s ? c2 : Ho(e);
c = c == l2 ? Rp : c, l = l == l2 ? Rp : l;
var u = c == Rp, d = l == Rp, h = c == l;
if (h && cy(t)) {
if (!cy(e))
return !1;
o = !0, u = !1;
}
if (h && !u)
return a || (a = new Za()), o || QT(t) ? rC(t, e, r, i, n, a) : d5(t, e, c, r, i, n, a);
if (!(r & g5)) {
var f = u && u2.call(t, "__wrapped__"), p = d && u2.call(e, "__wrapped__");
if (f || p) {
var m = f ? t.value() : t, y = p ? e.value() : e;
return a || (a = new Za()), n(m, y, r, i, a);
}
}
return h ? (a || (a = new Za()), m5(t, e, r, i, n, a)) : !1;
}
function mg(t, e, r, i, n) {
return t === e ? !0 : t == null || e == null || !Xc(t) && !Xc(e) ? t !== t && e !== e : y5(t, e, r, i, mg, n);
}
var b5 = 1, x5 = 2;
function w5(t, e, r, i) {
var n = r.length, a = n;
if (t == null)
return !a;
for (t = Object(t); n--; ) {
var o = r[n];
if (o[2] ? o[1] !== t[o[0]] : !(o[0] in t))
return !1;
}
for (; ++n < a; ) {
o = r[n];
var s = o[0], c = t[s], l = o[1];
if (o[2]) {
if (c === void 0 && !(s in t))
return !1;
} else {
var u = new Za(), d;
if (!(d === void 0 ? mg(l, c, b5 | x5, i, u) : d))
return !1;
}
}
return !0;
}
function iC(t) {
return t === t && !ls(t);
}
function _5(t) {
for (var e = eC(t), r = e.length; r--; ) {
var i = e[r], n = t[i];
e[r] = [i, n, iC(n)];
}
return e;
}
function nC(t, e) {
return function(r) {
return r == null ? !1 : r[t] === e && (e !== void 0 || t in Object(r));
};
}
function S5(t) {
var e = _5(t);
return e.length == 1 && e[0][2] ? nC(e[0][0], e[0][1]) : function(r) {
return r === t || w5(r, t, e);
};
}
function M5(t, e) {
return t != null && e in Object(t);
}
function E5(t, e, r) {
e = fg(e, t);
for (var i = -1, n = e.length, a = !1; ++i < n; ) {
var o = Wh(e[i]);
if (!(a = t != null && r(t, o)))
break;
t = t[o];
}
return a || ++i != n ? a : (n = t == null ? 0 : t.length, !!n && Y1(n) && X1(o, n) && (Gn(t) || K1(t)));
}
function aC(t, e) {
return t != null && E5(t, e, M5);
}
var T5 = 1, C5 = 2;
function A5(t, e) {
return J1(t) && iC(e) ? nC(Wh(t), e) : function(r) {
var i = ja(r, t);
return i === void 0 && i === e ? aC(r, t) : mg(e, i, T5 | C5);
};
}
function L5(t) {
return function(e) {
return e == null ? void 0 : e[t];
};
}
function k5(t) {
return function(e) {
return eb(e, t);
};
}
function P5(t) {
return J1(t) ? L5(Wh(t)) : k5(t);
}
function R5(t) {
return typeof t == "function" ? t : t == null ? XT : typeof t == "object" ? Gn(t) ? A5(t[0], t[1]) : S5(t) : P5(t);
}
var kv = function() {
return Ma.Date.now();
}, O5 = "Expected a function", D5 = Math.max, I5 = Math.min;
function oC(t, e, r) {
var i, n, a, o, s, c, l = 0, u = !1, d = !1, h = !0;
if (typeof t != "function")
throw new TypeError(O5);
e = Hw(e) || 0, ls(r) && (u = !!r.leading, d = "maxWait" in r, a = d ? D5(Hw(r.maxWait) || 0, e) : a, h = "trailing" in r ? !!r.trailing : h);
function f(_) {
var b = i, T = n;
return i = n = void 0, l = _, o = t.apply(T, b), o;
}
function p(_) {
return l = _, s = setTimeout(g, e), u ? f(_) : o;
}
function m(_) {
var b = _ - c, T = _ - l, E = e - b;
return d ? I5(E, a - T) : E;
}
function y(_) {
var b = _ - c, T = _ - l;
return c === void 0 || b >= e || b < 0 || d && T >= a;
}
function g() {
var _ = kv();
if (y(_))
return v(_);
s = setTimeout(g, m(_));
}
function v(_) {
return s = void 0, h && i ? f(_) : (i = n = void 0, o);
}
function x() {
s !== void 0 && clearTimeout(s), l = 0, i = c = n = s = void 0;
}
function w() {
return s === void 0 ? o : v(kv());
}
function S() {
var _ = kv(), b = y(_);
if (i = arguments, n = this, c = _, b) {
if (s === void 0)
return p(c);
if (d)
return clearTimeout(s), s = setTimeout(g, e), f(c);
}
return s === void 0 && (s = setTimeout(g, e)), o;
}
return S.cancel = x, S.flush = w, S;
}
function N5(t, e, r) {
var i = t == null ? 0 : t.length;
if (!i)
return -1;
var n = i - 1;
return VI(t, R5(e), n);
}
function Tm(t) {
for (var e = -1, r = t == null ? 0 : t.length, i = {}; ++e < r; ) {
var n = t[e];
i[n[0]] = n[1];
}
return i;
}
function Cm(t, e) {
return mg(t, e);
}
function ts(t) {
return t == null;
}
function B5(t) {
return t === void 0;
}
function F5(t, e, r, i) {
if (!ls(t))
return t;
e = fg(e, t);
for (var n = -1, a = e.length, o = a - 1, s = t; s != null && ++n < a; ) {
var c = Wh(e[n]), l = r;
if (c === "__proto__" || c === "constructor" || c === "prototype")
return t;
if (n != o) {
var u = s[c];
l = void 0, l === void 0 && (l = ls(u) ? u : X1(e[n + 1]) ? [] : {});
}
qI(s, c, l), s = s[c];
}
return t;
}
function z5(t, e, r) {
for (var i = -1, n = e.length, a = {}; ++i < n; ) {
var o = e[i], s = eb(t, o);
r(s, o) && F5(a, fg(o, t), s);
}
return a;
}
function $5(t, e) {
return z5(t, e, function(r, i) {
return aC(t, i);
});
}
var sC = M4(function(t, e) {
return t == null ? {} : $5(t, e);
});
const Yo = (t) => t === void 0, Zc = (t) => typeof t == "boolean", hi = (t) => typeof t == "number", ol = (t) => typeof Element > "u" ? !1 : t instanceof Element, Am = (t) => ts(t), V5 = (t) => Ei(t) ? !Number.isNaN(Number(t)) : !1, U5 = (t = "") => t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"), d2 = (t) => Object.keys(t);
let lC = class extends Error {
constructor(e) {
super(e), this.name = "ElementPlusError";
}
};
function j5(t, e) {
throw new lC(`[${t}] ${e}`);
}
function Vr(t, e) {
if (process.env.NODE_ENV !== "production") {
const r = Ei(t) ? new lC(`[${t}] ${e}`) : t;
console.warn(r);
}
}
const H5 = "utils/dom/style", cC = (t = "") => t.split(" ").filter((e) => !!e.trim()), py = (t, e) => {
!t || !e.trim() || t.classList.add(...cC(e));
}, sl = (t, e) => {
!t || !e.trim() || t.classList.remove(...cC(e));
}, cd = (t, e) => {
var r;
if (!$r || !t || !e)
return "";
let i = XD(e);
i === "float" && (i = "cssFloat");
try {
const n = t.style[i];
if (n)
return n;
const a = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t, "");
return a ? a[i] : "";
} catch {
return t.style[i];
}
};
function Yc(t, e = "px") {
if (!t)
return "";
if (hi(t) || V5(t))
return `${t}${e}`;
if (Ei(t))
return t;
Vr(H5, "binding value must be a string or number");
}
function G5(t, e) {
if (!$r)
return;
if (!e) {
t.scrollTop = 0;
return;
}
const r = [];
let i = e.offsetParent;
for (; i !== null && t !== i && t.contains(i); )
r.push(i), i = i.offsetParent;
const n = e.offsetTop + r.reduce((c, l) => c + l.offsetTop, 0), a = n + e.offsetHeight, o = t.scrollTop, s = o + t.clientHeight;
n < o ? t.scrollTop = n : a > s && (t.scrollTop = a - t.clientHeight);
}
/*! Element Plus Icons Vue v2.3.1 */
var W5 = /* @__PURE__ */ Le({
name: "ArrowDown",
__name: "arrow-down",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
})
]));
}
}), gg = W5, q5 = /* @__PURE__ */ Le({
name: "ArrowUp",
__name: "arrow-up",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
})
]));
}
}), uC = q5, X5 = /* @__PURE__ */ Le({
name: "CaretRight",
__name: "caret-right",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("path", {
fill: "currentColor",
d: "M384 192v640l384-320.064z"
})
]));
}
}), Z5 = X5, Y5 = /* @__PURE__ */ Le({
name: "CircleCheck",
__name: "circle-check",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
}),
Ee("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"
})
]));
}
}), K5 = Y5, J5 = /* @__PURE__ */ Le({
name: "CircleClose",
__name: "circle-close",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
}),
Ee("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"
})
]));
}
}), tb = J5, Q5 = /* @__PURE__ */ Le({
name: "Close",
__name: "close",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
})
]));
}
}), Lm = Q5, eB = /* @__PURE__ */ Le({
name: "Delete",
__name: "delete",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
})
]));
}
}), tB = eB, rB = /* @__PURE__ */ Le({
name: "Edit",
__name: "edit",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
}),
Ee("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"
})
]));
}
}), iB = rB, nB = /* @__PURE__ */ Le({
name: "Finished",
__name: "finished",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
})
]));
}
}), aB = nB, oB = /* @__PURE__ */ Le({
name: "Hide",
__name: "hide",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
}),
Ee("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"
})
]));
}
}), sB = oB, lB = /* @__PURE__ */ Le({
name: "Loading",
__name: "loading",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
})
]));
}
}), rb = lB, cB = /* @__PURE__ */ Le({
name: "Notebook",
__name: "notebook",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("path", {
fill: "currentColor",
d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32"
}),
Ee("path", {
fill: "currentColor",
d: "M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32"
})
]));
}
}), uB = cB, dB = /* @__PURE__ */ Le({
name: "View",
__name: "view",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
})
]));
}
}), hB = dB, pB = /* @__PURE__ */ Le({
name: "Warning",
__name: "warning",
setup(t) {
return (e, r) => (Q(), be("svg", {
xmlns: "http://www.w3.org/2000/svg",
viewBox: "0 0 1024 1024"
}, [
Ee("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"
})
]));
}
}), fB = pB;
const dC = "__epPropKey", vt = (t) => t, mB = (t) => di(t) && !!t[dC], vg = (t, e) => {
if (!di(t) || mB(t))
return t;
const { values: r, required: i, default: n, type: a, validator: o } = t, s = {
type: a,
required: !!i,
validator: r || o ? (c) => {
let l = !1, u = [];
if (r && (u = Array.from(r), vl(t, "default") && u.push(n), l || (l = u.includes(c))), o && (l || (l = o(c))), !l && u.length > 0) {
const d = [...new Set(u)].map((h) => JSON.stringify(h)).join(", ");
DT(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${d}], got value ${JSON.stringify(c)}.`);
}
return l;
} : void 0,
[dC]: !0
};
return vl(t, "default") && (s.default = n), s;
}, Kt = (t) => Tm(Object.entries(t).map(([e, r]) => [
e,
vg(r, e)
])), cs = vt([
String,
Object,
Function
]), hC = {
validating: rb,
success: K5,
error: tb
}, ni = (t, e) => {
if (t.install = (r) => {
for (const i of [t, ...Object.values(e ?? {})])
r.component(i.name, i);
}, e)
for (const [r, i] of Object.entries(e))
t[r] = i;
return t;
}, gB = (t, e) => (t.install = (r) => {
r.directive(e, t);
}, t), po = (t) => (t.install = oh, t), Gr = {
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"
}, ui = "update:modelValue", ib = "change", pC = ["", "default", "small", "large"], vB = (t) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t), Lc = (t) => t, yB = ["class", "style"], bB = /^on[A-Z]/, xB = (t = {}) => {
const { excludeListeners: e = !1, excludeKeys: r } = t, i = ee(() => ((r == null ? void 0 : r.value) || []).concat(yB)), n = Ct();
return n ? ee(() => {
var a;
return Tm(Object.entries((a = n.proxy) == null ? void 0 : a.$attrs).filter(([o]) => !i.value.includes(o) && !(e && bB.test(o))));
}) : (Vr("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), ee(() => ({})));
}, tm = ({ from: t, replacement: e, scope: r, version: i, ref: n, type: a = "API" }, o) => {
ze(() => N(o), (s) => {
s && Vr(r, `[${a}] ${t} is about to be deprecated in version ${i}, please use ${e} instead.
For more detail, please visit: ${n}
`);
}, {
immediate: !0
});
};
var wB = {
name: "en",
el: {
breadcrumb: {
label: "Breadcrumb"
},
colorpicker: {
confirm: "OK",
clear: "Clear",
defaultLabel: "color picker",
description: "current color is {color}. press enter to select a new color.",
alphaLabel: "pick alpha value"
},
datepicker: {
now: "Now",
today: "Today",
cancel: "Cancel",
clear: "Clear",
confirm: "OK",
dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
monthTablePrompt: "Use the arrow keys and enter to select the month",
yearTablePrompt: "Use the arrow keys and enter to select the year",
selectedDate: "Selected date",
selectDate: "Select date",
selectTime: "Select time",
startDate: "Start Date",
startTime: "Start Time",
endDate: "End Date",
endTime: "End Time",
prevYear: "Previous Year",
nextYear: "Next Year",
prevMonth: "Previous Month",
nextMonth: "Next Month",
year: "",
month1: "January",
month2: "February",
month3: "March",
month4: "April",
month5: "May",
month6: "June",
month7: "July",
month8: "August",
month9: "September",
month10: "October",
month11: "November",
month12: "December",
week: "week",
weeks: {
sun: "Sun",
mon: "Mon",
tue: "Tue",
wed: "Wed",
thu: "Thu",
fri: "Fri",
sat: "Sat"
},
weeksFull: {
sun: "Sunday",
mon: "Monday",
tue: "Tuesday",
wed: "Wednesday",
thu: "Thursday",
fri: "Friday",
sat: "Saturday"
},
months: {
jan: "Jan",
feb: "Feb",
mar: "Mar",
apr: "Apr",
may: "May",
jun: "Jun",
jul: "Jul",
aug: "Aug",
sep: "Sep",
oct: "Oct",
nov: "Nov",
dec: "Dec"
}
},
inputNumber: {
decrease: "decrease number",
increase: "increase number"
},
select: {
loading: "Loading",
noMatch: "No matching data",
noData: "No data",
placeholder: "Select"
},
mention: {
loading: "Loading"
},
dropdown: {
toggleDropdown: "Toggle Dropdown"
},
cascader: {
noMatch: "No matching data",
loading: "Loading",
placeholder: "Select",
noData: "No data"
},
pagination: {
goto: "Go to",
pagesize: "/page",
total: "Total {total}",
pageClassifier: "",
page: "Page",
prev: "Go to previous page",
next: "Go to next page",
currentPage: "page {pager}",
prevPages: "Previous {pager} pages",
nextPages: "Next {pager} pages",
deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
},
dialog: {
close: "Close this dialog"
},
drawer: {
close: "Close this dialog"
},
messagebox: {
title: "Message",
confirm: "OK",
cancel: "Cancel",
error: "Illegal input",
close: "Close this dialog"
},
upload: {
deleteTip: "press delete to remove",
delete: "Delete",
preview: "Preview",
continue: "Continue"
},
slider: {
defaultLabel: "slider between {min} and {max}",
defaultRangeStartLabel: "pick start value",
defaultRangeEndLabel: "pick end value"
},
table: {
emptyText: "No Data",
confirmFilter: "Confirm",
resetFilter: "Reset",
clearFilter: "All",
sumText: "Sum"
},
tour: {
next: "Next",
previous: "Previous",
finish: "Finish"
},
tree: {
emptyText: "No Data"
},
transfer: {
noMatch: "No matching data",
noData: "No data",
titles: ["List 1", "List 2"],
filterPlaceholder: "Enter keyword",
noCheckedFormat: "{total} items",
hasCheckedFormat: "{checked}/{total} checked"
},
image: {
error: "FAILED"
},
pageHeader: {
title: "Back"
},
popconfirm: {
confirmButtonText: "Yes",
cancelButtonText: "No"
},
carousel: {
leftArrow: "Carousel arrow left",
rightArrow: "Carousel arrow right",
indicator: "Carousel switch to index {index}"
}
}
};
const _B = (t) => (e, r) => SB(e, r, N(t)), SB = (t, e, r) => ja(r, t, t).replace(/\{(\w+)\}/g, (i, n) => {
var a;
return `${(a = e == null ? void 0 : e[n]) != null ? a : `{${n}}`}`;
}), MB = (t) => {
const e = ee(() => N(t).name), r = cn(t) ? t : we(t);
return {
lang: e,
locale: r,
t: _B(t)
};
}, fC = Symbol("localeContextKey"), qh = (t) => {
const e = t || Ye(fC, we());
return MB(ee(() => e.value || wB));
}, rm = "el", EB = "is-", Bs = (t, e, r, i, n) => {
let a = `${t}-${e}`;
return r && (a += `-${r}`), i && (a += `__${i}`), n && (a += `--${n}`), a;
}, mC = Symbol("namespaceContextKey"), nb = (t) => {
const e = t || (Ct() ? Ye(mC, we(rm)) : we(rm));
return ee(() => N(e) || rm);
}, Et = (t, e) => {
const r = nb(e);
return {
namespace: r,
b: (i = "") => Bs(r.value, t, i, "", ""),
e: (i) => i ? Bs(r.value, t, "", i, "") : "",
m: (i) => i ? Bs(r.value, t, "", "", i) : "",
be: (i, n) => i && n ? Bs(r.value, t, i, n, "") : "",
em: (i, n) => i && n ? Bs(r.value, t, "", i, n) : "",
bm: (i, n) => i && n ? Bs(r.value, t, i, "", n) : "",
bem: (i, n, a) => i && n && a ? Bs(r.value, t, i, n, a) : "",
is: (i, ...n) => {
const a = n.length >= 1 ? n[0] : !0;
return i && a ? `${EB}${i}` : "";
},
cssVar: (i) => {
const n = {};
for (const a in i)
i[a] && (n[`--${r.value}-${a}`] = i[a]);
return n;
},
cssVarName: (i) => `--${r.value}-${i}`,
cssVarBlock: (i) => {
const n = {};
for (const a in i)
i[a] && (n[`--${r.value}-${t}-${a}`] = i[a]);
return n;
},
cssVarBlockName: (i) => `--${r.value}-${t}-${i}`
};
}, TB = vg({
type: vt(Boolean),
default: null
}), CB = vg({
type: vt(Function)
}), AB = (t) => {
const e = `update:${t}`, r = `onUpdate:${t}`, i = [e], n = {
[t]: TB,
[r]: CB
};
return {
useModelToggle: ({
indicator: a,
toggleReason: o,
shouldHideWhenRouteChanges: s,
shouldProceed: c,
onShow: l,
onHide: u
}) => {
const d = Ct(), { emit: h } = d, f = d.props, p = ee(() => Di(f[r])), m = ee(() => f[t] === null), y = (_) => {
a.value !== !0 && (a.value = !0, o && (o.value = _), Di(l) && l(_));
}, g = (_) => {
a.value !== !1 && (a.value = !1, o && (o.value = _), Di(u) && u(_));
}, v = (_) => {
if (f.disabled === !0 || Di(c) && !c())
return;
const b = p.value && $r;
b && h(e, !0), (m.value || !b) && y(_);
}, x = (_) => {
if (f.disabled === !0 || !$r)
return;
const b = p.value && $r;
b && h(e, !1), (m.value || !b) && g(_);
}, w = (_) => {
Zc(_) && (f.disabled && _ ? p.value && h(e, !1) : a.value !== _ && (_ ? y() : g()));
}, S = () => {
a.value ? x() : v();
};
return ze(() => f[t], w), s && d.appContext.config.globalProperties.$route !== void 0 && ze(() => ({
...d.proxy.$route
}), () => {
s.value && a.value && x();
}), Lt(() => {
w(f[t]);
}), {
hide: x,
show: v,
toggle: S,
hasUpdateHandler: p
};
},
useModelToggleProps: n,
useModelToggleEmits: i
};
}, gC = (t) => {
const e = Ct();
return ee(() => {
var r, i;
return (i = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : i[t];
});
};
var Gi = "top", Mn = "bottom", En = "right", Wi = "left", ab = "auto", Xh = [Gi, Mn, En, Wi], Kc = "start", ch = "end", LB = "clippingParents", vC = "viewport", ud = "popper", kB = "reference", h2 = Xh.reduce(function(t, e) {
return t.concat([e + "-" + Kc, e + "-" + ch]);
}, []), yg = [].concat(Xh, [ab]).reduce(function(t, e) {
return t.concat([e, e + "-" + Kc, e + "-" + ch]);
}, []), PB = "beforeRead", RB = "read", OB = "afterRead", DB = "beforeMain", IB = "main", NB = "afterMain", BB = "beforeWrite", FB = "write", zB = "afterWrite", $B = [PB, RB, OB, DB, IB, NB, BB, FB, zB];
function va(t) {
return t ? (t.nodeName || "").toLowerCase() : null;
}
function Yn(t) {
if (t == null) return window;
if (t.toString() !== "[object Window]") {
var e = t.ownerDocument;
return e && e.defaultView || window;
}
return t;
}
function Jc(t) {
var e = Yn(t).Element;
return t instanceof e || t instanceof Element;
}
function _n(t) {
var e = Yn(t).HTMLElement;
return t instanceof e || t instanceof HTMLElement;
}
function ob(t) {
if (typeof ShadowRoot > "u") return !1;
var e = Yn(t).ShadowRoot;
return t instanceof e || t instanceof ShadowRoot;
}
function VB(t) {
var e = t.state;
Object.keys(e.elements).forEach(function(r) {
var i = e.styles[r] || {}, n = e.attributes[r] || {}, a = e.elements[r];
!_n(a) || !va(a) || (Object.assign(a.style, i), Object.keys(n).forEach(function(o) {
var s = n[o];
s === !1 ? a.removeAttribute(o) : a.setAttribute(o, s === !0 ? "" : s);
}));
});
}
function UB(t) {
var e = t.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(i) {
var n = e.elements[i], a = e.attributes[i] || {}, o = Object.keys(e.styles.hasOwnProperty(i) ? e.styles[i] : r[i]), s = o.reduce(function(c, l) {
return c[l] = "", c;
}, {});
!_n(n) || !va(n) || (Object.assign(n.style, s), Object.keys(a).forEach(function(c) {
n.removeAttribute(c);
}));
});
};
}
var yC = { name: "applyStyles", enabled: !0, phase: "write", fn: VB, effect: UB, requires: ["computeStyles"] };
function ha(t) {
return t.split("-")[0];
}
var ll = Math.max, km = Math.min, Qc = Math.round;
function eu(t, e) {
e === void 0 && (e = !1);
var r = t.getBoundingClientRect(), i = 1, n = 1;
if (_n(t) && e) {
var a = t.offsetHeight, o = t.offsetWidth;
o > 0 && (i = Qc(r.width) / o || 1), a > 0 && (n = Qc(r.height) / a || 1);
}
return { width: r.width / i, height: r.height / n, top: r.top / n, right: r.right / i, bottom: r.bottom / n, left: r.left / i, x: r.left / i, y: r.top / n };
}
function sb(t) {
var e = eu(t), r = t.offsetWidth, i = t.offsetHeight;
return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - i) <= 1 && (i = e.height), { x: t.offsetLeft, y: t.offsetTop, width: r, height: i };
}
function bC(t, e) {
var r = e.getRootNode && e.getRootNode();
if (t.contains(e)) return !0;
if (r && ob(r)) {
var i = e;
do {
if (i && t.isSameNode(i)) return !0;
i = i.parentNode || i.host;
} while (i);
}
return !1;
}
function to(t) {
return Yn(t).getComputedStyle(t);
}
function jB(t) {
return ["table", "td", "th"].indexOf(va(t)) >= 0;
}
function Es(t) {
return ((Jc(t) ? t.ownerDocument : t.document) || window.document).documentElement;
}
function bg(t) {
return va(t) === "html" ? t : t.assignedSlot || t.parentNode || (ob(t) ? t.host : null) || Es(t);
}
function p2(t) {
return !_n(t) || to(t).position === "fixed" ? null : t.offsetParent;
}
function HB(t) {
var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1;
if (r && _n(t)) {
var i = to(t);
if (i.position === "fixed") return null;
}
var n = bg(t);
for (ob(n) && (n = n.host); _n(n) && ["html", "body"].indexOf(va(n)) < 0; ) {
var a = to(n);
if (a.transform !== "none" || a.perspective !== "none" || a.contain === "paint" || ["transform", "perspective"].indexOf(a.willChange) !== -1 || e && a.willChange === "filter" || e && a.filter && a.filter !== "none") return n;
n = n.parentNode;
}
return null;
}
function Zh(t) {
for (var e = Yn(t), r = p2(t); r && jB(r) && to(r).position === "static"; ) r = p2(r);
return r && (va(r) === "html" || va(r) === "body" && to(r).position === "static") ? e : r || HB(t) || e;
}
function lb(t) {
return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function Gd(t, e, r) {
return ll(t, km(e, r));
}
function GB(t, e, r) {
var i = Gd(t, e, r);
return i > r ? r : i;
}
function xC() {
return { top: 0, right: 0, bottom: 0, left: 0 };
}
function wC(t) {
return Object.assign({}, xC(), t);
}
function _C(t, e) {
return e.reduce(function(r, i) {
return r[i] = t, r;
}, {});
}
var WB = function(t, e) {
return t = typeof t == "function" ? t(Object.assign({}, e.rects, { placement: e.placement })) : t, wC(typeof t != "number" ? t : _C(t, Xh));
};
function qB(t) {
var e, r = t.state, i = t.name, n = t.options, a = r.elements.arrow, o = r.modifiersData.popperOffsets, s = ha(r.placement), c = lb(s), l = [Wi, En].indexOf(s) >= 0, u = l ? "height" : "width";
if (!(!a || !o)) {
var d = WB(n.padding, r), h = sb(a), f = c === "y" ? Gi : Wi, p = c === "y" ? Mn : En, m = r.rects.reference[u] + r.rects.reference[c] - o[c] - r.rects.popper[u], y = o[c] - r.rects.reference[c], g = Zh(a), v = g ? c === "y" ? g.clientHeight || 0 : g.clientWidth || 0 : 0, x = m / 2 - y / 2, w = d[f], S = v - h[u] - d[p], _ = v / 2 - h[u] / 2 + x, b = Gd(w, _, S), T = c;
r.modifiersData[i] = (e = {}, e[T] = b, e.centerOffset = b - _, e);
}
}
function XB(t) {
var e = t.state, r = t.options, i = r.element, n = i === void 0 ? "[data-popper-arrow]" : i;
n != null && (typeof n == "string" && (n = e.elements.popper.querySelector(n), !n) || !bC(e.elements.popper, n) || (e.elements.arrow = n));
}
var ZB = { name: "arrow", enabled: !0, phase: "main", fn: qB, effect: XB, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
function tu(t) {
return t.split("-")[1];
}
var YB = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
function KB(t) {
var e = t.x, r = t.y, i = window, n = i.devicePixelRatio || 1;
return { x: Qc(e * n) / n || 0, y: Qc(r * n) / n || 0 };
}
function f2(t) {
var e, r = t.popper, i = t.popperRect, n = t.placement, a = t.variation, o = t.offsets, s = t.position, c = t.gpuAcceleration, l = t.adaptive, u = t.roundOffsets, d = t.isFixed, h = o.x, f = h === void 0 ? 0 : h, p = o.y, m = p === void 0 ? 0 : p, y = typeof u == "function" ? u({ x: f, y: m }) : { x: f, y: m };
f = y.x, m = y.y;
var g = o.hasOwnProperty("x"), v = o.hasOwnProperty("y"), x = Wi, w = Gi, S = window;
if (l) {
var _ = Zh(r), b = "clientHeight", T = "clientWidth";
if (_ === Yn(r) && (_ = Es(r), to(_).position !== "static" && s === "absolute" && (b = "scrollHeight", T = "scrollWidth")), _ = _, n === Gi || (n === Wi || n === En) && a === ch) {
w = Mn;
var E = d && _ === S && S.visualViewport ? S.visualViewport.height : _[b];
m -= E - i.height, m *= c ? 1 : -1;
}
if (n === Wi || (n === Gi || n === Mn) && a === ch) {
x = En;
var C = d && _ === S && S.visualViewport ? S.visualViewport.width : _[T];
f -= C - i.width, f *= c ? 1 : -1;
}
}
var L = Object.assign({ position: s }, l && YB), A = u === !0 ? KB({ x: f, y: m }) : { x: f, y: m };
if (f = A.x, m = A.y, c) {
var k;
return Object.assign({}, L, (k = {}, k[w] = v ? "0" : "", k[x] = g ? "0" : "", k.transform = (S.devicePixelRatio || 1) <= 1 ? "translate(" + f + "px, " + m + "px)" : "translate3d(" + f + "px, " + m + "px, 0)", k));
}
return Object.assign({}, L, (e = {}, e[w] = v ? m + "px" : "", e[x] = g ? f + "px" : "", e.transform = "", e));
}
function JB(t) {
var e = t.state, r = t.options, i = r.gpuAcceleration, n = i === void 0 ? !0 : i, a = r.adaptive, o = a === void 0 ? !0 : a, s = r.roundOffsets, c = s === void 0 ? !0 : s, l = { placement: ha(e.placement), variation: tu(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: n, isFixed: e.options.strategy === "fixed" };
e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, f2(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: c })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, f2(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: !1, roundOffsets: c })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
}
var SC = { name: "computeStyles", enabled: !0, phase: "beforeWrite", fn: JB, data: {} }, Op = { passive: !0 };
function QB(t) {
var e = t.state, r = t.instance, i = t.options, n = i.scroll, a = n === void 0 ? !0 : n, o = i.resize, s = o === void 0 ? !0 : o, c = Yn(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper);
return a && l.forEach(function(u) {
u.addEventListener("scroll", r.update, Op);
}), s && c.addEventListener("resize", r.update, Op), function() {
a && l.forEach(function(u) {
u.removeEventListener("scroll", r.update, Op);
}), s && c.removeEventListener("resize", r.update, Op);
};
}
var MC = { name: "eventListeners", enabled: !0, phase: "write", fn: function() {
}, effect: QB, data: {} }, eF = { left: "right", right: "left", bottom: "top", top: "bottom" };
function im(t) {
return t.replace(/left|right|bottom|top/g, function(e) {
return eF[e];
});
}
var tF = { start: "end", end: "start" };
function m2(t) {
return t.replace(/start|end/g, function(e) {
return tF[e];
});
}
function cb(t) {
var e = Yn(t), r = e.pageXOffset, i = e.pageYOffset;
return { scrollLeft: r, scrollTop: i };
}
function ub(t) {
return eu(Es(t)).left + cb(t).scrollLeft;
}
function rF(t) {
var e = Yn(t), r = Es(t), i = e.visualViewport, n = r.clientWidth, a = r.clientHeight, o = 0, s = 0;
return i && (n = i.width, a = i.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = i.offsetLeft, s = i.offsetTop)), { width: n, height: a, x: o + ub(t), y: s };
}
function iF(t) {
var e, r = Es(t), i = cb(t), n = (e = t.ownerDocument) == null ? void 0 : e.body, a = ll(r.scrollWidth, r.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), o = ll(r.scrollHeight, r.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s = -i.scrollLeft + ub(t), c = -i.scrollTop;
return to(n || r).direction === "rtl" && (s += ll(r.clientWidth, n ? n.clientWidth : 0) - a), { width: a, height: o, x: s, y: c };
}
function db(t) {
var e = to(t), r = e.overflow, i = e.overflowX, n = e.overflowY;
return /auto|scroll|overlay|hidden/.test(r + n + i);
}
function EC(t) {
return ["html", "body", "#document"].indexOf(va(t)) >= 0 ? t.ownerDocument.body : _n(t) && db(t) ? t : EC(bg(t));
}
function Wd(t, e) {
var r;
e === void 0 && (e = []);
var i = EC(t), n = i === ((r = t.ownerDocument) == null ? void 0 : r.body), a = Yn(i), o = n ? [a].concat(a.visualViewport || [], db(i) ? i : []) : i, s = e.concat(o);
return n ? s : s.concat(Wd(bg(o)));
}
function fy(t) {
return Object.assign({}, t, { left: t.x, top: t.y, right: t.x + t.width, bottom: t.y + t.height });
}
function nF(t) {
var e = eu(t);
return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e;
}
function g2(t, e) {
return e === vC ? fy(rF(t)) : Jc(e) ? nF(e) : fy(iF(Es(t)));
}
function aF(t) {
var e = Wd(bg(t)), r = ["absolute", "fixed"].indexOf(to(t).position) >= 0, i = r && _n(t) ? Zh(t) : t;
return Jc(i) ? e.filter(function(n) {
return Jc(n) && bC(n, i) && va(n) !== "body";
}) : [];
}
function oF(t, e, r) {
var i = e === "clippingParents" ? aF(t) : [].concat(e), n = [].concat(i, [r]), a = n[0], o = n.reduce(function(s, c) {
var l = g2(t, c);
return s.top = ll(l.top, s.top), s.right = km(l.right, s.right), s.bottom = km(l.bottom, s.bottom), s.left = ll(l.left, s.left), s;
}, g2(t, a));
return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o;
}
function TC(t) {
var e = t.reference, r = t.element, i = t.placement, n = i ? ha(i) : null, a = i ? tu(i) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, c;
switch (n) {
case Gi:
c = { x: o, y: e.y - r.height };
break;
case Mn:
c = { x: o, y: e.y + e.height };
break;
case En:
c = { x: e.x + e.width, y: s };
break;
case Wi:
c = { x: e.x - r.width, y: s };
break;
default:
c = { x: e.x, y: e.y };
}
var l = n ? lb(n) : null;
if (l != null) {
var u = l === "y" ? "height" : "width";
switch (a) {
case Kc:
c[l] = c[l] - (e[u] / 2 - r[u] / 2);
break;
case ch:
c[l] = c[l] + (e[u] / 2 - r[u] / 2);
break;
}
}
return c;
}
function uh(t, e) {
e === void 0 && (e = {});
var r = e, i = r.placement, n = i === void 0 ? t.placement : i, a = r.boundary, o = a === void 0 ? LB : a, s = r.rootBoundary, c = s === void 0 ? vC : s, l = r.elementContext, u = l === void 0 ? ud : l, d = r.altBoundary, h = d === void 0 ? !1 : d, f = r.padding, p = f === void 0 ? 0 : f, m = wC(typeof p != "number" ? p : _C(p, Xh)), y = u === ud ? kB : ud, g = t.rects.popper, v = t.elements[h ? y : u], x = oF(Jc(v) ? v : v.contextElement || Es(t.elements.popper), o, c), w = eu(t.elements.reference), S = TC({ reference: w, element: g, strategy: "absolute", placement: n }), _ = fy(Object.assign({}, g, S)), b = u === ud ? _ : w, T = { top: x.top - b.top + m.top, bottom: b.bottom - x.bottom + m.bottom, left: x.left - b.left + m.left, right: b.right - x.right + m.right }, E = t.modifiersData.offset;
if (u === ud && E) {
var C = E[n];
Object.keys(T).forEach(function(L) {
var A = [En, Mn].indexOf(L) >= 0 ? 1 : -1, k = [Gi, Mn].indexOf(L) >= 0 ? "y" : "x";
T[L] += C[k] * A;
});
}
return T;
}
function sF(t, e) {
e === void 0 && (e = {});
var r = e, i = r.placement, n = r.boundary, a = r.rootBoundary, o = r.padding, s = r.flipVariations, c = r.allowedAutoPlacements, l = c === void 0 ? yg : c, u = tu(i), d = u ? s ? h2 : h2.filter(function(p) {
return tu(p) === u;
}) : Xh, h = d.filter(function(p) {
return l.indexOf(p) >= 0;
});
h.length === 0 && (h = d);
var f = h.reduce(function(p, m) {
return p[m] = uh(t, { placement: m, boundary: n, rootBoundary: a, padding: o })[ha(m)], p;
}, {});
return Object.keys(f).sort(function(p, m) {
return f[p] - f[m];
});
}
function lF(t) {
if (ha(t) === ab) return [];
var e = im(t);
return [m2(t), e, m2(e)];
}
function cF(t) {
var e = t.state, r = t.options, i = t.name;
if (!e.modifiersData[i]._skip) {
for (var n = r.mainAxis, a = n === void 0 ? !0 : n, o = r.altAxis, s = o === void 0 ? !0 : o, c = r.fallbackPlacements, l = r.padding, u = r.boundary, d = r.rootBoundary, h = r.altBoundary, f = r.flipVariations, p = f === void 0 ? !0 : f, m = r.allowedAutoPlacements, y = e.options.placement, g = ha(y), v = g === y, x = c || (v || !p ? [im(y)] : lF(y)), w = [y].concat(x).reduce(function(re, K) {
return re.concat(ha(K) === ab ? sF(e, { placement: K, boundary: u, rootBoundary: d, padding: l, flipVariations: p, allowedAutoPlacements: m }) : K);
}, []), S = e.rects.reference, _ = e.rects.popper, b = /* @__PURE__ */ new Map(), T = !0, E = w[0], C = 0; C < w.length; C++) {
var L = w[C], A = ha(L), k = tu(L) === Kc, P = [Gi, Mn].indexOf(A) >= 0, R = P ? "width" : "height", M = uh(e, { placement: L, boundary: u, rootBoundary: d, altBoundary: h, padding: l }), O = P ? k ? En : Wi : k ? Mn : Gi;
S[R] > _[R] && (O = im(O));
var D = im(O), I = [];
if (a && I.push(M[A] <= 0), s && I.push(M[O] <= 0, M[D] <= 0), I.every(function(re) {
return re;
})) {
E = L, T = !1;
break;
}
b.set(L, I);
}
if (T) for (var F = p ? 3 : 1, z = function(re) {
var K = w.find(function(V) {
var H = b.get(V);
if (H) return H.slice(0, re).every(function(G) {
return G;
});
});
if (K) return E = K, "break";
}, U = F; U > 0; U--) {
var Z = z(U);
if (Z === "break") break;
}
e.placement !== E && (e.modifiersData[i]._skip = !0, e.placement = E, e.reset = !0);
}
}
var uF = { name: "flip", enabled: !0, phase: "main", fn: cF, requiresIfExists: ["offset"], data: { _skip: !1 } };
function v2(t, e, r) {
return r === void 0 && (r = { x: 0, y: 0 }), { top: t.top - e.height - r.y, right: t.right - e.width + r.x, bottom: t.bottom - e.height + r.y, left: t.left - e.width - r.x };
}
function y2(t) {
return [Gi, En, Mn, Wi].some(function(e) {
return t[e] >= 0;
});
}
function dF(t) {
var e = t.state, r = t.name, i = e.rects.reference, n = e.rects.popper, a = e.modifiersData.preventOverflow, o = uh(e, { elementContext: "reference" }), s = uh(e, { altBoundary: !0 }), c = v2(o, i), l = v2(s, n, a), u = y2(c), d = y2(l);
e.modifiersData[r] = { referenceClippingOffsets: c, popperEscapeOffsets: l, isReferenceHidden: u, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": u, "data-popper-escaped": d });
}
var hF = { name: "hide", enabled: !0, phase: "main", requiresIfExists: ["preventOverflow"], fn: dF };
function pF(t, e, r) {
var i = ha(t), n = [Wi, Gi].indexOf(i) >= 0 ? -1 : 1, a = typeof r == "function" ? r(Object.assign({}, e, { placement: t })) : r, o = a[0], s = a[1];
return o = o || 0, s = (s || 0) * n, [Wi, En].indexOf(i) >= 0 ? { x: s, y: o } : { x: o, y: s };
}
function fF(t) {
var e = t.state, r = t.options, i = t.name, n = r.offset, a = n === void 0 ? [0, 0] : n, o = yg.reduce(function(u, d) {
return u[d] = pF(d, e.rects, a), u;
}, {}), s = o[e.placement], c = s.x, l = s.y;
e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += c, e.modifiersData.popperOffsets.y += l), e.modifiersData[i] = o;
}
var mF = { name: "offset", enabled: !0, phase: "main", requires: ["popperOffsets"], fn: fF };
function gF(t) {
var e = t.state, r = t.name;
e.modifiersData[r] = TC({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
}
var CC = { name: "popperOffsets", enabled: !0, phase: "read", fn: gF, data: {} };
function vF(t) {
return t === "x" ? "y" : "x";
}
function yF(t) {
var e = t.state, r = t.options, i = t.name, n = r.mainAxis, a = n === void 0 ? !0 : n, o = r.altAxis, s = o === void 0 ? !1 : o, c = r.boundary, l = r.rootBoundary, u = r.altBoundary, d = r.padding, h = r.tether, f = h === void 0 ? !0 : h, p = r.tetherOffset, m = p === void 0 ? 0 : p, y = uh(e, { boundary: c, rootBoundary: l, padding: d, altBoundary: u }), g = ha(e.placement), v = tu(e.placement), x = !v, w = lb(g), S = vF(w), _ = e.modifiersData.popperOffsets, b = e.rects.reference, T = e.rects.popper, E = typeof m == "function" ? m(Object.assign({}, e.rects, { placement: e.placement })) : m, C = typeof E == "number" ? { mainAxis: E, altAxis: E } : Object.assign({ mainAxis: 0, altAxis: 0 }, E), L = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, A = { x: 0, y: 0 };
if (_) {
if (a) {
var k, P = w === "y" ? Gi : Wi, R = w === "y" ? Mn : En, M = w === "y" ? "height" : "width", O = _[w], D = O + y[P], I = O - y[R], F = f ? -T[M] / 2 : 0, z = v === Kc ? b[M] : T[M], U = v === Kc ? -T[M] : -b[M], Z = e.elements.arrow, re = f && Z ? sb(Z) : { width: 0, height: 0 }, K = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : xC(), V = K[P], H = K[R], G = Gd(0, b[M], re[M]), W = x ? b[M] / 2 - F - G - V - C.mainAxis : z - G - V - C.mainAxis, Y = x ? -b[M] / 2 + F + G + H + C.mainAxis : U + G + H + C.mainAxis, X = e.elements.arrow && Zh(e.elements.arrow), ie = X ? w === "y" ? X.clientTop || 0 : X.clientLeft || 0 : 0, ue = (k = L == null ? void 0 : L[w]) != null ? k : 0, $ = O + W - ue - ie, J = O + Y - ue, ne = Gd(f ? km(D, $) : D, O, f ? ll(I, J) : I);
_[w] = ne, A[w] = ne - O;
}
if (s) {
var j, q = w === "x" ? Gi : Wi, ge = w === "x" ? Mn : En, ye = _[S], _e = S === "y" ? "height" : "width", Me = ye + y[q], Ce = ye - y[ge], B = [Gi, Wi].indexOf(g) !== -1, ce = (j = L == null ? void 0 : L[S]) != null ? j : 0, ve = B ? Me : ye - b[_e] - T[_e] - ce + C.altAxis, te = B ? ye + b[_e] + T[_e] - ce - C.altAxis : Ce, pe = f && B ? GB(ve, ye, te) : Gd(f ? ve : Me, ye, f ? te : Ce);
_[S] = pe, A[S] = pe - ye;
}
e.modifiersData[i] = A;
}
}
var bF = { name: "preventOverflow", enabled: !0, phase: "main", fn: yF, requiresIfExists: ["offset"] };
function xF(t) {
return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop };
}
function wF(t) {
return t === Yn(t) || !_n(t) ? cb(t) : xF(t);
}
function _F(t) {
var e = t.getBoundingClientRect(), r = Qc(e.width) / t.offsetWidth || 1, i = Qc(e.height) / t.offsetHeight || 1;
return r !== 1 || i !== 1;
}
function SF(t, e, r) {
r === void 0 && (r = !1);
var i = _n(e), n = _n(e) && _F(e), a = Es(e), o = eu(t, n), s = { scrollLeft: 0, scrollTop: 0 }, c = { x: 0, y: 0 };
return (i || !i && !r) && ((va(e) !== "body" || db(a)) && (s = wF(e)), _n(e) ? (c = eu(e, !0), c.x += e.clientLeft, c.y += e.clientTop) : a && (c.x = ub(a))), { x: o.left + s.scrollLeft - c.x, y: o.top + s.scrollTop - c.y, width: o.width, height: o.height };
}
function MF(t) {
var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), i = [];
t.forEach(function(a) {
e.set(a.name, a);
});
function n(a) {
r.add(a.name);
var o = [].concat(a.requires || [], a.requiresIfExists || []);
o.forEach(function(s) {
if (!r.has(s)) {
var c = e.get(s);
c && n(c);
}
}), i.push(a);
}
return t.forEach(function(a) {
r.has(a.name) || n(a);
}), i;
}
function EF(t) {
var e = MF(t);
return $B.reduce(function(r, i) {
return r.concat(e.filter(function(n) {
return n.phase === i;
}));
}, []);
}
function TF(t) {
var e;
return function() {
return e || (e = new Promise(function(r) {
Promise.resolve().then(function() {
e = void 0, r(t());
});
})), e;
};
}
function CF(t) {
var e = t.reduce(function(r, i) {
var n = r[i.name];
return r[i.name] = n ? Object.assign({}, n, i, { options: Object.assign({}, n.options, i.options), data: Object.assign({}, n.data, i.data) }) : i, r;
}, {});
return Object.keys(e).map(function(r) {
return e[r];
});
}
var b2 = { placement: "bottom", modifiers: [], strategy: "absolute" };
function x2() {
for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r];
return !e.some(function(i) {
return !(i && typeof i.getBoundingClientRect == "function");
});
}
function hb(t) {
t === void 0 && (t = {});
var e = t, r = e.defaultModifiers, i = r === void 0 ? [] : r, n = e.defaultOptions, a = n === void 0 ? b2 : n;
return function(o, s, c) {
c === void 0 && (c = a);
var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, b2, a), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, u = [], d = !1, h = { state: l, setOptions: function(m) {
var y = typeof m == "function" ? m(l.options) : m;
p(), l.options = Object.assign({}, a, l.options, y), l.scrollParents = { reference: Jc(o) ? Wd(o) : o.contextElement ? Wd(o.contextElement) : [], popper: Wd(s) };
var g = EF(CF([].concat(i, l.options.modifiers)));
return l.orderedModifiers = g.filter(function(v) {
return v.enabled;
}), f(), h.update();
}, forceUpdate: function() {
if (!d) {
var m = l.elements, y = m.reference, g = m.popper;
if (x2(y, g)) {
l.rects = { reference: SF(y, Zh(g), l.options.strategy === "fixed"), popper: sb(g) }, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(T) {
return l.modifiersData[T.name] = Object.assign({}, T.data);
});
for (var v = 0; v < l.orderedModifiers.length; v++) {
if (l.reset === !0) {
l.reset = !1, v = -1;
continue;
}
var x = l.orderedModifiers[v], w = x.fn, S = x.options, _ = S === void 0 ? {} : S, b = x.name;
typeof w == "function" && (l = w({ state: l, options: _, name: b, instance: h }) || l);
}
}
}
}, update: TF(function() {
return new Promise(function(m) {
h.forceUpdate(), m(l);
});
}), destroy: function() {
p(), d = !0;
} };
if (!x2(o, s)) return h;
h.setOptions(c).then(function(m) {
!d && c.onFirstUpdate && c.onFirstUpdate(m);
});
function f() {
l.orderedModifiers.forEach(function(m) {
var y = m.name, g = m.options, v = g === void 0 ? {} : g, x = m.effect;
if (typeof x == "function") {
var w = x({ state: l, name: y, instance: h, options: v }), S = function() {
};
u.push(w || S);
}
});
}
function p() {
u.forEach(function(m) {
return m();
}), u = [];
}
return h;
};
}
hb();
var AF = [MC, CC, SC, yC];
hb({ defaultModifiers: AF });
var LF = [MC, CC, SC, yC, mF, uF, bF, ZB, hF], kF = hb({ defaultModifiers: LF });
const PF = (t, e, r = {}) => {
const i = {
name: "updateState",
enabled: !0,
phase: "write",
fn: ({ state: c }) => {
const l = RF(c);
Object.assign(o.value, l);
},
requires: ["computeStyles"]
}, n = ee(() => {
const { onFirstUpdate: c, placement: l, strategy: u, modifiers: d } = N(r);
return {
onFirstUpdate: c,
placement: l || "bottom",
strategy: u || "absolute",
modifiers: [
...d || [],
i,
{ name: "applyStyles", enabled: !1 }
]
};
}), a = mr(), o = we({
styles: {
popper: {
position: N(n).strategy,
left: "0",
top: "0"
},
arrow: {
position: "absolute"
}
},
attributes: {}
}), s = () => {
a.value && (a.value.destroy(), a.value = void 0);
};
return ze(n, (c) => {
const l = N(a);
l && l.setOptions(c);
}, {
deep: !0
}), ze([t, e], ([c, l]) => {
s(), !(!c || !l) && (a.value = kF(c, l, N(n)));
}), Sr(() => {
s();
}), {
state: ee(() => {
var c;
return { ...((c = N(a)) == null ? void 0 : c.state) || {} };
}),
styles: ee(() => N(o).styles),
attributes: ee(() => N(o).attributes),
update: () => {
var c;
return (c = N(a)) == null ? void 0 : c.update();
},
forceUpdate: () => {
var c;
return (c = N(a)) == null ? void 0 : c.forceUpdate();
},
instanceRef: ee(() => N(a))
};
};
function RF(t) {
const e = Object.keys(t.elements), r = Tm(e.map((n) => [n, t.styles[n] || {}])), i = Tm(e.map((n) => [n, t.attributes[n]]));
return {
styles: r,
attributes: i
};
}
function w2() {
let t;
const e = (i, n) => {
r(), t = window.setTimeout(i, n);
}, r = () => window.clearTimeout(t);
return cg(() => r()), {
registerTimeout: e,
cancelTimeout: r
};
}
const my = {
prefix: Math.floor(Math.random() * 1e4),
current: 0
}, OF = Symbol("elIdInjection"), AC = () => Ct() ? Ye(OF, my) : my, xg = (t) => {
const e = AC();
!$r && e === my && Vr("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 = nb();
return ee(() => N(t) || `${r.value}-id-${e.prefix}-${e.current++}`);
};
let kc = [];
const _2 = (t) => {
const e = t;
e.key === Gr.esc && kc.forEach((r) => r(e));
}, DF = (t) => {
Lt(() => {
kc.length === 0 && document.addEventListener("keydown", _2), $r && kc.push(t);
}), Sr(() => {
kc = kc.filter((e) => e !== t), kc.length === 0 && $r && document.removeEventListener("keydown", _2);
});
};
let S2;
const LC = () => {
const t = nb(), e = AC(), r = ee(() => `${t.value}-popper-container-${e.prefix}`), i = ee(() => `#${r.value}`);
return {
id: r,
selector: i
};
}, IF = (t) => {
const e = document.createElement("div");
return e.id = t, document.body.appendChild(e), e;
}, NF = () => {
const { id: t, selector: e } = LC();
return IT(() => {
$r && (process.env.NODE_ENV === "test" || !S2 || !document.body.querySelector(e.value)) && (S2 = IF(t.value));
}), {
id: t,
selector: e
};
}, BF = Kt({
showAfter: {
type: Number,
default: 0
},
hideAfter: {
type: Number,
default: 200
},
autoClose: {
type: Number,
default: 0
}
}), FF = ({
showAfter: t,
hideAfter: e,
autoClose: r,
open: i,
close: n
}) => {
const { registerTimeout: a } = w2(), {
registerTimeout: o,
cancelTimeout: s
} = w2();
return {
onOpen: (c) => {
a(() => {
i(c);
const l = N(r);
hi(l) && l > 0 && o(() => {
n(c);
}, l);
}, N(t));
},
onClose: (c) => {
s(), a(() => {
n(c);
}, N(e));
}
};
}, kC = Symbol("elForwardRef"), zF = (t) => {
Dt(kC, {
setForwardRef: (e) => {
t.value = e;
}
});
}, $F = (t) => ({
mounted(e) {
t(e);
},
updated(e) {
t(e);
},
unmounted() {
t(null);
}
}), M2 = {
current: 0
}, E2 = we(0), PC = 2e3, T2 = Symbol("elZIndexContextKey"), RC = Symbol("zIndexContextKey"), OC = (t) => {
const e = Ct() ? Ye(T2, M2) : M2, r = t || (Ct() ? Ye(RC, void 0) : void 0), i = ee(() => {
const o = N(r);
return hi(o) ? o : PC;
}), n = ee(() => i.value + E2.value), a = () => (e.current++, E2.value = e.current, n.value);
return !$r && !Ye(T2) && Vr("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: i,
currentZIndex: n,
nextZIndex: a
};
};
function VF(t) {
let e;
function r() {
if (t.value == null)
return;
const { selectionStart: n, selectionEnd: a, value: o } = t.value;
if (n == null || a == null)
return;
const s = o.slice(0, Math.max(0, n)), c = o.slice(Math.max(0, a));
e = {
selectionStart: n,
selectionEnd: a,
value: o,
beforeTxt: s,
afterTxt: c
};
}
function i() {
if (t.value == null || e == null)
return;
const { value: n } = t.value, { beforeTxt: a, afterTxt: o, selectionStart: s } = e;
if (a == null || o == null || s == null)
return;
let c = n.length;
if (n.endsWith(o))
c = n.length - o.length;
else if (n.startsWith(a))
c = a.length;
else {
const l = a[s - 1], u = n.indexOf(l, s - 1);
u !== -1 && (c = u + 1);
}
t.value.setSelectionRange(c, c);
}
return [r, i];
}
const Du = vg({
type: String,
values: pC,
required: !1
}), DC = Symbol("size"), UF = () => {
const t = Ye(DC, {});
return ee(() => N(t.size) || "");
};
function pb(t, {
beforeFocus: e,
afterFocus: r,
beforeBlur: i,
afterBlur: n
} = {}) {
const a = Ct(), { emit: o } = a, s = mr(), c = we(!1), l = (h) => {
Di(e) && e(h) || c.value || (c.value = !0, o("focus", h), r == null || r());
}, u = (h) => {
var f;
Di(i) && i(h) || h.relatedTarget && (f = s.value) != null && f.contains(h.relatedTarget) || (c.value = !1, o("blur", h), n == null || n());
}, d = () => {
var h, f;
(h = s.value) != null && h.contains(document.activeElement) && s.value !== document.activeElement || (f = t.value) == null || f.focus();
};
return ze(s, (h) => {
h && h.setAttribute("tabindex", "-1");
}), xn(s, "focus", l, !0), xn(s, "blur", u, !0), xn(s, "click", d, !0), process.env.NODE_ENV === "test" && Lt(() => {
const h = ol(t.value) ? t.value : document.querySelector("input,textarea");
h && (xn(h, "focus", l, !0), xn(h, "blur", u, !0));
}), {
isFocused: c,
wrapperRef: s,
handleFocus: l,
handleBlur: u
};
}
function IC({
afterComposition: t,
emit: e
}) {
const r = we(!1), i = (o) => {
e == null || e("compositionstart", o), r.value = !0;
}, n = (o) => {
var s;
e == null || e("compositionupdate", o);
const c = (s = o.target) == null ? void 0 : s.value, l = c[c.length - 1] || "";
r.value = !vB(l);
}, a = (o) => {
e == null || e("compositionend", o), r.value && (r.value = !1, st(() => t(o)));
};
return {
isComposing: r,
handleComposition: (o) => {
o.type === "compositionend" ? a(o) : n(o);
},
handleCompositionStart: i,
handleCompositionUpdate: n,
handleCompositionEnd: a
};
}
const NC = Symbol("emptyValuesContextKey"), jF = "use-empty-values", HF = ["", void 0, null], GF = void 0, WF = Kt({
emptyValues: Array,
valueOnClear: {
type: [String, Number, Boolean, Function],
default: void 0,
validator: (t) => Di(t) ? !t() : !t
}
}), qF = (t, e) => {
const r = Ct() ? Ye(NC, we({})) : we({}), i = ee(() => t.emptyValues || r.value.emptyValues || HF), n = ee(() => Di(t.valueOnClear) ? t.valueOnClear() : t.valueOnClear !== void 0 ? t.valueOnClear : Di(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : GF), a = (o) => i.value.includes(o);
return i.value.includes(n.value) || Vr(jF, "value-on-clear should be a value of empty-values"), {
emptyValues: i,
valueOnClear: n,
isEmptyValue: a
};
}, XF = Kt({
ariaLabel: String,
ariaOrientation: {
type: String,
values: ["horizontal", "vertical", "undefined"]
},
ariaControls: String
}), Ts = (t) => sC(XF, t), BC = Symbol(), Pm = we();
function fb(t, e = void 0) {
const r = Ct() ? Ye(BC, Pm) : Pm;
return t ? ee(() => {
var i, n;
return (n = (i = r.value) == null ? void 0 : i[t]) != null ? n : e;
}) : r;
}
function ZF(t, e) {
const r = fb(), i = Et(t, ee(() => {
var s;
return ((s = r.value) == null ? void 0 : s.namespace) || rm;
})), n = qh(ee(() => {
var s;
return (s = r.value) == null ? void 0 : s.locale;
})), a = OC(ee(() => {
var s;
return ((s = r.value) == null ? void 0 : s.zIndex) || PC;
})), o = ee(() => {
var s;
return N(e) || ((s = r.value) == null ? void 0 : s.size) || "";
});
return YF(ee(() => N(r) || {})), {
ns: i,
locale: n,
zIndex: a,
size: o
};
}
const YF = (t, e, r = !1) => {
var i;
const n = !!Ct(), a = n ? fb() : void 0, o = (i = void 0) != null ? i : n ? Dt : void 0;
if (!o) {
Vr("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
return;
}
const s = ee(() => {
const c = N(t);
return a != null && a.value ? KF(a.value, c) : c;
});
return o(BC, s), o(fC, ee(() => s.value.locale)), o(mC, ee(() => s.value.namespace)), o(RC, ee(() => s.value.zIndex)), o(DC, {
size: ee(() => s.value.size || "")
}), o(NC, ee(() => ({
emptyValues: s.value.emptyValues,
valueOnClear: s.value.valueOnClear
}))), (r || !Pm.value) && (Pm.value = s.value), s;
}, KF = (t, e) => {
const r = [.../* @__PURE__ */ new Set([...d2(t), ...d2(e)])], i = {};
for (const n of r)
i[n] = e[n] !== void 0 ? e[n] : t[n];
return i;
};
var Mt = (t, e) => {
const r = t.__vccOpts || t;
for (const [i, n] of e)
r[i] = n;
return r;
};
const JF = Kt({
size: {
type: vt([Number, String])
},
color: {
type: String
}
}), QF = Le({
name: "ElIcon",
inheritAttrs: !1
}), ez = /* @__PURE__ */ Le({
...QF,
props: JF,
setup(t) {
const e = t, r = Et("icon"), i = ee(() => {
const { size: n, color: a } = e;
return !n && !a ? {} : {
fontSize: Yo(n) ? void 0 : Yc(n),
"--color": a
};
});
return (n, a) => (Q(), be("i", Nr({
class: N(r).b(),
style: N(i)
}, n.$attrs), [
Fe(n.$slots, "default")
], 16));
}
});
var tz = /* @__PURE__ */ Mt(ez, [["__file", "icon.vue"]]);
const Oi = ni(tz), mb = Symbol("formContextKey"), dh = Symbol("formItemContextKey"), bl = (t, e = {}) => {
const r = we(void 0), i = e.prop ? r : gC("size"), n = e.global ? r : UF(), a = e.form ? { size: void 0 } : Ye(mb, void 0), o = e.formItem ? { size: void 0 } : Ye(dh, void 0);
return ee(() => i.value || N(t) || (o == null ? void 0 : o.size) || (a == null ? void 0 : a.size) || n.value || "");
}, Yh = (t) => {
const e = gC("disabled"), r = Ye(mb, void 0);
return ee(() => e.value || N(t) || (r == null ? void 0 : r.disabled) || !1);
}, zl = () => {
const t = Ye(mb, void 0), e = Ye(dh, void 0);
return {
form: t,
formItem: e
};
}, Kh = (t, {
formItemContext: e,
disableIdGeneration: r,
disableIdManagement: i
}) => {
r || (r = we(!1)), i || (i = we(!1));
const n = we();
let a;
const o = ee(() => {
var s;
return !!(!(t.label || t.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1);
});
return Lt(() => {
a = ze([pr(t, "id"), r], ([s, c]) => {
const l = s ?? (c ? void 0 : xg().value);
l !== n.value && (e != null && e.removeInputId && (n.value && e.removeInputId(n.value), !(i != null && i.value) && !c && l && e.addInputId(l)), n.value = l);
}, { immediate: !0 });
}), j1(() => {
a && a(), e != null && e.removeInputId && n.value && e.removeInputId(n.value);
}), {
isLabeledByFormItem: o,
inputId: n
};
};
let kn;
const rz = `
height:0 !important;
visibility:hidden !important;
${jD() ? "" : "overflow:hidden !important;"}
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important;
`, iz = [
"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 nz(t) {
const e = window.getComputedStyle(t), r = e.getPropertyValue("box-sizing"), i = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), n = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width"));
return { contextStyle: iz.map((a) => `${a}:${e.getPropertyValue(a)}`).join(";"), paddingSize: i, borderSize: n, boxSizing: r };
}
function C2(t, e = 1, r) {
var i;
kn || (kn = document.createElement("textarea"), document.body.appendChild(kn));
const { paddingSize: n, borderSize: a, boxSizing: o, contextStyle: s } = nz(t);
kn.setAttribute("style", `${s};${rz}`), kn.value = t.value || t.placeholder || "";
let c = kn.scrollHeight;
const l = {};
o === "border-box" ? c = c + a : o === "content-box" && (c = c - n), kn.value = "";
const u = kn.scrollHeight - n;
if (hi(e)) {
let d = u * e;
o === "border-box" && (d = d + n + a), c = Math.max(d, c), l.minHeight = `${d}px`;
}
if (hi(r)) {
let d = u * r;
o === "border-box" && (d = d + n + a), c = Math.min(d, c);
}
return l.height = `${c}px`, (i = kn.parentNode) == null || i.removeChild(kn), kn = void 0, l;
}
const az = Kt({
id: {
type: String,
default: void 0
},
size: Du,
disabled: Boolean,
modelValue: {
type: vt([
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: vt([Boolean, Object]),
default: !1
},
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: cs
},
prefixIcon: {
type: cs
},
containerRole: {
type: String,
default: void 0
},
tabindex: {
type: [String, Number],
default: 0
},
validateEvent: {
type: Boolean,
default: !0
},
inputStyle: {
type: vt([Object, Array, String]),
default: () => Lc({})
},
autofocus: Boolean,
rows: {
type: Number,
default: 2
},
...Ts(["ariaLabel"])
}), oz = {
[ui]: (t) => Ei(t),
input: (t) => Ei(t),
change: (t) => Ei(t),
focus: (t) => t instanceof FocusEvent,
blur: (t) => t instanceof FocusEvent,
clear: () => !0,
mouseleave: (t) => t instanceof MouseEvent,
mouseenter: (t) => t instanceof MouseEvent,
keydown: (t) => t instanceof Event,
compositionstart: (t) => t instanceof CompositionEvent,
compositionupdate: (t) => t instanceof CompositionEvent,
compositionend: (t) => t instanceof CompositionEvent
}, sz = Le({
name: "ElInput",
inheritAttrs: !1
}), lz = /* @__PURE__ */ Le({
...sz,
props: az,
emits: oz,
setup(t, { expose: e, emit: r }) {
const i = t, n = AT(), a = co(), o = ee(() => {
const B = {};
return i.containerRole === "combobox" && (B["aria-haspopup"] = n["aria-haspopup"], B["aria-owns"] = n["aria-owns"], B["aria-expanded"] = n["aria-expanded"]), B;
}), s = ee(() => [
i.type === "textarea" ? y.b() : m.b(),
m.m(f.value),
m.is("disabled", p.value),
m.is("exceed", Z.value),
{
[m.b("group")]: a.prepend || a.append,
[m.m("prefix")]: a.prefix || i.prefixIcon,
[m.m("suffix")]: a.suffix || i.suffixIcon || i.clearable || i.showPassword,
[m.bm("suffix", "password-clear")]: I.value && F.value,
[m.b("hidden")]: i.type === "hidden"
},
n.class
]), c = ee(() => [
m.e("wrapper"),
m.is("focus", E.value)
]), l = xB({
excludeKeys: ee(() => Object.keys(o.value))
}), { form: u, formItem: d } = zl(), { inputId: h } = Kh(i, {
formItemContext: d
}), f = bl(), p = Yh(), m = Et("input"), y = Et("textarea"), g = mr(), v = mr(), x = we(!1), w = we(!1), S = we(), _ = mr(i.inputStyle), b = ee(() => g.value || v.value), { wrapperRef: T, isFocused: E, handleFocus: C, handleBlur: L } = pb(b, {
beforeFocus() {
return p.value;
},
afterBlur() {
var B;
i.validateEvent && ((B = d == null ? void 0 : d.validate) == null || B.call(d, "blur").catch((ce) => Vr(ce)));
}
}), A = ee(() => {
var B;
return (B = u == null ? void 0 : u.statusIcon) != null ? B : !1;
}), k = ee(() => (d == null ? void 0 : d.validateState) || ""), P = ee(() => k.value && hC[k.value]), R = ee(() => w.value ? hB : sB), M = ee(() => [
n.style
]), O = ee(() => [
i.inputStyle,
_.value,
{ resize: i.resize }
]), D = ee(() => ts(i.modelValue) ? "" : String(i.modelValue)), I = ee(() => i.clearable && !p.value && !i.readonly && !!D.value && (E.value || x.value)), F = ee(() => i.showPassword && !p.value && !i.readonly && !!D.value && (!!D.value || E.value)), z = ee(() => i.showWordLimit && !!i.maxlength && (i.type === "text" || i.type === "textarea") && !p.value && !i.readonly && !i.showPassword), U = ee(() => D.value.length), Z = ee(() => !!z.value && U.value > Number(i.maxlength)), re = ee(() => !!a.suffix || !!i.suffixIcon || I.value || i.showPassword || z.value || !!k.value && A.value), [K, V] = VF(g);
Ua(v, (B) => {
if (G(), !z.value || i.resize !== "both")
return;
const ce = B[0], { width: ve } = ce.contentRect;
S.value = {
right: `calc(100% - ${ve + 15 + 6}px)`
};
});
const H = () => {
const { type: B, autosize: ce } = i;
if (!(!$r || B !== "textarea" || !v.value))
if (ce) {
const ve = di(ce) ? ce.minRows : void 0, te = di(ce) ? ce.maxRows : void 0, pe = C2(v.value, ve, te);
_.value = {
overflowY: "hidden",
...pe
}, st(() => {
v.value.offsetHeight, _.value = pe;
});
} else
_.value = {
minHeight: C2(v.value).minHeight
};
}, G = /* @__PURE__ */ ((B) => {
let ce = !1;
return () => {
var ve;
ce || !i.autosize || ((ve = v.value) == null ? void 0 : ve.offsetParent) === null || (B(), ce = !0);
};
})(H), W = () => {
const B = b.value, ce = i.formatter ? i.formatter(D.value) : D.value;
!B || B.value === ce || (B.value = ce);
}, Y = async (B) => {
K();
let { value: ce } = B.target;
if (i.formatter && (ce = i.parser ? i.parser(ce) : ce), !ie.value) {
if (ce === D.value) {
W();
return;
}
r(ui, ce), r("input", ce), await st(), W(), V();
}
}, X = (B) => {
r("change", B.target.value);
}, {
isComposing: ie,
handleCompositionStart: ue,
handleCompositionUpdate: $,
handleCompositionEnd: J
} = IC({ emit: r, afterComposition: Y }), ne = () => {
w.value = !w.value, j();
}, j = async () => {
var B;
await st(), (B = b.value) == null || B.focus();
}, q = () => {
var B;
return (B = b.value) == null ? void 0 : B.blur();
}, ge = (B) => {
x.value = !1, r("mouseleave", B);
}, ye = (B) => {
x.value = !0, r("mouseenter", B);
}, _e = (B) => {
r("keydown", B);
}, Me = () => {
var B;
(B = b.value) == null || B.select();
}, Ce = () => {
r(ui, ""), r("change", ""), r("clear"), r("input", "");
};
return ze(() => i.modelValue, () => {
var B;
st(() => H()), i.validateEvent && ((B = d == null ? void 0 : d.validate) == null || B.call(d, "change").catch((ce) => Vr(ce)));
}), ze(D, () => W()), ze(() => i.type, async () => {
await st(), W(), H();
}), Lt(() => {
!i.formatter && i.parser && Vr("ElInput", "If you set the parser, you also need to set the formatter."), W(), st(H);
}), e({
input: g,
textarea: v,
ref: b,
textareaStyle: O,
autosize: pr(i, "autosize"),
isComposing: ie,
focus: j,
blur: q,
select: Me,
clear: Ce,
resizeTextarea: H
}), (B, ce) => (Q(), be("div", Nr(N(o), {
class: [
N(s),
{
[N(m).bm("group", "append")]: B.$slots.append,
[N(m).bm("group", "prepend")]: B.$slots.prepend
}
],
style: N(M),
role: B.containerRole,
onMouseenter: ye,
onMouseleave: ge
}), [
Pe(" input "),
B.type !== "textarea" ? (Q(), be(pt, { key: 0 }, [
Pe(" prepend slot "),
B.$slots.prepend ? (Q(), be("div", {
key: 0,
class: xe(N(m).be("group", "prepend"))
}, [
Fe(B.$slots, "prepend")
], 2)) : Pe("v-if", !0),
Ee("div", {
ref_key: "wrapperRef",
ref: T,
class: xe(N(c))
}, [
Pe(" prefix slot "),
B.$slots.prefix || B.prefixIcon ? (Q(), be("span", {
key: 0,
class: xe(N(m).e("prefix"))
}, [
Ee("span", {
class: xe(N(m).e("prefix-inner"))
}, [
Fe(B.$slots, "prefix"),
B.prefixIcon ? (Q(), Re(N(Oi), {
key: 0,
class: xe(N(m).e("icon"))
}, {
default: le(() => [
(Q(), Re(Yt(B.prefixIcon)))
]),
_: 1
}, 8, ["class"])) : Pe("v-if", !0)
], 2)
], 2)) : Pe("v-if", !0),
Ee("input", Nr({
id: N(h),
ref_key: "input",
ref: g,
class: N(m).e("inner")
}, N(l), {
minlength: B.minlength,
maxlength: B.maxlength,
type: B.showPassword ? w.value ? "text" : "password" : B.type,
disabled: N(p),
readonly: B.readonly,
autocomplete: B.autocomplete,
tabindex: B.tabindex,
"aria-label": B.ariaLabel,
placeholder: B.placeholder,
style: B.inputStyle,
form: B.form,
autofocus: B.autofocus,
onCompositionstart: N(ue),
onCompositionupdate: N($),
onCompositionend: N(J),
onInput: Y,
onChange: X,
onKeydown: _e
}), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
Pe(" suffix slot "),
N(re) ? (Q(), be("span", {
key: 1,
class: xe(N(m).e("suffix"))
}, [
Ee("span", {
class: xe(N(m).e("suffix-inner"))
}, [
!N(I) || !N(F) || !N(z) ? (Q(), be(pt, { key: 0 }, [
Fe(B.$slots, "suffix"),
B.suffixIcon ? (Q(), Re(N(Oi), {
key: 0,
class: xe(N(m).e("icon"))
}, {
default: le(() => [
(Q(), Re(Yt(B.suffixIcon)))
]),
_: 1
}, 8, ["class"])) : Pe("v-if", !0)
], 64)) : Pe("v-if", !0),
N(I) ? (Q(), Re(N(Oi), {
key: 1,
class: xe([N(m).e("icon"), N(m).e("clear")]),
onMousedown: Tt(N(oh), ["prevent"]),
onClick: Ce
}, {
default: le(() => [
oe(N(tb))
]),
_: 1
}, 8, ["class", "onMousedown"])) : Pe("v-if", !0),
N(F) ? (Q(), Re(N(Oi), {
key: 2,
class: xe([N(m).e("icon"), N(m).e("password")]),
onClick: ne
}, {
default: le(() => [
(Q(), Re(Yt(N(R))))
]),
_: 1
}, 8, ["class"])) : Pe("v-if", !0),
N(z) ? (Q(), be("span", {
key: 3,
class: xe(N(m).e("count"))
}, [
Ee("span", {
class: xe(N(m).e("count-inner"))
}, Ze(N(U)) + " / " + Ze(B.maxlength), 3)
], 2)) : Pe("v-if", !0),
N(k) && N(P) && N(A) ? (Q(), Re(N(Oi), {
key: 4,
class: xe([
N(m).e("icon"),
N(m).e("validateIcon"),
N(m).is("loading", N(k) === "validating")
])
}, {
default: le(() => [
(Q(), Re(Yt(N(P))))
]),
_: 1
}, 8, ["class"])) : Pe("v-if", !0)
], 2)
], 2)) : Pe("v-if", !0)
], 2),
Pe(" append slot "),
B.$slots.append ? (Q(), be("div", {
key: 1,
class: xe(N(m).be("group", "append"))
}, [
Fe(B.$slots, "append")
], 2)) : Pe("v-if", !0)
], 64)) : (Q(), be(pt, { key: 1 }, [
Pe(" textarea "),
Ee("textarea", Nr({
id: N(h),
ref_key: "textarea",
ref: v,
class: [N(y).e("inner"), N(m).is("focus", N(E))]
}, N(l), {
minlength: B.minlength,
maxlength: B.maxlength,
tabindex: B.tabindex,
disabled: N(p),
readonly: B.readonly,
autocomplete: B.autocomplete,
style: N(O),
"aria-label": B.ariaLabel,
placeholder: B.placeholder,
form: B.form,
autofocus: B.autofocus,
rows: B.rows,
onCompositionstart: N(ue),
onCompositionupdate: N($),
onCompositionend: N(J),
onInput: Y,
onFocus: N(C),
onBlur: N(L),
onChange: X,
onKeydown: _e
}), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
N(z) ? (Q(), be("span", {
key: 0,
style: yt(S.value),
class: xe(N(m).e("count"))
}, Ze(N(U)) + " / " + Ze(B.maxlength), 7)) : Pe("v-if", !0)
], 64))
], 16, ["role"]));
}
});
var cz = /* @__PURE__ */ Mt(lz, [["__file", "input.vue"]]);
const Jh = ni(cz), Jl = 4, uz = {
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"
}
}, dz = ({
move: t,
size: e,
bar: r
}) => ({
[r.size]: e,
transform: `translate${r.axis}(${t}%)`
}), gb = Symbol("scrollbarContextKey"), hz = Kt({
vertical: Boolean,
size: String,
move: Number,
ratio: {
type: Number,
required: !0
},
always: Boolean
}), pz = "Thumb", fz = /* @__PURE__ */ Le({
__name: "thumb",
props: hz,
setup(t) {
const e = t, r = Ye(gb), i = Et("scrollbar");
r || j5(pz, "can not inject scrollbar context");
const n = we(), a = we(), o = we({}), s = we(!1);
let c = !1, l = !1, u = $r ? document.onselectstart : null;
const d = ee(() => uz[e.vertical ? "vertical" : "horizontal"]), h = ee(() => dz({
size: e.size,
move: e.move,
bar: d.value
})), f = ee(() => n.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / a.value[d.value.offset]), p = (_) => {
var b;
if (_.stopPropagation(), _.ctrlKey || [1, 2].includes(_.button))
return;
(b = window.getSelection()) == null || b.removeAllRanges(), y(_);
const T = _.currentTarget;
T && (o.value[d.value.axis] = T[d.value.offset] - (_[d.value.client] - T.getBoundingClientRect()[d.value.direction]));
}, m = (_) => {
if (!a.value || !n.value || !r.wrapElement)
return;
const b = Math.abs(_.target.getBoundingClientRect()[d.value.direction] - _[d.value.client]), T = a.value[d.value.offset] / 2, E = (b - T) * 100 * f.value / n.value[d.value.offset];
r.wrapElement[d.value.scroll] = E * r.wrapElement[d.value.scrollSize] / 100;
}, y = (_) => {
_.stopImmediatePropagation(), c = !0, document.addEventListener("mousemove", g), document.addEventListener("mouseup", v), u = document.onselectstart, document.onselectstart = () => !1;
}, g = (_) => {
if (!n.value || !a.value || c === !1)
return;
const b = o.value[d.value.axis];
if (!b)
return;
const T = (n.value.getBoundingClientRect()[d.value.direction] - _[d.value.client]) * -1, E = a.value[d.value.offset] - b, C = (T - E) * 100 * f.value / n.value[d.value.offset];
r.wrapElement[d.value.scroll] = C * r.wrapElement[d.value.scrollSize] / 100;
}, v = () => {
c = !1, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", v), S(), l && (s.value = !1);
}, x = () => {
l = !1, s.value = !!e.size;
}, w = () => {
l = !0, s.value = c;
};
Sr(() => {
S(), document.removeEventListener("mouseup", v);
});
const S = () => {
document.onselectstart !== u && (document.onselectstart = u);
};
return xn(pr(r, "scrollbarElement"), "mousemove", x), xn(pr(r, "scrollbarElement"), "mouseleave", w), (_, b) => (Q(), Re(Zn, {
name: N(i).b("fade"),
persisted: ""
}, {
default: le(() => [
ht(Ee("div", {
ref_key: "instance",
ref: n,
class: xe([N(i).e("bar"), N(i).is(N(d).key)]),
onMousedown: m
}, [
Ee("div", {
ref_key: "thumb",
ref: a,
class: xe(N(i).e("thumb")),
style: yt(N(h)),
onMousedown: p
}, null, 38)
], 34), [
[Ot, _.always || s.value]
])
]),
_: 1
}, 8, ["name"]));
}
});
var A2 = /* @__PURE__ */ Mt(fz, [["__file", "thumb.vue"]]);
const mz = Kt({
always: {
type: Boolean,
default: !0
},
minSize: {
type: Number,
required: !0
}
}), gz = /* @__PURE__ */ Le({
__name: "bar",
props: mz,
setup(t, { expose: e }) {
const r = t, i = Ye(gb), n = we(0), a = we(0), o = we(""), s = we(""), c = we(1), l = we(1);
return e({
handleScroll: (u) => {
if (u) {
const d = u.offsetHeight - Jl, h = u.offsetWidth - Jl;
a.value = u.scrollTop * 100 / d * c.value, n.value = u.scrollLeft * 100 / h * l.value;
}
},
update: () => {
const u = i == null ? void 0 : i.wrapElement;
if (!u)
return;
const d = u.offsetHeight - Jl, h = u.offsetWidth - Jl, f = d ** 2 / u.scrollHeight, p = h ** 2 / u.scrollWidth, m = Math.max(f, r.minSize), y = Math.max(p, r.minSize);
c.value = f / (d - f) / (m / (d - m)), l.value = p / (h - p) / (y / (h - y)), s.value = m + Jl < d ? `${m}px` : "", o.value = y + Jl < h ? `${y}px` : "";
}
}), (u, d) => (Q(), be(pt, null, [
oe(A2, {
move: n.value,
ratio: l.value,
size: o.value,
always: u.always
}, null, 8, ["move", "ratio", "size", "always"]),
oe(A2, {
move: a.value,
ratio: c.value,
size: s.value,
vertical: "",
always: u.always
}, null, 8, ["move", "ratio", "size", "always"])
], 64));
}
});
var vz = /* @__PURE__ */ Mt(gz, [["__file", "bar.vue"]]);
const yz = Kt({
height: {
type: [String, Number],
default: ""
},
maxHeight: {
type: [String, Number],
default: ""
},
native: {
type: Boolean,
default: !1
},
wrapStyle: {
type: vt([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,
...Ts(["ariaLabel", "ariaOrientation"])
}), bz = {
scroll: ({
scrollTop: t,
scrollLeft: e
}) => [t, e].every(hi)
}, gy = "ElScrollbar", xz = Le({
name: gy
}), wz = /* @__PURE__ */ Le({
...xz,
props: yz,
emits: bz,
setup(t, { expose: e, emit: r }) {
const i = t, n = Et("scrollbar");
let a, o, s = 0, c = 0;
const l = we(), u = we(), d = we(), h = we(), f = ee(() => {
const S = {};
return i.height && (S.height = Yc(i.height)), i.maxHeight && (S.maxHeight = Yc(i.maxHeight)), [i.wrapStyle, S];
}), p = ee(() => [
i.wrapClass,
n.e("wrap"),
{ [n.em("wrap", "hidden-default")]: !i.native }
]), m = ee(() => [n.e("view"), i.viewClass]), y = () => {
var S;
u.value && ((S = h.value) == null || S.handleScroll(u.value), s = u.value.scrollTop, c = u.value.scrollLeft, r("scroll", {
scrollTop: u.value.scrollTop,
scrollLeft: u.value.scrollLeft
}));
};
function g(S, _) {
di(S) ? u.value.scrollTo(S) : hi(S) && hi(_) && u.value.scrollTo(S, _);
}
const v = (S) => {
if (!hi(S)) {
Vr(gy, "value must be a number");
return;
}
u.value.scrollTop = S;
}, x = (S) => {
if (!hi(S)) {
Vr(gy, "value must be a number");
return;
}
u.value.scrollLeft = S;
}, w = () => {
var S;
(S = h.value) == null || S.update();
};
return ze(() => i.noresize, (S) => {
S ? (a == null || a(), o == null || o()) : ({ stop: a } = Ua(d, w), o = xn("resize", w));
}, { immediate: !0 }), ze(() => [i.maxHeight, i.height], () => {
i.native || st(() => {
var S;
w(), u.value && ((S = h.value) == null || S.handleScroll(u.value));
});
}), Dt(gb, _r({
scrollbarElement: l,
wrapElement: u
})), LT(() => {
u.value && (u.value.scrollTop = s, u.value.scrollLeft = c);
}), Lt(() => {
i.native || st(() => {
w();
});
}), jh(() => w()), e({
wrapRef: u,
update: w,
scrollTo: g,
setScrollTop: v,
setScrollLeft: x,
handleScroll: y
}), (S, _) => (Q(), be("div", {
ref_key: "scrollbarRef",
ref: l,
class: xe(N(n).b())
}, [
Ee("div", {
ref_key: "wrapRef",
ref: u,
class: xe(N(p)),
style: yt(N(f)),
tabindex: S.tabindex,
onScroll: y
}, [
(Q(), Re(Yt(S.tag), {
id: S.id,
ref_key: "resizeRef",
ref: d,
class: xe(N(m)),
style: yt(S.viewStyle),
role: S.role,
"aria-label": S.ariaLabel,
"aria-orientation": S.ariaOrientation
}, {
default: le(() => [
Fe(S.$slots, "default")
]),
_: 3
}, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
], 46, ["tabindex"]),
S.native ? Pe("v-if", !0) : (Q(), Re(vz, {
key: 0,
ref_key: "barRef",
ref: h,
always: S.always,
"min-size": S.minSize
}, null, 8, ["always", "min-size"]))
], 2));
}
});
var _z = /* @__PURE__ */ Mt(wz, [["__file", "scrollbar.vue"]]);
const Sz = ni(_z), vb = Symbol("popper"), FC = Symbol("popperContent"), Mz = [
"dialog",
"grid",
"group",
"listbox",
"menu",
"navigation",
"tooltip",
"tree"
], zC = Kt({
role: {
type: String,
values: Mz,
default: "tooltip"
}
}), Ez = Le({
name: "ElPopper",
inheritAttrs: !1
}), Tz = /* @__PURE__ */ Le({
...Ez,
props: zC,
setup(t, { expose: e }) {
const r = t, i = we(), n = we(), a = we(), o = we(), s = ee(() => r.role), c = {
triggerRef: i,
popperInstanceRef: n,
contentRef: a,
referenceRef: o,
role: s
};
return e(c), Dt(vb, c), (l, u) => Fe(l.$slots, "default");
}
});
var Cz = /* @__PURE__ */ Mt(Tz, [["__file", "popper.vue"]]);
const $C = Kt({
arrowOffset: {
type: Number,
default: 5
}
}), Az = Le({
name: "ElPopperArrow",
inheritAttrs: !1
}), Lz = /* @__PURE__ */ Le({
...Az,
props: $C,
setup(t, { expose: e }) {
const r = t, i = Et("popper"), { arrowOffset: n, arrowRef: a, arrowStyle: o } = Ye(FC, void 0);
return ze(() => r.arrowOffset, (s) => {
n.value = s;
}), Sr(() => {
a.value = void 0;
}), e({
arrowRef: a
}), (s, c) => (Q(), be("span", {
ref_key: "arrowRef",
ref: a,
class: xe(N(i).e("arrow")),
style: yt(N(o)),
"data-popper-arrow": ""
}, null, 6));
}
});
var kz = /* @__PURE__ */ Mt(Lz, [["__file", "arrow.vue"]]);
const Pv = "ElOnlyChild", Pz = Le({
name: Pv,
setup(t, {
slots: e,
attrs: r
}) {
var i;
const n = Ye(kC), a = $F((i = n == null ? void 0 : n.setForwardRef) != null ? i : oh);
return () => {
var o;
const s = (o = e.default) == null ? void 0 : o.call(e, r);
if (!s)
return null;
if (s.length > 1)
return Vr(Pv, "requires exact only one valid child."), null;
const c = VC(s);
return c ? ht(kT(c, r), [[a]]) : (Vr(Pv, "no valid child node found"), null);
};
}
});
function VC(t) {
if (!t)
return null;
const e = t;
for (const r of e) {
if (di(r))
switch (r.type) {
case PT:
continue;
case sg:
case "svg":
return L2(r);
case pt:
return VC(r.children);
default:
return r;
}
return L2(r);
}
return null;
}
function L2(t) {
const e = Et("only-child");
return oe("span", {
class: e.e("content")
}, [t]);
}
const UC = Kt({
virtualRef: {
type: vt(Object)
},
virtualTriggering: Boolean,
onMouseenter: {
type: vt(Function)
},
onMouseleave: {
type: vt(Function)
},
onClick: {
type: vt(Function)
},
onKeydown: {
type: vt(Function)
},
onFocus: {
type: vt(Function)
},
onBlur: {
type: vt(Function)
},
onContextmenu: {
type: vt(Function)
},
id: String,
open: Boolean
}), Rz = Le({
name: "ElPopperTrigger",
inheritAttrs: !1
}), Oz = /* @__PURE__ */ Le({
...Rz,
props: UC,
setup(t, { expose: e }) {
const r = t, { role: i, triggerRef: n } = Ye(vb, void 0);
zF(n);
const a = ee(() => s.value ? r.id : void 0), o = ee(() => {
if (i && i.value === "tooltip")
return r.open && r.id ? r.id : void 0;
}), s = ee(() => {
if (i && i.value !== "tooltip")
return i.value;
}), c = ee(() => s.value ? `${r.open}` : void 0);
let l;
const u = [
"onMouseenter",
"onMouseleave",
"onClick",
"onKeydown",
"onFocus",
"onBlur",
"onContextmenu"
];
return Lt(() => {
ze(() => r.virtualRef, (d) => {
d && (n.value = qa(d));
}, {
immediate: !0
}), ze(n, (d, h) => {
l == null || l(), l = void 0, ol(d) && (u.forEach((f) => {
var p;
const m = r[f];
m && (d.addEventListener(f.slice(2).toLowerCase(), m), (p = h == null ? void 0 : h.removeEventListener) == null || p.call(h, f.slice(2).toLowerCase(), m));
}), l = ze([a, o, s, c], (f) => {
[
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((p, m) => {
ts(f[m]) ? d.removeAttribute(p) : d.setAttribute(p, f[m]);
});
}, { immediate: !0 })), ol(h) && [
"aria-controls",
"aria-describedby",
"aria-haspopup",
"aria-expanded"
].forEach((f) => h.removeAttribute(f));
}, {
immediate: !0
});
}), Sr(() => {
if (l == null || l(), l = void 0, n.value && ol(n.value)) {
const d = n.value;
u.forEach((h) => {
const f = r[h];
f && d.removeEventListener(h.slice(2).toLowerCase(), f);
}), n.value = void 0;
}
}), e({
triggerRef: n
}), (d, h) => d.virtualTriggering ? Pe("v-if", !0) : (Q(), Re(N(Pz), Nr({ key: 0 }, d.$attrs, {
"aria-controls": N(a),
"aria-describedby": N(o),
"aria-expanded": N(c),
"aria-haspopup": N(s)
}), {
default: le(() => [
Fe(d.$slots, "default")
]),
_: 3
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"]));
}
});
var Dz = /* @__PURE__ */ Mt(Oz, [["__file", "trigger.vue"]]);
const Rv = "focus-trap.focus-after-trapped", Ov = "focus-trap.focus-after-released", Iz = "focus-trap.focusout-prevented", k2 = {
cancelable: !0,
bubbles: !1
}, Nz = {
cancelable: !0,
bubbles: !1
}, P2 = "focusAfterTrapped", R2 = "focusAfterReleased", Bz = Symbol("elFocusTrap"), yb = we(), wg = we(0), bb = we(0);
let Dp = 0;
const jC = (t) => {
const e = [], r = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
acceptNode: (i) => {
const n = i.tagName === "INPUT" && i.type === "hidden";
return i.disabled || i.hidden || n ? NodeFilter.FILTER_SKIP : i.tabIndex >= 0 || i === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
}
});
for (; r.nextNode(); )
e.push(r.currentNode);
return e;
}, O2 = (t, e) => {
for (const r of t)
if (!Fz(r, e))
return r;
}, Fz = (t, e) => {
if (process.env.NODE_ENV === "test")
return !1;
if (getComputedStyle(t).visibility === "hidden")
return !0;
for (; t; ) {
if (e && t === e)
return !1;
if (getComputedStyle(t).display === "none")
return !0;
t = t.parentElement;
}
return !1;
}, zz = (t) => {
const e = jC(t), r = O2(e, t), i = O2(e.reverse(), t);
return [r, i];
}, $z = (t) => t instanceof HTMLInputElement && "select" in t, zo = (t, e) => {
if (t && t.focus) {
const r = document.activeElement;
t.focus({ preventScroll: !0 }), bb.value = window.performance.now(), t !== r && $z(t) && e && t.select();
}
};
function D2(t, e) {
const r = [...t], i = t.indexOf(e);
return i !== -1 && r.splice(i, 1), r;
}
const Vz = () => {
let t = [];
return {
push: (e) => {
const r = t[0];
r && e !== r && r.pause(), t = D2(t, e), t.unshift(e);
},
remove: (e) => {
var r, i;
t = D2(t, e), (i = (r = t[0]) == null ? void 0 : r.resume) == null || i.call(r);
}
};
}, Uz = (t, e = !1) => {
const r = document.activeElement;
for (const i of t)
if (zo(i, e), document.activeElement !== r)
return;
}, I2 = Vz(), jz = () => wg.value > bb.value, Ip = () => {
yb.value = "pointer", wg.value = window.performance.now();
}, N2 = () => {
yb.value = "keyboard", wg.value = window.performance.now();
}, Hz = () => (Lt(() => {
Dp === 0 && (document.addEventListener("mousedown", Ip), document.addEventListener("touchstart", Ip), document.addEventListener("keydown", N2)), Dp++;
}), Sr(() => {
Dp--, Dp <= 0 && (document.removeEventListener("mousedown", Ip), document.removeEventListener("touchstart", Ip), document.removeEventListener("keydown", N2));
}), {
focusReason: yb,
lastUserFocusTimestamp: wg,
lastAutomatedFocusTimestamp: bb
}), Np = (t) => new CustomEvent(Iz, {
...Nz,
detail: t
}), Gz = Le({
name: "ElFocusTrap",
inheritAttrs: !1,
props: {
loop: Boolean,
trapped: Boolean,
focusTrapEl: Object,
focusStartEl: {
type: [Object, String],
default: "first"
}
},
emits: [
P2,
R2,
"focusin",
"focusout",
"focusout-prevented",
"release-requested"
],
setup(t, { emit: e }) {
const r = we();
let i, n;
const { focusReason: a } = Hz();
DF((p) => {
t.trapped && !o.paused && e("release-requested", p);
});
const o = {
paused: !1,
pause() {
this.paused = !0;
},
resume() {
this.paused = !1;
}
}, s = (p) => {
if (!t.loop && !t.trapped || o.paused)
return;
const { key: m, altKey: y, ctrlKey: g, metaKey: v, currentTarget: x, shiftKey: w } = p, { loop: S } = t, _ = m === Gr.tab && !y && !g && !v, b = document.activeElement;
if (_ && b) {
const T = x, [E, C] = zz(T);
if (E && C) {
if (!w && b === C) {
const L = Np({
focusReason: a.value
});
e("focusout-prevented", L), L.defaultPrevented || (p.preventDefault(), S && zo(E, !0));
} else if (w && [E, T].includes(b)) {
const L = Np({
focusReason: a.value
});
e("focusout-prevented", L), L.defaultPrevented || (p.preventDefault(), S && zo(C, !0));
}
} else if (b === T) {
const L = Np({
focusReason: a.value
});
e("focusout-prevented", L), L.defaultPrevented || p.preventDefault();
}
}
};
Dt(Bz, {
focusTrapRef: r,
onKeydown: s
}), ze(() => t.focusTrapEl, (p) => {
p && (r.value = p);
}, { immediate: !0 }), ze([r], ([p], [m]) => {
p && (p.addEventListener("keydown", s), p.addEventListener("focusin", u), p.addEventListener("focusout", d)), m && (m.removeEventListener("keydown", s), m.removeEventListener("focusin", u), m.removeEventListener("focusout", d));
});
const c = (p) => {
e(P2, p);
}, l = (p) => e(R2, p), u = (p) => {
const m = N(r);
if (!m)
return;
const y = p.target, g = p.relatedTarget, v = y && m.contains(y);
t.trapped || g && m.contains(g) || (i = g), v && e("focusin", p), !o.paused && t.trapped && (v ? n = y : zo(n, !0));
}, d = (p) => {
const m = N(r);
if (!(o.paused || !m))
if (t.trapped) {
const y = p.relatedTarget;
!ts(y) && !m.contains(y) && setTimeout(() => {
if (!o.paused && t.trapped) {
const g = Np({
focusReason: a.value
});
e("focusout-prevented", g), g.defaultPrevented || zo(n, !0);
}
}, 0);
} else {
const y = p.target;
y && m.contains(y) || e("focusout", p);
}
};
async function h() {
await st();
const p = N(r);
if (p) {
I2.push(o);
const m = p.contains(document.activeElement) ? i : document.activeElement;
if (i = m, !p.contains(m)) {
const y = new Event(Rv, k2);
p.addEventListener(Rv, c), p.dispatchEvent(y), y.defaultPrevented || st(() => {
let g = t.focusStartEl;
Ei(g) || (zo(g), document.activeElement !== g && (g = "first")), g === "first" && Uz(jC(p), !0), (document.activeElement === m || g === "container") && zo(p);
});
}
}
}
function f() {
const p = N(r);
if (p) {
p.removeEventListener(Rv, c);
const m = new CustomEvent(Ov, {
...k2,
detail: {
focusReason: a.value
}
});
p.addEventListener(Ov, l), p.dispatchEvent(m), !m.defaultPrevented && (a.value == "keyboard" || !jz() || p.contains(document.activeElement)) && zo(i ?? document.body), p.removeEventListener(Ov, l), I2.remove(o);
}
}
return Lt(() => {
t.trapped && h(), ze(() => t.trapped, (p) => {
p ? h() : f();
});
}), Sr(() => {
t.trapped && f(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", u), r.value.removeEventListener("focusout", d), r.value = void 0);
}), {
onKeydown: s
};
}
});
function Wz(t, e, r, i, n, a) {
return Fe(t.$slots, "default", { handleKeydown: t.onKeydown });
}
var qz = /* @__PURE__ */ Mt(Gz, [["render", Wz], ["__file", "focus-trap.vue"]]);
const Xz = ["fixed", "absolute"], Zz = Kt({
boundariesPadding: {
type: Number,
default: 0
},
fallbackPlacements: {
type: vt(Array),
default: void 0
},
gpuAcceleration: {
type: Boolean,
default: !0
},
offset: {
type: Number,
default: 12
},
placement: {
type: String,
values: yg,
default: "bottom"
},
popperOptions: {
type: vt(Object),
default: () => ({})
},
strategy: {
type: String,
values: Xz,
default: "absolute"
}
}), HC = Kt({
...Zz,
id: String,
style: {
type: vt([String, Array, Object])
},
className: {
type: vt([String, Array, Object])
},
effect: {
type: vt(String),
default: "dark"
},
visible: Boolean,
enterable: {
type: Boolean,
default: !0
},
pure: Boolean,
focusOnShow: {
type: Boolean,
default: !1
},
trapping: {
type: Boolean,
default: !1
},
popperClass: {
type: vt([String, Array, Object])
},
popperStyle: {
type: vt([String, Array, Object])
},
referenceEl: {
type: vt(Object)
},
triggerTargetEl: {
type: vt(Object)
},
stopPopperMouseEvent: {
type: Boolean,
default: !0
},
virtualTriggering: Boolean,
zIndex: Number,
...Ts(["ariaLabel"])
}), Yz = {
mouseenter: (t) => t instanceof MouseEvent,
mouseleave: (t) => t instanceof MouseEvent,
focus: () => !0,
blur: () => !0,
close: () => !0
}, Kz = (t, e = []) => {
const { placement: r, strategy: i, popperOptions: n } = t, a = {
placement: r,
strategy: i,
...n,
modifiers: [...Qz(t), ...e]
};
return e$(a, n == null ? void 0 : n.modifiers), a;
}, Jz = (t) => {
if ($r)
return qa(t);
};
function Qz(t) {
const { offset: e, gpuAcceleration: r, fallbackPlacements: i } = t;
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: i
}
},
{
name: "computeStyles",
options: {
gpuAcceleration: r
}
}
];
}
function e$(t, e) {
e && (t.modifiers = [...t.modifiers, ...e ?? []]);
}
const t$ = 0, r$ = (t) => {
const { popperInstanceRef: e, contentRef: r, triggerRef: i, role: n } = Ye(vb, void 0), a = we(), o = we(), s = ee(() => ({
name: "eventListeners",
enabled: !!t.visible
})), c = ee(() => {
var g;
const v = N(a), x = (g = N(o)) != null ? g : t$;
return {
name: "arrow",
enabled: !B5(v),
options: {
element: v,
padding: x
}
};
}), l = ee(() => ({
onFirstUpdate: () => {
p();
},
...Kz(t, [
N(c),
N(s)
])
})), u = ee(() => Jz(t.referenceEl) || N(i)), { attributes: d, state: h, styles: f, update: p, forceUpdate: m, instanceRef: y } = PF(u, r, l);
return ze(y, (g) => e.value = g), Lt(() => {
ze(() => {
var g;
return (g = N(u)) == null ? void 0 : g.getBoundingClientRect();
}, () => {
p();
});
}), {
attributes: d,
arrowRef: a,
contentRef: r,
instanceRef: y,
state: h,
styles: f,
role: n,
forceUpdate: m,
update: p
};
}, i$ = (t, {
attributes: e,
styles: r,
role: i
}) => {
const { nextZIndex: n } = OC(), a = Et("popper"), o = ee(() => N(e).popper), s = we(hi(t.zIndex) ? t.zIndex : n()), c = ee(() => [
a.b(),
a.is("pure", t.pure),
a.is(t.effect),
t.popperClass
]), l = ee(() => [
{ zIndex: N(s) },
N(r).popper,
t.popperStyle || {}
]), u = ee(() => i.value === "dialog" ? "false" : void 0), d = ee(() => N(r).arrow || {});
return {
ariaModal: u,
arrowStyle: d,
contentAttrs: o,
contentClass: c,
contentStyle: l,
contentZIndex: s,
updateZIndex: () => {
s.value = hi(t.zIndex) ? t.zIndex : n();
}
};
}, n$ = (t, e) => {
const r = we(!1), i = we();
return {
focusStartRef: i,
trapped: r,
onFocusAfterReleased: (n) => {
var a;
((a = n.detail) == null ? void 0 : a.focusReason) !== "pointer" && (i.value = "first", e("blur"));
},
onFocusAfterTrapped: () => {
e("focus");
},
onFocusInTrap: (n) => {
t.visible && !r.value && (n.target && (i.value = n.target), r.value = !0);
},
onFocusoutPrevented: (n) => {
t.trapping || (n.detail.focusReason === "pointer" && n.preventDefault(), r.value = !1);
},
onReleaseRequested: () => {
r.value = !1, e("close");
}
};
}, a$ = Le({
name: "ElPopperContent"
}), o$ = /* @__PURE__ */ Le({
...a$,
props: HC,
emits: Yz,
setup(t, { expose: e, emit: r }) {
const i = t, {
focusStartRef: n,
trapped: a,
onFocusAfterReleased: o,
onFocusAfterTrapped: s,
onFocusInTrap: c,
onFocusoutPrevented: l,
onReleaseRequested: u
} = n$(i, r), { attributes: d, arrowRef: h, contentRef: f, styles: p, instanceRef: m, role: y, update: g } = r$(i), {
ariaModal: v,
arrowStyle: x,
contentAttrs: w,
contentClass: S,
contentStyle: _,
updateZIndex: b
} = i$(i, {
styles: p,
attributes: d,
role: y
}), T = Ye(dh, void 0), E = we();
Dt(FC, {
arrowStyle: x,
arrowRef: h,
arrowOffset: E
}), T && Dt(dh, {
...T,
addInputId: oh,
removeInputId: oh
});
let C;
const L = (k = !0) => {
g(), k && b();
}, A = () => {
L(!1), i.visible && i.focusOnShow ? a.value = !0 : i.visible === !1 && (a.value = !1);
};
return Lt(() => {
ze(() => i.triggerTargetEl, (k, P) => {
C == null || C(), C = void 0;
const R = N(k || f.value), M = N(P || f.value);
ol(R) && (C = ze([y, () => i.ariaLabel, v, () => i.id], (O) => {
["role", "aria-label", "aria-modal", "id"].forEach((D, I) => {
ts(O[I]) ? R.removeAttribute(D) : R.setAttribute(D, O[I]);
});
}, { immediate: !0 })), M !== R && ol(M) && ["role", "aria-label", "aria-modal", "id"].forEach((O) => {
M.removeAttribute(O);
});
}, { immediate: !0 }), ze(() => i.visible, A, { immediate: !0 });
}), Sr(() => {
C == null || C(), C = void 0;
}), e({
popperContentRef: f,
popperInstanceRef: m,
updatePopper: L,
contentStyle: _
}), (k, P) => (Q(), be("div", Nr({
ref_key: "contentRef",
ref: f
}, N(w), {
style: N(_),
class: N(S),
tabindex: "-1",
onMouseenter: (R) => k.$emit("mouseenter", R),
onMouseleave: (R) => k.$emit("mouseleave", R)
}), [
oe(N(qz), {
trapped: N(a),
"trap-on-focus-in": !0,
"focus-trap-el": N(f),
"focus-start-el": N(n),
onFocusAfterTrapped: N(s),
onFocusAfterReleased: N(o),
onFocusin: N(c),
onFocusoutPrevented: N(l),
onReleaseRequested: N(u)
}, {
default: le(() => [
Fe(k.$slots, "default")
]),
_: 3
}, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
], 16, ["onMouseenter", "onMouseleave"]));
}
});
var s$ = /* @__PURE__ */ Mt(o$, [["__file", "content.vue"]]);
const l$ = ni(Cz), xb = Symbol("elTooltip"), $i = Kt({
...BF,
...HC,
appendTo: {
type: vt([String, Object])
},
content: {
type: String,
default: ""
},
rawContent: Boolean,
persistent: Boolean,
visible: {
type: vt(Boolean),
default: null
},
transition: String,
teleported: {
type: Boolean,
default: !0
},
disabled: Boolean,
...Ts(["ariaLabel"])
}), hh = Kt({
...UC,
disabled: Boolean,
trigger: {
type: vt([String, Array]),
default: "hover"
},
triggerKeys: {
type: vt(Array),
default: () => [Gr.enter, Gr.space]
}
}), {
useModelToggleProps: c$,
useModelToggleEmits: u$,
useModelToggle: d$
} = AB("visible"), h$ = Kt({
...zC,
...c$,
...$i,
...hh,
...$C,
showArrow: {
type: Boolean,
default: !0
}
}), p$ = [
...u$,
"before-show",
"before-hide",
"show",
"hide",
"open",
"close"
], f$ = (t, e) => Ui(t) ? t.includes(e) : t === e, Ql = (t, e, r) => (i) => {
f$(N(t), e) && r(i);
}, m$ = Le({
name: "ElTooltipTrigger"
}), g$ = /* @__PURE__ */ Le({
...m$,
props: hh,
setup(t, { expose: e }) {
const r = t, i = Et("tooltip"), { controlled: n, id: a, open: o, onOpen: s, onClose: c, onToggle: l } = Ye(xb, void 0), u = we(null), d = () => {
if (N(n) || r.disabled)
return !0;
}, h = pr(r, "trigger"), f = $a(d, Ql(h, "hover", s)), p = $a(d, Ql(h, "hover", c)), m = $a(d, Ql(h, "click", (w) => {
w.button === 0 && l(w);
})), y = $a(d, Ql(h, "focus", s)), g = $a(d, Ql(h, "focus", c)), v = $a(d, Ql(h, "contextmenu", (w) => {
w.preventDefault(), l(w);
})), x = $a(d, (w) => {
const { code: S } = w;
r.triggerKeys.includes(S) && (w.preventDefault(), l(w));
});
return e({
triggerRef: u
}), (w, S) => (Q(), Re(N(Dz), {
id: N(a),
"virtual-ref": w.virtualRef,
open: N(o),
"virtual-triggering": w.virtualTriggering,
class: xe(N(i).e("trigger")),
onBlur: N(g),
onClick: N(m),
onContextmenu: N(v),
onFocus: N(y),
onMouseenter: N(f),
onMouseleave: N(p),
onKeydown: N(x)
}, {
default: le(() => [
Fe(w.$slots, "default")
]),
_: 3
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]));
}
});
var v$ = /* @__PURE__ */ Mt(g$, [["__file", "trigger.vue"]]);
const y$ = Kt({
to: {
type: vt([String, Object]),
required: !0
},
disabled: Boolean
}), b$ = /* @__PURE__ */ Le({
__name: "teleport",
props: y$,
setup(t) {
return (e, r) => e.disabled ? Fe(e.$slots, "default", { key: 0 }) : (Q(), Re(NT, {
key: 1,
to: e.to
}, [
Fe(e.$slots, "default")
], 8, ["to"]));
}
});
var x$ = /* @__PURE__ */ Mt(b$, [["__file", "teleport.vue"]]);
const w$ = ni(x$), _$ = Le({
name: "ElTooltipContent",
inheritAttrs: !1
}), S$ = /* @__PURE__ */ Le({
..._$,
props: $i,
setup(t, { expose: e }) {
const r = t, { selector: i } = LC(), n = Et("tooltip"), a = we(null);
let o;
const {
controlled: s,
id: c,
open: l,
trigger: u,
onClose: d,
onOpen: h,
onShow: f,
onHide: p,
onBeforeShow: m,
onBeforeHide: y
} = Ye(xb, void 0), g = ee(() => r.transition || `${n.namespace.value}-fade-in-linear`), v = ee(() => process.env.NODE_ENV === "test" ? !0 : r.persistent);
Sr(() => {
o == null || o();
});
const x = ee(() => N(v) ? !0 : N(l)), w = ee(() => r.disabled ? !1 : N(l)), S = ee(() => r.appendTo || i.value), _ = ee(() => {
var M;
return (M = r.style) != null ? M : {};
}), b = we(!0), T = () => {
p(), b.value = !0;
}, E = () => {
if (N(s))
return !0;
}, C = $a(E, () => {
r.enterable && N(u) === "hover" && h();
}), L = $a(E, () => {
N(u) === "hover" && d();
}), A = () => {
var M, O;
(O = (M = a.value) == null ? void 0 : M.updatePopper) == null || O.call(M), m == null || m();
}, k = () => {
y == null || y();
}, P = () => {
f(), o = kD(ee(() => {
var M;
return (M = a.value) == null ? void 0 : M.popperContentRef;
}), () => {
N(s) || N(u) !== "hover" && d();
});
}, R = () => {
r.virtualTriggering || d();
};
return ze(() => N(l), (M) => {
M ? b.value = !1 : o == null || o();
}, {
flush: "post"
}), ze(() => r.content, () => {
var M, O;
(O = (M = a.value) == null ? void 0 : M.updatePopper) == null || O.call(M);
}), e({
contentRef: a
}), (M, O) => (Q(), Re(N(w$), {
disabled: !M.teleported,
to: N(S)
}, {
default: le(() => [
oe(Zn, {
name: N(g),
onAfterLeave: T,
onBeforeEnter: A,
onAfterEnter: P,
onBeforeLeave: k
}, {
default: le(() => [
N(x) ? ht((Q(), Re(N(s$), Nr({
key: 0,
id: N(c),
ref_key: "contentRef",
ref: a
}, M.$attrs, {
"aria-label": M.ariaLabel,
"aria-hidden": b.value,
"boundaries-padding": M.boundariesPadding,
"fallback-placements": M.fallbackPlacements,
"gpu-acceleration": M.gpuAcceleration,
offset: M.offset,
placement: M.placement,
"popper-options": M.popperOptions,
strategy: M.strategy,
effect: M.effect,
enterable: M.enterable,
pure: M.pure,
"popper-class": M.popperClass,
"popper-style": [M.popperStyle, N(_)],
"reference-el": M.referenceEl,
"trigger-target-el": M.triggerTargetEl,
visible: N(w),
"z-index": M.zIndex,
onMouseenter: N(C),
onMouseleave: N(L),
onBlur: R,
onClose: N(d)
}), {
default: le(() => [
Fe(M.$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"])), [
[Ot, N(w)]
]) : Pe("v-if", !0)
]),
_: 3
}, 8, ["name"])
]),
_: 3
}, 8, ["disabled", "to"]));
}
});
var M$ = /* @__PURE__ */ Mt(S$, [["__file", "content.vue"]]);
const E$ = Le({
name: "ElTooltip"
}), T$ = /* @__PURE__ */ Le({
...E$,
props: h$,
emits: p$,
setup(t, { expose: e, emit: r }) {
const i = t;
NF();
const n = xg(), a = we(), o = we(), s = () => {
var g;
const v = N(a);
v && ((g = v.popperInstanceRef) == null || g.update());
}, c = we(!1), l = we(), { show: u, hide: d, hasUpdateHandler: h } = d$({
indicator: c,
toggleReason: l
}), { onOpen: f, onClose: p } = FF({
showAfter: pr(i, "showAfter"),
hideAfter: pr(i, "hideAfter"),
autoClose: pr(i, "autoClose"),
open: u,
close: d
}), m = ee(() => Zc(i.visible) && !h.value);
Dt(xb, {
controlled: m,
id: n,
open: U1(c),
trigger: pr(i, "trigger"),
onOpen: (g) => {
f(g);
},
onClose: (g) => {
p(g);
},
onToggle: (g) => {
N(c) ? p(g) : f(g);
},
onShow: () => {
r("show", l.value);
},
onHide: () => {
r("hide", l.value);
},
onBeforeShow: () => {
r("before-show", l.value);
},
onBeforeHide: () => {
r("before-hide", l.value);
},
updatePopper: s
}), ze(() => i.disabled, (g) => {
g && c.value && (c.value = !1);
});
const y = (g) => {
var v, x;
const w = (x = (v = o.value) == null ? void 0 : v.contentRef) == null ? void 0 : x.popperContentRef, S = (g == null ? void 0 : g.relatedTarget) || document.activeElement;
return w && w.contains(S);
};
return RT(() => c.value && d()), e({
popperRef: a,
contentRef: o,
isFocusInsideContent: y,
updatePopper: s,
onOpen: f,
onClose: p,
hide: d
}), (g, v) => (Q(), Re(N(l$), {
ref_key: "popperRef",
ref: a,
role: g.role
}, {
default: le(() => [
oe(v$, {
disabled: g.disabled,
trigger: g.trigger,
"trigger-keys": g.triggerKeys,
"virtual-ref": g.virtualRef,
"virtual-triggering": g.virtualTriggering
}, {
default: le(() => [
g.$slots.default ? Fe(g.$slots, "default", { key: 0 }) : Pe("v-if", !0)
]),
_: 3
}, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
oe(M$, {
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: le(() => [
Fe(g.$slots, "content", {}, () => [
g.rawContent ? (Q(), be("span", {
key: 0,
innerHTML: g.content
}, null, 8, ["innerHTML"])) : (Q(), be("span", { key: 1 }, Ze(g.content), 1))
]),
g.showArrow ? (Q(), Re(N(kz), {
key: 0,
"arrow-offset": g.arrowOffset
}, null, 8, ["arrow-offset"])) : Pe("v-if", !0)
]),
_: 3
}, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
]),
_: 3
}, 8, ["role"]));
}
});
var C$ = /* @__PURE__ */ Mt(T$, [["__file", "tooltip.vue"]]);
const wb = ni(C$), GC = Symbol("buttonGroupContextKey"), A$ = (t, e) => {
tm({
from: "type.text",
replacement: "link",
version: "3.0.0",
scope: "props",
ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
}, ee(() => t.type === "text"));
const r = Ye(GC, void 0), i = fb("button"), { form: n } = zl(), a = bl(ee(() => r == null ? void 0 : r.size)), o = Yh(), s = we(), c = co(), l = ee(() => t.type || (r == null ? void 0 : r.type) || ""), u = ee(() => {
var f, p, m;
return (m = (p = t.autoInsertSpace) != null ? p : (f = i.value) == null ? void 0 : f.autoInsertSpace) != null ? m : !1;
}), d = ee(() => t.tag === "button" ? {
ariaDisabled: o.value || t.loading,
disabled: o.value || t.loading,
autofocus: t.autofocus,
type: t.nativeType
} : {}), h = ee(() => {
var f;
const p = (f = c.default) == null ? void 0 : f.call(c);
if (u.value && (p == null ? void 0 : p.length) === 1) {
const m = p[0];
if ((m == null ? void 0 : m.type) === sg) {
const y = m.children;
return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim());
}
}
return !1;
});
return {
_disabled: o,
_size: a,
_type: l,
_ref: s,
_props: d,
shouldAddSpace: h,
handleClick: (f) => {
if (o.value || t.loading) {
f.stopPropagation();
return;
}
t.nativeType === "reset" && (n == null || n.resetFields()), e("click", f);
}
};
}, L$ = [
"default",
"primary",
"success",
"warning",
"info",
"danger",
"text",
""
], k$ = ["button", "submit", "reset"], vy = Kt({
size: Du,
disabled: Boolean,
type: {
type: String,
values: L$,
default: ""
},
icon: {
type: cs
},
nativeType: {
type: String,
values: k$,
default: "button"
},
loading: Boolean,
loadingIcon: {
type: cs,
default: () => rb
},
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: vt([String, Object]),
default: "button"
}
}), P$ = {
click: (t) => t instanceof MouseEvent
};
function pi(t, e) {
R$(t) && (t = "100%");
var r = O$(t);
return t = e === 360 ? t : Math.min(e, Math.max(0, parseFloat(t))), r && (t = parseInt(String(t * e), 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : (e === 360 ? t = (t < 0 ? t % e + e : t % e) / parseFloat(String(e)) : t = t % e / parseFloat(String(e)), t);
}
function Bp(t) {
return Math.min(1, Math.max(0, t));
}
function R$(t) {
return typeof t == "string" && t.indexOf(".") !== -1 && parseFloat(t) === 1;
}
function O$(t) {
return typeof t == "string" && t.indexOf("%") !== -1;
}
function WC(t) {
return t = parseFloat(t), (isNaN(t) || t < 0 || t > 1) && (t = 1), t;
}
function Fp(t) {
return t <= 1 ? "".concat(Number(t) * 100, "%") : t;
}
function tl(t) {
return t.length === 1 ? "0" + t : String(t);
}
function D$(t, e, r) {
return {
r: pi(t, 255) * 255,
g: pi(e, 255) * 255,
b: pi(r, 255) * 255
};
}
function B2(t, e, r) {
t = pi(t, 255), e = pi(e, 255), r = pi(r, 255);
var i = Math.max(t, e, r), n = Math.min(t, e, r), a = 0, o = 0, s = (i + n) / 2;
if (i === n)
o = 0, a = 0;
else {
var c = i - n;
switch (o = s > 0.5 ? c / (2 - i - n) : c / (i + n), i) {
case t:
a = (e - r) / c + (e < r ? 6 : 0);
break;
case e:
a = (r - t) / c + 2;
break;
case r:
a = (t - e) / c + 4;
break;
}
a /= 6;
}
return { h: a, s: o, l: s };
}
function Dv(t, e, r) {
return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t;
}
function I$(t, e, r) {
var i, n, a;
if (t = pi(t, 360), e = pi(e, 100), r = pi(r, 100), e === 0)
n = r, a = r, i = r;
else {
var o = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - o;
i = Dv(s, o, t + 1 / 3), n = Dv(s, o, t), a = Dv(s, o, t - 1 / 3);
}
return { r: i * 255, g: n * 255, b: a * 255 };
}
function F2(t, e, r) {
t = pi(t, 255), e = pi(e, 255), r = pi(r, 255);
var i = Math.max(t, e, r), n = Math.min(t, e, r), a = 0, o = i, s = i - n, c = i === 0 ? 0 : s / i;
if (i === n)
a = 0;
else {
switch (i) {
case t:
a = (e - r) / s + (e < r ? 6 : 0);
break;
case e:
a = (r - t) / s + 2;
break;
case r:
a = (t - e) / s + 4;
break;
}
a /= 6;
}
return { h: a, s: c, v: o };
}
function N$(t, e, r) {
t = pi(t, 360) * 6, e = pi(e, 100), r = pi(r, 100);
var i = Math.floor(t), n = t - i, a = r * (1 - e), o = r * (1 - n * e), s = r * (1 - (1 - n) * e), c = i % 6, l = [r, o, a, a, s, r][c], u = [s, r, r, o, a, a][c], d = [a, a, s, r, r, o][c];
return { r: l * 255, g: u * 255, b: d * 255 };
}
function z2(t, e, r, i) {
var n = [
tl(Math.round(t).toString(16)),
tl(Math.round(e).toString(16)),
tl(Math.round(r).toString(16))
];
return i && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
}
function B$(t, e, r, i, n) {
var a = [
tl(Math.round(t).toString(16)),
tl(Math.round(e).toString(16)),
tl(Math.round(r).toString(16)),
tl(F$(i))
];
return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) && a[3].startsWith(a[3].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
}
function F$(t) {
return Math.round(parseFloat(t) * 255).toString(16);
}
function $2(t) {
return tn(t) / 255;
}
function tn(t) {
return parseInt(t, 16);
}
function z$(t) {
return {
r: t >> 16,
g: (t & 65280) >> 8,
b: t & 255
};
}
var yy = {
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 $$(t) {
var e = { r: 0, g: 0, b: 0 }, r = 1, i = null, n = null, a = null, o = !1, s = !1;
return typeof t == "string" && (t = j$(t)), typeof t == "object" && (ka(t.r) && ka(t.g) && ka(t.b) ? (e = D$(t.r, t.g, t.b), o = !0, s = String(t.r).substr(-1) === "%" ? "prgb" : "rgb") : ka(t.h) && ka(t.s) && ka(t.v) ? (i = Fp(t.s), n = Fp(t.v), e = N$(t.h, i, n), o = !0, s = "hsv") : ka(t.h) && ka(t.s) && ka(t.l) && (i = Fp(t.s), a = Fp(t.l), e = I$(t.h, i, a), o = !0, s = "hsl"), Object.prototype.hasOwnProperty.call(t, "a") && (r = t.a)), r = WC(r), {
ok: o,
format: t.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 V$ = "[-\\+]?\\d+%?", U$ = "[-\\+]?\\d*\\.\\d+%?", Ko = "(?:".concat(U$, ")|(?:").concat(V$, ")"), Iv = "[\\s|\\(]+(".concat(Ko, ")[,|\\s]+(").concat(Ko, ")[,|\\s]+(").concat(Ko, ")\\s*\\)?"), Nv = "[\\s|\\(]+(".concat(Ko, ")[,|\\s]+(").concat(Ko, ")[,|\\s]+(").concat(Ko, ")[,|\\s]+(").concat(Ko, ")\\s*\\)?"), Nn = {
CSS_UNIT: new RegExp(Ko),
rgb: new RegExp("rgb" + Iv),
rgba: new RegExp("rgba" + Nv),
hsl: new RegExp("hsl" + Iv),
hsla: new RegExp("hsla" + Nv),
hsv: new RegExp("hsv" + Iv),
hsva: new RegExp("hsva" + Nv),
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 j$(t) {
if (t = t.trim().toLowerCase(), t.length === 0)
return !1;
var e = !1;
if (yy[t])
t = yy[t], e = !0;
else if (t === "transparent")
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
var r = Nn.rgb.exec(t);
return r ? { r: r[1], g: r[2], b: r[3] } : (r = Nn.rgba.exec(t), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = Nn.hsl.exec(t), r ? { h: r[1], s: r[2], l: r[3] } : (r = Nn.hsla.exec(t), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = Nn.hsv.exec(t), r ? { h: r[1], s: r[2], v: r[3] } : (r = Nn.hsva.exec(t), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = Nn.hex8.exec(t), r ? {
r: tn(r[1]),
g: tn(r[2]),
b: tn(r[3]),
a: $2(r[4]),
format: e ? "name" : "hex8"
} : (r = Nn.hex6.exec(t), r ? {
r: tn(r[1]),
g: tn(r[2]),
b: tn(r[3]),
format: e ? "name" : "hex"
} : (r = Nn.hex4.exec(t), r ? {
r: tn(r[1] + r[1]),
g: tn(r[2] + r[2]),
b: tn(r[3] + r[3]),
a: $2(r[4] + r[4]),
format: e ? "name" : "hex8"
} : (r = Nn.hex3.exec(t), r ? {
r: tn(r[1] + r[1]),
g: tn(r[2] + r[2]),
b: tn(r[3] + r[3]),
format: e ? "name" : "hex"
} : !1)))))))));
}
function ka(t) {
return !!Nn.CSS_UNIT.exec(String(t));
}
var H$ = (
/** @class */
function() {
function t(e, r) {
e === void 0 && (e = ""), r === void 0 && (r = {});
var i;
if (e instanceof t)
return e;
typeof e == "number" && (e = z$(e)), this.originalInput = e;
var n = $$(e);
this.originalInput = e, this.r = n.r, this.g = n.g, this.b = n.b, this.a = n.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (i = r.format) !== null && i !== void 0 ? i : n.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 = n.ok;
}
return t.prototype.isDark = function() {
return this.getBrightness() < 128;
}, t.prototype.isLight = function() {
return !this.isDark();
}, t.prototype.getBrightness = function() {
var e = this.toRgb();
return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
}, t.prototype.getLuminance = function() {
var e = this.toRgb(), r, i, n, a = e.r / 255, o = e.g / 255, s = e.b / 255;
return a <= 0.03928 ? r = a / 12.92 : r = Math.pow((a + 0.055) / 1.055, 2.4), o <= 0.03928 ? i = o / 12.92 : i = Math.pow((o + 0.055) / 1.055, 2.4), s <= 0.03928 ? n = s / 12.92 : n = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * i + 0.0722 * n;
}, t.prototype.getAlpha = function() {
return this.a;
}, t.prototype.setAlpha = function(e) {
return this.a = WC(e), this.roundA = Math.round(100 * this.a) / 100, this;
}, t.prototype.isMonochrome = function() {
var e = this.toHsl().s;
return e === 0;
}, t.prototype.toHsv = function() {
var e = F2(this.r, this.g, this.b);
return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
}, t.prototype.toHsvString = function() {
var e = F2(this.r, this.g, this.b), r = Math.round(e.h * 360), i = Math.round(e.s * 100), n = Math.round(e.v * 100);
return this.a === 1 ? "hsv(".concat(r, ", ").concat(i, "%, ").concat(n, "%)") : "hsva(".concat(r, ", ").concat(i, "%, ").concat(n, "%, ").concat(this.roundA, ")");
}, t.prototype.toHsl = function() {
var e = B2(this.r, this.g, this.b);
return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
}, t.prototype.toHslString = function() {
var e = B2(this.r, this.g, this.b), r = Math.round(e.h * 360), i = Math.round(e.s * 100), n = Math.round(e.l * 100);
return this.a === 1 ? "hsl(".concat(r, ", ").concat(i, "%, ").concat(n, "%)") : "hsla(".concat(r, ", ").concat(i, "%, ").concat(n, "%, ").concat(this.roundA, ")");
}, t.prototype.toHex = function(e) {
return e === void 0 && (e = !1), z2(this.r, this.g, this.b, e);
}, t.prototype.toHexString = function(e) {
return e === void 0 && (e = !1), "#" + this.toHex(e);
}, t.prototype.toHex8 = function(e) {
return e === void 0 && (e = !1), B$(this.r, this.g, this.b, this.a, e);
}, t.prototype.toHex8String = function(e) {
return e === void 0 && (e = !1), "#" + this.toHex8(e);
}, t.prototype.toHexShortString = function(e) {
return e === void 0 && (e = !1), this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
}, t.prototype.toRgb = function() {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a
};
}, t.prototype.toRgbString = function() {
var e = Math.round(this.r), r = Math.round(this.g), i = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(i, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(i, ", ").concat(this.roundA, ")");
}, t.prototype.toPercentageRgb = function() {
var e = function(r) {
return "".concat(Math.round(pi(r, 255) * 100), "%");
};
return {
r: e(this.r),
g: e(this.g),
b: e(this.b),
a: this.a
};
}, t.prototype.toPercentageRgbString = function() {
var e = function(r) {
return Math.round(pi(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, ")");
}, t.prototype.toName = function() {
if (this.a === 0)
return "transparent";
if (this.a < 1)
return !1;
for (var e = "#" + z2(this.r, this.g, this.b, !1), r = 0, i = Object.entries(yy); r < i.length; r++) {
var n = i[r], a = n[0], o = n[1];
if (e === o)
return a;
}
return !1;
}, t.prototype.toString = function(e) {
var r = !!e;
e = e ?? this.format;
var i = !1, n = this.a < 1 && this.a >= 0, a = !r && n && (e.startsWith("hex") || e === "name");
return a ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (i = this.toRgbString()), e === "prgb" && (i = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (i = this.toHexString()), e === "hex3" && (i = this.toHexString(!0)), e === "hex4" && (i = this.toHex8String(!0)), e === "hex8" && (i = this.toHex8String()), e === "name" && (i = this.toName()), e === "hsl" && (i = this.toHslString()), e === "hsv" && (i = this.toHsvString()), i || this.toHexString());
}, t.prototype.toNumber = function() {
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
}, t.prototype.clone = function() {
return new t(this.toString());
}, t.prototype.lighten = function(e) {
e === void 0 && (e = 10);
var r = this.toHsl();
return r.l += e / 100, r.l = Bp(r.l), new t(r);
}, t.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 t(r);
}, t.prototype.darken = function(e) {
e === void 0 && (e = 10);
var r = this.toHsl();
return r.l -= e / 100, r.l = Bp(r.l), new t(r);
}, t.prototype.tint = function(e) {
return e === void 0 && (e = 10), this.mix("white", e);
}, t.prototype.shade = function(e) {
return e === void 0 && (e = 10), this.mix("black", e);
}, t.prototype.desaturate = function(e) {
e === void 0 && (e = 10);
var r = this.toHsl();
return r.s -= e / 100, r.s = Bp(r.s), new t(r);
}, t.prototype.saturate = function(e) {
e === void 0 && (e = 10);
var r = this.toHsl();
return r.s += e / 100, r.s = Bp(r.s), new t(r);
}, t.prototype.greyscale = function() {
return this.desaturate(100);
}, t.prototype.spin = function(e) {
var r = this.toHsl(), i = (r.h + e) % 360;
return r.h = i < 0 ? 360 + i : i, new t(r);
}, t.prototype.mix = function(e, r) {
r === void 0 && (r = 50);
var i = this.toRgb(), n = new t(e).toRgb(), a = r / 100, o = {
r: (n.r - i.r) * a + i.r,
g: (n.g - i.g) * a + i.g,
b: (n.b - i.b) * a + i.b,
a: (n.a - i.a) * a + i.a
};
return new t(o);
}, t.prototype.analogous = function(e, r) {
e === void 0 && (e = 6), r === void 0 && (r = 30);
var i = this.toHsl(), n = 360 / r, a = [this];
for (i.h = (i.h - (n * e >> 1) + 720) % 360; --e; )
i.h = (i.h + n) % 360, a.push(new t(i));
return a;
}, t.prototype.complement = function() {
var e = this.toHsl();
return e.h = (e.h + 180) % 360, new t(e);
}, t.prototype.monochromatic = function(e) {
e === void 0 && (e = 6);
for (var r = this.toHsv(), i = r.h, n = r.s, a = r.v, o = [], s = 1 / e; e--; )
o.push(new t({ h: i, s: n, v: a })), a = (a + s) % 1;
return o;
}, t.prototype.splitcomplement = function() {
var e = this.toHsl(), r = e.h;
return [
this,
new t({ h: (r + 72) % 360, s: e.s, l: e.l }),
new t({ h: (r + 216) % 360, s: e.s, l: e.l })
];
}, t.prototype.onBackground = function(e) {
var r = this.toRgb(), i = new t(e).toRgb(), n = r.a + i.a * (1 - r.a);
return new t({
r: (r.r * r.a + i.r * i.a * (1 - r.a)) / n,
g: (r.g * r.a + i.g * i.a * (1 - r.a)) / n,
b: (r.b * r.a + i.b * i.a * (1 - r.a)) / n,
a: n
});
}, t.prototype.triad = function() {
return this.polyad(3);
}, t.prototype.tetrad = function() {
return this.polyad(4);
}, t.prototype.polyad = function(e) {
for (var r = this.toHsl(), i = r.h, n = [this], a = 360 / e, o = 1; o < e; o++)
n.push(new t({ h: (i + o * a) % 360, s: r.s, l: r.l }));
return n;
}, t.prototype.equals = function(e) {
return this.toRgbString() === new t(e).toRgbString();
}, t;
}()
);
function To(t, e = 20) {
return t.mix("#141414", e).toString();
}
function G$(t) {
const e = Yh(), r = Et("button");
return ee(() => {
let i = {}, n = t.color;
if (n) {
const a = n.match(/var\((.*?)\)/);
a && (n = window.getComputedStyle(window.document.documentElement).getPropertyValue(a[1]));
const o = new H$(n), s = t.dark ? o.tint(20).toString() : To(o, 20);
if (t.plain)
i = r.cssVarBlock({
"bg-color": t.dark ? To(o, 90) : o.tint(90).toString(),
"text-color": n,
"border-color": t.dark ? To(o, 50) : o.tint(50).toString(),
"hover-text-color": `var(${r.cssVarName("color-white")})`,
"hover-bg-color": n,
"hover-border-color": n,
"active-bg-color": s,
"active-text-color": `var(${r.cssVarName("color-white")})`,
"active-border-color": s
}), e.value && (i[r.cssVarBlockName("disabled-bg-color")] = t.dark ? To(o, 90) : o.tint(90).toString(), i[r.cssVarBlockName("disabled-text-color")] = t.dark ? To(o, 50) : o.tint(50).toString(), i[r.cssVarBlockName("disabled-border-color")] = t.dark ? To(o, 80) : o.tint(80).toString());
else {
const c = t.dark ? To(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`;
if (i = r.cssVarBlock({
"bg-color": n,
"text-color": l,
"border-color": n,
"hover-bg-color": c,
"hover-text-color": l,
"hover-border-color": c,
"active-bg-color": s,
"active-border-color": s
}), e.value) {
const u = t.dark ? To(o, 50) : o.tint(50).toString();
i[r.cssVarBlockName("disabled-bg-color")] = u, i[r.cssVarBlockName("disabled-text-color")] = t.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, i[r.cssVarBlockName("disabled-border-color")] = u;
}
}
}
return i;
});
}
const W$ = Le({
name: "ElButton"
}), q$ = /* @__PURE__ */ Le({
...W$,
props: vy,
emits: P$,
setup(t, { expose: e, emit: r }) {
const i = t, n = G$(i), a = Et("button"), { _ref: o, _size: s, _type: c, _disabled: l, _props: u, shouldAddSpace: d, handleClick: h } = A$(i, r), f = ee(() => [
a.b(),
a.m(c.value),
a.m(s.value),
a.is("disabled", l.value),
a.is("loading", i.loading),
a.is("plain", i.plain),
a.is("round", i.round),
a.is("circle", i.circle),
a.is("text", i.text),
a.is("link", i.link),
a.is("has-bg", i.bg)
]);
return e({
ref: o,
size: s,
type: c,
disabled: l,
shouldAddSpace: d
}), (p, m) => (Q(), Re(Yt(p.tag), Nr({
ref_key: "_ref",
ref: o
}, N(u), {
class: N(f),
style: N(n),
onClick: N(h)
}), {
default: le(() => [
p.loading ? (Q(), be(pt, { key: 0 }, [
p.$slots.loading ? Fe(p.$slots, "loading", { key: 0 }) : (Q(), Re(N(Oi), {
key: 1,
class: xe(N(a).is("loading"))
}, {
default: le(() => [
(Q(), Re(Yt(p.loadingIcon)))
]),
_: 1
}, 8, ["class"]))
], 64)) : p.icon || p.$slots.icon ? (Q(), Re(N(Oi), { key: 1 }, {
default: le(() => [
p.icon ? (Q(), Re(Yt(p.icon), { key: 0 })) : Fe(p.$slots, "icon", { key: 1 })
]),
_: 3
})) : Pe("v-if", !0),
p.$slots.default ? (Q(), be("span", {
key: 2,
class: xe({ [N(a).em("text", "expand")]: N(d) })
}, [
Fe(p.$slots, "default")
], 2)) : Pe("v-if", !0)
]),
_: 3
}, 16, ["class", "style", "onClick"]));
}
});
var X$ = /* @__PURE__ */ Mt(q$, [["__file", "button.vue"]]);
const Z$ = {
size: vy.size,
type: vy.type
}, Y$ = Le({
name: "ElButtonGroup"
}), K$ = /* @__PURE__ */ Le({
...Y$,
props: Z$,
setup(t) {
const e = t;
Dt(GC, _r({
size: pr(e, "size"),
type: pr(e, "type")
}));
const r = Et("button");
return (i, n) => (Q(), be("div", {
class: xe(N(r).b("group"))
}, [
Fe(i.$slots, "default")
], 2));
}
});
var qC = /* @__PURE__ */ Mt(K$, [["__file", "button-group.vue"]]);
const us = ni(X$, {
ButtonGroup: qC
}), J$ = po(qC), $o = /* @__PURE__ */ new Map();
if ($r) {
let t;
document.addEventListener("mousedown", (e) => t = e), document.addEventListener("mouseup", (e) => {
if (t) {
for (const r of $o.values())
for (const { documentHandler: i } of r)
i(e, t);
t = void 0;
}
});
}
function V2(t, e) {
let r = [];
return Array.isArray(e.arg) ? r = e.arg : ol(e.arg) && r.push(e.arg), function(i, n) {
const a = e.instance.popperRef, o = i.target, s = n == null ? void 0 : n.target, c = !e || !e.instance, l = !o || !s, u = t.contains(o) || t.contains(s), d = t === o, h = r.length && r.some((p) => p == null ? void 0 : p.contains(o)) || r.length && r.includes(s), f = a && (a.contains(o) || a.contains(s));
c || l || u || d || h || f || e.value(i, n);
};
}
const XC = {
beforeMount(t, e) {
$o.has(t) || $o.set(t, []), $o.get(t).push({
documentHandler: V2(t, e),
bindingFn: e.value
});
},
updated(t, e) {
$o.has(t) || $o.set(t, []);
const r = $o.get(t), i = r.findIndex((a) => a.bindingFn === e.oldValue), n = {
documentHandler: V2(t, e),
bindingFn: e.value
};
i >= 0 ? r.splice(i, 1, n) : r.push(n);
},
unmounted(t) {
$o.delete(t);
}
}, Q$ = Kt({
header: {
type: String,
default: ""
},
footer: {
type: String,
default: ""
},
bodyStyle: {
type: vt([String, Object, Array]),
default: ""
},
bodyClass: String,
shadow: {
type: String,
values: ["always", "hover", "never"],
default: "always"
}
}), e6 = Le({
name: "ElCard"
}), t6 = /* @__PURE__ */ Le({
...e6,
props: Q$,
setup(t) {
const e = Et("card");
return (r, i) => (Q(), be("div", {
class: xe([N(e).b(), N(e).is(`${r.shadow}-shadow`)])
}, [
r.$slots.header || r.header ? (Q(), be("div", {
key: 0,
class: xe(N(e).e("header"))
}, [
Fe(r.$slots, "header", {}, () => [
et(Ze(r.header), 1)
])
], 2)) : Pe("v-if", !0),
Ee("div", {
class: xe([N(e).e("body"), r.bodyClass]),
style: yt(r.bodyStyle)
}, [
Fe(r.$slots, "default")
], 6),
r.$slots.footer || r.footer ? (Q(), be("div", {
key: 1,
class: xe(N(e).e("footer"))
}, [
Fe(r.$slots, "footer", {}, () => [
et(Ze(r.footer), 1)
])
], 2)) : Pe("v-if", !0)
], 2));
}
});
var r6 = /* @__PURE__ */ Mt(t6, [["__file", "card.vue"]]);
const i6 = ni(r6), ZC = {
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: Du,
tabindex: [String, Number],
validateEvent: {
type: Boolean,
default: !0
},
...Ts(["ariaControls"])
}, YC = {
[ui]: (t) => Ei(t) || hi(t) || Zc(t),
change: (t) => Ei(t) || hi(t) || Zc(t)
}, Iu = Symbol("checkboxGroupContextKey"), n6 = ({
model: t,
isChecked: e
}) => {
const r = Ye(Iu, void 0), i = ee(() => {
var n, a;
const o = (n = r == null ? void 0 : r.max) == null ? void 0 : n.value, s = (a = r == null ? void 0 : r.min) == null ? void 0 : a.value;
return !Yo(o) && t.value.length >= o && !e.value || !Yo(s) && t.value.length <= s && e.value;
});
return {
isDisabled: Yh(ee(() => (r == null ? void 0 : r.disabled.value) || i.value)),
isLimitDisabled: i
};
}, a6 = (t, {
model: e,
isLimitExceeded: r,
hasOwnLabel: i,
isDisabled: n,
isLabeledByFormItem: a
}) => {
const o = Ye(Iu, void 0), { formItem: s } = zl(), { emit: c } = Ct();
function l(p) {
var m, y, g, v;
return [!0, t.trueValue, t.trueLabel].includes(p) ? (y = (m = t.trueValue) != null ? m : t.trueLabel) != null ? y : !0 : (v = (g = t.falseValue) != null ? g : t.falseLabel) != null ? v : !1;
}
function u(p, m) {
c("change", l(p), m);
}
function d(p) {
if (r.value)
return;
const m = p.target;
c("change", l(m.checked), p);
}
async function h(p) {
r.value || !i.value && !n.value && a.value && (p.composedPath().some((m) => m.tagName === "LABEL") || (e.value = l([!1, t.falseValue, t.falseLabel].includes(e.value)), await st(), u(e.value, p)));
}
const f = ee(() => (o == null ? void 0 : o.validateEvent) || t.validateEvent);
return ze(() => t.modelValue, () => {
f.value && (s == null || s.validate("change").catch((p) => Vr(p)));
}), {
handleChange: d,
onClickRoot: h
};
}, o6 = (t) => {
const e = we(!1), { emit: r } = Ct(), i = Ye(Iu, void 0), n = ee(() => Yo(i) === !1), a = we(!1), o = ee({
get() {
var s, c;
return n.value ? (s = i == null ? void 0 : i.modelValue) == null ? void 0 : s.value : (c = t.modelValue) != null ? c : e.value;
},
set(s) {
var c, l;
n.value && Ui(s) ? (a.value = ((c = i == null ? void 0 : i.max) == null ? void 0 : c.value) !== void 0 && s.length > (i == null ? void 0 : i.max.value) && s.length > o.value.length, a.value === !1 && ((l = i == null ? void 0 : i.changeEvent) == null || l.call(i, s))) : (r(ui, s), e.value = s);
}
});
return {
model: o,
isGroup: n,
isLimitExceeded: a
};
}, s6 = (t, e, { model: r }) => {
const i = Ye(Iu, void 0), n = we(!1), a = ee(() => Am(t.value) ? t.label : t.value), o = ee(() => {
const u = r.value;
return Zc(u) ? u : Ui(u) ? di(a.value) ? u.map(gl).some((d) => Cm(d, a.value)) : u.map(gl).includes(a.value) : u != null ? u === t.trueValue || u === t.trueLabel : !!u;
}), s = bl(ee(() => {
var u;
return (u = i == null ? void 0 : i.size) == null ? void 0 : u.value;
}), {
prop: !0
}), c = bl(ee(() => {
var u;
return (u = i == null ? void 0 : i.size) == null ? void 0 : u.value;
})), l = ee(() => !!e.default || !Am(a.value));
return {
checkboxButtonSize: s,
isChecked: o,
isFocused: n,
checkboxSize: c,
hasOwnLabel: l,
actualValue: a
};
}, KC = (t, e) => {
const { formItem: r } = zl(), { model: i, isGroup: n, isLimitExceeded: a } = o6(t), {
isFocused: o,
isChecked: s,
checkboxButtonSize: c,
checkboxSize: l,
hasOwnLabel: u,
actualValue: d
} = s6(t, e, { model: i }), { isDisabled: h } = n6({ model: i, isChecked: s }), { inputId: f, isLabeledByFormItem: p } = Kh(t, {
formItemContext: r,
disableIdGeneration: u,
disableIdManagement: n
}), { handleChange: m, onClickRoot: y } = a6(t, {
model: i,
isLimitExceeded: a,
hasOwnLabel: u,
isDisabled: h,
isLabeledByFormItem: p
});
return (() => {
function g() {
var v, x;
Ui(i.value) && !i.value.includes(d.value) ? i.value.push(d.value) : i.value = (x = (v = t.trueValue) != null ? v : t.trueLabel) != null ? x : !0;
}
t.checked && g();
})(), tm({
from: "label act as value",
replacement: "value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
}, ee(() => n.value && Am(t.value))), tm({
from: "true-label",
replacement: "true-value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
}, ee(() => !!t.trueLabel)), tm({
from: "false-label",
replacement: "false-value",
version: "3.0.0",
scope: "el-checkbox",
ref: "https://element-plus.org/en-US/component/checkbox.html"
}, ee(() => !!t.falseLabel)), {
inputId: f,
isLabeledByFormItem: p,
isChecked: s,
isDisabled: h,
isFocused: o,
checkboxButtonSize: c,
checkboxSize: l,
hasOwnLabel: u,
model: i,
actualValue: d,
handleChange: m,
onClickRoot: y
};
}, l6 = Le({
name: "ElCheckbox"
}), c6 = /* @__PURE__ */ Le({
...l6,
props: ZC,
emits: YC,
setup(t) {
const e = t, r = co(), {
inputId: i,
isLabeledByFormItem: n,
isChecked: a,
isDisabled: o,
isFocused: s,
checkboxSize: c,
hasOwnLabel: l,
model: u,
actualValue: d,
handleChange: h,
onClickRoot: f
} = KC(e, r), p = Et("checkbox"), m = ee(() => [
p.b(),
p.m(c.value),
p.is("disabled", o.value),
p.is("bordered", e.border),
p.is("checked", a.value)
]), y = ee(() => [
p.e("input"),
p.is("disabled", o.value),
p.is("checked", a.value),
p.is("indeterminate", e.indeterminate),
p.is("focus", s.value)
]);
return (g, v) => (Q(), Re(Yt(!N(l) && N(n) ? "span" : "label"), {
class: xe(N(m)),
"aria-controls": g.indeterminate ? g.ariaControls : null,
onClick: N(f)
}, {
default: le(() => {
var x, w, S, _;
return [
Ee("span", {
class: xe(N(y))
}, [
g.trueValue || g.falseValue || g.trueLabel || g.falseLabel ? ht((Q(), be("input", {
key: 0,
id: N(i),
"onUpdate:modelValue": (b) => cn(u) ? u.value = b : null,
class: xe(N(p).e("original")),
type: "checkbox",
indeterminate: g.indeterminate,
name: g.name,
tabindex: g.tabindex,
disabled: N(o),
"true-value": (w = (x = g.trueValue) != null ? x : g.trueLabel) != null ? w : !0,
"false-value": (_ = (S = g.falseValue) != null ? S : g.falseLabel) != null ? _ : !1,
onChange: N(h),
onFocus: (b) => s.value = !0,
onBlur: (b) => s.value = !1,
onClick: Tt(() => {
}, ["stop"])
}, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
[Sm, N(u)]
]) : ht((Q(), be("input", {
key: 1,
id: N(i),
"onUpdate:modelValue": (b) => cn(u) ? u.value = b : null,
class: xe(N(p).e("original")),
type: "checkbox",
indeterminate: g.indeterminate,
disabled: N(o),
value: N(d),
name: g.name,
tabindex: g.tabindex,
onChange: N(h),
onFocus: (b) => s.value = !0,
onBlur: (b) => s.value = !1,
onClick: Tt(() => {
}, ["stop"])
}, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [
[Sm, N(u)]
]),
Ee("span", {
class: xe(N(p).e("inner"))
}, null, 2)
], 2),
N(l) ? (Q(), be("span", {
key: 0,
class: xe(N(p).e("label"))
}, [
Fe(g.$slots, "default"),
g.$slots.default ? Pe("v-if", !0) : (Q(), be(pt, { key: 0 }, [
et(Ze(g.label), 1)
], 64))
], 2)) : Pe("v-if", !0)
];
}),
_: 3
}, 8, ["class", "aria-controls", "onClick"]));
}
});
var u6 = /* @__PURE__ */ Mt(c6, [["__file", "checkbox.vue"]]);
const d6 = Le({
name: "ElCheckboxButton"
}), h6 = /* @__PURE__ */ Le({
...d6,
props: ZC,
emits: YC,
setup(t) {
const e = t, r = co(), {
isFocused: i,
isChecked: n,
isDisabled: a,
checkboxButtonSize: o,
model: s,
actualValue: c,
handleChange: l
} = KC(e, r), u = Ye(Iu, void 0), d = Et("checkbox"), h = ee(() => {
var p, m, y, g;
const v = (m = (p = u == null ? void 0 : u.fill) == null ? void 0 : p.value) != null ? m : "";
return {
backgroundColor: v,
borderColor: v,
color: (g = (y = u == null ? void 0 : u.textColor) == null ? void 0 : y.value) != null ? g : "",
boxShadow: v ? `-1px 0 0 0 ${v}` : void 0
};
}), f = ee(() => [
d.b("button"),
d.bm("button", o.value),
d.is("disabled", a.value),
d.is("checked", n.value),
d.is("focus", i.value)
]);
return (p, m) => {
var y, g, v, x;
return Q(), be("label", {
class: xe(N(f))
}, [
p.trueValue || p.falseValue || p.trueLabel || p.falseLabel ? ht((Q(), be("input", {
key: 0,
"onUpdate:modelValue": (w) => cn(s) ? s.value = w : null,
class: xe(N(d).be("button", "original")),
type: "checkbox",
name: p.name,
tabindex: p.tabindex,
disabled: N(a),
"true-value": (g = (y = p.trueValue) != null ? y : p.trueLabel) != null ? g : !0,
"false-value": (x = (v = p.falseValue) != null ? v : p.falseLabel) != null ? x : !1,
onChange: N(l),
onFocus: (w) => i.value = !0,
onBlur: (w) => i.value = !1,
onClick: Tt(() => {
}, ["stop"])
}, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
[Sm, N(s)]
]) : ht((Q(), be("input", {
key: 1,
"onUpdate:modelValue": (w) => cn(s) ? s.value = w : null,
class: xe(N(d).be("button", "original")),
type: "checkbox",
name: p.name,
tabindex: p.tabindex,
disabled: N(a),
value: N(c),
onChange: N(l),
onFocus: (w) => i.value = !0,
onBlur: (w) => i.value = !1,
onClick: Tt(() => {
}, ["stop"])
}, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [
[Sm, N(s)]
]),
p.$slots.default || p.label ? (Q(), be("span", {
key: 2,
class: xe(N(d).be("button", "inner")),
style: yt(N(n) ? N(h) : void 0)
}, [
Fe(p.$slots, "default", {}, () => [
et(Ze(p.label), 1)
])
], 6)) : Pe("v-if", !0)
], 2);
};
}
});
var JC = /* @__PURE__ */ Mt(h6, [["__file", "checkbox-button.vue"]]);
const p6 = Kt({
modelValue: {
type: vt(Array),
default: () => []
},
disabled: Boolean,
min: Number,
max: Number,
size: Du,
fill: String,
textColor: String,
tag: {
type: String,
default: "div"
},
validateEvent: {
type: Boolean,
default: !0
},
...Ts(["ariaLabel"])
}), f6 = {
[ui]: (t) => Ui(t),
change: (t) => Ui(t)
}, m6 = Le({
name: "ElCheckboxGroup"
}), g6 = /* @__PURE__ */ Le({
...m6,
props: p6,
emits: f6,
setup(t, { emit: e }) {
const r = t, i = Et("checkbox"), { formItem: n } = zl(), { inputId: a, isLabeledByFormItem: o } = Kh(r, {
formItemContext: n
}), s = async (l) => {
e(ui, l), await st(), e("change", l);
}, c = ee({
get() {
return r.modelValue;
},
set(l) {
s(l);
}
});
return Dt(Iu, {
...sC(Zi(r), [
"size",
"min",
"max",
"disabled",
"validateEvent",
"fill",
"textColor"
]),
modelValue: c,
changeEvent: s
}), ze(() => r.modelValue, () => {
r.validateEvent && (n == null || n.validate("change").catch((l) => Vr(l)));
}), (l, u) => {
var d;
return Q(), Re(Yt(l.tag), {
id: N(a),
class: xe(N(i).b("group")),
role: "group",
"aria-label": N(o) ? void 0 : l.ariaLabel || "checkbox-group",
"aria-labelledby": N(o) ? (d = N(n)) == null ? void 0 : d.labelId : void 0
}, {
default: le(() => [
Fe(l.$slots, "default")
]),
_: 3
}, 8, ["id", "class", "aria-label", "aria-labelledby"]);
};
}
});
var QC = /* @__PURE__ */ Mt(g6, [["__file", "checkbox-group.vue"]]);
const v6 = ni(u6, {
CheckboxButton: JC,
CheckboxGroup: QC
});
po(JC);
po(QC);
const by = Kt({
type: {
type: String,
values: ["primary", "success", "info", "warning", "danger"],
default: "primary"
},
closable: Boolean,
disableTransitions: Boolean,
hit: Boolean,
color: String,
size: {
type: String,
values: pC
},
effect: {
type: String,
values: ["dark", "light", "plain"],
default: "light"
},
round: Boolean
}), y6 = {
close: (t) => t instanceof MouseEvent,
click: (t) => t instanceof MouseEvent
}, b6 = Le({
name: "ElTag"
}), x6 = /* @__PURE__ */ Le({
...b6,
props: by,
emits: y6,
setup(t, { emit: e }) {
const r = t, i = bl(), n = Et("tag"), a = ee(() => {
const { type: l, hit: u, effect: d, closable: h, round: f } = r;
return [
n.b(),
n.is("closable", h),
n.m(l || "primary"),
n.m(i.value),
n.m(d),
n.is("hit", u),
n.is("round", f)
];
}), o = (l) => {
e("close", l);
}, s = (l) => {
e("click", l);
}, c = (l) => {
l.component.subTree.component.bum = null;
};
return (l, u) => l.disableTransitions ? (Q(), be("span", {
key: 0,
class: xe(N(a)),
style: yt({ backgroundColor: l.color }),
onClick: s
}, [
Ee("span", {
class: xe(N(n).e("content"))
}, [
Fe(l.$slots, "default")
], 2),
l.closable ? (Q(), Re(N(Oi), {
key: 0,
class: xe(N(n).e("close")),
onClick: Tt(o, ["stop"])
}, {
default: le(() => [
oe(N(Lm))
]),
_: 1
}, 8, ["class", "onClick"])) : Pe("v-if", !0)
], 6)) : (Q(), Re(Zn, {
key: 1,
name: `${N(n).namespace.value}-zoom-in-center`,
appear: "",
onVnodeMounted: c
}, {
default: le(() => [
Ee("span", {
class: xe(N(a)),
style: yt({ backgroundColor: l.color }),
onClick: s
}, [
Ee("span", {
class: xe(N(n).e("content"))
}, [
Fe(l.$slots, "default")
], 2),
l.closable ? (Q(), Re(N(Oi), {
key: 0,
class: xe(N(n).e("close")),
onClick: Tt(o, ["stop"])
}, {
default: le(() => [
oe(N(Lm))
]),
_: 1
}, 8, ["class", "onClick"])) : Pe("v-if", !0)
], 6)
]),
_: 3
}, 8, ["name"]));
}
});
var w6 = /* @__PURE__ */ Mt(x6, [["__file", "tag.vue"]]);
const _6 = ni(w6), eA = Symbol("rowContextKey"), S6 = [
"start",
"center",
"end",
"space-around",
"space-between",
"space-evenly"
], M6 = ["top", "middle", "bottom"], E6 = Kt({
tag: {
type: String,
default: "div"
},
gutter: {
type: Number,
default: 0
},
justify: {
type: String,
values: S6,
default: "start"
},
align: {
type: String,
values: M6
}
}), T6 = Le({
name: "ElRow"
}), C6 = /* @__PURE__ */ Le({
...T6,
props: E6,
setup(t) {
const e = t, r = Et("row"), i = ee(() => e.gutter);
Dt(eA, {
gutter: i
});
const n = ee(() => {
const o = {};
return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o;
}), a = ee(() => [
r.b(),
r.is(`justify-${e.justify}`, e.justify !== "start"),
r.is(`align-${e.align}`, !!e.align)
]);
return (o, s) => (Q(), Re(Yt(o.tag), {
class: xe(N(a)),
style: yt(N(n))
}, {
default: le(() => [
Fe(o.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var A6 = /* @__PURE__ */ Mt(C6, [["__file", "row.vue"]]);
const _g = ni(A6), L6 = Kt({
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: vt([Number, Object]),
default: () => Lc({})
},
sm: {
type: vt([Number, Object]),
default: () => Lc({})
},
md: {
type: vt([Number, Object]),
default: () => Lc({})
},
lg: {
type: vt([Number, Object]),
default: () => Lc({})
},
xl: {
type: vt([Number, Object]),
default: () => Lc({})
}
}), k6 = Le({
name: "ElCol"
}), P6 = /* @__PURE__ */ Le({
...k6,
props: L6,
setup(t) {
const e = t, { gutter: r } = Ye(eA, { gutter: ee(() => 0) }), i = Et("col"), n = ee(() => {
const o = {};
return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o;
}), a = ee(() => {
const o = [];
return ["span", "offset", "pull", "push"].forEach((s) => {
const c = e[s];
hi(c) && (s === "span" ? o.push(i.b(`${e[s]}`)) : c > 0 && o.push(i.b(`${s}-${e[s]}`)));
}), ["xs", "sm", "md", "lg", "xl"].forEach((s) => {
hi(e[s]) ? o.push(i.b(`${s}-${e[s]}`)) : di(e[s]) && Object.entries(e[s]).forEach(([c, l]) => {
o.push(c !== "span" ? i.b(`${s}-${c}-${l}`) : i.b(`${s}-${l}`));
});
}), r.value && o.push(i.is("guttered")), [i.b(), o];
});
return (o, s) => (Q(), Re(Yt(o.tag), {
class: xe(N(a)),
style: yt(N(n))
}, {
default: le(() => [
Fe(o.$slots, "default")
]),
_: 3
}, 8, ["class", "style"]));
}
});
var R6 = /* @__PURE__ */ Mt(P6, [["__file", "col.vue"]]);
const Qh = ni(R6), O6 = Le({
name: "ElCollapseTransition"
}), D6 = /* @__PURE__ */ Le({
...O6,
setup(t) {
const e = Et("collapse-transition"), r = (n) => {
n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom;
}, i = {
beforeEnter(n) {
n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.style.height && (n.dataset.elExistsHeight = n.style.height), n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0;
},
enter(n) {
requestAnimationFrame(() => {
n.dataset.oldOverflow = n.style.overflow, n.dataset.elExistsHeight ? n.style.maxHeight = n.dataset.elExistsHeight : n.scrollHeight !== 0 ? n.style.maxHeight = `${n.scrollHeight}px` : n.style.maxHeight = 0, n.style.paddingTop = n.dataset.oldPaddingTop, n.style.paddingBottom = n.dataset.oldPaddingBottom, n.style.overflow = "hidden";
});
},
afterEnter(n) {
n.style.maxHeight = "", n.style.overflow = n.dataset.oldOverflow;
},
enterCancelled(n) {
r(n);
},
beforeLeave(n) {
n.dataset || (n.dataset = {}), n.dataset.oldPaddingTop = n.style.paddingTop, n.dataset.oldPaddingBottom = n.style.paddingBottom, n.dataset.oldOverflow = n.style.overflow, n.style.maxHeight = `${n.scrollHeight}px`, n.style.overflow = "hidden";
},
leave(n) {
n.scrollHeight !== 0 && (n.style.maxHeight = 0, n.style.paddingTop = 0, n.style.paddingBottom = 0);
},
afterLeave(n) {
r(n);
},
leaveCancelled(n) {
r(n);
}
};
return (n, a) => (Q(), Re(Zn, Nr({
name: N(e).b()
}, OT(i)), {
default: le(() => [
Fe(n.$slots, "default")
]),
_: 3
}, 16, ["name"]));
}
});
var I6 = /* @__PURE__ */ Mt(D6, [["__file", "collapse-transition.vue"]]);
const N6 = ni(I6), B6 = Kt({
color: {
type: vt(Object),
required: !0
},
vertical: {
type: Boolean,
default: !1
}
});
let Bv = !1;
function ph(t, e) {
if (!$r)
return;
const r = function(a) {
var o;
(o = e.drag) == null || o.call(e, a);
}, i = function(a) {
var o;
document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", i), document.removeEventListener("touchmove", r), document.removeEventListener("touchend", i), document.onselectstart = null, document.ondragstart = null, Bv = !1, (o = e.end) == null || o.call(e, a);
}, n = function(a) {
var o;
Bv || (a.preventDefault(), document.onselectstart = () => !1, document.ondragstart = () => !1, document.addEventListener("mousemove", r), document.addEventListener("mouseup", i), document.addEventListener("touchmove", r), document.addEventListener("touchend", i), Bv = !0, (o = e.start) == null || o.call(e, a));
};
t.addEventListener("mousedown", n), t.addEventListener("touchstart", n, { passive: !1 });
}
const F6 = (t) => {
const e = Ct(), { t: r } = qh(), i = mr(), n = mr(), a = ee(() => t.color.get("alpha")), o = ee(() => r("el.colorpicker.alphaLabel"));
function s(d) {
var h;
d.target !== i.value && c(d), (h = i.value) == null || h.focus();
}
function c(d) {
if (!n.value || !i.value)
return;
const h = e.vnode.el.getBoundingClientRect(), { clientX: f, clientY: p } = q1(d);
if (t.vertical) {
let m = p - h.top;
m = Math.max(i.value.offsetHeight / 2, m), m = Math.min(m, h.height - i.value.offsetHeight / 2), t.color.set("alpha", Math.round((m - i.value.offsetHeight / 2) / (h.height - i.value.offsetHeight) * 100));
} else {
let m = f - h.left;
m = Math.max(i.value.offsetWidth / 2, m), m = Math.min(m, h.width - i.value.offsetWidth / 2), t.color.set("alpha", Math.round((m - i.value.offsetWidth / 2) / (h.width - i.value.offsetWidth) * 100));
}
}
function l(d) {
const { code: h, shiftKey: f } = d, p = f ? 10 : 1;
switch (h) {
case Gr.left:
case Gr.down:
d.preventDefault(), d.stopPropagation(), u(-p);
break;
case Gr.right:
case Gr.up:
d.preventDefault(), d.stopPropagation(), u(p);
break;
}
}
function u(d) {
let h = a.value + d;
h = h < 0 ? 0 : h > 100 ? 100 : h, t.color.set("alpha", h);
}
return {
thumb: i,
bar: n,
alpha: a,
alphaLabel: o,
handleDrag: c,
handleClick: s,
handleKeydown: l
};
}, z6 = (t, {
bar: e,
thumb: r,
handleDrag: i
}) => {
const n = Ct(), a = Et("color-alpha-slider"), o = we(0), s = we(0), c = we();
function l() {
if (!r.value || t.vertical)
return 0;
const v = n.vnode.el, x = t.color.get("alpha");
return v ? Math.round(x * (v.offsetWidth - r.value.offsetWidth / 2) / 100) : 0;
}
function u() {
if (!r.value)
return 0;
const v = n.vnode.el;
if (!t.vertical)
return 0;
const x = t.color.get("alpha");
return v ? Math.round(x * (v.offsetHeight - r.value.offsetHeight / 2) / 100) : 0;
}
function d() {
if (t.color && t.color.value) {
const { r: v, g: x, b: w } = t.color.toRgb();
return `linear-gradient(to right, rgba(${v}, ${x}, ${w}, 0) 0%, rgba(${v}, ${x}, ${w}, 1) 100%)`;
}
return "";
}
function h() {
o.value = l(), s.value = u(), c.value = d();
}
Lt(() => {
if (!e.value || !r.value)
return;
const v = {
drag: (x) => {
i(x);
},
end: (x) => {
i(x);
}
};
ph(e.value, v), ph(r.value, v), h();
}), ze(() => t.color.get("alpha"), () => h()), ze(() => t.color.value, () => h());
const f = ee(() => [a.b(), a.is("vertical", t.vertical)]), p = ee(() => a.e("bar")), m = ee(() => a.e("thumb")), y = ee(() => ({ background: c.value })), g = ee(() => ({
left: Yc(o.value),
top: Yc(s.value)
}));
return { rootKls: f, barKls: p, barStyle: y, thumbKls: m, thumbStyle: g, update: h };
}, $6 = "ElColorAlphaSlider", V6 = Le({
name: $6
}), U6 = /* @__PURE__ */ Le({
...V6,
props: B6,
setup(t, { expose: e }) {
const r = t, {
alpha: i,
alphaLabel: n,
bar: a,
thumb: o,
handleDrag: s,
handleClick: c,
handleKeydown: l
} = F6(r), { rootKls: u, barKls: d, barStyle: h, thumbKls: f, thumbStyle: p, update: m } = z6(r, {
bar: a,
thumb: o,
handleDrag: s
});
return e({
update: m,
bar: a,
thumb: o
}), (y, g) => (Q(), be("div", {
class: xe(N(u))
}, [
Ee("div", {
ref_key: "bar",
ref: a,
class: xe(N(d)),
style: yt(N(h)),
onClick: N(c)
}, null, 14, ["onClick"]),
Ee("div", {
ref_key: "thumb",
ref: o,
class: xe(N(f)),
style: yt(N(p)),
"aria-label": N(n),
"aria-valuenow": N(i),
"aria-orientation": y.vertical ? "vertical" : "horizontal",
"aria-valuemin": "0",
"aria-valuemax": "100",
role: "slider",
tabindex: "0",
onKeydown: N(l)
}, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"])
], 2));
}
});
var j6 = /* @__PURE__ */ Mt(U6, [["__file", "alpha-slider.vue"]]);
const H6 = Le({
name: "ElColorHueSlider",
props: {
color: {
type: Object,
required: !0
},
vertical: Boolean
},
setup(t) {
const e = Et("color-hue-slider"), r = Ct(), i = we(), n = we(), a = we(0), o = we(0), s = ee(() => t.color.get("hue"));
ze(() => s.value, () => {
h();
});
function c(f) {
f.target !== i.value && l(f);
}
function l(f) {
if (!n.value || !i.value)
return;
const p = r.vnode.el.getBoundingClientRect(), { clientX: m, clientY: y } = q1(f);
let g;
if (t.vertical) {
let v = y - p.top;
v = Math.min(v, p.height - i.value.offsetHeight / 2), v = Math.max(i.value.offsetHeight / 2, v), g = Math.round((v - i.value.offsetHeight / 2) / (p.height - i.value.offsetHeight) * 360);
} else {
let v = m - p.left;
v = Math.min(v, p.width - i.value.offsetWidth / 2), v = Math.max(i.value.offsetWidth / 2, v), g = Math.round((v - i.value.offsetWidth / 2) / (p.width - i.value.offsetWidth) * 360);
}
t.color.set("hue", g);
}
function u() {
if (!i.value)
return 0;
const f = r.vnode.el;
if (t.vertical)
return 0;
const p = t.color.get("hue");
return f ? Math.round(p * (f.offsetWidth - i.value.offsetWidth / 2) / 360) : 0;
}
function d() {
if (!i.value)
return 0;
const f = r.vnode.el;
if (!t.vertical)
return 0;
const p = t.color.get("hue");
return f ? Math.round(p * (f.offsetHeight - i.value.offsetHeight / 2) / 360) : 0;
}
function h() {
a.value = u(), o.value = d();
}
return Lt(() => {
if (!n.value || !i.value)
return;
const f = {
drag: (p) => {
l(p);
},
end: (p) => {
l(p);
}
};
ph(n.value, f), ph(i.value, f), h();
}), {
bar: n,
thumb: i,
thumbLeft: a,
thumbTop: o,
hueValue: s,
handleClick: c,
update: h,
ns: e
};
}
});
function G6(t, e, r, i, n, a) {
return Q(), be("div", {
class: xe([t.ns.b(), t.ns.is("vertical", t.vertical)])
}, [
Ee("div", {
ref: "bar",
class: xe(t.ns.e("bar")),
onClick: t.handleClick
}, null, 10, ["onClick"]),
Ee("div", {
ref: "thumb",
class: xe(t.ns.e("thumb")),
style: yt({
left: t.thumbLeft + "px",
top: t.thumbTop + "px"
})
}, null, 6)
], 2);
}
var W6 = /* @__PURE__ */ Mt(H6, [["render", G6], ["__file", "hue-slider.vue"]]);
const q6 = Kt({
modelValue: String,
id: String,
showAlpha: Boolean,
colorFormat: String,
disabled: Boolean,
size: Du,
popperClass: {
type: String,
default: ""
},
tabindex: {
type: [String, Number],
default: 0
},
teleported: $i.teleported,
predefine: {
type: vt(Array)
},
validateEvent: {
type: Boolean,
default: !0
},
...Ts(["ariaLabel"])
}), X6 = {
[ui]: (t) => Ei(t) || ts(t),
[ib]: (t) => Ei(t) || ts(t),
activeChange: (t) => Ei(t) || ts(t),
focus: (t) => t instanceof FocusEvent,
blur: (t) => t instanceof FocusEvent
}, tA = Symbol("colorPickerContextKey"), U2 = function(t, e, r) {
return [
t,
e * r / ((t = (2 - e) * r) < 1 ? t : 2 - t) || 0,
t / 2
];
}, Z6 = function(t) {
return typeof t == "string" && t.includes(".") && Number.parseFloat(t) === 1;
}, Y6 = function(t) {
return typeof t == "string" && t.includes("%");
}, Fc = function(t, e) {
Z6(t) && (t = "100%");
const r = Y6(t);
return t = Math.min(e, Math.max(0, Number.parseFloat(`${t}`))), r && (t = Number.parseInt(`${t * e}`, 10) / 100), Math.abs(t - e) < 1e-6 ? 1 : t % e / Number.parseFloat(e);
}, j2 = {
10: "A",
11: "B",
12: "C",
13: "D",
14: "E",
15: "F"
}, nm = (t) => {
t = Math.min(Math.round(t), 255);
const e = Math.floor(t / 16), r = t % 16;
return `${j2[e] || e}${j2[r] || r}`;
}, H2 = function({ r: t, g: e, b: r }) {
return Number.isNaN(+t) || Number.isNaN(+e) || Number.isNaN(+r) ? "" : `#${nm(t)}${nm(e)}${nm(r)}`;
}, Fv = {
A: 10,
B: 11,
C: 12,
D: 13,
E: 14,
F: 15
}, Fs = function(t) {
return t.length === 2 ? (Fv[t[0].toUpperCase()] || +t[0]) * 16 + (Fv[t[1].toUpperCase()] || +t[1]) : Fv[t[1].toUpperCase()] || +t[1];
}, K6 = function(t, e, r) {
e = e / 100, r = r / 100;
let i = e;
const n = Math.max(r, 0.01);
r *= 2, e *= r <= 1 ? r : 2 - r, i *= n <= 1 ? n : 2 - n;
const a = (r + e) / 2, o = r === 0 ? 2 * i / (n + i) : 2 * e / (r + e);
return {
h: t,
s: o * 100,
v: a * 100
};
}, G2 = (t, e, r) => {
t = Fc(t, 255), e = Fc(e, 255), r = Fc(r, 255);
const i = Math.max(t, e, r), n = Math.min(t, e, r);
let a;
const o = i, s = i - n, c = i === 0 ? 0 : s / i;
if (i === n)
a = 0;
else {
switch (i) {
case t: {
a = (e - r) / s + (e < r ? 6 : 0);
break;
}
case e: {
a = (r - t) / s + 2;
break;
}
case r: {
a = (t - e) / s + 4;
break;
}
}
a /= 6;
}
return { h: a * 360, s: c * 100, v: o * 100 };
}, dd = function(t, e, r) {
t = Fc(t, 360) * 6, e = Fc(e, 100), r = Fc(r, 100);
const i = Math.floor(t), n = t - i, a = r * (1 - e), o = r * (1 - n * e), s = r * (1 - (1 - n) * e), c = i % 6, l = [r, o, a, a, s, r][c], u = [s, r, r, o, a, a][c], d = [a, a, s, r, r, o][c];
return {
r: Math.round(l * 255),
g: Math.round(u * 255),
b: Math.round(d * 255)
};
};
let qd = class {
constructor(e = {}) {
this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = !1, this.format = "hex", this.value = "";
for (const r in e)
vl(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 i in e)
vl(e, i) && this.set(i, e[i]);
return;
}
this[`_${e}`] = r, this.doOnChange();
}
get(e) {
return e === "alpha" ? Math.floor(this[`_${e}`]) : this[`_${e}`];
}
toRgb() {
return dd(this._hue, this._saturation, this._value);
}
fromString(e) {
if (!e) {
this._hue = 0, this._saturation = 100, this._value = 100, this.doOnChange();
return;
}
const r = (i, n, a) => {
this._hue = Math.max(0, Math.min(360, i)), this._saturation = Math.max(0, Math.min(100, n)), this._value = Math.max(0, Math.min(100, a)), this.doOnChange();
};
if (e.includes("hsl")) {
const i = e.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((n) => n !== "").map((n, a) => a > 2 ? Number.parseFloat(n) : Number.parseInt(n, 10));
if (i.length === 4 ? this._alpha = Number.parseFloat(i[3]) * 100 : i.length === 3 && (this._alpha = 100), i.length >= 3) {
const { h: n, s: a, v: o } = K6(i[0], i[1], i[2]);
r(n, a, o);
}
} else if (e.includes("hsv")) {
const i = e.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((n) => n !== "").map((n, a) => a > 2 ? Number.parseFloat(n) : Number.parseInt(n, 10));
i.length === 4 ? this._alpha = Number.parseFloat(i[3]) * 100 : i.length === 3 && (this._alpha = 100), i.length >= 3 && r(i[0], i[1], i[2]);
} else if (e.includes("rgb")) {
const i = e.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((n) => n !== "").map((n, a) => a > 2 ? Number.parseFloat(n) : Number.parseInt(n, 10));
if (i.length === 4 ? this._alpha = Number.parseFloat(i[3]) * 100 : i.length === 3 && (this._alpha = 100), i.length >= 3) {
const { h: n, s: a, v: o } = G2(i[0], i[1], i[2]);
r(n, a, o);
}
} else if (e.includes("#")) {
const i = e.replace("#", "").trim();
if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(i))
return;
let n, a, o;
i.length === 3 ? (n = Fs(i[0] + i[0]), a = Fs(i[1] + i[1]), o = Fs(i[2] + i[2])) : (i.length === 6 || i.length === 8) && (n = Fs(i.slice(0, 2)), a = Fs(i.slice(2, 4)), o = Fs(i.slice(4, 6))), i.length === 8 ? this._alpha = Fs(i.slice(6)) / 255 * 100 : (i.length === 3 || i.length === 6) && (this._alpha = 100);
const { h: s, s: c, v: l } = G2(n, a, o);
r(s, c, l);
}
}
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: i, _alpha: n, format: a } = this;
if (this.enableAlpha)
switch (a) {
case "hsl": {
const o = U2(e, r / 100, i / 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(i)}%, ${this.get("alpha") / 100})`;
break;
}
case "hex": {
this.value = `${H2(dd(e, r, i))}${nm(n * 255 / 100)}`;
break;
}
default: {
const { r: o, g: s, b: c } = dd(e, r, i);
this.value = `rgba(${o}, ${s}, ${c}, ${this.get("alpha") / 100})`;
}
}
else
switch (a) {
case "hsl": {
const o = U2(e, r / 100, i / 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(i)}%)`;
break;
}
case "rgb": {
const { r: o, g: s, b: c } = dd(e, r, i);
this.value = `rgb(${o}, ${s}, ${c})`;
break;
}
default:
this.value = H2(dd(e, r, i));
}
}
};
const J6 = Le({
props: {
colors: {
type: Array,
required: !0
},
color: {
type: Object,
required: !0
},
enableAlpha: {
type: Boolean,
required: !0
}
},
setup(t) {
const e = Et("color-predefine"), { currentColor: r } = Ye(tA), i = we(a(t.colors, t.color));
ze(() => r.value, (o) => {
const s = new qd();
s.fromString(o), i.value.forEach((c) => {
c.selected = s.compare(c);
});
}), lg(() => {
i.value = a(t.colors, t.color);
});
function n(o) {
t.color.fromString(t.colors[o]);
}
function a(o, s) {
return o.map((c) => {
const l = new qd();
return l.enableAlpha = t.enableAlpha, l.format = "rgba", l.fromString(c), l.selected = l.value === s.value, l;
});
}
return {
rgbaColors: i,
handleSelect: n,
ns: e
};
}
});
function Q6(t, e, r, i, n, a) {
return Q(), be("div", {
class: xe(t.ns.b())
}, [
Ee("div", {
class: xe(t.ns.e("colors"))
}, [
(Q(!0), be(pt, null, ir(t.rgbaColors, (o, s) => (Q(), be("div", {
key: t.colors[s],
class: xe([
t.ns.e("color-selector"),
t.ns.is("alpha", o._alpha < 100),
{ selected: o.selected }
]),
onClick: (c) => t.handleSelect(s)
}, [
Ee("div", {
style: yt({ backgroundColor: o.value })
}, null, 4)
], 10, ["onClick"]))), 128))
], 2)
], 2);
}
var eV = /* @__PURE__ */ Mt(J6, [["render", Q6], ["__file", "predefine.vue"]]);
const tV = Le({
name: "ElSlPanel",
props: {
color: {
type: Object,
required: !0
}
},
setup(t) {
const e = Et("color-svpanel"), r = Ct(), i = we(0), n = we(0), a = we("hsl(0, 100%, 50%)"), o = ee(() => {
const l = t.color.get("hue"), u = t.color.get("value");
return { hue: l, value: u };
});
function s() {
const l = t.color.get("saturation"), u = t.color.get("value"), d = r.vnode.el, { clientWidth: h, clientHeight: f } = d;
n.value = l * h / 100, i.value = (100 - u) * f / 100, a.value = `hsl(${t.color.get("hue")}, 100%, 50%)`;
}
function c(l) {
const u = r.vnode.el.getBoundingClientRect(), { clientX: d, clientY: h } = q1(l);
let f = d - u.left, p = h - u.top;
f = Math.max(0, f), f = Math.min(f, u.width), p = Math.max(0, p), p = Math.min(p, u.height), n.value = f, i.value = p, t.color.set({
saturation: f / u.width * 100,
value: 100 - p / u.height * 100
});
}
return ze(() => o.value, () => {
s();
}), Lt(() => {
ph(r.vnode.el, {
drag: (l) => {
c(l);
},
end: (l) => {
c(l);
}
}), s();
}), {
cursorTop: i,
cursorLeft: n,
background: a,
colorValue: o,
handleDrag: c,
update: s,
ns: e
};
}
});
function rV(t, e, r, i, n, a) {
return Q(), be("div", {
class: xe(t.ns.b()),
style: yt({
backgroundColor: t.background
})
}, [
Ee("div", {
class: xe(t.ns.e("white"))
}, null, 2),
Ee("div", {
class: xe(t.ns.e("black"))
}, null, 2),
Ee("div", {
class: xe(t.ns.e("cursor")),
style: yt({
top: t.cursorTop + "px",
left: t.cursorLeft + "px"
})
}, [
Ee("div")
], 6)
], 6);
}
var iV = /* @__PURE__ */ Mt(tV, [["render", rV], ["__file", "sv-panel.vue"]]);
const nV = Le({
name: "ElColorPicker"
}), aV = /* @__PURE__ */ Le({
...nV,
props: q6,
emits: X6,
setup(t, { expose: e, emit: r }) {
const i = t, { t: n } = qh(), a = Et("color"), { formItem: o } = zl(), s = bl(), c = Yh(), { inputId: l, isLabeledByFormItem: u } = Kh(i, {
formItemContext: o
}), d = we(), h = we(), f = we(), p = we(), m = we(), y = we(), { isFocused: g, handleFocus: v, handleBlur: x } = pb(m, {
beforeFocus() {
return c.value;
},
beforeBlur(W) {
var Y;
return (Y = p.value) == null ? void 0 : Y.isFocusInsideContent(W);
},
afterBlur() {
R(!1), I();
}
});
let w = !0;
const S = _r(new qd({
enableAlpha: i.showAlpha,
format: i.colorFormat || "",
value: i.modelValue
})), _ = we(!1), b = we(!1), T = we(""), E = ee(() => !i.modelValue && !b.value ? "transparent" : P(S, i.showAlpha)), C = ee(() => !i.modelValue && !b.value ? "" : S.value), L = ee(() => u.value ? void 0 : i.ariaLabel || n("el.colorpicker.defaultLabel")), A = ee(() => u.value ? o == null ? void 0 : o.labelId : void 0), k = ee(() => [
a.b("picker"),
a.is("disabled", c.value),
a.bm("picker", s.value),
a.is("focused", g.value)
]);
function P(W, Y) {
if (!(W instanceof qd))
throw new TypeError("color should be instance of _color Class");
const { r: X, g: ie, b: ue } = W.toRgb();
return Y ? `rgba(${X}, ${ie}, ${ue}, ${W.get("alpha") / 100})` : `rgb(${X}, ${ie}, ${ue})`;
}
function R(W) {
_.value = W;
}
const M = oC(R, 100, { leading: !0 });
function O() {
c.value || R(!0);
}
function D() {
M(!1), I();
}
function I() {
st(() => {
i.modelValue ? S.fromString(i.modelValue) : (S.value = "", st(() => {
b.value = !1;
}));
});
}
function F() {
c.value || M(!_.value);
}
function z() {
S.fromString(T.value);
}
function U() {
const W = S.value;
r(ui, W), r("change", W), i.validateEvent && (o == null || o.validate("change").catch((Y) => Vr(Y))), M(!1), st(() => {
const Y = new qd({
enableAlpha: i.showAlpha,
format: i.colorFormat || "",
value: i.modelValue
});
S.compare(Y) || I();
});
}
function Z() {
M(!1), r(ui, null), r("change", null), i.modelValue !== null && i.validateEvent && (o == null || o.validate("change").catch((W) => Vr(W))), I();
}
function re() {
_.value && (D(), g.value && H());
}
function K(W) {
W.preventDefault(), W.stopPropagation(), R(!1), I();
}
function V(W) {
switch (W.code) {
case Gr.enter:
case Gr.space:
W.preventDefault(), W.stopPropagation(), O(), y.value.focus();
break;
case Gr.esc:
K(W);
break;
}
}
function H() {
m.value.focus();
}
function G() {
m.value.blur();
}
return Lt(() => {
i.modelValue && (T.value = C.value);
}), ze(() => i.modelValue, (W) => {
W ? W && W !== S.value && (w = !1, S.fromString(W)) : b.value = !1;
}), ze(() => [i.colorFormat, i.showAlpha], () => {
S.enableAlpha = i.showAlpha, S.format = i.colorFormat || S.format, S.doOnChange(), r(ui, S.value);
}), ze(() => C.value, (W) => {
T.value = W, w && r("activeChange", W), w = !0;
}), ze(() => S.value, () => {
!i.modelValue && !b.value && (b.value = !0);
}), ze(() => _.value, () => {
st(() => {
var W, Y, X;
(W = d.value) == null || W.update(), (Y = h.value) == null || Y.update(), (X = f.value) == null || X.update();
});
}), Dt(tA, {
currentColor: C
}), e({
color: S,
show: O,
hide: D,
focus: H,
blur: G
}), (W, Y) => (Q(), Re(N(wb), {
ref_key: "popper",
ref: p,
visible: _.value,
"show-arrow": !1,
"fallback-placements": ["bottom", "top", "right", "left"],
offset: 0,
"gpu-acceleration": !1,
"popper-class": [N(a).be("picker", "panel"), N(a).b("dropdown"), W.popperClass],
"stop-popper-mouse-event": !1,
effect: "light",
trigger: "click",
teleported: W.teleported,
transition: `${N(a).namespace.value}-zoom-in-top`,
persistent: "",
onHide: (X) => R(!1)
}, {
content: le(() => [
ht((Q(), be("div", {
onKeydown: ti(K, ["esc"])
}, [
Ee("div", {
class: xe(N(a).be("dropdown", "main-wrapper"))
}, [
oe(W6, {
ref_key: "hue",
ref: d,
class: "hue-slider",
color: N(S),
vertical: ""
}, null, 8, ["color"]),
oe(iV, {
ref_key: "sv",
ref: h,
color: N(S)
}, null, 8, ["color"])
], 2),
W.showAlpha ? (Q(), Re(j6, {
key: 0,
ref_key: "alpha",
ref: f,
color: N(S)
}, null, 8, ["color"])) : Pe("v-if", !0),
W.predefine ? (Q(), Re(eV, {
key: 1,
ref: "predefine",
"enable-alpha": W.showAlpha,
color: N(S),
colors: W.predefine
}, null, 8, ["enable-alpha", "color", "colors"])) : Pe("v-if", !0),
Ee("div", {
class: xe(N(a).be("dropdown", "btns"))
}, [
Ee("span", {
class: xe(N(a).be("dropdown", "value"))
}, [
oe(N(Jh), {
ref_key: "inputRef",
ref: y,
modelValue: T.value,
"onUpdate:modelValue": (X) => T.value = X,
"validate-event": !1,
size: "small",
onKeyup: ti(z, ["enter"]),
onBlur: z
}, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"])
], 2),
oe(N(us), {
class: xe(N(a).be("dropdown", "link-btn")),
text: "",
size: "small",
onClick: Z
}, {
default: le(() => [
et(Ze(N(n)("el.colorpicker.clear")), 1)
]),
_: 1
}, 8, ["class"]),
oe(N(us), {
plain: "",
size: "small",
class: xe(N(a).be("dropdown", "btn")),
onClick: U
}, {
default: le(() => [
et(Ze(N(n)("el.colorpicker.confirm")), 1)
]),
_: 1
}, 8, ["class"])
], 2)
], 40, ["onKeydown"])), [
[N(XC), re]
])
]),
default: le(() => [
Ee("div", Nr({
id: N(l),
ref_key: "triggerRef",
ref: m
}, W.$attrs, {
class: N(k),
role: "button",
"aria-label": N(L),
"aria-labelledby": N(A),
"aria-description": N(n)("el.colorpicker.description", { color: W.modelValue || "" }),
"aria-disabled": N(c),
tabindex: N(c) ? -1 : W.tabindex,
onKeydown: V,
onFocus: N(v),
onBlur: N(x)
}), [
N(c) ? (Q(), be("div", {
key: 0,
class: xe(N(a).be("picker", "mask"))
}, null, 2)) : Pe("v-if", !0),
Ee("div", {
class: xe(N(a).be("picker", "trigger")),
onClick: F
}, [
Ee("span", {
class: xe([N(a).be("picker", "color"), N(a).is("alpha", W.showAlpha)])
}, [
Ee("span", {
class: xe(N(a).be("picker", "color-inner")),
style: yt({
backgroundColor: N(E)
})
}, [
ht(oe(N(Oi), {
class: xe([N(a).be("picker", "icon"), N(a).is("icon-arrow-down")])
}, {
default: le(() => [
oe(N(gg))
]),
_: 1
}, 8, ["class"]), [
[Ot, W.modelValue || b.value]
]),
ht(oe(N(Oi), {
class: xe([N(a).be("picker", "empty"), N(a).is("icon-close")])
}, {
default: le(() => [
oe(N(Lm))
]),
_: 1
}, 8, ["class"]), [
[Ot, !W.modelValue && !b.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 oV = /* @__PURE__ */ Mt(aV, [["__file", "color-picker.vue"]]);
const sV = ni(oV), lV = Le({
name: "ElContainer"
}), cV = /* @__PURE__ */ Le({
...lV,
props: {
direction: {
type: String
}
},
setup(t) {
const e = t, r = co(), i = Et("container"), n = ee(() => e.direction === "vertical" ? !0 : e.direction === "horizontal" ? !1 : r && r.default ? r.default().some((a) => {
const o = a.type.name;
return o === "ElHeader" || o === "ElFooter";
}) : !1);
return (a, o) => (Q(), be("section", {
class: xe([N(i).b(), N(i).is("vertical", N(n))])
}, [
Fe(a.$slots, "default")
], 2));
}
});
var uV = /* @__PURE__ */ Mt(cV, [["__file", "container.vue"]]);
const dV = Le({
name: "ElAside"
}), hV = /* @__PURE__ */ Le({
...dV,
props: {
width: {
type: String,
default: null
}
},
setup(t) {
const e = t, r = Et("aside"), i = ee(() => e.width ? r.cssVarBlock({ width: e.width }) : {});
return (n, a) => (Q(), be("aside", {
class: xe(N(r).b()),
style: yt(N(i))
}, [
Fe(n.$slots, "default")
], 6));
}
});
var rA = /* @__PURE__ */ Mt(hV, [["__file", "aside.vue"]]);
const pV = Le({
name: "ElFooter"
}), fV = /* @__PURE__ */ Le({
...pV,
props: {
height: {
type: String,
default: null
}
},
setup(t) {
const e = t, r = Et("footer"), i = ee(() => e.height ? r.cssVarBlock({ height: e.height }) : {});
return (n, a) => (Q(), be("footer", {
class: xe(N(r).b()),
style: yt(N(i))
}, [
Fe(n.$slots, "default")
], 6));
}
});
var iA = /* @__PURE__ */ Mt(fV, [["__file", "footer.vue"]]);
const mV = Le({
name: "ElHeader"
}), gV = /* @__PURE__ */ Le({
...mV,
props: {
height: {
type: String,
default: null
}
},
setup(t) {
const e = t, r = Et("header"), i = ee(() => e.height ? r.cssVarBlock({
height: e.height
}) : {});
return (n, a) => (Q(), be("header", {
class: xe(N(r).b()),
style: yt(N(i))
}, [
Fe(n.$slots, "default")
], 6));
}
});
var nA = /* @__PURE__ */ Mt(gV, [["__file", "header.vue"]]);
const vV = Le({
name: "ElMain"
}), yV = /* @__PURE__ */ Le({
...vV,
setup(t) {
const e = Et("main");
return (r, i) => (Q(), be("main", {
class: xe(N(e).b())
}, [
Fe(r.$slots, "default")
], 2));
}
});
var aA = /* @__PURE__ */ Mt(yV, [["__file", "main.vue"]]);
const oA = ni(uV, {
Aside: rA,
Footer: iA,
Header: nA,
Main: aA
});
po(rA);
po(iA);
const sA = po(nA), _b = po(aA), bV = /* @__PURE__ */ Le({
inheritAttrs: !1
});
function xV(t, e, r, i, n, a) {
return Fe(t.$slots, "default");
}
var wV = /* @__PURE__ */ Mt(bV, [["render", xV], ["__file", "collection.vue"]]);
const _V = /* @__PURE__ */ Le({
name: "ElCollectionItem",
inheritAttrs: !1
});
function SV(t, e, r, i, n, a) {
return Fe(t.$slots, "default");
}
var MV = /* @__PURE__ */ Mt(_V, [["render", SV], ["__file", "collection-item.vue"]]);
const EV = "data-el-collection-item", TV = (t) => {
const e = `El${t}Collection`, r = `${e}Item`, i = Symbol(e), n = Symbol(r), a = {
...wV,
name: e,
setup() {
const s = we(null), c = /* @__PURE__ */ new Map();
Dt(i, {
itemMap: c,
getItems: () => {
const l = N(s);
if (!l)
return [];
const u = Array.from(l.querySelectorAll(`[${EV}]`));
return [...c.values()].sort((d, h) => u.indexOf(d.ref) - u.indexOf(h.ref));
},
collectionRef: s
});
}
}, o = {
...MV,
name: r,
setup(s, { attrs: c }) {
const l = we(null), u = Ye(i, void 0);
Dt(n, {
collectionItemRef: l
}), Lt(() => {
const d = N(l);
d && u.itemMap.set(d, {
ref: d,
...c
});
}), Sr(() => {
const d = N(l);
u.itemMap.delete(d);
});
}
};
return {
COLLECTION_INJECTION_KEY: i,
COLLECTION_ITEM_INJECTION_KEY: n,
ElCollection: a,
ElCollectionItem: o
};
}, zv = Kt({
trigger: hh.trigger,
effect: {
...$i.effect,
default: "light"
},
type: {
type: vt(String)
},
placement: {
type: vt(String),
default: "bottom"
},
popperOptions: {
type: vt(Object),
default: () => ({})
},
id: String,
size: {
type: String,
default: ""
},
splitButton: Boolean,
hideOnClick: {
type: Boolean,
default: !0
},
loop: {
type: Boolean,
default: !0
},
showTimeout: {
type: Number,
default: 150
},
hideTimeout: {
type: Number,
default: 150
},
tabindex: {
type: vt([Number, String]),
default: 0
},
maxHeight: {
type: vt([Number, String]),
default: ""
},
popperClass: {
type: String,
default: ""
},
disabled: Boolean,
role: {
type: String,
default: "menu"
},
buttonProps: {
type: vt(Object)
},
teleported: $i.teleported
});
Kt({
command: {
type: [Object, String, Number],
default: () => ({})
},
disabled: Boolean,
divided: Boolean,
textValue: String,
icon: {
type: cs
}
});
Kt({
onKeydown: { type: vt(Function) }
});
TV("Dropdown");
const lA = Symbol("ElSelectGroup"), ep = Symbol("ElSelect");
function CV(t, e) {
const r = Ye(ep), i = Ye(lA, { disabled: !1 }), n = ee(() => u(qo(r.props.modelValue), t.value)), a = ee(() => {
var f;
if (r.props.multiple) {
const p = qo((f = r.props.modelValue) != null ? f : []);
return !n.value && p.length >= r.props.multipleLimit && r.props.multipleLimit > 0;
} else
return !1;
}), o = ee(() => t.label || (di(t.value) ? "" : t.value)), s = ee(() => t.value || t.label || ""), c = ee(() => t.disabled || e.groupDisabled || a.value), l = Ct(), u = (f = [], p) => {
if (di(t.value)) {
const m = r.props.valueKey;
return f && f.some((y) => gl(ja(y, m)) === ja(p, m));
} else
return f && f.includes(p);
}, d = () => {
!t.disabled && !i.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(l.proxy));
}, h = (f) => {
const p = new RegExp(U5(f), "i");
e.visible = p.test(o.value) || t.created;
};
return ze(() => o.value, () => {
!t.created && !r.props.remote && r.setSelected();
}), ze(() => t.value, (f, p) => {
const { remote: m, valueKey: y } = r.props;
if (f !== p && (r.onOptionDestroy(p, l.proxy), r.onOptionCreate(l.proxy)), !t.created && !m) {
if (y && di(f) && di(p) && f[y] === p[y])
return;
r.setSelected();
}
}), ze(() => i.disabled, () => {
e.groupDisabled = i.disabled;
}, { immediate: !0 }), {
select: r,
currentLabel: o,
currentValue: s,
itemSelected: n,
isDisabled: c,
hoverItem: d,
updateOption: h
};
}
const AV = Le({
name: "ElOption",
componentName: "ElOption",
props: {
value: {
required: !0,
type: [String, Number, Boolean, Object]
},
label: [String, Number],
created: Boolean,
disabled: Boolean
},
setup(t) {
const e = Et("select"), r = xg(), i = ee(() => [
e.be("dropdown", "item"),
e.is("disabled", N(s)),
e.is("selected", N(o)),
e.is("hovering", N(h))
]), n = _r({
index: -1,
groupDisabled: !1,
visible: !0,
hover: !1
}), {
currentLabel: a,
itemSelected: o,
isDisabled: s,
select: c,
hoverItem: l,
updateOption: u
} = CV(t, n), { visible: d, hover: h } = Zi(n), f = Ct().proxy;
c.onOptionCreate(f), Sr(() => {
const m = f.value, { selected: y } = c.states, g = (c.props.multiple ? y : [y]).some((v) => v.value === f.value);
st(() => {
c.states.cachedOptions.get(m) === f && !g && c.states.cachedOptions.delete(m);
}), c.onOptionDestroy(m, f);
});
function p() {
s.value || c.handleOptionSelect(f);
}
return {
ns: e,
id: r,
containerKls: i,
currentLabel: a,
itemSelected: o,
isDisabled: s,
select: c,
hoverItem: l,
updateOption: u,
visible: d,
hover: h,
selectOptionClick: p,
states: n
};
}
});
function LV(t, e, r, i, n, a) {
return ht((Q(), be("li", {
id: t.id,
class: xe(t.containerKls),
role: "option",
"aria-disabled": t.isDisabled || void 0,
"aria-selected": t.itemSelected,
onMouseenter: t.hoverItem,
onClick: Tt(t.selectOptionClick, ["stop"])
}, [
Fe(t.$slots, "default", {}, () => [
Ee("span", null, Ze(t.currentLabel), 1)
])
], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [
[Ot, t.visible]
]);
}
var Sb = /* @__PURE__ */ Mt(AV, [["render", LV], ["__file", "option.vue"]]);
const kV = Le({
name: "ElSelectDropdown",
componentName: "ElSelectDropdown",
setup() {
const t = Ye(ep), e = Et("select"), r = ee(() => t.props.popperClass), i = ee(() => t.props.multiple), n = ee(() => t.props.fitInputWidth), a = we("");
function o() {
var s;
a.value = `${(s = t.selectRef) == null ? void 0 : s.offsetWidth}px`;
}
return Lt(() => {
o(), Ua(t.selectRef, o);
}), {
ns: e,
minWidth: a,
popperClass: r,
isMultiple: i,
isFitInputWidth: n
};
}
});
function PV(t, e, r, i, n, a) {
return Q(), be("div", {
class: xe([t.ns.b("dropdown"), t.ns.is("multiple", t.isMultiple), t.popperClass]),
style: yt({ [t.isFitInputWidth ? "width" : "minWidth"]: t.minWidth })
}, [
t.$slots.header ? (Q(), be("div", {
key: 0,
class: xe(t.ns.be("dropdown", "header"))
}, [
Fe(t.$slots, "header")
], 2)) : Pe("v-if", !0),
Fe(t.$slots, "default"),
t.$slots.footer ? (Q(), be("div", {
key: 1,
class: xe(t.ns.be("dropdown", "footer"))
}, [
Fe(t.$slots, "footer")
], 2)) : Pe("v-if", !0)
], 6);
}
var RV = /* @__PURE__ */ Mt(kV, [["render", PV], ["__file", "select-dropdown.vue"]]);
const OV = 11, DV = (t, e) => {
const { t: r } = qh(), i = xg(), n = Et("select"), a = Et("input"), o = _r({
inputValue: "",
options: /* @__PURE__ */ new Map(),
cachedOptions: /* @__PURE__ */ new Map(),
disabledOptions: /* @__PURE__ */ new Map(),
optionValues: [],
selected: [],
selectionWidth: 0,
calculatorWidth: 0,
collapseItemWidth: 0,
selectedLabel: "",
hoveringIndex: -1,
previousQuery: null,
inputHovering: !1,
menuVisibleOnFocus: !1,
isBeforeHide: !1
}), s = we(null), c = we(null), l = we(null), u = we(null), d = we(null), h = we(null), f = we(null), p = we(null), m = we(null), y = we(null), g = we(null), v = we(null), {
isComposing: x,
handleCompositionStart: w,
handleCompositionUpdate: S,
handleCompositionEnd: _
} = IC({
afterComposition: (ae) => te(ae)
}), { wrapperRef: b, isFocused: T } = pb(d, {
beforeFocus() {
return M.value;
},
afterFocus() {
t.automaticDropdown && !E.value && (E.value = !0, o.menuVisibleOnFocus = !0);
},
beforeBlur(ae) {
var Se, Be;
return ((Se = l.value) == null ? void 0 : Se.isFocusInsideContent(ae)) || ((Be = u.value) == null ? void 0 : Be.isFocusInsideContent(ae));
},
afterBlur() {
E.value = !1, o.menuVisibleOnFocus = !1;
}
}), E = we(!1), C = we(), { form: L, formItem: A } = zl(), { inputId: k } = Kh(t, {
formItemContext: A
}), { valueOnClear: P, isEmptyValue: R } = qF(t), M = ee(() => t.disabled || (L == null ? void 0 : L.disabled)), O = ee(() => Ui(t.modelValue) ? t.modelValue.length > 0 : !R(t.modelValue)), D = ee(() => t.clearable && !M.value && o.inputHovering && O.value), I = ee(() => t.remote && t.filterable && !t.remoteShowSuffix ? "" : t.suffixIcon), F = ee(() => n.is("reverse", I.value && E.value)), z = ee(() => (A == null ? void 0 : A.validateState) || ""), U = ee(() => hC[z.value]), Z = ee(() => t.remote ? 300 : 0), re = ee(() => t.loading ? t.loadingText || r("el.select.loading") : t.remote && !o.inputValue && o.options.size === 0 ? !1 : t.filterable && o.inputValue && o.options.size > 0 && K.value === 0 ? t.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t.noDataText || r("el.select.noData") : null), K = ee(() => V.value.filter((ae) => ae.visible).length), V = ee(() => {
const ae = Array.from(o.options.values()), Se = [];
return o.optionValues.forEach((Be) => {
const Ge = ae.findIndex((tt) => tt.value === Be);
Ge > -1 && Se.push(ae[Ge]);
}), Se.length >= ae.length ? Se : ae;
}), H = ee(() => Array.from(o.cachedOptions.values())), G = ee(() => {
const ae = V.value.filter((Se) => !Se.created).some((Se) => Se.currentLabel === o.inputValue);
return t.filterable && t.allowCreate && o.inputValue !== "" && !ae;
}), W = () => {
t.filterable && Di(t.filterMethod) || t.filterable && t.remote && Di(t.remoteMethod) || V.value.forEach((ae) => {
var Se;
(Se = ae.updateOption) == null || Se.call(ae, o.inputValue);
});
}, Y = bl(), X = ee(() => ["small"].includes(Y.value) ? "small" : "default"), ie = ee({
get() {
return E.value && re.value !== !1;
},
set(ae) {
E.value = ae;
}
}), ue = ee(() => {
if (t.multiple && !Yo(t.modelValue))
return qo(t.modelValue).length === 0 && !o.inputValue;
const ae = Ui(t.modelValue) ? t.modelValue[0] : t.modelValue;
return t.filterable || Yo(ae) ? !o.inputValue : !0;
}), $ = ee(() => {
var ae;
const Se = (ae = t.placeholder) != null ? ae : r("el.select.placeholder");
return t.multiple || !O.value ? Se : o.selectedLabel;
}), J = ee(() => sy ? null : "mouseenter");
ze(() => t.modelValue, (ae, Se) => {
t.multiple && t.filterable && !t.reserveKeyword && (o.inputValue = "", ne("")), q(), !Cm(ae, Se) && t.validateEvent && (A == null || A.validate("change").catch((Be) => Vr(Be)));
}, {
flush: "post",
deep: !0
}), ze(() => E.value, (ae) => {
ae ? ne(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = !0), e("visible-change", ae);
}), ze(() => o.options.entries(), () => {
var ae;
if (!$r)
return;
const Se = ((ae = s.value) == null ? void 0 : ae.querySelectorAll("input")) || [];
(!t.filterable && !t.defaultFirstOption && !Yo(t.modelValue) || !Array.from(Se).includes(document.activeElement)) && q(), t.defaultFirstOption && (t.filterable || t.remote) && K.value && j();
}, {
flush: "post"
}), ze(() => o.hoveringIndex, (ae) => {
hi(ae) && ae > -1 ? C.value = V.value[ae] || {} : C.value = {}, V.value.forEach((Se) => {
Se.hover = C.value === Se;
});
}), lg(() => {
o.isBeforeHide || W();
});
const ne = (ae) => {
o.previousQuery === ae || x.value || (o.previousQuery = ae, t.filterable && Di(t.filterMethod) ? t.filterMethod(ae) : t.filterable && t.remote && Di(t.remoteMethod) && t.remoteMethod(ae), t.defaultFirstOption && (t.filterable || t.remote) && K.value ? st(j) : st(ye));
}, j = () => {
const ae = V.value.filter((Ge) => Ge.visible && !Ge.disabled && !Ge.states.groupDisabled), Se = ae.find((Ge) => Ge.created), Be = ae[0];
o.hoveringIndex = qe(V.value, Se || Be);
}, q = () => {
if (t.multiple)
o.selectedLabel = "";
else {
const Se = Ui(t.modelValue) ? t.modelValue[0] : t.modelValue, Be = ge(Se);
o.selectedLabel = Be.currentLabel, o.selected = [Be];
return;
}
const ae = [];
Yo(t.modelValue) || qo(t.modelValue).forEach((Se) => {
ae.push(ge(Se));
}), o.selected = ae;
}, ge = (ae) => {
let Se;
const Be = Tv(ae).toLowerCase() === "object", Ge = Tv(ae).toLowerCase() === "null", tt = Tv(ae).toLowerCase() === "undefined";
for (let ut = o.cachedOptions.size - 1; ut >= 0; ut--) {
const St = H.value[ut];
if (Be ? ja(St.value, t.valueKey) === ja(ae, t.valueKey) : St.value === ae) {
Se = {
value: ae,
currentLabel: St.currentLabel,
get isDisabled() {
return St.isDisabled;
}
};
break;
}
}
if (Se)
return Se;
const gt = Be ? ae.label : !Ge && !tt ? ae : "";
return {
value: ae,
currentLabel: gt
};
}, ye = () => {
o.hoveringIndex = V.value.findIndex((ae) => o.selected.some((Se) => xt(Se) === xt(ae)));
}, _e = () => {
o.selectionWidth = c.value.getBoundingClientRect().width;
}, Me = () => {
o.calculatorWidth = h.value.getBoundingClientRect().width;
}, Ce = () => {
o.collapseItemWidth = g.value.getBoundingClientRect().width;
}, B = () => {
var ae, Se;
(Se = (ae = l.value) == null ? void 0 : ae.updatePopper) == null || Se.call(ae);
}, ce = () => {
var ae, Se;
(Se = (ae = u.value) == null ? void 0 : ae.updatePopper) == null || Se.call(ae);
}, ve = () => {
o.inputValue.length > 0 && !E.value && (E.value = !0), ne(o.inputValue);
}, te = (ae) => {
if (o.inputValue = ae.target.value, t.remote)
pe();
else
return ve();
}, pe = oC(() => {
ve();
}, Z.value), fe = (ae) => {
Cm(t.modelValue, ae) || e(ib, ae);
}, he = (ae) => N5(ae, (Se) => !o.disabledOptions.has(Se)), Te = (ae) => {
if (t.multiple && ae.code !== Gr.delete && ae.target.value.length <= 0) {
const Se = qo(t.modelValue).slice(), Be = he(Se);
if (Be < 0)
return;
const Ge = Se[Be];
Se.splice(Be, 1), e(ui, Se), fe(Se), e("remove-tag", Ge);
}
}, He = (ae, Se) => {
const Be = o.selected.indexOf(Se);
if (Be > -1 && !M.value) {
const Ge = qo(t.modelValue).slice();
Ge.splice(Be, 1), e(ui, Ge), fe(Ge), e("remove-tag", Se.value);
}
ae.stopPropagation(), _t();
}, We = (ae) => {
ae.stopPropagation();
const Se = t.multiple ? [] : P.value;
if (t.multiple)
for (const Be of o.selected)
Be.isDisabled && Se.push(Be.value);
e(ui, Se), fe(Se), o.hoveringIndex = -1, E.value = !1, e("clear"), _t();
}, Ie = (ae) => {
var Se;
if (t.multiple) {
const Be = qo((Se = t.modelValue) != null ? Se : []).slice(), Ge = qe(Be, ae.value);
Ge > -1 ? Be.splice(Ge, 1) : (t.multipleLimit <= 0 || Be.length < t.multipleLimit) && Be.push(ae.value), e(ui, Be), fe(Be), ae.created && ne(""), t.filterable && !t.reserveKeyword && (o.inputValue = "");
} else
e(ui, ae.value), fe(ae.value), E.value = !1;
_t(), !E.value && st(() => {
De(ae);
});
}, qe = (ae = [], Se) => {
if (!di(Se))
return ae.indexOf(Se);
const Be = t.valueKey;
let Ge = -1;
return ae.some((tt, gt) => gl(ja(tt, Be)) === ja(Se, Be) ? (Ge = gt, !0) : !1), Ge;
}, De = (ae) => {
var Se, Be, Ge, tt, gt;
const ut = Ui(ae) ? ae[0] : ae;
let St = null;
if (ut != null && ut.value) {
const er = V.value.filter((vr) => vr.value === ut.value);
er.length > 0 && (St = er[0].$el);
}
if (l.value && St) {
const er = (tt = (Ge = (Be = (Se = l.value) == null ? void 0 : Se.popperRef) == null ? void 0 : Be.contentRef) == null ? void 0 : Ge.querySelector) == null ? void 0 : tt.call(Ge, `.${n.be("dropdown", "wrap")}`);
er && G5(er, St);
}
(gt = v.value) == null || gt.handleScroll();
}, $e = (ae) => {
o.options.set(ae.value, ae), o.cachedOptions.set(ae.value, ae), ae.disabled && o.disabledOptions.set(ae.value, ae);
}, nt = (ae, Se) => {
o.options.get(ae) === Se && o.options.delete(ae);
}, lt = ee(() => {
var ae, Se;
return (Se = (ae = l.value) == null ? void 0 : ae.popperRef) == null ? void 0 : Se.contentRef;
}), mt = () => {
o.isBeforeHide = !1, st(() => De(o.selected));
}, _t = () => {
var ae;
(ae = d.value) == null || ae.focus();
}, wt = () => {
var ae;
(ae = d.value) == null || ae.blur();
}, me = (ae) => {
We(ae);
}, Ne = () => {
E.value = !1, T.value && wt();
}, Ue = () => {
o.inputValue.length > 0 ? o.inputValue = "" : E.value = !1;
}, Ke = () => {
M.value || (sy && (o.inputHovering = !0), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = !1 : E.value = !E.value);
}, ct = () => {
E.value ? V.value[o.hoveringIndex] && Ie(V.value[o.hoveringIndex]) : Ke();
}, xt = (ae) => di(ae.value) ? ja(ae.value, t.valueKey) : ae.value, At = ee(() => V.value.filter((ae) => ae.visible).every((ae) => ae.disabled)), Ft = ee(() => t.multiple ? t.collapseTags ? o.selected.slice(0, t.maxCollapseTags) : o.selected : []), zt = ee(() => t.multiple ? t.collapseTags ? o.selected.slice(t.maxCollapseTags) : [] : []), se = (ae) => {
if (!E.value) {
E.value = !0;
return;
}
if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || x.value) && !At.value) {
ae === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : ae === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1));
const Se = V.value[o.hoveringIndex];
(Se.disabled === !0 || Se.states.groupDisabled === !0 || !Se.visible) && se(ae), st(() => De(C.value));
}
}, ke = () => {
if (!c.value)
return 0;
const ae = window.getComputedStyle(c.value);
return Number.parseFloat(ae.gap || "6px");
}, Ae = ee(() => {
const ae = ke();
return { maxWidth: `${g.value && t.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - ae : o.selectionWidth}px` };
}), Oe = ee(() => ({ maxWidth: `${o.selectionWidth}px` })), Ve = ee(() => ({
width: `${Math.max(o.calculatorWidth, OV)}px`
}));
return Ua(c, _e), Ua(h, Me), Ua(m, B), Ua(b, B), Ua(y, ce), Ua(g, Ce), Lt(() => {
q();
}), {
inputId: k,
contentId: i,
nsSelect: n,
nsInput: a,
states: o,
isFocused: T,
expanded: E,
optionsArray: V,
hoverOption: C,
selectSize: Y,
filteredOptionsCount: K,
resetCalculatorWidth: Me,
updateTooltip: B,
updateTagTooltip: ce,
debouncedOnInputChange: pe,
onInput: te,
deletePrevTag: Te,
deleteTag: He,
deleteSelected: We,
handleOptionSelect: Ie,
scrollToOption: De,
hasModelValue: O,
shouldShowPlaceholder: ue,
currentPlaceholder: $,
mouseEnterEventName: J,
showClose: D,
iconComponent: I,
iconReverse: F,
validateState: z,
validateIcon: U,
showNewOption: G,
updateOptions: W,
collapseTagSize: X,
setSelected: q,
selectDisabled: M,
emptyText: re,
handleCompositionStart: w,
handleCompositionUpdate: S,
handleCompositionEnd: _,
onOptionCreate: $e,
onOptionDestroy: nt,
handleMenuEnter: mt,
focus: _t,
blur: wt,
handleClearClick: me,
handleClickOutside: Ne,
handleEsc: Ue,
toggleMenu: Ke,
selectOption: ct,
getValueKey: xt,
navigateOptions: se,
dropdownMenuVisible: ie,
showTagList: Ft,
collapseTagList: zt,
tagStyle: Ae,
collapseTagStyle: Oe,
inputStyle: Ve,
popperRef: lt,
inputRef: d,
tooltipRef: l,
tagTooltipRef: u,
calculatorRef: h,
prefixRef: f,
suffixRef: p,
selectRef: s,
wrapperRef: b,
selectionRef: c,
scrollbarRef: v,
menuRef: m,
tagMenuRef: y,
collapseItemRef: g
};
};
var IV = Le({
name: "ElOptions",
setup(t, { slots: e }) {
const r = Ye(ep);
let i = [];
return () => {
var n, a;
const o = (n = e.default) == null ? void 0 : n.call(e), s = [];
function c(l) {
Ui(l) && l.forEach((u) => {
var d, h, f, p;
const m = (d = (u == null ? void 0 : u.type) || {}) == null ? void 0 : d.name;
m === "ElOptionGroup" ? c(!Ei(u.children) && !Ui(u.children) && Di((h = u.children) == null ? void 0 : h.default) ? (f = u.children) == null ? void 0 : f.default() : u.children) : m === "ElOption" ? s.push((p = u.props) == null ? void 0 : p.value) : Ui(u.children) && c(u.children);
});
}
return o.length && c((a = o[0]) == null ? void 0 : a.children), Cm(s, i) || (i = s, r && (r.states.optionValues = s)), o;
};
}
});
const NV = Kt({
name: String,
id: String,
modelValue: {
type: [Array, String, Number, Boolean, Object],
default: void 0
},
autocomplete: {
type: String,
default: "off"
},
automaticDropdown: Boolean,
size: Du,
effect: {
type: vt(String),
default: "light"
},
disabled: Boolean,
clearable: Boolean,
filterable: Boolean,
allowCreate: Boolean,
loading: Boolean,
popperClass: {
type: String,
default: ""
},
popperOptions: {
type: vt(Object),
default: () => ({})
},
remote: Boolean,
loadingText: String,
noMatchText: String,
noDataText: String,
remoteMethod: Function,
filterMethod: Function,
multiple: Boolean,
multipleLimit: {
type: Number,
default: 0
},
placeholder: {
type: String
},
defaultFirstOption: Boolean,
reserveKeyword: {
type: Boolean,
default: !0
},
valueKey: {
type: String,
default: "value"
},
collapseTags: Boolean,
collapseTagsTooltip: Boolean,
maxCollapseTags: {
type: Number,
default: 1
},
teleported: $i.teleported,
persistent: {
type: Boolean,
default: !0
},
clearIcon: {
type: cs,
default: tb
},
fitInputWidth: Boolean,
suffixIcon: {
type: cs,
default: gg
},
tagType: { ...by.type, default: "info" },
tagEffect: { ...by.effect, default: "light" },
validateEvent: {
type: Boolean,
default: !0
},
remoteShowSuffix: Boolean,
placement: {
type: vt(String),
values: yg,
default: "bottom-start"
},
fallbackPlacements: {
type: vt(Array),
default: ["bottom-start", "top-start", "right", "left"]
},
appendTo: String,
...WF,
...Ts(["ariaLabel"])
}), W2 = "ElSelect", BV = Le({
name: W2,
componentName: W2,
components: {
ElSelectMenu: RV,
ElOption: Sb,
ElOptions: IV,
ElTag: _6,
ElScrollbar: Sz,
ElTooltip: wb,
ElIcon: Oi
},
directives: { ClickOutside: XC },
props: NV,
emits: [
ui,
ib,
"remove-tag",
"clear",
"visible-change",
"focus",
"blur"
],
setup(t, { emit: e }) {
const r = ee(() => {
const { modelValue: a, multiple: o } = t, s = o ? [] : void 0;
return Ui(a) ? o ? a : s : o ? s : a;
}), i = _r({
...Zi(t),
modelValue: r
}), n = DV(i, e);
return Dt(ep, _r({
props: i,
states: n.states,
optionsArray: n.optionsArray,
handleOptionSelect: n.handleOptionSelect,
onOptionCreate: n.onOptionCreate,
onOptionDestroy: n.onOptionDestroy,
selectRef: n.selectRef,
setSelected: n.setSelected
})), {
...n,
modelValue: r
};
}
});
function FV(t, e, r, i, n, a) {
const o = qt("el-tag"), s = qt("el-tooltip"), c = qt("el-icon"), l = qt("el-option"), u = qt("el-options"), d = qt("el-scrollbar"), h = qt("el-select-menu"), f = BT("click-outside");
return ht((Q(), be("div", {
ref: "selectRef",
class: xe([t.nsSelect.b(), t.nsSelect.m(t.selectSize)]),
[FT(t.mouseEnterEventName)]: (p) => t.states.inputHovering = !0,
onMouseleave: (p) => t.states.inputHovering = !1
}, [
oe(s, {
ref: "tooltipRef",
visible: t.dropdownMenuVisible,
placement: t.placement,
teleported: t.teleported,
"popper-class": [t.nsSelect.e("popper"), t.popperClass],
"popper-options": t.popperOptions,
"fallback-placements": t.fallbackPlacements,
effect: t.effect,
pure: "",
trigger: "click",
transition: `${t.nsSelect.namespace.value}-zoom-in-top`,
"stop-popper-mouse-event": !1,
"gpu-acceleration": !1,
persistent: t.persistent,
"append-to": t.appendTo,
onBeforeShow: t.handleMenuEnter,
onHide: (p) => t.states.isBeforeHide = !1
}, {
default: le(() => {
var p;
return [
Ee("div", {
ref: "wrapperRef",
class: xe([
t.nsSelect.e("wrapper"),
t.nsSelect.is("focused", t.isFocused),
t.nsSelect.is("hovering", t.states.inputHovering),
t.nsSelect.is("filterable", t.filterable),
t.nsSelect.is("disabled", t.selectDisabled)
]),
onClick: Tt(t.toggleMenu, ["prevent"])
}, [
t.$slots.prefix ? (Q(), be("div", {
key: 0,
ref: "prefixRef",
class: xe(t.nsSelect.e("prefix"))
}, [
Fe(t.$slots, "prefix")
], 2)) : Pe("v-if", !0),
Ee("div", {
ref: "selectionRef",
class: xe([
t.nsSelect.e("selection"),
t.nsSelect.is("near", t.multiple && !t.$slots.prefix && !!t.states.selected.length)
])
}, [
t.multiple ? Fe(t.$slots, "tag", { key: 0 }, () => [
(Q(!0), be(pt, null, ir(t.showTagList, (m) => (Q(), be("div", {
key: t.getValueKey(m),
class: xe(t.nsSelect.e("selected-item"))
}, [
oe(o, {
closable: !t.selectDisabled && !m.isDisabled,
size: t.collapseTagSize,
type: t.tagType,
effect: t.tagEffect,
"disable-transitions": "",
style: yt(t.tagStyle),
onClose: (y) => t.deleteTag(y, m)
}, {
default: le(() => [
Ee("span", {
class: xe(t.nsSelect.e("tags-text"))
}, [
Fe(t.$slots, "label", {
label: m.currentLabel,
value: m.value
}, () => [
et(Ze(m.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
], 2))), 128)),
t.collapseTags && t.states.selected.length > t.maxCollapseTags ? (Q(), Re(s, {
key: 0,
ref: "tagTooltipRef",
disabled: t.dropdownMenuVisible || !t.collapseTagsTooltip,
"fallback-placements": ["bottom", "top", "right", "left"],
effect: t.effect,
placement: "bottom",
teleported: t.teleported
}, {
default: le(() => [
Ee("div", {
ref: "collapseItemRef",
class: xe(t.nsSelect.e("selected-item"))
}, [
oe(o, {
closable: !1,
size: t.collapseTagSize,
type: t.tagType,
effect: t.tagEffect,
"disable-transitions": "",
style: yt(t.collapseTagStyle)
}, {
default: le(() => [
Ee("span", {
class: xe(t.nsSelect.e("tags-text"))
}, " + " + Ze(t.states.selected.length - t.maxCollapseTags), 3)
]),
_: 1
}, 8, ["size", "type", "effect", "style"])
], 2)
]),
content: le(() => [
Ee("div", {
ref: "tagMenuRef",
class: xe(t.nsSelect.e("selection"))
}, [
(Q(!0), be(pt, null, ir(t.collapseTagList, (m) => (Q(), be("div", {
key: t.getValueKey(m),
class: xe(t.nsSelect.e("selected-item"))
}, [
oe(o, {
class: "in-tooltip",
closable: !t.selectDisabled && !m.isDisabled,
size: t.collapseTagSize,
type: t.tagType,
effect: t.tagEffect,
"disable-transitions": "",
onClose: (y) => t.deleteTag(y, m)
}, {
default: le(() => [
Ee("span", {
class: xe(t.nsSelect.e("tags-text"))
}, [
Fe(t.$slots, "label", {
label: m.currentLabel,
value: m.value
}, () => [
et(Ze(m.currentLabel), 1)
])
], 2)
]),
_: 2
}, 1032, ["closable", "size", "type", "effect", "onClose"])
], 2))), 128))
], 2)
]),
_: 3
}, 8, ["disabled", "effect", "teleported"])) : Pe("v-if", !0)
]) : Pe("v-if", !0),
t.selectDisabled ? Pe("v-if", !0) : (Q(), be("div", {
key: 1,
class: xe([
t.nsSelect.e("selected-item"),
t.nsSelect.e("input-wrapper"),
t.nsSelect.is("hidden", !t.filterable)
])
}, [
ht(Ee("input", {
id: t.inputId,
ref: "inputRef",
"onUpdate:modelValue": (m) => t.states.inputValue = m,
type: "text",
name: t.name,
class: xe([t.nsSelect.e("input"), t.nsSelect.is(t.selectSize)]),
disabled: t.selectDisabled,
autocomplete: t.autocomplete,
style: yt(t.inputStyle),
role: "combobox",
readonly: !t.filterable,
spellcheck: "false",
"aria-activedescendant": ((p = t.hoverOption) == null ? void 0 : p.id) || "",
"aria-controls": t.contentId,
"aria-expanded": t.dropdownMenuVisible,
"aria-label": t.ariaLabel,
"aria-autocomplete": "none",
"aria-haspopup": "listbox",
onKeydown: [
ti(Tt((m) => t.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
ti(Tt((m) => t.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
ti(Tt(t.handleEsc, ["stop", "prevent"]), ["esc"]),
ti(Tt(t.selectOption, ["stop", "prevent"]), ["enter"]),
ti(Tt(t.deletePrevTag, ["stop"]), ["delete"])
],
onCompositionstart: t.handleCompositionStart,
onCompositionupdate: t.handleCompositionUpdate,
onCompositionend: t.handleCompositionEnd,
onInput: t.onInput,
onClick: Tt(t.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"]), [
[zT, t.states.inputValue]
]),
t.filterable ? (Q(), be("span", {
key: 0,
ref: "calculatorRef",
"aria-hidden": "true",
class: xe(t.nsSelect.e("input-calculator")),
textContent: Ze(t.states.inputValue)
}, null, 10, ["textContent"])) : Pe("v-if", !0)
], 2)),
t.shouldShowPlaceholder ? (Q(), be("div", {
key: 2,
class: xe([
t.nsSelect.e("selected-item"),
t.nsSelect.e("placeholder"),
t.nsSelect.is("transparent", !t.hasModelValue || t.expanded && !t.states.inputValue)
])
}, [
t.hasModelValue ? Fe(t.$slots, "label", {
key: 0,
label: t.currentPlaceholder,
value: t.modelValue
}, () => [
Ee("span", null, Ze(t.currentPlaceholder), 1)
]) : (Q(), be("span", { key: 1 }, Ze(t.currentPlaceholder), 1))
], 2)) : Pe("v-if", !0)
], 2),
Ee("div", {
ref: "suffixRef",
class: xe(t.nsSelect.e("suffix"))
}, [
t.iconComponent && !t.showClose ? (Q(), Re(c, {
key: 0,
class: xe([t.nsSelect.e("caret"), t.nsSelect.e("icon"), t.iconReverse])
}, {
default: le(() => [
(Q(), Re(Yt(t.iconComponent)))
]),
_: 1
}, 8, ["class"])) : Pe("v-if", !0),
t.showClose && t.clearIcon ? (Q(), Re(c, {
key: 1,
class: xe([
t.nsSelect.e("caret"),
t.nsSelect.e("icon"),
t.nsSelect.e("clear")
]),
onClick: t.handleClearClick
}, {
default: le(() => [
(Q(), Re(Yt(t.clearIcon)))
]),
_: 1
}, 8, ["class", "onClick"])) : Pe("v-if", !0),
t.validateState && t.validateIcon ? (Q(), Re(c, {
key: 2,
class: xe([t.nsInput.e("icon"), t.nsInput.e("validateIcon")])
}, {
default: le(() => [
(Q(), Re(Yt(t.validateIcon)))
]),
_: 1
}, 8, ["class"])) : Pe("v-if", !0)
], 2)
], 10, ["onClick"])
];
}),
content: le(() => [
oe(h, { ref: "menuRef" }, {
default: le(() => [
t.$slots.header ? (Q(), be("div", {
key: 0,
class: xe(t.nsSelect.be("dropdown", "header")),
onClick: Tt(() => {
}, ["stop"])
}, [
Fe(t.$slots, "header")
], 10, ["onClick"])) : Pe("v-if", !0),
ht(oe(d, {
id: t.contentId,
ref: "scrollbarRef",
tag: "ul",
"wrap-class": t.nsSelect.be("dropdown", "wrap"),
"view-class": t.nsSelect.be("dropdown", "list"),
class: xe([t.nsSelect.is("empty", t.filteredOptionsCount === 0)]),
role: "listbox",
"aria-label": t.ariaLabel,
"aria-orientation": "vertical"
}, {
default: le(() => [
t.showNewOption ? (Q(), Re(l, {
key: 0,
value: t.states.inputValue,
created: !0
}, null, 8, ["value"])) : Pe("v-if", !0),
oe(u, null, {
default: le(() => [
Fe(t.$slots, "default")
]),
_: 3
})
]),
_: 3
}, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [
[Ot, t.states.options.size > 0 && !t.loading]
]),
t.$slots.loading && t.loading ? (Q(), be("div", {
key: 1,
class: xe(t.nsSelect.be("dropdown", "loading"))
}, [
Fe(t.$slots, "loading")
], 2)) : t.loading || t.filteredOptionsCount === 0 ? (Q(), be("div", {
key: 2,
class: xe(t.nsSelect.be("dropdown", "empty"))
}, [
Fe(t.$slots, "empty", {}, () => [
Ee("span", null, Ze(t.emptyText), 1)
])
], 2)) : Pe("v-if", !0),
t.$slots.footer ? (Q(), be("div", {
key: 3,
class: xe(t.nsSelect.be("dropdown", "footer")),
onClick: Tt(() => {
}, ["stop"])
}, [
Fe(t.$slots, "footer")
], 10, ["onClick"])) : Pe("v-if", !0)
]),
_: 3
}, 512)
]),
_: 3
}, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"])
], 16, ["onMouseleave"])), [
[f, t.handleClickOutside, t.popperRef]
]);
}
var zV = /* @__PURE__ */ Mt(BV, [["render", FV], ["__file", "select.vue"]]);
const $V = Le({
name: "ElOptionGroup",
componentName: "ElOptionGroup",
props: {
label: String,
disabled: Boolean
},
setup(t) {
const e = Et("select"), r = we(null), i = Ct(), n = we([]);
Dt(lA, _r({
...Zi(t)
}));
const a = ee(() => n.value.some((l) => l.visible === !0)), o = (l) => {
var u, d;
return ((u = l.type) == null ? void 0 : u.name) === "ElOption" && !!((d = l.component) != null && d.proxy);
}, s = (l) => {
const u = qo(l), d = [];
return u.forEach((h) => {
var f, p;
o(h) ? d.push(h.component.proxy) : (f = h.children) != null && f.length ? d.push(...s(h.children)) : (p = h.component) != null && p.subTree && d.push(...s(h.component.subTree));
}), d;
}, c = () => {
n.value = s(i.subTree);
};
return Lt(() => {
c();
}), BD(r, c, {
attributes: !0,
subtree: !0,
childList: !0
}), {
groupRef: r,
visible: a,
ns: e
};
}
});
function VV(t, e, r, i, n, a) {
return ht((Q(), be("ul", {
ref: "groupRef",
class: xe(t.ns.be("group", "wrap"))
}, [
Ee("li", {
class: xe(t.ns.be("group", "title"))
}, Ze(t.label), 3),
Ee("li", null, [
Ee("ul", {
class: xe(t.ns.b("group"))
}, [
Fe(t.$slots, "default")
], 2)
])
], 2)), [
[Ot, t.visible]
]);
}
var cA = /* @__PURE__ */ Mt($V, [["render", VV], ["__file", "option-group.vue"]]);
const UV = ni(zV, {
Option: Sb,
OptionGroup: cA
}), jV = po(Sb);
po(cA);
const HV = Kt({
trigger: hh.trigger,
placement: zv.placement,
disabled: hh.disabled,
visible: $i.visible,
transition: $i.transition,
popperOptions: zv.popperOptions,
tabindex: zv.tabindex,
content: $i.content,
popperStyle: $i.popperStyle,
popperClass: $i.popperClass,
enterable: {
...$i.enterable,
default: !0
},
effect: {
...$i.effect,
default: "light"
},
teleported: $i.teleported,
title: String,
width: {
type: [String, Number],
default: 150
},
offset: {
type: Number,
default: void 0
},
showAfter: {
type: Number,
default: 0
},
hideAfter: {
type: Number,
default: 200
},
autoClose: {
type: Number,
default: 0
},
showArrow: {
type: Boolean,
default: !0
},
persistent: {
type: Boolean,
default: !0
},
"onUpdate:visible": {
type: Function
}
}), GV = {
"update:visible": (t) => Zc(t),
"before-enter": () => !0,
"before-leave": () => !0,
"after-enter": () => !0,
"after-leave": () => !0
}, WV = "onUpdate:visible", qV = Le({
name: "ElPopover"
}), XV = /* @__PURE__ */ Le({
...qV,
props: HV,
emits: GV,
setup(t, { expose: e, emit: r }) {
const i = t, n = ee(() => i[WV]), a = Et("popover"), o = we(), s = ee(() => {
var y;
return (y = N(o)) == null ? void 0 : y.popperRef;
}), c = ee(() => [
{
width: Yc(i.width)
},
i.popperStyle
]), l = ee(() => [a.b(), i.popperClass, { [a.m("plain")]: !!i.content }]), u = ee(() => i.transition === `${a.namespace.value}-fade-in-linear`), d = () => {
var y;
(y = o.value) == null || y.hide();
}, h = () => {
r("before-enter");
}, f = () => {
r("before-leave");
}, p = () => {
r("after-enter");
}, m = () => {
r("update:visible", !1), r("after-leave");
};
return e({
popperRef: s,
hide: d
}), (y, g) => (Q(), Re(N(wb), Nr({
ref_key: "tooltipRef",
ref: o
}, y.$attrs, {
trigger: y.trigger,
placement: y.placement,
disabled: y.disabled,
visible: y.visible,
transition: y.transition,
"popper-options": y.popperOptions,
tabindex: y.tabindex,
content: y.content,
offset: y.offset,
"show-after": y.showAfter,
"hide-after": y.hideAfter,
"auto-close": y.autoClose,
"show-arrow": y.showArrow,
"aria-label": y.title,
effect: y.effect,
enterable: y.enterable,
"popper-class": N(l),
"popper-style": N(c),
teleported: y.teleported,
persistent: y.persistent,
"gpu-acceleration": N(u),
"onUpdate:visible": N(n),
onBeforeShow: h,
onBeforeHide: f,
onShow: p,
onHide: m
}), {
content: le(() => [
y.title ? (Q(), be("div", {
key: 0,
class: xe(N(a).e("title")),
role: "title"
}, Ze(y.title), 3)) : Pe("v-if", !0),
Fe(y.$slots, "default", {}, () => [
et(Ze(y.content), 1)
])
]),
default: le(() => [
y.$slots.reference ? Fe(y.$slots, "reference", { key: 0 }) : Pe("v-if", !0)
]),
_: 3
}, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"]));
}
});
var ZV = /* @__PURE__ */ Mt(XV, [["__file", "popover.vue"]]);
const q2 = (t, e) => {
const r = e.arg || e.value, i = r == null ? void 0 : r.popperRef;
i && (i.triggerRef = t);
};
var YV = {
mounted(t, e) {
q2(t, e);
},
updated(t, e) {
q2(t, e);
}
};
const KV = "popover", JV = gB(YV, KV), Mb = ni(ZV, {
directive: JV
}), zc = "$treeNodeId", X2 = function(t, e) {
!e || e[zc] || Object.defineProperty(e, zc, {
value: t.id,
enumerable: !1,
configurable: !1,
writable: !1
});
}, Eb = function(t, e) {
return t ? e[t] : e[zc];
}, xy = (t, e, r) => {
const i = t.value.currentNode;
r();
const n = t.value.currentNode;
i !== n && e("current-change", n ? n.data : null, n);
}, wy = (t) => {
let e = !0, r = !0, i = !0;
for (let n = 0, a = t.length; n < a; n++) {
const o = t[n];
(o.checked !== !0 || o.indeterminate) && (e = !1, o.disabled || (i = !1)), (o.checked !== !1 || o.indeterminate) && (r = !1);
}
return { all: e, none: r, allWithoutDisable: i, half: !e && !r };
}, Id = function(t) {
if (t.childNodes.length === 0 || t.loading)
return;
const { all: e, none: r, half: i } = wy(t.childNodes);
e ? (t.checked = !0, t.indeterminate = !1) : i ? (t.checked = !1, t.indeterminate = !0) : r && (t.checked = !1, t.indeterminate = !1);
const n = t.parent;
!n || n.level === 0 || t.store.checkStrictly || Id(n);
}, zp = function(t, e) {
const r = t.store.props, i = t.data || {}, n = r[e];
if (typeof n == "function")
return n(i, t);
if (typeof n == "string")
return i[n];
if (typeof n > "u") {
const a = i[e];
return a === void 0 ? "" : a;
}
};
let QV = 0, _y = class am {
constructor(e) {
this.id = QV++, this.text = null, this.checked = !1, this.indeterminate = !1, this.data = null, this.expanded = !1, this.parent = null, this.visible = !0, this.isCurrent = !1, this.canFocus = !1;
for (const r in e)
vl(e, r) && (this[r] = e[r]);
this.level = 0, this.loaded = !1, this.childNodes = [], this.loading = !1, 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 a = zp(this, "isLeaf");
typeof a == "boolean" && (this.isLeafByUser = a);
}
if (e.lazy !== !0 && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = !0, this.canFocus = !0)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || X2(this, this.data), !this.data)
return;
const i = e.defaultExpandedKeys, n = e.key;
n && i && i.includes(this.key) && this.expand(null, e.autoExpandParent), n && e.currentNodeKey !== void 0 && this.key === e.currentNodeKey && (e.currentNode = this, e.currentNode.isCurrent = !0), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === !0) && (this.canFocus = !0);
}
setData(e) {
Array.isArray(e) || X2(this, e), this.data = e, this.childNodes = [];
let r;
this.level === 0 && Array.isArray(this.data) ? r = this.data : r = zp(this, "children") || [];
for (let i = 0, n = r.length; i < n; i++)
this.insertChild({ data: r[i] });
}
get label() {
return zp(this, "label");
}
get key() {
const e = this.store.key;
return this.data ? this.data[e] : null;
}
get disabled() {
return zp(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 = !0) {
return (this.childNodes || []).some((i) => i === e || r && i.contains(e));
}
remove() {
const e = this.parent;
e && e.removeChild(this);
}
insertChild(e, r, i) {
if (!e)
throw new Error("InsertChild error: child is required.");
if (!(e instanceof am)) {
if (!i) {
const n = this.getChildren(!0);
n.includes(e.data) || (typeof r > "u" || r < 0 ? n.push(e.data) : n.splice(r, 0, e.data));
}
Object.assign(e, {
parent: this,
store: this.store
}), e = _r(new am(e)), e instanceof am && 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 i;
r && (i = this.childNodes.indexOf(r)), this.insertChild(e, i);
}
insertAfter(e, r) {
let i;
r && (i = this.childNodes.indexOf(r), i !== -1 && (i += 1)), this.insertChild(e, i);
}
removeChild(e) {
const r = this.getChildren() || [], i = r.indexOf(e.data);
i > -1 && r.splice(i, 1);
const n = this.childNodes.indexOf(e);
n > -1 && (this.store && this.store.deregisterNode(e), e.parent = null, this.childNodes.splice(n, 1)), this.updateLeafState();
}
removeChildByData(e) {
let r = null;
for (let i = 0; i < this.childNodes.length; i++)
if (this.childNodes[i].data === e) {
r = this.childNodes[i];
break;
}
r && this.removeChild(r);
}
expand(e, r) {
const i = () => {
if (r) {
let n = this.parent;
for (; n.level > 0; )
n.expanded = !0, n = n.parent;
}
this.expanded = !0, e && e(), this.childNodes.forEach((n) => {
n.canFocus = !0;
});
};
this.shouldLoadData() ? this.loadData((n) => {
Array.isArray(n) && (this.checked ? this.setChecked(!0, !0) : this.store.checkStrictly || Id(this), i());
}) : i();
}
doCreateChildren(e, r = {}) {
e.forEach((i) => {
this.insertChild(Object.assign({ data: i }, r), void 0, !0);
});
}
collapse() {
this.expanded = !1, this.childNodes.forEach((e) => {
e.canFocus = !1;
});
}
shouldLoadData() {
return this.store.lazy === !0 && this.store.load && !this.loaded;
}
updateLeafState() {
if (this.store.lazy === !0 && this.loaded !== !0 && typeof this.isLeafByUser < "u") {
this.isLeaf = this.isLeafByUser;
return;
}
const e = this.childNodes;
if (!this.store.lazy || this.store.lazy === !0 && this.loaded === !0) {
this.isLeaf = !e || e.length === 0;
return;
}
this.isLeaf = !1;
}
setChecked(e, r, i, n) {
if (this.indeterminate = e === "half", this.checked = e === !0, this.store.checkStrictly)
return;
if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
const { all: o, allWithoutDisable: s } = wy(this.childNodes);
!this.isLeaf && !o && s && (this.checked = !1, e = !1);
const c = () => {
if (r) {
const l = this.childNodes;
for (let h = 0, f = l.length; h < f; h++) {
const p = l[h];
n = n || e !== !1;
const m = p.disabled ? p.checked : n;
p.setChecked(m, r, !0, n);
}
const { half: u, all: d } = wy(l);
d || (this.checked = d, this.indeterminate = u);
}
};
if (this.shouldLoadData()) {
this.loadData(() => {
c(), Id(this);
}, {
checked: e !== !1
});
return;
} else
c();
}
const a = this.parent;
!a || a.level === 0 || i || Id(a);
}
getChildren(e = !1) {
if (this.level === 0)
return this.data;
const r = this.data;
if (!r)
return null;
const i = this.store.props;
let n = "children";
return i && (n = i.children || "children"), r[n] === void 0 && (r[n] = null), e && !r[n] && (r[n] = []), r[n];
}
updateChildren() {
const e = this.getChildren() || [], r = this.childNodes.map((a) => a.data), i = {}, n = [];
e.forEach((a, o) => {
const s = a[zc];
s && r.findIndex((c) => c[zc] === s) >= 0 ? i[s] = { index: o, data: a } : n.push({ index: o, data: a });
}), this.store.lazy || r.forEach((a) => {
i[a[zc]] || this.removeChildByData(a);
}), n.forEach(({ index: a, data: o }) => {
this.insertChild({ data: o }, a);
}), this.updateLeafState();
}
loadData(e, r = {}) {
if (this.store.lazy === !0 && this.store.load && !this.loaded && (!this.loading || Object.keys(r).length)) {
this.loading = !0;
const i = (a) => {
this.childNodes = [], this.doCreateChildren(a, r), this.loaded = !0, this.loading = !1, this.updateLeafState(), e && e.call(this, a);
}, n = () => {
this.loading = !1;
};
this.store.load(this, i, n);
} else
e && e.call(this);
}
eachNode(e) {
const r = [this];
for (; r.length; ) {
const i = r.shift();
r.unshift(...i.childNodes), e(i);
}
}
reInitChecked() {
this.store.checkStrictly || Id(this);
}
}, e8 = class {
constructor(e) {
this.currentNode = null, this.currentNodeKey = null;
for (const r in e)
vl(e, r) && (this[r] = e[r]);
this.nodesMap = {};
}
initialize() {
if (this.root = new _y({
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, i = this.lazy, n = function(a) {
const o = a.root ? a.root.childNodes : a.childNodes;
if (o.forEach((s) => {
s.visible = r.call(s, e, s.data, s), n(s);
}), !a.visible && o.length) {
let s = !0;
s = !o.some((c) => c.visible), a.root ? a.root.visible = s === !1 : a.visible = s === !1;
}
e && a.visible && !a.isLeaf && (!i || a.loaded) && a.expand();
};
n(this);
}
setData(e) {
e !== this.root.data ? (this.nodesMap = {}, this.root.setData(e), this._initDefaultCheckedNodes()) : this.root.updateChildren();
}
getNode(e) {
if (e instanceof _y)
return e;
const r = di(e) ? Eb(this.key, e) : e;
return this.nodesMap[r] || null;
}
insertBefore(e, r) {
const i = this.getNode(r);
i.parent.insertBefore({ data: e }, i);
}
insertAfter(e, r) {
const i = this.getNode(r);
i.parent.insertAfter({ data: e }, i);
}
remove(e) {
const r = this.getNode(e);
r && r.parent && (r === this.currentNode && (this.currentNode = null), r.parent.removeChild(r));
}
append(e, r) {
const i = Am(r) ? this.root : this.getNode(r);
i && i.insertChild({ data: e });
}
_initDefaultCheckedNodes() {
const e = this.defaultCheckedKeys || [], r = this.nodesMap;
e.forEach((i) => {
const n = r[i];
n && n.setChecked(!0, !this.checkStrictly);
});
}
_initDefaultCheckedNode(e) {
(this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(!0, !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((r) => {
this.deregisterNode(r);
}), delete this.nodesMap[e.key]);
}
getCheckedNodes(e = !1, r = !1) {
const i = [], n = function(a) {
(a.root ? a.root.childNodes : a.childNodes).forEach((o) => {
(o.checked || r && o.indeterminate) && (!e || e && o.isLeaf) && i.push(o.data), n(o);
});
};
return n(this), i;
}
getCheckedKeys(e = !1) {
return this.getCheckedNodes(e).map((r) => (r || {})[this.key]);
}
getHalfCheckedNodes() {
const e = [], r = function(i) {
(i.root ? i.root.childNodes : i.childNodes).forEach((n) => {
n.indeterminate && e.push(n.data), r(n);
});
};
return r(this), e;
}
getHalfCheckedKeys() {
return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]);
}
_getAllNodes() {
const e = [], r = this.nodesMap;
for (const i in r)
vl(r, i) && e.push(r[i]);
return e;
}
updateChildren(e, r) {
const i = this.nodesMap[e];
if (!i)
return;
const n = i.childNodes;
for (let a = n.length - 1; a >= 0; a--) {
const o = n[a];
this.remove(o.data);
}
for (let a = 0, o = r.length; a < o; a++) {
const s = r[a];
this.append(s, i.data);
}
}
_setCheckedKeys(e, r = !1, i) {
const n = this._getAllNodes().sort((c, l) => c.level - l.level), a = /* @__PURE__ */ Object.create(null), o = Object.keys(i);
n.forEach((c) => c.setChecked(!1, !1));
const s = (c) => {
c.childNodes.forEach((l) => {
var u;
a[l.data[e]] = !0, (u = l.childNodes) != null && u.length && s(l);
});
};
for (let c = 0, l = n.length; c < l; c++) {
const u = n[c], d = u.data[e].toString();
if (!o.includes(d)) {
u.checked && !a[d] && u.setChecked(!1, !1);
continue;
}
if (u.childNodes.length && s(u), u.isLeaf || this.checkStrictly) {
u.setChecked(!0, !1);
continue;
}
if (u.setChecked(!0, !0), r) {
u.setChecked(!1, !1);
const h = function(f) {
f.childNodes.forEach((p) => {
p.isLeaf || p.setChecked(!1, !1), h(p);
});
};
h(u);
}
}
}
setCheckedNodes(e, r = !1) {
const i = this.key, n = {};
e.forEach((a) => {
n[(a || {})[i]] = !0;
}), this._setCheckedKeys(i, r, n);
}
setCheckedKeys(e, r = !1) {
this.defaultCheckedKeys = e;
const i = this.key, n = {};
e.forEach((a) => {
n[a] = !0;
}), this._setCheckedKeys(i, r, n);
}
setDefaultExpandedKeys(e) {
e = e || [], this.defaultExpandedKeys = e, e.forEach((r) => {
const i = this.getNode(r);
i && i.expand(null, this.autoExpandParent);
});
}
setChecked(e, r, i) {
const n = this.getNode(e);
n && n.setChecked(!!r, i);
}
getCurrentNode() {
return this.currentNode;
}
setCurrentNode(e) {
const r = this.currentNode;
r && (r.isCurrent = !1), this.currentNode = e, this.currentNode.isCurrent = !0;
}
setUserCurrentNode(e, r = !0) {
const i = e[this.key], n = this.nodesMap[i];
this.setCurrentNode(n), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0);
}
setCurrentNodeKey(e, r = !0) {
if (e == null) {
this.currentNode && (this.currentNode.isCurrent = !1), this.currentNode = null;
return;
}
const i = this.getNode(e);
i && (this.setCurrentNode(i), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, !0));
}
};
const t8 = Le({
name: "ElTreeNodeContent",
props: {
node: {
type: Object,
required: !0
},
renderContent: Function
},
setup(t) {
const e = Et("tree"), r = Ye("NodeInstance"), i = Ye("RootTree");
return () => {
const n = t.node, { data: a, store: o } = n;
return t.renderContent ? t.renderContent(an, { _self: r, node: n, data: a, store: o }) : Fe(i.ctx.slots, "default", { node: n, data: a }, () => [
an("span", { class: e.be("node", "label") }, [n.label])
]);
};
}
});
var r8 = /* @__PURE__ */ Mt(t8, [["__file", "tree-node-content.vue"]]);
function uA(t) {
const e = Ye("TreeNodeMap", null), r = {
treeNodeExpand: (i) => {
t.node !== i && t.node.collapse();
},
children: []
};
return e && e.children.push(r), Dt("TreeNodeMap", r), {
broadcastExpanded: (i) => {
if (t.accordion)
for (const n of r.children)
n.treeNodeExpand(i);
}
};
}
const dA = Symbol("dragEvents");
function i8({ props: t, ctx: e, el$: r, dropIndicator$: i, store: n }) {
const a = Et("tree"), o = we({
showDropIndicator: !1,
draggingNode: null,
dropNode: null,
allowDrop: !0,
dropType: null
});
return Dt(dA, {
treeNodeDragStart: ({ event: s, treeNode: c }) => {
if (typeof t.allowDrag == "function" && !t.allowDrag(c.node))
return s.preventDefault(), !1;
s.dataTransfer.effectAllowed = "move";
try {
s.dataTransfer.setData("text/plain", "");
} catch {
}
o.value.draggingNode = c, e.emit("node-drag-start", c.node, s);
},
treeNodeDragOver: ({ event: s, treeNode: c }) => {
const l = c, u = o.value.dropNode;
u && u.node.id !== l.node.id && sl(u.$el, a.is("drop-inner"));
const d = o.value.draggingNode;
if (!d || !l)
return;
let h = !0, f = !0, p = !0, m = !0;
typeof t.allowDrop == "function" && (h = t.allowDrop(d.node, l.node, "prev"), m = f = t.allowDrop(d.node, l.node, "inner"), p = t.allowDrop(d.node, l.node, "next")), s.dataTransfer.dropEffect = f || h || p ? "move" : "none", (h || f || p) && (u == null ? void 0 : u.node.id) !== l.node.id && (u && e.emit("node-drag-leave", d.node, u.node, s), e.emit("node-drag-enter", d.node, l.node, s)), h || f || p ? o.value.dropNode = l : o.value.dropNode = null, l.node.nextSibling === d.node && (p = !1), l.node.previousSibling === d.node && (h = !1), l.node.contains(d.node, !1) && (f = !1), (d.node === l.node || d.node.contains(l.node)) && (h = !1, f = !1, p = !1);
const y = l.$el.querySelector(`.${a.be("node", "content")}`).getBoundingClientRect(), g = r.value.getBoundingClientRect();
let v;
const x = h ? f ? 0.25 : p ? 0.45 : 1 : -1, w = p ? f ? 0.75 : h ? 0.55 : 0 : 1;
let S = -9999;
const _ = s.clientY - y.top;
_ < y.height * x ? v = "before" : _ > y.height * w ? v = "after" : f ? v = "inner" : v = "none";
const b = l.$el.querySelector(`.${a.be("node", "expand-icon")}`).getBoundingClientRect(), T = i.value;
v === "before" ? S = b.top - g.top : v === "after" && (S = b.bottom - g.top), T.style.top = `${S}px`, T.style.left = `${b.right - g.left}px`, v === "inner" ? py(l.$el, a.is("drop-inner")) : sl(l.$el, a.is("drop-inner")), o.value.showDropIndicator = v === "before" || v === "after", o.value.allowDrop = o.value.showDropIndicator || m, o.value.dropType = v, e.emit("node-drag-over", d.node, l.node, s);
},
treeNodeDragEnd: (s) => {
const { draggingNode: c, dropType: l, dropNode: u } = o.value;
if (s.preventDefault(), s.dataTransfer && (s.dataTransfer.dropEffect = "move"), c && u) {
const d = { data: c.node.data };
l !== "none" && c.node.remove(), l === "before" ? u.node.parent.insertBefore(d, u.node) : l === "after" ? u.node.parent.insertAfter(d, u.node) : l === "inner" && u.node.insertChild(d), l !== "none" && (n.value.registerNode(d), n.value.key && c.node.eachNode((h) => {
var f;
(f = n.value.nodesMap[h.data[n.value.key]]) == null || f.setChecked(h.checked, !n.value.checkStrictly);
})), sl(u.$el, a.is("drop-inner")), e.emit("node-drag-end", c.node, u.node, l, s), l !== "none" && e.emit("node-drop", c.node, u.node, l, s);
}
c && !u && e.emit("node-drag-end", c.node, null, l, s), o.value.showDropIndicator = !1, o.value.draggingNode = null, o.value.dropNode = null, o.value.allowDrop = !0;
}
}), {
dragState: o
};
}
const n8 = Le({
name: "ElTreeNode",
components: {
ElCollapseTransition: N6,
ElCheckbox: v6,
NodeContent: r8,
ElIcon: Oi,
Loading: rb
},
props: {
node: {
type: _y,
default: () => ({})
},
props: {
type: Object,
default: () => ({})
},
accordion: Boolean,
renderContent: Function,
renderAfterExpand: Boolean,
showCheckbox: {
type: Boolean,
default: !1
}
},
emits: ["node-expand"],
setup(t, e) {
const r = Et("tree"), { broadcastExpanded: i } = uA(t), n = Ye("RootTree"), a = we(!1), o = we(!1), s = we(null), c = we(null), l = we(null), u = Ye(dA), d = Ct();
Dt("NodeInstance", d), n || Vr("Tree", "Can not find node's tree."), t.node.expanded && (a.value = !0, o.value = !0);
const h = n.props.props.children || "children";
ze(() => {
const w = t.node.data[h];
return w && [...w];
}, () => {
t.node.updateChildren();
}), ze(() => t.node.indeterminate, (w) => {
m(t.node.checked, w);
}), ze(() => t.node.checked, (w) => {
m(w, t.node.indeterminate);
}), ze(() => t.node.childNodes.length, () => t.node.reInitChecked()), ze(() => t.node.expanded, (w) => {
st(() => a.value = w), w && (o.value = !0);
});
const f = (w) => Eb(n.props.nodeKey, w.data), p = (w) => {
const S = t.props.class;
if (!S)
return {};
let _;
if (Di(S)) {
const { data: b } = w;
_ = S(b, w);
} else
_ = S;
return Ei(_) ? { [_]: !0 } : _;
}, m = (w, S) => {
(s.value !== w || c.value !== S) && n.ctx.emit("check-change", t.node.data, w, S), s.value = w, c.value = S;
}, y = (w) => {
xy(n.store, n.ctx.emit, () => n.store.value.setCurrentNode(t.node)), n.currentNode.value = t.node, n.props.expandOnClickNode && v(), n.props.checkOnClickNode && !t.node.disabled && x(null, {
target: { checked: !t.node.checked }
}), n.ctx.emit("node-click", t.node.data, t.node, d, w);
}, g = (w) => {
n.instance.vnode.props.onNodeContextmenu && (w.stopPropagation(), w.preventDefault()), n.ctx.emit("node-contextmenu", w, t.node.data, t.node, d);
}, v = () => {
t.node.isLeaf || (a.value ? (n.ctx.emit("node-collapse", t.node.data, t.node, d), t.node.collapse()) : t.node.expand(() => {
e.emit("node-expand", t.node.data, t.node, d);
}));
}, x = (w, S) => {
t.node.setChecked(S.target.checked, !n.props.checkStrictly), st(() => {
const _ = n.store.value;
n.ctx.emit("check", t.node.data, {
checkedNodes: _.getCheckedNodes(),
checkedKeys: _.getCheckedKeys(),
halfCheckedNodes: _.getHalfCheckedNodes(),
halfCheckedKeys: _.getHalfCheckedKeys()
});
});
};
return {
ns: r,
node$: l,
tree: n,
expanded: a,
childNodeRendered: o,
oldChecked: s,
oldIndeterminate: c,
getNodeKey: f,
getNodeClass: p,
handleSelectChange: m,
handleClick: y,
handleContextMenu: g,
handleExpandIconClick: v,
handleCheckChange: x,
handleChildNodeExpand: (w, S, _) => {
i(S), n.ctx.emit("node-expand", w, S, _);
},
handleDragStart: (w) => {
n.props.draggable && u.treeNodeDragStart({ event: w, treeNode: t });
},
handleDragOver: (w) => {
w.preventDefault(), n.props.draggable && u.treeNodeDragOver({
event: w,
treeNode: { $el: l.value, node: t.node }
});
},
handleDrop: (w) => {
w.preventDefault();
},
handleDragEnd: (w) => {
n.props.draggable && u.treeNodeDragEnd(w);
},
CaretRight: Z5
};
}
});
function a8(t, e, r, i, n, a) {
const o = qt("el-icon"), s = qt("el-checkbox"), c = qt("loading"), l = qt("node-content"), u = qt("el-tree-node"), d = qt("el-collapse-transition");
return ht((Q(), be("div", {
ref: "node$",
class: xe([
t.ns.b("node"),
t.ns.is("expanded", t.expanded),
t.ns.is("current", t.node.isCurrent),
t.ns.is("hidden", !t.node.visible),
t.ns.is("focusable", !t.node.disabled),
t.ns.is("checked", !t.node.disabled && t.node.checked),
t.getNodeClass(t.node)
]),
role: "treeitem",
tabindex: "-1",
"aria-expanded": t.expanded,
"aria-disabled": t.node.disabled,
"aria-checked": t.node.checked,
draggable: t.tree.props.draggable,
"data-key": t.getNodeKey(t.node),
onClick: Tt(t.handleClick, ["stop"]),
onContextmenu: t.handleContextMenu,
onDragstart: Tt(t.handleDragStart, ["stop"]),
onDragover: Tt(t.handleDragOver, ["stop"]),
onDragend: Tt(t.handleDragEnd, ["stop"]),
onDrop: Tt(t.handleDrop, ["stop"])
}, [
Ee("div", {
class: xe(t.ns.be("node", "content")),
style: yt({ paddingLeft: (t.node.level - 1) * t.tree.props.indent + "px" })
}, [
t.tree.props.icon || t.CaretRight ? (Q(), Re(o, {
key: 0,
class: xe([
t.ns.be("node", "expand-icon"),
t.ns.is("leaf", t.node.isLeaf),
{
expanded: !t.node.isLeaf && t.expanded
}
]),
onClick: Tt(t.handleExpandIconClick, ["stop"])
}, {
default: le(() => [
(Q(), Re(Yt(t.tree.props.icon || t.CaretRight)))
]),
_: 1
}, 8, ["class", "onClick"])) : Pe("v-if", !0),
t.showCheckbox ? (Q(), Re(s, {
key: 1,
"model-value": t.node.checked,
indeterminate: t.node.indeterminate,
disabled: !!t.node.disabled,
onClick: Tt(() => {
}, ["stop"]),
onChange: t.handleCheckChange
}, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : Pe("v-if", !0),
t.node.loading ? (Q(), Re(o, {
key: 2,
class: xe([t.ns.be("node", "loading-icon"), t.ns.is("loading")])
}, {
default: le(() => [
oe(c)
]),
_: 1
}, 8, ["class"])) : Pe("v-if", !0),
oe(l, {
node: t.node,
"render-content": t.renderContent
}, null, 8, ["node", "render-content"])
], 6),
oe(d, null, {
default: le(() => [
!t.renderAfterExpand || t.childNodeRendered ? ht((Q(), be("div", {
key: 0,
class: xe(t.ns.be("node", "children")),
role: "group",
"aria-expanded": t.expanded
}, [
(Q(!0), be(pt, null, ir(t.node.childNodes, (h) => (Q(), Re(u, {
key: t.getNodeKey(h),
"render-content": t.renderContent,
"render-after-expand": t.renderAfterExpand,
"show-checkbox": t.showCheckbox,
node: h,
accordion: t.accordion,
props: t.props,
onNodeExpand: t.handleChildNodeExpand
}, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128))
], 10, ["aria-expanded"])), [
[Ot, t.expanded]
]) : Pe("v-if", !0)
]),
_: 1
})
], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [
[Ot, t.node.visible]
]);
}
var o8 = /* @__PURE__ */ Mt(n8, [["render", a8], ["__file", "tree-node.vue"]]);
function s8({ el$: t }, e) {
const r = Et("tree"), i = mr([]), n = mr([]);
Lt(() => {
a();
}), jh(() => {
i.value = Array.from(t.value.querySelectorAll("[role=treeitem]")), n.value = Array.from(t.value.querySelectorAll("input[type=checkbox]"));
}), ze(n, (o) => {
o.forEach((s) => {
s.setAttribute("tabindex", "-1");
});
}), xn(t, "keydown", (o) => {
const s = o.target;
if (!s.className.includes(r.b("node")))
return;
const c = o.code;
i.value = Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));
const l = i.value.indexOf(s);
let u;
if ([Gr.up, Gr.down].includes(c)) {
if (o.preventDefault(), c === Gr.up) {
u = l === -1 ? 0 : l !== 0 ? l - 1 : i.value.length - 1;
const h = u;
for (; !e.value.getNode(i.value[u].dataset.key).canFocus; ) {
if (u--, u === h) {
u = -1;
break;
}
u < 0 && (u = i.value.length - 1);
}
} else {
u = l === -1 ? 0 : l < i.value.length - 1 ? l + 1 : 0;
const h = u;
for (; !e.value.getNode(i.value[u].dataset.key).canFocus; ) {
if (u++, u === h) {
u = -1;
break;
}
u >= i.value.length && (u = 0);
}
}
u !== -1 && i.value[u].focus();
}
[Gr.left, Gr.right].includes(c) && (o.preventDefault(), s.click());
const d = s.querySelector('[type="checkbox"]');
[Gr.enter, Gr.space].includes(c) && d && (o.preventDefault(), d.click());
});
const a = () => {
var o;
i.value = Array.from(t.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)), n.value = Array.from(t.value.querySelectorAll("input[type=checkbox]"));
const s = t.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);
if (s.length) {
s[0].setAttribute("tabindex", "0");
return;
}
(o = i.value[0]) == null || o.setAttribute("tabindex", "0");
};
}
const l8 = Le({
name: "ElTree",
components: { ElTreeNode: o8 },
props: {
data: {
type: Array,
default: () => []
},
emptyText: {
type: String
},
renderAfterExpand: {
type: Boolean,
default: !0
},
nodeKey: String,
checkStrictly: Boolean,
defaultExpandAll: Boolean,
expandOnClickNode: {
type: Boolean,
default: !0
},
checkOnClickNode: Boolean,
checkDescendants: {
type: Boolean,
default: !1
},
autoExpandParent: {
type: Boolean,
default: !0
},
defaultCheckedKeys: Array,
defaultExpandedKeys: Array,
currentNodeKey: [String, Number],
renderContent: Function,
showCheckbox: {
type: Boolean,
default: !1
},
draggable: {
type: Boolean,
default: !1
},
allowDrag: Function,
allowDrop: Function,
props: {
type: Object,
default: () => ({
children: "children",
label: "label",
disabled: "disabled"
})
},
lazy: {
type: Boolean,
default: !1
},
highlightCurrent: Boolean,
load: Function,
filterNodeMethod: Function,
accordion: Boolean,
indent: {
type: Number,
default: 18
},
icon: {
type: cs
}
},
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(t, e) {
const { t: r } = qh(), i = Et("tree"), n = Ye(ep, null), a = we(new e8({
key: t.nodeKey,
data: t.data,
lazy: t.lazy,
props: t.props,
load: t.load,
currentNodeKey: t.currentNodeKey,
checkStrictly: t.checkStrictly,
checkDescendants: t.checkDescendants,
defaultCheckedKeys: t.defaultCheckedKeys,
defaultExpandedKeys: t.defaultExpandedKeys,
autoExpandParent: t.autoExpandParent,
defaultExpandAll: t.defaultExpandAll,
filterNodeMethod: t.filterNodeMethod
}));
a.value.initialize();
const o = we(a.value.root), s = we(null), c = we(null), l = we(null), { broadcastExpanded: u } = uA(t), { dragState: d } = i8({
props: t,
ctx: e,
el$: c,
dropIndicator$: l,
store: a
});
s8({ el$: c }, a);
const h = ee(() => {
const { childNodes: D } = o.value, I = n ? n.hasFilteredOptions !== 0 : !1;
return (!D || D.length === 0 || D.every(({ visible: F }) => !F)) && !I;
});
ze(() => t.currentNodeKey, (D) => {
a.value.setCurrentNodeKey(D);
}), ze(() => t.defaultCheckedKeys, (D) => {
a.value.setDefaultCheckedKey(D);
}), ze(() => t.defaultExpandedKeys, (D) => {
a.value.setDefaultExpandedKeys(D);
}), ze(() => t.data, (D) => {
a.value.setData(D);
}, { deep: !0 }), ze(() => t.checkStrictly, (D) => {
a.value.checkStrictly = D;
});
const f = (D) => {
if (!t.filterNodeMethod)
throw new Error("[Tree] filterNodeMethod is required when filter");
a.value.filter(D);
}, p = (D) => Eb(t.nodeKey, D.data), m = (D) => {
if (!t.nodeKey)
throw new Error("[Tree] nodeKey is required in getNodePath");
const I = a.value.getNode(D);
if (!I)
return [];
const F = [I.data];
let z = I.parent;
for (; z && z !== o.value; )
F.push(z.data), z = z.parent;
return F.reverse();
}, y = (D, I) => a.value.getCheckedNodes(D, I), g = (D) => a.value.getCheckedKeys(D), v = () => {
const D = a.value.getCurrentNode();
return D ? D.data : null;
}, x = () => {
if (!t.nodeKey)
throw new Error("[Tree] nodeKey is required in getCurrentKey");
const D = v();
return D ? D[t.nodeKey] : null;
}, w = (D, I) => {
if (!t.nodeKey)
throw new Error("[Tree] nodeKey is required in setCheckedNodes");
a.value.setCheckedNodes(D, I);
}, S = (D, I) => {
if (!t.nodeKey)
throw new Error("[Tree] nodeKey is required in setCheckedKeys");
a.value.setCheckedKeys(D, I);
}, _ = (D, I, F) => {
a.value.setChecked(D, I, F);
}, b = () => a.value.getHalfCheckedNodes(), T = () => a.value.getHalfCheckedKeys(), E = (D, I = !0) => {
if (!t.nodeKey)
throw new Error("[Tree] nodeKey is required in setCurrentNode");
xy(a, e.emit, () => {
u(D), a.value.setUserCurrentNode(D, I);
});
}, C = (D, I = !0) => {
if (!t.nodeKey)
throw new Error("[Tree] nodeKey is required in setCurrentKey");
xy(a, e.emit, () => {
u(), a.value.setCurrentNodeKey(D, I);
});
}, L = (D) => a.value.getNode(D), A = (D) => {
a.value.remove(D);
}, k = (D, I) => {
a.value.append(D, I);
}, P = (D, I) => {
a.value.insertBefore(D, I);
}, R = (D, I) => {
a.value.insertAfter(D, I);
}, M = (D, I, F) => {
u(I), e.emit("node-expand", D, I, F);
}, O = (D, I) => {
if (!t.nodeKey)
throw new Error("[Tree] nodeKey is required in updateKeyChild");
a.value.updateChildren(D, I);
};
return Dt("RootTree", {
ctx: e,
props: t,
store: a,
root: o,
currentNode: s,
instance: Ct()
}), Dt(dh, void 0), {
ns: i,
store: a,
root: o,
currentNode: s,
dragState: d,
el$: c,
dropIndicator$: l,
isEmpty: h,
filter: f,
getNodeKey: p,
getNodePath: m,
getCheckedNodes: y,
getCheckedKeys: g,
getCurrentNode: v,
getCurrentKey: x,
setCheckedNodes: w,
setCheckedKeys: S,
setChecked: _,
getHalfCheckedNodes: b,
getHalfCheckedKeys: T,
setCurrentNode: E,
setCurrentKey: C,
t: r,
getNode: L,
remove: A,
append: k,
insertBefore: P,
insertAfter: R,
handleNodeExpand: M,
updateKeyChildren: O
};
}
});
function c8(t, e, r, i, n, a) {
const o = qt("el-tree-node");
return Q(), be("div", {
ref: "el$",
class: xe([
t.ns.b(),
t.ns.is("dragging", !!t.dragState.draggingNode),
t.ns.is("drop-not-allow", !t.dragState.allowDrop),
t.ns.is("drop-inner", t.dragState.dropType === "inner"),
{ [t.ns.m("highlight-current")]: t.highlightCurrent }
]),
role: "tree"
}, [
(Q(!0), be(pt, null, ir(t.root.childNodes, (s) => (Q(), Re(o, {
key: t.getNodeKey(s),
node: s,
props: t.props,
accordion: t.accordion,
"render-after-expand": t.renderAfterExpand,
"show-checkbox": t.showCheckbox,
"render-content": t.renderContent,
onNodeExpand: t.handleNodeExpand
}, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)),
t.isEmpty ? (Q(), be("div", {
key: 0,
class: xe(t.ns.e("empty-block"))
}, [
Fe(t.$slots, "empty", {}, () => {
var s;
return [
Ee("span", {
class: xe(t.ns.e("empty-text"))
}, Ze((s = t.emptyText) != null ? s : t.t("el.tree.emptyText")), 3)
];
})
], 2)) : Pe("v-if", !0),
ht(Ee("div", {
ref: "dropIndicator$",
class: xe(t.ns.e("drop-indicator"))
}, null, 2), [
[Ot, t.dragState.showDropIndicator]
])
], 2);
}
var u8 = /* @__PURE__ */ Mt(l8, [["render", c8], ["__file", "tree.vue"]]);
const d8 = ni(u8);
function h8(t) {
let e;
const r = we(!1), i = _r({
...t,
originalPosition: "",
originalOverflow: "",
visible: !1
});
function n(h) {
i.text = h;
}
function a() {
const h = i.parent, f = d.ns;
if (!h.vLoadingAddClassList) {
let p = h.getAttribute("loading-number");
p = Number.parseInt(p) - 1, p ? h.setAttribute("loading-number", p.toString()) : (sl(h, f.bm("parent", "relative")), h.removeAttribute("loading-number")), sl(h, f.bm("parent", "hidden"));
}
o(), u.unmount();
}
function o() {
var h, f;
(f = (h = d.$el) == null ? void 0 : h.parentNode) == null || f.removeChild(d.$el);
}
function s() {
var h;
t.beforeClose && !t.beforeClose() || (r.value = !0, clearTimeout(e), e = setTimeout(c, 400), i.visible = !1, (h = t.closed) == null || h.call(t));
}
function c() {
if (!r.value)
return;
const h = i.parent;
r.value = !1, h.vLoadingAddClassList = void 0, a();
}
const l = Le({
name: "ElLoading",
setup(h, { expose: f }) {
const { ns: p, zIndex: m } = ZF("loading");
return f({
ns: p,
zIndex: m
}), () => {
const y = i.spinner || i.svg, g = an("svg", {
class: "circular",
viewBox: i.svgViewBox ? i.svgViewBox : "0 0 50 50",
...y ? { innerHTML: y } : {}
}, [
an("circle", {
class: "path",
cx: "25",
cy: "25",
r: "20",
fill: "none"
})
]), v = i.text ? an("p", { class: p.b("text") }, [i.text]) : void 0;
return an(Zn, {
name: p.b("fade"),
onAfterLeave: c
}, {
default: le(() => [
ht(oe("div", {
style: {
backgroundColor: i.background || ""
},
class: [
p.b("mask"),
i.customClass,
i.fullscreen ? "is-fullscreen" : ""
]
}, [
an("div", {
class: p.b("spinner")
}, [g, v])
]), [[Ot, i.visible]])
])
});
};
}
}), u = $T(l), d = u.mount(document.createElement("div"));
return {
...Zi(i),
setText: n,
removeElLoadingChild: o,
close: s,
handleAfterLeave: c,
vm: d,
get $el() {
return d.$el;
}
};
}
let $p;
const p8 = function(t = {}) {
if (!$r)
return;
const e = f8(t);
if (e.fullscreen && $p)
return $p;
const r = h8({
...e,
closed: () => {
var n;
(n = e.closed) == null || n.call(e), e.fullscreen && ($p = void 0);
}
});
m8(e, e.parent, r), Z2(e, e.parent, r), e.parent.vLoadingAddClassList = () => Z2(e, e.parent, r);
let i = e.parent.getAttribute("loading-number");
return i ? i = `${Number.parseInt(i) + 1}` : i = "1", e.parent.setAttribute("loading-number", i), e.parent.appendChild(r.$el), st(() => r.visible.value = e.visible), e.fullscreen && ($p = r), r;
}, f8 = (t) => {
var e, r, i, n;
let a;
return Ei(t.target) ? a = (e = document.querySelector(t.target)) != null ? e : document.body : a = t.target || document.body, {
parent: a === document.body || t.body ? document.body : a,
background: t.background || "",
svg: t.svg || "",
svgViewBox: t.svgViewBox || "",
spinner: t.spinner || !1,
text: t.text || "",
fullscreen: a === document.body && ((r = t.fullscreen) != null ? r : !0),
lock: (i = t.lock) != null ? i : !1,
customClass: t.customClass || "",
visible: (n = t.visible) != null ? n : !0,
beforeClose: t.beforeClose,
closed: t.closed,
target: a
};
}, m8 = async (t, e, r) => {
const { nextZIndex: i } = r.vm.zIndex || r.vm._.exposed.zIndex, n = {};
if (t.fullscreen)
r.originalPosition.value = cd(document.body, "position"), r.originalOverflow.value = cd(document.body, "overflow"), n.zIndex = i();
else if (t.parent === document.body) {
r.originalPosition.value = cd(document.body, "position"), await st();
for (const a of ["top", "left"]) {
const o = a === "top" ? "scrollTop" : "scrollLeft";
n[a] = `${t.target.getBoundingClientRect()[a] + document.body[o] + document.documentElement[o] - Number.parseInt(cd(document.body, `margin-${a}`), 10)}px`;
}
for (const a of ["height", "width"])
n[a] = `${t.target.getBoundingClientRect()[a]}px`;
} else
r.originalPosition.value = cd(e, "position");
for (const [a, o] of Object.entries(n))
r.$el.style[a] = o;
}, Z2 = (t, e, r) => {
const i = r.vm.ns || r.vm._.exposed.ns;
["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? sl(e, i.bm("parent", "relative")) : py(e, i.bm("parent", "relative")), t.fullscreen && t.lock ? py(e, i.bm("parent", "hidden")) : sl(e, i.bm("parent", "hidden"));
}, om = Symbol("ElLoading"), Y2 = (t, e) => {
var r, i, n, a;
const o = e.instance, s = (h) => di(e.value) ? e.value[h] : void 0, c = (h) => {
const f = Ei(h) && (o == null ? void 0 : o[h]) || h;
return f && we(f);
}, l = (h) => c(s(h) || t.getAttribute(`element-loading-${YD(h)}`)), u = (r = s("fullscreen")) != null ? r : e.modifiers.fullscreen, d = {
text: l("text"),
svg: l("svg"),
svgViewBox: l("svgViewBox"),
spinner: l("spinner"),
background: l("background"),
customClass: l("customClass"),
fullscreen: u,
target: (i = s("target")) != null ? i : u ? void 0 : t,
body: (n = s("body")) != null ? n : e.modifiers.body,
lock: (a = s("lock")) != null ? a : e.modifiers.lock
};
t[om] = {
options: d,
instance: p8(d)
};
}, g8 = (t, e) => {
for (const r of Object.keys(e))
cn(e[r]) && (e[r].value = t[r]);
}, hA = {
mounted(t, e) {
e.value && Y2(t, e);
},
updated(t, e) {
const r = t[om];
e.oldValue !== e.value && (e.value && !e.oldValue ? Y2(t, e) : e.value && e.oldValue ? di(e.value) && g8(e.value, r.options) : r == null || r.instance.close());
},
unmounted(t) {
var e;
(e = t[om]) == null || e.instance.close(), t[om] = null;
}
}, Cs = (t, e) => {
const r = t.__vccOpts || t;
for (const [i, n] of e)
r[i] = n;
return r;
}, v8 = {
name: "AnnotationPopup",
props: {
annotationEntry: {
type: Object
}
},
inject: ["$annotator", "userApiKey"],
data: function() {
return {
displayPair: {
"Feature ID": "featureId",
Tooltip: "label",
Models: "models",
Name: "name",
Resource: "resourceId"
},
editing: !1,
evidencePrefixes: ["", "DOI:", "PMID:"],
evidencePrefix: "",
evidence: [],
authenticated: !1,
newEvidence: "",
comment: "",
prevSubs: [],
showSubmissions: !0,
errorMessage: "",
creator: void 0
};
},
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";
}
},
methods: {
evidenceEntered: function(t) {
t && (this.evidence.push(this.evidencePrefix + t), this.newEvidence = "");
},
formatTime: function(t) {
const e = {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric"
};
return new Date(t).toLocaleDateString(void 0, e);
},
updatePrevSubmissions: function() {
var t;
this.$annotator && this.authenticated && this.annotationEntry.resourceId && this.annotationEntry.featureId && ((t = this.$annotator) == null || t.itemAnnotations(
this.userApiKey,
this.annotationEntry.resourceId,
this.annotationEntry.featureId
).then((e) => {
this.prevSubs = e;
}).catch((e) => {
console.log(e);
}));
},
submit: function() {
var t;
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((i) => {
if (i.includes("DOI:")) {
const n = i.replace("DOI:", "https://doi.org/");
e.push(new URL(n));
} else if (i.includes("PMID:")) {
const n = i.replace(
"PMID:",
"https://pubmed.ncbi.nlm.nih.gov/"
);
e.push(new URL(n));
} else
e.push(i);
});
const r = {
resource: this.annotationEntry.resourceId,
item: Object.assign(
{ id: this.annotationEntry.featureId },
Object.fromEntries(
Object.entries(this.annotationEntry).filter(
([i]) => ["label", "models"].includes(i)
)
)
),
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), (t = this.$annotator) == null || t.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(t) {
this.evidence.splice(t, 1);
},
resetSubmission: function() {
this.editing = !1, this.evidence = [], this.newFeature = "", this.comment = "";
}
},
watch: {
annotationEntry: {
handler: function(t, e) {
t !== e && (this.resetSubmission(), this.updatePrevSubmissions());
},
immediate: !1,
deep: !1
}
},
mounted: function() {
var t;
(t = this.$annotator) == null || t.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 = !0, this.updatePrevSubmissions()) : this.errorMessage = "";
});
}
}, $l = (t) => (Hh("data-v-9930ef40"), t = t(), Gh(), t), y8 = { class: "block" }, b8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("div", { class: "title" }, "Feature Annotations", -1)), x8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", { class: "sub-title" }, "Previous submissions:", -1)), w8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", null, "Evidence: ", -1)), _8 = ["href"], S8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", null, "Comment: ", -1)), M8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", { class: "sub-title" }, "Suggest changes:", -1)), E8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", null, "Evidence:", -1)), T8 = /* @__PURE__ */ $l(() => /* @__PURE__ */ Ee("strong", null, "Comment:", -1)), C8 = { class: "sub-title" };
function A8(t, e, r, i, n, a) {
const o = _g, s = uC, c = Oi, l = gg, u = iB, d = tB, h = aB, f = Qh, p = Lm, m = jV, y = UV, g = Jh, v = us, x = _b;
return Q(), Re(x, { class: "main" }, {
default: le(() => [
Ee("div", y8, [
oe(o, { class: "info-field" }, {
default: le(() => [
b8
]),
_: 1
}),
r.annotationEntry ? (Q(), be(pt, { key: 0 }, [
(Q(!0), be(pt, null, ir(t.displayPair, (w, S) => ht((Q(), Re(o, {
class: "dialog-text",
key: w
}, {
default: le(() => [
Ee("strong", null, Ze(S) + ": ", 1),
et(" " + Ze(r.annotationEntry[w]), 1)
]),
_: 2
}, 1024)), [
[Ot, r.annotationEntry[w]]
])), 128)),
t.prevSubs.length > 0 ? (Q(), be(pt, { key: 0 }, [
ht(Ee("div", {
class: "hide",
onClick: e[0] || (e[0] = (w) => t.showSubmissions = !1)
}, [
et(" Hide previous submissions "),
oe(c, null, {
default: le(() => [
oe(s)
]),
_: 1
})
], 512), [
[Ot, t.showSubmissions]
]),
ht(Ee("div", {
class: "hide",
onClick: e[1] || (e[1] = (w) => t.showSubmissions = !0)
}, [
et(" Show previous " + Ze(t.prevSubs.length) + " submission(s) ", 1),
oe(c, null, {
default: le(() => [
oe(l)
]),
_: 1
})
], 512), [
[Ot, !t.showSubmissions]
]),
t.showSubmissions ? (Q(), be(pt, { key: 0 }, [
oe(o, { class: "dialog-spacer" }),
oe(o, { class: "dialog-text" }, {
default: le(() => [
x8
]),
_: 1
}),
(Q(!0), be(pt, null, ir(t.prevSubs, (w, S) => (Q(), be("div", {
class: "entry",
key: S
}, [
oe(o, { class: "dialog-text" }, {
default: le(() => [
Ee("strong", null, Ze(a.formatTime(w.created)), 1),
et(" " + Ze(w.creator.name), 1)
]),
_: 2
}, 1024),
oe(o, { class: "dialog-text" }, {
default: le(() => [
w8,
(Q(!0), be(pt, null, ir(w.body.evidence, (_) => (Q(), Re(o, {
key: _,
class: "dialog-text"
}, {
default: le(() => [
Ee("a", {
href: _,
target: "_blank"
}, Ze(_), 9, _8)
]),
_: 2
}, 1024))), 128))
]),
_: 2
}, 1024),
oe(o, { class: "dialog-text" }, {
default: le(() => [
S8,
et(" " + Ze(w.body.comment), 1)
]),
_: 2
}, 1024)
]))), 128))
], 64)) : Pe("", !0)
], 64)) : Pe("", !0),
t.authenticated ? (Q(), be(pt, { key: 1 }, [
a.isEditable ? (Q(), be(pt, { key: 0 }, [
oe(o, { class: "dialog-spacer" }),
t.editing ? (Q(), be(pt, { key: 1 }, [
oe(o, { class: "dialog-text" }, {
default: le(() => [
M8
]),
_: 1
}),
a.isDeleted ? Pe("", !0) : (Q(), be(pt, { key: 0 }, [
oe(o, { class: "dialog-text" }, {
default: le(() => [
E8
]),
_: 1
}),
(Q(!0), be(pt, null, ir(t.evidence, (w, S) => (Q(), Re(o, { key: w }, {
default: le(() => [
oe(f, { span: 20 }, {
default: le(() => [
et(Ze(t.evidence[S]), 1)
]),
_: 2
}, 1024),
oe(f, { span: 4 }, {
default: le(() => [
oe(c, { class: "standard-icon" }, {
default: le(() => [
oe(p, {
onClick: (_) => a.removeEvidence(S)
}, null, 8, ["onClick"])
]),
_: 2
}, 1024)
]),
_: 2
}, 1024)
]),
_: 2
}, 1024))), 128)),
oe(o, null, {
default: le(() => [
oe(g, {
size: "small",
placeholder: "Enter",
modelValue: t.newEvidence,
"onUpdate:modelValue": e[4] || (e[4] = (w) => t.newEvidence = w),
onChange: e[5] || (e[5] = (w) => a.evidenceEntered(w))
}, {
prepend: le(() => [
oe(y, {
teleported: !1,
modelValue: t.evidencePrefix,
"onUpdate:modelValue": e[3] || (e[3] = (w) => t.evidencePrefix = w),
placeholder: "No Prefix",
class: "select-box",
"popper-class": "flatmap_dropdown"
}, {
default: le(() => [
(Q(!0), be(pt, null, ir(t.evidencePrefixes, (w) => (Q(), Re(m, {
key: w,
label: w,
value: w
}, {
default: le(() => [
oe(o, null, {
default: le(() => [
oe(f, { span: 12 }, {
default: le(() => [
et(Ze(w), 1)
]),
_: 2
}, 1024)
]),
_: 2
}, 1024)
]),
_: 2
}, 1032, ["label", "value"]))), 128))
]),
_: 1
}, 8, ["modelValue"])
]),
_: 1
}, 8, ["modelValue"])
]),
_: 1
})
], 64)),
oe(o, null, {
default: le(() => [
T8
]),
_: 1
}),
oe(o, { class: "dialog-text" }, {
default: le(() => [
oe(g, {
type: "textarea",
autosize: { minRows: 2, maxRows: 4 },
placeholder: "Enter",
modelValue: t.comment,
"onUpdate:modelValue": e[6] || (e[6] = (w) => t.comment = w)
}, null, 8, ["modelValue"])
]),
_: 1
}),
oe(o, { class: "dialog-text" }, {
default: le(() => [
oe(v, {
class: "button",
type: "primary",
plain: "",
onClick: a.submit
}, {
default: le(() => [
et(" Submit ")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
], 64)) : (Q(), Re(o, { key: 0 }, {
default: le(() => [
oe(c, { class: "standard-icon" }, {
default: le(() => [
oe(u, {
onClick: e[2] || (e[2] = (w) => t.editing = !0)
})
]),
_: 1
}),
a.isDeleted ? (Q(), Re(c, {
key: 0,
class: "standard-icon"
}, {
default: le(() => [
oe(d, { onClick: a.submit }, null, 8, ["onClick"])
]),
_: 1
})) : a.isPositionUpdated ? (Q(), Re(c, {
key: 1,
class: "standard-icon"
}, {
default: le(() => [
oe(h, { onClick: a.submit }, null, 8, ["onClick"])
]),
_: 1
})) : Pe("", !0)
]),
_: 1
})),
t.errorMessage ? (Q(), Re(o, {
key: 2,
class: "dialog-text"
}, {
default: le(() => [
Ee("strong", C8, Ze(t.errorMessage), 1)
]),
_: 1
})) : Pe("", !0)
], 64)) : Pe("", !0)
], 64)) : Pe("", !0)
], 64)) : Pe("", !0)
])
]),
_: 1
});
}
const L8 = /* @__PURE__ */ Cs(v8, [["render", A8], ["__scopeId", "data-v-9930ef40"]]), k8 = {
name: "CreateTooltipContent",
components: {
Button: us,
Col: Qh,
Container: oA,
Header: sA,
Input: Jh,
Main: _b
},
props: {
createData: {
type: Object
}
},
watch: {
"createData.shape": {
handler: function(t, e) {
this.group = t, e !== void 0 && this.$emit("cancel-create");
},
immediate: !0
}
},
computed: {
confirmText: function() {
return this.createData.editingIndex > -1 ? "Edit" : "Confirm";
}
},
data: function() {
return {
group: "default",
region: "",
showPoint: !1
};
},
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");
}
}
}, P8 = (t) => (Hh("data-v-d61c5879"), t = t(), Gh(), t), R8 = /* @__PURE__ */ P8(() => /* @__PURE__ */ Ee("span", { class: "create-text" }, " Primitives will be created in the __annotation region ", -1));
function O8(t, e, r, i, n, a) {
const o = sA, s = Qh, c = _g, l = Jh, u = us, d = _b, h = oA;
return Q(), Re(h, { class: "create-container" }, {
default: le(() => [
oe(o, {
height: "30px",
class: "header"
}, {
default: le(() => [
Ee("div", null, "Create " + Ze(r.createData.shape), 1)
]),
_: 1
}),
oe(d, { class: "slides-block" }, {
default: le(() => [
R8,
ht(oe(c, { class: "row" }, {
default: le(() => [
oe(s, {
offset: 0,
span: 8
}, {
default: le(() => [
et(" Position: ")
]),
_: 1
}),
oe(s, {
offset: 0,
span: 16
}, {
default: le(() => [
(Q(!0), be(pt, null, ir(r.createData.points, ({ value: f, i: p }) => (Q(), Re(c, {
key: p,
class: "value"
}, {
default: le(() => [
et(Ze(p), 1)
]),
_: 2
}, 1024))), 128))
]),
_: 1
})
]),
_: 1
}, 512), [
[Ot, t.showPoint]
]),
oe(c, { class: "row" }, {
default: le(() => [
oe(s, {
offset: 0,
span: 8
}, {
default: le(() => [
et(" Region: ")
]),
_: 1
}),
oe(s, {
offset: 0,
span: 16
}, {
default: le(() => [
oe(l, {
modelValue: t.region,
"onUpdate:modelValue": e[0] || (e[0] = (f) => t.region = f),
placeholder: "__annotation",
size: "small"
}, null, 8, ["modelValue"])
]),
_: 1
})
]),
_: 1
}),
oe(c, { class: "row" }, {
default: le(() => [
oe(s, {
offset: 0,
span: 8
}, {
default: le(() => [
et(" Group: ")
]),
_: 1
}),
oe(s, {
offset: 0,
span: 16
}, {
default: le(() => [
oe(l, {
modelValue: t.group,
"onUpdate:modelValue": e[1] || (e[1] = (f) => t.group = f),
placeholder: r.createData.shape,
size: "small"
}, null, 8, ["modelValue", "placeholder"])
]),
_: 1
})
]),
_: 1
}),
oe(c, null, {
default: le(() => [
oe(s, {
offset: 0,
span: 12
}, {
default: le(() => [
oe(u, {
type: "primary",
plain: "",
onClick: a.confirm
}, {
default: le(() => [
et(Ze(a.confirmText), 1)
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
}),
oe(s, {
offset: 0,
span: 12
}, {
default: le(() => [
oe(u, {
type: "primary",
plain: "",
onClick: a.cancel
}, {
default: le(() => [
et(" Cancel ")
]),
_: 1
}, 8, ["onClick"])
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})
]),
_: 1
});
}
const D8 = /* @__PURE__ */ Cs(k8, [["render", O8], ["__scopeId", "data-v-d61c5879"]]);
function Zr(t) {
"@babel/helpers - typeof";
return Zr = 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;
}, Zr(t);
}
function Tb(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
}
function I8(t, e) {
for (var r = 0; r < e.length; r++) {
var i = e[r];
i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(t, i.key, i);
}
}
function Cb(t, e, r) {
return e && I8(t.prototype, e), Object.defineProperty(t, "prototype", {
writable: !1
}), t;
}
function pA(t, e, r) {
return e in t ? Object.defineProperty(t, e, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = r, t;
}
function Fn(t, e) {
return N8(t) || B8(t, e) || fA(t, e) || F8();
}
function N8(t) {
if (Array.isArray(t)) return t;
}
function B8(t, e) {
var r = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
if (r != null) {
var i = [], n = !0, a = !1, o, s;
try {
for (r = r.call(t); !(n = (o = r.next()).done) && (i.push(o.value), !(e && i.length === e)); n = !0)
;
} catch (c) {
a = !0, s = c;
} finally {
try {
!n && r.return != null && r.return();
} finally {
if (a) throw s;
}
}
return i;
}
}
function fA(t, e) {
if (t) {
if (typeof t == "string") return K2(t, e);
var r = Object.prototype.toString.call(t).slice(8, -1);
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return K2(t, e);
}
}
function K2(t, e) {
(e == null || e > t.length) && (e = t.length);
for (var r = 0, i = new Array(e); r < e; r++) i[r] = t[r];
return i;
}
function F8() {
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 mA(t, e) {
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
if (!r) {
if (Array.isArray(t) || (r = fA(t)) || e) {
r && (t = r);
var i = 0, n = function() {
};
return {
s: n,
n: function() {
return i >= t.length ? {
done: !0
} : {
done: !1,
value: t[i++]
};
},
e: function(c) {
throw c;
},
f: n
};
}
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 a = !0, o = !1, s;
return {
s: function() {
r = r.call(t);
},
n: function() {
var c = r.next();
return a = c.done, c;
},
e: function(c) {
o = !0, s = c;
},
f: function() {
try {
!a && r.return != null && r.return();
} finally {
if (o) throw s;
}
}
};
}
var Hr = typeof window > "u" ? null : window, J2 = Hr ? Hr.navigator : null;
Hr && Hr.document;
var z8 = Zr(""), gA = Zr({}), $8 = Zr(function() {
}), V8 = typeof HTMLElement > "u" ? "undefined" : Zr(HTMLElement), tp = function(t) {
return t && t.instanceString && xr(t.instanceString) ? t.instanceString() : null;
}, dt = function(t) {
return t != null && Zr(t) == z8;
}, xr = function(t) {
return t != null && Zr(t) === $8;
}, ar = function(t) {
return !on(t) && (Array.isArray ? Array.isArray(t) : t != null && t instanceof Array);
}, Gt = function(t) {
return t != null && Zr(t) === gA && !ar(t) && t.constructor === Object;
}, U8 = function(t) {
return t != null && Zr(t) === gA;
}, Xe = function(t) {
return t != null && Zr(t) === Zr(1) && !isNaN(t);
}, j8 = function(t) {
return Xe(t) && Math.floor(t) === t;
}, Rm = function(t) {
if (V8 !== "undefined")
return t != null && t instanceof HTMLElement;
}, on = function(t) {
return rp(t) || vA(t);
}, rp = function(t) {
return tp(t) === "collection" && t._private.single;
}, vA = function(t) {
return tp(t) === "collection" && !t._private.single;
}, Ab = function(t) {
return tp(t) === "core";
}, yA = function(t) {
return tp(t) === "stylesheet";
}, H8 = function(t) {
return tp(t) === "event";
}, ds = function(t) {
return t == null ? !0 : !!(t === "" || t.match(/^\s+$/));
}, G8 = function(t) {
return typeof HTMLElement > "u" ? !1 : t instanceof HTMLElement;
}, W8 = function(t) {
return Gt(t) && Xe(t.x1) && Xe(t.x2) && Xe(t.y1) && Xe(t.y2);
}, q8 = function(t) {
return U8(t) && xr(t.then);
}, X8 = function() {
return J2 && J2.userAgent.match(/msie|trident|edge/i);
}, fh = function(t, e) {
e || (e = function() {
if (arguments.length === 1)
return arguments[0];
if (arguments.length === 0)
return "undefined";
for (var i = [], n = 0; n < arguments.length; n++)
i.push(arguments[n]);
return i.join("$");
});
var r = function i() {
var n = this, a = arguments, o, s = e.apply(n, a), c = i.cache;
return (o = c[s]) || (o = c[s] = t.apply(n, a)), o;
};
return r.cache = {}, r;
}, Lb = fh(function(t) {
return t.replace(/([A-Z])/g, function(e) {
return "-" + e.toLowerCase();
});
}), Sg = fh(function(t) {
return t.replace(/(-\w)/g, function(e) {
return e[1].toUpperCase();
});
}), bA = fh(function(t, e) {
return t + e[0].toUpperCase() + e.substring(1);
}, function(t, e) {
return t + "$" + e;
}), Q2 = function(t) {
return ds(t) ? t : t.charAt(0).toUpperCase() + t.substring(1);
}, qr = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))", Z8 = "rgb[a]?\\((" + qr + "[%]?)\\s*,\\s*(" + qr + "[%]?)\\s*,\\s*(" + qr + "[%]?)(?:\\s*,\\s*(" + qr + "))?\\)", Y8 = "rgb[a]?\\((?:" + qr + "[%]?)\\s*,\\s*(?:" + qr + "[%]?)\\s*,\\s*(?:" + qr + "[%]?)(?:\\s*,\\s*(?:" + qr + "))?\\)", K8 = "hsl[a]?\\((" + qr + ")\\s*,\\s*(" + qr + "[%])\\s*,\\s*(" + qr + "[%])(?:\\s*,\\s*(" + qr + "))?\\)", J8 = "hsl[a]?\\((?:" + qr + ")\\s*,\\s*(?:" + qr + "[%])\\s*,\\s*(?:" + qr + "[%])(?:\\s*,\\s*(?:" + qr + "))?\\)", Q8 = "\\#[0-9a-fA-F]{3}", eU = "\\#[0-9a-fA-F]{6}", xA = function(t, e) {
return t < e ? -1 : t > e ? 1 : 0;
}, tU = function(t, e) {
return -1 * xA(t, e);
}, bt = Object.assign != null ? Object.assign.bind(Object) : function(t) {
for (var e = arguments, r = 1; r < e.length; r++) {
var i = e[r];
if (i != null)
for (var n = Object.keys(i), a = 0; a < n.length; a++) {
var o = n[a];
t[o] = i[o];
}
}
return t;
}, rU = function(t) {
if (!(!(t.length === 4 || t.length === 7) || t[0] !== "#")) {
var e = t.length === 4, r, i, n, a = 16;
return e ? (r = parseInt(t[1] + t[1], a), i = parseInt(t[2] + t[2], a), n = parseInt(t[3] + t[3], a)) : (r = parseInt(t[1] + t[2], a), i = parseInt(t[3] + t[4], a), n = parseInt(t[5] + t[6], a)), [r, i, n];
}
}, iU = function(t) {
var e, r, i, n, a, o, s, c;
function l(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 u = new RegExp("^" + K8 + "$").exec(t);
if (u) {
if (r = parseInt(u[1]), r < 0 ? r = (360 - -1 * r % 360) % 360 : r > 360 && (r = r % 360), r /= 360, i = parseFloat(u[2]), i < 0 || i > 100 || (i = i / 100, n = parseFloat(u[3]), n < 0 || n > 100) || (n = n / 100, a = u[4], a !== void 0 && (a = parseFloat(a), a < 0 || a > 1)))
return;
if (i === 0)
o = s = c = Math.round(n * 255);
else {
var d = n < 0.5 ? n * (1 + i) : n + i - n * i, h = 2 * n - d;
o = Math.round(255 * l(h, d, r + 1 / 3)), s = Math.round(255 * l(h, d, r)), c = Math.round(255 * l(h, d, r - 1 / 3));
}
e = [o, s, c, a];
}
return e;
}, nU = function(t) {
var e, r = new RegExp("^" + Z8 + "$").exec(t);
if (r) {
e = [];
for (var i = [], n = 1; n <= 3; n++) {
var a = r[n];
if (a[a.length - 1] === "%" && (i[n] = !0), a = parseFloat(a), i[n] && (a = a / 100 * 255), a < 0 || a > 255)
return;
e.push(Math.floor(a));
}
var o = i[1] || i[2] || i[3], s = i[1] && i[2] && i[3];
if (o && !s)
return;
var c = r[4];
if (c !== void 0) {
if (c = parseFloat(c), c < 0 || c > 1)
return;
e.push(c);
}
}
return e;
}, aU = function(t) {
return sU[t.toLowerCase()];
}, oU = function(t) {
return (ar(t) ? t : null) || aU(t) || rU(t) || nU(t) || iU(t);
}, sU = {
// 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]
}, wA = function(t) {
for (var e = t.map, r = t.keys, i = r.length, n = 0; n < i; n++) {
var a = r[n];
if (Gt(a))
throw Error("Tried to set map with object key");
n < r.length - 1 ? (e[a] == null && (e[a] = {}), e = e[a]) : e[a] = t.value;
}
}, _A = function(t) {
for (var e = t.map, r = t.keys, i = r.length, n = 0; n < i; n++) {
var a = r[n];
if (Gt(a))
throw Error("Tried to get map with object key");
if (e = e[a], e == null)
return e;
}
return e;
};
function lU(t) {
var e = typeof t;
return t != null && (e == "object" || e == "function");
}
var xl = lU, Nd = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function cU(t, e) {
return e = { exports: {} }, t(e, e.exports), e.exports;
}
var uU = typeof Nd == "object" && Nd && Nd.Object === Object && Nd, dU = uU, hU = typeof self == "object" && self && self.Object === Object && self, pU = dU || hU || Function("return this")(), Mg = pU, fU = function() {
return Mg.Date.now();
}, $v = fU, mU = /\s/;
function gU(t) {
for (var e = t.length; e-- && mU.test(t.charAt(e)); )
;
return e;
}
var vU = gU, yU = /^\s+/;
function bU(t) {
return t && t.slice(0, vU(t) + 1).replace(yU, "");
}
var xU = bU, wU = Mg.Symbol, ru = wU, SA = Object.prototype, _U = SA.hasOwnProperty, SU = SA.toString, hd = ru ? ru.toStringTag : void 0;
function MU(t) {
var e = _U.call(t, hd), r = t[hd];
try {
t[hd] = void 0;
var i = !0;
} catch {
}
var n = SU.call(t);
return i && (e ? t[hd] = r : delete t[hd]), n;
}
var EU = MU, TU = Object.prototype, CU = TU.toString;
function AU(t) {
return CU.call(t);
}
var LU = AU, kU = "[object Null]", PU = "[object Undefined]", e_ = ru ? ru.toStringTag : void 0;
function RU(t) {
return t == null ? t === void 0 ? PU : kU : e_ && e_ in Object(t) ? EU(t) : LU(t);
}
var MA = RU;
function OU(t) {
return t != null && typeof t == "object";
}
var DU = OU, IU = "[object Symbol]";
function NU(t) {
return typeof t == "symbol" || DU(t) && MA(t) == IU;
}
var ip = NU, t_ = NaN, BU = /^[-+]0x[0-9a-f]+$/i, FU = /^0b[01]+$/i, zU = /^0o[0-7]+$/i, $U = parseInt;
function VU(t) {
if (typeof t == "number")
return t;
if (ip(t))
return t_;
if (xl(t)) {
var e = typeof t.valueOf == "function" ? t.valueOf() : t;
t = xl(e) ? e + "" : e;
}
if (typeof t != "string")
return t === 0 ? t : +t;
t = xU(t);
var r = FU.test(t);
return r || zU.test(t) ? $U(t.slice(2), r ? 2 : 8) : BU.test(t) ? t_ : +t;
}
var r_ = VU, UU = "Expected a function", jU = Math.max, HU = Math.min;
function GU(t, e, r) {
var i, n, a, o, s, c, l = 0, u = !1, d = !1, h = !0;
if (typeof t != "function")
throw new TypeError(UU);
e = r_(e) || 0, xl(r) && (u = !!r.leading, d = "maxWait" in r, a = d ? jU(r_(r.maxWait) || 0, e) : a, h = "trailing" in r ? !!r.trailing : h);
function f(_) {
var b = i, T = n;
return i = n = void 0, l = _, o = t.apply(T, b), o;
}
function p(_) {
return l = _, s = setTimeout(g, e), u ? f(_) : o;
}
function m(_) {
var b = _ - c, T = _ - l, E = e - b;
return d ? HU(E, a - T) : E;
}
function y(_) {
var b = _ - c, T = _ - l;
return c === void 0 || b >= e || b < 0 || d && T >= a;
}
function g() {
var _ = $v();
if (y(_))
return v(_);
s = setTimeout(g, m(_));
}
function v(_) {
return s = void 0, h && i ? f(_) : (i = n = void 0, o);
}
function x() {
s !== void 0 && clearTimeout(s), l = 0, i = c = n = s = void 0;
}
function w() {
return s === void 0 ? o : v($v());
}
function S() {
var _ = $v(), b = y(_);
if (i = arguments, n = this, c = _, b) {
if (s === void 0)
return p(c);
if (d)
return clearTimeout(s), s = setTimeout(g, e), f(c);
}
return s === void 0 && (s = setTimeout(g, e)), o;
}
return S.cancel = x, S.flush = w, S;
}
var Eg = GU, Vv = Hr ? Hr.performance : null, EA = Vv && Vv.now ? function() {
return Vv.now();
} : function() {
return Date.now();
}, WU = function() {
if (Hr) {
if (Hr.requestAnimationFrame)
return function(t) {
Hr.requestAnimationFrame(t);
};
if (Hr.mozRequestAnimationFrame)
return function(t) {
Hr.mozRequestAnimationFrame(t);
};
if (Hr.webkitRequestAnimationFrame)
return function(t) {
Hr.webkitRequestAnimationFrame(t);
};
if (Hr.msRequestAnimationFrame)
return function(t) {
Hr.msRequestAnimationFrame(t);
};
}
return function(t) {
t && setTimeout(function() {
t(EA());
}, 1e3 / 60);
};
}(), Om = function(t) {
return WU(t);
}, ro = EA, Rc = 9261, TA = 65599, Bd = 5381, CA = function(t) {
for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Rc, r = e, i; i = t.next(), !i.done; )
r = r * TA + i.value | 0;
return r;
}, mh = function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Rc;
return e * TA + t | 0;
}, gh = function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bd;
return (e << 5) + e + t | 0;
}, qU = function(t, e) {
return t * 2097152 + e;
}, Co = function(t) {
return t[0] * 2097152 + t[1];
}, Vp = function(t, e) {
return [mh(t[0], e[0]), gh(t[1], e[1])];
}, XU = function(t, e) {
var r = {
value: 0,
done: !1
}, i = 0, n = t.length, a = {
next: function() {
return i < n ? r.value = t[i++] : r.done = !0, r;
}
};
return CA(a, e);
}, wl = function(t, e) {
var r = {
value: 0,
done: !1
}, i = 0, n = t.length, a = {
next: function() {
return i < n ? r.value = t.charCodeAt(i++) : r.done = !0, r;
}
};
return CA(a, e);
}, AA = function() {
return ZU(arguments);
}, ZU = function(t) {
for (var e, r = 0; r < t.length; r++) {
var i = t[r];
r === 0 ? e = wl(i) : e = wl(i, e);
}
return e;
}, YU = !0, KU = console.warn != null, JU = console.trace != null, kb = Number.MAX_SAFE_INTEGER || 9007199254740991, LA = function() {
return !0;
}, Dm = function() {
return !1;
}, i_ = function() {
return 0;
}, Pb = function() {
}, Tr = function(t) {
throw new Error(t);
}, QU = function(t) {
return YU;
}, Zt = function(t) {
QU() && (KU ? console.warn(t) : (console.log(t), JU && console.trace()));
}, ej = function(t) {
return bt({}, t);
}, la = function(t) {
return t == null ? t : ar(t) ? t.slice() : Gt(t) ? ej(t) : t;
}, tj = function(t) {
return t.slice();
}, kA = function(t, e) {
for (
// loop :)
e = t = "";
// b - result , a - numeric letiable
t++ < 36;
//
e += t * 51 & 52 ? (
// return a random number or 4
(t ^ 15 ? (
// generate a random number from 0 to 15
8 ^ Math.random() * (t ^ 20 ? 16 : 4)
) : 4).toString(16)
) : "-"
)
;
return e;
}, rj = {}, PA = function() {
return rj;
}, yi = function(t) {
var e = Object.keys(t);
return function(r) {
for (var i = {}, n = 0; n < e.length; n++) {
var a = e[n], o = r == null ? void 0 : r[a];
i[a] = o === void 0 ? t[a] : o;
}
return i;
};
}, hs = function(t, e, r) {
for (var i = t.length - 1; i >= 0; i--)
t[i] === e && t.splice(i, 1);
}, Rb = function(t) {
t.splice(0, t.length);
}, ij = function(t, e) {
for (var r = 0; r < e.length; r++) {
var i = e[r];
t.push(i);
}
}, $n = function(t, e, r) {
return r && (e = bA(r, e)), t[e];
}, Xo = function(t, e, r, i) {
r && (e = bA(r, e)), t[e] = i;
}, nj = /* @__PURE__ */ function() {
function t() {
Tb(this, t), this._obj = {};
}
return Cb(t, [{
key: "set",
value: function(e, r) {
return this._obj[e] = r, this;
}
}, {
key: "delete",
value: function(e) {
return this._obj[e] = void 0, this;
}
}, {
key: "clear",
value: function() {
this._obj = {};
}
}, {
key: "has",
value: function(e) {
return this._obj[e] !== void 0;
}
}, {
key: "get",
value: function(e) {
return this._obj[e];
}
}]), t;
}(), ca = typeof Map < "u" ? Map : nj, aj = "undefined", oj = /* @__PURE__ */ function() {
function t(e) {
if (Tb(this, t), 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 i = 0; i < r.length; i++)
this.add(r[i]);
}
}
return Cb(t, [{
key: "instanceString",
value: function() {
return "set";
}
}, {
key: "add",
value: function(e) {
var r = this._obj;
r[e] !== 1 && (r[e] = 1, this.size++);
}
}, {
key: "delete",
value: function(e) {
var r = this._obj;
r[e] === 1 && (r[e] = 0, this.size--);
}
}, {
key: "clear",
value: function() {
this._obj = /* @__PURE__ */ Object.create(null);
}
}, {
key: "has",
value: function(e) {
return this._obj[e] === 1;
}
}, {
key: "toArray",
value: function() {
var e = this;
return Object.keys(this._obj).filter(function(r) {
return e.has(r);
});
}
}, {
key: "forEach",
value: function(e, r) {
return this.toArray().forEach(e, r);
}
}]), t;
}(), Nu = (typeof Set > "u" ? "undefined" : Zr(Set)) !== aj ? Set : oj, Tg = function(t, e) {
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0;
if (t === void 0 || e === void 0 || !Ab(t)) {
Tr("An element must have a core reference and parameters set");
return;
}
var i = e.group;
if (i == null && (e.data && e.data.source != null && e.data.target != null ? i = "edges" : i = "nodes"), i !== "nodes" && i !== "edges") {
Tr("An element must be of type `nodes` or `edges`; you specified `" + i + "`");
return;
}
this.length = 1, this[0] = this;
var n = this._private = {
cy: t,
single: !0,
// indicates this is an element
data: e.data || {},
// data object
position: e.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: !1,
// whether the compound dimensions need to be recalculated the next time dimensions are read
listeners: [],
// array of bound listeners
group: i,
// 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: !0,
// whether it's inside the vis; true if removed (set true here since we call restore)
selected: !!e.selected,
// whether it's selected
selectable: e.selectable === void 0 ? !0 : !!e.selectable,
// whether it's selectable
locked: !!e.locked,
// whether the element is locked (cannot be moved)
grabbed: !1,
// whether the element is grabbed by the mouse; renderer sets this privately
grabbable: e.grabbable === void 0 ? !0 : !!e.grabbable,
// whether the element can be grabbed
pannable: e.pannable === void 0 ? i === "edges" : !!e.pannable,
// whether the element has passthrough panning enabled
active: !1,
// whether the element is active from user interaction
classes: new Nu(),
// map ( className => true )
animation: {
// object for currently-running animations
current: [],
queue: []
},
rscratch: {},
// object in which the renderer can store information
scratch: e.scratch || {},
// scratch objects
edges: [],
// array of connected edges
children: [],
// array of children
parent: e.parent && e.parent.isNode() ? e.parent : null,
// parent ref
traversalCache: {},
// cache of output of traversal functions
backgrounding: !1,
// 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 (n.position.x == null && (n.position.x = 0), n.position.y == null && (n.position.y = 0), e.renderedPosition) {
var a = e.renderedPosition, o = t.pan(), s = t.zoom();
n.position = {
x: (a.x - o.x) / s,
y: (a.y - o.y) / s
};
}
var c = [];
ar(e.classes) ? c = e.classes : dt(e.classes) && (c = e.classes.split(/\s+/));
for (var l = 0, u = c.length; l < u; l++) {
var d = c[l];
!d || d === "" || n.classes.add(d);
}
this.createEmitter();
var h = e.style || e.css;
h && (Zt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."), this.style(h)), (r === void 0 || r) && this.restore();
}, n_ = function(t) {
return t = {
bfs: t.bfs || !t.dfs,
dfs: t.dfs || !t.bfs
}, function(e, r, i) {
var n;
Gt(e) && !on(e) && (n = e, e = n.roots || n.root, r = n.visit, i = n.directed), i = arguments.length === 2 && !xr(r) ? r : i, r = xr(r) ? r : function() {
};
for (var a = this._private.cy, o = e = dt(e) ? this.filter(e) : e, s = [], c = [], l = {}, u = {}, d = {}, h = 0, f, p = this.byGroup(), m = p.nodes, y = p.edges, g = 0; g < o.length; g++) {
var v = o[g], x = v.id();
v.isNode() && (s.unshift(v), t.bfs && (d[x] = !0, c.push(v)), u[x] = 0);
}
for (var w = function() {
var C = t.bfs ? s.shift() : s.pop(), L = C.id();
if (t.dfs) {
if (d[L])
return "continue";
d[L] = !0, c.push(C);
}
var A = u[L], k = l[L], P = k != null ? k.source() : null, R = k != null ? k.target() : null, M = k == null ? void 0 : C.same(P) ? R[0] : P[0], O = void 0;
if (O = r(C, k, M, h++, A), O === !0)
return f = C, "break";
if (O === !1)
return "break";
for (var D = C.connectedEdges().filter(function(Z) {
return (!i || Z.source().same(C)) && y.has(Z);
}), I = 0; I < D.length; I++) {
var F = D[I], z = F.connectedNodes().filter(function(Z) {
return !Z.same(C) && m.has(Z);
}), U = z.id();
z.length !== 0 && !d[U] && (z = z[0], s.push(z), t.bfs && (d[U] = !0, c.push(z)), l[U] = F, u[U] = u[L] + 1);
}
}; s.length !== 0; ) {
var S = w();
if (S !== "continue" && S === "break")
break;
}
for (var _ = a.collection(), b = 0; b < c.length; b++) {
var T = c[b], E = l[T.id()];
E != null && _.push(E), _.push(T);
}
return {
path: a.collection(_),
found: a.collection(f)
};
};
}, vh = {
breadthFirstSearch: n_({
bfs: !0
}),
depthFirstSearch: n_({
dfs: !0
})
};
vh.bfs = vh.breadthFirstSearch;
vh.dfs = vh.depthFirstSearch;
var sj = cU(function(t, e) {
(function() {
var r, i, n, a, o, s, c, l, u, d, h, f, p, m, y;
n = Math.floor, d = Math.min, i = function(g, v) {
return g < v ? -1 : g > v ? 1 : 0;
}, u = function(g, v, x, w, S) {
var _;
if (x == null && (x = 0), S == null && (S = i), x < 0)
throw new Error("lo must be non-negative");
for (w == null && (w = g.length); x < w; )
_ = n((x + w) / 2), S(v, g[_]) < 0 ? w = _ : x = _ + 1;
return [].splice.apply(g, [x, x - x].concat(v)), v;
}, s = function(g, v, x) {
return x == null && (x = i), g.push(v), m(g, 0, g.length - 1, x);
}, o = function(g, v) {
var x, w;
return v == null && (v = i), x = g.pop(), g.length ? (w = g[0], g[0] = x, y(g, 0, v)) : w = x, w;
}, l = function(g, v, x) {
var w;
return x == null && (x = i), w = g[0], g[0] = v, y(g, 0, x), w;
}, c = function(g, v, x) {
var w;
return x == null && (x = i), g.length && x(g[0], v) < 0 && (w = [g[0], v], v = w[0], g[0] = w[1], y(g, 0, x)), v;
}, a = function(g, v) {
var x, w, S, _, b, T;
for (v == null && (v = i), _ = (function() {
T = [];
for (var E = 0, C = n(g.length / 2); 0 <= C ? E < C : E > C; 0 <= C ? E++ : E--)
T.push(E);
return T;
}).apply(this).reverse(), b = [], w = 0, S = _.length; w < S; w++)
x = _[w], b.push(y(g, x, v));
return b;
}, p = function(g, v, x) {
var w;
if (x == null && (x = i), w = g.indexOf(v), w !== -1)
return m(g, 0, w, x), y(g, w, x);
}, h = function(g, v, x) {
var w, S, _, b, T;
if (x == null && (x = i), S = g.slice(0, v), !S.length)
return S;
for (a(S, x), T = g.slice(v), _ = 0, b = T.length; _ < b; _++)
w = T[_], c(S, w, x);
return S.sort(x).reverse();
}, f = function(g, v, x) {
var w, S, _, b, T, E, C, L, A;
if (x == null && (x = i), v * 10 <= g.length) {
if (_ = g.slice(0, v).sort(x), !_.length)
return _;
for (S = _[_.length - 1], C = g.slice(v), b = 0, E = C.length; b < E; b++)
w = C[b], x(w, S) < 0 && (u(_, w, 0, null, x), _.pop(), S = _[_.length - 1]);
return _;
}
for (a(g, x), A = [], T = 0, L = d(v, g.length); 0 <= L ? T < L : T > L; 0 <= L ? ++T : --T)
A.push(o(g, x));
return A;
}, m = function(g, v, x, w) {
var S, _, b;
for (w == null && (w = i), S = g[x]; x > v; ) {
if (b = x - 1 >> 1, _ = g[b], w(S, _) < 0) {
g[x] = _, x = b;
continue;
}
break;
}
return g[x] = S;
}, y = function(g, v, x) {
var w, S, _, b, T;
for (x == null && (x = i), S = g.length, T = v, _ = g[v], w = 2 * v + 1; w < S; )
b = w + 1, b < S && !(x(g[w], g[b]) < 0) && (w = b), g[v] = g[w], v = w, w = 2 * v + 1;
return g[v] = _, m(g, T, v, x);
}, r = function() {
g.push = s, g.pop = o, g.replace = l, g.pushpop = c, g.heapify = a, g.updateItem = p, g.nlargest = h, g.nsmallest = f;
function g(v) {
this.cmp = v ?? i, this.nodes = [];
}
return g.prototype.push = function(v) {
return s(this.nodes, v, this.cmp);
}, g.prototype.pop = function() {
return o(this.nodes, this.cmp);
}, g.prototype.peek = function() {
return this.nodes[0];
}, g.prototype.contains = function(v) {
return this.nodes.indexOf(v) !== -1;
}, g.prototype.replace = function(v) {
return l(this.nodes, v, this.cmp);
}, g.prototype.pushpop = function(v) {
return c(this.nodes, v, this.cmp);
}, g.prototype.heapify = function() {
return a(this.nodes, this.cmp);
}, g.prototype.updateItem = function(v) {
return p(this.nodes, v, 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 v;
return v = new g(), v.nodes = this.nodes.slice(0), v;
}, 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, v) {
return t.exports = v();
}(this, function() {
return r;
});
}).call(Nd);
}), np = sj, lj = yi({
root: null,
weight: function(t) {
return 1;
},
directed: !1
}), cj = {
dijkstra: function(t) {
if (!Gt(t)) {
var e = arguments;
t = {
root: e[0],
weight: e[1],
directed: e[2]
};
}
var r = lj(t), i = r.root, n = r.weight, a = r.directed, o = this, s = n, c = dt(i) ? this.filter(i)[0] : i[0], l = {}, u = {}, d = {}, h = this.byGroup(), f = h.nodes, p = h.edges;
p.unmergeBy(function(P) {
return P.isLoop();
});
for (var m = function(P) {
return l[P.id()];
}, y = function(P, R) {
l[P.id()] = R, g.updateItem(P);
}, g = new np(function(P, R) {
return m(P) - m(R);
}), v = 0; v < f.length; v++) {
var x = f[v];
l[x.id()] = x.same(c) ? 0 : 1 / 0, g.push(x);
}
for (var w = function(P, R) {
for (var M = (a ? P.edgesTo(R) : P.edgesWith(R)).intersect(p), O = 1 / 0, D, I = 0; I < M.length; I++) {
var F = M[I], z = s(F);
(z < O || !D) && (O = z, D = F);
}
return {
edge: D,
dist: O
};
}; g.size() > 0; ) {
var S = g.pop(), _ = m(S), b = S.id();
if (d[b] = _, _ !== 1 / 0)
for (var T = S.neighborhood().intersect(f), E = 0; E < T.length; E++) {
var C = T[E], L = C.id(), A = w(S, C), k = _ + A.dist;
k < m(C) && (y(C, k), u[L] = {
node: S,
edge: A.edge
});
}
}
return {
distanceTo: function(P) {
var R = dt(P) ? f.filter(P)[0] : P[0];
return d[R.id()];
},
pathTo: function(P) {
var R = dt(P) ? f.filter(P)[0] : P[0], M = [], O = R, D = O.id();
if (R.length > 0)
for (M.unshift(R); u[D]; ) {
var I = u[D];
M.unshift(I.edge), M.unshift(I.node), O = I.node, D = O.id();
}
return o.spawn(M);
}
};
}
}, uj = {
// kruskal's algorithm (finds min spanning tree, assuming undirected graph)
// implemented from pseudocode from wikipedia
kruskal: function(t) {
t = t || function(v) {
return 1;
};
for (var e = this.byGroup(), r = e.nodes, i = e.edges, n = r.length, a = new Array(n), o = r, s = function(v) {
for (var x = 0; x < a.length; x++) {
var w = a[x];
if (w.has(v))
return x;
}
}, c = 0; c < n; c++)
a[c] = this.spawn(r[c]);
for (var l = i.sort(function(v, x) {
return t(v) - t(x);
}), u = 0; u < l.length; u++) {
var d = l[u], h = d.source()[0], f = d.target()[0], p = s(h), m = s(f), y = a[p], g = a[m];
p !== m && (o.merge(d), y.merge(g), a.splice(m, 1));
}
return o;
}
}, dj = yi({
root: null,
goal: null,
weight: function(t) {
return 1;
},
heuristic: function(t) {
return 0;
},
directed: !1
}), hj = {
// Implemented from pseudocode from wikipedia
aStar: function(t) {
var e = this.cy(), r = dj(t), i = r.root, n = r.goal, a = r.heuristic, o = r.directed, s = r.weight;
i = e.collection(i)[0], n = e.collection(n)[0];
var c = i.id(), l = n.id(), u = {}, d = {}, h = {}, f = new np(function(I, F) {
return d[I.id()] - d[F.id()];
}), p = new Nu(), m = {}, y = {}, g = function(I, F) {
f.push(I), p.add(F);
}, v, x, w = function() {
v = f.pop(), x = v.id(), p.delete(x);
}, S = function(I) {
return p.has(I);
};
g(i, c), u[c] = 0, d[c] = a(i);
for (var _ = 0; f.size() > 0; ) {
if (w(), _++, x === l) {
for (var b = [], T = n, E = l, C = y[E]; b.unshift(T), C != null && b.unshift(C), T = m[E], T != null; )
E = T.id(), C = y[E];
return {
found: !0,
distance: u[x],
path: this.spawn(b),
steps: _
};
}
h[x] = !0;
for (var L = v._private.edges, A = 0; A < L.length; A++) {
var k = L[A];
if (this.hasElementWithId(k.id()) && !(o && k.data("source") !== x)) {
var P = k.source(), R = k.target(), M = P.id() !== x ? P : R, O = M.id();
if (this.hasElementWithId(O) && !h[O]) {
var D = u[x] + s(k);
if (!S(O)) {
u[O] = D, d[O] = D + a(M), g(M, O), m[O] = v, y[O] = k;
continue;
}
D < u[O] && (u[O] = D, d[O] = D + a(M), m[O] = v, y[O] = k);
}
}
}
}
return {
found: !1,
distance: void 0,
path: void 0,
steps: _
};
}
}, pj = yi({
weight: function(t) {
return 1;
},
directed: !1
}), fj = {
// Implemented from pseudocode from wikipedia
floydWarshall: function(t) {
for (var e = this.cy(), r = pj(t), i = r.weight, n = r.directed, a = i, o = this.byGroup(), s = o.nodes, c = o.edges, l = s.length, u = l * l, d = function(z) {
return s.indexOf(z);
}, h = function(z) {
return s[z];
}, f = new Array(u), p = 0; p < u; p++) {
var m = p % l, y = (p - m) / l;
y === m ? f[p] = 0 : f[p] = 1 / 0;
}
for (var g = new Array(u), v = new Array(u), x = 0; x < c.length; x++) {
var w = c[x], S = w.source()[0], _ = w.target()[0];
if (S !== _) {
var b = d(S), T = d(_), E = b * l + T, C = a(w);
if (f[E] > C && (f[E] = C, g[E] = T, v[E] = w), !n) {
var L = T * l + b;
!n && f[L] > C && (f[L] = C, g[L] = b, v[L] = w);
}
}
}
for (var A = 0; A < l; A++)
for (var k = 0; k < l; k++)
for (var P = k * l + A, R = 0; R < l; R++) {
var M = k * l + R, O = A * l + R;
f[P] + f[O] < f[M] && (f[M] = f[P] + f[O], g[M] = g[P]);
}
var D = function(z) {
return (dt(z) ? e.filter(z) : z)[0];
}, I = function(z) {
return d(D(z));
}, F = {
distance: function(z, U) {
var Z = I(z), re = I(U);
return f[Z * l + re];
},
path: function(z, U) {
var Z = I(z), re = I(U), K = h(Z);
if (Z === re)
return K.collection();
if (g[Z * l + re] == null)
return e.collection();
var V = e.collection(), H = Z, G;
for (V.merge(K); Z !== re; )
H = Z, Z = g[Z * l + re], G = v[H * l + Z], V.merge(G), V.merge(h(Z));
return V;
}
};
return F;
}
// floydWarshall
}, mj = yi({
weight: function(t) {
return 1;
},
directed: !1,
root: null
}), gj = {
// Implemented from pseudocode from wikipedia
bellmanFord: function(t) {
var e = this, r = mj(t), i = r.weight, n = r.directed, a = r.root, o = i, s = this, c = this.cy(), l = this.byGroup(), u = l.edges, d = l.nodes, h = d.length, f = new ca(), p = !1, m = [];
a = c.collection(a)[0], u.unmergeBy(function(ne) {
return ne.isLoop();
});
for (var y = u.length, g = function(ne) {
var j = f.get(ne.id());
return j || (j = {}, f.set(ne.id(), j)), j;
}, v = function(ne) {
return (dt(ne) ? c.$(ne) : ne)[0];
}, x = function(ne) {
return g(v(ne)).dist;
}, w = function(ne) {
for (var j = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : a, q = v(ne), ge = [], ye = q; ; ) {
if (ye == null)
return e.spawn();
var _e = g(ye), Me = _e.edge, Ce = _e.pred;
if (ge.unshift(ye[0]), ye.same(j) && ge.length > 0)
break;
Me != null && ge.unshift(Me), ye = Ce;
}
return s.spawn(ge);
}, S = 0; S < h; S++) {
var _ = d[S], b = g(_);
_.same(a) ? b.dist = 0 : b.dist = 1 / 0, b.pred = null, b.edge = null;
}
for (var T = !1, E = function(ne, j, q, ge, ye, _e) {
var Me = ge.dist + _e;
Me < ye.dist && !q.same(ge.edge) && (ye.dist = Me, ye.pred = ne, ye.edge = q, T = !0);
}, C = 1; C < h; C++) {
T = !1;
for (var L = 0; L < y; L++) {
var A = u[L], k = A.source(), P = A.target(), R = o(A), M = g(k), O = g(P);
E(k, P, A, M, O, R), n || E(P, k, A, O, M, R);
}
if (!T)
break;
}
if (T)
for (var D = [], I = 0; I < y; I++) {
var F = u[I], z = F.source(), U = F.target(), Z = o(F), re = g(z).dist, K = g(U).dist;
if (re + Z < K || !n && K + Z < re)
if (p || (Zt("Graph contains a negative weight cycle for Bellman-Ford"), p = !0), t.findNegativeWeightCycles !== !1) {
var V = [];
re + Z < K && V.push(z), !n && K + Z < re && V.push(U);
for (var H = V.length, G = 0; G < H; G++) {
var W = V[G], Y = [W];
Y.push(g(W).edge);
for (var X = g(W).pred; Y.indexOf(X) === -1; )
Y.push(X), Y.push(g(X).edge), X = g(X).pred;
Y = Y.slice(Y.indexOf(X));
for (var ie = Y[0].id(), ue = 0, $ = 2; $ < Y.length; $ += 2)
Y[$].id() < ie && (ie = Y[$].id(), ue = $);
Y = Y.slice(ue).concat(Y.slice(0, ue)), Y.push(Y[0]);
var J = Y.map(function(ne) {
return ne.id();
}).join(",");
D.indexOf(J) === -1 && (m.push(s.spawn(Y)), D.push(J));
}
} else
break;
}
return {
distanceTo: x,
pathTo: w,
hasNegativeWeightCycle: p,
negativeWeightCycles: m
};
}
// bellmanFord
}, vj = Math.sqrt(2), yj = function(t, e, r) {
r.length === 0 && Tr("Karger-Stein must be run on a connected (sub)graph");
for (var i = r[t], n = i[1], a = i[2], o = e[n], s = e[a], c = r, l = c.length - 1; l >= 0; l--) {
var u = c[l], d = u[1], h = u[2];
(e[d] === o && e[h] === s || e[d] === s && e[h] === o) && c.splice(l, 1);
}
for (var f = 0; f < c.length; f++) {
var p = c[f];
p[1] === s ? (c[f] = p.slice(), c[f][1] = o) : p[2] === s && (c[f] = p.slice(), c[f][2] = o);
}
for (var m = 0; m < e.length; m++)
e[m] === s && (e[m] = o);
return c;
}, Uv = function(t, e, r, i) {
for (; r > i; ) {
var n = Math.floor(Math.random() * e.length);
e = yj(n, t, e), r--;
}
return e;
}, bj = {
// Computes the minimum cut of an undirected graph
// Returns the correct answer with high probability
kargerStein: function() {
var t = this, e = this.byGroup(), r = e.nodes, i = e.edges;
i.unmergeBy(function(O) {
return O.isLoop();
});
var n = r.length, a = i.length, o = Math.ceil(Math.pow(Math.log(n) / Math.LN2, 2)), s = Math.floor(n / vj);
if (n < 2) {
Tr("At least 2 nodes are required for Karger-Stein algorithm");
return;
}
for (var c = [], l = 0; l < a; l++) {
var u = i[l];
c.push([l, r.indexOf(u.source()), r.indexOf(u.target())]);
}
for (var d = 1 / 0, h = [], f = new Array(n), p = new Array(n), m = new Array(n), y = function(O, D) {
for (var I = 0; I < n; I++)
D[I] = O[I];
}, g = 0; g <= o; g++) {
for (var v = 0; v < n; v++)
p[v] = v;
var x = Uv(p, c.slice(), n, s), w = x.slice();
y(p, m);
var S = Uv(p, x, s, 2), _ = Uv(m, w, s, 2);
S.length <= _.length && S.length < d ? (d = S.length, h = S, y(p, f)) : _.length <= S.length && _.length < d && (d = _.length, h = _, y(m, f));
}
for (var b = this.spawn(h.map(function(O) {
return i[O[0]];
})), T = this.spawn(), E = this.spawn(), C = f[0], L = 0; L < f.length; L++) {
var A = f[L], k = r[L];
A === C ? T.merge(k) : E.merge(k);
}
var P = function(O) {
var D = t.spawn();
return O.forEach(function(I) {
D.merge(I), I.connectedEdges().forEach(function(F) {
t.contains(F) && !b.contains(F) && D.merge(F);
});
}), D;
}, R = [P(T), P(E)], M = {
cut: b,
components: R,
// n.b. partitions are included to be compatible with the old api spec
// (could be removed in a future major version)
partition1: T,
partition2: E
};
return M;
}
}, xj = function(t) {
return {
x: t.x,
y: t.y
};
}, Cg = function(t, e, r) {
return {
x: t.x * e + r.x,
y: t.y * e + r.y
};
}, RA = function(t, e, r) {
return {
x: (t.x - r.x) / e,
y: (t.y - r.y) / e
};
}, Oc = function(t) {
return {
x: t[0],
y: t[1]
};
}, wj = function(t) {
for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t.length, i = 1 / 0, n = e; n < r; n++) {
var a = t[n];
isFinite(a) && (i = Math.min(a, i));
}
return i;
}, _j = function(t) {
for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t.length, i = -1 / 0, n = e; n < r; n++) {
var a = t[n];
isFinite(a) && (i = Math.max(a, i));
}
return i;
}, Sj = function(t) {
for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t.length, i = 0, n = 0, a = e; a < r; a++) {
var o = t[a];
isFinite(o) && (i += o, n++);
}
return i / n;
}, Mj = function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : t.length, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0;
i ? t = t.slice(e, r) : (r < t.length && t.splice(r, t.length - r), e > 0 && t.splice(0, e));
for (var o = 0, s = t.length - 1; s >= 0; s--) {
var c = t[s];
a ? isFinite(c) || (t[s] = -1 / 0, o++) : t.splice(s, 1);
}
n && t.sort(function(d, h) {
return d - h;
});
var l = t.length, u = Math.floor(l / 2);
return l % 2 !== 0 ? t[u + 1 + o] : (t[u - 1 + o] + t[u + o]) / 2;
}, Ej = function(t) {
return Math.PI * t / 180;
}, Up = function(t, e) {
return Math.atan2(e, t) - Math.PI / 2;
}, Ob = Math.log2 || function(t) {
return Math.log(t) / Math.log(2);
}, OA = function(t) {
return t > 0 ? 1 : t < 0 ? -1 : 0;
}, _l = function(t, e) {
return Math.sqrt(qs(t, e));
}, qs = function(t, e) {
var r = e.x - t.x, i = e.y - t.y;
return r * r + i * i;
}, Tj = function(t) {
for (var e = t.length, r = 0, i = 0; i < e; i++)
r += t[i];
for (var n = 0; n < e; n++)
t[n] = t[n] / r;
return t;
}, ei = function(t, e, r, i) {
return (1 - i) * (1 - i) * t + 2 * (1 - i) * i * e + i * i * r;
}, $c = function(t, e, r, i) {
return {
x: ei(t.x, e.x, r.x, i),
y: ei(t.y, e.y, r.y, i)
};
}, Cj = function(t, e, r, i) {
var n = {
x: e.x - t.x,
y: e.y - t.y
}, a = _l(t, e), o = {
x: n.x / a,
y: n.y / a
};
return r = r ?? 0, i = i ?? r * a, {
x: t.x + o.x * i,
y: t.y + o.y * i
};
}, yh = function(t, e, r) {
return Math.max(t, Math.min(r, e));
}, Yi = function(t) {
if (t == null)
return {
x1: 1 / 0,
y1: 1 / 0,
x2: -1 / 0,
y2: -1 / 0,
w: 0,
h: 0
};
if (t.x1 != null && t.y1 != null) {
if (t.x2 != null && t.y2 != null && t.x2 >= t.x1 && t.y2 >= t.y1)
return {
x1: t.x1,
y1: t.y1,
x2: t.x2,
y2: t.y2,
w: t.x2 - t.x1,
h: t.y2 - t.y1
};
if (t.w != null && t.h != null && t.w >= 0 && t.h >= 0)
return {
x1: t.x1,
y1: t.y1,
x2: t.x1 + t.w,
y2: t.y1 + t.h,
w: t.w,
h: t.h
};
}
}, Aj = function(t) {
return {
x1: t.x1,
x2: t.x2,
w: t.w,
y1: t.y1,
y2: t.y2,
h: t.h
};
}, Lj = function(t) {
t.x1 = 1 / 0, t.y1 = 1 / 0, t.x2 = -1 / 0, t.y2 = -1 / 0, t.w = 0, t.h = 0;
}, kj = function(t, e, r) {
return {
x1: t.x1 + e,
x2: t.x2 + e,
y1: t.y1 + r,
y2: t.y2 + r,
w: t.w,
h: t.h
};
}, DA = function(t, e) {
t.x1 = Math.min(t.x1, e.x1), t.x2 = Math.max(t.x2, e.x2), t.w = t.x2 - t.x1, t.y1 = Math.min(t.y1, e.y1), t.y2 = Math.max(t.y2, e.y2), t.h = t.y2 - t.y1;
}, Pj = function(t, e, r) {
t.x1 = Math.min(t.x1, e), t.x2 = Math.max(t.x2, e), t.w = t.x2 - t.x1, t.y1 = Math.min(t.y1, r), t.y2 = Math.max(t.y2, r), t.h = t.y2 - t.y1;
}, sm = function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
return t.x1 -= e, t.x2 += e, t.y1 -= e, t.y2 += e, t.w = t.x2 - t.x1, t.h = t.y2 - t.y1, t;
}, lm = function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0], r, i, n, a;
if (e.length === 1)
r = i = n = a = e[0];
else if (e.length === 2)
r = n = e[0], a = i = e[1];
else if (e.length === 4) {
var o = Fn(e, 4);
r = o[0], i = o[1], n = o[2], a = o[3];
}
return t.x1 -= a, t.x2 += i, t.y1 -= r, t.y2 += n, t.w = t.x2 - t.x1, t.h = t.y2 - t.y1, t;
}, a_ = function(t, e) {
t.x1 = e.x1, t.y1 = e.y1, t.x2 = e.x2, t.y2 = e.y2, t.w = t.x2 - t.x1, t.h = t.y2 - t.y1;
}, Db = function(t, e) {
return !(t.x1 > e.x2 || e.x1 > t.x2 || t.x2 < e.x1 || e.x2 < t.x1 || t.y2 < e.y1 || e.y2 < t.y1 || t.y1 > e.y2 || e.y1 > t.y2);
}, iu = function(t, e, r) {
return t.x1 <= e && e <= t.x2 && t.y1 <= r && r <= t.y2;
}, Rj = function(t, e) {
return iu(t, e.x, e.y);
}, IA = function(t, e) {
return iu(t, e.x1, e.y1) && iu(t, e.x2, e.y2);
}, NA = function(t, e, r, i, n, a, o) {
var s = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto", c = s === "auto" ? Sl(n, a) : s, l = n / 2, u = a / 2;
c = Math.min(c, l, u);
var d = c !== l, h = c !== u, f;
if (d) {
var p = r - l + c - o, m = i - u - o, y = r + l - c + o, g = m;
if (f = Jo(t, e, r, i, p, m, y, g, !1), f.length > 0)
return f;
}
if (h) {
var v = r + l + o, x = i - u + c - o, w = v, S = i + u - c + o;
if (f = Jo(t, e, r, i, v, x, w, S, !1), f.length > 0)
return f;
}
if (d) {
var _ = r - l + c - o, b = i + u + o, T = r + l - c + o, E = b;
if (f = Jo(t, e, r, i, _, b, T, E, !1), f.length > 0)
return f;
}
if (h) {
var C = r - l - o, L = i - u + c - o, A = C, k = i + u - c + o;
if (f = Jo(t, e, r, i, C, L, A, k, !1), f.length > 0)
return f;
}
var P;
{
var R = r - l + c, M = i - u + c;
if (P = Fd(t, e, r, i, R, M, c + o), P.length > 0 && P[0] <= R && P[1] <= M)
return [P[0], P[1]];
}
{
var O = r + l - c, D = i - u + c;
if (P = Fd(t, e, r, i, O, D, c + o), P.length > 0 && P[0] >= O && P[1] <= D)
return [P[0], P[1]];
}
{
var I = r + l - c, F = i + u - c;
if (P = Fd(t, e, r, i, I, F, c + o), P.length > 0 && P[0] >= I && P[1] >= F)
return [P[0], P[1]];
}
{
var z = r - l + c, U = i + u - c;
if (P = Fd(t, e, r, i, z, U, c + o), P.length > 0 && P[0] <= z && P[1] >= U)
return [P[0], P[1]];
}
return [];
}, Oj = function(t, e, r, i, n, a, o) {
var s = o, c = Math.min(r, n), l = Math.max(r, n), u = Math.min(i, a), d = Math.max(i, a);
return c - s <= t && t <= l + s && u - s <= e && e <= d + s;
}, Dj = function(t, e, r, i, n, a, o, s, c) {
var l = {
x1: Math.min(r, o, n) - c,
x2: Math.max(r, o, n) + c,
y1: Math.min(i, s, a) - c,
y2: Math.max(i, s, a) + c
};
return !(t < l.x1 || t > l.x2 || e < l.y1 || e > l.y2);
}, Ij = function(t, e, r, i) {
r -= i;
var n = e * e - 4 * t * r;
if (n < 0)
return [];
var a = Math.sqrt(n), o = 2 * t, s = (-e + a) / o, c = (-e - a) / o;
return [s, c];
}, Nj = function(t, e, r, i, n) {
var a = 1e-5;
t === 0 && (t = a), e /= t, r /= t, i /= t;
var o, s, c, l, u, d, h, f;
if (s = (3 * r - e * e) / 9, c = -(27 * i) + e * (9 * r - 2 * (e * e)), c /= 54, o = s * s * s + c * c, n[1] = 0, h = e / 3, o > 0) {
u = c + Math.sqrt(o), u = u < 0 ? -Math.pow(-u, 1 / 3) : Math.pow(u, 1 / 3), d = c - Math.sqrt(o), d = d < 0 ? -Math.pow(-d, 1 / 3) : Math.pow(d, 1 / 3), n[0] = -h + u + d, h += (u + d) / 2, n[4] = n[2] = -h, h = Math.sqrt(3) * (-d + u) / 2, n[3] = h, n[5] = -h;
return;
}
if (n[5] = n[3] = 0, o === 0) {
f = c < 0 ? -Math.pow(-c, 1 / 3) : Math.pow(c, 1 / 3), n[0] = -h + 2 * f, n[4] = n[2] = -(f + h);
return;
}
s = -s, l = s * s * s, l = Math.acos(c / Math.sqrt(l)), f = 2 * Math.sqrt(s), n[0] = -h + f * Math.cos(l / 3), n[2] = -h + f * Math.cos((l + 2 * Math.PI) / 3), n[4] = -h + f * Math.cos((l + 4 * Math.PI) / 3);
}, Bj = function(t, e, r, i, n, a, o, s) {
var c = 1 * r * r - 4 * r * n + 2 * r * o + 4 * n * n - 4 * n * o + o * o + i * i - 4 * i * a + 2 * i * s + 4 * a * a - 4 * a * s + s * s, l = 1 * 9 * r * n - 3 * r * r - 3 * r * o - 6 * n * n + 3 * n * o + 9 * i * a - 3 * i * i - 3 * i * s - 6 * a * a + 3 * a * s, u = 1 * 3 * r * r - 6 * r * n + r * o - r * t + 2 * n * n + 2 * n * t - o * t + 3 * i * i - 6 * i * a + i * s - i * e + 2 * a * a + 2 * a * e - s * e, d = 1 * r * n - r * r + r * t - n * t + i * a - i * i + i * e - a * e, h = [];
Nj(c, l, u, d, h);
for (var f = 1e-7, p = [], m = 0; m < 6; m += 2)
Math.abs(h[m + 1]) < f && h[m] >= 0 && h[m] <= 1 && p.push(h[m]);
p.push(1), p.push(0);
for (var y = -1, g, v, x, w = 0; w < p.length; w++)
g = Math.pow(1 - p[w], 2) * r + 2 * (1 - p[w]) * p[w] * n + p[w] * p[w] * o, v = Math.pow(1 - p[w], 2) * i + 2 * (1 - p[w]) * p[w] * a + p[w] * p[w] * s, x = Math.pow(g - t, 2) + Math.pow(v - e, 2), y >= 0 ? x < y && (y = x) : y = x;
return y;
}, Fj = function(t, e, r, i, n, a) {
var o = [t - r, e - i], s = [n - r, a - i], c = s[0] * s[0] + s[1] * s[1], l = o[0] * o[0] + o[1] * o[1], u = o[0] * s[0] + o[1] * s[1], d = u * u / c;
return u < 0 ? l : d > c ? (t - n) * (t - n) + (e - a) * (e - a) : l - d;
}, Vi = function(t, e, r) {
for (var i, n, a, o, s, c = 0, l = 0; l < r.length / 2; l++)
if (i = r[l * 2], n = r[l * 2 + 1], l + 1 < r.length / 2 ? (a = r[(l + 1) * 2], o = r[(l + 1) * 2 + 1]) : (a = r[(l + 1 - r.length / 2) * 2], o = r[(l + 1 - r.length / 2) * 2 + 1]), !(i == t && a == t)) if (i >= t && t >= a || i <= t && t <= a)
s = (t - i) / (a - i) * (o - n) + n, s > e && c++;
else
continue;
return c % 2 !== 0;
}, io = function(t, e, r, i, n, a, o, s, c) {
var l = new Array(r.length), u;
s[0] != null ? (u = Math.atan(s[1] / s[0]), s[0] < 0 ? u = u + Math.PI / 2 : u = -u - Math.PI / 2) : u = s;
for (var d = Math.cos(-u), h = Math.sin(-u), f = 0; f < l.length / 2; f++)
l[f * 2] = a / 2 * (r[f * 2] * d - r[f * 2 + 1] * h), l[f * 2 + 1] = o / 2 * (r[f * 2 + 1] * d + r[f * 2] * h), l[f * 2] += i, l[f * 2 + 1] += n;
var p;
if (c > 0) {
var m = Nm(l, -c);
p = Im(m);
} else
p = l;
return Vi(t, e, p);
}, zj = function(t, e, r, i, n, a, o, s) {
for (var c = new Array(r.length * 2), l = 0; l < s.length; l++) {
var u = s[l];
c[l * 4 + 0] = u.startX, c[l * 4 + 1] = u.startY, c[l * 4 + 2] = u.stopX, c[l * 4 + 3] = u.stopY;
var d = Math.pow(u.cx - t, 2) + Math.pow(u.cy - e, 2);
if (d <= Math.pow(u.radius, 2))
return !0;
}
return Vi(t, e, c);
}, Im = function(t) {
for (var e = new Array(t.length / 2), r, i, n, a, o, s, c, l, u = 0; u < t.length / 4; u++) {
r = t[u * 4], i = t[u * 4 + 1], n = t[u * 4 + 2], a = t[u * 4 + 3], u < t.length / 4 - 1 ? (o = t[(u + 1) * 4], s = t[(u + 1) * 4 + 1], c = t[(u + 1) * 4 + 2], l = t[(u + 1) * 4 + 3]) : (o = t[0], s = t[1], c = t[2], l = t[3]);
var d = Jo(r, i, n, a, o, s, c, l, !0);
e[u * 2] = d[0], e[u * 2 + 1] = d[1];
}
return e;
}, Nm = function(t, e) {
for (var r = new Array(t.length * 2), i, n, a, o, s = 0; s < t.length / 2; s++) {
i = t[s * 2], n = t[s * 2 + 1], s < t.length / 2 - 1 ? (a = t[(s + 1) * 2], o = t[(s + 1) * 2 + 1]) : (a = t[0], o = t[1]);
var c = o - n, l = -(a - i), u = Math.sqrt(c * c + l * l), d = c / u, h = l / u;
r[s * 4] = i + d * e, r[s * 4 + 1] = n + h * e, r[s * 4 + 2] = a + d * e, r[s * 4 + 3] = o + h * e;
}
return r;
}, $j = function(t, e, r, i, n, a) {
var o = r - t, s = i - e;
o /= n, s /= a;
var c = Math.sqrt(o * o + s * s), l = c - 1;
if (l < 0)
return [];
var u = l / c;
return [(r - t) * u + t, (i - e) * u + e];
}, rl = function(t, e, r, i, n, a, o) {
return t -= n, e -= a, t /= r / 2 + o, e /= i / 2 + o, t * t + e * e <= 1;
}, Fd = function(t, e, r, i, n, a, o) {
var s = [r - t, i - e], c = [t - n, e - a], l = s[0] * s[0] + s[1] * s[1], u = 2 * (c[0] * s[0] + c[1] * s[1]), d = c[0] * c[0] + c[1] * c[1] - o * o, h = u * u - 4 * l * d;
if (h < 0)
return [];
var f = (-u + Math.sqrt(h)) / (2 * l), p = (-u - Math.sqrt(h)) / (2 * l), m = Math.min(f, p), y = Math.max(f, p), g = [];
if (m >= 0 && m <= 1 && g.push(m), y >= 0 && y <= 1 && g.push(y), g.length === 0)
return [];
var v = g[0] * s[0] + t, x = g[0] * s[1] + e;
if (g.length > 1) {
if (g[0] == g[1])
return [v, x];
var w = g[1] * s[0] + t, S = g[1] * s[1] + e;
return [v, x, w, S];
} else
return [v, x];
}, jv = function(t, e, r) {
return e <= t && t <= r || r <= t && t <= e ? t : t <= e && e <= r || r <= e && e <= t ? e : r;
}, Jo = function(t, e, r, i, n, a, o, s, c) {
var l = t - n, u = r - t, d = o - n, h = e - a, f = i - e, p = s - a, m = d * h - p * l, y = u * h - f * l, g = p * u - d * f;
if (g !== 0) {
var v = m / g, x = y / g, w = 1e-3, S = 0 - w, _ = 1 + w;
return S <= v && v <= _ && S <= x && x <= _ ? [t + v * u, e + v * f] : c ? [t + v * u, e + v * f] : [];
} else
return m === 0 || y === 0 ? jv(t, r, o) === o ? [o, s] : jv(t, r, n) === n ? [n, a] : jv(n, o, r) === r ? [r, i] : [] : [];
}, bh = function(t, e, r, i, n, a, o, s) {
var c = [], l, u = new Array(r.length), d = !0;
a == null && (d = !1);
var h;
if (d) {
for (var f = 0; f < u.length / 2; f++)
u[f * 2] = r[f * 2] * a + i, u[f * 2 + 1] = r[f * 2 + 1] * o + n;
if (s > 0) {
var p = Nm(u, -s);
h = Im(p);
} else
h = u;
} else
h = r;
for (var m, y, g, v, x = 0; x < h.length / 2; x++)
m = h[x * 2], y = h[x * 2 + 1], x < h.length / 2 - 1 ? (g = h[(x + 1) * 2], v = h[(x + 1) * 2 + 1]) : (g = h[0], v = h[1]), l = Jo(t, e, i, n, m, y, g, v), l.length !== 0 && c.push(l[0], l[1]);
return c;
}, Vj = function(t, e, r, i, n, a, o, s, c) {
var l = [], u, d = new Array(r.length * 2);
c.forEach(function(g, v) {
v === 0 ? (d[d.length - 2] = g.startX, d[d.length - 1] = g.startY) : (d[v * 4 - 2] = g.startX, d[v * 4 - 1] = g.startY), d[v * 4] = g.stopX, d[v * 4 + 1] = g.stopY, u = Fd(t, e, i, n, g.cx, g.cy, g.radius), u.length !== 0 && l.push(u[0], u[1]);
});
for (var h = 0; h < d.length / 4; h++)
u = Jo(t, e, i, n, d[h * 4], d[h * 4 + 1], d[h * 4 + 2], d[h * 4 + 3], !1), u.length !== 0 && l.push(u[0], u[1]);
if (l.length > 2) {
for (var f = [l[0], l[1]], p = Math.pow(f[0] - t, 2) + Math.pow(f[1] - e, 2), m = 1; m < l.length / 2; m++) {
var y = Math.pow(l[m * 2] - t, 2) + Math.pow(l[m * 2 + 1] - e, 2);
y <= p && (f[0] = l[m * 2], f[1] = l[m * 2 + 1], p = y);
}
return f;
}
return l;
}, jp = function(t, e, r) {
var i = [t[0] - e[0], t[1] - e[1]], n = Math.sqrt(i[0] * i[0] + i[1] * i[1]), a = (n - r) / n;
return a < 0 && (a = 1e-5), [e[0] + a * i[0], e[1] + a * i[1]];
}, Ri = function(t, e) {
var r = Sy(t, e);
return r = BA(r), r;
}, BA = function(t) {
for (var e, r, i = t.length / 2, n = 1 / 0, a = 1 / 0, o = -1 / 0, s = -1 / 0, c = 0; c < i; c++)
e = t[2 * c], r = t[2 * c + 1], n = Math.min(n, e), o = Math.max(o, e), a = Math.min(a, r), s = Math.max(s, r);
for (var l = 2 / (o - n), u = 2 / (s - a), d = 0; d < i; d++)
e = t[2 * d] = t[2 * d] * l, r = t[2 * d + 1] = t[2 * d + 1] * u, n = Math.min(n, e), o = Math.max(o, e), a = Math.min(a, r), s = Math.max(s, r);
if (a < -1)
for (var h = 0; h < i; h++)
r = t[2 * h + 1] = t[2 * h + 1] + (-1 - a);
return t;
}, Sy = function(t, e) {
var r = 1 / t * 2 * Math.PI, i = t % 2 === 0 ? Math.PI / 2 + r / 2 : Math.PI / 2;
i += e;
for (var n = new Array(t * 2), a, o = 0; o < t; o++)
a = o * r + i, n[2 * o] = Math.cos(a), n[2 * o + 1] = Math.sin(-a);
return n;
}, Sl = function(t, e) {
return Math.min(t / 4, e / 4, 8);
}, FA = function(t, e) {
return Math.min(t / 10, e / 10, 8);
}, Ib = function() {
return 8;
}, Uj = function(t, e, r) {
return [t - 2 * e + r, 2 * (e - t), t];
}, My = function(t, e) {
return {
heightOffset: Math.min(15, 0.05 * e),
widthOffset: Math.min(100, 0.25 * t),
ctrlPtOffsetPct: 0.05
};
}, jj = yi({
dampingFactor: 0.8,
precision: 1e-6,
iterations: 200,
weight: function(t) {
return 1;
}
}), Hj = {
pageRank: function(t) {
for (var e = jj(t), r = e.dampingFactor, i = e.precision, n = e.iterations, a = e.weight, o = this._private.cy, s = this.byGroup(), c = s.nodes, l = s.edges, u = c.length, d = u * u, h = l.length, f = new Array(d), p = new Array(u), m = (1 - r) / u, y = 0; y < u; y++) {
for (var g = 0; g < u; g++) {
var v = y * u + g;
f[v] = 0;
}
p[y] = 0;
}
for (var x = 0; x < h; x++) {
var w = l[x], S = w.data("source"), _ = w.data("target");
if (S !== _) {
var b = c.indexOfId(S), T = c.indexOfId(_), E = a(w), C = T * u + b;
f[C] += E, p[b] += E;
}
}
for (var L = 1 / u + m, A = 0; A < u; A++)
if (p[A] === 0)
for (var k = 0; k < u; k++) {
var P = k * u + A;
f[P] = L;
}
else
for (var R = 0; R < u; R++) {
var M = R * u + A;
f[M] = f[M] / p[A] + m;
}
for (var O = new Array(u), D = new Array(u), I, F = 0; F < u; F++)
O[F] = 1;
for (var z = 0; z < n; z++) {
for (var U = 0; U < u; U++)
D[U] = 0;
for (var Z = 0; Z < u; Z++)
for (var re = 0; re < u; re++) {
var K = Z * u + re;
D[Z] += f[K] * O[re];
}
Tj(D), I = O, O = D, D = I;
for (var V = 0, H = 0; H < u; H++) {
var G = I[H] - O[H];
V += G * G;
}
if (V < i)
break;
}
var W = {
rank: function(Y) {
return Y = o.collection(Y)[0], O[c.indexOf(Y)];
}
};
return W;
}
// pageRank
}, o_ = yi({
root: null,
weight: function(t) {
return 1;
},
directed: !1,
alpha: 0
}), Vc = {
degreeCentralityNormalized: function(t) {
t = o_(t);
var e = this.cy(), r = this.nodes(), i = r.length;
if (t.directed) {
for (var n = {}, a = {}, o = 0, s = 0, c = 0; c < i; c++) {
var l = r[c], u = l.id();
t.root = l;
var d = this.degreeCentrality(t);
o < d.indegree && (o = d.indegree), s < d.outdegree && (s = d.outdegree), n[u] = d.indegree, a[u] = d.outdegree;
}
return {
indegree: function(g) {
return o == 0 ? 0 : (dt(g) && (g = e.filter(g)), n[g.id()] / o);
},
outdegree: function(g) {
return s === 0 ? 0 : (dt(g) && (g = e.filter(g)), a[g.id()] / s);
}
};
} else {
for (var h = {}, f = 0, p = 0; p < i; p++) {
var m = r[p];
t.root = m;
var y = this.degreeCentrality(t);
f < y.degree && (f = y.degree), h[m.id()] = y.degree;
}
return {
degree: function(g) {
return f === 0 ? 0 : (dt(g) && (g = e.filter(g)), h[g.id()] / f);
}
};
}
},
// 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(t) {
t = o_(t);
var e = this.cy(), r = this, i = t, n = i.root, a = i.weight, o = i.directed, s = i.alpha;
if (n = e.collection(n)[0], o) {
for (var c = n.connectedEdges(), l = c.filter(function(S) {
return S.target().same(n) && r.has(S);
}), u = c.filter(function(S) {
return S.source().same(n) && r.has(S);
}), d = l.length, h = u.length, f = 0, p = 0, m = 0; m < l.length; m++)
f += a(l[m]);
for (var y = 0; y < u.length; y++)
p += a(u[y]);
return {
indegree: Math.pow(d, 1 - s) * Math.pow(f, s),
outdegree: Math.pow(h, 1 - s) * Math.pow(p, s)
};
} else {
for (var g = n.connectedEdges().intersection(r), v = g.length, x = 0, w = 0; w < g.length; w++)
x += a(g[w]);
return {
degree: Math.pow(v, 1 - s) * Math.pow(x, s)
};
}
}
// degreeCentrality
};
Vc.dc = Vc.degreeCentrality;
Vc.dcn = Vc.degreeCentralityNormalised = Vc.degreeCentralityNormalized;
var s_ = yi({
harmonic: !0,
weight: function() {
return 1;
},
directed: !1,
root: null
}), Uc = {
closenessCentralityNormalized: function(t) {
for (var e = s_(t), r = e.harmonic, i = e.weight, n = e.directed, a = this.cy(), o = {}, s = 0, c = this.nodes(), l = this.floydWarshall({
weight: i,
directed: n
}), u = 0; u < c.length; u++) {
for (var d = 0, h = c[u], f = 0; f < c.length; f++)
if (u !== f) {
var p = l.distance(h, c[f]);
r ? d += 1 / p : d += p;
}
r || (d = 1 / d), s < d && (s = d), o[h.id()] = d;
}
return {
closeness: function(m) {
return s == 0 ? 0 : (dt(m) ? m = a.filter(m)[0].id() : m = m.id(), o[m] / s);
}
};
},
// Implemented from pseudocode from wikipedia
closenessCentrality: function(t) {
var e = s_(t), r = e.root, i = e.weight, n = e.directed, a = e.harmonic;
r = this.filter(r)[0];
for (var o = this.dijkstra({
root: r,
weight: i,
directed: n
}), s = 0, c = this.nodes(), l = 0; l < c.length; l++) {
var u = c[l];
if (!u.same(r)) {
var d = o.distanceTo(u);
a ? s += 1 / d : s += d;
}
}
return a ? s : 1 / s;
}
// closenessCentrality
};
Uc.cc = Uc.closenessCentrality;
Uc.ccn = Uc.closenessCentralityNormalised = Uc.closenessCentralityNormalized;
var Gj = yi({
weight: null,
directed: !1
}), Ey = {
// Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes
betweennessCentrality: function(t) {
for (var e = Gj(t), r = e.directed, i = e.weight, n = i != null, a = this.cy(), o = this.nodes(), s = {}, c = {}, l = 0, u = {
set: function(g, v) {
c[g] = v, v > l && (l = v);
},
get: function(g) {
return c[g];
}
}, d = 0; d < o.length; d++) {
var h = o[d], f = h.id();
r ? s[f] = h.outgoers().nodes() : s[f] = h.openNeighborhood().nodes(), u.set(f, 0);
}
for (var p = function(g) {
for (var v = o[g].id(), x = [], w = {}, S = {}, _ = {}, b = new np(function(Z, re) {
return _[Z] - _[re];
}), T = 0; T < o.length; T++) {
var E = o[T].id();
w[E] = [], S[E] = 0, _[E] = 1 / 0;
}
for (S[v] = 1, _[v] = 0, b.push(v); !b.empty(); ) {
var C = b.pop();
if (x.push(C), n)
for (var L = 0; L < s[C].length; L++) {
var A = s[C][L], k = a.getElementById(C), P = void 0;
k.edgesTo(A).length > 0 ? P = k.edgesTo(A)[0] : P = A.edgesTo(k)[0];
var R = i(P);
A = A.id(), _[A] > _[C] + R && (_[A] = _[C] + R, b.nodes.indexOf(A) < 0 ? b.push(A) : b.updateItem(A), S[A] = 0, w[A] = []), _[A] == _[C] + R && (S[A] = S[A] + S[C], w[A].push(C));
}
else
for (var M = 0; M < s[C].length; M++) {
var O = s[C][M].id();
_[O] == 1 / 0 && (b.push(O), _[O] = _[C] + 1), _[O] == _[C] + 1 && (S[O] = S[O] + S[C], w[O].push(C));
}
}
for (var D = {}, I = 0; I < o.length; I++)
D[o[I].id()] = 0;
for (; x.length > 0; ) {
for (var F = x.pop(), z = 0; z < w[F].length; z++) {
var U = w[F][z];
D[U] = D[U] + S[U] / S[F] * (1 + D[F]);
}
F != o[g].id() && u.set(F, u.get(F) + D[F]);
}
}, m = 0; m < o.length; m++)
p(m);
var y = {
betweenness: function(g) {
var v = a.collection(g).id();
return u.get(v);
},
betweennessNormalized: function(g) {
if (l == 0)
return 0;
var v = a.collection(g).id();
return u.get(v) / l;
}
};
return y.betweennessNormalised = y.betweennessNormalized, y;
}
// betweennessCentrality
};
Ey.bc = Ey.betweennessCentrality;
var Wj = yi({
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(t) {
return 1;
}
]
}), qj = function(t) {
return Wj(t);
}, Xj = function(t, e) {
for (var r = 0, i = 0; i < e.length; i++)
r += e[i](t);
return r;
}, Zj = function(t, e, r) {
for (var i = 0; i < e; i++)
t[i * e + i] = r;
}, zA = function(t, e) {
for (var r, i = 0; i < e; i++) {
r = 0;
for (var n = 0; n < e; n++)
r += t[n * e + i];
for (var a = 0; a < e; a++)
t[a * e + i] = t[a * e + i] / r;
}
}, Yj = function(t, e, r) {
for (var i = new Array(r * r), n = 0; n < r; n++) {
for (var a = 0; a < r; a++)
i[n * r + a] = 0;
for (var o = 0; o < r; o++)
for (var s = 0; s < r; s++)
i[n * r + s] += t[n * r + o] * e[o * r + s];
}
return i;
}, Kj = function(t, e, r) {
for (var i = t.slice(0), n = 1; n < r; n++)
t = Yj(t, i, e);
return t;
}, Jj = function(t, e, r) {
for (var i = new Array(e * e), n = 0; n < e * e; n++)
i[n] = Math.pow(t[n], r);
return zA(i, e), i;
}, Qj = function(t, e, r, i) {
for (var n = 0; n < r; n++) {
var a = Math.round(t[n] * Math.pow(10, i)) / Math.pow(10, i), o = Math.round(e[n] * Math.pow(10, i)) / Math.pow(10, i);
if (a !== o)
return !1;
}
return !0;
}, eH = function(t, e, r, i) {
for (var n = [], a = 0; a < e; a++) {
for (var o = [], s = 0; s < e; s++)
Math.round(t[a * e + s] * 1e3) / 1e3 > 0 && o.push(r[s]);
o.length !== 0 && n.push(i.collection(o));
}
return n;
}, tH = function(t, e) {
for (var r = 0; r < t.length; r++)
if (!e[r] || t[r].id() !== e[r].id())
return !1;
return !0;
}, rH = function(t) {
for (var e = 0; e < t.length; e++)
for (var r = 0; r < t.length; r++)
e != r && tH(t[e], t[r]) && t.splice(r, 1);
return t;
}, l_ = function(t) {
for (var e = this.nodes(), r = this.edges(), i = this.cy(), n = qj(t), a = {}, o = 0; o < e.length; o++)
a[e[o].id()] = o;
for (var s = e.length, c = s * s, l = new Array(c), u, d = 0; d < c; d++)
l[d] = 0;
for (var h = 0; h < r.length; h++) {
var f = r[h], p = a[f.source().id()], m = a[f.target().id()], y = Xj(f, n.attributes);
l[p * s + m] += y, l[m * s + p] += y;
}
Zj(l, s, n.multFactor), zA(l, s);
for (var g = !0, v = 0; g && v < n.maxIterations; )
g = !1, u = Kj(l, s, n.expandFactor), l = Jj(u, s, n.inflateFactor), Qj(l, u, c, 4) || (g = !0), v++;
var x = eH(l, s, e, i);
return x = rH(x), x;
}, iH = {
markovClustering: l_,
mcl: l_
}, nH = function(t) {
return t;
}, $A = function(t, e) {
return Math.abs(e - t);
}, c_ = function(t, e, r) {
return t + $A(e, r);
}, u_ = function(t, e, r) {
return t + Math.pow(r - e, 2);
}, aH = function(t) {
return Math.sqrt(t);
}, oH = function(t, e, r) {
return Math.max(t, $A(e, r));
}, pd = function(t, e, r, i, n) {
for (var a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : nH, o = i, s, c, l = 0; l < t; l++)
s = e(l), c = r(l), o = n(o, s, c);
return a(o);
}, nu = {
euclidean: function(t, e, r) {
return t >= 2 ? pd(t, e, r, 0, u_, aH) : pd(t, e, r, 0, c_);
},
squaredEuclidean: function(t, e, r) {
return pd(t, e, r, 0, u_);
},
manhattan: function(t, e, r) {
return pd(t, e, r, 0, c_);
},
max: function(t, e, r) {
return pd(t, e, r, -1 / 0, oH);
}
};
nu["squared-euclidean"] = nu.squaredEuclidean;
nu.squaredeuclidean = nu.squaredEuclidean;
function Ag(t, e, r, i, n, a) {
var o;
return xr(t) ? o = t : o = nu[t] || nu.euclidean, e === 0 && xr(t) ? o(n, a) : o(e, r, i, n, a);
}
var sH = yi({
k: 2,
m: 2,
sensitivityThreshold: 1e-4,
distance: "euclidean",
maxIterations: 10,
attributes: [],
testMode: !1,
testCentroids: null
}), Nb = function(t) {
return sH(t);
}, Bm = function(t, e, r, i, n) {
var a = n !== "kMedoids", o = a ? function(u) {
return r[u];
} : function(u) {
return i[u](r);
}, s = function(u) {
return i[u](e);
}, c = r, l = e;
return Ag(t, i.length, o, s, c, l);
}, Hv = function(t, e, r) {
for (var i = r.length, n = new Array(i), a = new Array(i), o = new Array(e), s = null, c = 0; c < i; c++)
n[c] = t.min(r[c]).value, a[c] = t.max(r[c]).value;
for (var l = 0; l < e; l++) {
s = [];
for (var u = 0; u < i; u++)
s[u] = Math.random() * (a[u] - n[u]) + n[u];
o[l] = s;
}
return o;
}, VA = function(t, e, r, i, n) {
for (var a = 1 / 0, o = 0, s = 0; s < e.length; s++) {
var c = Bm(r, t, e[s], i, n);
c < a && (a = c, o = s);
}
return o;
}, UA = function(t, e, r) {
for (var i = [], n = null, a = 0; a < e.length; a++)
n = e[a], r[n.id()] === t && i.push(n);
return i;
}, lH = function(t, e, r) {
return Math.abs(e - t) <= r;
}, cH = function(t, e, r) {
for (var i = 0; i < t.length; i++)
for (var n = 0; n < t[i].length; n++) {
var a = Math.abs(t[i][n] - e[i][n]);
if (a > r)
return !1;
}
return !0;
}, uH = function(t, e, r) {
for (var i = 0; i < r; i++)
if (t === e[i]) return !0;
return !1;
}, d_ = function(t, e) {
var r = new Array(e);
if (t.length < 50)
for (var i = 0; i < e; i++) {
for (var n = t[Math.floor(Math.random() * t.length)]; uH(n, r, i); )
n = t[Math.floor(Math.random() * t.length)];
r[i] = n;
}
else
for (var a = 0; a < e; a++)
r[a] = t[Math.floor(Math.random() * t.length)];
return r;
}, h_ = function(t, e, r) {
for (var i = 0, n = 0; n < e.length; n++)
i += Bm("manhattan", e[n], t, r, "kMedoids");
return i;
}, dH = function(t) {
var e = this.cy(), r = this.nodes(), i = null, n = Nb(t), a = new Array(n.k), o = {}, s;
n.testMode ? typeof n.testCentroids == "number" ? (n.testCentroids, s = Hv(r, n.k, n.attributes)) : Zr(n.testCentroids) === "object" ? s = n.testCentroids : s = Hv(r, n.k, n.attributes) : s = Hv(r, n.k, n.attributes);
for (var c = !0, l = 0; c && l < n.maxIterations; ) {
for (var u = 0; u < r.length; u++)
i = r[u], o[i.id()] = VA(i, s, n.distance, n.attributes, "kMeans");
c = !1;
for (var d = 0; d < n.k; d++) {
var h = UA(d, r, o);
if (h.length !== 0) {
for (var f = n.attributes.length, p = s[d], m = new Array(f), y = new Array(f), g = 0; g < f; g++) {
y[g] = 0;
for (var v = 0; v < h.length; v++)
i = h[v], y[g] += n.attributes[g](i);
m[g] = y[g] / h.length, lH(m[g], p[g], n.sensitivityThreshold) || (c = !0);
}
s[d] = m, a[d] = e.collection(h);
}
}
l++;
}
return a;
}, hH = function(t) {
var e = this.cy(), r = this.nodes(), i = null, n = Nb(t), a = new Array(n.k), o, s = {}, c, l = new Array(n.k);
n.testMode ? typeof n.testCentroids == "number" || (Zr(n.testCentroids) === "object" ? o = n.testCentroids : o = d_(r, n.k)) : o = d_(r, n.k);
for (var u = !0, d = 0; u && d < n.maxIterations; ) {
for (var h = 0; h < r.length; h++)
i = r[h], s[i.id()] = VA(i, o, n.distance, n.attributes, "kMedoids");
u = !1;
for (var f = 0; f < o.length; f++) {
var p = UA(f, r, s);
if (p.length !== 0) {
l[f] = h_(o[f], p, n.attributes);
for (var m = 0; m < p.length; m++)
c = h_(p[m], p, n.attributes), c < l[f] && (l[f] = c, o[f] = p[m], u = !0);
a[f] = e.collection(p);
}
}
d++;
}
return a;
}, pH = function(t, e, r, i, n) {
for (var a, o, s = 0; s < e.length; s++)
for (var c = 0; c < t.length; c++)
i[s][c] = Math.pow(r[s][c], n.m);
for (var l = 0; l < t.length; l++)
for (var u = 0; u < n.attributes.length; u++) {
a = 0, o = 0;
for (var d = 0; d < e.length; d++)
a += i[d][l] * n.attributes[u](e[d]), o += i[d][l];
t[l][u] = a / o;
}
}, fH = function(t, e, r, i, n) {
for (var a = 0; a < t.length; a++)
e[a] = t[a].slice();
for (var o, s, c, l = 2 / (n.m - 1), u = 0; u < r.length; u++)
for (var d = 0; d < i.length; d++) {
o = 0;
for (var h = 0; h < r.length; h++)
s = Bm(n.distance, i[d], r[u], n.attributes, "cmeans"), c = Bm(n.distance, i[d], r[h], n.attributes, "cmeans"), o += Math.pow(s / c, l);
t[d][u] = 1 / o;
}
}, mH = function(t, e, r, i) {
for (var n = new Array(r.k), a = 0; a < n.length; a++)
n[a] = [];
for (var o, s, c = 0; c < e.length; c++) {
o = -1 / 0, s = -1;
for (var l = 0; l < e[0].length; l++)
e[c][l] > o && (o = e[c][l], s = l);
n[s].push(t[c]);
}
for (var u = 0; u < n.length; u++)
n[u] = i.collection(n[u]);
return n;
}, p_ = function(t) {
var e = this.cy(), r = this.nodes(), i = Nb(t), n, a, o, s, c;
s = new Array(r.length);
for (var l = 0; l < r.length; l++)
s[l] = new Array(i.k);
o = new Array(r.length);
for (var u = 0; u < r.length; u++)
o[u] = new Array(i.k);
for (var d = 0; d < r.length; d++) {
for (var h = 0, f = 0; f < i.k; f++)
o[d][f] = Math.random(), h += o[d][f];
for (var p = 0; p < i.k; p++)
o[d][p] = o[d][p] / h;
}
a = new Array(i.k);
for (var m = 0; m < i.k; m++)
a[m] = new Array(i.attributes.length);
c = new Array(r.length);
for (var y = 0; y < r.length; y++)
c[y] = new Array(i.k);
for (var g = !0, v = 0; g && v < i.maxIterations; )
g = !1, pH(a, r, o, c, i), fH(o, s, a, r, i), cH(o, s, i.sensitivityThreshold) || (g = !0), v++;
return n = mH(r, o, i, e), {
clusters: n,
degreeOfMembership: o
};
}, gH = {
kMeans: dH,
kMedoids: hH,
fuzzyCMeans: p_,
fcm: p_
}, vH = yi({
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: !1,
// 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
}), yH = {
single: "min",
complete: "max"
}, bH = function(t) {
var e = vH(t), r = yH[e.linkage];
return r != null && (e.linkage = r), e;
}, f_ = function(t, e, r, i, n) {
for (var a = 0, o = 1 / 0, s, c = n.attributes, l = function(b, T) {
return Ag(n.distance, c.length, function(E) {
return c[E](b);
}, function(E) {
return c[E](T);
}, b, T);
}, u = 0; u < t.length; u++) {
var d = t[u].key, h = r[d][i[d]];
h < o && (a = d, o = h);
}
if (n.mode === "threshold" && o >= n.threshold || n.mode === "dendrogram" && t.length === 1)
return !1;
var f = e[a], p = e[i[a]], m;
n.mode === "dendrogram" ? m = {
left: f,
right: p,
key: f.key
} : m = {
value: f.value.concat(p.value),
key: f.key
}, t[f.index] = m, t.splice(p.index, 1), e[f.key] = m;
for (var y = 0; y < t.length; y++) {
var g = t[y];
f.key === g.key ? s = 1 / 0 : n.linkage === "min" ? (s = r[f.key][g.key], r[f.key][g.key] > r[p.key][g.key] && (s = r[p.key][g.key])) : n.linkage === "max" ? (s = r[f.key][g.key], r[f.key][g.key] < r[p.key][g.key] && (s = r[p.key][g.key])) : n.linkage === "mean" ? s = (r[f.key][g.key] * f.size + r[p.key][g.key] * p.size) / (f.size + p.size) : n.mode === "dendrogram" ? s = l(g.value, f.value) : s = l(g.value[0], f.value[0]), r[f.key][g.key] = r[g.key][f.key] = s;
}
for (var v = 0; v < t.length; v++) {
var x = t[v].key;
if (i[x] === f.key || i[x] === p.key) {
for (var w = x, S = 0; S < t.length; S++) {
var _ = t[S].key;
r[x][_] < r[x][w] && (w = _);
}
i[x] = w;
}
t[v].index = v;
}
return f.key = p.key = f.index = p.index = null, !0;
}, Hp = function t(e, r, i) {
e && (e.value ? r.push(e.value) : (e.left && t(e.left, r), e.right && t(e.right, r)));
}, xH = function t(e, r) {
if (!e) return "";
if (e.left && e.right) {
var i = t(e.left, r), n = t(e.right, r), a = r.add({
group: "nodes",
data: {
id: i + "," + n
}
});
return r.add({
group: "edges",
data: {
source: i,
target: a.id()
}
}), r.add({
group: "edges",
data: {
source: n,
target: a.id()
}
}), a.id();
} else if (e.value)
return e.value.id();
}, wH = function t(e, r, i) {
if (!e) return [];
var n = [], a = [], o = [];
return r === 0 ? (e.left && Hp(e.left, n), e.right && Hp(e.right, a), o = n.concat(a), [i.collection(o)]) : r === 1 ? e.value ? [i.collection(e.value)] : (e.left && Hp(e.left, n), e.right && Hp(e.right, a), [i.collection(n), i.collection(a)]) : e.value ? [i.collection(e.value)] : (e.left && (n = t(e.left, r - 1, i)), e.right && (a = t(e.right, r - 1, i)), n.concat(a));
}, m_ = function(t) {
for (var e = this.cy(), r = this.nodes(), i = bH(t), n = i.attributes, a = function(g, v) {
return Ag(i.distance, n.length, function(x) {
return n[x](g);
}, function(x) {
return n[x](v);
}, g, v);
}, o = [], s = [], c = [], l = [], u = 0; u < r.length; u++) {
var d = {
value: i.mode === "dendrogram" ? r[u] : [r[u]],
key: u,
index: u
};
o[u] = d, l[u] = d, s[u] = [], c[u] = 0;
}
for (var h = 0; h < o.length; h++)
for (var f = 0; f <= h; f++) {
var p = void 0;
i.mode === "dendrogram" ? p = h === f ? 1 / 0 : a(o[h].value, o[f].value) : p = h === f ? 1 / 0 : a(o[h].value[0], o[f].value[0]), s[h][f] = p, s[f][h] = p, p < s[h][c[h]] && (c[h] = f);
}
for (var m = f_(o, l, s, c, i); m; )
m = f_(o, l, s, c, i);
var y;
return i.mode === "dendrogram" ? (y = wH(o[0], i.dendrogramDepth, e), i.addDendrogram && xH(o[0], e)) : (y = new Array(o.length), o.forEach(function(g, v) {
g.key = g.index = null, y[v] = e.collection(g.value);
})), y;
}, _H = {
hierarchicalClustering: m_,
hca: m_
}, SH = yi({
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')
]
}), MH = function(t) {
var e = t.damping, r = t.preference;
0.5 <= e && e < 1 || Tr("Damping must range on [0.5, 1). Got: ".concat(e));
var i = ["median", "mean", "min", "max"];
return i.some(function(n) {
return n === r;
}) || Xe(r) || Tr("Preference must be one of [".concat(i.map(function(n) {
return "'".concat(n, "'");
}).join(", "), "] or a number. Got: ").concat(r)), SH(t);
}, EH = function(t, e, r, i) {
var n = function(a, o) {
return i[o](a);
};
return -Ag(t, i.length, function(a) {
return n(e, a);
}, function(a) {
return n(r, a);
}, e, r);
}, TH = function(t, e) {
var r = null;
return e === "median" ? r = Mj(t) : e === "mean" ? r = Sj(t) : e === "min" ? r = wj(t) : e === "max" ? r = _j(t) : r = e, r;
}, CH = function(t, e, r) {
for (var i = [], n = 0; n < t; n++)
e[n * t + n] + r[n * t + n] > 0 && i.push(n);
return i;
}, g_ = function(t, e, r) {
for (var i = [], n = 0; n < t; n++) {
for (var a = -1, o = -1 / 0, s = 0; s < r.length; s++) {
var c = r[s];
e[n * t + c] > o && (a = c, o = e[n * t + c]);
}
a > 0 && i.push(a);
}
for (var l = 0; l < r.length; l++)
i[r[l]] = r[l];
return i;
}, AH = function(t, e, r) {
for (var i = g_(t, e, r), n = 0; n < r.length; n++) {
for (var a = [], o = 0; o < i.length; o++)
i[o] === r[n] && a.push(o);
for (var s = -1, c = -1 / 0, l = 0; l < a.length; l++) {
for (var u = 0, d = 0; d < a.length; d++)
u += e[a[d] * t + a[l]];
u > c && (s = l, c = u);
}
r[n] = a[s];
}
return i = g_(t, e, r), i;
}, v_ = function(t) {
for (var e = this.cy(), r = this.nodes(), i = MH(t), n = {}, a = 0; a < r.length; a++)
n[r[a].id()] = a;
var o, s, c, l, u, d;
o = r.length, s = o * o, c = new Array(s);
for (var h = 0; h < s; h++)
c[h] = -1 / 0;
for (var f = 0; f < o; f++)
for (var p = 0; p < o; p++)
f !== p && (c[f * o + p] = EH(i.distance, r[f], r[p], i.attributes));
l = TH(c, i.preference);
for (var m = 0; m < o; m++)
c[m * o + m] = l;
u = new Array(s);
for (var y = 0; y < s; y++)
u[y] = 0;
d = new Array(s);
for (var g = 0; g < s; g++)
d[g] = 0;
for (var v = new Array(o), x = new Array(o), w = new Array(o), S = 0; S < o; S++)
v[S] = 0, x[S] = 0, w[S] = 0;
for (var _ = new Array(o * i.minIterations), b = 0; b < _.length; b++)
_[b] = 0;
var T;
for (T = 0; T < i.maxIterations; T++) {
for (var E = 0; E < o; E++) {
for (var C = -1 / 0, L = -1 / 0, A = -1, k = 0, P = 0; P < o; P++)
v[P] = u[E * o + P], k = d[E * o + P] + c[E * o + P], k >= C ? (L = C, C = k, A = P) : k > L && (L = k);
for (var R = 0; R < o; R++)
u[E * o + R] = (1 - i.damping) * (c[E * o + R] - C) + i.damping * v[R];
u[E * o + A] = (1 - i.damping) * (c[E * o + A] - L) + i.damping * v[A];
}
for (var M = 0; M < o; M++) {
for (var O = 0, D = 0; D < o; D++)
v[D] = d[D * o + M], x[D] = Math.max(0, u[D * o + M]), O += x[D];
O -= x[M], x[M] = u[M * o + M], O += x[M];
for (var I = 0; I < o; I++)
d[I * o + M] = (1 - i.damping) * Math.min(0, O - x[I]) + i.damping * v[I];
d[M * o + M] = (1 - i.damping) * (O - x[M]) + i.damping * v[M];
}
for (var F = 0, z = 0; z < o; z++) {
var U = d[z * o + z] + u[z * o + z] > 0 ? 1 : 0;
_[T % i.minIterations * o + z] = U, F += U;
}
if (F > 0 && (T >= i.minIterations - 1 || T == i.maxIterations - 1)) {
for (var Z = 0, re = 0; re < o; re++) {
w[re] = 0;
for (var K = 0; K < i.minIterations; K++)
w[re] += _[K * o + re];
(w[re] === 0 || w[re] === i.minIterations) && Z++;
}
if (Z === o)
break;
}
}
for (var V = CH(o, u, d), H = AH(o, c, V), G = {}, W = 0; W < V.length; W++)
G[V[W]] = [];
for (var Y = 0; Y < r.length; Y++) {
var X = n[r[Y].id()], ie = H[X];
ie != null && G[ie].push(r[Y]);
}
for (var ue = new Array(V.length), $ = 0; $ < V.length; $++)
ue[$] = e.collection(G[V[$]]);
return ue;
}, LH = {
affinityPropagation: v_,
ap: v_
}, kH = yi({
root: void 0,
directed: !1
}), PH = {
hierholzer: function(t) {
if (!Gt(t)) {
var e = arguments;
t = {
root: e[0],
directed: e[1]
};
}
var r = kH(t), i = r.root, n = r.directed, a = this, o = !1, s, c, l;
i && (l = dt(i) ? this.filter(i)[0].id() : i[0].id());
var u = {}, d = {};
n ? a.forEach(function(g) {
var v = g.id();
if (g.isNode()) {
var x = g.indegree(!0), w = g.outdegree(!0), S = x - w, _ = w - x;
S == 1 ? s ? o = !0 : s = v : _ == 1 ? c ? o = !0 : c = v : (_ > 1 || S > 1) && (o = !0), u[v] = [], g.outgoers().forEach(function(b) {
b.isEdge() && u[v].push(b.id());
});
} else
d[v] = [void 0, g.target().id()];
}) : a.forEach(function(g) {
var v = g.id();
if (g.isNode()) {
var x = g.degree(!0);
x % 2 && (s ? c ? o = !0 : c = v : s = v), u[v] = [], g.connectedEdges().forEach(function(w) {
return u[v].push(w.id());
});
} else
d[v] = [g.source().id(), g.target().id()];
});
var h = {
found: !1,
trail: void 0
};
if (o) return h;
if (c && s)
if (n) {
if (l && c != l)
return h;
l = c;
} else {
if (l && c != l && s != l)
return h;
l || (l = c);
}
else
l || (l = a[0].id());
var f = function(g) {
for (var v = g, x = [g], w, S, _; u[v].length; )
w = u[v].shift(), S = d[w][0], _ = d[w][1], v != _ ? (u[_] = u[_].filter(function(b) {
return b != w;
}), v = _) : !n && v != S && (u[S] = u[S].filter(function(b) {
return b != w;
}), v = S), x.unshift(w), x.unshift(v);
return x;
}, p = [], m = [];
for (m = f(l); m.length != 1; )
u[m[0]].length == 0 ? (p.unshift(a.getElementById(m.shift())), p.unshift(a.getElementById(m.shift()))) : m = f(m.shift()).concat(m);
p.unshift(a.getElementById(m.shift()));
for (var y in u)
if (u[y].length)
return h;
return h.found = !0, h.trail = this.spawn(p, !0), h;
}
}, Gp = function() {
var t = this, e = {}, r = 0, i = 0, n = [], a = [], o = {}, s = function(u, d) {
for (var h = a.length - 1, f = [], p = t.spawn(); a[h].x != u || a[h].y != d; )
f.push(a.pop().edge), h--;
f.push(a.pop().edge), f.forEach(function(m) {
var y = m.connectedNodes().intersection(t);
p.merge(m), y.forEach(function(g) {
var v = g.id(), x = g.connectedEdges().intersection(t);
p.merge(g), e[v].cutVertex ? p.merge(x.filter(function(w) {
return w.isLoop();
})) : p.merge(x);
});
}), n.push(p);
}, c = function u(d, h, f) {
d === f && (i += 1), e[h] = {
id: r,
low: r++,
cutVertex: !1
};
var p = t.getElementById(h).connectedEdges().intersection(t);
if (p.size() === 0)
n.push(t.spawn(t.getElementById(h)));
else {
var m, y, g, v;
p.forEach(function(x) {
m = x.source().id(), y = x.target().id(), g = m === h ? y : m, g !== f && (v = x.id(), o[v] || (o[v] = !0, a.push({
x: h,
y: g,
edge: x
})), g in e ? e[h].low = Math.min(e[h].low, e[g].id) : (u(d, g, h), e[h].low = Math.min(e[h].low, e[g].low), e[h].id <= e[g].low && (e[h].cutVertex = !0, s(h, g))));
});
}
};
t.forEach(function(u) {
if (u.isNode()) {
var d = u.id();
d in e || (i = 0, c(d, d), e[d].cutVertex = i > 1);
}
});
var l = Object.keys(e).filter(function(u) {
return e[u].cutVertex;
}).map(function(u) {
return t.getElementById(u);
});
return {
cut: t.spawn(l),
components: n
};
}, RH = {
hopcroftTarjanBiconnected: Gp,
htbc: Gp,
htb: Gp,
hopcroftTarjanBiconnectedComponents: Gp
}, Wp = function() {
var t = this, e = {}, r = 0, i = [], n = [], a = t.spawn(t), o = function s(c) {
n.push(c), e[c] = {
index: r,
low: r++,
explored: !1
};
var l = t.getElementById(c).connectedEdges().intersection(t);
if (l.forEach(function(p) {
var m = p.target().id();
m !== c && (m in e || s(m), e[m].explored || (e[c].low = Math.min(e[c].low, e[m].low)));
}), e[c].index === e[c].low) {
for (var u = t.spawn(); ; ) {
var d = n.pop();
if (u.merge(t.getElementById(d)), e[d].low = e[c].index, e[d].explored = !0, d === c)
break;
}
var h = u.edgesWith(u), f = u.merge(h);
i.push(f), a = a.difference(f);
}
};
return t.forEach(function(s) {
if (s.isNode()) {
var c = s.id();
c in e || o(c);
}
}), {
cut: a,
components: i
};
}, OH = {
tarjanStronglyConnected: Wp,
tsc: Wp,
tscc: Wp,
tarjanStronglyConnectedComponents: Wp
}, jA = {};
[vh, cj, uj, hj, fj, gj, bj, Hj, Vc, Uc, Ey, iH, gH, _H, LH, PH, RH, OH].forEach(function(t) {
bt(jA, t);
});
/*!
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)
*/
var HA = 0, GA = 1, WA = 2, no = function t(e) {
if (!(this instanceof t)) return new t(e);
this.id = "Thenable/1.0.7", this.state = HA, 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));
};
no.prototype = {
/* promise resolving methods */
fulfill: function(t) {
return y_(this, GA, "fulfillValue", t);
},
reject: function(t) {
return y_(this, WA, "rejectReason", t);
},
/* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */
then: function(t, e) {
var r = this, i = new no();
return r.onFulfilled.push(x_(t, i, "fulfill")), r.onRejected.push(x_(e, i, "reject")), qA(r), i.proxy;
}
};
var y_ = function(t, e, r, i) {
return t.state === HA && (t.state = e, t[r] = i, qA(t)), t;
}, qA = function(t) {
t.state === GA ? b_(t, "onFulfilled", t.fulfillValue) : t.state === WA && b_(t, "onRejected", t.rejectReason);
}, b_ = function(t, e, r) {
if (t[e].length !== 0) {
var i = t[e];
t[e] = [];
var n = function() {
for (var a = 0; a < i.length; a++)
i[a](r);
};
typeof setImmediate == "function" ? setImmediate(n) : setTimeout(n, 0);
}
}, x_ = function(t, e, r) {
return function(i) {
if (typeof t != "function")
e[r].call(e, i);
else {
var n;
try {
n = t(i);
} catch (a) {
e.reject(a);
return;
}
DH(e, n);
}
};
}, DH = function t(e, r) {
if (e === r || e.proxy === r) {
e.reject(new TypeError("cannot resolve promise with itself"));
return;
}
var i;
if (Zr(r) === "object" && r !== null || typeof r == "function")
try {
i = r.then;
} catch (a) {
e.reject(a);
return;
}
if (typeof i == "function") {
var n = !1;
try {
i.call(
r,
/* resolvePromise */
/* [Promises/A+ 2.3.3.3.1] */
function(a) {
n || (n = !0, a === r ? e.reject(new TypeError("circular thenable chain")) : t(e, a));
},
/* rejectPromise */
/* [Promises/A+ 2.3.3.3.2] */
function(a) {
n || (n = !0, e.reject(a));
}
);
} catch (a) {
n || e.reject(a);
}
return;
}
e.fulfill(r);
};
no.all = function(t) {
return new no(function(e, r) {
for (var i = new Array(t.length), n = 0, a = function(s, c) {
i[s] = c, n++, n === t.length && e(i);
}, o = 0; o < t.length; o++)
(function(s) {
var c = t[s], l = c != null && c.then != null;
if (l)
c.then(function(d) {
a(s, d);
}, function(d) {
r(d);
});
else {
var u = c;
a(s, u);
}
})(o);
});
};
no.resolve = function(t) {
return new no(function(e, r) {
e(t);
});
};
no.reject = function(t) {
return new no(function(e, r) {
r(t);
});
};
var Bu = typeof Promise < "u" ? Promise : no, Ty = function(t, e, r) {
var i = Ab(t), n = !i, a = this._private = bt({
duration: 1e3
}, e, r);
if (a.target = t, a.style = a.style || a.css, a.started = !1, a.playing = !1, a.hooked = !1, a.applying = !1, a.progress = 0, a.completes = [], a.frames = [], a.complete && xr(a.complete) && a.completes.push(a.complete), n) {
var o = t.position();
a.startPosition = a.startPosition || {
x: o.x,
y: o.y
}, a.startStyle = a.startStyle || t.cy().style().getAnimationStartStyle(t, a.style);
}
if (i) {
var s = t.pan();
a.startPan = {
x: s.x,
y: s.y
}, a.startZoom = t.zoom();
}
this.length = 1, this[0] = this;
}, Ml = Ty.prototype;
bt(Ml, {
instanceString: function() {
return "animation";
},
hook: function() {
var t = this._private;
if (!t.hooked) {
var e, r = t.target._private.animation;
t.queue ? e = r.queue : e = r.current, e.push(this), on(t.target) && t.target.cy().addToAnimationPool(t.target), t.hooked = !0;
}
return this;
},
play: function() {
var t = this._private;
return t.progress === 1 && (t.progress = 0), t.playing = !0, t.started = !1, t.stopped = !1, this.hook(), this;
},
playing: function() {
return this._private.playing;
},
apply: function() {
var t = this._private;
return t.applying = !0, t.started = !1, t.stopped = !1, this.hook(), this;
},
applying: function() {
return this._private.applying;
},
pause: function() {
var t = this._private;
return t.playing = !1, t.started = !1, this;
},
stop: function() {
var t = this._private;
return t.playing = !1, t.started = !1, t.stopped = !0, this;
},
rewind: function() {
return this.progress(0);
},
fastforward: function() {
return this.progress(1);
},
time: function(t) {
var e = this._private;
return t === void 0 ? e.progress * e.duration : this.progress(t / e.duration);
},
progress: function(t) {
var e = this._private, r = e.playing;
return t === void 0 ? e.progress : (r && this.pause(), e.progress = t, e.started = !1, r && this.play(), this);
},
completed: function() {
return this._private.progress === 1;
},
reverse: function() {
var t = this._private, e = t.playing;
e && this.pause(), t.progress = 1 - t.progress, t.started = !1;
var r = function(s, c) {
var l = t[s];
l != null && (t[s] = t[c], t[c] = l);
};
if (r("zoom", "startZoom"), r("pan", "startPan"), r("position", "startPosition"), t.style)
for (var i = 0; i < t.style.length; i++) {
var n = t.style[i], a = n.name, o = t.startStyle[a];
t.startStyle[a] = n, t.style[i] = o;
}
return e && this.play(), this;
},
promise: function(t) {
var e = this._private, r;
switch (t) {
case "frame":
r = e.frames;
break;
default:
case "complete":
case "completed":
r = e.completes;
}
return new Bu(function(i, n) {
r.push(function() {
i();
});
});
}
});
Ml.complete = Ml.completed;
Ml.run = Ml.play;
Ml.running = Ml.playing;
var IH = {
animated: function() {
return function() {
var t = this, e = t.length !== void 0, r = e ? t : [t], i = this._private.cy || this;
if (!i.styleEnabled())
return !1;
var n = r[0];
if (n)
return n._private.animation.current.length > 0;
};
},
// animated
clearQueue: function() {
return function() {
var t = this, e = t.length !== void 0, r = e ? t : [t], i = this._private.cy || this;
if (!i.styleEnabled())
return this;
for (var n = 0; n < r.length; n++) {
var a = r[n];
a._private.animation.queue = [];
}
return this;
};
},
// clearQueue
delay: function() {
return function(t, e) {
var r = this._private.cy || this;
return r.styleEnabled() ? this.animate({
delay: t,
duration: t,
complete: e
}) : this;
};
},
// delay
delayAnimation: function() {
return function(t, e) {
var r = this._private.cy || this;
return r.styleEnabled() ? this.animation({
delay: t,
duration: t,
complete: e
}) : this;
};
},
// delay
animation: function() {
return function(t, e) {
var r = this, i = r.length !== void 0, n = i ? r : [r], a = this._private.cy || this, o = !i, s = !o;
if (!a.styleEnabled())
return this;
var c = a.style();
t = bt({}, t, e);
var l = Object.keys(t).length === 0;
if (l)
return new Ty(n[0], t);
switch (t.duration === void 0 && (t.duration = 400), t.duration) {
case "slow":
t.duration = 600;
break;
case "fast":
t.duration = 200;
break;
}
if (s && (t.style = c.getPropsList(t.style || t.css), t.css = void 0), s && t.renderedPosition != null) {
var u = t.renderedPosition, d = a.pan(), h = a.zoom();
t.position = RA(u, h, d);
}
if (o && t.panBy != null) {
var f = t.panBy, p = a.pan();
t.pan = {
x: p.x + f.x,
y: p.y + f.y
};
}
var m = t.center || t.centre;
if (o && m != null) {
var y = a.getCenterPan(m.eles, t.zoom);
y != null && (t.pan = y);
}
if (o && t.fit != null) {
var g = t.fit, v = a.getFitViewport(g.eles || g.boundingBox, g.padding);
v != null && (t.pan = v.pan, t.zoom = v.zoom);
}
if (o && Gt(t.zoom)) {
var x = a.getZoomedViewport(t.zoom);
x != null ? (x.zoomed && (t.zoom = x.zoom), x.panned && (t.pan = x.pan)) : t.zoom = null;
}
return new Ty(n[0], t);
};
},
// animate
animate: function() {
return function(t, e) {
var r = this, i = r.length !== void 0, n = i ? r : [r], a = this._private.cy || this;
if (!a.styleEnabled())
return this;
e && (t = bt({}, t, e));
for (var o = 0; o < n.length; o++) {
var s = n[o], c = s.animated() && (t.queue === void 0 || t.queue), l = s.animation(t, c ? {
queue: !0
} : void 0);
l.play();
}
return this;
};
},
// animate
stop: function() {
return function(t, e) {
var r = this, i = r.length !== void 0, n = i ? r : [r], a = this._private.cy || this;
if (!a.styleEnabled())
return this;
for (var o = 0; o < n.length; o++) {
for (var s = n[o], c = s._private, l = c.animation.current, u = 0; u < l.length; u++) {
var d = l[u], h = d._private;
e && (h.duration = 0);
}
t && (c.animation.queue = []), e || (c.animation.current = []);
}
return a.notify("draw"), this;
};
}
// stop
}, NH = Array.isArray, Lg = NH, BH = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, FH = /^\w*$/;
function zH(t, e) {
if (Lg(t))
return !1;
var r = typeof t;
return r == "number" || r == "symbol" || r == "boolean" || t == null || ip(t) ? !0 : FH.test(t) || !BH.test(t) || e != null && t in Object(e);
}
var $H = zH, VH = "[object AsyncFunction]", UH = "[object Function]", jH = "[object GeneratorFunction]", HH = "[object Proxy]";
function GH(t) {
if (!xl(t))
return !1;
var e = MA(t);
return e == UH || e == jH || e == VH || e == HH;
}
var WH = GH, qH = Mg["__core-js_shared__"], Gv = qH, w_ = function() {
var t = /[^.]+$/.exec(Gv && Gv.keys && Gv.keys.IE_PROTO || "");
return t ? "Symbol(src)_1." + t : "";
}();
function XH(t) {
return !!w_ && w_ in t;
}
var ZH = XH, YH = Function.prototype, KH = YH.toString;
function JH(t) {
if (t != null) {
try {
return KH.call(t);
} catch {
}
try {
return t + "";
} catch {
}
}
return "";
}
var QH = JH, eG = /[\\^$.*+?()[\]{}|]/g, tG = /^\[object .+?Constructor\]$/, rG = Function.prototype, iG = Object.prototype, nG = rG.toString, aG = iG.hasOwnProperty, oG = RegExp(
"^" + nG.call(aG).replace(eG, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function sG(t) {
if (!xl(t) || ZH(t))
return !1;
var e = WH(t) ? oG : tG;
return e.test(QH(t));
}
var lG = sG;
function cG(t, e) {
return t == null ? void 0 : t[e];
}
var uG = cG;
function dG(t, e) {
var r = uG(t, e);
return lG(r) ? r : void 0;
}
var Bb = dG, hG = Bb(Object, "create"), xh = hG;
function pG() {
this.__data__ = xh ? xh(null) : {}, this.size = 0;
}
var fG = pG;
function mG(t) {
var e = this.has(t) && delete this.__data__[t];
return this.size -= e ? 1 : 0, e;
}
var gG = mG, vG = "__lodash_hash_undefined__", yG = Object.prototype, bG = yG.hasOwnProperty;
function xG(t) {
var e = this.__data__;
if (xh) {
var r = e[t];
return r === vG ? void 0 : r;
}
return bG.call(e, t) ? e[t] : void 0;
}
var wG = xG, _G = Object.prototype, SG = _G.hasOwnProperty;
function MG(t) {
var e = this.__data__;
return xh ? e[t] !== void 0 : SG.call(e, t);
}
var EG = MG, TG = "__lodash_hash_undefined__";
function CG(t, e) {
var r = this.__data__;
return this.size += this.has(t) ? 0 : 1, r[t] = xh && e === void 0 ? TG : e, this;
}
var AG = CG;
function Fu(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var i = t[e];
this.set(i[0], i[1]);
}
}
Fu.prototype.clear = fG;
Fu.prototype.delete = gG;
Fu.prototype.get = wG;
Fu.prototype.has = EG;
Fu.prototype.set = AG;
var __ = Fu;
function LG() {
this.__data__ = [], this.size = 0;
}
var kG = LG;
function PG(t, e) {
return t === e || t !== t && e !== e;
}
var XA = PG;
function RG(t, e) {
for (var r = t.length; r--; )
if (XA(t[r][0], e))
return r;
return -1;
}
var kg = RG, OG = Array.prototype, DG = OG.splice;
function IG(t) {
var e = this.__data__, r = kg(e, t);
if (r < 0)
return !1;
var i = e.length - 1;
return r == i ? e.pop() : DG.call(e, r, 1), --this.size, !0;
}
var NG = IG;
function BG(t) {
var e = this.__data__, r = kg(e, t);
return r < 0 ? void 0 : e[r][1];
}
var FG = BG;
function zG(t) {
return kg(this.__data__, t) > -1;
}
var $G = zG;
function VG(t, e) {
var r = this.__data__, i = kg(r, t);
return i < 0 ? (++this.size, r.push([t, e])) : r[i][1] = e, this;
}
var UG = VG;
function zu(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var i = t[e];
this.set(i[0], i[1]);
}
}
zu.prototype.clear = kG;
zu.prototype.delete = NG;
zu.prototype.get = FG;
zu.prototype.has = $G;
zu.prototype.set = UG;
var jG = zu, HG = Bb(Mg, "Map"), GG = HG;
function WG() {
this.size = 0, this.__data__ = {
hash: new __(),
map: new (GG || jG)(),
string: new __()
};
}
var qG = WG;
function XG(t) {
var e = typeof t;
return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
}
var ZG = XG;
function YG(t, e) {
var r = t.__data__;
return ZG(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
}
var Pg = YG;
function KG(t) {
var e = Pg(this, t).delete(t);
return this.size -= e ? 1 : 0, e;
}
var JG = KG;
function QG(t) {
return Pg(this, t).get(t);
}
var e9 = QG;
function t9(t) {
return Pg(this, t).has(t);
}
var r9 = t9;
function i9(t, e) {
var r = Pg(this, t), i = r.size;
return r.set(t, e), this.size += r.size == i ? 0 : 1, this;
}
var n9 = i9;
function $u(t) {
var e = -1, r = t == null ? 0 : t.length;
for (this.clear(); ++e < r; ) {
var i = t[e];
this.set(i[0], i[1]);
}
}
$u.prototype.clear = qG;
$u.prototype.delete = JG;
$u.prototype.get = e9;
$u.prototype.has = r9;
$u.prototype.set = n9;
var ZA = $u, a9 = "Expected a function";
function Fb(t, e) {
if (typeof t != "function" || e != null && typeof e != "function")
throw new TypeError(a9);
var r = function() {
var i = arguments, n = e ? e.apply(this, i) : i[0], a = r.cache;
if (a.has(n))
return a.get(n);
var o = t.apply(this, i);
return r.cache = a.set(n, o) || a, o;
};
return r.cache = new (Fb.Cache || ZA)(), r;
}
Fb.Cache = ZA;
var o9 = Fb, s9 = 500;
function l9(t) {
var e = o9(t, function(i) {
return r.size === s9 && r.clear(), i;
}), r = e.cache;
return e;
}
var c9 = l9, u9 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, d9 = /\\(\\)?/g, h9 = c9(function(t) {
var e = [];
return t.charCodeAt(0) === 46 && e.push(""), t.replace(u9, function(r, i, n, a) {
e.push(n ? a.replace(d9, "$1") : i || r);
}), e;
}), YA = h9;
function p9(t, e) {
for (var r = -1, i = t == null ? 0 : t.length, n = Array(i); ++r < i; )
n[r] = e(t[r], r, t);
return n;
}
var KA = p9, f9 = 1 / 0, S_ = ru ? ru.prototype : void 0, M_ = S_ ? S_.toString : void 0;
function JA(t) {
if (typeof t == "string")
return t;
if (Lg(t))
return KA(t, JA) + "";
if (ip(t))
return M_ ? M_.call(t) : "";
var e = t + "";
return e == "0" && 1 / t == -f9 ? "-0" : e;
}
var m9 = JA;
function g9(t) {
return t == null ? "" : m9(t);
}
var QA = g9;
function v9(t, e) {
return Lg(t) ? t : $H(t, e) ? [t] : YA(QA(t));
}
var e3 = v9, y9 = 1 / 0;
function b9(t) {
if (typeof t == "string" || ip(t))
return t;
var e = t + "";
return e == "0" && 1 / t == -y9 ? "-0" : e;
}
var zb = b9;
function x9(t, e) {
e = e3(e, t);
for (var r = 0, i = e.length; t != null && r < i; )
t = t[zb(e[r++])];
return r && r == i ? t : void 0;
}
var w9 = x9;
function _9(t, e, r) {
var i = t == null ? void 0 : w9(t, e);
return i === void 0 ? r : i;
}
var S9 = _9, M9 = function() {
try {
var t = Bb(Object, "defineProperty");
return t({}, "", {}), t;
} catch {
}
}(), E_ = M9;
function E9(t, e, r) {
e == "__proto__" && E_ ? E_(t, e, {
configurable: !0,
enumerable: !0,
value: r,
writable: !0
}) : t[e] = r;
}
var T9 = E9, C9 = Object.prototype, A9 = C9.hasOwnProperty;
function L9(t, e, r) {
var i = t[e];
(!(A9.call(t, e) && XA(i, r)) || r === void 0 && !(e in t)) && T9(t, e, r);
}
var k9 = L9, P9 = 9007199254740991, R9 = /^(?:0|[1-9]\d*)$/;
function O9(t, e) {
var r = typeof t;
return e = e ?? P9, !!e && (r == "number" || r != "symbol" && R9.test(t)) && t > -1 && t % 1 == 0 && t < e;
}
var D9 = O9;
function I9(t, e, r, i) {
if (!xl(t))
return t;
e = e3(e, t);
for (var n = -1, a = e.length, o = a - 1, s = t; s != null && ++n < a; ) {
var c = zb(e[n]), l = r;
if (c === "__proto__" || c === "constructor" || c === "prototype")
return t;
if (n != o) {
var u = s[c];
l = i ? i(u, c, s) : void 0, l === void 0 && (l = xl(u) ? u : D9(e[n + 1]) ? [] : {});
}
k9(s, c, l), s = s[c];
}
return t;
}
var N9 = I9;
function B9(t, e, r) {
return t == null ? t : N9(t, e, r);
}
var F9 = B9;
function z9(t, e) {
var r = -1, i = t.length;
for (e || (e = Array(i)); ++r < i; )
e[r] = t[r];
return e;
}
var $9 = z9;
function V9(t) {
return Lg(t) ? KA(t, zb) : ip(t) ? [t] : $9(YA(QA(t)));
}
var U9 = V9, j9 = {
// access data field
data: function(t) {
var e = {
field: "data",
bindingEvent: "data",
allowBinding: !1,
allowSetting: !1,
allowGetting: !1,
settingEvent: "data",
settingTriggersEvent: !1,
triggerFnName: "trigger",
immutableKeys: {},
// key => true if immutable
updateStyle: !1,
beforeGet: function(r) {
},
beforeSet: function(r, i) {
},
onSet: function(r) {
},
canSet: function(r) {
return !0;
}
};
return t = bt({}, e, t), function(r, i) {
var n = t, a = this, o = a.length !== void 0, s = o ? a : [a], c = o ? a[0] : a;
if (dt(r)) {
var l = r.indexOf(".") !== -1, u = l && U9(r);
if (n.allowGetting && i === void 0) {
var d;
return c && (n.beforeGet(c), u && c._private[n.field][r] === void 0 ? d = S9(c._private[n.field], u) : d = c._private[n.field][r]), d;
} else if (n.allowSetting && i !== void 0) {
var h = !n.immutableKeys[r];
if (h) {
var f = pA({}, r, i);
n.beforeSet(a, f);
for (var p = 0, m = s.length; p < m; p++) {
var y = s[p];
n.canSet(y) && (u && c._private[n.field][r] === void 0 ? F9(y._private[n.field], u, i) : y._private[n.field][r] = i);
}
n.updateStyle && a.updateStyle(), n.onSet(a), n.settingTriggersEvent && a[n.triggerFnName](n.settingEvent);
}
}
} else if (n.allowSetting && Gt(r)) {
var g = r, v, x, w = Object.keys(g);
n.beforeSet(a, g);
for (var S = 0; S < w.length; S++) {
v = w[S], x = g[v];
var _ = !n.immutableKeys[v];
if (_)
for (var b = 0; b < s.length; b++) {
var T = s[b];
n.canSet(T) && (T._private[n.field][v] = x);
}
}
n.updateStyle && a.updateStyle(), n.onSet(a), n.settingTriggersEvent && a[n.triggerFnName](n.settingEvent);
} else if (n.allowBinding && xr(r)) {
var E = r;
a.on(n.bindingEvent, E);
} else if (n.allowGetting && r === void 0) {
var C;
return c && (n.beforeGet(c), C = c._private[n.field]), C;
}
return a;
};
},
// data
// remove data field
removeData: function(t) {
var e = {
field: "data",
event: "data",
triggerFnName: "trigger",
triggerEvent: !1,
immutableKeys: {}
// key => true if immutable
};
return t = bt({}, e, t), function(r) {
var i = t, n = this, a = n.length !== void 0, o = a ? n : [n];
if (dt(r)) {
for (var s = r.split(/\s+/), c = s.length, l = 0; l < c; l++) {
var u = s[l];
if (!ds(u)) {
var d = !i.immutableKeys[u];
if (d)
for (var h = 0, f = o.length; h < f; h++)
o[h]._private[i.field][u] = void 0;
}
}
i.triggerEvent && n[i.triggerFnName](i.event);
} else if (r === void 0) {
for (var p = 0, m = o.length; p < m; p++)
for (var y = o[p]._private[i.field], g = Object.keys(y), v = 0; v < g.length; v++) {
var x = g[v], w = !i.immutableKeys[x];
w && (y[x] = void 0);
}
i.triggerEvent && n[i.triggerFnName](i.event);
}
return n;
};
}
// removeData
}, H9 = {
eventAliasesOn: function(t) {
var e = t;
e.addListener = e.listen = e.bind = e.on, e.unlisten = e.unbind = e.off = e.removeListener, e.trigger = e.emit, e.pon = e.promiseOn = function(r, i) {
var n = this, a = Array.prototype.slice.call(arguments, 0);
return new Bu(function(o, s) {
var c = function(d) {
n.off.apply(n, u), o(d);
}, l = a.concat([c]), u = l.concat([]);
n.on.apply(n, l);
});
};
}
}, Xt = {};
[IH, j9, H9].forEach(function(t) {
bt(Xt, t);
});
var G9 = {
animate: Xt.animate(),
animation: Xt.animation(),
animated: Xt.animated(),
clearQueue: Xt.clearQueue(),
delay: Xt.delay(),
delayAnimation: Xt.delayAnimation(),
stop: Xt.stop()
}, cm = {
classes: function(t) {
var e = this;
if (t === void 0) {
var r = [];
return e[0]._private.classes.forEach(function(f) {
return r.push(f);
}), r;
} else ar(t) || (t = (t || "").match(/\S+/g) || []);
for (var i = [], n = new Nu(t), a = 0; a < e.length; a++) {
for (var o = e[a], s = o._private, c = s.classes, l = !1, u = 0; u < t.length; u++) {
var d = t[u], h = c.has(d);
if (!h) {
l = !0;
break;
}
}
l || (l = c.size !== t.length), l && (s.classes = n, i.push(o));
}
return i.length > 0 && this.spawn(i).updateStyle().emit("class"), e;
},
addClass: function(t) {
return this.toggleClass(t, !0);
},
hasClass: function(t) {
var e = this[0];
return e != null && e._private.classes.has(t);
},
toggleClass: function(t, e) {
ar(t) || (t = t.match(/\S+/g) || []);
for (var r = this, i = e === void 0, n = [], a = 0, o = r.length; a < o; a++)
for (var s = r[a], c = s._private.classes, l = !1, u = 0; u < t.length; u++) {
var d = t[u], h = c.has(d), f = !1;
e || i && !h ? (c.add(d), f = !0) : (!e || i && h) && (c.delete(d), f = !0), !l && f && (n.push(s), l = !0);
}
return n.length > 0 && this.spawn(n).updateStyle().emit("class"), r;
},
removeClass: function(t) {
return this.toggleClass(t, !1);
},
flashClass: function(t, e) {
var r = this;
if (e == null)
e = 250;
else if (e === 0)
return r;
return r.addClass(t), setTimeout(function() {
r.removeClass(t);
}, e), r;
}
};
cm.className = cm.classNames = cm.classes;
var Ut = {
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: qr,
// 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+"
};
Ut.variable = "(?:[\\w-.]|(?:\\\\" + Ut.metaChar + "))+";
Ut.className = "(?:[\\w-]|(?:\\\\" + Ut.metaChar + "))+";
Ut.value = Ut.string + "|" + Ut.number;
Ut.id = Ut.variable;
(function() {
var t, e, r;
for (t = Ut.comparatorOp.split("|"), r = 0; r < t.length; r++)
e = t[r], Ut.comparatorOp += "|@" + e;
for (t = Ut.comparatorOp.split("|"), r = 0; r < t.length; r++)
e = t[r], !(e.indexOf("!") >= 0) && e !== "=" && (Ut.comparatorOp += "|\\!" + e);
})();
var rr = function() {
return {
checks: []
};
}, rt = {
/** 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
}, Cy = [{
selector: ":selected",
matches: function(t) {
return t.selected();
}
}, {
selector: ":unselected",
matches: function(t) {
return !t.selected();
}
}, {
selector: ":selectable",
matches: function(t) {
return t.selectable();
}
}, {
selector: ":unselectable",
matches: function(t) {
return !t.selectable();
}
}, {
selector: ":locked",
matches: function(t) {
return t.locked();
}
}, {
selector: ":unlocked",
matches: function(t) {
return !t.locked();
}
}, {
selector: ":visible",
matches: function(t) {
return t.visible();
}
}, {
selector: ":hidden",
matches: function(t) {
return !t.visible();
}
}, {
selector: ":transparent",
matches: function(t) {
return t.transparent();
}
}, {
selector: ":grabbed",
matches: function(t) {
return t.grabbed();
}
}, {
selector: ":free",
matches: function(t) {
return !t.grabbed();
}
}, {
selector: ":removed",
matches: function(t) {
return t.removed();
}
}, {
selector: ":inside",
matches: function(t) {
return !t.removed();
}
}, {
selector: ":grabbable",
matches: function(t) {
return t.grabbable();
}
}, {
selector: ":ungrabbable",
matches: function(t) {
return !t.grabbable();
}
}, {
selector: ":animated",
matches: function(t) {
return t.animated();
}
}, {
selector: ":unanimated",
matches: function(t) {
return !t.animated();
}
}, {
selector: ":parent",
matches: function(t) {
return t.isParent();
}
}, {
selector: ":childless",
matches: function(t) {
return t.isChildless();
}
}, {
selector: ":child",
matches: function(t) {
return t.isChild();
}
}, {
selector: ":orphan",
matches: function(t) {
return t.isOrphan();
}
}, {
selector: ":nonorphan",
matches: function(t) {
return t.isChild();
}
}, {
selector: ":compound",
matches: function(t) {
return t.isNode() ? t.isParent() : t.source().isParent() || t.target().isParent();
}
}, {
selector: ":loop",
matches: function(t) {
return t.isLoop();
}
}, {
selector: ":simple",
matches: function(t) {
return t.isSimple();
}
}, {
selector: ":active",
matches: function(t) {
return t.active();
}
}, {
selector: ":inactive",
matches: function(t) {
return !t.active();
}
}, {
selector: ":backgrounding",
matches: function(t) {
return t.backgrounding();
}
}, {
selector: ":nonbackgrounding",
matches: function(t) {
return !t.backgrounding();
}
}].sort(function(t, e) {
return tU(t.selector, e.selector);
}), W9 = function() {
for (var t = {}, e, r = 0; r < Cy.length; r++)
e = Cy[r], t[e.selector] = e.matches;
return t;
}(), q9 = function(t, e) {
return W9[t](e);
}, X9 = "(" + Cy.map(function(t) {
return t.selector;
}).join("|") + ")", ec = function(t) {
return t.replace(new RegExp("\\\\(" + Ut.metaChar + ")", "g"), function(e, r) {
return r;
});
}, Ao = function(t, e, r) {
t[t.length - 1] = r;
}, Ay = [{
name: "group",
// just used for identifying when debugging
query: !0,
regex: "(" + Ut.group + ")",
populate: function(t, e, r) {
var i = Fn(r, 1), n = i[0];
e.checks.push({
type: rt.GROUP,
value: n === "*" ? n : n + "s"
});
}
}, {
name: "state",
query: !0,
regex: X9,
populate: function(t, e, r) {
var i = Fn(r, 1), n = i[0];
e.checks.push({
type: rt.STATE,
value: n
});
}
}, {
name: "id",
query: !0,
regex: "\\#(" + Ut.id + ")",
populate: function(t, e, r) {
var i = Fn(r, 1), n = i[0];
e.checks.push({
type: rt.ID,
value: ec(n)
});
}
}, {
name: "className",
query: !0,
regex: "\\.(" + Ut.className + ")",
populate: function(t, e, r) {
var i = Fn(r, 1), n = i[0];
e.checks.push({
type: rt.CLASS,
value: ec(n)
});
}
}, {
name: "dataExists",
query: !0,
regex: "\\[\\s*(" + Ut.variable + ")\\s*\\]",
populate: function(t, e, r) {
var i = Fn(r, 1), n = i[0];
e.checks.push({
type: rt.DATA_EXIST,
field: ec(n)
});
}
}, {
name: "dataCompare",
query: !0,
regex: "\\[\\s*(" + Ut.variable + ")\\s*(" + Ut.comparatorOp + ")\\s*(" + Ut.value + ")\\s*\\]",
populate: function(t, e, r) {
var i = Fn(r, 3), n = i[0], a = i[1], o = i[2], s = new RegExp("^" + Ut.string + "$").exec(o) != null;
s ? o = o.substring(1, o.length - 1) : o = parseFloat(o), e.checks.push({
type: rt.DATA_COMPARE,
field: ec(n),
operator: a,
value: o
});
}
}, {
name: "dataBool",
query: !0,
regex: "\\[\\s*(" + Ut.boolOp + ")\\s*(" + Ut.variable + ")\\s*\\]",
populate: function(t, e, r) {
var i = Fn(r, 2), n = i[0], a = i[1];
e.checks.push({
type: rt.DATA_BOOL,
field: ec(a),
operator: n
});
}
}, {
name: "metaCompare",
query: !0,
regex: "\\[\\[\\s*(" + Ut.meta + ")\\s*(" + Ut.comparatorOp + ")\\s*(" + Ut.number + ")\\s*\\]\\]",
populate: function(t, e, r) {
var i = Fn(r, 3), n = i[0], a = i[1], o = i[2];
e.checks.push({
type: rt.META_COMPARE,
field: ec(n),
operator: a,
value: parseFloat(o)
});
}
}, {
name: "nextQuery",
separator: !0,
regex: Ut.separator,
populate: function(t, e) {
var r = t.currentSubject, i = t.edgeCount, n = t.compoundCount, a = t[t.length - 1];
r != null && (a.subject = r, t.currentSubject = null), a.edgeCount = i, a.compoundCount = n, t.edgeCount = 0, t.compoundCount = 0;
var o = t[t.length++] = rr();
return o;
}
}, {
name: "directedEdge",
separator: !0,
regex: Ut.directedEdge,
populate: function(t, e) {
if (t.currentSubject == null) {
var r = rr(), i = e, n = rr();
return r.checks.push({
type: rt.DIRECTED_EDGE,
source: i,
target: n
}), Ao(t, e, r), t.edgeCount++, n;
} else {
var a = rr(), o = e, s = rr();
return a.checks.push({
type: rt.NODE_SOURCE,
source: o,
target: s
}), Ao(t, e, a), t.edgeCount++, s;
}
}
}, {
name: "undirectedEdge",
separator: !0,
regex: Ut.undirectedEdge,
populate: function(t, e) {
if (t.currentSubject == null) {
var r = rr(), i = e, n = rr();
return r.checks.push({
type: rt.UNDIRECTED_EDGE,
nodes: [i, n]
}), Ao(t, e, r), t.edgeCount++, n;
} else {
var a = rr(), o = e, s = rr();
return a.checks.push({
type: rt.NODE_NEIGHBOR,
node: o,
neighbor: s
}), Ao(t, e, a), s;
}
}
}, {
name: "child",
separator: !0,
regex: Ut.child,
populate: function(t, e) {
if (t.currentSubject == null) {
var r = rr(), i = rr(), n = t[t.length - 1];
return r.checks.push({
type: rt.CHILD,
parent: n,
child: i
}), Ao(t, e, r), t.compoundCount++, i;
} else if (t.currentSubject === e) {
var a = rr(), o = t[t.length - 1], s = rr(), c = rr(), l = rr(), u = rr();
return a.checks.push({
type: rt.COMPOUND_SPLIT,
left: o,
right: s,
subject: c
}), c.checks = e.checks, e.checks = [{
type: rt.TRUE
}], u.checks.push({
type: rt.TRUE
}), s.checks.push({
type: rt.PARENT,
// type is swapped on right side queries
parent: u,
child: l
// empty for now
}), Ao(t, o, a), t.currentSubject = c, t.compoundCount++, l;
} else {
var d = rr(), h = rr(), f = [{
type: rt.PARENT,
parent: d,
child: h
}];
return d.checks = e.checks, e.checks = f, t.compoundCount++, h;
}
}
}, {
name: "descendant",
separator: !0,
regex: Ut.descendant,
populate: function(t, e) {
if (t.currentSubject == null) {
var r = rr(), i = rr(), n = t[t.length - 1];
return r.checks.push({
type: rt.DESCENDANT,
ancestor: n,
descendant: i
}), Ao(t, e, r), t.compoundCount++, i;
} else if (t.currentSubject === e) {
var a = rr(), o = t[t.length - 1], s = rr(), c = rr(), l = rr(), u = rr();
return a.checks.push({
type: rt.COMPOUND_SPLIT,
left: o,
right: s,
subject: c
}), c.checks = e.checks, e.checks = [{
type: rt.TRUE
}], u.checks.push({
type: rt.TRUE
}), s.checks.push({
type: rt.ANCESTOR,
// type is swapped on right side queries
ancestor: u,
descendant: l
// empty for now
}), Ao(t, o, a), t.currentSubject = c, t.compoundCount++, l;
} else {
var d = rr(), h = rr(), f = [{
type: rt.ANCESTOR,
ancestor: d,
descendant: h
}];
return d.checks = e.checks, e.checks = f, t.compoundCount++, h;
}
}
}, {
name: "subject",
modifier: !0,
regex: Ut.subject,
populate: function(t, e) {
if (t.currentSubject != null && t.currentSubject !== e)
return Zt("Redefinition of subject in selector `" + t.toString() + "`"), !1;
t.currentSubject = e;
var r = t[t.length - 1], i = r.checks[0], n = i == null ? null : i.type;
n === rt.DIRECTED_EDGE ? i.type = rt.NODE_TARGET : n === rt.UNDIRECTED_EDGE && (i.type = rt.NODE_NEIGHBOR, i.node = i.nodes[1], i.neighbor = i.nodes[0], i.nodes = null);
}
}];
Ay.forEach(function(t) {
return t.regexObj = new RegExp("^" + t.regex);
});
var Z9 = function(t) {
for (var e, r, i, n = 0; n < Ay.length; n++) {
var a = Ay[n], o = a.name, s = t.match(a.regexObj);
if (s != null) {
r = s, e = a, i = o;
var c = s[0];
t = t.substring(c.length);
break;
}
}
return {
expr: e,
match: r,
name: i,
remaining: t
};
}, Y9 = function(t) {
var e = t.match(/^\s+/);
if (e) {
var r = e[0];
t = t.substring(r.length);
}
return t;
}, K9 = function(t) {
var e = this, r = e.inputText = t, i = e[0] = rr();
for (e.length = 1, r = Y9(r); ; ) {
var n = Z9(r);
if (n.expr == null)
return Zt("The selector `" + t + "`is invalid"), !1;
var a = n.match.slice(1), o = n.expr.populate(e, i, a);
if (o === !1)
return !1;
if (o != null && (i = o), r = n.remaining, r.match(/^\s*$/))
break;
}
var s = e[e.length - 1];
e.currentSubject != null && (s.subject = e.currentSubject), s.edgeCount = e.edgeCount, s.compoundCount = e.compoundCount;
for (var c = 0; c < e.length; c++) {
var l = e[c];
if (l.compoundCount > 0 && l.edgeCount > 0)
return Zt("The selector `" + t + "` is invalid because it uses both a compound selector and an edge selector"), !1;
if (l.edgeCount > 1)
return Zt("The selector `" + t + "` is invalid because it uses multiple edge selectors"), !1;
l.edgeCount === 1 && Zt("The selector `" + t + "` 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 !0;
}, J9 = function() {
if (this.toStringCache != null)
return this.toStringCache;
for (var t = function(c) {
return c ?? "";
}, e = function(c) {
return dt(c) ? '"' + c + '"' : t(c);
}, r = function(c) {
return " " + c + " ";
}, i = function(c, l) {
var u = c.type, d = c.value;
switch (u) {
case rt.GROUP: {
var h = t(d);
return h.substring(0, h.length - 1);
}
case rt.DATA_COMPARE: {
var f = c.field, p = c.operator;
return "[" + f + r(t(p)) + e(d) + "]";
}
case rt.DATA_BOOL: {
var m = c.operator, y = c.field;
return "[" + t(m) + y + "]";
}
case rt.DATA_EXIST: {
var g = c.field;
return "[" + g + "]";
}
case rt.META_COMPARE: {
var v = c.operator, x = c.field;
return "[[" + x + r(t(v)) + e(d) + "]]";
}
case rt.STATE:
return d;
case rt.ID:
return "#" + d;
case rt.CLASS:
return "." + d;
case rt.PARENT:
case rt.CHILD:
return n(c.parent, l) + r(">") + n(c.child, l);
case rt.ANCESTOR:
case rt.DESCENDANT:
return n(c.ancestor, l) + " " + n(c.descendant, l);
case rt.COMPOUND_SPLIT: {
var w = n(c.left, l), S = n(c.subject, l), _ = n(c.right, l);
return w + (w.length > 0 ? " " : "") + S + _;
}
case rt.TRUE:
return "";
}
}, n = function(c, l) {
return c.checks.reduce(function(u, d, h) {
return u + (l === c && h === 0 ? "$" : "") + i(d, l);
}, "");
}, a = "", o = 0; o < this.length; o++) {
var s = this[o];
a += n(s, s.subject), this.length > 1 && o < this.length - 1 && (a += ", ");
}
return this.toStringCache = a, a;
}, Q9 = {
parse: K9,
toString: J9
}, t3 = function(t, e, r) {
var i, n = dt(t), a = Xe(t), o = dt(r), s, c, l = !1, u = !1, d = !1;
switch (e.indexOf("!") >= 0 && (e = e.replace("!", ""), u = !0), e.indexOf("@") >= 0 && (e = e.replace("@", ""), l = !0), (n || o || l) && (s = !n && !a ? "" : "" + t, c = "" + r), l && (t = s = s.toLowerCase(), r = c = c.toLowerCase()), e) {
case "*=":
i = s.indexOf(c) >= 0;
break;
case "$=":
i = s.indexOf(c, s.length - c.length) >= 0;
break;
case "^=":
i = s.indexOf(c) === 0;
break;
case "=":
i = t === r;
break;
case ">":
d = !0, i = t > r;
break;
case ">=":
d = !0, i = t >= r;
break;
case "<":
d = !0, i = t < r;
break;
case "<=":
d = !0, i = t <= r;
break;
default:
i = !1;
break;
}
return u && (t != null || !d) && (i = !i), i;
}, eW = function(t, e) {
switch (e) {
case "?":
return !!t;
case "!":
return !t;
case "^":
return t === void 0;
}
}, tW = function(t) {
return t !== void 0;
}, $b = function(t, e) {
return t.data(e);
}, rW = function(t, e) {
return t[e]();
}, Ar = [], fr = function(t, e) {
return t.checks.every(function(r) {
return Ar[r.type](r, e);
});
};
Ar[rt.GROUP] = function(t, e) {
var r = t.value;
return r === "*" || r === e.group();
};
Ar[rt.STATE] = function(t, e) {
var r = t.value;
return q9(r, e);
};
Ar[rt.ID] = function(t, e) {
var r = t.value;
return e.id() === r;
};
Ar[rt.CLASS] = function(t, e) {
var r = t.value;
return e.hasClass(r);
};
Ar[rt.META_COMPARE] = function(t, e) {
var r = t.field, i = t.operator, n = t.value;
return t3(rW(e, r), i, n);
};
Ar[rt.DATA_COMPARE] = function(t, e) {
var r = t.field, i = t.operator, n = t.value;
return t3($b(e, r), i, n);
};
Ar[rt.DATA_BOOL] = function(t, e) {
var r = t.field, i = t.operator;
return eW($b(e, r), i);
};
Ar[rt.DATA_EXIST] = function(t, e) {
var r = t.field;
return t.operator, tW($b(e, r));
};
Ar[rt.UNDIRECTED_EDGE] = function(t, e) {
var r = t.nodes[0], i = t.nodes[1], n = e.source(), a = e.target();
return fr(r, n) && fr(i, a) || fr(i, n) && fr(r, a);
};
Ar[rt.NODE_NEIGHBOR] = function(t, e) {
return fr(t.node, e) && e.neighborhood().some(function(r) {
return r.isNode() && fr(t.neighbor, r);
});
};
Ar[rt.DIRECTED_EDGE] = function(t, e) {
return fr(t.source, e.source()) && fr(t.target, e.target());
};
Ar[rt.NODE_SOURCE] = function(t, e) {
return fr(t.source, e) && e.outgoers().some(function(r) {
return r.isNode() && fr(t.target, r);
});
};
Ar[rt.NODE_TARGET] = function(t, e) {
return fr(t.target, e) && e.incomers().some(function(r) {
return r.isNode() && fr(t.source, r);
});
};
Ar[rt.CHILD] = function(t, e) {
return fr(t.child, e) && fr(t.parent, e.parent());
};
Ar[rt.PARENT] = function(t, e) {
return fr(t.parent, e) && e.children().some(function(r) {
return fr(t.child, r);
});
};
Ar[rt.DESCENDANT] = function(t, e) {
return fr(t.descendant, e) && e.ancestors().some(function(r) {
return fr(t.ancestor, r);
});
};
Ar[rt.ANCESTOR] = function(t, e) {
return fr(t.ancestor, e) && e.descendants().some(function(r) {
return fr(t.descendant, r);
});
};
Ar[rt.COMPOUND_SPLIT] = function(t, e) {
return fr(t.subject, e) && fr(t.left, e) && fr(t.right, e);
};
Ar[rt.TRUE] = function() {
return !0;
};
Ar[rt.COLLECTION] = function(t, e) {
var r = t.value;
return r.has(e);
};
Ar[rt.FILTER] = function(t, e) {
var r = t.value;
return r(e);
};
var iW = function(t) {
var e = this;
if (e.length === 1 && e[0].checks.length === 1 && e[0].checks[0].type === rt.ID)
return t.getElementById(e[0].checks[0].value).collection();
var r = function(i) {
for (var n = 0; n < e.length; n++) {
var a = e[n];
if (fr(a, i))
return !0;
}
return !1;
};
return e.text() == null && (r = function() {
return !0;
}), t.filter(r);
}, nW = function(t) {
for (var e = this, r = 0; r < e.length; r++) {
var i = e[r];
if (fr(i, t))
return !0;
}
return !1;
}, aW = {
matches: nW,
filter: iW
}, ps = function(t) {
this.inputText = t, this.currentSubject = null, this.compoundCount = 0, this.edgeCount = 0, this.length = 0, t == null || dt(t) && t.match(/^\s*$/) || (on(t) ? this.addQuery({
checks: [{
type: rt.COLLECTION,
value: t.collection()
}]
}) : xr(t) ? this.addQuery({
checks: [{
type: rt.FILTER,
value: t
}]
}) : dt(t) ? this.parse(t) || (this.invalid = !0) : Tr("A selector must be created from a string; found "));
}, fs = ps.prototype;
[Q9, aW].forEach(function(t) {
return bt(fs, t);
});
fs.text = function() {
return this.inputText;
};
fs.size = function() {
return this.length;
};
fs.eq = function(t) {
return this[t];
};
fs.sameText = function(t) {
return !this.invalid && !t.invalid && this.text() === t.text();
};
fs.addQuery = function(t) {
this[this.length++] = t;
};
fs.selector = fs.toString;
var rs = {
allAre: function(t) {
var e = new ps(t);
return this.every(function(r) {
return e.matches(r);
});
},
is: function(t) {
var e = new ps(t);
return this.some(function(r) {
return e.matches(r);
});
},
some: function(t, e) {
for (var r = 0; r < this.length; r++) {
var i = e ? t.apply(e, [this[r], r, this]) : t(this[r], r, this);
if (i)
return !0;
}
return !1;
},
every: function(t, e) {
for (var r = 0; r < this.length; r++) {
var i = e ? t.apply(e, [this[r], r, this]) : t(this[r], r, this);
if (!i)
return !1;
}
return !0;
},
same: function(t) {
if (this === t)
return !0;
t = this.cy().collection(t);
var e = this.length, r = t.length;
return e !== r ? !1 : e === 1 ? this[0] === t[0] : this.every(function(i) {
return t.hasElementWithId(i.id());
});
},
anySame: function(t) {
return t = this.cy().collection(t), this.some(function(e) {
return t.hasElementWithId(e.id());
});
},
allAreNeighbors: function(t) {
t = this.cy().collection(t);
var e = this.neighborhood();
return t.every(function(r) {
return e.hasElementWithId(r.id());
});
},
contains: function(t) {
t = this.cy().collection(t);
var e = this;
return t.every(function(r) {
return e.hasElementWithId(r.id());
});
}
};
rs.allAreNeighbours = rs.allAreNeighbors;
rs.has = rs.contains;
rs.equal = rs.equals = rs.same;
var wn = function(t, e) {
return function(r, i, n, a) {
var o = r, s = this, c;
if (o == null ? c = "" : on(o) && o.length === 1 && (c = o.id()), s.length === 1 && c) {
var l = s[0]._private, u = l.traversalCache = l.traversalCache || {}, d = u[e] = u[e] || [], h = wl(c), f = d[h];
return f || (d[h] = t.call(s, r, i, n, a));
} else
return t.call(s, r, i, n, a);
};
}, au = {
parent: function(t) {
var e = [];
if (this.length === 1) {
var r = this[0]._private.parent;
if (r)
return r;
}
for (var i = 0; i < this.length; i++) {
var n = this[i], a = n._private.parent;
a && e.push(a);
}
return this.spawn(e, !0).filter(t);
},
parents: function(t) {
for (var e = [], r = this.parent(); r.nonempty(); ) {
for (var i = 0; i < r.length; i++) {
var n = r[i];
e.push(n);
}
r = r.parent();
}
return this.spawn(e, !0).filter(t);
},
commonAncestors: function(t) {
for (var e, r = 0; r < this.length; r++) {
var i = this[r], n = i.parents();
e = e || n, e = e.intersect(n);
}
return e.filter(t);
},
orphans: function(t) {
return this.stdFilter(function(e) {
return e.isOrphan();
}).filter(t);
},
nonorphans: function(t) {
return this.stdFilter(function(e) {
return e.isChild();
}).filter(t);
},
children: wn(function(t) {
for (var e = [], r = 0; r < this.length; r++)
for (var i = this[r], n = i._private.children, a = 0; a < n.length; a++)
e.push(n[a]);
return this.spawn(e, !0).filter(t);
}, "children"),
siblings: function(t) {
return this.parent().children().not(this).filter(t);
},
isParent: function() {
var t = this[0];
if (t)
return t.isNode() && t._private.children.length !== 0;
},
isChildless: function() {
var t = this[0];
if (t)
return t.isNode() && t._private.children.length === 0;
},
isChild: function() {
var t = this[0];
if (t)
return t.isNode() && t._private.parent != null;
},
isOrphan: function() {
var t = this[0];
if (t)
return t.isNode() && t._private.parent == null;
},
descendants: function(t) {
var e = [];
function r(i) {
for (var n = 0; n < i.length; n++) {
var a = i[n];
e.push(a), a.children().nonempty() && r(a.children());
}
}
return r(this.children()), this.spawn(e, !0).filter(t);
}
};
function Vb(t, e, r, i) {
for (var n = [], a = new Nu(), o = t.cy(), s = o.hasCompoundNodes(), c = 0; c < t.length; c++) {
var l = t[c];
r ? n.push(l) : s && i(n, a, l);
}
for (; n.length > 0; ) {
var u = n.shift();
e(u), a.add(u.id()), s && i(n, a, u);
}
return t;
}
function r3(t, e, r) {
if (r.isParent())
for (var i = r._private.children, n = 0; n < i.length; n++) {
var a = i[n];
e.has(a.id()) || t.push(a);
}
}
au.forEachDown = function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
return Vb(this, t, e, r3);
};
function i3(t, e, r) {
if (r.isChild()) {
var i = r._private.parent;
e.has(i.id()) || t.push(i);
}
}
au.forEachUp = function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
return Vb(this, t, e, i3);
};
function oW(t, e, r) {
i3(t, e, r), r3(t, e, r);
}
au.forEachUpAndDown = function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
return Vb(this, t, e, oW);
};
au.ancestors = au.parents;
var wh, n3;
wh = n3 = {
data: Xt.data({
field: "data",
bindingEvent: "data",
allowBinding: !0,
allowSetting: !0,
settingEvent: "data",
settingTriggersEvent: !0,
triggerFnName: "trigger",
allowGetting: !0,
immutableKeys: {
id: !0,
source: !0,
target: !0,
parent: !0
},
updateStyle: !0
}),
removeData: Xt.removeData({
field: "data",
event: "data",
triggerFnName: "trigger",
triggerEvent: !0,
immutableKeys: {
id: !0,
source: !0,
target: !0,
parent: !0
},
updateStyle: !0
}),
scratch: Xt.data({
field: "scratch",
bindingEvent: "scratch",
allowBinding: !0,
allowSetting: !0,
settingEvent: "scratch",
settingTriggersEvent: !0,
triggerFnName: "trigger",
allowGetting: !0,
updateStyle: !0
}),
removeScratch: Xt.removeData({
field: "scratch",
event: "scratch",
triggerFnName: "trigger",
triggerEvent: !0,
updateStyle: !0
}),
rscratch: Xt.data({
field: "rscratch",
allowBinding: !1,
allowSetting: !0,
settingTriggersEvent: !1,
allowGetting: !0
}),
removeRscratch: Xt.removeData({
field: "rscratch",
triggerEvent: !1
}),
id: function() {
var t = this[0];
if (t)
return t._private.data.id;
}
};
wh.attr = wh.data;
wh.removeAttr = wh.removeData;
var sW = n3, Rg = {};
function Wv(t) {
return function(e) {
var r = this;
if (e === void 0 && (e = !0), r.length !== 0)
if (r.isNode() && !r.removed()) {
for (var i = 0, n = r[0], a = n._private.edges, o = 0; o < a.length; o++) {
var s = a[o];
!e && s.isLoop() || (i += t(n, s));
}
return i;
} else
return;
};
}
bt(Rg, {
degree: Wv(function(t, e) {
return e.source().same(e.target()) ? 2 : 1;
}),
indegree: Wv(function(t, e) {
return e.target().same(t) ? 1 : 0;
}),
outdegree: Wv(function(t, e) {
return e.source().same(t) ? 1 : 0;
})
});
function tc(t, e) {
return function(r) {
for (var i, n = this.nodes(), a = 0; a < n.length; a++) {
var o = n[a], s = o[t](r);
s !== void 0 && (i === void 0 || e(s, i)) && (i = s);
}
return i;
};
}
bt(Rg, {
minDegree: tc("degree", function(t, e) {
return t < e;
}),
maxDegree: tc("degree", function(t, e) {
return t > e;
}),
minIndegree: tc("indegree", function(t, e) {
return t < e;
}),
maxIndegree: tc("indegree", function(t, e) {
return t > e;
}),
minOutdegree: tc("outdegree", function(t, e) {
return t < e;
}),
maxOutdegree: tc("outdegree", function(t, e) {
return t > e;
})
});
bt(Rg, {
totalDegree: function(t) {
for (var e = 0, r = this.nodes(), i = 0; i < r.length; i++)
e += r[i].degree(t);
return e;
}
});
var jn, a3, o3 = function(t, e, r) {
for (var i = 0; i < t.length; i++) {
var n = t[i];
if (!n.locked()) {
var a = n._private.position, o = {
x: e.x != null ? e.x - a.x : 0,
y: e.y != null ? e.y - a.y : 0
};
n.isParent() && !(o.x === 0 && o.y === 0) && n.children().shift(o, r), n.dirtyBoundingBoxCache();
}
}
}, T_ = {
field: "position",
bindingEvent: "position",
allowBinding: !0,
allowSetting: !0,
settingEvent: "position",
settingTriggersEvent: !0,
triggerFnName: "emitAndNotify",
allowGetting: !0,
validKeys: ["x", "y"],
beforeGet: function(t) {
t.updateCompoundBounds();
},
beforeSet: function(t, e) {
o3(t, e, !1);
},
onSet: function(t) {
t.dirtyCompoundBoundsCache();
},
canSet: function(t) {
return !t.locked();
}
};
jn = a3 = {
position: Xt.data(T_),
// position but no notification to renderer
silentPosition: Xt.data(bt({}, T_, {
allowBinding: !1,
allowSetting: !0,
settingTriggersEvent: !1,
allowGetting: !1,
beforeSet: function(t, e) {
o3(t, e, !0);
},
onSet: function(t) {
t.dirtyCompoundBoundsCache();
}
})),
positions: function(t, e) {
if (Gt(t))
e ? this.silentPosition(t) : this.position(t);
else if (xr(t)) {
var r = t, i = this.cy();
i.startBatch();
for (var n = 0; n < this.length; n++) {
var a = this[n], o = void 0;
(o = r(a, n)) && (e ? a.silentPosition(o) : a.position(o));
}
i.endBatch();
}
return this;
},
silentPositions: function(t) {
return this.positions(t, !0);
},
shift: function(t, e, r) {
var i;
if (Gt(t) ? (i = {
x: Xe(t.x) ? t.x : 0,
y: Xe(t.y) ? t.y : 0
}, r = e) : dt(t) && Xe(e) && (i = {
x: 0,
y: 0
}, i[t] = e), i != null) {
var n = this.cy();
n.startBatch();
for (var a = 0; a < this.length; a++) {
var o = this[a];
if (!(n.hasCompoundNodes() && o.isChild() && o.ancestors().anySame(this))) {
var s = o.position(), c = {
x: s.x + i.x,
y: s.y + i.y
};
r ? o.silentPosition(c) : o.position(c);
}
}
n.endBatch();
}
return this;
},
silentShift: function(t, e) {
return Gt(t) ? this.shift(t, !0) : dt(t) && Xe(e) && this.shift(t, e, !0), this;
},
// get/set the rendered (i.e. on screen) positon of the element
renderedPosition: function(t, e) {
var r = this[0], i = this.cy(), n = i.zoom(), a = i.pan(), o = Gt(t) ? t : void 0, s = o !== void 0 || e !== void 0 && dt(t);
if (r && r.isNode())
if (s)
for (var c = 0; c < this.length; c++) {
var l = this[c];
e !== void 0 ? l.position(t, (e - a[t]) / n) : o !== void 0 && l.position(RA(o, n, a));
}
else {
var u = r.position();
return o = Cg(u, n, a), t === void 0 ? o : o[t];
}
else if (!s)
return;
return this;
},
// get/set the position relative to the parent
relativePosition: function(t, e) {
var r = this[0], i = this.cy(), n = Gt(t) ? t : void 0, a = n !== void 0 || e !== void 0 && dt(t), o = i.hasCompoundNodes();
if (r && r.isNode())
if (a)
for (var s = 0; s < this.length; s++) {
var c = this[s], l = o ? c.parent() : null, u = l && l.length > 0, d = u;
u && (l = l[0]);
var h = d ? l.position() : {
x: 0,
y: 0
};
e !== void 0 ? c.position(t, e + h[t]) : n !== void 0 && c.position({
x: n.x + h.x,
y: n.y + h.y
});
}
else {
var f = r.position(), p = o ? r.parent() : null, m = p && p.length > 0, y = m;
m && (p = p[0]);
var g = y ? p.position() : {
x: 0,
y: 0
};
return n = {
x: f.x - g.x,
y: f.y - g.y
}, t === void 0 ? n : n[t];
}
else if (!a)
return;
return this;
}
};
jn.modelPosition = jn.point = jn.position;
jn.modelPositions = jn.points = jn.positions;
jn.renderedPoint = jn.renderedPosition;
jn.relativePoint = jn.relativePosition;
var lW = a3, jc, As;
jc = As = {};
As.renderedBoundingBox = function(t) {
var e = this.boundingBox(t), r = this.cy(), i = r.zoom(), n = r.pan(), a = e.x1 * i + n.x, o = e.x2 * i + n.x, s = e.y1 * i + n.y, c = e.y2 * i + n.y;
return {
x1: a,
x2: o,
y1: s,
y2: c,
w: o - a,
h: c - s
};
};
As.dirtyCompoundBoundsCache = function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = this.cy();
return !e.styleEnabled() || !e.hasCompoundNodes() ? this : (this.forEachUp(function(r) {
if (r.isParent()) {
var i = r._private;
i.compoundBoundsClean = !1, i.bbCache = null, t || r.emitAndNotify("bounds");
}
}), this);
};
As.updateCompoundBounds = function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = this.cy();
if (!e.styleEnabled() || !e.hasCompoundNodes())
return this;
if (!t && e.batching())
return this;
function r(o) {
if (!o.isParent())
return;
var s = o._private, c = o.children(), l = o.pstyle("compound-sizing-wrt-labels").value === "include", u = {
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 = c.boundingBox({
includeLabels: l,
includeOverlays: !1,
// updating the compound bounds happens outside of the regular
// cache cycle (i.e. before fired events)
useCache: !1
}), h = s.position;
(d.w === 0 || d.h === 0) && (d = {
w: o.pstyle("width").pfValue,
h: o.pstyle("height").pfValue
}, d.x1 = h.x - d.w / 2, d.x2 = h.x + d.w / 2, d.y1 = h.y - d.h / 2, d.y2 = h.y + d.h / 2);
function f(E, C, L) {
var A = 0, k = 0, P = C + L;
return E > 0 && P > 0 && (A = C / P * E, k = L / P * E), {
biasDiff: A,
biasComplementDiff: k
};
}
function p(E, C, L, A) {
if (L.units === "%")
switch (A) {
case "width":
return E > 0 ? L.pfValue * E : 0;
case "height":
return C > 0 ? L.pfValue * C : 0;
case "average":
return E > 0 && C > 0 ? L.pfValue * (E + C) / 2 : 0;
case "min":
return E > 0 && C > 0 ? E > C ? L.pfValue * C : L.pfValue * E : 0;
case "max":
return E > 0 && C > 0 ? E > C ? L.pfValue * E : L.pfValue * C : 0;
default:
return 0;
}
else return L.units === "px" ? L.pfValue : 0;
}
var m = u.width.left.value;
u.width.left.units === "px" && u.width.val > 0 && (m = m * 100 / u.width.val);
var y = u.width.right.value;
u.width.right.units === "px" && u.width.val > 0 && (y = y * 100 / u.width.val);
var g = u.height.top.value;
u.height.top.units === "px" && u.height.val > 0 && (g = g * 100 / u.height.val);
var v = u.height.bottom.value;
u.height.bottom.units === "px" && u.height.val > 0 && (v = v * 100 / u.height.val);
var x = f(u.width.val - d.w, m, y), w = x.biasDiff, S = x.biasComplementDiff, _ = f(u.height.val - d.h, g, v), b = _.biasDiff, T = _.biasComplementDiff;
s.autoPadding = p(d.w, d.h, o.pstyle("padding"), o.pstyle("padding-relative-to").value), s.autoWidth = Math.max(d.w, u.width.val), h.x = (-w + d.x1 + d.x2 + S) / 2, s.autoHeight = Math.max(d.h, u.height.val), h.y = (-b + d.y1 + d.y2 + T) / 2;
}
for (var i = 0; i < this.length; i++) {
var n = this[i], a = n._private;
(!a.compoundBoundsClean || t) && (r(n), e.batching() || (a.compoundBoundsClean = !0));
}
return this;
};
var yn = function(t) {
return t === 1 / 0 || t === -1 / 0 ? 0 : t;
}, zn = function(t, e, r, i, n) {
i - e === 0 || n - r === 0 || e == null || r == null || i == null || n == null || (t.x1 = e < t.x1 ? e : t.x1, t.x2 = i > t.x2 ? i : t.x2, t.y1 = r < t.y1 ? r : t.y1, t.y2 = n > t.y2 ? n : t.y2, t.w = t.x2 - t.x1, t.h = t.y2 - t.y1);
}, Xs = function(t, e) {
return e == null ? t : zn(t, e.x1, e.y1, e.x2, e.y2);
}, fd = function(t, e, r) {
return $n(t, e, r);
}, qp = function(t, e, r) {
if (!e.cy().headless()) {
var i = e._private, n = i.rstyle, a = n.arrowWidth / 2, o = e.pstyle(r + "-arrow-shape").value, s, c;
if (o !== "none") {
r === "source" ? (s = n.srcX, c = n.srcY) : r === "target" ? (s = n.tgtX, c = n.tgtY) : (s = n.midX, c = n.midY);
var l = i.arrowBounds = i.arrowBounds || {}, u = l[r] = l[r] || {};
u.x1 = s - a, u.y1 = c - a, u.x2 = s + a, u.y2 = c + a, u.w = u.x2 - u.x1, u.h = u.y2 - u.y1, sm(u, 1), zn(t, u.x1, u.y1, u.x2, u.y2);
}
}
}, qv = function(t, e, r) {
if (!e.cy().headless()) {
var i;
r ? i = r + "-" : i = "";
var n = e._private, a = n.rstyle, o = e.pstyle(i + "label").strValue;
if (o) {
var s = e.pstyle("text-halign"), c = e.pstyle("text-valign"), l = fd(a, "labelWidth", r), u = fd(a, "labelHeight", r), d = fd(a, "labelX", r), h = fd(a, "labelY", r), f = e.pstyle(i + "text-margin-x").pfValue, p = e.pstyle(i + "text-margin-y").pfValue, m = e.isEdge(), y = e.pstyle(i + "text-rotation"), g = e.pstyle("text-outline-width").pfValue, v = e.pstyle("text-border-width").pfValue, x = v / 2, w = e.pstyle("text-background-padding").pfValue, S = 2, _ = u, b = l, T = b / 2, E = _ / 2, C, L, A, k;
if (m)
C = d - T, L = d + T, A = h - E, k = h + E;
else {
switch (s.value) {
case "left":
C = d - b, L = d;
break;
case "center":
C = d - T, L = d + T;
break;
case "right":
C = d, L = d + b;
break;
}
switch (c.value) {
case "top":
A = h - _, k = h;
break;
case "center":
A = h - E, k = h + E;
break;
case "bottom":
A = h, k = h + _;
break;
}
}
C += f - Math.max(g, x) - w - S, L += f + Math.max(g, x) + w + S, A += p - Math.max(g, x) - w - S, k += p + Math.max(g, x) + w + S;
var P = r || "main", R = n.labelBounds, M = R[P] = R[P] || {};
M.x1 = C, M.y1 = A, M.x2 = L, M.y2 = k, M.w = L - C, M.h = k - A;
var O = m && y.strValue === "autorotate", D = y.pfValue != null && y.pfValue !== 0;
if (O || D) {
var I = O ? fd(n.rstyle, "labelAngle", r) : y.pfValue, F = Math.cos(I), z = Math.sin(I), U = (C + L) / 2, Z = (A + k) / 2;
if (!m) {
switch (s.value) {
case "left":
U = L;
break;
case "right":
U = C;
break;
}
switch (c.value) {
case "top":
Z = k;
break;
case "bottom":
Z = A;
break;
}
}
var re = function(X, ie) {
return X = X - U, ie = ie - Z, {
x: X * F - ie * z + U,
y: X * z + ie * F + Z
};
}, K = re(C, A), V = re(C, k), H = re(L, A), G = re(L, k);
C = Math.min(K.x, V.x, H.x, G.x), L = Math.max(K.x, V.x, H.x, G.x), A = Math.min(K.y, V.y, H.y, G.y), k = Math.max(K.y, V.y, H.y, G.y);
}
var W = P + "Rot", Y = R[W] = R[W] || {};
Y.x1 = C, Y.y1 = A, Y.x2 = L, Y.y2 = k, Y.w = L - C, Y.h = k - A, zn(t, C, A, L, k), zn(n.labelBounds.all, C, A, L, k);
}
return t;
}
}, cW = function(t, e) {
if (!e.cy().headless()) {
var r = e.pstyle("outline-opacity").value, i = e.pstyle("outline-width").value;
if (r > 0 && i > 0) {
var n = e.pstyle("outline-offset").value, a = e.pstyle("shape").value, o = i + n, s = (t.w + o * 2) / t.w, c = (t.h + o * 2) / t.h, l = 0, u = 0;
["diamond", "pentagon", "round-triangle"].includes(a) ? (s = (t.w + o * 2.4) / t.w, u = -o / 3.6) : ["concave-hexagon", "rhomboid", "right-rhomboid"].includes(a) ? s = (t.w + o * 2.4) / t.w : a === "star" ? (s = (t.w + o * 2.8) / t.w, c = (t.h + o * 2.6) / t.h, u = -o / 3.8) : a === "triangle" ? (s = (t.w + o * 2.8) / t.w, c = (t.h + o * 2.4) / t.h, u = -o / 1.4) : a === "vee" && (s = (t.w + o * 4.4) / t.w, c = (t.h + o * 3.8) / t.h, u = -o * 0.5);
var d = t.h * c - t.h, h = t.w * s - t.w;
if (lm(t, [Math.ceil(d / 2), Math.ceil(h / 2)]), l != 0 || u !== 0) {
var f = kj(t, l, u);
DA(t, f);
}
}
}
}, uW = function(t, e) {
var r = t._private.cy, i = r.styleEnabled(), n = r.headless(), a = Yi(), o = t._private, s = t.isNode(), c = t.isEdge(), l, u, d, h, f, p, m = o.rstyle, y = s && i ? t.pstyle("bounds-expansion").pfValue : [0], g = function($) {
return $.pstyle("display").value !== "none";
}, v = !i || g(t) && (!c || g(t.source()) && g(t.target()));
if (v) {
var x = 0, w = 0;
i && e.includeOverlays && (x = t.pstyle("overlay-opacity").value, x !== 0 && (w = t.pstyle("overlay-padding").value));
var S = 0, _ = 0;
i && e.includeUnderlays && (S = t.pstyle("underlay-opacity").value, S !== 0 && (_ = t.pstyle("underlay-padding").value));
var b = Math.max(w, _), T = 0, E = 0;
if (i && (T = t.pstyle("width").pfValue, E = T / 2), s && e.includeNodes) {
var C = t.position();
f = C.x, p = C.y;
var L = t.outerWidth(), A = L / 2, k = t.outerHeight(), P = k / 2;
l = f - A, u = f + A, d = p - P, h = p + P, zn(a, l, d, u, h), i && e.includeOutlines && cW(a, t);
} else if (c && e.includeEdges)
if (i && !n) {
var R = t.pstyle("curve-style").strValue;
if (l = Math.min(m.srcX, m.midX, m.tgtX), u = Math.max(m.srcX, m.midX, m.tgtX), d = Math.min(m.srcY, m.midY, m.tgtY), h = Math.max(m.srcY, m.midY, m.tgtY), l -= E, u += E, d -= E, h += E, zn(a, l, d, u, h), R === "haystack") {
var M = m.haystackPts;
if (M && M.length === 2) {
if (l = M[0].x, d = M[0].y, u = M[1].x, h = M[1].y, l > u) {
var O = l;
l = u, u = O;
}
if (d > h) {
var D = d;
d = h, h = D;
}
zn(a, l - E, d - E, u + E, h + E);
}
} else if (R === "bezier" || R === "unbundled-bezier" || R.endsWith("segments") || R.endsWith("taxi")) {
var I;
switch (R) {
case "bezier":
case "unbundled-bezier":
I = m.bezierPts;
break;
case "segments":
case "taxi":
case "round-segments":
case "round-taxi":
I = m.linePts;
break;
}
if (I != null)
for (var F = 0; F < I.length; F++) {
var z = I[F];
l = z.x - E, u = z.x + E, d = z.y - E, h = z.y + E, zn(a, l, d, u, h);
}
}
} else {
var U = t.source(), Z = U.position(), re = t.target(), K = re.position();
if (l = Z.x, u = K.x, d = Z.y, h = K.y, l > u) {
var V = l;
l = u, u = V;
}
if (d > h) {
var H = d;
d = h, h = H;
}
l -= E, u += E, d -= E, h += E, zn(a, l, d, u, h);
}
if (i && e.includeEdges && c && (qp(a, t, "mid-source"), qp(a, t, "mid-target"), qp(a, t, "source"), qp(a, t, "target")), i) {
var G = t.pstyle("ghost").value === "yes";
if (G) {
var W = t.pstyle("ghost-offset-x").pfValue, Y = t.pstyle("ghost-offset-y").pfValue;
zn(a, a.x1 + W, a.y1 + Y, a.x2 + W, a.y2 + Y);
}
}
var X = o.bodyBounds = o.bodyBounds || {};
a_(X, a), lm(X, y), sm(X, 1), i && (l = a.x1, u = a.x2, d = a.y1, h = a.y2, zn(a, l - b, d - b, u + b, h + b));
var ie = o.overlayBounds = o.overlayBounds || {};
a_(ie, a), lm(ie, y), sm(ie, 1);
var ue = o.labelBounds = o.labelBounds || {};
ue.all != null ? Lj(ue.all) : ue.all = Yi(), i && e.includeLabels && (e.includeMainLabels && qv(a, t, null), c && (e.includeSourceLabels && qv(a, t, "source"), e.includeTargetLabels && qv(a, t, "target")));
}
return a.x1 = yn(a.x1), a.y1 = yn(a.y1), a.x2 = yn(a.x2), a.y2 = yn(a.y2), a.w = yn(a.x2 - a.x1), a.h = yn(a.y2 - a.y1), a.w > 0 && a.h > 0 && v && (lm(a, y), sm(a, 1)), a;
}, s3 = function(t) {
var e = 0, r = function(n) {
return (n ? 1 : 0) << e++;
}, i = 0;
return i += r(t.incudeNodes), i += r(t.includeEdges), i += r(t.includeLabels), i += r(t.includeMainLabels), i += r(t.includeSourceLabels), i += r(t.includeTargetLabels), i += r(t.includeOverlays), i += r(t.includeOutlines), i;
}, l3 = function(t) {
if (t.isEdge()) {
var e = t.source().position(), r = t.target().position(), i = function(n) {
return Math.round(n);
};
return XU([i(e.x), i(e.y), i(r.x), i(r.y)]);
} else
return 0;
}, C_ = function(t, e) {
var r = t._private, i, n = t.isEdge(), a = e == null ? A_ : s3(e), o = a === A_, s = l3(t), c = r.bbCachePosKey === s, l = e.useCache && c, u = function(f) {
return f._private.bbCache == null || f._private.styleDirty;
}, d = !l || u(t) || n && u(t.source()) || u(t.target());
if (d ? (c || t.recalculateRenderedStyle(l), i = uW(t, _h), r.bbCache = i, r.bbCachePosKey = s) : i = r.bbCache, !o) {
var h = t.isNode();
i = Yi(), (e.includeNodes && h || e.includeEdges && !h) && (e.includeOverlays ? Xs(i, r.overlayBounds) : Xs(i, r.bodyBounds)), e.includeLabels && (e.includeMainLabels && (!n || e.includeSourceLabels && e.includeTargetLabels) ? Xs(i, r.labelBounds.all) : (e.includeMainLabels && Xs(i, r.labelBounds.mainRot), e.includeSourceLabels && Xs(i, r.labelBounds.sourceRot), e.includeTargetLabels && Xs(i, r.labelBounds.targetRot))), i.w = i.x2 - i.x1, i.h = i.y2 - i.y1;
}
return i;
}, _h = {
includeNodes: !0,
includeEdges: !0,
includeLabels: !0,
includeMainLabels: !0,
includeSourceLabels: !0,
includeTargetLabels: !0,
includeOverlays: !0,
includeUnderlays: !0,
includeOutlines: !0,
useCache: !0
}, A_ = s3(_h), L_ = yi(_h);
As.boundingBox = function(t) {
var e;
if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (t === void 0 || t.useCache === void 0 || t.useCache === !0))
t === void 0 ? t = _h : t = L_(t), e = C_(this[0], t);
else {
e = Yi(), t = t || _h;
var r = L_(t), i = this, n = i.cy(), a = n.styleEnabled();
if (a)
for (var o = 0; o < i.length; o++) {
var s = i[o], c = s._private, l = l3(s), u = c.bbCachePosKey === l, d = r.useCache && u && !c.styleDirty;
s.recalculateRenderedStyle(d);
}
this.updateCompoundBounds(!t.useCache);
for (var h = 0; h < i.length; h++) {
var f = i[h];
Xs(e, C_(f, r));
}
}
return e.x1 = yn(e.x1), e.y1 = yn(e.y1), e.x2 = yn(e.x2), e.y2 = yn(e.y2), e.w = yn(e.x2 - e.x1), e.h = yn(e.y2 - e.y1), e;
};
As.dirtyBoundingBoxCache = function() {
for (var t = 0; t < this.length; t++) {
var e = this[t]._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;
};
As.boundingBoxAt = function(t) {
var e = this.nodes(), r = this.cy(), i = r.hasCompoundNodes(), n = r.collection();
if (i && (n = e.filter(function(l) {
return l.isParent();
}), e = e.not(n)), Gt(t)) {
var a = t;
t = function() {
return a;
};
}
var o = function(l, u) {
return l._private.bbAtOldPos = t(l, u);
}, s = function(l) {
return l._private.bbAtOldPos;
};
r.startBatch(), e.forEach(o).silentPositions(t), i && (n.dirtyCompoundBoundsCache(), n.dirtyBoundingBoxCache(), n.updateCompoundBounds(!0));
var c = Aj(this.boundingBox({
useCache: !1
}));
return e.silentPositions(s), i && (n.dirtyCompoundBoundsCache(), n.dirtyBoundingBoxCache(), n.updateCompoundBounds(!0)), r.endBatch(), c;
};
jc.boundingbox = jc.bb = jc.boundingBox;
jc.renderedBoundingbox = jc.renderedBoundingBox;
var dW = As, zd, ap;
zd = ap = {};
var c3 = function(t) {
t.uppercaseName = Q2(t.name), t.autoName = "auto" + t.uppercaseName, t.labelName = "label" + t.uppercaseName, t.outerName = "outer" + t.uppercaseName, t.uppercaseOuterName = Q2(t.outerName), zd[t.name] = function() {
var e = this[0], r = e._private, i = r.cy, n = i._private.styleEnabled;
if (e)
if (n) {
if (e.isParent())
return e.updateCompoundBounds(), r[t.autoName] || 0;
var a = e.pstyle(t.name);
switch (a.strValue) {
case "label":
return e.recalculateRenderedStyle(), r.rstyle[t.labelName] || 0;
default:
return a.pfValue;
}
} else
return 1;
}, zd["outer" + t.uppercaseName] = function() {
var e = this[0], r = e._private, i = r.cy, n = i._private.styleEnabled;
if (e)
if (n) {
var a = e[t.name](), o = e.pstyle("border-width").pfValue, s = 2 * e.padding();
return a + o + s;
} else
return 1;
}, zd["rendered" + t.uppercaseName] = function() {
var e = this[0];
if (e) {
var r = e[t.name]();
return r * this.cy().zoom();
}
}, zd["rendered" + t.uppercaseOuterName] = function() {
var e = this[0];
if (e) {
var r = e[t.outerName]();
return r * this.cy().zoom();
}
};
};
c3({
name: "width"
});
c3({
name: "height"
});
ap.padding = function() {
var t = this[0], e = t._private;
return t.isParent() ? (t.updateCompoundBounds(), e.autoPadding !== void 0 ? e.autoPadding : t.pstyle("padding").pfValue) : t.pstyle("padding").pfValue;
};
ap.paddedHeight = function() {
var t = this[0];
return t.height() + 2 * t.padding();
};
ap.paddedWidth = function() {
var t = this[0];
return t.width() + 2 * t.padding();
};
var hW = ap, pW = function(t, e) {
if (t.isEdge())
return e(t);
}, fW = function(t, e) {
if (t.isEdge()) {
var r = t.cy();
return Cg(e(t), r.zoom(), r.pan());
}
}, mW = function(t, e) {
if (t.isEdge()) {
var r = t.cy(), i = r.pan(), n = r.zoom();
return e(t).map(function(a) {
return Cg(a, n, i);
});
}
}, gW = function(t) {
return t.renderer().getControlPoints(t);
}, vW = function(t) {
return t.renderer().getSegmentPoints(t);
}, yW = function(t) {
return t.renderer().getSourceEndpoint(t);
}, bW = function(t) {
return t.renderer().getTargetEndpoint(t);
}, xW = function(t) {
return t.renderer().getEdgeMidpoint(t);
}, k_ = {
controlPoints: {
get: gW,
mult: !0
},
segmentPoints: {
get: vW,
mult: !0
},
sourceEndpoint: {
get: yW
},
targetEndpoint: {
get: bW
},
midpoint: {
get: xW
}
}, wW = function(t) {
return "rendered" + t[0].toUpperCase() + t.substr(1);
}, _W = Object.keys(k_).reduce(function(t, e) {
var r = k_[e], i = wW(e);
return t[e] = function() {
return pW(this, r.get);
}, r.mult ? t[i] = function() {
return mW(this, r.get);
} : t[i] = function() {
return fW(this, r.get);
}, t;
}, {}), SW = bt({}, lW, dW, hW, _W);
/*!
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
*/
var u3 = function(t, e) {
this.recycle(t, e);
};
function md() {
return !1;
}
function Xp() {
return !0;
}
u3.prototype = {
instanceString: function() {
return "event";
},
recycle: function(t, e) {
if (this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = md, t != null && t.preventDefault ? (this.type = t.type, this.isDefaultPrevented = t.defaultPrevented ? Xp : md) : t != null && t.type ? e = t : this.type = t, e != null && (this.originalEvent = e.originalEvent, this.type = e.type != null ? e.type : this.type, this.cy = e.cy, this.target = e.target, this.position = e.position, this.renderedPosition = e.renderedPosition, this.namespace = e.namespace, this.layout = e.layout), this.cy != null && this.position != null && this.renderedPosition == null) {
var r = this.position, i = this.cy.zoom(), n = this.cy.pan();
this.renderedPosition = {
x: r.x * i + n.x,
y: r.y * i + n.y
};
}
this.timeStamp = t && t.timeStamp || Date.now();
},
preventDefault: function() {
this.isDefaultPrevented = Xp;
var t = this.originalEvent;
t && t.preventDefault && t.preventDefault();
},
stopPropagation: function() {
this.isPropagationStopped = Xp;
var t = this.originalEvent;
t && t.stopPropagation && t.stopPropagation();
},
stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = Xp, this.stopPropagation();
},
isDefaultPrevented: md,
isPropagationStopped: md,
isImmediatePropagationStopped: md
};
var d3 = /^([^.]+)(\.(?:[^.]+))?$/, MW = ".*", h3 = {
qualifierCompare: function(t, e) {
return t === e;
},
eventMatches: function() {
return !0;
},
addEventFields: function() {
},
callbackContext: function(t) {
return t;
},
beforeEmit: function() {
},
afterEmit: function() {
},
bubble: function() {
return !1;
},
parent: function() {
return null;
},
context: null
}, P_ = Object.keys(h3), EW = {};
function Og() {
for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : EW, e = arguments.length > 1 ? arguments[1] : void 0, r = 0; r < P_.length; r++) {
var i = P_[r];
this[i] = t[i] || h3[i];
}
this.context = e || this.context, this.listeners = [], this.emitting = 0;
}
var ms = Og.prototype, p3 = function(t, e, r, i, n, a, o) {
xr(i) && (n = i, i = null), o && (a == null ? a = o : a = bt({}, a, o));
for (var s = ar(r) ? r : r.split(/\s+/), c = 0; c < s.length; c++) {
var l = s[c];
if (!ds(l)) {
var u = l.match(d3);
if (u) {
var d = u[1], h = u[2] ? u[2] : null, f = e(t, l, d, h, i, n, a);
if (f === !1)
break;
}
}
}
}, R_ = function(t, e) {
return t.addEventFields(t.context, e), new u3(e.type, e);
}, TW = function(t, e, r) {
if (H8(r)) {
e(t, r);
return;
} else if (Gt(r)) {
e(t, R_(t, r));
return;
}
for (var i = ar(r) ? r : r.split(/\s+/), n = 0; n < i.length; n++) {
var a = i[n];
if (!ds(a)) {
var o = a.match(d3);
if (o) {
var s = o[1], c = o[2] ? o[2] : null, l = R_(t, {
type: s,
namespace: c,
target: t.context
});
e(t, l);
}
}
}
};
ms.on = ms.addListener = function(t, e, r, i, n) {
return p3(this, function(a, o, s, c, l, u, d) {
xr(u) && a.listeners.push({
event: o,
// full event string
callback: u,
// callback to run
type: s,
// the event type (e.g. 'click')
namespace: c,
// the event namespace (e.g. ".foo")
qualifier: l,
// a restriction on whether to match this emitter
conf: d
// additional configuration
});
}, t, e, r, i, n), this;
};
ms.one = function(t, e, r, i) {
return this.on(t, e, r, i, {
one: !0
});
};
ms.removeListener = ms.off = function(t, e, r, i) {
var n = this;
this.emitting !== 0 && (this.listeners = tj(this.listeners));
for (var a = this.listeners, o = function(c) {
var l = a[c];
p3(n, function(u, d, h, f, p, m) {
if ((l.type === h || t === "*") && (!f && l.namespace !== ".*" || l.namespace === f) && (!p || u.qualifierCompare(l.qualifier, p)) && (!m || l.callback === m))
return a.splice(c, 1), !1;
}, t, e, r, i);
}, s = a.length - 1; s >= 0; s--)
o(s);
return this;
};
ms.removeAllListeners = function() {
return this.removeListener("*");
};
ms.emit = ms.trigger = function(t, e, r) {
var i = this.listeners, n = i.length;
return this.emitting++, ar(e) || (e = [e]), TW(this, function(a, o) {
r != null && (i = [{
event: o.event,
type: o.type,
namespace: o.namespace,
callback: r
}], n = i.length);
for (var s = function(l) {
var u = i[l];
if (u.type === o.type && (!u.namespace || u.namespace === o.namespace || u.namespace === MW) && a.eventMatches(a.context, u, o)) {
var d = [o];
e != null && ij(d, e), a.beforeEmit(a.context, u, o), u.conf && u.conf.one && (a.listeners = a.listeners.filter(function(p) {
return p !== u;
}));
var h = a.callbackContext(a.context, u, o), f = u.callback.apply(h, d);
a.afterEmit(a.context, u, o), f === !1 && (o.stopPropagation(), o.preventDefault());
}
}, c = 0; c < n; c++)
s(c);
a.bubble(a.context) && !o.isPropagationStopped() && a.parent(a.context).emit(o, e);
}, t), this.emitting--, this;
};
var CW = {
qualifierCompare: function(t, e) {
return t == null || e == null ? t == null && e == null : t.sameText(e);
},
eventMatches: function(t, e, r) {
var i = e.qualifier;
return i != null ? t !== r.target && rp(r.target) && i.matches(r.target) : !0;
},
addEventFields: function(t, e) {
e.cy = t.cy(), e.target = t;
},
callbackContext: function(t, e, r) {
return e.qualifier != null ? r.target : t;
},
beforeEmit: function(t, e) {
e.conf && e.conf.once && e.conf.onceCollection.removeListener(e.event, e.qualifier, e.callback);
},
bubble: function() {
return !0;
},
parent: function(t) {
return t.isChild() ? t.parent() : t.cy();
}
}, Zp = function(t) {
return dt(t) ? new ps(t) : t;
}, f3 = {
createEmitter: function() {
for (var t = 0; t < this.length; t++) {
var e = this[t], r = e._private;
r.emitter || (r.emitter = new Og(CW, e));
}
return this;
},
emitter: function() {
return this._private.emitter;
},
on: function(t, e, r) {
for (var i = Zp(e), n = 0; n < this.length; n++) {
var a = this[n];
a.emitter().on(t, i, r);
}
return this;
},
removeListener: function(t, e, r) {
for (var i = Zp(e), n = 0; n < this.length; n++) {
var a = this[n];
a.emitter().removeListener(t, i, r);
}
return this;
},
removeAllListeners: function() {
for (var t = 0; t < this.length; t++) {
var e = this[t];
e.emitter().removeAllListeners();
}
return this;
},
one: function(t, e, r) {
for (var i = Zp(e), n = 0; n < this.length; n++) {
var a = this[n];
a.emitter().one(t, i, r);
}
return this;
},
once: function(t, e, r) {
for (var i = Zp(e), n = 0; n < this.length; n++) {
var a = this[n];
a.emitter().on(t, i, r, {
once: !0,
onceCollection: this
});
}
},
emit: function(t, e) {
for (var r = 0; r < this.length; r++) {
var i = this[r];
i.emitter().emit(t, e);
}
return this;
},
emitAndNotify: function(t, e) {
if (this.length !== 0)
return this.cy().notify(t, this), this.emit(t, e), this;
}
};
Xt.eventAliasesOn(f3);
var m3 = {
nodes: function(t) {
return this.filter(function(e) {
return e.isNode();
}).filter(t);
},
edges: function(t) {
return this.filter(function(e) {
return e.isEdge();
}).filter(t);
},
// internal helper to get nodes and edges as separate collections with single iteration over elements
byGroup: function() {
for (var t = this.spawn(), e = this.spawn(), r = 0; r < this.length; r++) {
var i = this[r];
i.isNode() ? t.push(i) : e.push(i);
}
return {
nodes: t,
edges: e
};
},
filter: function(t, e) {
if (t === void 0)
return this;
if (dt(t) || on(t))
return new ps(t).filter(this);
if (xr(t)) {
for (var r = this.spawn(), i = this, n = 0; n < i.length; n++) {
var a = i[n], o = e ? t.apply(e, [a, n, i]) : t(a, n, i);
o && r.push(a);
}
return r;
}
return this.spawn();
},
not: function(t) {
if (t) {
dt(t) && (t = this.filter(t));
for (var e = this.spawn(), r = 0; r < this.length; r++) {
var i = this[r], n = t.has(i);
n || e.push(i);
}
return e;
} else
return this;
},
absoluteComplement: function() {
var t = this.cy();
return t.mutableElements().not(this);
},
intersect: function(t) {
if (dt(t)) {
var e = t;
return this.filter(e);
}
for (var r = this.spawn(), i = this, n = t, a = this.length < t.length, o = a ? i : n, s = a ? n : i, c = 0; c < o.length; c++) {
var l = o[c];
s.has(l) && r.push(l);
}
return r;
},
xor: function(t) {
var e = this._private.cy;
dt(t) && (t = e.$(t));
var r = this.spawn(), i = this, n = t, a = function(o, s) {
for (var c = 0; c < o.length; c++) {
var l = o[c], u = l._private.data.id, d = s.hasElementWithId(u);
d || r.push(l);
}
};
return a(i, n), a(n, i), r;
},
diff: function(t) {
var e = this._private.cy;
dt(t) && (t = e.$(t));
var r = this.spawn(), i = this.spawn(), n = this.spawn(), a = this, o = t, s = function(c, l, u) {
for (var d = 0; d < c.length; d++) {
var h = c[d], f = h._private.data.id, p = l.hasElementWithId(f);
p ? n.merge(h) : u.push(h);
}
};
return s(a, o, r), s(o, a, i), {
left: r,
right: i,
both: n
};
},
add: function(t) {
var e = this._private.cy;
if (!t)
return this;
if (dt(t)) {
var r = t;
t = e.mutableElements().filter(r);
}
for (var i = this.spawnSelf(), n = 0; n < t.length; n++) {
var a = t[n], o = !this.has(a);
o && i.push(a);
}
return i;
},
// in place merge on calling collection
merge: function(t) {
var e = this._private, r = e.cy;
if (!t)
return this;
if (t && dt(t)) {
var i = t;
t = r.mutableElements().filter(i);
}
for (var n = e.map, a = 0; a < t.length; a++) {
var o = t[a], s = o._private.data.id, c = !n.has(s);
if (c) {
var l = this.length++;
this[l] = o, n.set(s, {
ele: o,
index: l
});
}
}
return this;
},
unmergeAt: function(t) {
var e = this[t], r = e.id(), i = this._private, n = i.map;
this[t] = void 0, n.delete(r);
var a = t === this.length - 1;
if (this.length > 1 && !a) {
var o = this.length - 1, s = this[o], c = s._private.data.id;
this[o] = void 0, this[t] = s, n.set(c, {
ele: s,
index: t
});
}
return this.length--, this;
},
// remove single ele in place in calling collection
unmergeOne: function(t) {
t = t[0];
var e = this._private, r = t._private.data.id, i = e.map, n = i.get(r);
if (!n)
return this;
var a = n.index;
return this.unmergeAt(a), this;
},
// remove eles in place on calling collection
unmerge: function(t) {
var e = this._private.cy;
if (!t)
return this;
if (t && dt(t)) {
var r = t;
t = e.mutableElements().filter(r);
}
for (var i = 0; i < t.length; i++)
this.unmergeOne(t[i]);
return this;
},
unmergeBy: function(t) {
for (var e = this.length - 1; e >= 0; e--) {
var r = this[e];
t(r) && this.unmergeAt(e);
}
return this;
},
map: function(t, e) {
for (var r = [], i = this, n = 0; n < i.length; n++) {
var a = i[n], o = e ? t.apply(e, [a, n, i]) : t(a, n, i);
r.push(o);
}
return r;
},
reduce: function(t, e) {
for (var r = e, i = this, n = 0; n < i.length; n++)
r = t(r, i[n], n, i);
return r;
},
max: function(t, e) {
for (var r = -1 / 0, i, n = this, a = 0; a < n.length; a++) {
var o = n[a], s = e ? t.apply(e, [o, a, n]) : t(o, a, n);
s > r && (r = s, i = o);
}
return {
value: r,
ele: i
};
},
min: function(t, e) {
for (var r = 1 / 0, i, n = this, a = 0; a < n.length; a++) {
var o = n[a], s = e ? t.apply(e, [o, a, n]) : t(o, a, n);
s < r && (r = s, i = o);
}
return {
value: r,
ele: i
};
}
}, Ht = m3;
Ht.u = Ht["|"] = Ht["+"] = Ht.union = Ht.or = Ht.add;
Ht["\\"] = Ht["!"] = Ht["-"] = Ht.difference = Ht.relativeComplement = Ht.subtract = Ht.not;
Ht.n = Ht["&"] = Ht["."] = Ht.and = Ht.intersection = Ht.intersect;
Ht["^"] = Ht["(+)"] = Ht["(-)"] = Ht.symmetricDifference = Ht.symdiff = Ht.xor;
Ht.fnFilter = Ht.filterFn = Ht.stdFilter = Ht.filter;
Ht.complement = Ht.abscomp = Ht.absoluteComplement;
var AW = {
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 t = this[0];
if (t)
return t._private.group;
}
}, g3 = function(t, e) {
var r = t.cy(), i = r.hasCompoundNodes();
function n(l) {
var u = l.pstyle("z-compound-depth");
return u.value === "auto" ? i ? l.zDepth() : 0 : u.value === "bottom" ? -1 : u.value === "top" ? kb : 0;
}
var a = n(t) - n(e);
if (a !== 0)
return a;
function o(l) {
var u = l.pstyle("z-index-compare");
return u.value === "auto" && l.isNode() ? 1 : 0;
}
var s = o(t) - o(e);
if (s !== 0)
return s;
var c = t.pstyle("z-index").value - e.pstyle("z-index").value;
return c !== 0 ? c : t.poolIndex() - e.poolIndex();
}, Fm = {
forEach: function(t, e) {
if (xr(t))
for (var r = this.length, i = 0; i < r; i++) {
var n = this[i], a = e ? t.apply(e, [n, i, this]) : t(n, i, this);
if (a === !1)
break;
}
return this;
},
toArray: function() {
for (var t = [], e = 0; e < this.length; e++)
t.push(this[e]);
return t;
},
slice: function(t, e) {
var r = [], i = this.length;
e == null && (e = i), t == null && (t = 0), t < 0 && (t = i + t), e < 0 && (e = i + e);
for (var n = t; n >= 0 && n < e && n < i; n++)
r.push(this[n]);
return this.spawn(r);
},
size: function() {
return this.length;
},
eq: function(t) {
return this[t] || 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(t) {
if (!xr(t))
return this;
var e = this.toArray().sort(t);
return this.spawn(e);
},
sortByZIndex: function() {
return this.sort(g3);
},
zDepth: function() {
var t = this[0];
if (t) {
var e = t._private, r = e.group;
if (r === "nodes") {
var i = e.data.parent ? t.parents().size() : 0;
return t.isParent() ? i : kb - 1;
} else {
var n = e.source, a = e.target, o = n.zDepth(), s = a.zDepth();
return Math.max(o, s, 0);
}
}
}
};
Fm.each = Fm.forEach;
var LW = function() {
var t = "undefined", e = (typeof Symbol > "u" ? "undefined" : Zr(Symbol)) != t && Zr(Symbol.iterator) != t;
e && (Fm[Symbol.iterator] = function() {
var r = this, i = {
value: void 0,
done: !1
}, n = 0, a = this.length;
return pA({
next: function() {
return n < a ? i.value = r[n++] : (i.value = void 0, i.done = !0), i;
}
}, Symbol.iterator, function() {
return this;
});
});
};
LW();
var kW = yi({
nodeDimensionsIncludeLabels: !1
}), um = {
// Calculates and returns node dimensions { x, y } based on options given
layoutDimensions: function(t) {
t = kW(t);
var e;
if (!this.takesUpSpace())
e = {
w: 0,
h: 0
};
else if (t.nodeDimensionsIncludeLabels) {
var r = this.boundingBox();
e = {
w: r.w,
h: r.h
};
} else
e = {
w: this.outerWidth(),
h: this.outerHeight()
};
return (e.w === 0 || e.h === 0) && (e.w = e.h = 1), e;
},
// using standard layout options, apply position function (w/ or w/o animation)
layoutPositions: function(t, e, r) {
var i = this.nodes().filter(function(w) {
return !w.isParent();
}), n = this.cy(), a = e.eles, o = function(w) {
return w.id();
}, s = fh(r, o);
t.emit({
type: "layoutstart",
layout: t
}), t.animations = [];
var c = function(w, S, _) {
var b = {
x: S.x1 + S.w / 2,
y: S.y1 + S.h / 2
}, T = {
// scale from center of bounding box (not necessarily 0,0)
x: (_.x - b.x) * w,
y: (_.y - b.y) * w
};
return {
x: b.x + T.x,
y: b.y + T.y
};
}, l = e.spacingFactor && e.spacingFactor !== 1, u = function() {
if (!l)
return null;
for (var w = Yi(), S = 0; S < i.length; S++) {
var _ = i[S], b = s(_, S);
Pj(w, b.x, b.y);
}
return w;
}, d = u(), h = fh(function(w, S) {
var _ = s(w, S);
if (l) {
var b = Math.abs(e.spacingFactor);
_ = c(b, d, _);
}
return e.transform != null && (_ = e.transform(w, _)), _;
}, o);
if (e.animate) {
for (var f = 0; f < i.length; f++) {
var p = i[f], m = h(p, f), y = e.animateFilter == null || e.animateFilter(p, f);
if (y) {
var g = p.animation({
position: m,
duration: e.animationDuration,
easing: e.animationEasing
});
t.animations.push(g);
} else
p.position(m);
}
if (e.fit) {
var v = n.animation({
fit: {
boundingBox: a.boundingBoxAt(h),
padding: e.padding
},
duration: e.animationDuration,
easing: e.animationEasing
});
t.animations.push(v);
} else if (e.zoom !== void 0 && e.pan !== void 0) {
var x = n.animation({
zoom: e.zoom,
pan: e.pan,
duration: e.animationDuration,
easing: e.animationEasing
});
t.animations.push(x);
}
t.animations.forEach(function(w) {
return w.play();
}), t.one("layoutready", e.ready), t.emit({
type: "layoutready",
layout: t
}), Bu.all(t.animations.map(function(w) {
return w.promise();
})).then(function() {
t.one("layoutstop", e.stop), t.emit({
type: "layoutstop",
layout: t
});
});
} else
i.positions(h), e.fit && n.fit(e.eles, e.padding), e.zoom != null && n.zoom(e.zoom), e.pan && n.pan(e.pan), t.one("layoutready", e.ready), t.emit({
type: "layoutready",
layout: t
}), t.one("layoutstop", e.stop), t.emit({
type: "layoutstop",
layout: t
});
return this;
},
layout: function(t) {
var e = this.cy();
return e.makeLayout(bt({}, t, {
eles: this
}));
}
};
um.createLayout = um.makeLayout = um.layout;
function v3(t, e, r) {
var i = r._private, n = i.styleCache = i.styleCache || [], a;
return (a = n[t]) != null || (a = n[t] = e(r)), a;
}
function Dg(t, e) {
return t = wl(t), function(r) {
return v3(t, e, r);
};
}
function Ig(t, e) {
t = wl(t);
var r = function(i) {
return e.call(i);
};
return function() {
var i = this[0];
if (i)
return v3(t, r, i);
};
}
var fi = {
recalculateRenderedStyle: function(t) {
var e = this.cy(), r = e.renderer(), i = e.styleEnabled();
return r && i && r.recalculateRenderedStyle(this, t), this;
},
dirtyStyleCache: function() {
var t = this.cy(), e = function(i) {
return i._private.styleCache = null;
};
if (t.hasCompoundNodes()) {
var r;
r = this.spawnSelf().merge(this.descendants()).merge(this.parents()), r.merge(r.connectedEdges()), r.forEach(e);
} else
this.forEach(function(i) {
e(i), i.connectedEdges().forEach(e);
});
return this;
},
// fully updates (recalculates) the style for the elements
updateStyle: function(t) {
var e = this._private.cy;
if (!e.styleEnabled())
return this;
if (e.batching()) {
var r = e._private.batchStyleEles;
return r.merge(this), this;
}
var i = e.hasCompoundNodes(), n = this;
t = !!(t || t === void 0), i && (n = this.spawnSelf().merge(this.descendants()).merge(this.parents()));
var a = n;
return t ? a.emitAndNotify("style") : a.emit("style"), n.forEach(function(o) {
return o._private.styleDirty = !0;
}), this;
},
// private: clears dirty flag and recalculates style
cleanStyle: function() {
var t = this.cy();
if (t.styleEnabled())
for (var e = 0; e < this.length; e++) {
var r = this[e];
r._private.styleDirty && (r._private.styleDirty = !1, t.style().apply(r));
}
},
// get the internal parsed style object for the specified property
parsedStyle: function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, r = this[0], i = r.cy();
if (i.styleEnabled() && r) {
this.cleanStyle();
var n = r._private.style[t];
return n ?? (e ? i.style().getDefaultProperty(t) : null);
}
},
numericStyle: function(t) {
var e = this[0];
if (e.cy().styleEnabled() && e) {
var r = e.pstyle(t);
return r.pfValue !== void 0 ? r.pfValue : r.value;
}
},
numericStyleUnits: function(t) {
var e = this[0];
if (e.cy().styleEnabled() && e)
return e.pstyle(t).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(t) {
var e = this.cy();
if (!e.styleEnabled())
return this;
var r = this[0];
if (r)
return e.style().getRenderedStyle(r, t);
},
// read the calculated css style of the element or override the style (via a bypass)
style: function(t, e) {
var r = this.cy();
if (!r.styleEnabled())
return this;
var i = !1, n = r.style();
if (Gt(t)) {
var a = t;
n.applyBypass(this, a, i), this.emitAndNotify("style");
} else if (dt(t))
if (e === void 0) {
var o = this[0];
return o ? n.getStylePropertyValue(o, t) : void 0;
} else
n.applyBypass(this, t, e, i), this.emitAndNotify("style");
else if (t === void 0) {
var s = this[0];
return s ? n.getRawStyle(s) : void 0;
}
return this;
},
removeStyle: function(t) {
var e = this.cy();
if (!e.styleEnabled())
return this;
var r = !1, i = e.style(), n = this;
if (t === void 0)
for (var a = 0; a < n.length; a++) {
var o = n[a];
i.removeAllBypasses(o, r);
}
else {
t = t.split(/\s+/);
for (var s = 0; s < n.length; s++) {
var c = n[s];
i.removeBypasses(c, t, r);
}
}
return this.emitAndNotify("style"), this;
},
show: function() {
return this.css("display", "element"), this;
},
hide: function() {
return this.css("display", "none"), this;
},
effectiveOpacity: function() {
var t = this.cy();
if (!t.styleEnabled())
return 1;
var e = t.hasCompoundNodes(), r = this[0];
if (r) {
var i = r._private, n = r.pstyle("opacity").value;
if (!e)
return n;
var a = i.data.parent ? r.parents() : null;
if (a)
for (var o = 0; o < a.length; o++) {
var s = a[o], c = s.pstyle("opacity").value;
n = c * n;
}
return n;
}
},
transparent: function() {
var t = this.cy();
if (!t.styleEnabled())
return !1;
var e = this[0], r = e.cy().hasCompoundNodes();
if (e)
return r ? e.effectiveOpacity() === 0 : e.pstyle("opacity").value === 0;
},
backgrounding: function() {
var t = this.cy();
if (!t.styleEnabled())
return !1;
var e = this[0];
return !!e._private.backgrounding;
}
};
function Xv(t, e) {
var r = t._private, i = r.data.parent ? t.parents() : null;
if (i)
for (var n = 0; n < i.length; n++) {
var a = i[n];
if (!e(a))
return !1;
}
return !0;
}
function Ub(t) {
var e = t.ok, r = t.edgeOkViaNode || t.ok, i = t.parentOk || t.ok;
return function() {
var n = this.cy();
if (!n.styleEnabled())
return !0;
var a = this[0], o = n.hasCompoundNodes();
if (a) {
var s = a._private;
if (!e(a))
return !1;
if (a.isNode())
return !o || Xv(a, i);
var c = s.source, l = s.target;
return r(c) && (!o || Xv(c, r)) && (c === l || r(l) && (!o || Xv(l, r)));
}
};
}
var Vu = Dg("eleTakesUpSpace", function(t) {
return t.pstyle("display").value === "element" && t.width() !== 0 && (t.isNode() ? t.height() !== 0 : !0);
});
fi.takesUpSpace = Ig("takesUpSpace", Ub({
ok: Vu
}));
var PW = Dg("eleInteractive", function(t) {
return t.pstyle("events").value === "yes" && t.pstyle("visibility").value === "visible" && Vu(t);
}), RW = Dg("parentInteractive", function(t) {
return t.pstyle("visibility").value === "visible" && Vu(t);
});
fi.interactive = Ig("interactive", Ub({
ok: PW,
parentOk: RW,
edgeOkViaNode: Vu
}));
fi.noninteractive = function() {
var t = this[0];
if (t)
return !t.interactive();
};
var OW = Dg("eleVisible", function(t) {
return t.pstyle("visibility").value === "visible" && t.pstyle("opacity").pfValue !== 0 && Vu(t);
}), DW = Vu;
fi.visible = Ig("visible", Ub({
ok: OW,
edgeOkViaNode: DW
}));
fi.hidden = function() {
var t = this[0];
if (t)
return !t.visible();
};
fi.isBundledBezier = Ig("isBundledBezier", function() {
return this.cy().styleEnabled() ? !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace() : !1;
});
fi.bypass = fi.css = fi.style;
fi.renderedCss = fi.renderedStyle;
fi.removeBypass = fi.removeCss = fi.removeStyle;
fi.pstyle = fi.parsedStyle;
var is = {};
function O_(t) {
return function() {
var e = arguments, r = [];
if (e.length === 2) {
var i = e[0], n = e[1];
this.on(t.event, i, n);
} else if (e.length === 1 && xr(e[0])) {
var a = e[0];
this.on(t.event, a);
} else if (e.length === 0 || e.length === 1 && ar(e[0])) {
for (var o = e.length === 1 ? e[0] : null, s = 0; s < this.length; s++) {
var c = this[s], l = !t.ableField || c._private[t.ableField], u = c._private[t.field] != t.value;
if (t.overrideAble) {
var d = t.overrideAble(c);
if (d !== void 0 && (l = d, !d))
return this;
}
l && (c._private[t.field] = t.value, u && r.push(c));
}
var h = this.spawn(r);
h.updateStyle(), h.emit(t.event), o && h.emit(o);
}
return this;
};
}
function Uu(t) {
is[t.field] = function() {
var e = this[0];
if (e) {
if (t.overrideField) {
var r = t.overrideField(e);
if (r !== void 0)
return r;
}
return e._private[t.field];
}
}, is[t.on] = O_({
event: t.on,
field: t.field,
ableField: t.ableField,
overrideAble: t.overrideAble,
value: !0
}), is[t.off] = O_({
event: t.off,
field: t.field,
ableField: t.ableField,
overrideAble: t.overrideAble,
value: !1
});
}
Uu({
field: "locked",
overrideField: function(t) {
return t.cy().autolock() ? !0 : void 0;
},
on: "lock",
off: "unlock"
});
Uu({
field: "grabbable",
overrideField: function(t) {
return t.cy().autoungrabify() || t.pannable() ? !1 : void 0;
},
on: "grabify",
off: "ungrabify"
});
Uu({
field: "selected",
ableField: "selectable",
overrideAble: function(t) {
return t.cy().autounselectify() ? !1 : void 0;
},
on: "select",
off: "unselect"
});
Uu({
field: "selectable",
overrideField: function(t) {
return t.cy().autounselectify() ? !1 : void 0;
},
on: "selectify",
off: "unselectify"
});
is.deselect = is.unselect;
is.grabbed = function() {
var t = this[0];
if (t)
return t._private.grabbed;
};
Uu({
field: "active",
on: "activate",
off: "unactivate"
});
Uu({
field: "pannable",
on: "panify",
off: "unpanify"
});
is.inactive = function() {
var t = this[0];
if (t)
return !t._private.active;
};
var Ci = {}, D_ = function(t) {
return function(e) {
for (var r = this, i = [], n = 0; n < r.length; n++) {
var a = r[n];
if (a.isNode()) {
for (var o = !1, s = a.connectedEdges(), c = 0; c < s.length; c++) {
var l = s[c], u = l.source(), d = l.target();
if (t.noIncomingEdges && d === a && u !== a || t.noOutgoingEdges && u === a && d !== a) {
o = !0;
break;
}
}
o || i.push(a);
}
}
return this.spawn(i, !0).filter(e);
};
}, I_ = function(t) {
return function(e) {
for (var r = this, i = [], n = 0; n < r.length; n++) {
var a = r[n];
if (a.isNode())
for (var o = a.connectedEdges(), s = 0; s < o.length; s++) {
var c = o[s], l = c.source(), u = c.target();
t.outgoing && l === a ? (i.push(c), i.push(u)) : t.incoming && u === a && (i.push(c), i.push(l));
}
}
return this.spawn(i, !0).filter(e);
};
}, N_ = function(t) {
return function(e) {
for (var r = this, i = [], n = {}; ; ) {
var a = t.outgoing ? r.outgoers() : r.incomers();
if (a.length === 0)
break;
for (var o = !1, s = 0; s < a.length; s++) {
var c = a[s], l = c.id();
n[l] || (n[l] = !0, i.push(c), o = !0);
}
if (!o)
break;
r = a;
}
return this.spawn(i, !0).filter(e);
};
};
Ci.clearTraversalCache = function() {
for (var t = 0; t < this.length; t++)
this[t]._private.traversalCache = null;
};
bt(Ci, {
// get the root nodes in the DAG
roots: D_({
noIncomingEdges: !0
}),
// get the leaf nodes in the DAG
leaves: D_({
noOutgoingEdges: !0
}),
// normally called children in graph theory
// these nodes =edges=> outgoing nodes
outgoers: wn(I_({
outgoing: !0
}), "outgoers"),
// aka DAG descendants
successors: N_({
outgoing: !0
}),
// normally called parents in graph theory
// these nodes <=edges= incoming nodes
incomers: wn(I_({
incoming: !0
}), "incomers"),
// aka DAG ancestors
predecessors: N_({
incoming: !0
})
});
bt(Ci, {
neighborhood: wn(function(t) {
for (var e = [], r = this.nodes(), i = 0; i < r.length; i++)
for (var n = r[i], a = n.connectedEdges(), o = 0; o < a.length; o++) {
var s = a[o], c = s.source(), l = s.target(), u = n === c ? l : c;
u.length > 0 && e.push(u[0]), e.push(s[0]);
}
return this.spawn(e, !0).filter(t);
}, "neighborhood"),
closedNeighborhood: function(t) {
return this.neighborhood().add(this).filter(t);
},
openNeighborhood: function(t) {
return this.neighborhood(t);
}
});
Ci.neighbourhood = Ci.neighborhood;
Ci.closedNeighbourhood = Ci.closedNeighborhood;
Ci.openNeighbourhood = Ci.openNeighborhood;
bt(Ci, {
source: wn(function(t) {
var e = this[0], r;
return e && (r = e._private.source || e.cy().collection()), r && t ? r.filter(t) : r;
}, "source"),
target: wn(function(t) {
var e = this[0], r;
return e && (r = e._private.target || e.cy().collection()), r && t ? r.filter(t) : r;
}, "target"),
sources: B_({
attr: "source"
}),
targets: B_({
attr: "target"
})
});
function B_(t) {
return function(e) {
for (var r = [], i = 0; i < this.length; i++) {
var n = this[i], a = n._private[t.attr];
a && r.push(a);
}
return this.spawn(r, !0).filter(e);
};
}
bt(Ci, {
edgesWith: wn(F_(), "edgesWith"),
edgesTo: wn(F_({
thisIsSrc: !0
}), "edgesTo")
});
function F_(t) {
return function(e) {
var r = [], i = this._private.cy, n = t || {};
dt(e) && (e = i.$(e));
for (var a = 0; a < e.length; a++)
for (var o = e[a]._private.edges, s = 0; s < o.length; s++) {
var c = o[s], l = c._private.data, u = this.hasElementWithId(l.source) && e.hasElementWithId(l.target), d = e.hasElementWithId(l.source) && this.hasElementWithId(l.target), h = u || d;
h && ((n.thisIsSrc || n.thisIsTgt) && (n.thisIsSrc && !u || n.thisIsTgt && !d) || r.push(c));
}
return this.spawn(r, !0);
};
}
bt(Ci, {
connectedEdges: wn(function(t) {
for (var e = [], r = this, i = 0; i < r.length; i++) {
var n = r[i];
if (n.isNode())
for (var a = n._private.edges, o = 0; o < a.length; o++) {
var s = a[o];
e.push(s);
}
}
return this.spawn(e, !0).filter(t);
}, "connectedEdges"),
connectedNodes: wn(function(t) {
for (var e = [], r = this, i = 0; i < r.length; i++) {
var n = r[i];
n.isEdge() && (e.push(n.source()[0]), e.push(n.target()[0]));
}
return this.spawn(e, !0).filter(t);
}, "connectedNodes"),
parallelEdges: wn(z_(), "parallelEdges"),
codirectedEdges: wn(z_({
codirected: !0
}), "codirectedEdges")
});
function z_(t) {
var e = {
codirected: !1
};
return t = bt({}, e, t), function(r) {
for (var i = [], n = this.edges(), a = t, o = 0; o < n.length; o++)
for (var s = n[o], c = s._private, l = c.source, u = l._private.data.id, d = c.data.target, h = l._private.edges, f = 0; f < h.length; f++) {
var p = h[f], m = p._private.data, y = m.target, g = m.source, v = y === d && g === u, x = u === y && d === g;
(a.codirected && v || !a.codirected && (v || x)) && i.push(p);
}
return this.spawn(i, !0).filter(r);
};
}
bt(Ci, {
components: function(t) {
var e = this, r = e.cy(), i = r.collection(), n = t == null ? e.nodes() : t.nodes(), a = [];
t != null && n.empty() && (n = t.sources());
var o = function(c, l) {
i.merge(c), n.unmerge(c), l.merge(c);
};
if (n.empty())
return e.spawn();
var s = function() {
var c = r.collection();
a.push(c);
var l = n[0];
o(l, c), e.bfs({
directed: !1,
roots: l,
visit: function(u) {
return o(u, c);
}
}), c.forEach(function(u) {
u.connectedEdges().forEach(function(d) {
e.has(d) && c.has(d.source()) && c.has(d.target()) && c.merge(d);
});
});
};
do
s();
while (n.length > 0);
return a;
},
component: function() {
var t = this[0];
return t.cy().mutableElements().components(t)[0];
}
});
Ci.componentsOf = Ci.components;
var mi = function(t, e) {
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
if (t === void 0) {
Tr("A collection must have a reference to the core");
return;
}
var n = new ca(), a = !1;
if (!e)
e = [];
else if (e.length > 0 && Gt(e[0]) && !rp(e[0])) {
a = !0;
for (var o = [], s = new Nu(), c = 0, l = e.length; c < l; c++) {
var u = e[c];
u.data == null && (u.data = {});
var d = u.data;
if (d.id == null)
d.id = kA();
else if (t.hasElementWithId(d.id) || s.has(d.id))
continue;
var h = new Tg(t, u, !1);
o.push(h), s.add(d.id);
}
e = o;
}
this.length = 0;
for (var f = 0, p = e.length; f < p; f++) {
var m = e[f][0];
if (m != null) {
var y = m._private.data.id;
(!r || !n.has(y)) && (r && n.set(y, {
index: this.length,
ele: m
}), this[this.length] = m, this.length++);
}
}
this._private = {
eles: this,
cy: t,
get map() {
return this.lazyMap == null && this.rebuildMap(), this.lazyMap;
},
set map(g) {
this.lazyMap = g;
},
rebuildMap: function() {
for (var g = this.lazyMap = new ca(), v = this.eles, x = 0; x < v.length; x++) {
var w = v[x];
g.set(w.id(), {
index: x,
ele: w
});
}
}
}, r && (this._private.map = n), a && !i && this.restore();
}, cr = Tg.prototype = mi.prototype = Object.create(Array.prototype);
cr.instanceString = function() {
return "collection";
};
cr.spawn = function(t, e) {
return new mi(this.cy(), t, e);
};
cr.spawnSelf = function() {
return this.spawn(this);
};
cr.cy = function() {
return this._private.cy;
};
cr.renderer = function() {
return this._private.cy.renderer();
};
cr.element = function() {
return this[0];
};
cr.collection = function() {
return vA(this) ? this : new mi(this._private.cy, [this]);
};
cr.unique = function() {
return new mi(this._private.cy, this, !0);
};
cr.hasElementWithId = function(t) {
return t = "" + t, this._private.map.has(t);
};
cr.getElementById = function(t) {
t = "" + t;
var e = this._private.cy, r = this._private.map.get(t);
return r ? r.ele : new mi(e);
};
cr.$id = cr.getElementById;
cr.poolIndex = function() {
var t = this._private.cy, e = t._private.elements, r = this[0]._private.data.id;
return e._private.map.get(r).index;
};
cr.indexOf = function(t) {
var e = t[0]._private.data.id;
return this._private.map.get(e).index;
};
cr.indexOfId = function(t) {
return t = "" + t, this._private.map.get(t).index;
};
cr.json = function(t) {
var e = this.element(), r = this.cy();
if (e == null && t)
return this;
if (e != null) {
var i = e._private;
if (Gt(t)) {
if (r.startBatch(), t.data) {
e.data(t.data);
var n = i.data;
if (e.isEdge()) {
var a = !1, o = {}, s = t.data.source, c = t.data.target;
s != null && s != n.source && (o.source = "" + s, a = !0), c != null && c != n.target && (o.target = "" + c, a = !0), a && (e = e.move(o));
} else {
var l = "parent" in t.data, u = t.data.parent;
l && (u != null || n.parent != null) && u != n.parent && (u === void 0 && (u = null), u != null && (u = "" + u), e = e.move({
parent: u
}));
}
}
t.position && e.position(t.position);
var d = function(p, m, y) {
var g = t[p];
g != null && g !== i[p] && (g ? e[m]() : e[y]());
};
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"), t.classes != null && e.classes(t.classes), r.endBatch(), this;
} else if (t === void 0) {
var h = {
data: la(i.data),
position: la(i.position),
group: i.group,
removed: i.removed,
selected: i.selected,
selectable: i.selectable,
locked: i.locked,
grabbable: i.grabbable,
pannable: i.pannable,
classes: null
};
h.classes = "";
var f = 0;
return i.classes.forEach(function(p) {
return h.classes += f++ === 0 ? p : " " + p;
}), h;
}
}
};
cr.jsons = function() {
for (var t = [], e = 0; e < this.length; e++) {
var r = this[e], i = r.json();
t.push(i);
}
return t;
};
cr.clone = function() {
for (var t = this.cy(), e = [], r = 0; r < this.length; r++) {
var i = this[r], n = i.json(), a = new Tg(t, n, !1);
e.push(a);
}
return new mi(t, e);
};
cr.copy = cr.clone;
cr.restore = function() {
for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, r = this, i = r.cy(), n = i._private, a = [], o = [], s, c = 0, l = r.length; c < l; c++) {
var u = r[c];
e && !u.removed() || (u.isNode() ? a.push(u) : o.push(u));
}
s = a.concat(o);
var d, h = function() {
s.splice(d, 1), d--;
};
for (d = 0; d < s.length; d++) {
var f = s[d], p = f._private, m = p.data;
if (f.clearTraversalCache(), !(!e && !p.removed)) {
if (m.id === void 0)
m.id = kA();
else if (Xe(m.id))
m.id = "" + m.id;
else if (ds(m.id) || !dt(m.id)) {
Tr("Can not create element with invalid string ID `" + m.id + "`"), h();
continue;
} else if (i.hasElementWithId(m.id)) {
Tr("Can not create second element with ID `" + m.id + "`"), h();
continue;
}
}
var y = m.id;
if (f.isNode()) {
var g = p.position;
g.x == null && (g.x = 0), g.y == null && (g.y = 0);
}
if (f.isEdge()) {
for (var v = f, x = ["source", "target"], w = x.length, S = !1, _ = 0; _ < w; _++) {
var b = x[_], T = m[b];
Xe(T) && (T = m[b] = "" + m[b]), T == null || T === "" ? (Tr("Can not create edge `" + y + "` with unspecified " + b), S = !0) : i.hasElementWithId(T) || (Tr("Can not create edge `" + y + "` with nonexistant " + b + " `" + T + "`"), S = !0);
}
if (S) {
h();
continue;
}
var E = i.getElementById(m.source), C = i.getElementById(m.target);
E.same(C) ? E._private.edges.push(v) : (E._private.edges.push(v), C._private.edges.push(v)), v._private.source = E, v._private.target = C;
}
p.map = new ca(), p.map.set(y, {
ele: f,
index: 0
}), p.removed = !1, e && i.addToPool(f);
}
for (var L = 0; L < a.length; L++) {
var A = a[L], k = A._private.data;
Xe(k.parent) && (k.parent = "" + k.parent);
var P = k.parent, R = P != null;
if (R || A._private.parent) {
var M = A._private.parent ? i.collection().merge(A._private.parent) : i.getElementById(P);
if (M.empty())
k.parent = void 0;
else if (M[0].removed())
Zt("Node added with missing parent, reference to parent removed"), k.parent = void 0, A._private.parent = null;
else {
for (var O = !1, D = M; !D.empty(); ) {
if (A.same(D)) {
O = !0, k.parent = void 0;
break;
}
D = D.parent();
}
O || (M[0]._private.children.push(A), A._private.parent = M[0], n.hasCompoundNodes = !0);
}
}
}
if (s.length > 0) {
for (var I = s.length === r.length ? r : new mi(i, s), F = 0; F < I.length; F++) {
var z = I[F];
z.isNode() || (z.parallelEdges().clearTraversalCache(), z.source().clearTraversalCache(), z.target().clearTraversalCache());
}
var U;
n.hasCompoundNodes ? U = i.collection().merge(I).merge(I.connectedNodes()).merge(I.parent()) : U = I, U.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t), t ? I.emitAndNotify("add") : e && I.emit("add");
}
return r;
};
cr.removed = function() {
var t = this[0];
return t && t._private.removed;
};
cr.inside = function() {
var t = this[0];
return t && !t._private.removed;
};
cr.remove = function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, r = this, i = [], n = {}, a = r._private.cy;
function o(P) {
for (var R = P._private.edges, M = 0; M < R.length; M++)
c(R[M]);
}
function s(P) {
for (var R = P._private.children, M = 0; M < R.length; M++)
c(R[M]);
}
function c(P) {
var R = n[P.id()];
e && P.removed() || R || (n[P.id()] = !0, P.isNode() ? (i.push(P), o(P), s(P)) : i.unshift(P));
}
for (var l = 0, u = r.length; l < u; l++) {
var d = r[l];
c(d);
}
function h(P, R) {
var M = P._private.edges;
hs(M, R), P.clearTraversalCache();
}
function f(P) {
P.clearTraversalCache();
}
var p = [];
p.ids = {};
function m(P, R) {
R = R[0], P = P[0];
var M = P._private.children, O = P.id();
hs(M, R), R._private.parent = null, p.ids[O] || (p.ids[O] = !0, p.push(P));
}
r.dirtyCompoundBoundsCache(), e && a.removeFromPool(i);
for (var y = 0; y < i.length; y++) {
var g = i[y];
if (g.isEdge()) {
var v = g.source()[0], x = g.target()[0];
h(v, g), h(x, g);
for (var w = g.parallelEdges(), S = 0; S < w.length; S++) {
var _ = w[S];
f(_), _.isBundledBezier() && _.dirtyBoundingBoxCache();
}
} else {
var b = g.parent();
b.length !== 0 && m(b, g);
}
e && (g._private.removed = !0);
}
var T = a._private.elements;
a._private.hasCompoundNodes = !1;
for (var E = 0; E < T.length; E++) {
var C = T[E];
if (C.isParent()) {
a._private.hasCompoundNodes = !0;
break;
}
}
var L = new mi(this.cy(), i);
L.size() > 0 && (t ? L.emitAndNotify("remove") : e && L.emit("remove"));
for (var A = 0; A < p.length; A++) {
var k = p[A];
(!e || !k.removed()) && k.updateStyle();
}
return L;
};
cr.move = function(t) {
var e = this._private.cy, r = this, i = !1, n = !1, a = function(f) {
return f == null ? f : "" + f;
};
if (t.source !== void 0 || t.target !== void 0) {
var o = a(t.source), s = a(t.target), c = o != null && e.hasElementWithId(o), l = s != null && e.hasElementWithId(s);
(c || l) && (e.batch(function() {
r.remove(i, n), r.emitAndNotify("moveout");
for (var f = 0; f < r.length; f++) {
var p = r[f], m = p._private.data;
p.isEdge() && (c && (m.source = o), l && (m.target = s));
}
r.restore(i, n);
}), r.emitAndNotify("move"));
} else if (t.parent !== void 0) {
var u = a(t.parent), d = u === null || e.hasElementWithId(u);
if (d) {
var h = u === null ? void 0 : u;
e.batch(function() {
var f = r.remove(i, n);
f.emitAndNotify("moveout");
for (var p = 0; p < r.length; p++) {
var m = r[p], y = m._private.data;
m.isNode() && (y.parent = h);
}
f.restore(i, n);
}), r.emitAndNotify("move");
}
}
return this;
};
[jA, G9, cm, rs, au, sW, Rg, SW, f3, m3, AW, Fm, um, fi, is, Ci].forEach(function(t) {
bt(cr, t);
});
var IW = {
add: function(t) {
var e, r = this;
if (on(t)) {
var i = t;
if (i._private.cy === r)
e = i.restore();
else {
for (var n = [], a = 0; a < i.length; a++) {
var o = i[a];
n.push(o.json());
}
e = new mi(r, n);
}
} else if (ar(t)) {
var s = t;
e = new mi(r, s);
} else if (Gt(t) && (ar(t.nodes) || ar(t.edges))) {
for (var c = t, l = [], u = ["nodes", "edges"], d = 0, h = u.length; d < h; d++) {
var f = u[d], p = c[f];
if (ar(p))
for (var m = 0, y = p.length; m < y; m++) {
var g = bt({
group: f
}, p[m]);
l.push(g);
}
}
e = new mi(r, l);
} else {
var v = t;
e = new Tg(r, v).collection();
}
return e;
},
remove: function(t) {
if (!on(t) && dt(t)) {
var e = t;
t = this.$(e);
}
return t.remove();
}
};
/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */
function NW(t, e, r, i) {
var n = 4, a = 1e-3, o = 1e-7, s = 10, c = 11, l = 1 / (c - 1), u = typeof Float32Array < "u";
if (arguments.length !== 4)
return !1;
for (var d = 0; d < 4; ++d)
if (typeof arguments[d] != "number" || isNaN(arguments[d]) || !isFinite(arguments[d]))
return !1;
t = Math.min(t, 1), r = Math.min(r, 1), t = Math.max(t, 0), r = Math.max(r, 0);
var h = u ? new Float32Array(c) : new Array(c);
function f(C, L) {
return 1 - 3 * L + 3 * C;
}
function p(C, L) {
return 3 * L - 6 * C;
}
function m(C) {
return 3 * C;
}
function y(C, L, A) {
return ((f(L, A) * C + p(L, A)) * C + m(L)) * C;
}
function g(C, L, A) {
return 3 * f(L, A) * C * C + 2 * p(L, A) * C + m(L);
}
function v(C, L) {
for (var A = 0; A < n; ++A) {
var k = g(L, t, r);
if (k === 0)
return L;
var P = y(L, t, r) - C;
L -= P / k;
}
return L;
}
function x() {
for (var C = 0; C < c; ++C)
h[C] = y(C * l, t, r);
}
function w(C, L, A) {
var k, P, R = 0;
do
P = L + (A - L) / 2, k = y(P, t, r) - C, k > 0 ? A = P : L = P;
while (Math.abs(k) > o && ++R < s);
return P;
}
function S(C) {
for (var L = 0, A = 1, k = c - 1; A !== k && h[A] <= C; ++A)
L += l;
--A;
var P = (C - h[A]) / (h[A + 1] - h[A]), R = L + P * l, M = g(R, t, r);
return M >= a ? v(C, R) : M === 0 ? R : w(C, L, L + l);
}
var _ = !1;
function b() {
_ = !0, (t !== e || r !== i) && x();
}
var T = function(C) {
return _ || b(), t === e && r === i ? C : C === 0 ? 0 : C === 1 ? 1 : y(S(C), e, i);
};
T.getControlPoints = function() {
return [{
x: t,
y: e
}, {
x: r,
y: i
}];
};
var E = "generateBezier(" + [t, e, r, i] + ")";
return T.toString = function() {
return E;
}, T;
}
/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */
var BW = /* @__PURE__ */ function() {
function t(i) {
return -i.tension * i.x - i.friction * i.v;
}
function e(i, n, a) {
var o = {
x: i.x + a.dx * n,
v: i.v + a.dv * n,
tension: i.tension,
friction: i.friction
};
return {
dx: o.v,
dv: t(o)
};
}
function r(i, n) {
var a = {
dx: i.v,
dv: t(i)
}, o = e(i, n * 0.5, a), s = e(i, n * 0.5, o), c = e(i, n, s), l = 1 / 6 * (a.dx + 2 * (o.dx + s.dx) + c.dx), u = 1 / 6 * (a.dv + 2 * (o.dv + s.dv) + c.dv);
return i.x = i.x + l * n, i.v = i.v + u * n, i;
}
return function i(n, a, o) {
var s = {
x: -1,
v: 0,
tension: null,
friction: null
}, c = [0], l = 0, u = 1 / 1e4, d = 16 / 1e3, h, f, p;
for (n = parseFloat(n) || 500, a = parseFloat(a) || 20, o = o || null, s.tension = n, s.friction = a, h = o !== null, h ? (l = i(n, a), f = l / o * d) : f = d; p = r(p || s, f), c.push(1 + p.x), l += 16, Math.abs(p.x) > u && Math.abs(p.v) > u; )
;
return h ? function(m) {
return c[m * (c.length - 1) | 0];
} : l;
};
}(), or = function(t, e, r, i) {
var n = NW(t, e, r, i);
return function(a, o, s) {
return a + (o - a) * n(s);
};
}, dm = {
linear: function(t, e, r) {
return t + (e - t) * r;
},
// default easings
ease: or(0.25, 0.1, 0.25, 1),
"ease-in": or(0.42, 0, 1, 1),
"ease-out": or(0, 0, 0.58, 1),
"ease-in-out": or(0.42, 0, 0.58, 1),
// sine
"ease-in-sine": or(0.47, 0, 0.745, 0.715),
"ease-out-sine": or(0.39, 0.575, 0.565, 1),
"ease-in-out-sine": or(0.445, 0.05, 0.55, 0.95),
// quad
"ease-in-quad": or(0.55, 0.085, 0.68, 0.53),
"ease-out-quad": or(0.25, 0.46, 0.45, 0.94),
"ease-in-out-quad": or(0.455, 0.03, 0.515, 0.955),
// cubic
"ease-in-cubic": or(0.55, 0.055, 0.675, 0.19),
"ease-out-cubic": or(0.215, 0.61, 0.355, 1),
"ease-in-out-cubic": or(0.645, 0.045, 0.355, 1),
// quart
"ease-in-quart": or(0.895, 0.03, 0.685, 0.22),
"ease-out-quart": or(0.165, 0.84, 0.44, 1),
"ease-in-out-quart": or(0.77, 0, 0.175, 1),
// quint
"ease-in-quint": or(0.755, 0.05, 0.855, 0.06),
"ease-out-quint": or(0.23, 1, 0.32, 1),
"ease-in-out-quint": or(0.86, 0, 0.07, 1),
// expo
"ease-in-expo": or(0.95, 0.05, 0.795, 0.035),
"ease-out-expo": or(0.19, 1, 0.22, 1),
"ease-in-out-expo": or(1, 0, 0, 1),
// circ
"ease-in-circ": or(0.6, 0.04, 0.98, 0.335),
"ease-out-circ": or(0.075, 0.82, 0.165, 1),
"ease-in-out-circ": or(0.785, 0.135, 0.15, 0.86),
// user param easings...
spring: function(t, e, r) {
if (r === 0)
return dm.linear;
var i = BW(t, e, r);
return function(n, a, o) {
return n + (a - n) * i(o);
};
},
"cubic-bezier": or
};
function $_(t, e, r, i, n) {
if (i === 1 || e === r)
return r;
var a = n(e, r, i);
return t == null || ((t.roundValue || t.color) && (a = Math.round(a)), t.min !== void 0 && (a = Math.max(a, t.min)), t.max !== void 0 && (a = Math.min(a, t.max))), a;
}
function V_(t, e) {
return t.pfValue != null || t.value != null ? t.pfValue != null && (e == null || e.type.units !== "%") ? t.pfValue : t.value : t;
}
function rc(t, e, r, i, n) {
var a = n != null ? n.type : null;
r < 0 ? r = 0 : r > 1 && (r = 1);
var o = V_(t, n), s = V_(e, n);
if (Xe(o) && Xe(s))
return $_(a, o, s, r, i);
if (ar(o) && ar(s)) {
for (var c = [], l = 0; l < s.length; l++) {
var u = o[l], d = s[l];
if (u != null && d != null) {
var h = $_(a, u, d, r, i);
c.push(h);
} else
c.push(d);
}
return c;
}
}
function FW(t, e, r, i) {
var n = !i, a = t._private, o = e._private, s = o.easing, c = o.startTime, l = i ? t : t.cy(), u = l.style();
if (!o.easingImpl)
if (s == null)
o.easingImpl = dm.linear;
else {
var d;
if (dt(s)) {
var h = u.parse("transition-timing-function", s);
d = h.value;
} else
d = s;
var f, p;
dt(d) ? (f = d, p = []) : (f = d[1], p = d.slice(2).map(function(I) {
return +I;
})), p.length > 0 ? (f === "spring" && p.push(o.duration), o.easingImpl = dm[f].apply(null, p)) : o.easingImpl = dm[f];
}
var m = o.easingImpl, y;
if (o.duration === 0 ? y = 1 : y = (r - c) / o.duration, o.applying && (y = o.progress), y < 0 ? y = 0 : y > 1 && (y = 1), o.delay == null) {
var g = o.startPosition, v = o.position;
if (v && n && !t.locked()) {
var x = {};
gd(g.x, v.x) && (x.x = rc(g.x, v.x, y, m)), gd(g.y, v.y) && (x.y = rc(g.y, v.y, y, m)), t.position(x);
}
var w = o.startPan, S = o.pan, _ = a.pan, b = S != null && i;
b && (gd(w.x, S.x) && (_.x = rc(w.x, S.x, y, m)), gd(w.y, S.y) && (_.y = rc(w.y, S.y, y, m)), t.emit("pan"));
var T = o.startZoom, E = o.zoom, C = E != null && i;
C && (gd(T, E) && (a.zoom = yh(a.minZoom, rc(T, E, y, m), a.maxZoom)), t.emit("zoom")), (b || C) && t.emit("viewport");
var L = o.style;
if (L && L.length > 0 && n) {
for (var A = 0; A < L.length; A++) {
var k = L[A], P = k.name, R = k, M = o.startStyle[P], O = u.properties[M.name], D = rc(M, R, y, m, O);
u.overrideBypass(t, P, D);
}
t.emit("style");
}
}
return o.progress = y, y;
}
function gd(t, e) {
return t == null || e == null ? !1 : Xe(t) && Xe(e) ? !0 : !!(t && e);
}
function zW(t, e, r, i) {
var n = e._private;
n.started = !0, n.startTime = r - n.progress * n.duration;
}
function U_(t, e) {
var r = e._private.aniEles, i = [];
function n(u, d) {
var h = u._private, f = h.animation.current, p = h.animation.queue, m = !1;
if (f.length === 0) {
var y = p.shift();
y && f.push(y);
}
for (var g = function(S) {
for (var _ = S.length - 1; _ >= 0; _--) {
var b = S[_];
b();
}
S.splice(0, S.length);
}, v = f.length - 1; v >= 0; v--) {
var x = f[v], w = x._private;
if (w.stopped) {
f.splice(v, 1), w.hooked = !1, w.playing = !1, w.started = !1, g(w.frames);
continue;
}
!w.playing && !w.applying || (w.playing && w.applying && (w.applying = !1), w.started || zW(u, x, t), FW(u, x, t, d), w.applying && (w.applying = !1), g(w.frames), w.step != null && w.step(t), x.completed() && (f.splice(v, 1), w.hooked = !1, w.playing = !1, w.started = !1, g(w.completes)), m = !0);
}
return !d && f.length === 0 && p.length === 0 && i.push(u), m;
}
for (var a = !1, o = 0; o < r.length; o++) {
var s = r[o], c = n(s);
a = a || c;
}
var l = n(e, !0);
(a || l) && (r.length > 0 ? e.notify("draw", r) : e.notify("draw")), r.unmerge(i), e.emit("step");
}
var $W = {
// pull in animation functions
animate: Xt.animate(),
animation: Xt.animation(),
animated: Xt.animated(),
clearQueue: Xt.clearQueue(),
delay: Xt.delay(),
delayAnimation: Xt.delayAnimation(),
stop: Xt.stop(),
addToAnimationPool: function(t) {
var e = this;
e.styleEnabled() && e._private.aniEles.merge(t);
},
stopAnimationLoop: function() {
this._private.animationsRunning = !1;
},
startAnimationLoop: function() {
var t = this;
if (t._private.animationsRunning = !0, !t.styleEnabled())
return;
function e() {
t._private.animationsRunning && Om(function(i) {
U_(i, t), e();
});
}
var r = t.renderer();
r && r.beforeRender ? r.beforeRender(function(i, n) {
U_(n, t);
}, r.beforeRenderPriorities.animations) : e();
}
}, VW = {
qualifierCompare: function(t, e) {
return t == null || e == null ? t == null && e == null : t.sameText(e);
},
eventMatches: function(t, e, r) {
var i = e.qualifier;
return i != null ? t !== r.target && rp(r.target) && i.matches(r.target) : !0;
},
addEventFields: function(t, e) {
e.cy = t, e.target = t;
},
callbackContext: function(t, e, r) {
return e.qualifier != null ? r.target : t;
}
}, Yp = function(t) {
return dt(t) ? new ps(t) : t;
}, y3 = {
createEmitter: function() {
var t = this._private;
return t.emitter || (t.emitter = new Og(VW, this)), this;
},
emitter: function() {
return this._private.emitter;
},
on: function(t, e, r) {
return this.emitter().on(t, Yp(e), r), this;
},
removeListener: function(t, e, r) {
return this.emitter().removeListener(t, Yp(e), r), this;
},
removeAllListeners: function() {
return this.emitter().removeAllListeners(), this;
},
one: function(t, e, r) {
return this.emitter().one(t, Yp(e), r), this;
},
once: function(t, e, r) {
return this.emitter().one(t, Yp(e), r), this;
},
emit: function(t, e) {
return this.emitter().emit(t, e), this;
},
emitAndNotify: function(t, e) {
return this.emit(t), this.notify(t, e), this;
}
};
Xt.eventAliasesOn(y3);
var Ly = {
png: function(t) {
var e = this._private.renderer;
return t = t || {}, e.png(t);
},
jpg: function(t) {
var e = this._private.renderer;
return t = t || {}, t.bg = t.bg || "#fff", e.jpg(t);
}
};
Ly.jpeg = Ly.jpg;
var hm = {
layout: function(t) {
var e = this;
if (t == null) {
Tr("Layout options must be specified to make a layout");
return;
}
if (t.name == null) {
Tr("A `name` must be specified to make a layout");
return;
}
var r = t.name, i = e.extension("layout", r);
if (i == null) {
Tr("No such layout `" + r + "` found. Did you forget to import it and `cytoscape.use()` it?");
return;
}
var n;
dt(t.eles) ? n = e.$(t.eles) : n = t.eles != null ? t.eles : e.$();
var a = new i(bt({}, t, {
cy: e,
eles: n
}));
return a;
}
};
hm.createLayout = hm.makeLayout = hm.layout;
var UW = {
notify: function(t, e) {
var r = this._private;
if (this.batching()) {
r.batchNotifications = r.batchNotifications || {};
var i = r.batchNotifications[t] = r.batchNotifications[t] || this.collection();
e != null && i.merge(e);
return;
}
if (r.notificationsEnabled) {
var n = this.renderer();
this.destroyed() || !n || n.notify(t, e);
}
},
notifications: function(t) {
var e = this._private;
return t === void 0 ? e.notificationsEnabled : (e.notificationsEnabled = !!t, this);
},
noNotifications: function(t) {
this.notifications(!1), t(), this.notifications(!0);
},
batching: function() {
return this._private.batchCount > 0;
},
startBatch: function() {
var t = this._private;
return t.batchCount == null && (t.batchCount = 0), t.batchCount === 0 && (t.batchStyleEles = this.collection(), t.batchNotifications = {}), t.batchCount++, this;
},
endBatch: function() {
var t = this._private;
if (t.batchCount === 0)
return this;
if (t.batchCount--, t.batchCount === 0) {
t.batchStyleEles.updateStyle();
var e = this.renderer();
Object.keys(t.batchNotifications).forEach(function(r) {
var i = t.batchNotifications[r];
i.empty() ? e.notify(r) : e.notify(r, i);
});
}
return this;
},
batch: function(t) {
return this.startBatch(), t(), this.endBatch(), this;
},
// for backwards compatibility
batchData: function(t) {
var e = this;
return this.batch(function() {
for (var r = Object.keys(t), i = 0; i < r.length; i++) {
var n = r[i], a = t[n], o = e.getElementById(n);
o.data(a);
}
});
}
}, jW = yi({
hideEdgesOnViewport: !1,
textureOnViewport: !1,
motionBlur: !1,
motionBlurOpacity: 0.05,
pixelRatio: void 0,
desktopTapThreshold: 4,
touchTapThreshold: 8,
wheelSensitivity: 1,
debug: !1,
showFps: !1
}), ky = {
renderTo: function(t, e, r, i) {
var n = this._private.renderer;
return n.renderTo(t, e, r, i), 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(t) {
var e = this, r = e.extension("renderer", t.name);
if (r == null) {
Tr("Can not initialise: No such renderer `".concat(t.name, "` found. Did you forget to import it and `cytoscape.use()` it?"));
return;
}
t.wheelSensitivity !== void 0 && Zt("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 i = jW(t);
i.cy = e, e._private.renderer = new r(i), this.notify("init");
},
destroyRenderer: function() {
var t = this;
t.notify("destroy");
var e = t.container();
if (e)
for (e._cyreg = null; e.childNodes.length > 0; )
e.removeChild(e.childNodes[0]);
t._private.renderer = null, t.mutableElements().forEach(function(r) {
var i = r._private;
i.rscratch = {}, i.rstyle = {}, i.animation.current = [], i.animation.queue = [];
});
},
onRender: function(t) {
return this.on("render", t);
},
offRender: function(t) {
return this.off("render", t);
}
};
ky.invalidateDimensions = ky.resize;
var pm = {
// 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(t, e) {
return dt(t) ? this.$(t) : on(t) ? t.collection() : ar(t) ? (e || (e = {}), new mi(this, t, e.unique, e.removed)) : new mi(this);
},
nodes: function(t) {
var e = this.$(function(r) {
return r.isNode();
});
return t ? e.filter(t) : e;
},
edges: function(t) {
var e = this.$(function(r) {
return r.isEdge();
});
return t ? e.filter(t) : e;
},
// search the graph like jQuery
$: function(t) {
var e = this._private.elements;
return t ? e.filter(t) : e.spawnSelf();
},
mutableElements: function() {
return this._private.elements;
}
};
pm.elements = pm.filter = pm.$;
var ki = {}, Xd = "t", HW = "f";
ki.apply = function(t) {
for (var e = this, r = e._private, i = r.cy, n = i.collection(), a = 0; a < t.length; a++) {
var o = t[a], s = e.getContextMeta(o);
if (!s.empty) {
var c = e.getContextStyle(s), l = e.applyContextStyle(s, c, o);
o._private.appliedInitStyle ? e.updateTransitions(o, l.diffProps) : o._private.appliedInitStyle = !0;
var u = e.updateStyleHints(o);
u && n.push(o);
}
}
return n;
};
ki.getPropertiesDiff = function(t, e) {
var r = this, i = r._private.propDiffs = r._private.propDiffs || {}, n = t + "-" + e, a = i[n];
if (a)
return a;
for (var o = [], s = {}, c = 0; c < r.length; c++) {
var l = r[c], u = t[c] === Xd, d = e[c] === Xd, h = u !== d, f = l.mappedProperties.length > 0;
if (h || d && f) {
var p = void 0;
h && f || h ? p = l.properties : f && (p = l.mappedProperties);
for (var m = 0; m < p.length; m++) {
for (var y = p[m], g = y.name, v = !1, x = c + 1; x < r.length; x++) {
var w = r[x], S = e[x] === Xd;
if (S && (v = w.properties[y.name] != null, v))
break;
}
!s[g] && !v && (s[g] = !0, o.push(g));
}
}
}
return i[n] = o, o;
};
ki.getContextMeta = function(t) {
for (var e = this, r = "", i, n = t._private.styleCxtKey || "", a = 0; a < e.length; a++) {
var o = e[a], s = o.selector && o.selector.matches(t);
s ? r += Xd : r += HW;
}
return i = e.getPropertiesDiff(n, r), t._private.styleCxtKey = r, {
key: r,
diffPropNames: i,
empty: i.length === 0
};
};
ki.getContextStyle = function(t) {
var e = t.key, r = this, i = this._private.contextStyles = this._private.contextStyles || {};
if (i[e])
return i[e];
for (var n = {
_private: {
key: e
}
}, a = 0; a < r.length; a++) {
var o = r[a], s = e[a] === Xd;
if (s)
for (var c = 0; c < o.properties.length; c++) {
var l = o.properties[c];
n[l.name] = l;
}
}
return i[e] = n, n;
};
ki.applyContextStyle = function(t, e, r) {
for (var i = this, n = t.diffPropNames, a = {}, o = i.types, s = 0; s < n.length; s++) {
var c = n[s], l = e[c], u = r.pstyle(c);
if (!l)
if (u)
u.bypass ? l = {
name: c,
deleteBypassed: !0
} : l = {
name: c,
delete: !0
};
else continue;
if (u !== l) {
if (l.mapped === o.fn && u != null && u.mapping != null && u.mapping.value === l.value) {
var d = u.mapping, h = d.fnValue = l.value(r);
if (h === d.prevFnValue)
continue;
}
var f = a[c] = {
prev: u
};
i.applyParsedProperty(r, l), f.next = r.pstyle(c), f.next && f.next.bypass && (f.next = f.next.bypassed);
}
}
return {
diffProps: a
};
};
ki.updateStyleHints = function(t) {
var e = t._private, r = this, i = r.propertyGroupNames, n = r.propertyGroupKeys, a = function(Y, X, ie) {
return r.getPropertiesHash(Y, X, ie);
}, o = e.styleKey;
if (t.removed())
return !1;
var s = e.group === "nodes", c = t._private.style;
i = Object.keys(c);
for (var l = 0; l < n.length; l++) {
var u = n[l];
e.styleKeys[u] = [Rc, Bd];
}
for (var d = function(Y, X) {
return e.styleKeys[X][0] = mh(Y, e.styleKeys[X][0]);
}, h = function(Y, X) {
return e.styleKeys[X][1] = gh(Y, e.styleKeys[X][1]);
}, f = function(Y, X) {
d(Y, X), h(Y, X);
}, p = function(Y, X) {
for (var ie = 0; ie < Y.length; ie++) {
var ue = Y.charCodeAt(ie);
d(ue, X), h(ue, X);
}
}, m = 2e9, y = function(Y) {
return -128 < Y && Y < 128 && Math.floor(Y) !== Y ? m - (Y * 1024 | 0) : Y;
}, g = 0; g < i.length; g++) {
var v = i[g], x = c[v];
if (x != null) {
var w = this.properties[v], S = w.type, _ = w.groupKey, b = void 0;
w.hashOverride != null ? b = w.hashOverride(t, x) : x.pfValue != null && (b = x.pfValue);
var T = w.enums == null ? x.value : null, E = b != null, C = T != null, L = E || C, A = x.units;
if (S.number && L && !S.multiple) {
var k = E ? b : T;
f(y(k), _), !E && A != null && p(A, _);
} else
p(x.strValue, _);
}
}
for (var P = [Rc, Bd], R = 0; R < n.length; R++) {
var M = n[R], O = e.styleKeys[M];
P[0] = mh(O[0], P[0]), P[1] = gh(O[1], P[1]);
}
e.styleKey = qU(P[0], P[1]);
var D = e.styleKeys;
e.labelDimsKey = Co(D.labelDimensions);
var I = a(t, ["label"], D.labelDimensions);
if (e.labelKey = Co(I), e.labelStyleKey = Co(Vp(D.commonLabel, I)), !s) {
var F = a(t, ["source-label"], D.labelDimensions);
e.sourceLabelKey = Co(F), e.sourceLabelStyleKey = Co(Vp(D.commonLabel, F));
var z = a(t, ["target-label"], D.labelDimensions);
e.targetLabelKey = Co(z), e.targetLabelStyleKey = Co(Vp(D.commonLabel, z));
}
if (s) {
var U = e.styleKeys, Z = U.nodeBody, re = U.nodeBorder, K = U.nodeOutline, V = U.backgroundImage, H = U.compound, G = U.pie, W = [Z, re, K, V, H, G].filter(function(Y) {
return Y != null;
}).reduce(Vp, [Rc, Bd]);
e.nodeKey = Co(W), e.hasPie = G != null && G[0] !== Rc && G[1] !== Bd;
}
return o !== e.styleKey;
};
ki.clearStyleHints = function(t) {
var e = t._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;
};
ki.applyParsedProperty = function(t, e) {
var r = this, i = e, n = t._private.style, a, o = r.types, s = r.properties[i.name].type, c = i.bypass, l = n[i.name], u = l && l.bypass, d = t._private, h = "mapping", f = function(U) {
return U == null ? null : U.pfValue != null ? U.pfValue : U.value;
}, p = function() {
var U = f(l), Z = f(i);
r.checkTriggers(t, i.name, U, Z);
};
if (e.name === "curve-style" && t.isEdge() && // loops must be bundled beziers
(e.value !== "bezier" && t.isLoop() || // edges connected to compound nodes can not be haystacks
e.value === "haystack" && (t.source().isParent() || t.target().isParent())) && (i = e = this.parse(e.name, "bezier", c)), i.delete)
return n[i.name] = void 0, p(), !0;
if (i.deleteBypassed)
return l ? l.bypass ? (l.bypassed = void 0, p(), !0) : !1 : (p(), !0);
if (i.deleteBypass)
return l ? l.bypass ? (n[i.name] = l.bypassed, p(), !0) : !1 : (p(), !0);
var m = function() {
Zt("Do not assign mappings to elements without corresponding data (i.e. ele `" + t.id() + "` has no mapping for property `" + i.name + "` with data field `" + i.field + "`); try a `[" + i.field + "]` selector to limit scope to elements with `" + i.field + "` defined");
};
switch (i.mapped) {
case o.mapData: {
for (var y = i.field.split("."), g = d.data, v = 0; v < y.length && g; v++) {
var x = y[v];
g = g[x];
}
if (g == null)
return m(), !1;
var w;
if (Xe(g)) {
var S = i.fieldMax - i.fieldMin;
S === 0 ? w = 0 : w = (g - i.fieldMin) / S;
} else
return Zt("Do not use continuous mappers without specifying numeric data (i.e. `" + i.field + ": " + g + "` for `" + t.id() + "` is non-numeric)"), !1;
if (w < 0 ? w = 0 : w > 1 && (w = 1), s.color) {
var _ = i.valueMin[0], b = i.valueMax[0], T = i.valueMin[1], E = i.valueMax[1], C = i.valueMin[2], L = i.valueMax[2], A = i.valueMin[3] == null ? 1 : i.valueMin[3], k = i.valueMax[3] == null ? 1 : i.valueMax[3], P = [Math.round(_ + (b - _) * w), Math.round(T + (E - T) * w), Math.round(C + (L - C) * w), Math.round(A + (k - A) * w)];
a = {
// colours are simple, so just create the flat property instead of expensive string parsing
bypass: i.bypass,
// we're a bypass if the mapping property is a bypass
name: i.name,
value: P,
strValue: "rgb(" + P[0] + ", " + P[1] + ", " + P[2] + ")"
};
} else if (s.number) {
var R = i.valueMin + (i.valueMax - i.valueMin) * w;
a = this.parse(i.name, R, i.bypass, h);
} else
return !1;
if (!a)
return m(), !1;
a.mapping = i, i = a;
break;
}
case o.data: {
for (var M = i.field.split("."), O = d.data, D = 0; D < M.length && O; D++) {
var I = M[D];
O = O[I];
}
if (O != null && (a = this.parse(i.name, O, i.bypass, h)), !a)
return m(), !1;
a.mapping = i, i = a;
break;
}
case o.fn: {
var F = i.value, z = i.fnValue != null ? i.fnValue : F(t);
if (i.prevFnValue = z, z == null)
return Zt("Custom function mappers may not return null (i.e. `" + i.name + "` for ele `" + t.id() + "` is null)"), !1;
if (a = this.parse(i.name, z, i.bypass, h), !a)
return Zt("Custom function mappers may not return invalid values for the property type (i.e. `" + i.name + "` for ele `" + t.id() + "` is invalid)"), !1;
a.mapping = la(i), i = a;
break;
}
case void 0:
break;
default:
return !1;
}
return c ? (u ? i.bypassed = l.bypassed : i.bypassed = l, n[i.name] = i) : u ? l.bypassed = i : n[i.name] = i, p(), !0;
};
ki.cleanElements = function(t, e) {
for (var r = 0; r < t.length; r++) {
var i = t[r];
if (this.clearStyleHints(i), i.dirtyCompoundBoundsCache(), i.dirtyBoundingBoxCache(), !e)
i._private.style = {};
else
for (var n = i._private.style, a = Object.keys(n), o = 0; o < a.length; o++) {
var s = a[o], c = n[s];
c != null && (c.bypass ? c.bypassed = null : n[s] = null);
}
}
};
ki.update = function() {
var t = this._private.cy, e = t.mutableElements();
e.updateStyle();
};
ki.updateTransitions = function(t, e) {
var r = this, i = t._private, n = t.pstyle("transition-property").value, a = t.pstyle("transition-duration").pfValue, o = t.pstyle("transition-delay").pfValue;
if (n.length > 0 && a > 0) {
for (var s = {}, c = !1, l = 0; l < n.length; l++) {
var u = n[l], d = t.pstyle(u), h = e[u];
if (h) {
var f = h.prev, p = f, m = h.next != null ? h.next : d, y = !1, g = void 0, v = 1e-6;
p && (Xe(p.pfValue) && Xe(m.pfValue) ? (y = m.pfValue - p.pfValue, g = p.pfValue + v * y) : Xe(p.value) && Xe(m.value) ? (y = m.value - p.value, g = p.value + v * y) : ar(p.value) && ar(m.value) && (y = p.value[0] !== m.value[0] || p.value[1] !== m.value[1] || p.value[2] !== m.value[2], g = p.strValue), y && (s[u] = m.strValue, this.applyBypass(t, u, g), c = !0));
}
}
if (!c)
return;
i.transitioning = !0, new Bu(function(x) {
o > 0 ? t.delayAnimation(o).play().promise().then(x) : x();
}).then(function() {
return t.animation({
style: s,
duration: a,
easing: t.pstyle("transition-timing-function").value,
queue: !1
}).play().promise();
}).then(function() {
r.removeBypasses(t, n), t.emitAndNotify("style"), i.transitioning = !1;
});
} else i.transitioning && (this.removeBypasses(t, n), t.emitAndNotify("style"), i.transitioning = !1);
};
ki.checkTrigger = function(t, e, r, i, n, a) {
var o = this.properties[e], s = n(o);
s != null && s(r, i) && a(o);
};
ki.checkZOrderTrigger = function(t, e, r, i) {
var n = this;
this.checkTrigger(t, e, r, i, function(a) {
return a.triggersZOrder;
}, function() {
n._private.cy.notify("zorder", t);
});
};
ki.checkBoundsTrigger = function(t, e, r, i) {
this.checkTrigger(t, e, r, i, function(n) {
return n.triggersBounds;
}, function(n) {
t.dirtyCompoundBoundsCache(), t.dirtyBoundingBoxCache(), // only for beziers -- so performance of other edges isn't affected
n.triggersBoundsOfParallelBeziers && e === "curve-style" && (r === "bezier" || i === "bezier") && t.parallelEdges().forEach(function(a) {
a.isBundledBezier() && a.dirtyBoundingBoxCache();
}), n.triggersBoundsOfConnectedEdges && e === "display" && (r === "none" || i === "none") && t.connectedEdges().forEach(function(a) {
a.dirtyBoundingBoxCache();
});
});
};
ki.checkTriggers = function(t, e, r, i) {
t.dirtyStyleCache(), this.checkZOrderTrigger(t, e, r, i), this.checkBoundsTrigger(t, e, r, i);
};
var op = {};
op.applyBypass = function(t, e, r, i) {
var n = this, a = [], o = !0;
if (e === "*" || e === "**") {
if (r !== void 0)
for (var s = 0; s < n.properties.length; s++) {
var c = n.properties[s], l = c.name, u = this.parse(l, r, !0);
u && a.push(u);
}
} else if (dt(e)) {
var d = this.parse(e, r, !0);
d && a.push(d);
} else if (Gt(e)) {
var h = e;
i = r;
for (var f = Object.keys(h), p = 0; p < f.length; p++) {
var m = f[p], y = h[m];
if (y === void 0 && (y = h[Sg(m)]), y !== void 0) {
var g = this.parse(m, y, !0);
g && a.push(g);
}
}
} else
return !1;
if (a.length === 0)
return !1;
for (var v = !1, x = 0; x < t.length; x++) {
for (var w = t[x], S = {}, _ = void 0, b = 0; b < a.length; b++) {
var T = a[b];
if (i) {
var E = w.pstyle(T.name);
_ = S[T.name] = {
prev: E
};
}
v = this.applyParsedProperty(w, la(T)) || v, i && (_.next = w.pstyle(T.name));
}
v && this.updateStyleHints(w), i && this.updateTransitions(w, S, o);
}
return v;
};
op.overrideBypass = function(t, e, r) {
e = Lb(e);
for (var i = 0; i < t.length; i++) {
var n = t[i], a = n._private.style[e], o = this.properties[e].type, s = o.color, c = o.mutiple, l = a ? a.pfValue != null ? a.pfValue : a.value : null;
!a || !a.bypass ? this.applyBypass(n, e, r) : (a.value = r, a.pfValue != null && (a.pfValue = r), s ? a.strValue = "rgb(" + r.join(",") + ")" : c ? a.strValue = r.join(" ") : a.strValue = "" + r, this.updateStyleHints(n)), this.checkTriggers(n, e, l, r);
}
};
op.removeAllBypasses = function(t, e) {
return this.removeBypasses(t, this.propertyNames, e);
};
op.removeBypasses = function(t, e, r) {
for (var i = !0, n = 0; n < t.length; n++) {
for (var a = t[n], o = {}, s = 0; s < e.length; s++) {
var c = e[s], l = this.properties[c], u = a.pstyle(l.name);
if (!(!u || !u.bypass)) {
var d = "", h = this.parse(c, d, !0), f = o[l.name] = {
prev: u
};
this.applyParsedProperty(a, h), f.next = a.pstyle(l.name);
}
}
this.updateStyleHints(a), r && this.updateTransitions(a, o, i);
}
};
var jb = {};
jb.getEmSizeInPixels = function() {
var t = this.containerCss("font-size");
return t != null ? parseFloat(t) : 1;
};
jb.containerCss = function(t) {
var e = this._private.cy, r = e.container(), i = e.window();
if (i && r && i.getComputedStyle)
return i.getComputedStyle(r).getPropertyValue(t);
};
var ya = {};
ya.getRenderedStyle = function(t, e) {
return e ? this.getStylePropertyValue(t, e, !0) : this.getRawStyle(t, !0);
};
ya.getRawStyle = function(t, e) {
var r = this;
if (t = t[0], t) {
for (var i = {}, n = 0; n < r.properties.length; n++) {
var a = r.properties[n], o = r.getStylePropertyValue(t, a.name, e);
o != null && (i[a.name] = o, i[Sg(a.name)] = o);
}
return i;
}
};
ya.getIndexedStyle = function(t, e, r, i) {
var n = t.pstyle(e)[r][i];
return n ?? t.cy().style().getDefaultProperty(e)[r][0];
};
ya.getStylePropertyValue = function(t, e, r) {
var i = this;
if (t = t[0], t) {
var n = i.properties[e];
n.alias && (n = n.pointsTo);
var a = n.type, o = t.pstyle(n.name);
if (o) {
var s = o.value, c = o.units, l = o.strValue;
if (r && a.number && s != null && Xe(s)) {
var u = t.cy().zoom(), d = function(m) {
return m * u;
}, h = function(m, y) {
return d(m) + y;
}, f = ar(s), p = f ? c.every(function(m) {
return m != null;
}) : c != null;
return p ? f ? s.map(function(m, y) {
return h(m, c[y]);
}).join(" ") : h(s, c) : f ? s.map(function(m) {
return dt(m) ? m : "" + d(m);
}).join(" ") : "" + d(s);
} else if (l != null)
return l;
}
return null;
}
};
ya.getAnimationStartStyle = function(t, e) {
for (var r = {}, i = 0; i < e.length; i++) {
var n = e[i], a = n.name, o = t.pstyle(a);
o !== void 0 && (Gt(o) ? o = this.parse(a, o.strValue) : o = this.parse(a, o)), o && (r[a] = o);
}
return r;
};
ya.getPropsList = function(t) {
var e = this, r = [], i = t, n = e.properties;
if (i)
for (var a = Object.keys(i), o = 0; o < a.length; o++) {
var s = a[o], c = i[s], l = n[s] || n[Lb(s)], u = this.parse(l.name, c);
u && r.push(u);
}
return r;
};
ya.getNonDefaultPropertiesHash = function(t, e, r) {
var i = r.slice(), n, a, o, s, c, l;
for (c = 0; c < e.length; c++)
if (n = e[c], a = t.pstyle(n, !1), a != null)
if (a.pfValue != null)
i[0] = mh(s, i[0]), i[1] = gh(s, i[1]);
else
for (o = a.strValue, l = 0; l < o.length; l++)
s = o.charCodeAt(l), i[0] = mh(s, i[0]), i[1] = gh(s, i[1]);
return i;
};
ya.getPropertiesHash = ya.getNonDefaultPropertiesHash;
var Ng = {};
Ng.appendFromJson = function(t) {
for (var e = this, r = 0; r < t.length; r++) {
var i = t[r], n = i.selector, a = i.style || i.css, o = Object.keys(a);
e.selector(n);
for (var s = 0; s < o.length; s++) {
var c = o[s], l = a[c];
e.css(c, l);
}
}
return e;
};
Ng.fromJson = function(t) {
var e = this;
return e.resetToDefault(), e.appendFromJson(t), e;
};
Ng.json = function() {
for (var t = [], e = this.defaultLength; e < this.length; e++) {
for (var r = this[e], i = r.selector, n = r.properties, a = {}, o = 0; o < n.length; o++) {
var s = n[o];
a[s.name] = s.strValue;
}
t.push({
selector: i ? i.toString() : "core",
style: a
});
}
return t;
};
var Hb = {};
Hb.appendFromString = function(t) {
var e = this, r = this, i = "" + t, n, a, o;
i = i.replace(/[/][*](\s|.)+?[*][/]/g, "");
function s() {
i.length > n.length ? i = i.substr(n.length) : i = "";
}
function c() {
a.length > o.length ? a = a.substr(o.length) : a = "";
}
for (; ; ) {
var l = i.match(/^\s*$/);
if (l)
break;
var u = i.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);
if (!u) {
Zt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + i);
break;
}
n = u[0];
var d = u[1];
if (d !== "core") {
var h = new ps(d);
if (h.invalid) {
Zt("Skipping parsing of block: Invalid selector found in string stylesheet: " + d), s();
continue;
}
}
var f = u[2], p = !1;
a = f;
for (var m = []; ; ) {
var y = a.match(/^\s*$/);
if (y)
break;
var g = a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);
if (!g) {
Zt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + f), p = !0;
break;
}
o = g[0];
var v = g[1], x = g[2], w = e.properties[v];
if (!w) {
Zt("Skipping property: Invalid property name in: " + o), c();
continue;
}
var S = r.parse(v, x);
if (!S) {
Zt("Skipping property: Invalid property definition in: " + o), c();
continue;
}
m.push({
name: v,
val: x
}), c();
}
if (p) {
s();
break;
}
r.selector(d);
for (var _ = 0; _ < m.length; _++) {
var b = m[_];
r.css(b.name, b.val);
}
s();
}
return r;
};
Hb.fromString = function(t) {
var e = this;
return e.resetToDefault(), e.appendFromString(t), e;
};
var si = {};
(function() {
var t = qr, e = Y8, r = J8, i = Q8, n = eU, a = function(G) {
return "^" + G + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$";
}, o = function(G) {
var W = t + "|\\w+|" + e + "|" + r + "|" + i + "|" + n;
return "^" + G + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + t + ")\\s*\\,\\s*(" + t + ")\\s*,\\s*(" + W + ")\\s*\\,\\s*(" + W + ")\\)$";
}, s = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"];
si.types = {
time: {
number: !0,
min: 0,
units: "s|ms",
implicitUnits: "ms"
},
percent: {
number: !0,
min: 0,
max: 100,
units: "%",
implicitUnits: "%"
},
percentages: {
number: !0,
min: 0,
max: 100,
units: "%",
implicitUnits: "%",
multiple: !0
},
zeroOneNumber: {
number: !0,
min: 0,
max: 1,
unitless: !0
},
zeroOneNumbers: {
number: !0,
min: 0,
max: 1,
unitless: !0,
multiple: !0
},
nOneOneNumber: {
number: !0,
min: -1,
max: 1,
unitless: !0
},
nonNegativeInt: {
number: !0,
min: 0,
integer: !0,
unitless: !0
},
nonNegativeNumber: {
number: !0,
min: 0,
unitless: !0
},
position: {
enums: ["parent", "origin"]
},
nodeSize: {
number: !0,
min: 0,
enums: ["label"]
},
number: {
number: !0,
unitless: !0
},
numbers: {
number: !0,
unitless: !0,
multiple: !0
},
positiveNumber: {
number: !0,
unitless: !0,
min: 0,
strictMin: !0
},
size: {
number: !0,
min: 0
},
bidirectionalSize: {
number: !0
},
// allows negative
bidirectionalSizeMaybePercent: {
number: !0,
allowPercent: !0
},
// allows negative
bidirectionalSizes: {
number: !0,
multiple: !0
},
// allows negative
sizeMaybePercent: {
number: !0,
min: 0,
allowPercent: !0
},
axisDirection: {
enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"]
},
paddingRelativeTo: {
enums: ["width", "height", "average", "min", "max"]
},
bgWH: {
number: !0,
min: 0,
allowPercent: !0,
enums: ["auto"],
multiple: !0
},
bgPos: {
number: !0,
allowPercent: !0,
multiple: !0
},
bgRelativeTo: {
enums: ["inner", "include-padding"],
multiple: !0
},
bgRepeat: {
enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"],
multiple: !0
},
bgFit: {
enums: ["none", "contain", "cover"],
multiple: !0
},
bgCrossOrigin: {
enums: ["anonymous", "use-credentials", "null"],
multiple: !0
},
bgClip: {
enums: ["none", "node"],
multiple: !0
},
bgContainment: {
enums: ["inside", "over"],
multiple: !0
},
color: {
color: !0
},
colors: {
color: !0,
multiple: !0
},
fill: {
enums: ["solid", "linear-gradient", "radial-gradient"]
},
bool: {
enums: ["yes", "no"]
},
bools: {
enums: ["yes", "no"],
multiple: !0
},
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: !0
},
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: !0,
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: !0,
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: !0
},
data: {
mapping: !0,
regex: a("data")
},
layoutData: {
mapping: !0,
regex: a("layoutData")
},
scratch: {
mapping: !0,
regex: a("scratch")
},
mapData: {
mapping: !0,
regex: o("mapData")
},
mapLayoutData: {
mapping: !0,
regex: o("mapLayoutData")
},
mapScratch: {
mapping: !0,
regex: o("mapScratch")
},
fn: {
mapping: !0,
fn: !0
},
url: {
regexes: s,
singleRegexMatchValue: !0
},
urls: {
regexes: s,
singleRegexMatchValue: !0,
multiple: !0
},
propList: {
propList: !0
},
angle: {
number: !0,
units: "deg|rad",
implicitUnits: "rad"
},
textRotation: {
number: !0,
units: "deg|rad",
implicitUnits: "rad",
enums: ["none", "autorotate"]
},
polygonPointList: {
number: !0,
multiple: !0,
evenMultiple: !0,
min: -1,
max: 1,
unitless: !0
},
edgeDistances: {
enums: ["intersection", "node-position", "endpoints"]
},
edgeEndpoint: {
number: !0,
multiple: !0,
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: !0,
validate: function(G, W) {
switch (G.length) {
case 2:
return W[0] !== "deg" && W[0] !== "rad" && W[1] !== "deg" && W[1] !== "rad";
case 1:
return dt(G[0]) || W[0] === "deg" || W[0] === "rad";
default:
return !1;
}
}
},
easing: {
regexes: ["^(spring)\\s*\\(\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*,\\s*(" + t + ")\\s*,\\s*(" + t + ")\\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: !0,
multiple: !0,
min: 0,
validate: function(G) {
var W = G.length;
return W === 1 || W === 2 || W === 4;
}
}
};
var c = {
zeroNonZero: function(G, W) {
return (G == null || W == null) && G !== W || G == 0 && W != 0 ? !0 : G != 0 && W == 0;
},
any: function(G, W) {
return G != W;
},
emptyNonEmpty: function(G, W) {
var Y = ds(G), X = ds(W);
return Y && !X || !Y && X;
}
}, l = si.types, u = [{
name: "label",
type: l.text,
triggersBounds: c.any,
triggersZOrder: c.emptyNonEmpty
}, {
name: "text-rotation",
type: l.textRotation,
triggersBounds: c.any
}, {
name: "text-margin-x",
type: l.bidirectionalSize,
triggersBounds: c.any
}, {
name: "text-margin-y",
type: l.bidirectionalSize,
triggersBounds: c.any
}], d = [{
name: "source-label",
type: l.text,
triggersBounds: c.any
}, {
name: "source-text-rotation",
type: l.textRotation,
triggersBounds: c.any
}, {
name: "source-text-margin-x",
type: l.bidirectionalSize,
triggersBounds: c.any
}, {
name: "source-text-margin-y",
type: l.bidirectionalSize,
triggersBounds: c.any
}, {
name: "source-text-offset",
type: l.size,
triggersBounds: c.any
}], h = [{
name: "target-label",
type: l.text,
triggersBounds: c.any
}, {
name: "target-text-rotation",
type: l.textRotation,
triggersBounds: c.any
}, {
name: "target-text-margin-x",
type: l.bidirectionalSize,
triggersBounds: c.any
}, {
name: "target-text-margin-y",
type: l.bidirectionalSize,
triggersBounds: c.any
}, {
name: "target-text-offset",
type: l.size,
triggersBounds: c.any
}], f = [{
name: "font-family",
type: l.fontFamily,
triggersBounds: c.any
}, {
name: "font-style",
type: l.fontStyle,
triggersBounds: c.any
}, {
name: "font-weight",
type: l.fontWeight,
triggersBounds: c.any
}, {
name: "font-size",
type: l.size,
triggersBounds: c.any
}, {
name: "text-transform",
type: l.textTransform,
triggersBounds: c.any
}, {
name: "text-wrap",
type: l.textWrap,
triggersBounds: c.any
}, {
name: "text-overflow-wrap",
type: l.textOverflowWrap,
triggersBounds: c.any
}, {
name: "text-max-width",
type: l.size,
triggersBounds: c.any
}, {
name: "text-outline-width",
type: l.size,
triggersBounds: c.any
}, {
name: "line-height",
type: l.positiveNumber,
triggersBounds: c.any
}], p = [{
name: "text-valign",
type: l.valign,
triggersBounds: c.any
}, {
name: "text-halign",
type: l.halign,
triggersBounds: c.any
}, {
name: "color",
type: l.color
}, {
name: "text-outline-color",
type: l.color
}, {
name: "text-outline-opacity",
type: l.zeroOneNumber
}, {
name: "text-background-color",
type: l.color
}, {
name: "text-background-opacity",
type: l.zeroOneNumber
}, {
name: "text-background-padding",
type: l.size,
triggersBounds: c.any
}, {
name: "text-border-opacity",
type: l.zeroOneNumber
}, {
name: "text-border-color",
type: l.color
}, {
name: "text-border-width",
type: l.size,
triggersBounds: c.any
}, {
name: "text-border-style",
type: l.borderStyle,
triggersBounds: c.any
}, {
name: "text-background-shape",
type: l.textBackgroundShape,
triggersBounds: c.any
}, {
name: "text-justification",
type: l.justification
}], m = [{
name: "events",
type: l.bool,
triggersZOrder: c.any
}, {
name: "text-events",
type: l.bool,
triggersZOrder: c.any
}], y = [{
name: "display",
type: l.display,
triggersZOrder: c.any,
triggersBounds: c.any,
triggersBoundsOfConnectedEdges: !0
}, {
name: "visibility",
type: l.visibility,
triggersZOrder: c.any
}, {
name: "opacity",
type: l.zeroOneNumber,
triggersZOrder: c.zeroNonZero
}, {
name: "text-opacity",
type: l.zeroOneNumber
}, {
name: "min-zoomed-font-size",
type: l.size
}, {
name: "z-compound-depth",
type: l.zCompoundDepth,
triggersZOrder: c.any
}, {
name: "z-index-compare",
type: l.zIndexCompare,
triggersZOrder: c.any
}, {
name: "z-index",
type: l.number,
triggersZOrder: c.any
}], g = [{
name: "overlay-padding",
type: l.size,
triggersBounds: c.any
}, {
name: "overlay-color",
type: l.color
}, {
name: "overlay-opacity",
type: l.zeroOneNumber,
triggersBounds: c.zeroNonZero
}, {
name: "overlay-shape",
type: l.overlayShape,
triggersBounds: c.any
}, {
name: "overlay-corner-radius",
type: l.cornerRadius
}], v = [{
name: "underlay-padding",
type: l.size,
triggersBounds: c.any
}, {
name: "underlay-color",
type: l.color
}, {
name: "underlay-opacity",
type: l.zeroOneNumber,
triggersBounds: c.zeroNonZero
}, {
name: "underlay-shape",
type: l.overlayShape,
triggersBounds: c.any
}, {
name: "underlay-corner-radius",
type: l.cornerRadius
}], x = [{
name: "transition-property",
type: l.propList
}, {
name: "transition-duration",
type: l.time
}, {
name: "transition-delay",
type: l.time
}, {
name: "transition-timing-function",
type: l.easing
}], w = function(G, W) {
return W.value === "label" ? -G.poolIndex() : W.pfValue;
}, S = [{
name: "height",
type: l.nodeSize,
triggersBounds: c.any,
hashOverride: w
}, {
name: "width",
type: l.nodeSize,
triggersBounds: c.any,
hashOverride: w
}, {
name: "shape",
type: l.nodeShape,
triggersBounds: c.any
}, {
name: "shape-polygon-points",
type: l.polygonPointList,
triggersBounds: c.any
}, {
name: "corner-radius",
type: l.cornerRadius
}, {
name: "background-color",
type: l.color
}, {
name: "background-fill",
type: l.fill
}, {
name: "background-opacity",
type: l.zeroOneNumber
}, {
name: "background-blacken",
type: l.nOneOneNumber
}, {
name: "background-gradient-stop-colors",
type: l.colors
}, {
name: "background-gradient-stop-positions",
type: l.percentages
}, {
name: "background-gradient-direction",
type: l.gradientDirection
}, {
name: "padding",
type: l.sizeMaybePercent,
triggersBounds: c.any
}, {
name: "padding-relative-to",
type: l.paddingRelativeTo,
triggersBounds: c.any
}, {
name: "bounds-expansion",
type: l.boundsExpansion,
triggersBounds: c.any
}], _ = [{
name: "border-color",
type: l.color
}, {
name: "border-opacity",
type: l.zeroOneNumber
}, {
name: "border-width",
type: l.size,
triggersBounds: c.any
}, {
name: "border-style",
type: l.borderStyle
}, {
name: "border-cap",
type: l.lineCap
}, {
name: "border-join",
type: l.lineJoin
}, {
name: "border-dash-pattern",
type: l.numbers
}, {
name: "border-dash-offset",
type: l.number
}, {
name: "border-position",
type: l.linePosition
}], b = [{
name: "outline-color",
type: l.color
}, {
name: "outline-opacity",
type: l.zeroOneNumber
}, {
name: "outline-width",
type: l.size,
triggersBounds: c.any
}, {
name: "outline-style",
type: l.borderStyle
}, {
name: "outline-offset",
type: l.size,
triggersBounds: c.any
}], T = [{
name: "background-image",
type: l.urls
}, {
name: "background-image-crossorigin",
type: l.bgCrossOrigin
}, {
name: "background-image-opacity",
type: l.zeroOneNumbers
}, {
name: "background-image-containment",
type: l.bgContainment
}, {
name: "background-image-smoothing",
type: l.bools
}, {
name: "background-position-x",
type: l.bgPos
}, {
name: "background-position-y",
type: l.bgPos
}, {
name: "background-width-relative-to",
type: l.bgRelativeTo
}, {
name: "background-height-relative-to",
type: l.bgRelativeTo
}, {
name: "background-repeat",
type: l.bgRepeat
}, {
name: "background-fit",
type: l.bgFit
}, {
name: "background-clip",
type: l.bgClip
}, {
name: "background-width",
type: l.bgWH
}, {
name: "background-height",
type: l.bgWH
}, {
name: "background-offset-x",
type: l.bgPos
}, {
name: "background-offset-y",
type: l.bgPos
}], E = [{
name: "position",
type: l.position,
triggersBounds: c.any
}, {
name: "compound-sizing-wrt-labels",
type: l.compoundIncludeLabels,
triggersBounds: c.any
}, {
name: "min-width",
type: l.size,
triggersBounds: c.any
}, {
name: "min-width-bias-left",
type: l.sizeMaybePercent,
triggersBounds: c.any
}, {
name: "min-width-bias-right",
type: l.sizeMaybePercent,
triggersBounds: c.any
}, {
name: "min-height",
type: l.size,
triggersBounds: c.any
}, {
name: "min-height-bias-top",
type: l.sizeMaybePercent,
triggersBounds: c.any
}, {
name: "min-height-bias-bottom",
type: l.sizeMaybePercent,
triggersBounds: c.any
}], C = [{
name: "line-style",
type: l.lineStyle
}, {
name: "line-color",
type: l.color
}, {
name: "line-fill",
type: l.fill
}, {
name: "line-cap",
type: l.lineCap
}, {
name: "line-opacity",
type: l.zeroOneNumber
}, {
name: "line-dash-pattern",
type: l.numbers
}, {
name: "line-dash-offset",
type: l.number
}, {
name: "line-outline-width",
type: l.size
}, {
name: "line-outline-color",
type: l.color
}, {
name: "line-gradient-stop-colors",
type: l.colors
}, {
name: "line-gradient-stop-positions",
type: l.percentages
}, {
name: "curve-style",
type: l.curveStyle,
triggersBounds: c.any,
triggersBoundsOfParallelBeziers: !0
}, {
name: "haystack-radius",
type: l.zeroOneNumber,
triggersBounds: c.any
}, {
name: "source-endpoint",
type: l.edgeEndpoint,
triggersBounds: c.any
}, {
name: "target-endpoint",
type: l.edgeEndpoint,
triggersBounds: c.any
}, {
name: "control-point-step-size",
type: l.size,
triggersBounds: c.any
}, {
name: "control-point-distances",
type: l.bidirectionalSizes,
triggersBounds: c.any
}, {
name: "control-point-weights",
type: l.numbers,
triggersBounds: c.any
}, {
name: "segment-distances",
type: l.bidirectionalSizes,
triggersBounds: c.any
}, {
name: "segment-weights",
type: l.numbers,
triggersBounds: c.any
}, {
name: "segment-radii",
type: l.numbers,
triggersBounds: c.any
}, {
name: "radius-type",
type: l.radiusType,
triggersBounds: c.any
}, {
name: "taxi-turn",
type: l.bidirectionalSizeMaybePercent,
triggersBounds: c.any
}, {
name: "taxi-turn-min-distance",
type: l.size,
triggersBounds: c.any
}, {
name: "taxi-direction",
type: l.axisDirection,
triggersBounds: c.any
}, {
name: "taxi-radius",
type: l.number,
triggersBounds: c.any
}, {
name: "edge-distances",
type: l.edgeDistances,
triggersBounds: c.any
}, {
name: "arrow-scale",
type: l.positiveNumber,
triggersBounds: c.any
}, {
name: "loop-direction",
type: l.angle,
triggersBounds: c.any
}, {
name: "loop-sweep",
type: l.angle,
triggersBounds: c.any
}, {
name: "source-distance-from-node",
type: l.size,
triggersBounds: c.any
}, {
name: "target-distance-from-node",
type: l.size,
triggersBounds: c.any
}], L = [{
name: "ghost",
type: l.bool,
triggersBounds: c.any
}, {
name: "ghost-offset-x",
type: l.bidirectionalSize,
triggersBounds: c.any
}, {
name: "ghost-offset-y",
type: l.bidirectionalSize,
triggersBounds: c.any
}, {
name: "ghost-opacity",
type: l.zeroOneNumber
}], A = [{
name: "selection-box-color",
type: l.color
}, {
name: "selection-box-opacity",
type: l.zeroOneNumber
}, {
name: "selection-box-border-color",
type: l.color
}, {
name: "selection-box-border-width",
type: l.size
}, {
name: "active-bg-color",
type: l.color
}, {
name: "active-bg-opacity",
type: l.zeroOneNumber
}, {
name: "active-bg-size",
type: l.size
}, {
name: "outside-texture-bg-color",
type: l.color
}, {
name: "outside-texture-bg-opacity",
type: l.zeroOneNumber
}], k = [];
si.pieBackgroundN = 16, k.push({
name: "pie-size",
type: l.sizeMaybePercent
});
for (var P = 1; P <= si.pieBackgroundN; P++)
k.push({
name: "pie-" + P + "-background-color",
type: l.color
}), k.push({
name: "pie-" + P + "-background-size",
type: l.percent
}), k.push({
name: "pie-" + P + "-background-opacity",
type: l.zeroOneNumber
});
var R = [], M = si.arrowPrefixes = ["source", "mid-source", "target", "mid-target"];
[{
name: "arrow-shape",
type: l.arrowShape,
triggersBounds: c.any
}, {
name: "arrow-color",
type: l.color
}, {
name: "arrow-fill",
type: l.arrowFill
}, {
name: "arrow-width",
type: l.arrowWidth
}].forEach(function(G) {
M.forEach(function(W) {
var Y = W + "-" + G.name, X = G.type, ie = G.triggersBounds;
R.push({
name: Y,
type: X,
triggersBounds: ie
});
});
}, {});
var O = si.properties = [].concat(m, x, y, g, v, L, p, f, u, d, h, S, _, b, T, k, E, C, R, A), D = si.propertyGroups = {
// common to all eles
behavior: m,
transition: x,
visibility: y,
overlay: g,
underlay: v,
ghost: L,
// labels
commonLabel: p,
labelDimensions: f,
mainLabel: u,
sourceLabel: d,
targetLabel: h,
// node props
nodeBody: S,
nodeBorder: _,
nodeOutline: b,
backgroundImage: T,
pie: k,
compound: E,
// edge props
edgeLine: C,
edgeArrow: R,
core: A
}, I = si.propertyGroupNames = {}, F = si.propertyGroupKeys = Object.keys(D);
F.forEach(function(G) {
I[G] = D[G].map(function(W) {
return W.name;
}), D[G].forEach(function(W) {
return W.groupKey = G;
});
});
var z = si.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"
}];
si.propertyNames = O.map(function(G) {
return G.name;
});
for (var U = 0; U < O.length; U++) {
var Z = O[U];
O[Z.name] = Z;
}
for (var re = 0; re < z.length; re++) {
var K = z[re], V = O[K.pointsTo], H = {
name: K.name,
alias: !0,
pointsTo: V
};
O.push(H), O[K.name] = H;
}
})();
si.getDefaultProperty = function(t) {
return this.getDefaultProperties()[t];
};
si.getDefaultProperties = function() {
var t = this._private;
if (t.defaultProperties != null)
return t.defaultProperties;
for (var e = bt({
// 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(c, l) {
for (var u = 1; u <= si.pieBackgroundN; u++) {
var d = l.name.replace("{{i}}", u), h = l.value;
c[d] = h;
}
return c;
}, {}), {
// 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(c, l) {
return si.arrowPrefixes.forEach(function(u) {
var d = u + "-" + l.name, h = l.value;
c[d] = h;
}), c;
}, {})), r = {}, i = 0; i < this.properties.length; i++) {
var n = this.properties[i];
if (!n.pointsTo) {
var a = n.name, o = e[a], s = this.parse(a, o);
r[a] = s;
}
}
return t.defaultProperties = r, t.defaultProperties;
};
si.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 Bg = {};
Bg.parse = function(t, e, r, i) {
var n = this;
if (xr(e))
return n.parseImplWarn(t, e, r, i);
var a = i === "mapping" || i === !0 || i === !1 || i == null ? "dontcare" : i, o = r ? "t" : "f", s = "" + e, c = AA(t, s, o, a), l = n.propCache = n.propCache || [], u;
return (u = l[c]) || (u = l[c] = n.parseImplWarn(t, e, r, i)), (r || i === "mapping") && (u = la(u), u && (u.value = la(u.value))), u;
};
Bg.parseImplWarn = function(t, e, r, i) {
var n = this.parseImpl(t, e, r, i);
return !n && e != null && Zt("The style property `".concat(t, ": ").concat(e, "` is invalid")), n && (n.name === "width" || n.name === "height") && e === "label" && Zt("The style value of `label` is deprecated for `" + n.name + "`"), n;
};
Bg.parseImpl = function(t, e, r, i) {
var n = this;
t = Lb(t);
var a = n.properties[t], o = e, s = n.types;
if (!a || e === void 0)
return null;
a.alias && (a = a.pointsTo, t = a.name);
var c = dt(e);
c && (e = e.trim());
var l = a.type;
if (!l)
return null;
if (r && (e === "" || e === null))
return {
name: t,
value: e,
bypass: !0,
deleteBypass: !0
};
if (xr(e))
return {
name: t,
value: e,
strValue: "fn",
mapped: s.fn,
bypass: r
};
var u, d;
if (!(!c || i || e.length < 7 || e[1] !== "a")) {
if (e.length >= 7 && e[0] === "d" && (u = new RegExp(s.data.regex).exec(e))) {
if (r)
return !1;
var h = s.data;
return {
name: t,
value: u,
strValue: "" + e,
mapped: h,
field: u[1],
bypass: r
};
} else if (e.length >= 10 && e[0] === "m" && (d = new RegExp(s.mapData.regex).exec(e))) {
if (r || l.multiple)
return !1;
var f = s.mapData;
if (!(l.color || l.number))
return !1;
var p = this.parse(t, d[4]);
if (!p || p.mapped)
return !1;
var m = this.parse(t, d[5]);
if (!m || m.mapped)
return !1;
if (p.pfValue === m.pfValue || p.strValue === m.strValue)
return Zt("`" + t + ": " + e + "` is not a valid mapper because the output range is zero; converting to `" + t + ": " + p.strValue + "`"), this.parse(t, p.strValue);
if (l.color) {
var y = p.value, g = m.value, v = y[0] === g[0] && y[1] === g[1] && y[2] === g[2] && // optional alpha
(y[3] === g[3] || (y[3] == null || y[3] === 1) && (g[3] == null || g[3] === 1));
if (v)
return !1;
}
return {
name: t,
value: d,
strValue: "" + e,
mapped: f,
field: d[1],
fieldMin: parseFloat(d[2]),
// min & max are numeric
fieldMax: parseFloat(d[3]),
valueMin: p.value,
valueMax: m.value,
bypass: r
};
}
}
if (l.multiple && i !== "multiple") {
var x;
if (c ? x = e.split(/\s+/) : ar(e) ? x = e : x = [e], l.evenMultiple && x.length % 2 !== 0)
return null;
for (var w = [], S = [], _ = [], b = "", T = !1, E = 0; E < x.length; E++) {
var C = n.parse(t, x[E], r, "multiple");
T = T || dt(C.value), w.push(C.value), _.push(C.pfValue != null ? C.pfValue : C.value), S.push(C.units), b += (E > 0 ? " " : "") + C.strValue;
}
return l.validate && !l.validate(w, S) ? null : l.singleEnum && T ? w.length === 1 && dt(w[0]) ? {
name: t,
value: w[0],
strValue: w[0],
bypass: r
} : null : {
name: t,
value: w,
pfValue: _,
strValue: b,
bypass: r,
units: S
};
}
var L = function() {
for (var G = 0; G < l.enums.length; G++) {
var W = l.enums[G];
if (W === e)
return {
name: t,
value: e,
strValue: "" + e,
bypass: r
};
}
return null;
};
if (l.number) {
var A, k = "px";
if (l.units && (A = l.units), l.implicitUnits && (k = l.implicitUnits), !l.unitless)
if (c) {
var P = "px|em" + (l.allowPercent ? "|\\%" : "");
A && (P = A);
var R = e.match("^(" + qr + ")(" + P + ")?$");
R && (e = R[1], A = R[2] || k);
} else (!A || l.implicitUnits) && (A = k);
if (e = parseFloat(e), isNaN(e) && l.enums === void 0)
return null;
if (isNaN(e) && l.enums !== void 0)
return e = o, L();
if (l.integer && !j8(e) || l.min !== void 0 && (e < l.min || l.strictMin && e === l.min) || l.max !== void 0 && (e > l.max || l.strictMax && e === l.max))
return null;
var M = {
name: t,
value: e,
strValue: "" + e + (A || ""),
units: A,
bypass: r
};
return l.unitless || A !== "px" && A !== "em" ? M.pfValue = e : M.pfValue = A === "px" || !A ? e : this.getEmSizeInPixels() * e, (A === "ms" || A === "s") && (M.pfValue = A === "ms" ? e : 1e3 * e), (A === "deg" || A === "rad") && (M.pfValue = A === "rad" ? e : Ej(e)), A === "%" && (M.pfValue = e / 100), M;
} else if (l.propList) {
var O = [], D = "" + e;
if (D !== "none") {
for (var I = D.split(/\s*,\s*|\s+/), F = 0; F < I.length; F++) {
var z = I[F].trim();
n.properties[z] ? O.push(z) : Zt("`" + z + "` is not a valid property name");
}
if (O.length === 0)
return null;
}
return {
name: t,
value: O,
strValue: O.length === 0 ? "none" : O.join(" "),
bypass: r
};
} else if (l.color) {
var U = oU(e);
return U ? {
name: t,
value: U,
pfValue: U,
strValue: "rgb(" + U[0] + "," + U[1] + "," + U[2] + ")",
// n.b. no spaces b/c of multiple support
bypass: r
} : null;
} else if (l.regex || l.regexes) {
if (l.enums) {
var Z = L();
if (Z)
return Z;
}
for (var re = l.regexes ? l.regexes : [l.regex], K = 0; K < re.length; K++) {
var V = new RegExp(re[K]), H = V.exec(e);
if (H)
return {
name: t,
value: l.singleRegexMatchValue ? H[1] : H,
strValue: "" + e,
bypass: r
};
}
return null;
} else return l.string ? {
name: t,
value: "" + e,
strValue: "" + e,
bypass: r
} : l.enums ? L() : null;
};
var Ti = function t(e) {
if (!(this instanceof t))
return new t(e);
if (!Ab(e)) {
Tr("A style must have a core reference");
return;
}
this._private = {
cy: e,
coreStyle: {}
}, this.length = 0, this.resetToDefault();
}, Ai = Ti.prototype;
Ai.instanceString = function() {
return "style";
};
Ai.clear = function() {
for (var t = this._private, e = t.cy, r = e.elements(), i = 0; i < this.length; i++)
this[i] = void 0;
return this.length = 0, t.contextStyles = {}, t.propDiffs = {}, this.cleanElements(r, !0), r.forEach(function(n) {
var a = n[0]._private;
a.styleDirty = !0, a.appliedInitStyle = !1;
}), this;
};
Ai.resetToDefault = function() {
return this.clear(), this.addDefaultStylesheet(), this;
};
Ai.core = function(t) {
return this._private.coreStyle[t] || this.getDefaultProperty(t);
};
Ai.selector = function(t) {
var e = t === "core" ? null : new ps(t), r = this.length++;
return this[r] = {
selector: e,
properties: [],
mappedProperties: [],
index: r
}, this;
};
Ai.css = function() {
var t = this, e = arguments;
if (e.length === 1)
for (var r = e[0], i = 0; i < t.properties.length; i++) {
var n = t.properties[i], a = r[n.name];
a === void 0 && (a = r[Sg(n.name)]), a !== void 0 && this.cssRule(n.name, a);
}
else e.length === 2 && this.cssRule(e[0], e[1]);
return this;
};
Ai.style = Ai.css;
Ai.cssRule = function(t, e) {
var r = this.parse(t, e);
if (r) {
var i = this.length - 1;
this[i].properties.push(r), this[i].properties[r.name] = r, r.name.match(/pie-(\d+)-background-size/) && r.value && (this._private.hasPie = !0), r.mapped && this[i].mappedProperties.push(r);
var n = !this[i].selector;
n && (this._private.coreStyle[r.name] = r);
}
return this;
};
Ai.append = function(t) {
return yA(t) ? t.appendToStyle(this) : ar(t) ? this.appendFromJson(t) : dt(t) && this.appendFromString(t), this;
};
Ti.fromJson = function(t, e) {
var r = new Ti(t);
return r.fromJson(e), r;
};
Ti.fromString = function(t, e) {
return new Ti(t).fromString(e);
};
[ki, op, jb, ya, Ng, Hb, si, Bg].forEach(function(t) {
bt(Ai, t);
});
Ti.types = Ai.types;
Ti.properties = Ai.properties;
Ti.propertyGroups = Ai.propertyGroups;
Ti.propertyGroupNames = Ai.propertyGroupNames;
Ti.propertyGroupKeys = Ai.propertyGroupKeys;
var GW = {
style: function(t) {
if (t) {
var e = this.setStyle(t);
e.update();
}
return this._private.style;
},
setStyle: function(t) {
var e = this._private;
return yA(t) ? e.style = t.generateStyle(this) : ar(t) ? e.style = Ti.fromJson(this, t) : dt(t) ? e.style = Ti.fromString(this, t) : e.style = Ti(this), e.style;
},
// e.g. cy.data() changed => recalc ele mappers
updateStyle: function() {
this.mutableElements().updateStyle();
}
}, WW = "single", El = {
autolock: function(t) {
if (t !== void 0)
this._private.autolock = !!t;
else
return this._private.autolock;
return this;
},
autoungrabify: function(t) {
if (t !== void 0)
this._private.autoungrabify = !!t;
else
return this._private.autoungrabify;
return this;
},
autounselectify: function(t) {
if (t !== void 0)
this._private.autounselectify = !!t;
else
return this._private.autounselectify;
return this;
},
selectionType: function(t) {
var e = this._private;
if (e.selectionType == null && (e.selectionType = WW), t !== void 0)
(t === "additive" || t === "single") && (e.selectionType = t);
else
return e.selectionType;
return this;
},
panningEnabled: function(t) {
if (t !== void 0)
this._private.panningEnabled = !!t;
else
return this._private.panningEnabled;
return this;
},
userPanningEnabled: function(t) {
if (t !== void 0)
this._private.userPanningEnabled = !!t;
else
return this._private.userPanningEnabled;
return this;
},
zoomingEnabled: function(t) {
if (t !== void 0)
this._private.zoomingEnabled = !!t;
else
return this._private.zoomingEnabled;
return this;
},
userZoomingEnabled: function(t) {
if (t !== void 0)
this._private.userZoomingEnabled = !!t;
else
return this._private.userZoomingEnabled;
return this;
},
boxSelectionEnabled: function(t) {
if (t !== void 0)
this._private.boxSelectionEnabled = !!t;
else
return this._private.boxSelectionEnabled;
return this;
},
pan: function() {
var t = arguments, e = this._private.pan, r, i, n, a, o;
switch (t.length) {
case 0:
return e;
case 1:
if (dt(t[0]))
return r = t[0], e[r];
if (Gt(t[0])) {
if (!this._private.panningEnabled)
return this;
n = t[0], a = n.x, o = n.y, Xe(a) && (e.x = a), Xe(o) && (e.y = o), this.emit("pan viewport");
}
break;
case 2:
if (!this._private.panningEnabled)
return this;
r = t[0], i = t[1], (r === "x" || r === "y") && Xe(i) && (e[r] = i), this.emit("pan viewport");
break;
}
return this.notify("viewport"), this;
},
panBy: function(t, e) {
var r = arguments, i = this._private.pan, n, a, o, s, c;
if (!this._private.panningEnabled)
return this;
switch (r.length) {
case 1:
Gt(t) && (o = r[0], s = o.x, c = o.y, Xe(s) && (i.x += s), Xe(c) && (i.y += c), this.emit("pan viewport"));
break;
case 2:
n = t, a = e, (n === "x" || n === "y") && Xe(a) && (i[n] += a), this.emit("pan viewport");
break;
}
return this.notify("viewport"), this;
},
fit: function(t, e) {
var r = this.getFitViewport(t, e);
if (r) {
var i = this._private;
i.zoom = r.zoom, i.pan = r.pan, this.emit("pan zoom viewport"), this.notify("viewport");
}
return this;
},
getFitViewport: function(t, e) {
if (Xe(t) && e === void 0 && (e = t, t = void 0), !(!this._private.panningEnabled || !this._private.zoomingEnabled)) {
var r;
if (dt(t)) {
var i = t;
t = this.$(i);
} else if (W8(t)) {
var n = t;
r = {
x1: n.x1,
y1: n.y1,
x2: n.x2,
y2: n.y2
}, r.w = r.x2 - r.x1, r.h = r.y2 - r.y1;
} else on(t) || (t = this.mutableElements());
if (!(on(t) && t.empty())) {
r = r || t.boundingBox();
var a = this.width(), o = this.height(), s;
if (e = Xe(e) ? e : 0, !isNaN(a) && !isNaN(o) && a > 0 && o > 0 && !isNaN(r.w) && !isNaN(r.h) && r.w > 0 && r.h > 0) {
s = Math.min((a - 2 * e) / r.w, (o - 2 * e) / r.h), s = s > this._private.maxZoom ? this._private.maxZoom : s, s = s < this._private.minZoom ? this._private.minZoom : s;
var c = {
// now pan to middle
x: (a - s * (r.x1 + r.x2)) / 2,
y: (o - s * (r.y1 + r.y2)) / 2
};
return {
zoom: s,
pan: c
};
}
}
}
},
zoomRange: function(t, e) {
var r = this._private;
if (e == null) {
var i = t;
t = i.min, e = i.max;
}
return Xe(t) && Xe(e) && t <= e ? (r.minZoom = t, r.maxZoom = e) : Xe(t) && e === void 0 && t <= r.maxZoom ? r.minZoom = t : Xe(e) && t === void 0 && e >= r.minZoom && (r.maxZoom = e), this;
},
minZoom: function(t) {
return t === void 0 ? this._private.minZoom : this.zoomRange({
min: t
});
},
maxZoom: function(t) {
return t === void 0 ? this._private.maxZoom : this.zoomRange({
max: t
});
},
getZoomedViewport: function(t) {
var e = this._private, r = e.pan, i = e.zoom, n, a, o = !1;
if (e.zoomingEnabled || (o = !0), Xe(t) ? a = t : Gt(t) && (a = t.level, t.position != null ? n = Cg(t.position, i, r) : t.renderedPosition != null && (n = t.renderedPosition), n != null && !e.panningEnabled && (o = !0)), a = a > e.maxZoom ? e.maxZoom : a, a = a < e.minZoom ? e.minZoom : a, o || !Xe(a) || a === i || n != null && (!Xe(n.x) || !Xe(n.y)))
return null;
if (n != null) {
var s = r, c = i, l = a, u = {
x: -l / c * (n.x - s.x) + n.x,
y: -l / c * (n.y - s.y) + n.y
};
return {
zoomed: !0,
panned: !0,
zoom: l,
pan: u
};
} else
return {
zoomed: !0,
panned: !1,
zoom: a,
pan: r
};
},
zoom: function(t) {
if (t === void 0)
return this._private.zoom;
var e = this.getZoomedViewport(t), r = this._private;
return e == null || !e.zoomed ? this : (r.zoom = e.zoom, e.panned && (r.pan.x = e.pan.x, r.pan.y = e.pan.y), this.emit("zoom" + (e.panned ? " pan" : "") + " viewport"), this.notify("viewport"), this);
},
viewport: function(t) {
var e = this._private, r = !0, i = !0, n = [], a = !1, o = !1;
if (!t)
return this;
if (Xe(t.zoom) || (r = !1), Gt(t.pan) || (i = !1), !r && !i)
return this;
if (r) {
var s = t.zoom;
s < e.minZoom || s > e.maxZoom || !e.zoomingEnabled ? a = !0 : (e.zoom = s, n.push("zoom"));
}
if (i && (!a || !t.cancelOnFailedZoom) && e.panningEnabled) {
var c = t.pan;
Xe(c.x) && (e.pan.x = c.x, o = !1), Xe(c.y) && (e.pan.y = c.y, o = !1), o || n.push("pan");
}
return n.length > 0 && (n.push("viewport"), this.emit(n.join(" ")), this.notify("viewport")), this;
},
center: function(t) {
var e = this.getCenterPan(t);
return e && (this._private.pan = e, this.emit("pan viewport"), this.notify("viewport")), this;
},
getCenterPan: function(t, e) {
if (this._private.panningEnabled) {
if (dt(t)) {
var r = t;
t = this.mutableElements().filter(r);
} else on(t) || (t = this.mutableElements());
if (t.length !== 0) {
var i = t.boundingBox(), n = this.width(), a = this.height();
e = e === void 0 ? this._private.zoom : e;
var o = {
// middle
x: (n - e * (i.x1 + i.x2)) / 2,
y: (a - e * (i.y1 + i.y2)) / 2
};
return o;
}
}
},
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 t = this._private, e = t.container, r = this;
return t.sizeCache = t.sizeCache || (e ? function() {
var i = r.window().getComputedStyle(e), n = function(a) {
return parseFloat(i.getPropertyValue(a));
};
return {
width: e.clientWidth - n("padding-left") - n("padding-right"),
height: e.clientHeight - n("padding-top") - n("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 t = this._private.pan, e = this._private.zoom, r = this.renderedExtent(), i = {
x1: (r.x1 - t.x) / e,
x2: (r.x2 - t.x) / e,
y1: (r.y1 - t.y) / e,
y2: (r.y2 - t.y) / e
};
return i.w = i.x2 - i.x1, i.h = i.y2 - i.y1, i;
},
renderedExtent: function() {
var t = this.width(), e = this.height();
return {
x1: 0,
y1: 0,
x2: t,
y2: e,
w: t,
h: e
};
},
multiClickDebounceTime: function(t) {
if (t) this._private.multiClickDebounceTime = t;
else return this._private.multiClickDebounceTime;
return this;
}
};
El.centre = El.center;
El.autolockNodes = El.autolock;
El.autoungrabifyNodes = El.autoungrabify;
var Sh = {
data: Xt.data({
field: "data",
bindingEvent: "data",
allowBinding: !0,
allowSetting: !0,
settingEvent: "data",
settingTriggersEvent: !0,
triggerFnName: "trigger",
allowGetting: !0,
updateStyle: !0
}),
removeData: Xt.removeData({
field: "data",
event: "data",
triggerFnName: "trigger",
triggerEvent: !0,
updateStyle: !0
}),
scratch: Xt.data({
field: "scratch",
bindingEvent: "scratch",
allowBinding: !0,
allowSetting: !0,
settingEvent: "scratch",
settingTriggersEvent: !0,
triggerFnName: "trigger",
allowGetting: !0,
updateStyle: !0
}),
removeScratch: Xt.removeData({
field: "scratch",
event: "scratch",
triggerFnName: "trigger",
triggerEvent: !0,
updateStyle: !0
})
};
Sh.attr = Sh.data;
Sh.removeAttr = Sh.removeData;
var zm = function(t) {
var e = this;
t = bt({}, t);
var r = t.container;
r && !Rm(r) && Rm(r[0]) && (r = r[0]);
var i = r ? r._cyreg : null;
i = i || {}, i && i.cy && (i.cy.destroy(), i = {});
var n = i.readies = i.readies || [];
r && (r._cyreg = i), i.cy = e;
var a = Hr !== void 0 && r !== void 0 && !t.headless, o = t;
o.layout = bt({
name: a ? "grid" : "null"
}, o.layout), o.renderer = bt({
name: a ? "canvas" : "null"
}, o.renderer);
var s = function(h, f, p) {
return f !== void 0 ? f : p !== void 0 ? p : h;
}, c = this._private = {
container: r,
// html dom ele container
ready: !1,
// whether ready has been triggered
options: o,
// cached options
elements: new mi(this),
// elements in the graph
listeners: [],
// list of listeners
aniEles: new mi(this),
// elements being animated
data: o.data || {},
// data for the core
scratch: {},
// scratch object for core
layout: null,
renderer: null,
destroyed: !1,
// whether destroy was called
notificationsEnabled: !0,
// whether notifications are sent to the renderer
minZoom: 1e-50,
maxZoom: 1e50,
zoomingEnabled: s(!0, o.zoomingEnabled),
userZoomingEnabled: s(!0, o.userZoomingEnabled),
panningEnabled: s(!0, o.panningEnabled),
userPanningEnabled: s(!0, o.userPanningEnabled),
boxSelectionEnabled: s(!0, o.boxSelectionEnabled),
autolock: s(!1, o.autolock, o.autolockNodes),
autoungrabify: s(!1, o.autoungrabify, o.autoungrabifyNodes),
autounselectify: s(!1, o.autounselectify),
styleEnabled: o.styleEnabled === void 0 ? a : o.styleEnabled,
zoom: Xe(o.zoom) ? o.zoom : 1,
pan: {
x: Gt(o.pan) && Xe(o.pan.x) ? o.pan.x : 0,
y: Gt(o.pan) && Xe(o.pan.y) ? o.pan.y : 0
},
animation: {
// object for currently-running animations
current: [],
queue: []
},
hasCompoundNodes: !1,
multiClickDebounceTime: s(250, o.multiClickDebounceTime)
};
this.createEmitter(), this.selectionType(o.selectionType), this.zoomRange({
min: o.minZoom,
max: o.maxZoom
});
var l = function(h, f) {
var p = h.some(q8);
if (p)
return Bu.all(h).then(f);
f(h);
};
c.styleEnabled && e.setStyle([]);
var u = bt({}, o, o.renderer);
e.initRenderer(u);
var d = function(h, f, p) {
e.notifications(!1);
var m = e.mutableElements();
m.length > 0 && m.remove(), h != null && (Gt(h) || ar(h)) && e.add(h), e.one("layoutready", function(g) {
e.notifications(!0), e.emit(g), e.one("load", f), e.emitAndNotify("load");
}).one("layoutstop", function() {
e.one("done", p), e.emit("done");
});
var y = bt({}, e._private.options.layout);
y.eles = e.elements(), e.layout(y).run();
};
l([o.style, o.elements], function(h) {
var f = h[0], p = h[1];
c.styleEnabled && e.style().append(f), d(p, function() {
e.startAnimationLoop(), c.ready = !0, xr(o.ready) && e.on("ready", o.ready);
for (var m = 0; m < n.length; m++) {
var y = n[m];
e.on("ready", y);
}
i && (i.readies = []), e.emit("ready");
}, o.done);
});
}, $m = zm.prototype;
bt($m, {
instanceString: function() {
return "core";
},
isReady: function() {
return this._private.ready;
},
destroyed: function() {
return this._private.destroyed;
},
ready: function(t) {
return this.isReady() ? this.emitter().emit("ready", [], t) : this.on("ready", t), this;
},
destroy: function() {
var t = this;
if (!t.destroyed())
return t.stopAnimationLoop(), t.destroyRenderer(), this.emit("destroy"), t._private.destroyed = !0, t;
},
hasElementWithId: function(t) {
return this._private.elements.hasElementWithId(t);
},
getElementById: function(t) {
return this._private.elements.getElementById(t);
},
hasCompoundNodes: function() {
return this._private.hasCompoundNodes;
},
headless: function() {
return this._private.renderer.isHeadless();
},
styleEnabled: function() {
return this._private.styleEnabled;
},
addToPool: function(t) {
return this._private.elements.merge(t), this;
},
removeFromPool: function(t) {
return this._private.elements.unmerge(t), this;
},
container: function() {
return this._private.container || null;
},
window: function() {
var t = this._private.container;
if (t == null) return Hr;
var e = this._private.container.ownerDocument;
return e === void 0 || e == null ? Hr : e.defaultView || Hr;
},
mount: function(t) {
if (t != null) {
var e = this, r = e._private, i = r.options;
return !Rm(t) && Rm(t[0]) && (t = t[0]), e.stopAnimationLoop(), e.destroyRenderer(), r.container = t, r.styleEnabled = !0, e.invalidateSize(), e.initRenderer(bt({}, i, i.renderer, {
// allow custom renderer name to be re-used, otherwise use canvas
name: i.renderer.name === "null" ? "canvas" : i.renderer.name
})), e.startAnimationLoop(), e.style(i.style), e.emit("mount"), e;
}
},
unmount: function() {
var t = this;
return t.stopAnimationLoop(), t.destroyRenderer(), t.initRenderer({
name: "null"
}), t.emit("unmount"), t;
},
options: function() {
return la(this._private.options);
},
json: function(t) {
var e = this, r = e._private, i = e.mutableElements(), n = function(v) {
return e.getElementById(v.id());
};
if (Gt(t)) {
if (e.startBatch(), t.elements) {
var a = {}, o = function(v, x) {
for (var w = [], S = [], _ = 0; _ < v.length; _++) {
var b = v[_];
if (!b.data.id) {
Zt("cy.json() cannot handle elements without an ID attribute");
continue;
}
var T = "" + b.data.id, E = e.getElementById(T);
a[T] = !0, E.length !== 0 ? S.push({
ele: E,
json: b
}) : (x && (b.group = x), w.push(b));
}
e.add(w);
for (var C = 0; C < S.length; C++) {
var L = S[C], A = L.ele, k = L.json;
A.json(k);
}
};
if (ar(t.elements))
o(t.elements);
else
for (var s = ["nodes", "edges"], c = 0; c < s.length; c++) {
var l = s[c], u = t.elements[l];
ar(u) && o(u, l);
}
var d = e.collection();
i.filter(function(v) {
return !a[v.id()];
}).forEach(function(v) {
v.isParent() ? d.merge(v) : v.remove();
}), d.forEach(function(v) {
return v.children().move({
parent: null
});
}), d.forEach(function(v) {
return n(v).remove();
});
}
t.style && e.style(t.style), t.zoom != null && t.zoom !== r.zoom && e.zoom(t.zoom), t.pan && (t.pan.x !== r.pan.x || t.pan.y !== r.pan.y) && e.pan(t.pan), t.data && e.data(t.data);
for (var h = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"], f = 0; f < h.length; f++) {
var p = h[f];
t[p] != null && e[p](t[p]);
}
return e.endBatch(), this;
} else {
var m = !!t, y = {};
m ? y.elements = this.elements().map(function(v) {
return v.json();
}) : (y.elements = {}, i.forEach(function(v) {
var x = v.group();
y.elements[x] || (y.elements[x] = []), y.elements[x].push(v.json());
})), this._private.styleEnabled && (y.style = e.style().json()), y.data = la(e.data());
var g = r.options;
return y.zoomingEnabled = r.zoomingEnabled, y.userZoomingEnabled = r.userZoomingEnabled, y.zoom = r.zoom, y.minZoom = r.minZoom, y.maxZoom = r.maxZoom, y.panningEnabled = r.panningEnabled, y.userPanningEnabled = r.userPanningEnabled, y.pan = la(r.pan), y.boxSelectionEnabled = r.boxSelectionEnabled, y.renderer = la(g.renderer), y.hideEdgesOnViewport = g.hideEdgesOnViewport, y.textureOnViewport = g.textureOnViewport, y.wheelSensitivity = g.wheelSensitivity, y.motionBlur = g.motionBlur, y.multiClickDebounceTime = g.multiClickDebounceTime, y;
}
}
});
$m.$id = $m.getElementById;
[IW, $W, y3, Ly, hm, UW, ky, pm, GW, El, Sh].forEach(function(t) {
bt($m, t);
});
var qW = {
fit: !0,
// whether to fit the viewport to the graph
directed: !1,
// whether the tree is directed downwards (or edges can point in any direction if false)
padding: 30,
// padding on fit
circle: !1,
// put depths in concentric circles if true, put depths top down if false
grid: !1,
// 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: !0,
// prevents node overlap, may overflow boundingBox if not enough space
nodeDimensionsIncludeLabels: !1,
// 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: !1,
// 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(t, e) {
return !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
ready: void 0,
// callback on layoutready
stop: void 0,
// callback on layoutstop
transform: function(t, e) {
return e;
}
// transform a given node position. Useful for changing flow direction in discrete layouts
}, XW = {
maximal: !1,
// 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: !1
// 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
}, ic = function(t) {
return t.scratch("breadthfirst");
}, j_ = function(t, e) {
return t.scratch("breadthfirst", e);
};
function b3(t) {
this.options = bt({}, qW, XW, t);
}
b3.prototype.run = function() {
var t = this.options, e = t, r = t.cy, i = e.eles, n = i.nodes().filter(function($) {
return !$.isParent();
}), a = i, o = e.directed, s = e.acyclic || e.maximal || e.maximalAdjustments > 0, c = Yi(e.boundingBox ? e.boundingBox : {
x1: 0,
y1: 0,
w: r.width(),
h: r.height()
}), l;
if (on(e.roots))
l = e.roots;
else if (ar(e.roots)) {
for (var u = [], d = 0; d < e.roots.length; d++) {
var h = e.roots[d], f = r.getElementById(h);
u.push(f);
}
l = r.collection(u);
} else if (dt(e.roots))
l = r.$(e.roots);
else if (o)
l = n.roots();
else {
var p = i.components();
l = r.collection();
for (var m = function($) {
var J = p[$], ne = J.maxDegree(!1), j = J.filter(function(q) {
return q.degree(!1) === ne;
});
l = l.add(j);
}, y = 0; y < p.length; y++)
m(y);
}
var g = [], v = {}, x = function($, J) {
g[J] == null && (g[J] = []);
var ne = g[J].length;
g[J].push($), j_($, {
index: ne,
depth: J
});
}, w = function($, J) {
var ne = ic($), j = ne.depth, q = ne.index;
g[j][q] = null, x($, J);
};
a.bfs({
roots: l,
directed: e.directed,
visit: function($, J, ne, j, q) {
var ge = $[0], ye = ge.id();
x(ge, q), v[ye] = !0;
}
});
for (var S = [], _ = 0; _ < n.length; _++) {
var b = n[_];
v[b.id()] || S.push(b);
}
var T = function($) {
for (var J = g[$], ne = 0; ne < J.length; ne++) {
var j = J[ne];
if (j == null) {
J.splice(ne, 1), ne--;
continue;
}
j_(j, {
depth: $,
index: ne
});
}
}, E = function() {
for (var $ = 0; $ < g.length; $++)
T($);
}, C = function($, J) {
for (var ne = ic($), j = $.incomers().filter(function(B) {
return B.isNode() && i.has(B);
}), q = -1, ge = $.id(), ye = 0; ye < j.length; ye++) {
var _e = j[ye], Me = ic(_e);
q = Math.max(q, Me.depth);
}
if (ne.depth <= q) {
if (!e.acyclic && J[ge])
return null;
var Ce = q + 1;
return w($, Ce), J[ge] = Ce, !0;
}
return !1;
};
if (o && s) {
var L = [], A = {}, k = function($) {
return L.push($);
}, P = function() {
return L.shift();
};
for (n.forEach(function($) {
return L.push($);
}); L.length > 0; ) {
var R = P(), M = C(R, A);
if (M)
R.outgoers().filter(function($) {
return $.isNode() && i.has($);
}).forEach(k);
else if (M === null) {
Zt("Detected double maximal shift for node `" + R.id() + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");
break;
}
}
}
E();
var O = 0;
if (e.avoidOverlap)
for (var D = 0; D < n.length; D++) {
var I = n[D], F = I.layoutDimensions(e), z = F.w, U = F.h;
O = Math.max(O, z, U);
}
var Z = {}, re = function($) {
if (Z[$.id()])
return Z[$.id()];
for (var J = ic($).depth, ne = $.neighborhood(), j = 0, q = 0, ge = 0; ge < ne.length; ge++) {
var ye = ne[ge];
if (!(ye.isEdge() || ye.isParent() || !n.has(ye))) {
var _e = ic(ye);
if (_e != null) {
var Me = _e.index, Ce = _e.depth;
if (!(Me == null || Ce == null)) {
var B = g[Ce].length;
Ce < J && (j += Me / B, q++);
}
}
}
}
return q = Math.max(1, q), j = j / q, q === 0 && (j = 0), Z[$.id()] = j, j;
}, K = function($, J) {
var ne = re($), j = re(J), q = ne - j;
return q === 0 ? xA($.id(), J.id()) : q;
};
e.depthSort !== void 0 && (K = e.depthSort);
for (var V = 0; V < g.length; V++)
g[V].sort(K), T(V);
for (var H = [], G = 0; G < S.length; G++)
H.push(S[G]);
g.unshift(H), E();
for (var W = 0, Y = 0; Y < g.length; Y++)
W = Math.max(g[Y].length, W);
var X = {
x: c.x1 + c.w / 2,
y: c.x1 + c.h / 2
}, ie = g.reduce(function($, J) {
return Math.max($, J.length);
}, 0), ue = function($) {
var J = ic($), ne = J.depth, j = J.index, q = g[ne].length, ge = Math.max(c.w / ((e.grid ? ie : q) + 1), O), ye = Math.max(c.h / (g.length + 1), O), _e = Math.min(c.w / 2 / g.length, c.h / 2 / g.length);
if (_e = Math.max(_e, O), e.circle) {
var Me = _e * ne + _e - (g.length > 0 && g[0].length <= 3 ? _e / 2 : 0), Ce = 2 * Math.PI / g[ne].length * j;
return ne === 0 && g[0].length === 1 && (Me = 1), {
x: X.x + Me * Math.cos(Ce),
y: X.y + Me * Math.sin(Ce)
};
} else {
var B = {
x: X.x + (j + 1 - (q + 1) / 2) * ge,
y: (ne + 1) * ye
};
return B;
}
};
return i.nodes().layoutPositions(this, e, ue), this;
};
var ZW = {
fit: !0,
// 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: !0,
// prevents node overlap, may overflow boundingBox and radius if not enough space
nodeDimensionsIncludeLabels: !1,
// 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: !0,
// 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: !1,
// 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(t, e) {
return !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
ready: void 0,
// callback on layoutready
stop: void 0,
// callback on layoutstop
transform: function(t, e) {
return e;
}
// transform a given node position. Useful for changing flow direction in discrete layouts
};
function x3(t) {
this.options = bt({}, ZW, t);
}
x3.prototype.run = function() {
var t = this.options, e = t, r = t.cy, i = e.eles, n = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, a = i.nodes().not(":parent");
e.sort && (a = a.sort(e.sort));
for (var o = Yi(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
}, c = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / a.length : e.sweep, l = c / Math.max(1, a.length - 1), u, d = 0, h = 0; h < a.length; h++) {
var f = a[h], p = f.layoutDimensions(e), m = p.w, y = p.h;
d = Math.max(d, m, y);
}
if (Xe(e.radius) ? u = e.radius : a.length <= 1 ? u = 0 : u = Math.min(o.h, o.w) / 2 - d, a.length > 1 && e.avoidOverlap) {
d *= 1.75;
var g = Math.cos(l) - Math.cos(0), v = Math.sin(l) - Math.sin(0), x = Math.sqrt(d * d / (g * g + v * v));
u = Math.max(x, u);
}
var w = function(S, _) {
var b = e.startAngle + _ * l * (n ? 1 : -1), T = u * Math.cos(b), E = u * Math.sin(b), C = {
x: s.x + T,
y: s.y + E
};
return C;
};
return i.nodes().layoutPositions(this, e, w), this;
};
var YW = {
fit: !0,
// 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: !0,
// whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)
equidistant: !1,
// 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: !0,
// prevents node overlap, may overflow boundingBox if not enough space
nodeDimensionsIncludeLabels: !1,
// 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(t) {
return t.degree();
},
levelWidth: function(t) {
return t.maxDegree() / 4;
},
animate: !1,
// 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(t, e) {
return !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
ready: void 0,
// callback on layoutready
stop: void 0,
// callback on layoutstop
transform: function(t, e) {
return e;
}
// transform a given node position. Useful for changing flow direction in discrete layouts
};
function w3(t) {
this.options = bt({}, YW, t);
}
w3.prototype.run = function() {
for (var t = this.options, e = t, r = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, i = t.cy, n = e.eles, a = n.nodes().not(":parent"), o = Yi(e.boundingBox ? e.boundingBox : {
x1: 0,
y1: 0,
w: i.width(),
h: i.height()
}), s = {
x: o.x1 + o.w / 2,
y: o.y1 + o.h / 2
}, c = [], l = 0, u = 0; u < a.length; u++) {
var d = a[u], h = void 0;
h = e.concentric(d), c.push({
value: h,
node: d
}), d._private.scratch.concentric = h;
}
a.updateStyle();
for (var f = 0; f < a.length; f++) {
var p = a[f], m = p.layoutDimensions(e);
l = Math.max(l, m.w, m.h);
}
c.sort(function($, J) {
return J.value - $.value;
});
for (var y = e.levelWidth(a), g = [[]], v = g[0], x = 0; x < c.length; x++) {
var w = c[x];
if (v.length > 0) {
var S = Math.abs(v[0].value - w.value);
S >= y && (v = [], g.push(v));
}
v.push(w);
}
var _ = l + e.minNodeSpacing;
if (!e.avoidOverlap) {
var b = g.length > 0 && g[0].length > 1, T = Math.min(o.w, o.h) / 2 - _, E = T / (g.length + b ? 1 : 0);
_ = Math.min(_, E);
}
for (var C = 0, L = 0; L < g.length; L++) {
var A = g[L], k = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / A.length : e.sweep, P = A.dTheta = k / Math.max(1, A.length - 1);
if (A.length > 1 && e.avoidOverlap) {
var R = Math.cos(P) - Math.cos(0), M = Math.sin(P) - Math.sin(0), O = Math.sqrt(_ * _ / (R * R + M * M));
C = Math.max(O, C);
}
A.r = C, C += _;
}
if (e.equidistant) {
for (var D = 0, I = 0, F = 0; F < g.length; F++) {
var z = g[F], U = z.r - I;
D = Math.max(D, U);
}
I = 0;
for (var Z = 0; Z < g.length; Z++) {
var re = g[Z];
Z === 0 && (I = re.r), re.r = I, I += D;
}
}
for (var K = {}, V = 0; V < g.length; V++)
for (var H = g[V], G = H.dTheta, W = H.r, Y = 0; Y < H.length; Y++) {
var X = H[Y], ie = e.startAngle + (r ? 1 : -1) * G * Y, ue = {
x: s.x + W * Math.cos(ie),
y: s.y + W * Math.sin(ie)
};
K[X.node.id()] = ue;
}
return n.nodes().layoutPositions(this, e, function($) {
var J = $.id();
return K[J];
}), this;
};
var Zv, KW = {
// 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: !0,
// 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(t, e) {
return !0;
},
// 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: !0,
// 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: !1,
// Randomize the initial positions of the nodes (true) or use existing positions (false)
randomize: !1,
// Extra spacing between components in non-compound graphs
componentSpacing: 40,
// Node repulsion (non overlapping) multiplier
nodeRepulsion: function(t) {
return 2048;
},
// Node repulsion (overlapping) multiplier
nodeOverlap: 4,
// Ideal edge (non nested) length
idealEdgeLength: function(t) {
return 32;
},
// Divisor to compute edge forces
edgeElasticity: function(t) {
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 Fg(t) {
this.options = bt({}, KW, t), this.options.layout = this;
var e = this.options.eles.nodes(), r = this.options.eles.edges(), i = r.filter(function(n) {
var a = n.source().data("id"), o = n.target().data("id"), s = e.some(function(l) {
return l.data("id") === a;
}), c = e.some(function(l) {
return l.data("id") === o;
});
return !s || !c;
});
this.options.eles = this.options.eles.not(i);
}
Fg.prototype.run = function() {
var t = this.options, e = t.cy, r = this;
r.stopped = !1, (t.animate === !0 || t.animate === !1) && r.emit({
type: "layoutstart",
layout: r
}), t.debug === !0 ? Zv = !0 : Zv = !1;
var i = JW(e, r, t);
Zv && t7(i), t.randomize && r7(i);
var n = ro(), a = function() {
i7(i, e, t), t.fit === !0 && e.fit(t.padding);
}, o = function(d) {
return !(r.stopped || d >= t.numIter || (n7(i, t), i.temperature = i.temperature * t.coolingFactor, i.temperature < t.minTemp));
}, s = function() {
if (t.animate === !0 || t.animate === !1)
a(), r.one("layoutstop", t.stop), r.emit({
type: "layoutstop",
layout: r
});
else {
var d = t.eles.nodes(), h = _3(i, t, d);
d.layoutPositions(r, t, h);
}
}, c = 0, l = !0;
if (t.animate === !0) {
var u = function d() {
for (var h = 0; l && h < t.refresh; )
l = o(c), c++, h++;
if (!l)
G_(i, t), s();
else {
var f = ro();
f - n >= t.animationThreshold && a(), Om(d);
}
};
u();
} else {
for (; l; )
l = o(c), c++;
G_(i, t), s();
}
return this;
};
Fg.prototype.stop = function() {
return this.stopped = !0, this.thread && this.thread.stop(), this.emit("layoutstop"), this;
};
Fg.prototype.destroy = function() {
return this.thread && this.thread.stop(), this;
};
var JW = function(t, e, r) {
for (var i = r.eles.edges(), n = r.eles.nodes(), a = Yi(r.boundingBox ? r.boundingBox : {
x1: 0,
y1: 0,
w: t.width(),
h: t.height()
}), o = {
isCompound: t.hasCompoundNodes(),
layoutNodes: [],
idToIndex: {},
nodeSize: n.size(),
graphSet: [],
indexToGraph: [],
layoutEdges: [],
edgeSize: i.size(),
temperature: r.initialTemp,
clientWidth: a.w,
clientHeight: a.h,
boundingBox: a
}, s = r.eles.components(), c = {}, l = 0; l < s.length; l++)
for (var u = s[l], d = 0; d < u.length; d++) {
var h = u[d];
c[h.id()] = l;
}
for (var l = 0; l < o.nodeSize; l++) {
var f = n[l], p = f.layoutDimensions(r), m = {};
m.isLocked = f.locked(), m.id = f.data("id"), m.parentId = f.data("parent"), m.cmptId = c[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 = xr(r.nodeRepulsion) ? r.nodeRepulsion(f) : r.nodeRepulsion, o.layoutNodes.push(m), o.idToIndex[m.id] = l;
}
for (var y = [], g = 0, v = -1, x = [], l = 0; l < o.nodeSize; l++) {
var f = o.layoutNodes[l], w = f.parentId;
w != null ? o.layoutNodes[o.idToIndex[w]].children.push(f.id) : (y[++v] = f.id, x.push(f.id));
}
for (o.graphSet.push(x); g <= v; ) {
var S = y[g++], _ = o.idToIndex[S], h = o.layoutNodes[_], b = h.children;
if (b.length > 0) {
o.graphSet.push(b);
for (var l = 0; l < b.length; l++)
y[++v] = b[l];
}
}
for (var l = 0; l < o.graphSet.length; l++)
for (var T = o.graphSet[l], d = 0; d < T.length; d++) {
var E = o.idToIndex[T[d]];
o.indexToGraph[E] = l;
}
for (var l = 0; l < o.edgeSize; l++) {
var C = i[l], L = {};
L.id = C.data("id"), L.sourceId = C.data("source"), L.targetId = C.data("target");
var A = xr(r.idealEdgeLength) ? r.idealEdgeLength(C) : r.idealEdgeLength, k = xr(r.edgeElasticity) ? r.edgeElasticity(C) : r.edgeElasticity, P = o.idToIndex[L.sourceId], R = o.idToIndex[L.targetId], M = o.indexToGraph[P], O = o.indexToGraph[R];
if (M != O) {
for (var D = QW(L.sourceId, L.targetId, o), I = o.graphSet[D], F = 0, m = o.layoutNodes[P]; I.indexOf(m.id) === -1; )
m = o.layoutNodes[o.idToIndex[m.parentId]], F++;
for (m = o.layoutNodes[R]; I.indexOf(m.id) === -1; )
m = o.layoutNodes[o.idToIndex[m.parentId]], F++;
A *= F * r.nestingFactor;
}
L.idealLength = A, L.elasticity = k, o.layoutEdges.push(L);
}
return o;
}, QW = function(t, e, r) {
var i = e7(t, e, 0, r);
return 2 > i.count ? 0 : i.graph;
}, e7 = function t(e, r, i, n) {
var a = n.graphSet[i];
if (-1 < a.indexOf(e) && -1 < a.indexOf(r))
return {
count: 2,
graph: i
};
for (var o = 0, s = 0; s < a.length; s++) {
var c = a[s], l = n.idToIndex[c], u = n.layoutNodes[l].children;
if (u.length !== 0) {
var d = n.indexToGraph[n.idToIndex[u[0]]], h = t(e, r, d, n);
if (h.count !== 0)
if (h.count === 1) {
if (o++, o === 2)
break;
} else
return h;
}
}
return {
count: o,
graph: i
};
}, t7, r7 = function(t, e) {
for (var r = t.clientWidth, i = t.clientHeight, n = 0; n < t.nodeSize; n++) {
var a = t.layoutNodes[n];
a.children.length === 0 && !a.isLocked && (a.positionX = Math.random() * r, a.positionY = Math.random() * i);
}
}, _3 = function(t, e, r) {
var i = t.boundingBox, n = {
x1: 1 / 0,
x2: -1 / 0,
y1: 1 / 0,
y2: -1 / 0
};
return e.boundingBox && (r.forEach(function(a) {
var o = t.layoutNodes[t.idToIndex[a.data("id")]];
n.x1 = Math.min(n.x1, o.positionX), n.x2 = Math.max(n.x2, o.positionX), n.y1 = Math.min(n.y1, o.positionY), n.y2 = Math.max(n.y2, o.positionY);
}), n.w = n.x2 - n.x1, n.h = n.y2 - n.y1), function(a, o) {
var s = t.layoutNodes[t.idToIndex[a.data("id")]];
if (e.boundingBox) {
var c = (s.positionX - n.x1) / n.w, l = (s.positionY - n.y1) / n.h;
return {
x: i.x1 + c * i.w,
y: i.y1 + l * i.h
};
} else
return {
x: s.positionX,
y: s.positionY
};
};
}, i7 = function(t, e, r) {
var i = r.layout, n = r.eles.nodes(), a = _3(t, r, n);
n.positions(a), t.ready !== !0 && (t.ready = !0, i.one("layoutready", r.ready), i.emit({
type: "layoutready",
layout: this
}));
}, n7 = function(t, e, r) {
a7(t, e), l7(t), c7(t, e), u7(t), d7(t);
}, a7 = function(t, e) {
for (var r = 0; r < t.graphSet.length; r++)
for (var i = t.graphSet[r], n = i.length, a = 0; a < n; a++)
for (var o = t.layoutNodes[t.idToIndex[i[a]]], s = a + 1; s < n; s++) {
var c = t.layoutNodes[t.idToIndex[i[s]]];
o7(o, c, t, e);
}
}, H_ = function(t) {
return -t + 2 * t * Math.random();
}, o7 = function(t, e, r, i) {
var n = t.cmptId, a = e.cmptId;
if (!(n !== a && !r.isCompound)) {
var o = e.positionX - t.positionX, s = e.positionY - t.positionY, c = 1;
o === 0 && s === 0 && (o = H_(c), s = H_(c));
var l = s7(t, e, o, s);
if (l > 0)
var y = i.nodeOverlap * l, m = Math.sqrt(o * o + s * s), g = y * o / m, v = y * s / m;
else
var u = Vm(t, o, s), d = Vm(e, -1 * o, -1 * s), h = d.x - u.x, f = d.y - u.y, p = h * h + f * f, m = Math.sqrt(p), y = (t.nodeRepulsion + e.nodeRepulsion) / p, g = y * h / m, v = y * f / m;
t.isLocked || (t.offsetX -= g, t.offsetY -= v), e.isLocked || (e.offsetX += g, e.offsetY += v);
}
}, s7 = function(t, e, r, i) {
if (r > 0)
var n = t.maxX - e.minX;
else
var n = e.maxX - t.minX;
if (i > 0)
var a = t.maxY - e.minY;
else
var a = e.maxY - t.minY;
return n >= 0 && a >= 0 ? Math.sqrt(n * n + a * a) : 0;
}, Vm = function(t, e, r) {
var i = t.positionX, n = t.positionY, a = t.height || 1, o = t.width || 1, s = r / e, c = a / o, l = {};
return e === 0 && 0 < r || e === 0 && 0 > r ? (l.x = i, l.y = n + a / 2, l) : 0 < e && -1 * c <= s && s <= c ? (l.x = i + o / 2, l.y = n + o * r / 2 / e, l) : 0 > e && -1 * c <= s && s <= c ? (l.x = i - o / 2, l.y = n - o * r / 2 / e, l) : 0 < r && (s <= -1 * c || s >= c) ? (l.x = i + a * e / 2 / r, l.y = n + a / 2, l) : (0 > r && (s <= -1 * c || s >= c) && (l.x = i - a * e / 2 / r, l.y = n - a / 2), l);
}, l7 = function(t, e) {
for (var r = 0; r < t.edgeSize; r++) {
var i = t.layoutEdges[r], n = t.idToIndex[i.sourceId], a = t.layoutNodes[n], o = t.idToIndex[i.targetId], s = t.layoutNodes[o], c = s.positionX - a.positionX, l = s.positionY - a.positionY;
if (!(c === 0 && l === 0)) {
var u = Vm(a, c, l), d = Vm(s, -1 * c, -1 * l), h = d.x - u.x, f = d.y - u.y, p = Math.sqrt(h * h + f * f), m = Math.pow(i.idealLength - p, 2) / i.elasticity;
if (p !== 0)
var y = m * h / p, g = m * f / p;
else
var y = 0, g = 0;
a.isLocked || (a.offsetX += y, a.offsetY += g), s.isLocked || (s.offsetX -= y, s.offsetY -= g);
}
}
}, c7 = function(t, e) {
if (e.gravity !== 0)
for (var r = 1, i = 0; i < t.graphSet.length; i++) {
var n = t.graphSet[i], a = n.length;
if (i === 0)
var c = t.clientHeight / 2, l = t.clientWidth / 2;
else
var o = t.layoutNodes[t.idToIndex[n[0]]], s = t.layoutNodes[t.idToIndex[o.parentId]], c = s.positionX, l = s.positionY;
for (var u = 0; u < a; u++) {
var d = t.layoutNodes[t.idToIndex[n[u]]];
if (!d.isLocked) {
var h = c - d.positionX, f = l - d.positionY, p = Math.sqrt(h * h + f * f);
if (p > r) {
var m = e.gravity * h / p, y = e.gravity * f / p;
d.offsetX += m, d.offsetY += y;
}
}
}
}
}, u7 = function(t, e) {
var r = [], i = 0, n = -1;
for (r.push.apply(r, t.graphSet[0]), n += t.graphSet[0].length; i <= n; ) {
var a = r[i++], o = t.idToIndex[a], s = t.layoutNodes[o], c = s.children;
if (0 < c.length && !s.isLocked) {
for (var l = s.offsetX, u = s.offsetY, d = 0; d < c.length; d++) {
var h = t.layoutNodes[t.idToIndex[c[d]]];
h.offsetX += l, h.offsetY += u, r[++n] = c[d];
}
s.offsetX = 0, s.offsetY = 0;
}
}
}, d7 = function(t, e) {
for (var r = 0; r < t.nodeSize; r++) {
var i = t.layoutNodes[r];
0 < i.children.length && (i.maxX = void 0, i.minX = void 0, i.maxY = void 0, i.minY = void 0);
}
for (var r = 0; r < t.nodeSize; r++) {
var i = t.layoutNodes[r];
if (!(0 < i.children.length || i.isLocked)) {
var n = h7(i.offsetX, i.offsetY, t.temperature);
i.positionX += n.x, i.positionY += n.y, i.offsetX = 0, i.offsetY = 0, i.minX = i.positionX - i.width, i.maxX = i.positionX + i.width, i.minY = i.positionY - i.height, i.maxY = i.positionY + i.height, p7(i, t);
}
}
for (var r = 0; r < t.nodeSize; r++) {
var i = t.layoutNodes[r];
0 < i.children.length && !i.isLocked && (i.positionX = (i.maxX + i.minX) / 2, i.positionY = (i.maxY + i.minY) / 2, i.width = i.maxX - i.minX, i.height = i.maxY - i.minY);
}
}, h7 = function(t, e, r) {
var i = Math.sqrt(t * t + e * e);
if (i > r)
var n = {
x: r * t / i,
y: r * e / i
};
else
var n = {
x: t,
y: e
};
return n;
}, p7 = function t(e, r) {
var i = e.parentId;
if (i != null) {
var n = r.layoutNodes[r.idToIndex[i]], a = !1;
if ((n.maxX == null || e.maxX + n.padRight > n.maxX) && (n.maxX = e.maxX + n.padRight, a = !0), (n.minX == null || e.minX - n.padLeft < n.minX) && (n.minX = e.minX - n.padLeft, a = !0), (n.maxY == null || e.maxY + n.padBottom > n.maxY) && (n.maxY = e.maxY + n.padBottom, a = !0), (n.minY == null || e.minY - n.padTop < n.minY) && (n.minY = e.minY - n.padTop, a = !0), a)
return t(n, r);
}
}, G_ = function(t, e) {
for (var r = t.layoutNodes, i = [], n = 0; n < r.length; n++) {
var a = r[n], o = a.cmptId, s = i[o] = i[o] || [];
s.push(a);
}
for (var c = 0, n = 0; n < i.length; n++) {
var l = i[n];
if (l) {
l.x1 = 1 / 0, l.x2 = -1 / 0, l.y1 = 1 / 0, l.y2 = -1 / 0;
for (var u = 0; u < l.length; u++) {
var d = l[u];
l.x1 = Math.min(l.x1, d.positionX - d.width / 2), l.x2 = Math.max(l.x2, d.positionX + d.width / 2), l.y1 = Math.min(l.y1, d.positionY - d.height / 2), l.y2 = Math.max(l.y2, d.positionY + d.height / 2);
}
l.w = l.x2 - l.x1, l.h = l.y2 - l.y1, c += l.w * l.h;
}
}
i.sort(function(g, v) {
return v.w * v.h - g.w * g.h;
});
for (var h = 0, f = 0, p = 0, m = 0, y = Math.sqrt(c) * t.clientWidth / t.clientHeight, n = 0; n < i.length; n++) {
var l = i[n];
if (l) {
for (var u = 0; u < l.length; u++) {
var d = l[u];
d.isLocked || (d.positionX += h - l.x1, d.positionY += f - l.y1);
}
h += l.w + e.componentSpacing, p += l.w + e.componentSpacing, m = Math.max(m, l.h), p > y && (f += m + e.componentSpacing, h = 0, p = 0, m = 0);
}
}
}, f7 = {
fit: !0,
// 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: !0,
// prevents node overlap, may overflow boundingBox if not enough space
avoidOverlapPadding: 10,
// extra spacing around nodes when avoidOverlap: true
nodeDimensionsIncludeLabels: !1,
// 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: !1,
// 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(t) {
},
// 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: !1,
// 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(t, e) {
return !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
ready: void 0,
// callback on layoutready
stop: void 0,
// callback on layoutstop
transform: function(t, e) {
return e;
}
// transform a given node position. Useful for changing flow direction in discrete layouts
};
function S3(t) {
this.options = bt({}, f7, t);
}
S3.prototype.run = function() {
var t = this.options, e = t, r = t.cy, i = e.eles, n = i.nodes().not(":parent");
e.sort && (n = n.sort(e.sort));
var a = Yi(e.boundingBox ? e.boundingBox : {
x1: 0,
y1: 0,
w: r.width(),
h: r.height()
});
if (a.h === 0 || a.w === 0)
i.nodes().layoutPositions(this, e, function(Z) {
return {
x: a.x1,
y: a.y1
};
});
else {
var o = n.size(), s = Math.sqrt(o * a.h / a.w), c = Math.round(s), l = Math.round(a.w / a.h * s), u = function(Z) {
if (Z == null)
return Math.min(c, l);
var re = Math.min(c, l);
re == c ? c = Z : l = Z;
}, d = function(Z) {
if (Z == null)
return Math.max(c, l);
var re = Math.max(c, l);
re == c ? c = Z : l = Z;
}, h = e.rows, f = e.cols != null ? e.cols : e.columns;
if (h != null && f != null)
c = h, l = f;
else if (h != null && f == null)
c = h, l = Math.ceil(o / c);
else if (h == null && f != null)
l = f, c = Math.ceil(o / l);
else if (l * c > o) {
var p = u(), m = d();
(p - 1) * m >= o ? u(p - 1) : (m - 1) * p >= o && d(m - 1);
} else
for (; l * c < o; ) {
var y = u(), g = d();
(g + 1) * y >= o ? d(g + 1) : u(y + 1);
}
var v = a.w / l, x = a.h / c;
if (e.condense && (v = 0, x = 0), e.avoidOverlap)
for (var w = 0; w < n.length; w++) {
var S = n[w], _ = S._private.position;
(_.x == null || _.y == null) && (_.x = 0, _.y = 0);
var b = S.layoutDimensions(e), T = e.avoidOverlapPadding, E = b.w + T, C = b.h + T;
v = Math.max(v, E), x = Math.max(x, C);
}
for (var L = {}, A = function(Z, re) {
return !!L["c-" + Z + "-" + re];
}, k = function(Z, re) {
L["c-" + Z + "-" + re] = !0;
}, P = 0, R = 0, M = function() {
R++, R >= l && (R = 0, P++);
}, O = {}, D = 0; D < n.length; D++) {
var I = n[D], F = e.position(I);
if (F && (F.row !== void 0 || F.col !== void 0)) {
var z = {
row: F.row,
col: F.col
};
if (z.col === void 0)
for (z.col = 0; A(z.row, z.col); )
z.col++;
else if (z.row === void 0)
for (z.row = 0; A(z.row, z.col); )
z.row++;
O[I.id()] = z, k(z.row, z.col);
}
}
var U = function(Z, re) {
var K, V;
if (Z.locked() || Z.isParent())
return !1;
var H = O[Z.id()];
if (H)
K = H.col * v + v / 2 + a.x1, V = H.row * x + x / 2 + a.y1;
else {
for (; A(P, R); )
M();
K = R * v + v / 2 + a.x1, V = P * x + x / 2 + a.y1, k(P, R), M();
}
return {
x: K,
y: V
};
};
n.layoutPositions(this, e, U);
}
return this;
};
var m7 = {
ready: function() {
},
// on layoutready
stop: function() {
}
// on layoutstop
};
function Gb(t) {
this.options = bt({}, m7, t);
}
Gb.prototype.run = function() {
var t = this.options, e = t.eles, r = this;
return t.cy, r.emit("layoutstart"), e.nodes().positions(function() {
return {
x: 0,
y: 0
};
}), r.one("layoutready", t.ready), r.emit("layoutready"), r.one("layoutstop", t.stop), r.emit("layoutstop"), this;
};
Gb.prototype.stop = function() {
return this;
};
var g7 = {
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: !0,
// 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: !1,
// 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(t, e) {
return !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
ready: void 0,
// callback on layoutready
stop: void 0,
// callback on layoutstop
transform: function(t, e) {
return e;
}
// transform a given node position. Useful for changing flow direction in discrete layouts
};
function M3(t) {
this.options = bt({}, g7, t);
}
M3.prototype.run = function() {
var t = this.options, e = t.eles, r = e.nodes(), i = xr(t.positions);
function n(a) {
if (t.positions == null)
return xj(a.position());
if (i)
return t.positions(a);
var o = t.positions[a._private.data.id];
return o ?? null;
}
return r.layoutPositions(this, t, function(a, o) {
var s = n(a);
return a.locked() || s == null ? !1 : s;
}), this;
};
var v7 = {
fit: !0,
// 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: !1,
// 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(t, e) {
return !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
ready: void 0,
// callback on layoutready
stop: void 0,
// callback on layoutstop
transform: function(t, e) {
return e;
}
// transform a given node position. Useful for changing flow direction in discrete layouts
};
function E3(t) {
this.options = bt({}, v7, t);
}
E3.prototype.run = function() {
var t = this.options, e = t.cy, r = t.eles, i = Yi(t.boundingBox ? t.boundingBox : {
x1: 0,
y1: 0,
w: e.width(),
h: e.height()
}), n = function(a, o) {
return {
x: i.x1 + Math.round(Math.random() * i.w),
y: i.y1 + Math.round(Math.random() * i.h)
};
};
return r.nodes().layoutPositions(this, t, n), this;
};
var y7 = [{
name: "breadthfirst",
impl: b3
}, {
name: "circle",
impl: x3
}, {
name: "concentric",
impl: w3
}, {
name: "cose",
impl: Fg
}, {
name: "grid",
impl: S3
}, {
name: "null",
impl: Gb
}, {
name: "preset",
impl: M3
}, {
name: "random",
impl: E3
}];
function T3(t) {
this.options = t, this.notifications = 0;
}
var W_ = function() {
}, q_ = function() {
throw new Error("A headless instance can not render images");
};
T3.prototype = {
recalculateRenderedStyle: W_,
notify: function() {
this.notifications++;
},
init: W_,
isHeadless: function() {
return !0;
},
png: q_,
jpg: q_
};
var Wb = {};
Wb.arrowShapeWidth = 0.3;
Wb.registerArrowShapes = function() {
var t = this.arrowShapes = {}, e = this, r = function(c, l, u, d, h, f, p) {
var m = h.x - u / 2 - p, y = h.x + u / 2 + p, g = h.y - u / 2 - p, v = h.y + u / 2 + p, x = m <= c && c <= y && g <= l && l <= v;
return x;
}, i = function(c, l, u, d, h) {
var f = c * Math.cos(d) - l * Math.sin(d), p = c * Math.sin(d) + l * Math.cos(d), m = f * u, y = p * u, g = m + h.x, v = y + h.y;
return {
x: g,
y: v
};
}, n = function(c, l, u, d) {
for (var h = [], f = 0; f < c.length; f += 2) {
var p = c[f], m = c[f + 1];
h.push(i(p, m, l, u, d));
}
return h;
}, a = function(c) {
for (var l = [], u = 0; u < c.length; u++) {
var d = c[u];
l.push(d.x, d.y);
}
return l;
}, o = function(c) {
return c.pstyle("width").pfValue * c.pstyle("arrow-scale").pfValue * 2;
}, s = function(c, l) {
dt(l) && (l = t[l]), t[c] = bt({
name: c,
points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3],
collide: function(u, d, h, f, p, m) {
var y = a(n(this.points, h + 2 * m, f, p)), g = Vi(u, d, y);
return g;
},
roughCollide: r,
draw: function(u, d, h, f) {
var p = n(this.points, d, h, f);
e.arrowShapeImpl("polygon")(u, p);
},
spacing: function(u) {
return 0;
},
gap: o
}, l);
};
s("none", {
collide: Dm,
roughCollide: Dm,
draw: Pb,
spacing: i_,
gap: i_
}), s("triangle", {
points: [-0.15, -0.3, 0, 0, 0.15, -0.3]
}), s("arrow", "triangle"), s("triangle-backcurve", {
points: t.triangle.points,
controlPoint: [0, -0.15],
roughCollide: r,
draw: function(c, l, u, d, h) {
var f = n(this.points, l, u, d), p = this.controlPoint, m = i(p[0], p[1], l, u, d);
e.arrowShapeImpl(this.name)(c, f, m);
},
gap: function(c) {
return o(c) * 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(c, l, u, d, h, f, p) {
var m = a(n(this.points, u + 2 * p, d, h)), y = a(n(this.pointsTee, u + 2 * p, d, h)), g = Vi(c, l, m) || Vi(c, l, y);
return g;
},
draw: function(c, l, u, d, h) {
var f = n(this.points, l, u, d), p = n(this.pointsTee, l, u, d);
e.arrowShapeImpl(this.name)(c, 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(c, l, u, d, h, f, p) {
var m = h, y = Math.pow(m.x - c, 2) + Math.pow(m.y - l, 2) <= Math.pow((u + 2 * p) * this.radius, 2), g = a(n(this.points, u + 2 * p, d, h));
return Vi(c, l, g) || y;
},
draw: function(c, l, u, d, h) {
var f = n(this.pointsTr, l, u, d);
e.arrowShapeImpl(this.name)(c, f, d.x, d.y, this.radius * l);
},
spacing: function(c) {
return e.getArrowWidth(c.pstyle("width").pfValue, c.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(c, l) {
var u = this.baseCrossLinePts.slice(), d = l / c, h = 3, f = 5;
return u[h] = u[h] - d, u[f] = u[f] - d, u;
},
collide: function(c, l, u, d, h, f, p) {
var m = a(n(this.points, u + 2 * p, d, h)), y = a(n(this.crossLinePts(u, f), u + 2 * p, d, h)), g = Vi(c, l, m) || Vi(c, l, y);
return g;
},
draw: function(c, l, u, d, h) {
var f = n(this.points, l, u, d), p = n(this.crossLinePts(l, h), l, u, d);
e.arrowShapeImpl(this.name)(c, f, p);
}
}), s("vee", {
points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15],
gap: function(c) {
return o(c) * 0.525;
}
}), s("circle", {
radius: 0.15,
collide: function(c, l, u, d, h, f, p) {
var m = h, y = Math.pow(m.x - c, 2) + Math.pow(m.y - l, 2) <= Math.pow((u + 2 * p) * this.radius, 2);
return y;
},
draw: function(c, l, u, d, h) {
e.arrowShapeImpl(this.name)(c, d.x, d.y, this.radius * l);
},
spacing: function(c) {
return e.getArrowWidth(c.pstyle("width").pfValue, c.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(c) {
return 1;
},
gap: function(c) {
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(c) {
return c.pstyle("width").pfValue * c.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(c) {
return 0.95 * c.pstyle("width").pfValue * c.pstyle("arrow-scale").value;
}
});
};
var Vl = {};
Vl.projectIntoViewport = function(t, e) {
var r = this.cy, i = this.findContainerClientCoords(), n = i[0], a = i[1], o = i[4], s = r.pan(), c = r.zoom(), l = ((t - n) / o - s.x) / c, u = ((e - a) / o - s.y) / c;
return [l, u];
};
Vl.findContainerClientCoords = function() {
if (this.containerBB)
return this.containerBB;
var t = this.container, e = t.getBoundingClientRect(), r = this.cy.window().getComputedStyle(t), i = function(y) {
return parseFloat(r.getPropertyValue(y));
}, n = {
left: i("padding-left"),
right: i("padding-right"),
top: i("padding-top"),
bottom: i("padding-bottom")
}, a = {
left: i("border-left-width"),
right: i("border-right-width"),
top: i("border-top-width"),
bottom: i("border-bottom-width")
}, o = t.clientWidth, s = t.clientHeight, c = n.left + n.right, l = n.top + n.bottom, u = a.left + a.right, d = e.width / (o + u), h = o - c, f = s - l, p = e.left + n.left + a.left, m = e.top + n.top + a.top;
return this.containerBB = [p, m, h, f, d];
};
Vl.invalidateContainerClientCoordsCache = function() {
this.containerBB = null;
};
Vl.findNearestElement = function(t, e, r, i) {
return this.findNearestElements(t, e, r, i)[0];
};
Vl.findNearestElements = function(t, e, r, i) {
var n = this, a = this, o = a.getCachedZSortedEles(), s = [], c = a.cy.zoom(), l = a.cy.hasCompoundNodes(), u = (i ? 24 : 8) / c, d = (i ? 8 : 2) / c, h = (i ? 8 : 2) / c, f = 1 / 0, p, m;
r && (o = o.interactive);
function y(b, T) {
if (b.isNode()) {
if (m)
return;
m = b, s.push(b);
}
if (b.isEdge() && (T == null || T < f))
if (p) {
if (p.pstyle("z-compound-depth").value === b.pstyle("z-compound-depth").value && p.pstyle("z-compound-depth").value === b.pstyle("z-compound-depth").value) {
for (var E = 0; E < s.length; E++)
if (s[E].isEdge()) {
s[E] = b, p = b, f = T ?? f;
break;
}
}
} else
s.push(b), p = b, f = T ?? f;
}
function g(b) {
var T = b.outerWidth() + 2 * d, E = b.outerHeight() + 2 * d, C = T / 2, L = E / 2, A = b.position(), k = b.pstyle("corner-radius").value === "auto" ? "auto" : b.pstyle("corner-radius").pfValue, P = b._private.rscratch;
if (A.x - C <= t && t <= A.x + C && A.y - L <= e && e <= A.y + L) {
var R = a.nodeShapes[n.getNodeShape(b)];
if (R.checkPoint(t, e, 0, T, E, A.x, A.y, k, P))
return y(b, 0), !0;
}
}
function v(b) {
var T = b._private, E = T.rscratch, C = b.pstyle("width").pfValue, L = b.pstyle("arrow-scale").value, A = C / 2 + u, k = A * A, P = A * 2, R = T.source, M = T.target, O;
if (E.edgeType === "segments" || E.edgeType === "straight" || E.edgeType === "haystack") {
for (var D = E.allpts, I = 0; I + 3 < D.length; I += 2)
if (Oj(t, e, D[I], D[I + 1], D[I + 2], D[I + 3], P) && k > (O = Fj(t, e, D[I], D[I + 1], D[I + 2], D[I + 3])))
return y(b, O), !0;
} else if (E.edgeType === "bezier" || E.edgeType === "multibezier" || E.edgeType === "self" || E.edgeType === "compound") {
for (var D = E.allpts, I = 0; I + 5 < E.allpts.length; I += 4)
if (Dj(t, e, D[I], D[I + 1], D[I + 2], D[I + 3], D[I + 4], D[I + 5], P) && k > (O = Bj(t, e, D[I], D[I + 1], D[I + 2], D[I + 3], D[I + 4], D[I + 5])))
return y(b, O), !0;
}
for (var R = R || T.source, M = M || T.target, F = n.getArrowWidth(C, L), z = [{
name: "source",
x: E.arrowStartX,
y: E.arrowStartY,
angle: E.srcArrowAngle
}, {
name: "target",
x: E.arrowEndX,
y: E.arrowEndY,
angle: E.tgtArrowAngle
}, {
name: "mid-source",
x: E.midX,
y: E.midY,
angle: E.midsrcArrowAngle
}, {
name: "mid-target",
x: E.midX,
y: E.midY,
angle: E.midtgtArrowAngle
}], I = 0; I < z.length; I++) {
var U = z[I], Z = a.arrowShapes[b.pstyle(U.name + "-arrow-shape").value], re = b.pstyle("width").pfValue;
if (Z.roughCollide(t, e, F, U.angle, {
x: U.x,
y: U.y
}, re, u) && Z.collide(t, e, F, U.angle, {
x: U.x,
y: U.y
}, re, u))
return y(b), !0;
}
l && s.length > 0 && (g(R), g(M));
}
function x(b, T, E) {
return $n(b, T, E);
}
function w(b, T) {
var E = b._private, C = h, L;
T ? L = T + "-" : L = "", b.boundingBox();
var A = E.labelBounds[T || "main"], k = b.pstyle(L + "label").value, P = b.pstyle("text-events").strValue === "yes";
if (!(!P || !k)) {
var R = x(E.rscratch, "labelX", T), M = x(E.rscratch, "labelY", T), O = x(E.rscratch, "labelAngle", T), D = b.pstyle(L + "text-margin-x").pfValue, I = b.pstyle(L + "text-margin-y").pfValue, F = A.x1 - C - D, z = A.x2 + C - D, U = A.y1 - C - I, Z = A.y2 + C - I;
if (O) {
var re = Math.cos(O), K = Math.sin(O), V = function(ie, ue) {
return ie = ie - R, ue = ue - M, {
x: ie * re - ue * K + R,
y: ie * K + ue * re + M
};
}, H = V(F, U), G = V(F, Z), W = V(z, U), Y = V(z, Z), X = [
// with the margin added after the rotation is applied
H.x + D,
H.y + I,
W.x + D,
W.y + I,
Y.x + D,
Y.y + I,
G.x + D,
G.y + I
];
if (Vi(t, e, X))
return y(b), !0;
} else if (iu(A, t, e))
return y(b), !0;
}
}
for (var S = o.length - 1; S >= 0; S--) {
var _ = o[S];
_.isNode() ? g(_) || w(_) : v(_) || w(_) || w(_, "source") || w(_, "target");
}
return s;
};
Vl.getAllInBox = function(t, e, r, i) {
var n = this.getCachedZSortedEles().interactive, a = [], o = Math.min(t, r), s = Math.max(t, r), c = Math.min(e, i), l = Math.max(e, i);
t = o, r = s, e = c, i = l;
for (var u = Yi({
x1: t,
y1: e,
x2: r,
y2: i
}), d = 0; d < n.length; d++) {
var h = n[d];
if (h.isNode()) {
var f = h, p = f.boundingBox({
includeNodes: !0,
includeEdges: !1,
includeLabels: !1
});
Db(u, p) && !IA(p, u) && a.push(f);
} else {
var m = h, y = m._private, g = y.rscratch;
if (g.startX != null && g.startY != null && !iu(u, g.startX, g.startY) || g.endX != null && g.endY != null && !iu(u, 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 v = y.rstyle.bezierPts || y.rstyle.linePts || y.rstyle.haystackPts, x = !0, w = 0; w < v.length; w++)
if (!Rj(u, v[w])) {
x = !1;
break;
}
x && a.push(m);
} else (g.edgeType === "haystack" || g.edgeType === "straight") && a.push(m);
}
}
return a;
};
var Um = {};
Um.calculateArrowAngles = function(t) {
var e = t._private.rscratch, r = e.edgeType === "haystack", i = e.edgeType === "bezier", n = e.edgeType === "multibezier", a = e.edgeType === "segments", o = e.edgeType === "compound", s = e.edgeType === "self", c, l, u, d, h, f, g, v;
if (r ? (u = e.haystackPts[0], d = e.haystackPts[1], h = e.haystackPts[2], f = e.haystackPts[3]) : (u = e.arrowStartX, d = e.arrowStartY, h = e.arrowEndX, f = e.arrowEndY), g = e.midX, v = e.midY, a)
c = u - e.segpts[0], l = d - e.segpts[1];
else if (n || o || s || i) {
var p = e.allpts, m = ei(p[0], p[2], p[4], 0.1), y = ei(p[1], p[3], p[5], 0.1);
c = u - m, l = d - y;
} else
c = u - g, l = d - v;
e.srcArrowAngle = Up(c, l);
var g = e.midX, v = e.midY;
if (r && (g = (u + h) / 2, v = (d + f) / 2), c = h - u, l = f - d, a) {
var p = e.allpts;
if (p.length / 2 % 2 === 0) {
var x = p.length / 2, w = x - 2;
c = p[x] - p[w], l = p[x + 1] - p[w + 1];
} else if (e.isRound)
c = e.midVector[1], l = -e.midVector[0];
else {
var x = p.length / 2 - 1, w = x - 2;
c = p[x] - p[w], l = p[x + 1] - p[w + 1];
}
} else if (n || o || s) {
var p = e.allpts, S = e.ctrlpts, _, b, T, E;
if (S.length / 2 % 2 === 0) {
var C = p.length / 2 - 1, L = C + 2, A = L + 2;
_ = ei(p[C], p[L], p[A], 0), b = ei(p[C + 1], p[L + 1], p[A + 1], 0), T = ei(p[C], p[L], p[A], 1e-4), E = ei(p[C + 1], p[L + 1], p[A + 1], 1e-4);
} else {
var L = p.length / 2 - 1, C = L - 2, A = L + 2;
_ = ei(p[C], p[L], p[A], 0.4999), b = ei(p[C + 1], p[L + 1], p[A + 1], 0.4999), T = ei(p[C], p[L], p[A], 0.5), E = ei(p[C + 1], p[L + 1], p[A + 1], 0.5);
}
c = T - _, l = E - b;
}
if (e.midtgtArrowAngle = Up(c, l), e.midDispX = c, e.midDispY = l, c *= -1, l *= -1, a) {
var p = e.allpts;
if (p.length / 2 % 2 !== 0 && !e.isRound) {
var x = p.length / 2 - 1, k = x + 2;
c = -(p[k] - p[x]), l = -(p[k + 1] - p[x + 1]);
}
}
if (e.midsrcArrowAngle = Up(c, l), a)
c = h - e.segpts[e.segpts.length - 2], l = f - e.segpts[e.segpts.length - 1];
else if (n || o || s || i) {
var p = e.allpts, P = p.length, m = ei(p[P - 6], p[P - 4], p[P - 2], 0.9), y = ei(p[P - 5], p[P - 3], p[P - 1], 0.9);
c = h - m, l = f - y;
} else
c = h - g, l = f - v;
e.tgtArrowAngle = Up(c, l);
};
Um.getArrowWidth = Um.getArrowHeight = function(t, e) {
var r = this.arrowWidthCache = this.arrowWidthCache || {}, i = r[t + ", " + e];
return i || (i = Math.max(Math.pow(t * 13.37, 0.9), 29) * e, r[t + ", " + e] = i, i);
};
var Py, Ry, ra = {}, gn = {}, X_, Z_, Qs, fm, Pa, zs, Zs, ta, nc, Kp, C3, A3, Oy, Dy, Y_, K_ = function(t, e, r) {
r.x = e.x - t.x, r.y = e.y - t.y, r.len = Math.sqrt(r.x * r.x + r.y * r.y), r.nx = r.x / r.len, r.ny = r.y / r.len, r.ang = Math.atan2(r.ny, r.nx);
}, b7 = function(t, e) {
e.x = t.x * -1, e.y = t.y * -1, e.nx = t.nx * -1, e.ny = t.ny * -1, e.ang = t.ang > 0 ? -(Math.PI - t.ang) : Math.PI + t.ang;
}, x7 = function(t, e, r, i, n) {
if (t !== Y_ ? K_(e, t, ra) : b7(gn, ra), K_(e, r, gn), X_ = ra.nx * gn.ny - ra.ny * gn.nx, Z_ = ra.nx * gn.nx - ra.ny * -gn.ny, Pa = Math.asin(Math.max(-1, Math.min(1, X_))), Math.abs(Pa) < 1e-6) {
Py = e.x, Ry = e.y, Zs = nc = 0;
return;
}
Qs = 1, fm = !1, Z_ < 0 ? Pa < 0 ? Pa = Math.PI + Pa : (Pa = Math.PI - Pa, Qs = -1, fm = !0) : Pa > 0 && (Qs = -1, fm = !0), e.radius !== void 0 ? nc = e.radius : nc = i, zs = Pa / 2, Kp = Math.min(ra.len / 2, gn.len / 2), n ? (ta = Math.abs(Math.cos(zs) * nc / Math.sin(zs)), ta > Kp ? (ta = Kp, Zs = Math.abs(ta * Math.sin(zs) / Math.cos(zs))) : Zs = nc) : (ta = Math.min(Kp, nc), Zs = Math.abs(ta * Math.sin(zs) / Math.cos(zs))), Oy = e.x + gn.nx * ta, Dy = e.y + gn.ny * ta, Py = Oy - gn.ny * Zs * Qs, Ry = Dy + gn.nx * Zs * Qs, C3 = e.x + ra.nx * ta, A3 = e.y + ra.ny * ta, Y_ = e;
};
function L3(t, e) {
e.radius === 0 ? t.lineTo(e.cx, e.cy) : t.arc(e.cx, e.cy, e.radius, e.startAngle, e.endAngle, e.counterClockwise);
}
function qb(t, e, r, i) {
var n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0;
return i === 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
} : (x7(t, e, r, i, n), {
cx: Py,
cy: Ry,
radius: Zs,
startX: C3,
startY: A3,
stopX: Oy,
stopY: Dy,
startAngle: ra.ang + Math.PI / 2 * Qs,
endAngle: gn.ang - Math.PI / 2 * Qs,
counterClockwise: fm
});
}
var Pi = {};
Pi.findMidptPtsEtc = function(t, e) {
var r = e.posPts, i = e.intersectionPts, n = e.vectorNormInverse, a, o = t.pstyle("source-endpoint"), s = t.pstyle("target-endpoint"), c = o.units != null && s.units != null, l = function(w, S, _, b) {
var T = b - S, E = _ - w, C = Math.sqrt(E * E + T * T);
return {
x: -T / C,
y: E / C
};
}, u = t.pstyle("edge-distances").value;
switch (u) {
case "node-position":
a = r;
break;
case "intersection":
a = i;
break;
case "endpoints": {
if (c) {
var d = this.manualEndptToPx(t.source()[0], o), h = Fn(d, 2), f = h[0], p = h[1], m = this.manualEndptToPx(t.target()[0], s), y = Fn(m, 2), g = y[0], v = y[1], x = {
x1: f,
y1: p,
x2: g,
y2: v
};
n = l(f, p, g, v), a = x;
} else
Zt("Edge ".concat(t.id(), " has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")), a = i;
break;
}
}
return {
midptPts: a,
vectorNormInverse: n
};
};
Pi.findHaystackPoints = function(t) {
for (var e = 0; e < t.length; e++) {
var r = t[e], i = r._private, n = i.rscratch;
if (!n.haystack) {
var a = Math.random() * 2 * Math.PI;
n.source = {
x: Math.cos(a),
y: Math.sin(a)
}, a = Math.random() * 2 * Math.PI, n.target = {
x: Math.cos(a),
y: Math.sin(a)
};
}
var o = i.source, s = i.target, c = o.position(), l = s.position(), u = o.width(), d = s.width(), h = o.height(), f = s.height(), p = r.pstyle("haystack-radius").value, m = p / 2;
n.haystackPts = n.allpts = [n.source.x * u * m + c.x, n.source.y * h * m + c.y, n.target.x * d * m + l.x, n.target.y * f * m + l.y], n.midX = (n.allpts[0] + n.allpts[2]) / 2, n.midY = (n.allpts[1] + n.allpts[3]) / 2, n.edgeType = "haystack", n.haystack = !0, this.storeEdgeProjections(r), this.calculateArrowAngles(r), this.recalculateEdgeLabelProjections(r), this.calculateLabelAngles(r);
}
};
Pi.findSegmentsPoints = function(t, e) {
var r = t._private.rscratch, i = t.pstyle("segment-weights"), n = t.pstyle("segment-distances"), a = t.pstyle("segment-radii"), o = t.pstyle("radius-type"), s = Math.min(i.pfValue.length, n.pfValue.length), c = a.pfValue[a.pfValue.length - 1], l = o.pfValue[o.pfValue.length - 1];
r.edgeType = "segments", r.segpts = [], r.radii = [], r.isArcRadius = [];
for (var u = 0; u < s; u++) {
var d = i.pfValue[u], h = n.pfValue[u], f = 1 - d, p = d, m = this.findMidptPtsEtc(t, e), y = m.midptPts, g = m.vectorNormInverse, v = {
x: y.x1 * f + y.x2 * p,
y: y.y1 * f + y.y2 * p
};
r.segpts.push(v.x + g.x * h, v.y + g.y * h), r.radii.push(a.pfValue[u] !== void 0 ? a.pfValue[u] : c), r.isArcRadius.push((o.pfValue[u] !== void 0 ? o.pfValue[u] : l) === "arc-radius");
}
};
Pi.findLoopPoints = function(t, e, r, i) {
var n = t._private.rscratch, a = e.dirCounts, o = e.srcPos, s = t.pstyle("control-point-distances"), c = s ? s.pfValue[0] : void 0, l = t.pstyle("loop-direction").pfValue, u = t.pstyle("loop-sweep").pfValue, d = t.pstyle("control-point-step-size").pfValue;
n.edgeType = "self";
var h = r, f = d;
i && (h = 0, f = c);
var p = l - Math.PI / 2, m = p - u / 2, y = p + u / 2, g = l + "_" + u;
h = a[g] === void 0 ? a[g] = 0 : ++a[g], n.ctrlpts = [o.x + Math.cos(m) * 1.4 * f * (h / 3 + 1), o.y + Math.sin(m) * 1.4 * f * (h / 3 + 1), o.x + Math.cos(y) * 1.4 * f * (h / 3 + 1), o.y + Math.sin(y) * 1.4 * f * (h / 3 + 1)];
};
Pi.findCompoundLoopPoints = function(t, e, r, i) {
var n = t._private.rscratch;
n.edgeType = "compound";
var a = e.srcPos, o = e.tgtPos, s = e.srcW, c = e.srcH, l = e.tgtW, u = e.tgtH, d = t.pstyle("control-point-step-size").pfValue, h = t.pstyle("control-point-distances"), f = h ? h.pfValue[0] : void 0, p = r, m = d;
i && (p = 0, m = f);
var y = 50, g = {
x: a.x - s / 2,
y: a.y - c / 2
}, v = {
x: o.x - l / 2,
y: o.y - u / 2
}, x = {
x: Math.min(g.x, v.x),
y: Math.min(g.y, v.y)
}, w = 0.5, S = Math.max(w, Math.log(s * 0.01)), _ = Math.max(w, Math.log(l * 0.01));
n.ctrlpts = [x.x, x.y - (1 + Math.pow(y, 1.12) / 100) * m * (p / 3 + 1) * S, x.x - (1 + Math.pow(y, 1.12) / 100) * m * (p / 3 + 1) * _, x.y];
};
Pi.findStraightEdgePoints = function(t) {
t._private.rscratch.edgeType = "straight";
};
Pi.findBezierPoints = function(t, e, r, i, n) {
var a = t._private.rscratch, o = t.pstyle("control-point-step-size").pfValue, s = t.pstyle("control-point-distances"), c = t.pstyle("control-point-weights"), l = s && c ? Math.min(s.value.length, c.value.length) : 1, u = s ? s.pfValue[0] : void 0, d = c.value[0], h = i;
a.edgeType = h ? "multibezier" : "bezier", a.ctrlpts = [];
for (var f = 0; f < l; f++) {
var p = (0.5 - e.eles.length / 2 + r) * o * (n ? -1 : 1), m = void 0, y = OA(p);
h && (u = s ? s.pfValue[f] : o, d = c.value[f]), i ? m = u : m = u !== void 0 ? y * u : void 0;
var g = m !== void 0 ? m : p, v = 1 - d, x = d, w = this.findMidptPtsEtc(t, e), S = w.midptPts, _ = w.vectorNormInverse, b = {
x: S.x1 * v + S.x2 * x,
y: S.y1 * v + S.y2 * x
};
a.ctrlpts.push(b.x + _.x * g, b.y + _.y * g);
}
};
Pi.findTaxiPoints = function(t, e) {
var r = t._private.rscratch;
r.edgeType = "segments";
var i = "vertical", n = "horizontal", a = "leftward", o = "rightward", s = "downward", c = "upward", l = "auto", u = e.posPts, d = e.srcW, h = e.srcH, f = e.tgtW, p = e.tgtH, m = t.pstyle("edge-distances").value, y = m !== "node-position", g = t.pstyle("taxi-direction").value, v = g, x = t.pstyle("taxi-turn"), w = x.units === "%", S = x.pfValue, _ = S < 0, b = t.pstyle("taxi-turn-min-distance").pfValue, T = y ? (d + f) / 2 : 0, E = y ? (h + p) / 2 : 0, C = u.x2 - u.x1, L = u.y2 - u.y1, A = function(He, We) {
return He > 0 ? Math.max(He - We, 0) : Math.min(He + We, 0);
}, k = A(C, T), P = A(L, E), R = !1;
v === l ? g = Math.abs(k) > Math.abs(P) ? n : i : v === c || v === s ? (g = i, R = !0) : (v === a || v === o) && (g = n, R = !0);
var M = g === i, O = M ? P : k, D = M ? L : C, I = OA(D), F = !1;
!(R && (w || _)) && (v === s && D < 0 || v === c && D > 0 || v === a && D > 0 || v === o && D < 0) && (I *= -1, O = I * Math.abs(O), F = !0);
var z;
if (w) {
var U = S < 0 ? 1 + S : S;
z = U * O;
} else {
var Z = S < 0 ? O : 0;
z = Z + S * I;
}
var re = function(He) {
return Math.abs(He) < b || Math.abs(He) >= Math.abs(O);
}, K = re(z), V = re(Math.abs(O) - Math.abs(z)), H = K || V;
if (H && !F)
if (M) {
var G = Math.abs(D) <= h / 2, W = Math.abs(C) <= f / 2;
if (G) {
var Y = (u.x1 + u.x2) / 2, X = u.y1, ie = u.y2;
r.segpts = [Y, X, Y, ie];
} else if (W) {
var ue = (u.y1 + u.y2) / 2, $ = u.x1, J = u.x2;
r.segpts = [$, ue, J, ue];
} else
r.segpts = [u.x1, u.y2];
} else {
var ne = Math.abs(D) <= d / 2, j = Math.abs(L) <= p / 2;
if (ne) {
var q = (u.y1 + u.y2) / 2, ge = u.x1, ye = u.x2;
r.segpts = [ge, q, ye, q];
} else if (j) {
var _e = (u.x1 + u.x2) / 2, Me = u.y1, Ce = u.y2;
r.segpts = [_e, Me, _e, Ce];
} else
r.segpts = [u.x2, u.y1];
}
else if (M) {
var B = u.y1 + z + (y ? h / 2 * I : 0), ce = u.x1, ve = u.x2;
r.segpts = [ce, B, ve, B];
} else {
var te = u.x1 + z + (y ? d / 2 * I : 0), pe = u.y1, fe = u.y2;
r.segpts = [te, pe, te, fe];
}
if (r.isRound) {
var he = t.pstyle("taxi-radius").value, Te = t.pstyle("radius-type").value[0] === "arc-radius";
r.radii = new Array(r.segpts.length / 2).fill(he), r.isArcRadius = new Array(r.segpts.length / 2).fill(Te);
}
};
Pi.tryToCorrectInvalidPoints = function(t, e) {
var r = t._private.rscratch;
if (r.edgeType === "bezier") {
var i = e.srcPos, n = e.tgtPos, a = e.srcW, o = e.srcH, s = e.tgtW, c = e.tgtH, l = e.srcShape, u = e.tgtShape, d = e.srcCornerRadius, h = e.tgtCornerRadius, f = e.srcRs, p = e.tgtRs, m = !Xe(r.startX) || !Xe(r.startY), y = !Xe(r.arrowStartX) || !Xe(r.arrowStartY), g = !Xe(r.endX) || !Xe(r.endY), v = !Xe(r.arrowEndX) || !Xe(r.arrowEndY), x = 3, w = this.getArrowWidth(t.pstyle("width").pfValue, t.pstyle("arrow-scale").value) * this.arrowShapeWidth, S = x * w, _ = _l({
x: r.ctrlpts[0],
y: r.ctrlpts[1]
}, {
x: r.startX,
y: r.startY
}), b = _ < S, T = _l({
x: r.ctrlpts[0],
y: r.ctrlpts[1]
}, {
x: r.endX,
y: r.endY
}), E = T < S, C = !1;
if (m || y || b) {
C = !0;
var L = {
// delta
x: r.ctrlpts[0] - i.x,
y: r.ctrlpts[1] - i.y
}, A = Math.sqrt(L.x * L.x + L.y * L.y), k = {
// normalised delta
x: L.x / A,
y: L.y / A
}, P = Math.max(a, o), R = {
// *2 radius guarantees outside shape
x: r.ctrlpts[0] + k.x * 2 * P,
y: r.ctrlpts[1] + k.y * 2 * P
}, M = l.intersectLine(i.x, i.y, a, o, R.x, R.y, 0, d, f);
b ? (r.ctrlpts[0] = r.ctrlpts[0] + k.x * (S - _), r.ctrlpts[1] = r.ctrlpts[1] + k.y * (S - _)) : (r.ctrlpts[0] = M[0] + k.x * S, r.ctrlpts[1] = M[1] + k.y * S);
}
if (g || v || E) {
C = !0;
var O = {
// delta
x: r.ctrlpts[0] - n.x,
y: r.ctrlpts[1] - n.y
}, D = Math.sqrt(O.x * O.x + O.y * O.y), I = {
// normalised delta
x: O.x / D,
y: O.y / D
}, F = Math.max(a, o), z = {
// *2 radius guarantees outside shape
x: r.ctrlpts[0] + I.x * 2 * F,
y: r.ctrlpts[1] + I.y * 2 * F
}, U = u.intersectLine(n.x, n.y, s, c, z.x, z.y, 0, h, p);
E ? (r.ctrlpts[0] = r.ctrlpts[0] + I.x * (S - T), r.ctrlpts[1] = r.ctrlpts[1] + I.y * (S - T)) : (r.ctrlpts[0] = U[0] + I.x * S, r.ctrlpts[1] = U[1] + I.y * S);
}
C && this.findEndpoints(t);
}
};
Pi.storeAllpts = function(t) {
var e = t._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 i, n;
e.ctrlpts.length / 2 % 2 === 0 ? (i = e.allpts.length / 2 - 1, e.midX = e.allpts[i], e.midY = e.allpts[i + 1]) : (i = e.allpts.length / 2 - 3, n = 0.5, e.midX = ei(e.allpts[i], e.allpts[i + 2], e.allpts[i + 4], n), e.midY = ei(e.allpts[i + 1], e.allpts[i + 3], e.allpts[i + 5], n));
} 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 a = 2; a + 3 < e.allpts.length; a += 2) {
var o = e.radii[a / 2 - 1], s = e.isArcRadius[a / 2 - 1];
e.roundCorners.push(qb({
x: e.allpts[a - 2],
y: e.allpts[a - 1]
}, {
x: e.allpts[a],
y: e.allpts[a + 1],
radius: o
}, {
x: e.allpts[a + 2],
y: e.allpts[a + 3]
}, o, s));
}
}
if (e.segpts.length % 4 === 0) {
var c = e.segpts.length / 2, l = c - 2;
e.midX = (e.segpts[l] + e.segpts[c]) / 2, e.midY = (e.segpts[l + 1] + e.segpts[c + 1]) / 2;
} else {
var u = e.segpts.length / 2 - 1;
if (!e.isRound)
e.midX = e.segpts[u], e.midY = e.segpts[u + 1];
else {
var d = {
x: e.segpts[u],
y: e.segpts[u + 1]
}, h = e.roundCorners[u / 2], f = [d.x - h.cx, d.y - h.cy], p = h.radius / Math.sqrt(Math.pow(f[0], 2) + Math.pow(f[1], 2));
f = f.map(function(m) {
return m * p;
}), e.midX = h.cx + f[0], e.midY = h.cy + f[1], e.midVector = f;
}
}
}
};
Pi.checkForInvalidEdgeWarning = function(t) {
var e = t[0]._private.rscratch;
e.nodesOverlap || Xe(e.startX) && Xe(e.startY) && Xe(e.endX) && Xe(e.endY) ? e.loggedErr = !1 : e.loggedErr || (e.loggedErr = !0, Zt("Edge `" + t.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."));
};
Pi.findEdgeControlPoints = function(t) {
var e = this;
if (!(!t || t.length === 0)) {
for (var r = this, i = r.cy, n = i.hasCompoundNodes(), a = {
map: new ca(),
get: function(_) {
var b = this.map.get(_[0]);
return b != null ? b.get(_[1]) : null;
},
set: function(_, b) {
var T = this.map.get(_[0]);
T == null && (T = new ca(), this.map.set(_[0], T)), T.set(_[1], b);
}
}, o = [], s = [], c = 0; c < t.length; c++) {
var l = t[c], u = l._private, d = l.pstyle("curve-style").value;
if (!(l.removed() || !l.takesUpSpace())) {
if (d === "haystack") {
s.push(l);
continue;
}
var h = d === "unbundled-bezier" || d.endsWith("segments") || d === "straight" || d === "straight-triangle" || d.endsWith("taxi"), f = d === "unbundled-bezier" || d === "bezier", p = u.source, m = u.target, y = p.poolIndex(), g = m.poolIndex(), v = [y, g].sort(), x = a.get(v);
x == null && (x = {
eles: []
}, a.set(v, x), o.push(v)), x.eles.push(l), h && (x.hasUnbundled = !0), f && (x.hasBezier = !0);
}
}
for (var w = function(_) {
var b = o[_], T = a.get(b), E = void 0;
if (!T.hasUnbundled) {
var C = T.eles[0].parallelEdges().filter(function(ve) {
return ve.isBundledBezier();
});
Rb(T.eles), C.forEach(function(ve) {
return T.eles.push(ve);
}), T.eles.sort(function(ve, te) {
return ve.poolIndex() - te.poolIndex();
});
}
var L = T.eles[0], A = L.source(), k = L.target();
if (A.poolIndex() > k.poolIndex()) {
var P = A;
A = k, k = P;
}
var R = T.srcPos = A.position(), M = T.tgtPos = k.position(), O = T.srcW = A.outerWidth(), D = T.srcH = A.outerHeight(), I = T.tgtW = k.outerWidth(), F = T.tgtH = k.outerHeight(), z = T.srcShape = r.nodeShapes[e.getNodeShape(A)], U = T.tgtShape = r.nodeShapes[e.getNodeShape(k)], Z = T.srcCornerRadius = A.pstyle("corner-radius").value === "auto" ? "auto" : A.pstyle("corner-radius").pfValue, re = T.tgtCornerRadius = k.pstyle("corner-radius").value === "auto" ? "auto" : k.pstyle("corner-radius").pfValue, K = T.tgtRs = k._private.rscratch, V = T.srcRs = A._private.rscratch;
T.dirCounts = {
north: 0,
west: 0,
south: 0,
east: 0,
northwest: 0,
southwest: 0,
northeast: 0,
southeast: 0
};
for (var H = 0; H < T.eles.length; H++) {
var G = T.eles[H], W = G[0]._private.rscratch, Y = G.pstyle("curve-style").value, X = Y === "unbundled-bezier" || Y.endsWith("segments") || Y.endsWith("taxi"), ie = !A.same(G.source());
if (!T.calculatedIntersection && A !== k && (T.hasBezier || T.hasUnbundled)) {
T.calculatedIntersection = !0;
var ue = z.intersectLine(R.x, R.y, O, D, M.x, M.y, 0, Z, V), $ = T.srcIntn = ue, J = U.intersectLine(M.x, M.y, I, F, R.x, R.y, 0, re, K), ne = T.tgtIntn = J, j = T.intersectionPts = {
x1: ue[0],
x2: J[0],
y1: ue[1],
y2: J[1]
}, q = T.posPts = {
x1: R.x,
x2: M.x,
y1: R.y,
y2: M.y
}, ge = J[1] - ue[1], ye = J[0] - ue[0], _e = Math.sqrt(ye * ye + ge * ge), Me = T.vector = {
x: ye,
y: ge
}, Ce = T.vectorNorm = {
x: Me.x / _e,
y: Me.y / _e
}, B = {
x: -Ce.y,
y: Ce.x
};
T.nodesOverlap = !Xe(_e) || U.checkPoint(ue[0], ue[1], 0, I, F, M.x, M.y, re, K) || z.checkPoint(J[0], J[1], 0, O, D, R.x, R.y, Z, V), T.vectorNormInverse = B, E = {
nodesOverlap: T.nodesOverlap,
dirCounts: T.dirCounts,
calculatedIntersection: !0,
hasBezier: T.hasBezier,
hasUnbundled: T.hasUnbundled,
eles: T.eles,
srcPos: M,
tgtPos: R,
srcW: I,
srcH: F,
tgtW: O,
tgtH: D,
srcIntn: ne,
tgtIntn: $,
srcShape: U,
tgtShape: z,
posPts: {
x1: q.x2,
y1: q.y2,
x2: q.x1,
y2: q.y1
},
intersectionPts: {
x1: j.x2,
y1: j.y2,
x2: j.x1,
y2: j.y1
},
vector: {
x: -Me.x,
y: -Me.y
},
vectorNorm: {
x: -Ce.x,
y: -Ce.y
},
vectorNormInverse: {
x: -B.x,
y: -B.y
}
};
}
var ce = ie ? E : T;
W.nodesOverlap = ce.nodesOverlap, W.srcIntn = ce.srcIntn, W.tgtIntn = ce.tgtIntn, W.isRound = Y.startsWith("round"), n && (A.isParent() || A.isChild() || k.isParent() || k.isChild()) && (A.parents().anySame(k) || k.parents().anySame(A) || A.same(k) && A.isParent()) ? e.findCompoundLoopPoints(G, ce, H, X) : A === k ? e.findLoopPoints(G, ce, H, X) : Y.endsWith("segments") ? e.findSegmentsPoints(G, ce) : Y.endsWith("taxi") ? e.findTaxiPoints(G, ce) : Y === "straight" || !X && T.eles.length % 2 === 1 && H === Math.floor(T.eles.length / 2) ? e.findStraightEdgePoints(G) : e.findBezierPoints(G, ce, H, X, ie), e.findEndpoints(G), e.tryToCorrectInvalidPoints(G, ce), e.checkForInvalidEdgeWarning(G), e.storeAllpts(G), e.storeEdgeProjections(G), e.calculateArrowAngles(G), e.recalculateEdgeLabelProjections(G), e.calculateLabelAngles(G);
}
}, S = 0; S < o.length; S++)
w(S);
this.findHaystackPoints(s);
}
};
function k3(t) {
var e = [];
if (t != null) {
for (var r = 0; r < t.length; r += 2) {
var i = t[r], n = t[r + 1];
e.push({
x: i,
y: n
});
}
return e;
}
}
Pi.getSegmentPoints = function(t) {
var e = t[0]._private.rscratch, r = e.edgeType;
if (r === "segments")
return this.recalculateRenderedStyle(t), k3(e.segpts);
};
Pi.getControlPoints = function(t) {
var e = t[0]._private.rscratch, r = e.edgeType;
if (r === "bezier" || r === "multibezier" || r === "self" || r === "compound")
return this.recalculateRenderedStyle(t), k3(e.ctrlpts);
};
Pi.getEdgeMidpoint = function(t) {
var e = t[0]._private.rscratch;
return this.recalculateRenderedStyle(t), {
x: e.midX,
y: e.midY
};
};
var sp = {};
sp.manualEndptToPx = function(t, e) {
var r = this, i = t.position(), n = t.outerWidth(), a = t.outerHeight(), o = t._private.rscratch;
if (e.value.length === 2) {
var s = [e.pfValue[0], e.pfValue[1]];
return e.units[0] === "%" && (s[0] = s[0] * n), e.units[1] === "%" && (s[1] = s[1] * a), s[0] += i.x, s[1] += i.y, s;
} else {
var c = e.pfValue[0];
c = -Math.PI / 2 + c;
var l = 2 * Math.max(n, a), u = [i.x + Math.cos(c) * l, i.y + Math.sin(c) * l];
return r.nodeShapes[this.getNodeShape(t)].intersectLine(i.x, i.y, n, a, u[0], u[1], 0, t.pstyle("corner-radius").value === "auto" ? "auto" : t.pstyle("corner-radius").pfValue, o);
}
};
sp.findEndpoints = function(t) {
var e = this, r, i = t.source()[0], n = t.target()[0], a = i.position(), o = n.position(), s = t.pstyle("target-arrow-shape").value, c = t.pstyle("source-arrow-shape").value, l = t.pstyle("target-distance-from-node").pfValue, u = t.pstyle("source-distance-from-node").pfValue, d = i._private.rscratch, h = n._private.rscratch, f = t.pstyle("curve-style").value, p = t._private.rscratch, m = p.edgeType, y = f === "taxi", g = m === "self" || m === "compound", v = m === "bezier" || m === "multibezier" || g, x = m !== "bezier", w = m === "straight" || m === "segments", S = m === "segments", _ = v || x || w, b = g || y, T = t.pstyle("source-endpoint"), E = b ? "outside-to-node" : T.value, C = i.pstyle("corner-radius").value === "auto" ? "auto" : i.pstyle("corner-radius").pfValue, L = t.pstyle("target-endpoint"), A = b ? "outside-to-node" : L.value, k = n.pstyle("corner-radius").value === "auto" ? "auto" : n.pstyle("corner-radius").pfValue;
p.srcManEndpt = T, p.tgtManEndpt = L;
var P, R, M, O;
if (v) {
var D = [p.ctrlpts[0], p.ctrlpts[1]], I = x ? [p.ctrlpts[p.ctrlpts.length - 2], p.ctrlpts[p.ctrlpts.length - 1]] : D;
P = I, R = D;
} else if (w) {
var F = S ? p.segpts.slice(0, 2) : [o.x, o.y], z = S ? p.segpts.slice(p.segpts.length - 2) : [a.x, a.y];
P = z, R = F;
}
if (A === "inside-to-node")
r = [o.x, o.y];
else if (L.units)
r = this.manualEndptToPx(n, L);
else if (A === "outside-to-line")
r = p.tgtIntn;
else if (A === "outside-to-node" || A === "outside-to-node-or-label" ? M = P : (A === "outside-to-line" || A === "outside-to-line-or-label") && (M = [a.x, a.y]), r = e.nodeShapes[this.getNodeShape(n)].intersectLine(o.x, o.y, n.outerWidth(), n.outerHeight(), M[0], M[1], 0, k, h), A === "outside-to-node-or-label" || A === "outside-to-line-or-label") {
var U = n._private.rscratch, Z = U.labelWidth, re = U.labelHeight, K = U.labelX, V = U.labelY, H = Z / 2, G = re / 2, W = n.pstyle("text-valign").value;
W === "top" ? V -= G : W === "bottom" && (V += G);
var Y = n.pstyle("text-halign").value;
Y === "left" ? K -= H : Y === "right" && (K += H);
var X = bh(M[0], M[1], [K - H, V - G, K + H, V - G, K + H, V + G, K - H, V + G], o.x, o.y);
if (X.length > 0) {
var ie = a, ue = qs(ie, Oc(r)), $ = qs(ie, Oc(X)), J = ue;
if ($ < ue && (r = X, J = $), X.length > 2) {
var ne = qs(ie, {
x: X[2],
y: X[3]
});
ne < J && (r = [X[2], X[3]]);
}
}
}
var j = jp(r, P, e.arrowShapes[s].spacing(t) + l), q = jp(r, P, e.arrowShapes[s].gap(t) + l);
if (p.endX = q[0], p.endY = q[1], p.arrowEndX = j[0], p.arrowEndY = j[1], E === "inside-to-node")
r = [a.x, a.y];
else if (T.units)
r = this.manualEndptToPx(i, T);
else if (E === "outside-to-line")
r = p.srcIntn;
else if (E === "outside-to-node" || E === "outside-to-node-or-label" ? O = R : (E === "outside-to-line" || E === "outside-to-line-or-label") && (O = [o.x, o.y]), r = e.nodeShapes[this.getNodeShape(i)].intersectLine(a.x, a.y, i.outerWidth(), i.outerHeight(), O[0], O[1], 0, C, d), E === "outside-to-node-or-label" || E === "outside-to-line-or-label") {
var ge = i._private.rscratch, ye = ge.labelWidth, _e = ge.labelHeight, Me = ge.labelX, Ce = ge.labelY, B = ye / 2, ce = _e / 2, ve = i.pstyle("text-valign").value;
ve === "top" ? Ce -= ce : ve === "bottom" && (Ce += ce);
var te = i.pstyle("text-halign").value;
te === "left" ? Me -= B : te === "right" && (Me += B);
var pe = bh(O[0], O[1], [Me - B, Ce - ce, Me + B, Ce - ce, Me + B, Ce + ce, Me - B, Ce + ce], a.x, a.y);
if (pe.length > 0) {
var fe = o, he = qs(fe, Oc(r)), Te = qs(fe, Oc(pe)), He = he;
if (Te < he && (r = [pe[0], pe[1]], He = Te), pe.length > 2) {
var We = qs(fe, {
x: pe[2],
y: pe[3]
});
We < He && (r = [pe[2], pe[3]]);
}
}
}
var Ie = jp(r, R, e.arrowShapes[c].spacing(t) + u), qe = jp(r, R, e.arrowShapes[c].gap(t) + u);
p.startX = qe[0], p.startY = qe[1], p.arrowStartX = Ie[0], p.arrowStartY = Ie[1], _ && (!Xe(p.startX) || !Xe(p.startY) || !Xe(p.endX) || !Xe(p.endY) ? p.badLine = !0 : p.badLine = !1);
};
sp.getSourceEndpoint = function(t) {
var e = t[0]._private.rscratch;
switch (this.recalculateRenderedStyle(t), e.edgeType) {
case "haystack":
return {
x: e.haystackPts[0],
y: e.haystackPts[1]
};
default:
return {
x: e.arrowStartX,
y: e.arrowStartY
};
}
};
sp.getTargetEndpoint = function(t) {
var e = t[0]._private.rscratch;
switch (this.recalculateRenderedStyle(t), e.edgeType) {
case "haystack":
return {
x: e.haystackPts[2],
y: e.haystackPts[3]
};
default:
return {
x: e.arrowEndX,
y: e.arrowEndY
};
}
};
var Xb = {};
function w7(t, e, r) {
for (var i = function(c, l, u, d) {
return ei(c, l, u, d);
}, n = e._private, a = n.rstyle.bezierPts, o = 0; o < t.bezierProjPcts.length; o++) {
var s = t.bezierProjPcts[o];
a.push({
x: i(r[0], r[2], r[4], s),
y: i(r[1], r[3], r[5], s)
});
}
}
Xb.storeEdgeProjections = function(t) {
var e = t._private, r = e.rscratch, i = r.edgeType;
if (e.rstyle.bezierPts = null, e.rstyle.linePts = null, e.rstyle.haystackPts = null, i === "multibezier" || i === "bezier" || i === "self" || i === "compound") {
e.rstyle.bezierPts = [];
for (var n = 0; n + 5 < r.allpts.length; n += 4)
w7(this, t, r.allpts.slice(n, n + 6));
} else if (i === "segments")
for (var a = e.rstyle.linePts = [], n = 0; n + 1 < r.allpts.length; n += 2)
a.push({
x: r.allpts[n],
y: r.allpts[n + 1]
});
else if (i === "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(t.pstyle("width").pfValue, t.pstyle("arrow-scale").value) * this.arrowShapeWidth;
};
Xb.recalculateEdgeProjections = function(t) {
this.findEdgeControlPoints(t);
};
var Ea = {};
Ea.recalculateNodeLabelProjection = function(t) {
var e = t.pstyle("label").strValue;
if (!ds(e)) {
var r, i, n = t._private, a = t.width(), o = t.height(), s = t.padding(), c = t.position(), l = t.pstyle("text-halign").strValue, u = t.pstyle("text-valign").strValue, d = n.rscratch, h = n.rstyle;
switch (l) {
case "left":
r = c.x - a / 2 - s;
break;
case "right":
r = c.x + a / 2 + s;
break;
default:
r = c.x;
}
switch (u) {
case "top":
i = c.y - o / 2 - s;
break;
case "bottom":
i = c.y + o / 2 + s;
break;
default:
i = c.y;
}
d.labelX = r, d.labelY = i, h.labelX = r, h.labelY = i, this.calculateLabelAngles(t), this.applyLabelDimensions(t);
}
};
var P3 = function(t, e) {
var r = Math.atan(e / t);
return t === 0 && r < 0 && (r = r * -1), r;
}, R3 = function(t, e) {
var r = e.x - t.x, i = e.y - t.y;
return P3(r, i);
}, _7 = function(t, e, r, i) {
var n = yh(0, i - 1e-3, 1), a = yh(0, i + 1e-3, 1), o = $c(t, e, r, n), s = $c(t, e, r, a);
return R3(o, s);
};
Ea.recalculateEdgeLabelProjections = function(t) {
var e, r = t._private, i = r.rscratch, n = this, a = {
mid: t.pstyle("label").strValue,
source: t.pstyle("source-label").strValue,
target: t.pstyle("target-label").strValue
};
if (a.mid || a.source || a.target) {
e = {
x: i.midX,
y: i.midY
};
var o = function(u, d, h) {
Xo(r.rscratch, u, d, h), Xo(r.rstyle, u, d, h);
};
o("labelX", null, e.x), o("labelY", null, e.y);
var s = P3(i.midDispX, i.midDispY);
o("labelAutoAngle", null, s);
var c = function u() {
if (u.cache)
return u.cache;
for (var d = [], h = 0; h + 5 < i.allpts.length; h += 4) {
var f = {
x: i.allpts[h],
y: i.allpts[h + 1]
}, p = {
x: i.allpts[h + 2],
y: i.allpts[h + 3]
}, m = {
x: i.allpts[h + 4],
y: i.allpts[h + 5]
};
d.push({
p0: f,
p1: p,
p2: m,
startDist: 0,
length: 0,
segments: []
});
}
var y = r.rstyle.bezierPts, g = n.bezierProjPcts.length;
function v(b, T, E, C, L) {
var A = _l(T, E), k = b.segments[b.segments.length - 1], P = {
p0: T,
p1: E,
t0: C,
t1: L,
startDist: k ? k.startDist + k.length : 0,
length: A
};
b.segments.push(P), b.length += A;
}
for (var x = 0; x < d.length; x++) {
var w = d[x], S = d[x - 1];
S && (w.startDist = S.startDist + S.length), v(w, w.p0, y[x * g], 0, n.bezierProjPcts[0]);
for (var _ = 0; _ < g - 1; _++)
v(w, y[x * g + _], y[x * g + _ + 1], n.bezierProjPcts[_], n.bezierProjPcts[_ + 1]);
v(w, y[x * g + g - 1], w.p2, n.bezierProjPcts[g - 1], 1);
}
return u.cache = d;
}, l = function(u) {
var d, h = u === "source";
if (a[u]) {
var f = t.pstyle(u + "-text-offset").pfValue;
switch (i.edgeType) {
case "self":
case "compound":
case "bezier":
case "multibezier": {
for (var p = c(), m, y = 0, g = 0, v = 0; v < p.length; v++) {
for (var x = p[h ? v : p.length - 1 - v], w = 0; w < x.segments.length; w++) {
var S = x.segments[h ? w : x.segments.length - 1 - w], _ = v === p.length - 1 && w === x.segments.length - 1;
if (y = g, g += S.length, g >= f || _) {
m = {
cp: x,
segment: S
};
break;
}
}
if (m)
break;
}
var b = m.cp, T = m.segment, E = (f - y) / T.length, C = T.t1 - T.t0, L = h ? T.t0 + C * E : T.t1 - C * E;
L = yh(0, L, 1), e = $c(b.p0, b.p1, b.p2, L), d = _7(b.p0, b.p1, b.p2, L);
break;
}
case "straight":
case "segments":
case "haystack": {
for (var A = 0, k, P, R, M, O = i.allpts.length, D = 0; D + 3 < O && (h ? (R = {
x: i.allpts[D],
y: i.allpts[D + 1]
}, M = {
x: i.allpts[D + 2],
y: i.allpts[D + 3]
}) : (R = {
x: i.allpts[O - 2 - D],
y: i.allpts[O - 1 - D]
}, M = {
x: i.allpts[O - 4 - D],
y: i.allpts[O - 3 - D]
}), k = _l(R, M), P = A, A += k, !(A >= f)); D += 2)
;
var I = f - P, F = I / k;
F = yh(0, F, 1), e = Cj(R, M, F), d = R3(R, M);
break;
}
}
o("labelX", u, e.x), o("labelY", u, e.y), o("labelAutoAngle", u, d);
}
};
l("source"), l("target"), this.applyLabelDimensions(t);
}
};
Ea.applyLabelDimensions = function(t) {
this.applyPrefixedLabelDimensions(t), t.isEdge() && (this.applyPrefixedLabelDimensions(t, "source"), this.applyPrefixedLabelDimensions(t, "target"));
};
Ea.applyPrefixedLabelDimensions = function(t, e) {
var r = t._private, i = this.getLabelText(t, e), n = this.calculateLabelDimensions(t, i), a = t.pstyle("line-height").pfValue, o = t.pstyle("text-wrap").strValue, s = $n(r.rscratch, "labelWrapCachedLines", e) || [], c = o !== "wrap" ? 1 : Math.max(s.length, 1), l = n.height / c, u = l * a, d = n.width, h = n.height + (c - 1) * (a - 1) * l;
Xo(r.rstyle, "labelWidth", e, d), Xo(r.rscratch, "labelWidth", e, d), Xo(r.rstyle, "labelHeight", e, h), Xo(r.rscratch, "labelHeight", e, h), Xo(r.rscratch, "labelLineHeight", e, u);
};
Ea.getLabelText = function(t, e) {
var r = t._private, i = e ? e + "-" : "", n = t.pstyle(i + "label").strValue, a = t.pstyle("text-transform").value, o = function(U, Z) {
return Z ? (Xo(r.rscratch, U, e, Z), Z) : $n(r.rscratch, U, e);
};
if (!n)
return "";
a == "none" || (a == "uppercase" ? n = n.toUpperCase() : a == "lowercase" && (n = n.toLowerCase()));
var s = t.pstyle("text-wrap").value;
if (s === "wrap") {
var c = o("labelKey");
if (c != null && o("labelWrapKey") === c)
return o("labelWrapCachedText");
for (var l = "", u = n.split(`
`), d = t.pstyle("text-max-width").pfValue, h = t.pstyle("text-overflow-wrap").value, f = h === "anywhere", p = [], m = /[\s\u200b]+|$/g, y = 0; y < u.length; y++) {
var g = u[y], v = this.calculateLabelDimensions(t, g), x = v.width;
if (f) {
var w = g.split("").join(l);
g = w;
}
if (x > d) {
var S = g.matchAll(m), _ = "", b = 0, T = mA(S), E;
try {
for (T.s(); !(E = T.n()).done; ) {
var C = E.value, L = C[0], A = g.substring(b, C.index);
b = C.index + L.length;
var k = _.length === 0 ? A : _ + A + L, P = this.calculateLabelDimensions(t, k), R = P.width;
R <= d ? _ += A + L : (_ && p.push(_), _ = A + L);
}
} catch (U) {
T.e(U);
} finally {
T.f();
}
_.match(/^[\s\u200b]+$/) || p.push(_);
} else
p.push(g);
}
o("labelWrapCachedLines", p), n = o("labelWrapCachedText", p.join(`
`)), o("labelWrapKey", c);
} else if (s === "ellipsis") {
var M = t.pstyle("text-max-width").pfValue, O = "", D = "…", I = !1;
if (this.calculateLabelDimensions(t, n).width < M)
return n;
for (var F = 0; F < n.length; F++) {
var z = this.calculateLabelDimensions(t, O + n[F] + D).width;
if (z > M)
break;
O += n[F], F === n.length - 1 && (I = !0);
}
return I || (O += D), O;
}
return n;
};
Ea.getLabelJustification = function(t) {
var e = t.pstyle("text-justification").strValue, r = t.pstyle("text-halign").strValue;
if (e === "auto")
if (t.isNode())
switch (r) {
case "left":
return "right";
case "right":
return "left";
default:
return "center";
}
else
return "center";
else
return e;
};
Ea.calculateLabelDimensions = function(t, e) {
var r = this, i = r.cy.window(), n = i.document, a = wl(e, t._private.labelDimsKey), o = r.labelDimCache || (r.labelDimCache = []), s = o[a];
if (s != null)
return s;
var c = 0, l = t.pstyle("font-style").strValue, u = t.pstyle("font-size").pfValue, d = t.pstyle("font-family").strValue, h = t.pstyle("font-weight").strValue, f = this.labelCalcCanvas, p = this.labelCalcCanvasContext;
if (!f) {
f = this.labelCalcCanvas = n.createElement("canvas"), p = this.labelCalcCanvasContext = f.getContext("2d");
var m = f.style;
m.position = "absolute", m.left = "-9999px", m.top = "-9999px", m.zIndex = "-1", m.visibility = "hidden", m.pointerEvents = "none";
}
p.font = "".concat(l, " ").concat(h, " ").concat(u, "px ").concat(d);
for (var y = 0, g = 0, v = e.split(`
`), x = 0; x < v.length; x++) {
var w = v[x], S = p.measureText(w), _ = Math.ceil(S.width), b = u;
y = Math.max(_, y), g += b;
}
return y += c, g += c, o[a] = {
width: y,
height: g
};
};
Ea.calculateLabelAngle = function(t, e) {
var r = t._private, i = r.rscratch, n = t.isEdge(), a = e ? e + "-" : "", o = t.pstyle(a + "text-rotation"), s = o.strValue;
return s === "none" ? 0 : n && s === "autorotate" ? i.labelAutoAngle : s === "autorotate" ? 0 : o.pfValue;
};
Ea.calculateLabelAngles = function(t) {
var e = this, r = t.isEdge(), i = t._private, n = i.rscratch;
n.labelAngle = e.calculateLabelAngle(t), r && (n.sourceLabelAngle = e.calculateLabelAngle(t, "source"), n.targetLabelAngle = e.calculateLabelAngle(t, "target"));
};
var O3 = {}, J_ = 28, Q_ = !1;
O3.getNodeShape = function(t) {
var e = this, r = t.pstyle("shape").value;
if (r === "cutrectangle" && (t.width() < J_ || t.height() < J_))
return Q_ || (Zt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), Q_ = !0), "rectangle";
if (t.isParent())
return r === "rectangle" || r === "roundrectangle" || r === "round-rectangle" || r === "cutrectangle" || r === "cut-rectangle" || r === "barrel" ? r : "rectangle";
if (r === "polygon") {
var i = t.pstyle("shape-polygon-points").value;
return e.nodeShapes.makePolygon(i).name;
}
return r;
};
var zg = {};
zg.registerCalculationListeners = function() {
var t = this.cy, e = t.collection(), r = this, i = function(a) {
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
if (e.merge(a), o)
for (var s = 0; s < a.length; s++) {
var c = a[s], l = c._private, u = l.rstyle;
u.clean = !1, u.cleanConnected = !1;
}
};
r.binder(t).on("bounds.* dirty.*", function(a) {
var o = a.target;
i(o);
}).on("style.* background.*", function(a) {
var o = a.target;
i(o, !1);
});
var n = function(a) {
if (a) {
var o = r.onUpdateEleCalcsFns;
e.cleanStyle();
for (var s = 0; s < e.length; s++) {
var c = e[s], l = c._private.rstyle;
c.isNode() && !l.cleanConnected && (i(c.connectedEdges()), l.cleanConnected = !0);
}
if (o)
for (var u = 0; u < o.length; u++) {
var d = o[u];
d(a, e);
}
r.recalculateRenderedStyle(e), e = t.collection();
}
};
r.flushRenderedStyleQueue = function() {
n(!0);
}, r.beforeRender(n, r.beforeRenderPriorities.eleCalcs);
};
zg.onUpdateEleCalcs = function(t) {
var e = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || [];
e.push(t);
};
zg.recalculateRenderedStyle = function(t, e) {
var r = function(x) {
return x._private.rstyle.cleanConnected;
}, i = [], n = [];
if (!this.destroyed) {
e === void 0 && (e = !0);
for (var a = 0; a < t.length; a++) {
var o = t[a], s = o._private, c = s.rstyle;
o.isEdge() && (!r(o.source()) || !r(o.target())) && (c.clean = !1), !(e && c.clean || o.removed()) && o.pstyle("display").value !== "none" && (s.group === "nodes" ? n.push(o) : i.push(o), c.clean = !0);
}
for (var l = 0; l < n.length; l++) {
var u = n[l], d = u._private, h = d.rstyle, f = u.position();
this.recalculateNodeLabelProjection(u), h.nodeX = f.x, h.nodeY = f.y, h.nodeW = u.pstyle("width").pfValue, h.nodeH = u.pstyle("height").pfValue;
}
this.recalculateEdgeProjections(i);
for (var p = 0; p < i.length; p++) {
var m = i[p], y = m._private, g = y.rstyle, v = y.rscratch;
g.srcX = v.arrowStartX, g.srcY = v.arrowStartY, g.tgtX = v.arrowEndX, g.tgtY = v.arrowEndY, g.midX = v.midX, g.midY = v.midY, g.labelAngle = v.labelAngle, g.sourceLabelAngle = v.sourceLabelAngle, g.targetLabelAngle = v.targetLabelAngle;
}
}
};
var $g = {};
$g.updateCachedGrabbedEles = function() {
var t = this.cachedZSortedEles;
if (t) {
t.drag = [], t.nondrag = [];
for (var e = [], r = 0; r < t.length; r++) {
var i = t[r], n = i._private.rscratch;
i.grabbed() && !i.isParent() ? e.push(i) : n.inDragLayer ? t.drag.push(i) : t.nondrag.push(i);
}
for (var r = 0; r < e.length; r++) {
var i = e[r];
t.drag.push(i);
}
}
};
$g.invalidateCachedZSortedEles = function() {
this.cachedZSortedEles = null;
};
$g.getCachedZSortedEles = function(t) {
if (t || !this.cachedZSortedEles) {
var e = this.cy.mutableElements().toArray();
e.sort(g3), e.interactive = e.filter(function(r) {
return r.interactive();
}), this.cachedZSortedEles = e, this.updateCachedGrabbedEles();
} else
e = this.cachedZSortedEles;
return e;
};
var D3 = {};
[Vl, Um, Pi, sp, Xb, Ea, O3, zg, $g].forEach(function(t) {
bt(D3, t);
});
var I3 = {};
I3.getCachedImage = function(t, e, r) {
var i = this, n = i.imageCache = i.imageCache || {}, a = n[t];
if (a)
return a.image.complete || a.image.addEventListener("load", r), a.image;
a = n[t] = n[t] || {};
var o = a.image = new Image();
o.addEventListener("load", r), o.addEventListener("error", function() {
o.error = !0;
});
var s = "data:", c = t.substring(0, s.length).toLowerCase() === s;
return c || (e = e === "null" ? null : e, o.crossOrigin = e), o.src = t, o;
};
var ju = {};
ju.registerBinding = function(t, e, r, i) {
var n = Array.prototype.slice.apply(arguments, [1]), a = this.binder(t);
return a.on.apply(a, n);
};
ju.binder = function(t) {
var e = this, r = e.cy.window(), i = t === r || t === r.document || t === r.document.body || G8(t);
if (e.supportsPassiveEvents == null) {
var n = !1;
try {
var a = Object.defineProperty({}, "passive", {
get: function() {
return n = !0, !0;
}
});
r.addEventListener("test", null, a);
} catch {
}
e.supportsPassiveEvents = n;
}
var o = function(s, c, l) {
var u = Array.prototype.slice.call(arguments);
return i && e.supportsPassiveEvents && (u[2] = {
capture: l ?? !1,
passive: !1,
once: !1
}), e.bindings.push({
target: t,
args: u
}), (t.addEventListener || t.on).apply(t, u), this;
};
return {
on: o,
addEventListener: o,
addListener: o,
bind: o
};
};
ju.nodeIsDraggable = function(t) {
return t && t.isNode() && !t.locked() && t.grabbable();
};
ju.nodeIsGrabbable = function(t) {
return this.nodeIsDraggable(t) && t.interactive();
};
ju.load = function() {
var t = this, e = t.cy.window(), r = function(B) {
return B.selected();
}, i = function(B, ce, ve, te) {
B == null && (B = t.cy);
for (var pe = 0; pe < ce.length; pe++) {
var fe = ce[pe];
B.emit({
originalEvent: ve,
type: fe,
position: te
});
}
}, n = function(B) {
return B.shiftKey || B.metaKey || B.ctrlKey;
}, a = function(B, ce) {
var ve = !0;
if (t.cy.hasCompoundNodes() && B && B.pannable())
for (var te = 0; ce && te < ce.length; te++) {
var B = ce[te];
if (B.isNode() && B.isParent() && !B.pannable()) {
ve = !1;
break;
}
}
else
ve = !0;
return ve;
}, o = function(B) {
B[0]._private.grabbed = !0;
}, s = function(B) {
B[0]._private.grabbed = !1;
}, c = function(B) {
B[0]._private.rscratch.inDragLayer = !0;
}, l = function(B) {
B[0]._private.rscratch.inDragLayer = !1;
}, u = function(B) {
B[0]._private.rscratch.isGrabTarget = !0;
}, d = function(B) {
B[0]._private.rscratch.isGrabTarget = !1;
}, h = function(B, ce) {
var ve = ce.addToList, te = ve.has(B);
!te && B.grabbable() && !B.locked() && (ve.merge(B), o(B));
}, f = function(B, ce) {
if (B.cy().hasCompoundNodes() && !(ce.inDragLayer == null && ce.addToList == null)) {
var ve = B.descendants();
ce.inDragLayer && (ve.forEach(c), ve.connectedEdges().forEach(c)), ce.addToList && h(ve, ce);
}
}, p = function(B, ce) {
ce = ce || {};
var ve = B.cy().hasCompoundNodes();
ce.inDragLayer && (B.forEach(c), B.neighborhood().stdFilter(function(te) {
return !ve || te.isEdge();
}).forEach(c)), ce.addToList && B.forEach(function(te) {
h(te, ce);
}), f(B, ce), g(B, {
inDragLayer: ce.inDragLayer
}), t.updateCachedGrabbedEles();
}, m = p, y = function(B) {
B && (t.getCachedZSortedEles().forEach(function(ce) {
s(ce), l(ce), d(ce);
}), t.updateCachedGrabbedEles());
}, g = function(B, ce) {
if (!(ce.inDragLayer == null && ce.addToList == null) && B.cy().hasCompoundNodes()) {
var ve = B.ancestors().orphans();
if (!ve.same(B)) {
var te = ve.descendants().spawnSelf().merge(ve).unmerge(B).unmerge(B.descendants()), pe = te.connectedEdges();
ce.inDragLayer && (pe.forEach(c), te.forEach(c)), ce.addToList && te.forEach(function(fe) {
h(fe, ce);
});
}
}
}, v = function() {
document.activeElement != null && document.activeElement.blur != null && document.activeElement.blur();
}, x = typeof MutationObserver < "u", w = typeof ResizeObserver < "u";
x ? (t.removeObserver = new MutationObserver(function(B) {
for (var ce = 0; ce < B.length; ce++) {
var ve = B[ce], te = ve.removedNodes;
if (te)
for (var pe = 0; pe < te.length; pe++) {
var fe = te[pe];
if (fe === t.container) {
t.destroy();
break;
}
}
}
}), t.container.parentNode && t.removeObserver.observe(t.container.parentNode, {
childList: !0
})) : t.registerBinding(t.container, "DOMNodeRemoved", function(B) {
t.destroy();
});
var S = Eg(function() {
t.cy.resize();
}, 100);
x && (t.styleObserver = new MutationObserver(S), t.styleObserver.observe(t.container, {
attributes: !0
})), t.registerBinding(e, "resize", S), w && (t.resizeObserver = new ResizeObserver(S), t.resizeObserver.observe(t.container));
var _ = function(B, ce) {
for (; B != null; )
ce(B), B = B.parentNode;
}, b = function() {
t.invalidateContainerClientCoordsCache();
};
_(t.container, function(B) {
t.registerBinding(B, "transitionend", b), t.registerBinding(B, "animationend", b), t.registerBinding(B, "scroll", b);
}), t.registerBinding(t.container, "contextmenu", function(B) {
B.preventDefault();
});
var T = function() {
return t.selection[4] !== 0;
}, E = function(B) {
for (var ce = t.findContainerClientCoords(), ve = ce[0], te = ce[1], pe = ce[2], fe = ce[3], he = B.touches ? B.touches : [B], Te = !1, He = 0; He < he.length; He++) {
var We = he[He];
if (ve <= We.clientX && We.clientX <= ve + pe && te <= We.clientY && We.clientY <= te + fe) {
Te = !0;
break;
}
}
if (!Te)
return !1;
for (var Ie = t.container, qe = B.target, De = qe.parentNode, $e = !1; De; ) {
if (De === Ie) {
$e = !0;
break;
}
De = De.parentNode;
}
return !!$e;
};
t.registerBinding(t.container, "mousedown", function(B) {
if (E(B) && !(t.hoverData.which === 1 && B.which !== 1)) {
B.preventDefault(), v(), t.hoverData.capture = !0, t.hoverData.which = B.which;
var ce = t.cy, ve = [B.clientX, B.clientY], te = t.projectIntoViewport(ve[0], ve[1]), pe = t.selection, fe = t.findNearestElements(te[0], te[1], !0, !1), he = fe[0], Te = t.dragData.possibleDragElements;
t.hoverData.mdownPos = te, t.hoverData.mdownGPos = ve;
var He = function() {
t.hoverData.tapholdCancelled = !1, clearTimeout(t.hoverData.tapholdTimeout), t.hoverData.tapholdTimeout = setTimeout(function() {
if (!t.hoverData.tapholdCancelled) {
var $e = t.hoverData.down;
$e ? $e.emit({
originalEvent: B,
type: "taphold",
position: {
x: te[0],
y: te[1]
}
}) : ce.emit({
originalEvent: B,
type: "taphold",
position: {
x: te[0],
y: te[1]
}
});
}
}, t.tapholdDuration);
};
if (B.which == 3) {
t.hoverData.cxtStarted = !0;
var We = {
originalEvent: B,
type: "cxttapstart",
position: {
x: te[0],
y: te[1]
}
};
he ? (he.activate(), he.emit(We), t.hoverData.down = he) : ce.emit(We), t.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(), t.hoverData.cxtDragged = !1;
} else if (B.which == 1) {
he && he.activate();
{
if (he != null && t.nodeIsGrabbable(he)) {
var Ie = function($e) {
return {
originalEvent: B,
type: $e,
position: {
x: te[0],
y: te[1]
}
};
}, qe = function($e) {
$e.emit(Ie("grab"));
};
if (u(he), !he.selected())
Te = t.dragData.possibleDragElements = ce.collection(), m(he, {
addToList: Te
}), he.emit(Ie("grabon")).emit(Ie("grab"));
else {
Te = t.dragData.possibleDragElements = ce.collection();
var De = ce.$(function($e) {
return $e.isNode() && $e.selected() && t.nodeIsGrabbable($e);
});
p(De, {
addToList: Te
}), he.emit(Ie("grabon")), De.forEach(qe);
}
t.redrawHint("eles", !0), t.redrawHint("drag", !0);
}
t.hoverData.down = he, t.hoverData.downs = fe, t.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime();
}
i(he, ["mousedown", "tapstart", "vmousedown"], B, {
x: te[0],
y: te[1]
}), he == null ? (pe[4] = 1, t.data.bgActivePosistion = {
x: te[0],
y: te[1]
}, t.redrawHint("select", !0), t.redraw()) : he.pannable() && (pe[4] = 1), He();
}
pe[0] = pe[2] = te[0], pe[1] = pe[3] = te[1];
}
}, !1), t.registerBinding(e, "mousemove", function(B) {
var ce = t.hoverData.capture;
if (!(!ce && !E(B))) {
var ve = !1, te = t.cy, pe = te.zoom(), fe = [B.clientX, B.clientY], he = t.projectIntoViewport(fe[0], fe[1]), Te = t.hoverData.mdownPos, He = t.hoverData.mdownGPos, We = t.selection, Ie = null;
!t.hoverData.draggingEles && !t.hoverData.dragging && !t.hoverData.selecting && (Ie = t.findNearestElement(he[0], he[1], !0, !1));
var qe = t.hoverData.last, De = t.hoverData.down, $e = [he[0] - We[2], he[1] - We[3]], nt = t.dragData.possibleDragElements, lt;
if (He) {
var mt = fe[0] - He[0], _t = mt * mt, wt = fe[1] - He[1], me = wt * wt, Ne = _t + me;
t.hoverData.isOverThresholdDrag = lt = Ne >= t.desktopTapThreshold2;
}
var Ue = n(B);
lt && (t.hoverData.tapholdCancelled = !0);
var Ke = function() {
var Oe = t.hoverData.dragDelta = t.hoverData.dragDelta || [];
Oe.length === 0 ? (Oe.push($e[0]), Oe.push($e[1])) : (Oe[0] += $e[0], Oe[1] += $e[1]);
};
ve = !0, i(Ie, ["mousemove", "vmousemove", "tapdrag"], B, {
x: he[0],
y: he[1]
});
var ct = function() {
t.data.bgActivePosistion = void 0, t.hoverData.selecting || te.emit({
originalEvent: B,
type: "boxstart",
position: {
x: he[0],
y: he[1]
}
}), We[4] = 1, t.hoverData.selecting = !0, t.redrawHint("select", !0), t.redraw();
};
if (t.hoverData.which === 3) {
if (lt) {
var xt = {
originalEvent: B,
type: "cxtdrag",
position: {
x: he[0],
y: he[1]
}
};
De ? De.emit(xt) : te.emit(xt), t.hoverData.cxtDragged = !0, (!t.hoverData.cxtOver || Ie !== t.hoverData.cxtOver) && (t.hoverData.cxtOver && t.hoverData.cxtOver.emit({
originalEvent: B,
type: "cxtdragout",
position: {
x: he[0],
y: he[1]
}
}), t.hoverData.cxtOver = Ie, Ie && Ie.emit({
originalEvent: B,
type: "cxtdragover",
position: {
x: he[0],
y: he[1]
}
}));
}
} else if (t.hoverData.dragging) {
if (ve = !0, te.panningEnabled() && te.userPanningEnabled()) {
var At;
if (t.hoverData.justStartedPan) {
var Ft = t.hoverData.mdownPos;
At = {
x: (he[0] - Ft[0]) * pe,
y: (he[1] - Ft[1]) * pe
}, t.hoverData.justStartedPan = !1;
} else
At = {
x: $e[0] * pe,
y: $e[1] * pe
};
te.panBy(At), te.emit("dragpan"), t.hoverData.dragged = !0;
}
he = t.projectIntoViewport(B.clientX, B.clientY);
} else if (We[4] == 1 && (De == null || De.pannable())) {
if (lt) {
if (!t.hoverData.dragging && te.boxSelectionEnabled() && (Ue || !te.panningEnabled() || !te.userPanningEnabled()))
ct();
else if (!t.hoverData.selecting && te.panningEnabled() && te.userPanningEnabled()) {
var zt = a(De, t.hoverData.downs);
zt && (t.hoverData.dragging = !0, t.hoverData.justStartedPan = !0, We[4] = 0, t.data.bgActivePosistion = Oc(Te), t.redrawHint("select", !0), t.redraw());
}
De && De.pannable() && De.active() && De.unactivate();
}
} else {
if (De && De.pannable() && De.active() && De.unactivate(), (!De || !De.grabbed()) && Ie != qe && (qe && i(qe, ["mouseout", "tapdragout"], B, {
x: he[0],
y: he[1]
}), Ie && i(Ie, ["mouseover", "tapdragover"], B, {
x: he[0],
y: he[1]
}), t.hoverData.last = Ie), De)
if (lt) {
if (te.boxSelectionEnabled() && Ue)
De && De.grabbed() && (y(nt), De.emit("freeon"), nt.emit("free"), t.dragData.didDrag && (De.emit("dragfreeon"), nt.emit("dragfree"))), ct();
else if (De && De.grabbed() && t.nodeIsDraggable(De)) {
var se = !t.dragData.didDrag;
se && t.redrawHint("eles", !0), t.dragData.didDrag = !0, t.hoverData.draggingEles || p(nt, {
inDragLayer: !0
});
var ke = {
x: 0,
y: 0
};
if (Xe($e[0]) && Xe($e[1]) && (ke.x += $e[0], ke.y += $e[1], se)) {
var Ae = t.hoverData.dragDelta;
Ae && Xe(Ae[0]) && Xe(Ae[1]) && (ke.x += Ae[0], ke.y += Ae[1]);
}
t.hoverData.draggingEles = !0, nt.silentShift(ke).emit("position drag"), t.redrawHint("drag", !0), t.redraw();
}
} else
Ke();
ve = !0;
}
if (We[2] = he[0], We[3] = he[1], ve)
return B.stopPropagation && B.stopPropagation(), B.preventDefault && B.preventDefault(), !1;
}
}, !1);
var C, L, A;
t.registerBinding(e, "mouseup", function(B) {
if (!(t.hoverData.which === 1 && B.which !== 1 && t.hoverData.capture)) {
var ce = t.hoverData.capture;
if (ce) {
t.hoverData.capture = !1;
var ve = t.cy, te = t.projectIntoViewport(B.clientX, B.clientY), pe = t.selection, fe = t.findNearestElement(te[0], te[1], !0, !1), he = t.dragData.possibleDragElements, Te = t.hoverData.down, He = n(B);
if (t.data.bgActivePosistion && (t.redrawHint("select", !0), t.redraw()), t.hoverData.tapholdCancelled = !0, t.data.bgActivePosistion = void 0, Te && Te.unactivate(), t.hoverData.which === 3) {
var We = {
originalEvent: B,
type: "cxttapend",
position: {
x: te[0],
y: te[1]
}
};
if (Te ? Te.emit(We) : ve.emit(We), !t.hoverData.cxtDragged) {
var Ie = {
originalEvent: B,
type: "cxttap",
position: {
x: te[0],
y: te[1]
}
};
Te ? Te.emit(Ie) : ve.emit(Ie);
}
t.hoverData.cxtDragged = !1, t.hoverData.which = null;
} else if (t.hoverData.which === 1) {
if (i(fe, ["mouseup", "tapend", "vmouseup"], B, {
x: te[0],
y: te[1]
}), !t.dragData.didDrag && // didn't move a node around
!t.hoverData.dragged && // didn't pan
!t.hoverData.selecting && // not box selection
!t.hoverData.isOverThresholdDrag && (i(Te, ["click", "tap", "vclick"], B, {
x: te[0],
y: te[1]
}), L = !1, B.timeStamp - A <= ve.multiClickDebounceTime() ? (C && clearTimeout(C), L = !0, A = null, i(Te, ["dblclick", "dbltap", "vdblclick"], B, {
x: te[0],
y: te[1]
})) : (C = setTimeout(function() {
L || i(Te, ["oneclick", "onetap", "voneclick"], B, {
x: te[0],
y: te[1]
});
}, ve.multiClickDebounceTime()), A = B.timeStamp)), Te == null && !t.dragData.didDrag && !t.hoverData.selecting && !t.hoverData.dragged && !n(B) && (ve.$(r).unselect(["tapunselect"]), he.length > 0 && t.redrawHint("eles", !0), t.dragData.possibleDragElements = he = ve.collection()), fe == Te && !t.dragData.didDrag && !t.hoverData.selecting && fe != null && fe._private.selectable && (t.hoverData.dragging || (ve.selectionType() === "additive" || He ? fe.selected() ? fe.unselect(["tapunselect"]) : fe.select(["tapselect"]) : He || (ve.$(r).unmerge(fe).unselect(["tapunselect"]), fe.select(["tapselect"]))), t.redrawHint("eles", !0)), t.hoverData.selecting) {
var qe = ve.collection(t.getAllInBox(pe[0], pe[1], pe[2], pe[3]));
t.redrawHint("select", !0), qe.length > 0 && t.redrawHint("eles", !0), ve.emit({
type: "boxend",
originalEvent: B,
position: {
x: te[0],
y: te[1]
}
});
var De = function(nt) {
return nt.selectable() && !nt.selected();
};
ve.selectionType() === "additive" || He || ve.$(r).unmerge(qe).unselect(), qe.emit("box").stdFilter(De).select().emit("boxselect"), t.redraw();
}
if (t.hoverData.dragging && (t.hoverData.dragging = !1, t.redrawHint("select", !0), t.redrawHint("eles", !0), t.redraw()), !pe[4]) {
t.redrawHint("drag", !0), t.redrawHint("eles", !0);
var $e = Te && Te.grabbed();
y(he), $e && (Te.emit("freeon"), he.emit("free"), t.dragData.didDrag && (Te.emit("dragfreeon"), he.emit("dragfree")));
}
}
pe[4] = 0, t.hoverData.down = null, t.hoverData.cxtStarted = !1, t.hoverData.draggingEles = !1, t.hoverData.selecting = !1, t.hoverData.isOverThresholdDrag = !1, t.dragData.didDrag = !1, t.hoverData.dragged = !1, t.hoverData.dragDelta = [], t.hoverData.mdownPos = null, t.hoverData.mdownGPos = null, t.hoverData.which = null;
}
}
}, !1);
var k = function(B) {
if (!t.scrollingPage) {
var ce = t.cy, ve = ce.zoom(), te = ce.pan(), pe = t.projectIntoViewport(B.clientX, B.clientY), fe = [pe[0] * ve + te.x, pe[1] * ve + te.y];
if (t.hoverData.draggingEles || t.hoverData.dragging || t.hoverData.cxtStarted || T()) {
B.preventDefault();
return;
}
if (ce.panningEnabled() && ce.userPanningEnabled() && ce.zoomingEnabled() && ce.userZoomingEnabled()) {
B.preventDefault(), t.data.wheelZooming = !0, clearTimeout(t.data.wheelTimeout), t.data.wheelTimeout = setTimeout(function() {
t.data.wheelZooming = !1, t.redrawHint("eles", !0), t.redraw();
}, 150);
var he;
B.deltaY != null ? he = B.deltaY / -250 : B.wheelDeltaY != null ? he = B.wheelDeltaY / 1e3 : he = B.wheelDelta / 1e3, he = he * t.wheelSensitivity;
var Te = B.deltaMode === 1;
Te && (he *= 33);
var He = ce.zoom() * Math.pow(10, he);
B.type === "gesturechange" && (He = t.gestureStartZoom * B.scale), ce.zoom({
level: He,
renderedPosition: {
x: fe[0],
y: fe[1]
}
}), ce.emit(B.type === "gesturechange" ? "pinchzoom" : "scrollzoom");
}
}
};
t.registerBinding(t.container, "wheel", k, !0), t.registerBinding(e, "scroll", function(B) {
t.scrollingPage = !0, clearTimeout(t.scrollingPageTimeout), t.scrollingPageTimeout = setTimeout(function() {
t.scrollingPage = !1;
}, 250);
}, !0), t.registerBinding(t.container, "gesturestart", function(B) {
t.gestureStartZoom = t.cy.zoom(), t.hasTouchStarted || B.preventDefault();
}, !0), t.registerBinding(t.container, "gesturechange", function(B) {
t.hasTouchStarted || k(B);
}, !0), t.registerBinding(t.container, "mouseout", function(B) {
var ce = t.projectIntoViewport(B.clientX, B.clientY);
t.cy.emit({
originalEvent: B,
type: "mouseout",
position: {
x: ce[0],
y: ce[1]
}
});
}, !1), t.registerBinding(t.container, "mouseover", function(B) {
var ce = t.projectIntoViewport(B.clientX, B.clientY);
t.cy.emit({
originalEvent: B,
type: "mouseover",
position: {
x: ce[0],
y: ce[1]
}
});
}, !1);
var P, R, M, O, D, I, F, z, U, Z, re, K, V, H = function(B, ce, ve, te) {
return Math.sqrt((ve - B) * (ve - B) + (te - ce) * (te - ce));
}, G = function(B, ce, ve, te) {
return (ve - B) * (ve - B) + (te - ce) * (te - ce);
}, W;
t.registerBinding(t.container, "touchstart", W = function(B) {
if (t.hasTouchStarted = !0, !!E(B)) {
v(), t.touchData.capture = !0, t.data.bgActivePosistion = void 0;
var ce = t.cy, ve = t.touchData.now, te = t.touchData.earlier;
if (B.touches[0]) {
var pe = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY);
ve[0] = pe[0], ve[1] = pe[1];
}
if (B.touches[1]) {
var pe = t.projectIntoViewport(B.touches[1].clientX, B.touches[1].clientY);
ve[2] = pe[0], ve[3] = pe[1];
}
if (B.touches[2]) {
var pe = t.projectIntoViewport(B.touches[2].clientX, B.touches[2].clientY);
ve[4] = pe[0], ve[5] = pe[1];
}
if (B.touches[1]) {
t.touchData.singleTouchMoved = !0, y(t.dragData.touchDragEles);
var fe = t.findContainerClientCoords();
U = fe[0], Z = fe[1], re = fe[2], K = fe[3], P = B.touches[0].clientX - U, R = B.touches[0].clientY - Z, M = B.touches[1].clientX - U, O = B.touches[1].clientY - Z, V = 0 <= P && P <= re && 0 <= M && M <= re && 0 <= R && R <= K && 0 <= O && O <= K;
var he = ce.pan(), Te = ce.zoom();
D = H(P, R, M, O), I = G(P, R, M, O), F = [(P + M) / 2, (R + O) / 2], z = [(F[0] - he.x) / Te, (F[1] - he.y) / Te];
var He = 200, We = He * He;
if (I < We && !B.touches[2]) {
var Ie = t.findNearestElement(ve[0], ve[1], !0, !0), qe = t.findNearestElement(ve[2], ve[3], !0, !0);
Ie && Ie.isNode() ? (Ie.activate().emit({
originalEvent: B,
type: "cxttapstart",
position: {
x: ve[0],
y: ve[1]
}
}), t.touchData.start = Ie) : qe && qe.isNode() ? (qe.activate().emit({
originalEvent: B,
type: "cxttapstart",
position: {
x: ve[0],
y: ve[1]
}
}), t.touchData.start = qe) : ce.emit({
originalEvent: B,
type: "cxttapstart",
position: {
x: ve[0],
y: ve[1]
}
}), t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxt = !0, t.touchData.cxtDragged = !1, t.data.bgActivePosistion = void 0, t.redraw();
return;
}
}
if (B.touches[2])
ce.boxSelectionEnabled() && B.preventDefault();
else if (!B.touches[1] && B.touches[0]) {
var De = t.findNearestElements(ve[0], ve[1], !0, !0), $e = De[0];
if ($e != null && ($e.activate(), t.touchData.start = $e, t.touchData.starts = De, t.nodeIsGrabbable($e))) {
var nt = t.dragData.touchDragEles = ce.collection(), lt = null;
t.redrawHint("eles", !0), t.redrawHint("drag", !0), $e.selected() ? (lt = ce.$(function(Ne) {
return Ne.selected() && t.nodeIsGrabbable(Ne);
}), p(lt, {
addToList: nt
})) : m($e, {
addToList: nt
}), u($e);
var mt = function(Ne) {
return {
originalEvent: B,
type: Ne,
position: {
x: ve[0],
y: ve[1]
}
};
};
$e.emit(mt("grabon")), lt ? lt.forEach(function(Ne) {
Ne.emit(mt("grab"));
}) : $e.emit(mt("grab"));
}
i($e, ["touchstart", "tapstart", "vmousedown"], B, {
x: ve[0],
y: ve[1]
}), $e == null && (t.data.bgActivePosistion = {
x: pe[0],
y: pe[1]
}, t.redrawHint("select", !0), t.redraw()), t.touchData.singleTouchMoved = !1, t.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(), clearTimeout(t.touchData.tapholdTimeout), t.touchData.tapholdTimeout = setTimeout(function() {
t.touchData.singleTouchMoved === !1 && !t.pinching && !t.touchData.selecting && i(t.touchData.start, ["taphold"], B, {
x: ve[0],
y: ve[1]
});
}, t.tapholdDuration);
}
if (B.touches.length >= 1) {
for (var _t = t.touchData.startPosition = [null, null, null, null, null, null], wt = 0; wt < ve.length; wt++)
_t[wt] = te[wt] = ve[wt];
var me = B.touches[0];
t.touchData.startGPosition = [me.clientX, me.clientY];
}
}
}, !1);
var Y;
t.registerBinding(e, "touchmove", Y = function(B) {
var ce = t.touchData.capture;
if (!(!ce && !E(B))) {
var ve = t.selection, te = t.cy, pe = t.touchData.now, fe = t.touchData.earlier, he = te.zoom();
if (B.touches[0]) {
var Te = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY);
pe[0] = Te[0], pe[1] = Te[1];
}
if (B.touches[1]) {
var Te = t.projectIntoViewport(B.touches[1].clientX, B.touches[1].clientY);
pe[2] = Te[0], pe[3] = Te[1];
}
if (B.touches[2]) {
var Te = t.projectIntoViewport(B.touches[2].clientX, B.touches[2].clientY);
pe[4] = Te[0], pe[5] = Te[1];
}
var He = t.touchData.startGPosition, We;
if (ce && B.touches[0] && He) {
for (var Ie = [], qe = 0; qe < pe.length; qe++)
Ie[qe] = pe[qe] - fe[qe];
var De = B.touches[0].clientX - He[0], $e = De * De, nt = B.touches[0].clientY - He[1], lt = nt * nt, mt = $e + lt;
We = mt >= t.touchTapThreshold2;
}
if (ce && t.touchData.cxt) {
B.preventDefault();
var _t = B.touches[0].clientX - U, wt = B.touches[0].clientY - Z, me = B.touches[1].clientX - U, Ne = B.touches[1].clientY - Z, Ue = G(_t, wt, me, Ne), Ke = Ue / I, ct = 150, xt = ct * ct, At = 1.5, Ft = At * At;
if (Ke >= Ft || Ue >= xt) {
t.touchData.cxt = !1, t.data.bgActivePosistion = void 0, t.redrawHint("select", !0);
var zt = {
originalEvent: B,
type: "cxttapend",
position: {
x: pe[0],
y: pe[1]
}
};
t.touchData.start ? (t.touchData.start.unactivate().emit(zt), t.touchData.start = null) : te.emit(zt);
}
}
if (ce && t.touchData.cxt) {
var zt = {
originalEvent: B,
type: "cxtdrag",
position: {
x: pe[0],
y: pe[1]
}
};
t.data.bgActivePosistion = void 0, t.redrawHint("select", !0), t.touchData.start ? t.touchData.start.emit(zt) : te.emit(zt), t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxtDragged = !0;
var se = t.findNearestElement(pe[0], pe[1], !0, !0);
(!t.touchData.cxtOver || se !== t.touchData.cxtOver) && (t.touchData.cxtOver && t.touchData.cxtOver.emit({
originalEvent: B,
type: "cxtdragout",
position: {
x: pe[0],
y: pe[1]
}
}), t.touchData.cxtOver = se, se && se.emit({
originalEvent: B,
type: "cxtdragover",
position: {
x: pe[0],
y: pe[1]
}
}));
} else if (ce && B.touches[2] && te.boxSelectionEnabled())
B.preventDefault(), t.data.bgActivePosistion = void 0, this.lastThreeTouch = +/* @__PURE__ */ new Date(), t.touchData.selecting || te.emit({
originalEvent: B,
type: "boxstart",
position: {
x: pe[0],
y: pe[1]
}
}), t.touchData.selecting = !0, t.touchData.didSelect = !0, ve[4] = 1, !ve || ve.length === 0 || ve[0] === void 0 ? (ve[0] = (pe[0] + pe[2] + pe[4]) / 3, ve[1] = (pe[1] + pe[3] + pe[5]) / 3, ve[2] = (pe[0] + pe[2] + pe[4]) / 3 + 1, ve[3] = (pe[1] + pe[3] + pe[5]) / 3 + 1) : (ve[2] = (pe[0] + pe[2] + pe[4]) / 3, ve[3] = (pe[1] + pe[3] + pe[5]) / 3), t.redrawHint("select", !0), t.redraw();
else if (ce && B.touches[1] && !t.touchData.didSelect && te.zoomingEnabled() && te.panningEnabled() && te.userZoomingEnabled() && te.userPanningEnabled()) {
B.preventDefault(), t.data.bgActivePosistion = void 0, t.redrawHint("select", !0);
var ke = t.dragData.touchDragEles;
if (ke) {
t.redrawHint("drag", !0);
for (var Ae = 0; Ae < ke.length; Ae++) {
var Oe = ke[Ae]._private;
Oe.grabbed = !1, Oe.rscratch.inDragLayer = !1;
}
}
var Ve = t.touchData.start, _t = B.touches[0].clientX - U, wt = B.touches[0].clientY - Z, me = B.touches[1].clientX - U, Ne = B.touches[1].clientY - Z, ae = H(_t, wt, me, Ne), Se = ae / D;
if (V) {
var Be = _t - P, Ge = wt - R, tt = me - M, gt = Ne - O, ut = (Be + tt) / 2, St = (Ge + gt) / 2, er = te.zoom(), vr = er * Se, fn = te.pan(), tr = z[0] * er + fn.x, ea = z[1] * er + fn.y, Jr = {
x: -vr / er * (tr - fn.x - ut) + tr,
y: -vr / er * (ea - fn.y - St) + ea
};
if (Ve && Ve.active()) {
var ke = t.dragData.touchDragEles;
y(ke), t.redrawHint("drag", !0), t.redrawHint("eles", !0), Ve.unactivate().emit("freeon"), ke.emit("free"), t.dragData.didDrag && (Ve.emit("dragfreeon"), ke.emit("dragfree"));
}
te.viewport({
zoom: vr,
pan: Jr,
cancelOnFailedZoom: !0
}), te.emit("pinchzoom"), D = ae, P = _t, R = wt, M = me, O = Ne, t.pinching = !0;
}
if (B.touches[0]) {
var Te = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY);
pe[0] = Te[0], pe[1] = Te[1];
}
if (B.touches[1]) {
var Te = t.projectIntoViewport(B.touches[1].clientX, B.touches[1].clientY);
pe[2] = Te[0], pe[3] = Te[1];
}
if (B.touches[2]) {
var Te = t.projectIntoViewport(B.touches[2].clientX, B.touches[2].clientY);
pe[4] = Te[0], pe[5] = Te[1];
}
} else if (B.touches[0] && !t.touchData.didSelect) {
var Ji = t.touchData.start, Mo = t.touchData.last, se;
if (!t.hoverData.draggingEles && !t.swipePanning && (se = t.findNearestElement(pe[0], pe[1], !0, !0)), ce && Ji != null && B.preventDefault(), ce && Ji != null && t.nodeIsDraggable(Ji))
if (We) {
var ke = t.dragData.touchDragEles, Eo = !t.dragData.didDrag;
Eo && p(ke, {
inDragLayer: !0
}), t.dragData.didDrag = !0;
var sd = {
x: 0,
y: 0
};
if (Xe(Ie[0]) && Xe(Ie[1]) && (sd.x += Ie[0], sd.y += Ie[1], Eo)) {
t.redrawHint("eles", !0);
var Ln = t.touchData.dragDelta;
Ln && Xe(Ln[0]) && Xe(Ln[1]) && (sd.x += Ln[0], sd.y += Ln[1]);
}
t.hoverData.draggingEles = !0, ke.silentShift(sd).emit("position drag"), t.redrawHint("drag", !0), t.touchData.startPosition[0] == fe[0] && t.touchData.startPosition[1] == fe[1] && t.redrawHint("eles", !0), t.redraw();
} else {
var Ln = t.touchData.dragDelta = t.touchData.dragDelta || [];
Ln.length === 0 ? (Ln.push(Ie[0]), Ln.push(Ie[1])) : (Ln[0] += Ie[0], Ln[1] += Ie[1]);
}
if (i(Ji || se, ["touchmove", "tapdrag", "vmousemove"], B, {
x: pe[0],
y: pe[1]
}), (!Ji || !Ji.grabbed()) && se != Mo && (Mo && Mo.emit({
originalEvent: B,
type: "tapdragout",
position: {
x: pe[0],
y: pe[1]
}
}), se && se.emit({
originalEvent: B,
type: "tapdragover",
position: {
x: pe[0],
y: pe[1]
}
})), t.touchData.last = se, ce)
for (var Ae = 0; Ae < pe.length; Ae++)
pe[Ae] && t.touchData.startPosition[Ae] && We && (t.touchData.singleTouchMoved = !0);
if (ce && (Ji == null || Ji.pannable()) && te.panningEnabled() && te.userPanningEnabled()) {
var yD = a(Ji, t.touchData.starts);
yD && (B.preventDefault(), t.data.bgActivePosistion || (t.data.bgActivePosistion = Oc(t.touchData.startPosition)), t.swipePanning ? (te.panBy({
x: Ie[0] * he,
y: Ie[1] * he
}), te.emit("dragpan")) : We && (t.swipePanning = !0, te.panBy({
x: De * he,
y: nt * he
}), te.emit("dragpan"), Ji && (Ji.unactivate(), t.redrawHint("select", !0), t.touchData.start = null)));
var Te = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY);
pe[0] = Te[0], pe[1] = Te[1];
}
}
for (var qe = 0; qe < pe.length; qe++)
fe[qe] = pe[qe];
ce && B.touches.length > 0 && !t.hoverData.draggingEles && !t.swipePanning && t.data.bgActivePosistion != null && (t.data.bgActivePosistion = void 0, t.redrawHint("select", !0), t.redraw());
}
}, !1);
var X;
t.registerBinding(e, "touchcancel", X = function(B) {
var ce = t.touchData.start;
t.touchData.capture = !1, ce && ce.unactivate();
});
var ie, ue, $, J;
if (t.registerBinding(e, "touchend", ie = function(B) {
var ce = t.touchData.start, ve = t.touchData.capture;
if (ve)
B.touches.length === 0 && (t.touchData.capture = !1), B.preventDefault();
else
return;
var te = t.selection;
t.swipePanning = !1, t.hoverData.draggingEles = !1;
var pe = t.cy, fe = pe.zoom(), he = t.touchData.now, Te = t.touchData.earlier;
if (B.touches[0]) {
var He = t.projectIntoViewport(B.touches[0].clientX, B.touches[0].clientY);
he[0] = He[0], he[1] = He[1];
}
if (B.touches[1]) {
var He = t.projectIntoViewport(B.touches[1].clientX, B.touches[1].clientY);
he[2] = He[0], he[3] = He[1];
}
if (B.touches[2]) {
var He = t.projectIntoViewport(B.touches[2].clientX, B.touches[2].clientY);
he[4] = He[0], he[5] = He[1];
}
ce && ce.unactivate();
var We;
if (t.touchData.cxt) {
if (We = {
originalEvent: B,
type: "cxttapend",
position: {
x: he[0],
y: he[1]
}
}, ce ? ce.emit(We) : pe.emit(We), !t.touchData.cxtDragged) {
var Ie = {
originalEvent: B,
type: "cxttap",
position: {
x: he[0],
y: he[1]
}
};
ce ? ce.emit(Ie) : pe.emit(Ie);
}
t.touchData.start && (t.touchData.start._private.grabbed = !1), t.touchData.cxt = !1, t.touchData.start = null, t.redraw();
return;
}
if (!B.touches[2] && pe.boxSelectionEnabled() && t.touchData.selecting) {
t.touchData.selecting = !1;
var qe = pe.collection(t.getAllInBox(te[0], te[1], te[2], te[3]));
te[0] = void 0, te[1] = void 0, te[2] = void 0, te[3] = void 0, te[4] = 0, t.redrawHint("select", !0), pe.emit({
type: "boxend",
originalEvent: B,
position: {
x: he[0],
y: he[1]
}
});
var De = function(ct) {
return ct.selectable() && !ct.selected();
};
qe.emit("box").stdFilter(De).select().emit("boxselect"), qe.nonempty() && t.redrawHint("eles", !0), t.redraw();
}
if (ce != null && ce.unactivate(), B.touches[2])
t.data.bgActivePosistion = void 0, t.redrawHint("select", !0);
else if (!B.touches[1] && !B.touches[0] && !B.touches[0]) {
t.data.bgActivePosistion = void 0, t.redrawHint("select", !0);
var $e = t.dragData.touchDragEles;
if (ce != null) {
var nt = ce._private.grabbed;
y($e), t.redrawHint("drag", !0), t.redrawHint("eles", !0), nt && (ce.emit("freeon"), $e.emit("free"), t.dragData.didDrag && (ce.emit("dragfreeon"), $e.emit("dragfree"))), i(ce, ["touchend", "tapend", "vmouseup", "tapdragout"], B, {
x: he[0],
y: he[1]
}), ce.unactivate(), t.touchData.start = null;
} else {
var lt = t.findNearestElement(he[0], he[1], !0, !0);
i(lt, ["touchend", "tapend", "vmouseup", "tapdragout"], B, {
x: he[0],
y: he[1]
});
}
var mt = t.touchData.startPosition[0] - he[0], _t = mt * mt, wt = t.touchData.startPosition[1] - he[1], me = wt * wt, Ne = _t + me, Ue = Ne * fe * fe;
t.touchData.singleTouchMoved || (ce || pe.$(":selected").unselect(["tapunselect"]), i(ce, ["tap", "vclick"], B, {
x: he[0],
y: he[1]
}), ue = !1, B.timeStamp - J <= pe.multiClickDebounceTime() ? ($ && clearTimeout($), ue = !0, J = null, i(ce, ["dbltap", "vdblclick"], B, {
x: he[0],
y: he[1]
})) : ($ = setTimeout(function() {
ue || i(ce, ["onetap", "voneclick"], B, {
x: he[0],
y: he[1]
});
}, pe.multiClickDebounceTime()), J = B.timeStamp)), ce != null && !t.dragData.didDrag && ce._private.selectable && Ue < t.touchTapThreshold2 && !t.pinching && (pe.selectionType() === "single" ? (pe.$(r).unmerge(ce).unselect(["tapunselect"]), ce.select(["tapselect"])) : ce.selected() ? ce.unselect(["tapunselect"]) : ce.select(["tapselect"]), t.redrawHint("eles", !0)), t.touchData.singleTouchMoved = !0;
}
for (var Ke = 0; Ke < he.length; Ke++)
Te[Ke] = he[Ke];
t.dragData.didDrag = !1, B.touches.length === 0 && (t.touchData.dragDelta = [], t.touchData.startPosition = [null, null, null, null, null, null], t.touchData.startGPosition = null, t.touchData.didSelect = !1), B.touches.length < 2 && (B.touches.length === 1 && (t.touchData.startGPosition = [B.touches[0].clientX, B.touches[0].clientY]), t.pinching = !1, t.redrawHint("eles", !0), t.redraw());
}, !1), typeof TouchEvent > "u") {
var ne = [], j = function(B) {
return {
clientX: B.clientX,
clientY: B.clientY,
force: 1,
identifier: B.pointerId,
pageX: B.pageX,
pageY: B.pageY,
radiusX: B.width / 2,
radiusY: B.height / 2,
screenX: B.screenX,
screenY: B.screenY,
target: B.target
};
}, q = function(B) {
return {
event: B,
touch: j(B)
};
}, ge = function(B) {
ne.push(q(B));
}, ye = function(B) {
for (var ce = 0; ce < ne.length; ce++) {
var ve = ne[ce];
if (ve.event.pointerId === B.pointerId) {
ne.splice(ce, 1);
return;
}
}
}, _e = function(B) {
var ce = ne.filter(function(ve) {
return ve.event.pointerId === B.pointerId;
})[0];
ce.event = B, ce.touch = j(B);
}, Me = function(B) {
B.touches = ne.map(function(ce) {
return ce.touch;
});
}, Ce = function(B) {
return B.pointerType === "mouse" || B.pointerType === 4;
};
t.registerBinding(t.container, "pointerdown", function(B) {
Ce(B) || (B.preventDefault(), ge(B), Me(B), W(B));
}), t.registerBinding(t.container, "pointerup", function(B) {
Ce(B) || (ye(B), Me(B), ie(B));
}), t.registerBinding(t.container, "pointercancel", function(B) {
Ce(B) || (ye(B), Me(B), X(B));
}), t.registerBinding(t.container, "pointermove", function(B) {
Ce(B) || (B.preventDefault(), _e(B), Me(B), Y(B));
});
}
};
var fo = {};
fo.generatePolygon = function(t, e) {
return this.nodeShapes[t] = {
renderer: this,
name: t,
points: e,
draw: function(r, i, n, a, o, s) {
this.renderer.nodeShapeImpl("polygon", r, i, n, a, o, this.points);
},
intersectLine: function(r, i, n, a, o, s, c, l) {
return bh(o, s, this.points, r, i, n / 2, a / 2, c);
},
checkPoint: function(r, i, n, a, o, s, c, l) {
return io(r, i, this.points, s, c, a, o, [0, -1], n);
}
};
};
fo.generateEllipse = function() {
return this.nodeShapes.ellipse = {
renderer: this,
name: "ellipse",
draw: function(t, e, r, i, n, a) {
this.renderer.nodeShapeImpl(this.name, t, e, r, i, n);
},
intersectLine: function(t, e, r, i, n, a, o, s) {
return $j(n, a, t, e, r / 2 + o, i / 2 + o);
},
checkPoint: function(t, e, r, i, n, a, o, s) {
return rl(t, e, i, n, a, o, r);
}
};
};
fo.generateRoundPolygon = function(t, e) {
return this.nodeShapes[t] = {
renderer: this,
name: t,
points: e,
getOrCreateCorners: function(r, i, n, a, o, s, c) {
if (s[c] !== void 0 && s[c + "-cx"] === r && s[c + "-cy"] === i)
return s[c];
s[c] = new Array(e.length / 2), s[c + "-cx"] = r, s[c + "-cy"] = i;
var l = n / 2, u = a / 2;
o = o === "auto" ? FA(n, a) : o;
for (var d = new Array(e.length / 2), h = 0; h < e.length / 2; h++)
d[h] = {
x: r + l * e[h * 2],
y: i + u * e[h * 2 + 1]
};
var f, p, m, y, g = d.length;
for (p = d[g - 1], f = 0; f < g; f++)
m = d[f % g], y = d[(f + 1) % g], s[c][f] = qb(p, m, y, o), p = m, m = y;
return s[c];
},
draw: function(r, i, n, a, o, s, c) {
this.renderer.nodeShapeImpl("round-polygon", r, i, n, a, o, this.points, this.getOrCreateCorners(i, n, a, o, s, c, "drawCorners"));
},
intersectLine: function(r, i, n, a, o, s, c, l, u) {
return Vj(o, s, this.points, r, i, n, a, c, this.getOrCreateCorners(r, i, n, a, l, u, "corners"));
},
checkPoint: function(r, i, n, a, o, s, c, l, u) {
return zj(r, i, this.points, s, c, a, o, this.getOrCreateCorners(s, c, a, o, l, u, "corners"));
}
};
};
fo.generateRoundRectangle = function() {
return this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = {
renderer: this,
name: "round-rectangle",
points: Ri(4, 0),
draw: function(t, e, r, i, n, a) {
this.renderer.nodeShapeImpl(this.name, t, e, r, i, n, this.points, a);
},
intersectLine: function(t, e, r, i, n, a, o, s) {
return NA(n, a, t, e, r, i, o, s);
},
checkPoint: function(t, e, r, i, n, a, o, s) {
var c = i / 2, l = n / 2;
s = s === "auto" ? Sl(i, n) : s, s = Math.min(c, l, s);
var u = s * 2;
return !!(io(t, e, this.points, a, o, i, n - u, [0, -1], r) || io(t, e, this.points, a, o, i - u, n, [0, -1], r) || rl(t, e, u, u, a - c + s, o - l + s, r) || rl(t, e, u, u, a + c - s, o - l + s, r) || rl(t, e, u, u, a + c - s, o + l - s, r) || rl(t, e, u, u, a - c + s, o + l - s, r));
}
};
};
fo.generateCutRectangle = function() {
return this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = {
renderer: this,
name: "cut-rectangle",
cornerLength: Ib(),
points: Ri(4, 0),
draw: function(t, e, r, i, n, a) {
this.renderer.nodeShapeImpl(this.name, t, e, r, i, n, null, a);
},
generateCutTrianglePts: function(t, e, r, i, n) {
var a = n === "auto" ? this.cornerLength : n, o = e / 2, s = t / 2, c = r - s, l = r + s, u = i - o, d = i + o;
return {
topLeft: [c, u + a, c + a, u, c + a, u + a],
topRight: [l - a, u, l, u + a, l - a, u + a],
bottomRight: [l, d - a, l - a, d, l - a, d - a],
bottomLeft: [c + a, d, c, d - a, c + a, d - a]
};
},
intersectLine: function(t, e, r, i, n, a, o, s) {
var c = this.generateCutTrianglePts(r + 2 * o, i + 2 * o, t, e, s), l = [].concat.apply([], [c.topLeft.splice(0, 4), c.topRight.splice(0, 4), c.bottomRight.splice(0, 4), c.bottomLeft.splice(0, 4)]);
return bh(n, a, l, t, e);
},
checkPoint: function(t, e, r, i, n, a, o, s) {
var c = s === "auto" ? this.cornerLength : s;
if (io(t, e, this.points, a, o, i, n - 2 * c, [0, -1], r) || io(t, e, this.points, a, o, i - 2 * c, n, [0, -1], r))
return !0;
var l = this.generateCutTrianglePts(i, n, a, o);
return Vi(t, e, l.topLeft) || Vi(t, e, l.topRight) || Vi(t, e, l.bottomRight) || Vi(t, e, l.bottomLeft);
}
};
};
fo.generateBarrel = function() {
return this.nodeShapes.barrel = {
renderer: this,
name: "barrel",
points: Ri(4, 0),
draw: function(t, e, r, i, n, a) {
this.renderer.nodeShapeImpl(this.name, t, e, r, i, n);
},
intersectLine: function(t, e, r, i, n, a, o, s) {
var c = 0.15, l = 0.5, u = 0.85, d = this.generateBarrelBezierPts(r + 2 * o, i + 2 * o, t, e), h = function(p) {
var m = $c({
x: p[0],
y: p[1]
}, {
x: p[2],
y: p[3]
}, {
x: p[4],
y: p[5]
}, c), y = $c({
x: p[0],
y: p[1]
}, {
x: p[2],
y: p[3]
}, {
x: p[4],
y: p[5]
}, l), g = $c({
x: p[0],
y: p[1]
}, {
x: p[2],
y: p[3]
}, {
x: p[4],
y: p[5]
}, u);
return [p[0], p[1], m.x, m.y, y.x, y.y, g.x, g.y, p[4], p[5]];
}, f = [].concat(h(d.topLeft), h(d.topRight), h(d.bottomRight), h(d.bottomLeft));
return bh(n, a, f, t, e);
},
generateBarrelBezierPts: function(t, e, r, i) {
var n = e / 2, a = t / 2, o = r - a, s = r + a, c = i - n, l = i + n, u = My(t, e), d = u.heightOffset, h = u.widthOffset, f = u.ctrlPtOffsetPct * t, p = {
topLeft: [o, c + d, o + f, c, o + h, c],
topRight: [s - h, c, s - f, c, s, c + d],
bottomRight: [s, l - d, s - f, l, s - h, l],
bottomLeft: [o + h, l, o + f, l, o, l - d]
};
return p.topLeft.isTop = !0, p.topRight.isTop = !0, p.bottomLeft.isBottom = !0, p.bottomRight.isBottom = !0, p;
},
checkPoint: function(t, e, r, i, n, a, o, s) {
var c = My(i, n), l = c.heightOffset, u = c.widthOffset;
if (io(t, e, this.points, a, o, i, n - 2 * l, [0, -1], r) || io(t, e, this.points, a, o, i - 2 * u, n, [0, -1], r))
return !0;
for (var d = this.generateBarrelBezierPts(i, n, a, o), h = function(_, b, T) {
var E = T[4], C = T[2], L = T[0], A = T[5], k = T[1], P = Math.min(E, L), R = Math.max(E, L), M = Math.min(A, k), O = Math.max(A, k);
if (P <= _ && _ <= R && M <= b && b <= O) {
var D = Uj(E, C, L), I = Ij(D[0], D[1], D[2], _), F = I.filter(function(z) {
return 0 <= z && z <= 1;
});
if (F.length > 0)
return F[0];
}
return null;
}, f = Object.keys(d), p = 0; p < f.length; p++) {
var m = f[p], y = d[m], g = h(t, e, y);
if (g != null) {
var v = y[5], x = y[3], w = y[1], S = ei(v, x, w, g);
if (y.isTop && S <= e || y.isBottom && e <= S)
return !0;
}
}
return !1;
}
};
};
fo.generateBottomRoundrectangle = function() {
return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = {
renderer: this,
name: "bottom-round-rectangle",
points: Ri(4, 0),
draw: function(t, e, r, i, n, a) {
this.renderer.nodeShapeImpl(this.name, t, e, r, i, n, this.points, a);
},
intersectLine: function(t, e, r, i, n, a, o, s) {
var c = t - (r / 2 + o), l = e - (i / 2 + o), u = l, d = t + (r / 2 + o), h = Jo(n, a, t, e, c, l, d, u, !1);
return h.length > 0 ? h : NA(n, a, t, e, r, i, o, s);
},
checkPoint: function(t, e, r, i, n, a, o, s) {
s = s === "auto" ? Sl(i, n) : s;
var c = 2 * s;
if (io(t, e, this.points, a, o, i, n - c, [0, -1], r) || io(t, e, this.points, a, o, i - c, n, [0, -1], r))
return !0;
var l = i / 2 + 2 * r, u = n / 2 + 2 * r, d = [a - l, o - u, a - l, o, a + l, o, a + l, o - u];
return !!(Vi(t, e, d) || rl(t, e, c, c, a + i / 2 - s, o + n / 2 - s, r) || rl(t, e, c, c, a - i / 2 + s, o + n / 2 - s, r));
}
};
};
fo.registerNodeShapes = function() {
var t = this.nodeShapes = {}, e = this;
this.generateEllipse(), this.generatePolygon("triangle", Ri(3, 0)), this.generateRoundPolygon("round-triangle", Ri(3, 0)), this.generatePolygon("rectangle", Ri(4, 0)), t.square = t.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", Ri(5, 0)), this.generateRoundPolygon("round-pentagon", Ri(5, 0)), this.generatePolygon("hexagon", Ri(6, 0)), this.generateRoundPolygon("round-hexagon", Ri(6, 0)), this.generatePolygon("heptagon", Ri(7, 0)), this.generateRoundPolygon("round-heptagon", Ri(7, 0)), this.generatePolygon("octagon", Ri(8, 0)), this.generateRoundPolygon("round-octagon", Ri(8, 0));
var i = new Array(20);
{
var n = Sy(5, 0), a = Sy(5, Math.PI / 5), o = 0.5 * (3 - Math.sqrt(5));
o *= 1.57;
for (var s = 0; s < a.length / 2; s++)
a[s * 2] *= o, a[s * 2 + 1] *= o;
for (var s = 0; s < 20 / 4; s++)
i[s * 4] = n[s * 2], i[s * 4 + 1] = n[s * 2 + 1], i[s * 4 + 2] = a[s * 2], i[s * 4 + 3] = a[s * 2 + 1];
}
i = BA(i), this.generatePolygon("star", i), 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 c = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1];
this.generatePolygon("tag", c), this.generateRoundPolygon("round-tag", c);
}
t.makePolygon = function(l) {
var u = l.join("$"), d = "polygon-" + u, h;
return (h = this[d]) ? h : e.generatePolygon(d, l);
};
};
var lp = {};
lp.timeToRender = function() {
return this.redrawTotalTime / this.redrawCount;
};
lp.redraw = function(t) {
t = t || PA();
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 = !0, e.renderOptions = t;
};
lp.beforeRender = function(t, e) {
if (!this.destroyed) {
e == null && Tr("Priority is not optional for beforeRender");
var r = this.beforeRenderCallbacks;
r.push({
fn: t,
priority: e
}), r.sort(function(i, n) {
return n.priority - i.priority;
});
}
};
var eS = function(t, e, r) {
for (var i = t.beforeRenderCallbacks, n = 0; n < i.length; n++)
i[n].fn(e, r);
};
lp.startRenderLoop = function() {
var t = this, e = t.cy;
if (!t.renderLoopStarted) {
t.renderLoopStarted = !0;
var r = function i(n) {
if (!t.destroyed) {
if (!e.batching()) if (t.requestedFrame && !t.skipFrame) {
eS(t, !0, n);
var a = ro();
t.render(t.renderOptions);
var o = t.lastDrawTime = ro();
t.averageRedrawTime === void 0 && (t.averageRedrawTime = o - a), t.redrawCount === void 0 && (t.redrawCount = 0), t.redrawCount++, t.redrawTotalTime === void 0 && (t.redrawTotalTime = 0);
var s = o - a;
t.redrawTotalTime += s, t.lastRedrawTime = s, t.averageRedrawTime = t.averageRedrawTime / 2 + s / 2, t.requestedFrame = !1;
} else
eS(t, !1, n);
t.skipFrame = !1, Om(i);
}
};
Om(r);
}
};
var S7 = function(t) {
this.init(t);
}, N3 = S7, Hu = N3.prototype;
Hu.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"];
Hu.init = function(t) {
var e = this;
e.options = t, e.cy = t.cy;
var r = e.container = t.cy.container(), i = e.cy.window();
if (i) {
var n = i.document, a = n.head, o = "__________cytoscape_stylesheet", s = "__________cytoscape_container", c = n.getElementById(o) != null;
if (r.className.indexOf(s) < 0 && (r.className = (r.className || "") + " " + s), !c) {
var l = n.createElement("style");
l.id = o, l.textContent = "." + s + " { position: relative; }", a.insertBefore(l, a.children[0]);
}
var u = i.getComputedStyle(r), d = u.getPropertyValue("position");
d === "static" && Zt("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: !1,
initialPan: [null, null],
capture: !1
}, e.dragData = {
possibleDragElements: []
}, e.touchData = {
start: null,
capture: !1,
// These 3 fields related to tap, taphold events
startPosition: [null, null, null, null, null, null],
singleTouchStartTime: null,
singleTouchMoved: !0,
now: [null, null, null, null, null, null],
earlier: [null, null, null, null, null, null]
}, e.redraws = 0, e.showFps = t.showFps, e.debug = t.debug, e.hideEdgesOnViewport = t.hideEdgesOnViewport, e.textureOnViewport = t.textureOnViewport, e.wheelSensitivity = t.wheelSensitivity, e.motionBlurEnabled = t.motionBlur, e.forcedPixelRatio = Xe(t.pixelRatio) ? t.pixelRatio : null, e.motionBlur = t.motionBlur, e.motionBlurOpacity = t.motionBlurOpacity, e.motionBlurTransparency = 1 - e.motionBlurOpacity, e.motionBlurPxRatio = 1, e.mbPxRBlurry = 1, e.minMbLowQualFrames = 4, e.fullQualityMb = !1, e.clearedForMotionBlur = [], e.desktopTapThreshold = t.desktopTapThreshold, e.desktopTapThreshold2 = t.desktopTapThreshold * t.desktopTapThreshold, e.touchTapThreshold = t.touchTapThreshold, e.touchTapThreshold2 = t.touchTapThreshold * t.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();
};
Hu.notify = function(t, e) {
var r = this, i = r.cy;
if (!this.destroyed) {
if (t === "init") {
r.load();
return;
}
if (t === "destroy") {
r.destroy();
return;
}
(t === "add" || t === "remove" || t === "move" && i.hasCompoundNodes() || t === "load" || t === "zorder" || t === "mount") && r.invalidateCachedZSortedEles(), t === "viewport" && r.redrawHint("select", !0), (t === "load" || t === "resize" || t === "mount") && (r.invalidateContainerClientCoordsCache(), r.matchCanvasSize(r.container)), r.redrawHint("eles", !0), r.redrawHint("drag", !0), this.startRenderLoop(), this.redraw();
}
};
Hu.destroy = function() {
var t = this;
t.destroyed = !0, t.cy.stopAnimationLoop();
for (var e = 0; e < t.bindings.length; e++) {
var r = t.bindings[e], i = r, n = i.target;
(n.off || n.removeEventListener).apply(n, i.args);
}
if (t.bindings = [], t.beforeRenderCallbacks = [], t.onUpdateEleCalcsFns = [], t.removeObserver && t.removeObserver.disconnect(), t.styleObserver && t.styleObserver.disconnect(), t.resizeObserver && t.resizeObserver.disconnect(), t.labelCalcDiv)
try {
document.body.removeChild(t.labelCalcDiv);
} catch {
}
};
Hu.isHeadless = function() {
return !1;
};
[Wb, D3, I3, ju, fo, lp].forEach(function(t) {
bt(Hu, t);
});
var Yv = 1e3 / 60, B3 = {
setupDequeueing: function(t) {
return function() {
var e = this, r = this.renderer;
if (!e.dequeueingSetup) {
e.dequeueingSetup = !0;
var i = Eg(function() {
r.redrawHint("eles", !0), r.redrawHint("drag", !0), r.redraw();
}, t.deqRedrawThreshold), n = function(o, s) {
var c = ro(), l = r.averageRedrawTime, u = r.lastRedrawTime, d = [], h = r.cy.extent(), f = r.getPixelRatio();
for (o || r.flushRenderedStyleQueue(); ; ) {
var p = ro(), m = p - c, y = p - s;
if (u < Yv) {
var g = Yv - (o ? l : 0);
if (y >= t.deqFastCost * g)
break;
} else if (o) {
if (m >= t.deqCost * u || m >= t.deqAvgCost * l)
break;
} else if (y >= t.deqNoDrawCost * Yv)
break;
var v = t.deq(e, f, h);
if (v.length > 0)
for (var x = 0; x < v.length; x++)
d.push(v[x]);
else
break;
}
d.length > 0 && (t.onDeqd(e, d), !o && t.shouldRedraw(e, d, f, h) && i());
}, a = t.priority || Pb;
r.beforeRender(n, a(e));
}
};
}
}, M7 = /* @__PURE__ */ function() {
function t(e) {
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Dm;
Tb(this, t), this.idsByKey = new ca(), this.keyForId = new ca(), this.cachesByLvl = new ca(), this.lvls = [], this.getKey = e, this.doesEleInvalidateKey = r;
}
return Cb(t, [{
key: "getIdsFor",
value: function(e) {
e == null && Tr("Can not get id list for null key");
var r = this.idsByKey, i = this.idsByKey.get(e);
return i || (i = new Nu(), r.set(e, i)), i;
}
}, {
key: "addIdForKey",
value: function(e, r) {
e != null && this.getIdsFor(e).add(r);
}
}, {
key: "deleteIdForKey",
value: function(e, r) {
e != null && this.getIdsFor(e).delete(r);
}
}, {
key: "getNumberOfIdsForKey",
value: function(e) {
return e == null ? 0 : this.getIdsFor(e).size;
}
}, {
key: "updateKeyMappingFor",
value: function(e) {
var r = e.id(), i = this.keyForId.get(r), n = this.getKey(e);
this.deleteIdForKey(i, r), this.addIdForKey(n, r), this.keyForId.set(r, n);
}
}, {
key: "deleteKeyMappingFor",
value: function(e) {
var r = e.id(), i = this.keyForId.get(r);
this.deleteIdForKey(i, r), this.keyForId.delete(r);
}
}, {
key: "keyHasChangedFor",
value: function(e) {
var r = e.id(), i = this.keyForId.get(r), n = this.getKey(e);
return i !== n;
}
}, {
key: "isInvalid",
value: function(e) {
return this.keyHasChangedFor(e) || this.doesEleInvalidateKey(e);
}
}, {
key: "getCachesAt",
value: function(e) {
var r = this.cachesByLvl, i = this.lvls, n = r.get(e);
return n || (n = new ca(), r.set(e, n), i.push(e)), n;
}
}, {
key: "getCache",
value: function(e, r) {
return this.getCachesAt(r).get(e);
}
}, {
key: "get",
value: function(e, r) {
var i = this.getKey(e), n = this.getCache(i, r);
return n != null && this.updateKeyMappingFor(e), n;
}
}, {
key: "getForCachedKey",
value: function(e, r) {
var i = this.keyForId.get(e.id()), n = this.getCache(i, r);
return n;
}
}, {
key: "hasCache",
value: function(e, r) {
return this.getCachesAt(r).has(e);
}
}, {
key: "has",
value: function(e, r) {
var i = this.getKey(e);
return this.hasCache(i, r);
}
}, {
key: "setCache",
value: function(e, r, i) {
i.key = e, this.getCachesAt(r).set(e, i);
}
}, {
key: "set",
value: function(e, r, i) {
var n = this.getKey(e);
this.setCache(n, r, i), this.updateKeyMappingFor(e);
}
}, {
key: "deleteCache",
value: function(e, r) {
this.getCachesAt(r).delete(e);
}
}, {
key: "delete",
value: function(e, r) {
var i = this.getKey(e);
this.deleteCache(i, r);
}
}, {
key: "invalidateKey",
value: function(e) {
var r = this;
this.lvls.forEach(function(i) {
return r.deleteCache(e, i);
});
}
// 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(e) {
var r = e.id(), i = this.keyForId.get(r);
this.deleteKeyMappingFor(e);
var n = this.doesEleInvalidateKey(e);
return n && this.invalidateKey(i), n || this.getNumberOfIdsForKey(i) === 0;
}
}]), t;
}(), tS = 25, Jp = 50, mm = -4, Iy = 3, E7 = 7.99, T7 = 8, C7 = 1024, A7 = 1024, L7 = 1024, k7 = 0.2, P7 = 0.8, R7 = 10, O7 = 0.15, D7 = 0.1, I7 = 0.9, N7 = 0.9, B7 = 100, F7 = 1, Dc = {
dequeue: "dequeue",
downscale: "downscale",
highQuality: "highQuality"
}, z7 = yi({
getKey: null,
doesEleInvalidateKey: Dm,
drawElement: null,
getBoundingBox: null,
getRotationPoint: null,
getRotationOffset: null,
isVisible: LA,
allowEdgeTxrCaching: !0,
allowParentTxrCaching: !0
}), $d = function(t, e) {
var r = this;
r.renderer = t, r.onDequeues = [];
var i = z7(e);
bt(r, i), r.lookup = new M7(i.getKey, i.doesEleInvalidateKey), r.setupDequeueing();
}, Yr = $d.prototype;
Yr.reasons = Dc;
Yr.getTextureQueue = function(t) {
var e = this;
return e.eleImgCaches = e.eleImgCaches || {}, e.eleImgCaches[t] = e.eleImgCaches[t] || [];
};
Yr.getRetiredTextureQueue = function(t) {
var e = this, r = e.eleImgCaches.retired = e.eleImgCaches.retired || {}, i = r[t] = r[t] || [];
return i;
};
Yr.getElementQueue = function() {
var t = this, e = t.eleCacheQueue = t.eleCacheQueue || new np(function(r, i) {
return i.reqs - r.reqs;
});
return e;
};
Yr.getElementKeyToQueue = function() {
var t = this, e = t.eleKeyToCacheQueue = t.eleKeyToCacheQueue || {};
return e;
};
Yr.getElement = function(t, e, r, i, n) {
var a = this, o = this.renderer, s = o.cy.zoom(), c = this.lookup;
if (!e || e.w === 0 || e.h === 0 || isNaN(e.w) || isNaN(e.h) || !t.visible() || t.removed() || !a.allowEdgeTxrCaching && t.isEdge() || !a.allowParentTxrCaching && t.isParent())
return null;
if (i == null && (i = Math.ceil(Ob(s * r))), i < mm)
i = mm;
else if (s >= E7 || i > Iy)
return null;
var l = Math.pow(2, i), u = e.h * l, d = e.w * l, h = o.eleTextBiggerThanMin(t, l);
if (!this.isVisible(t, h))
return null;
var f = c.get(t, i);
if (f && f.invalidated && (f.invalidated = !1, f.texture.invalidatedWidth -= f.width), f)
return f;
var p;
if (u <= tS ? p = tS : u <= Jp ? p = Jp : p = Math.ceil(u / Jp) * Jp, u > L7 || d > A7)
return null;
var m = a.getTextureQueue(p), y = m[m.length - 2], g = function() {
return a.recycleTexture(p, d) || a.addTexture(p, d);
};
y || (y = m[m.length - 1]), y || (y = g()), y.width - y.usedWidth < d && (y = g());
for (var v = function(R) {
return R && R.scaledLabelShown === h;
}, x = n && n === Dc.dequeue, w = n && n === Dc.highQuality, S = n && n === Dc.downscale, _, b = i + 1; b <= Iy; b++) {
var T = c.get(t, b);
if (T) {
_ = T;
break;
}
}
var E = _ && _.level === i + 1 ? _ : null, C = function() {
y.context.drawImage(E.texture.canvas, E.x, 0, E.width, E.height, y.usedWidth, 0, d, u);
};
if (y.context.setTransform(1, 0, 0, 1, 0, 0), y.context.clearRect(y.usedWidth, 0, d, p), v(E))
C();
else if (v(_))
if (w) {
for (var L = _.level; L > i; L--)
E = a.getElement(t, e, r, L, Dc.downscale);
C();
} else
return a.queueElement(t, _.level - 1), _;
else {
var A;
if (!x && !w && !S)
for (var k = i - 1; k >= mm; k--) {
var P = c.get(t, k);
if (P) {
A = P;
break;
}
}
if (v(A))
return a.queueElement(t, i), A;
y.context.translate(y.usedWidth, 0), y.context.scale(l, l), this.drawElement(y.context, t, e, h, !1), y.context.scale(1 / l, 1 / l), y.context.translate(-y.usedWidth, 0);
}
return f = {
x: y.usedWidth,
texture: y,
level: i,
scale: l,
width: d,
height: u,
scaledLabelShown: h
}, y.usedWidth += Math.ceil(d + T7), y.eleCaches.push(f), c.set(t, i, f), a.checkTextureFullness(y), f;
};
Yr.invalidateElements = function(t) {
for (var e = 0; e < t.length; e++)
this.invalidateElement(t[e]);
};
Yr.invalidateElement = function(t) {
var e = this, r = e.lookup, i = [], n = r.isInvalid(t);
if (n) {
for (var a = mm; a <= Iy; a++) {
var o = r.getForCachedKey(t, a);
o && i.push(o);
}
var s = r.invalidate(t);
if (s)
for (var c = 0; c < i.length; c++) {
var l = i[c], u = l.texture;
u.invalidatedWidth += l.width, l.invalidated = !0, e.checkTextureUtility(u);
}
e.removeFromQueue(t);
}
};
Yr.checkTextureUtility = function(t) {
t.invalidatedWidth >= k7 * t.width && this.retireTexture(t);
};
Yr.checkTextureFullness = function(t) {
var e = this, r = e.getTextureQueue(t.height);
t.usedWidth / t.width > P7 && t.fullnessChecks >= R7 ? hs(r, t) : t.fullnessChecks++;
};
Yr.retireTexture = function(t) {
var e = this, r = t.height, i = e.getTextureQueue(r), n = this.lookup;
hs(i, t), t.retired = !0;
for (var a = t.eleCaches, o = 0; o < a.length; o++) {
var s = a[o];
n.deleteCache(s.key, s.level);
}
Rb(a);
var c = e.getRetiredTextureQueue(r);
c.push(t);
};
Yr.addTexture = function(t, e) {
var r = this, i = r.getTextureQueue(t), n = {};
return i.push(n), n.eleCaches = [], n.height = t, n.width = Math.max(C7, e), n.usedWidth = 0, n.invalidatedWidth = 0, n.fullnessChecks = 0, n.canvas = r.renderer.makeOffscreenCanvas(n.width, n.height), n.context = n.canvas.getContext("2d"), n;
};
Yr.recycleTexture = function(t, e) {
for (var r = this, i = r.getTextureQueue(t), n = r.getRetiredTextureQueue(t), a = 0; a < n.length; a++) {
var o = n[a];
if (o.width >= e)
return o.retired = !1, o.usedWidth = 0, o.invalidatedWidth = 0, o.fullnessChecks = 0, Rb(o.eleCaches), o.context.setTransform(1, 0, 0, 1, 0, 0), o.context.clearRect(0, 0, o.width, o.height), hs(n, o), i.push(o), o;
}
};
Yr.queueElement = function(t, e) {
var r = this, i = r.getElementQueue(), n = r.getElementKeyToQueue(), a = this.getKey(t), o = n[a];
if (o)
o.level = Math.max(o.level, e), o.eles.merge(t), o.reqs++, i.updateItem(o);
else {
var s = {
eles: t.spawn().merge(t),
level: e,
reqs: 1,
key: a
};
i.push(s), n[a] = s;
}
};
Yr.dequeue = function(t) {
for (var e = this, r = e.getElementQueue(), i = e.getElementKeyToQueue(), n = [], a = e.lookup, o = 0; o < F7 && r.size() > 0; o++) {
var s = r.pop(), c = s.key, l = s.eles[0], u = a.hasCache(l, s.level);
if (i[c] = null, !u) {
n.push(s);
var d = e.getBoundingBox(l);
e.getElement(l, d, t, s.level, Dc.dequeue);
}
}
return n;
};
Yr.removeFromQueue = function(t) {
var e = this, r = e.getElementQueue(), i = e.getElementKeyToQueue(), n = this.getKey(t), a = i[n];
a != null && (a.eles.length === 1 ? (a.reqs = kb, r.updateItem(a), r.pop(), i[n] = null) : a.eles.unmerge(t));
};
Yr.onDequeue = function(t) {
this.onDequeues.push(t);
};
Yr.offDequeue = function(t) {
hs(this.onDequeues, t);
};
Yr.setupDequeueing = B3.setupDequeueing({
deqRedrawThreshold: B7,
deqCost: O7,
deqAvgCost: D7,
deqNoDrawCost: I7,
deqFastCost: N7,
deq: function(t, e, r) {
return t.dequeue(e, r);
},
onDeqd: function(t, e) {
for (var r = 0; r < t.onDequeues.length; r++) {
var i = t.onDequeues[r];
i(e);
}
},
shouldRedraw: function(t, e, r, i) {
for (var n = 0; n < e.length; n++)
for (var a = e[n].eles, o = 0; o < a.length; o++) {
var s = a[o].boundingBox();
if (Db(s, i))
return !0;
}
return !1;
},
priority: function(t) {
return t.renderer.beforeRenderPriorities.eleTxrDeq;
}
});
var $7 = 1, Zd = -4, jm = 2, V7 = 3.99, U7 = 50, j7 = 50, H7 = 0.15, G7 = 0.1, W7 = 0.9, q7 = 0.9, X7 = 1, rS = 250, Z7 = 4e3 * 4e3, Y7 = !0, F3 = function(t) {
var e = this, r = e.renderer = t, i = r.cy;
e.layersByLevel = {}, e.firstGet = !0, e.lastInvalidationTime = ro() - 2 * rS, e.skipping = !1, e.eleTxrDeqs = i.collection(), e.scheduleElementRefinement = Eg(function() {
e.refineElementTextures(e.eleTxrDeqs), e.eleTxrDeqs.unmerge(e.eleTxrDeqs);
}, j7), r.beforeRender(function(a, o) {
o - e.lastInvalidationTime <= rS ? e.skipping = !0 : e.skipping = !1;
}, r.beforeRenderPriorities.lyrTxrSkip);
var n = function(a, o) {
return o.reqs - a.reqs;
};
e.layersQueue = new np(n), e.setupDequeueing();
}, bi = F3.prototype, iS = 0, K7 = Math.pow(2, 53) - 1;
bi.makeLayer = function(t, e) {
var r = Math.pow(2, e), i = Math.ceil(t.w * r), n = Math.ceil(t.h * r), a = this.renderer.makeOffscreenCanvas(i, n), o = {
id: iS = ++iS % K7,
bb: t,
level: e,
width: i,
height: n,
canvas: a,
context: a.getContext("2d"),
eles: [],
elesQueue: [],
reqs: 0
}, s = o.context, c = -o.bb.x1, l = -o.bb.y1;
return s.scale(r, r), s.translate(c, l), o;
};
bi.getLayers = function(t, e, r) {
var i = this, n = i.renderer, a = n.cy, o = a.zoom(), s = i.firstGet;
if (i.firstGet = !1, r == null) {
if (r = Math.ceil(Ob(o * e)), r < Zd)
r = Zd;
else if (o >= V7 || r > jm)
return null;
}
i.validateLayersElesOrdering(r, t);
var c = i.layersByLevel, l = Math.pow(2, r), u = c[r] = c[r] || [], d, h = i.levelIsComplete(r, t), f, p = function() {
var E = function(k) {
if (i.validateLayersElesOrdering(k, t), i.levelIsComplete(k, t))
return f = c[k], !0;
}, C = function(k) {
if (!f)
for (var P = r + k; Zd <= P && P <= jm && !E(P); P += k)
;
};
C(1), C(-1);
for (var L = u.length - 1; L >= 0; L--) {
var A = u[L];
A.invalid && hs(u, A);
}
};
if (!h)
p();
else
return u;
var m = function() {
if (!d) {
d = Yi();
for (var E = 0; E < t.length; E++)
DA(d, t[E].boundingBox());
}
return d;
}, y = function(E) {
E = E || {};
var C = E.after;
m();
var L = d.w * l * (d.h * l);
if (L > Z7)
return null;
var A = i.makeLayer(d, r);
if (C != null) {
var k = u.indexOf(C) + 1;
u.splice(k, 0, A);
} else (E.insert === void 0 || E.insert) && u.unshift(A);
return A;
};
if (i.skipping && !s)
return null;
for (var g = null, v = t.length / $7, x = !s, w = 0; w < t.length; w++) {
var S = t[w], _ = S._private.rscratch, b = _.imgLayerCaches = _.imgLayerCaches || {}, T = b[r];
if (T) {
g = T;
continue;
}
if ((!g || g.eles.length >= v || !IA(g.bb, S.boundingBox())) && (g = y({
insert: !0,
after: g
}), !g))
return null;
f || x ? i.queueLayer(g, S) : i.drawEleInLayer(g, S, r, e), g.eles.push(S), b[r] = g;
}
return f || (x ? null : u);
};
bi.getEleLevelForLayerLevel = function(t, e) {
return t;
};
bi.drawEleInLayer = function(t, e, r, i) {
var n = this, a = this.renderer, o = t.context, s = e.boundingBox();
s.w === 0 || s.h === 0 || !e.visible() || (r = n.getEleLevelForLayerLevel(r, i), a.setImgSmoothing(o, !1), a.drawCachedElement(o, e, null, null, r, Y7), a.setImgSmoothing(o, !0));
};
bi.levelIsComplete = function(t, e) {
var r = this, i = r.layersByLevel[t];
if (!i || i.length === 0)
return !1;
for (var n = 0, a = 0; a < i.length; a++) {
var o = i[a];
if (o.reqs > 0 || o.invalid)
return !1;
n += o.eles.length;
}
return n === e.length;
};
bi.validateLayersElesOrdering = function(t, e) {
var r = this.layersByLevel[t];
if (r)
for (var i = 0; i < r.length; i++) {
for (var n = r[i], a = -1, o = 0; o < e.length; o++)
if (n.eles[0] === e[o]) {
a = o;
break;
}
if (a < 0) {
this.invalidateLayer(n);
continue;
}
for (var s = a, o = 0; o < n.eles.length; o++)
if (n.eles[o] !== e[s + o]) {
this.invalidateLayer(n);
break;
}
}
};
bi.updateElementsInLayers = function(t, e) {
for (var r = this, i = rp(t[0]), n = 0; n < t.length; n++)
for (var a = i ? null : t[n], o = i ? t[n] : t[n].ele, s = o._private.rscratch, c = s.imgLayerCaches = s.imgLayerCaches || {}, l = Zd; l <= jm; l++) {
var u = c[l];
u && (a && r.getEleLevelForLayerLevel(u.level) !== a.level || e(u, o, a));
}
};
bi.haveLayers = function() {
for (var t = this, e = !1, r = Zd; r <= jm; r++) {
var i = t.layersByLevel[r];
if (i && i.length > 0) {
e = !0;
break;
}
}
return e;
};
bi.invalidateElements = function(t) {
var e = this;
t.length !== 0 && (e.lastInvalidationTime = ro(), !(t.length === 0 || !e.haveLayers()) && e.updateElementsInLayers(t, function(r, i, n) {
e.invalidateLayer(r);
}));
};
bi.invalidateLayer = function(t) {
if (this.lastInvalidationTime = ro(), !t.invalid) {
var e = t.level, r = t.eles, i = this.layersByLevel[e];
hs(i, t), t.elesQueue = [], t.invalid = !0, t.replacement && (t.replacement.invalid = !0);
for (var n = 0; n < r.length; n++) {
var a = r[n]._private.rscratch.imgLayerCaches;
a && (a[e] = null);
}
}
};
bi.refineElementTextures = function(t) {
var e = this;
e.updateElementsInLayers(t, function(r, i, n) {
var a = r.replacement;
if (a || (a = r.replacement = e.makeLayer(r.bb, r.level), a.replaces = r, a.eles = r.eles), !a.reqs)
for (var o = 0; o < a.eles.length; o++)
e.queueLayer(a, a.eles[o]);
});
};
bi.enqueueElementRefinement = function(t) {
this.eleTxrDeqs.merge(t), this.scheduleElementRefinement();
};
bi.queueLayer = function(t, e) {
var r = this, i = r.layersQueue, n = t.elesQueue, a = n.hasId = n.hasId || {};
if (!t.replacement) {
if (e) {
if (a[e.id()])
return;
n.push(e), a[e.id()] = !0;
}
t.reqs ? (t.reqs++, i.updateItem(t)) : (t.reqs = 1, i.push(t));
}
};
bi.dequeue = function(t) {
for (var e = this, r = e.layersQueue, i = [], n = 0; n < X7 && r.size() !== 0; ) {
var a = r.peek();
if (a.replacement) {
r.pop();
continue;
}
if (a.replaces && a !== a.replaces.replacement) {
r.pop();
continue;
}
if (a.invalid) {
r.pop();
continue;
}
var o = a.elesQueue.shift();
o && (e.drawEleInLayer(a, o, a.level, t), n++), i.length === 0 && i.push(!0), a.elesQueue.length === 0 && (r.pop(), a.reqs = 0, a.replaces && e.applyLayerReplacement(a), e.requestRedraw());
}
return i;
};
bi.applyLayerReplacement = function(t) {
var e = this, r = e.layersByLevel[t.level], i = t.replaces, n = r.indexOf(i);
if (!(n < 0 || i.invalid)) {
r[n] = t;
for (var a = 0; a < t.eles.length; a++) {
var o = t.eles[a]._private, s = o.imgLayerCaches = o.imgLayerCaches || {};
s && (s[t.level] = t);
}
e.requestRedraw();
}
};
bi.requestRedraw = Eg(function() {
var t = this.renderer;
t.redrawHint("eles", !0), t.redrawHint("drag", !0), t.redraw();
}, 100);
bi.setupDequeueing = B3.setupDequeueing({
deqRedrawThreshold: U7,
deqCost: H7,
deqAvgCost: G7,
deqNoDrawCost: W7,
deqFastCost: q7,
deq: function(t, e) {
return t.dequeue(e);
},
onDeqd: Pb,
shouldRedraw: LA,
priority: function(t) {
return t.renderer.beforeRenderPriorities.lyrTxrDeq;
}
});
var z3 = {}, nS;
function J7(t, e) {
for (var r = 0; r < e.length; r++) {
var i = e[r];
t.lineTo(i.x, i.y);
}
}
function Q7(t, e, r) {
for (var i, n = 0; n < e.length; n++) {
var a = e[n];
n === 0 && (i = a), t.lineTo(a.x, a.y);
}
t.quadraticCurveTo(r.x, r.y, i.x, i.y);
}
function aS(t, e, r) {
t.beginPath && t.beginPath();
for (var i = e, n = 0; n < i.length; n++) {
var a = i[n];
t.lineTo(a.x, a.y);
}
var o = r, s = r[0];
t.moveTo(s.x, s.y);
for (var n = 1; n < o.length; n++) {
var a = o[n];
t.lineTo(a.x, a.y);
}
t.closePath && t.closePath();
}
function eq(t, e, r, i, n) {
t.beginPath && t.beginPath(), t.arc(r, i, n, 0, Math.PI * 2, !1);
var a = e, o = a[0];
t.moveTo(o.x, o.y);
for (var s = 0; s < a.length; s++) {
var c = a[s];
t.lineTo(c.x, c.y);
}
t.closePath && t.closePath();
}
function tq(t, e, r, i) {
t.arc(e, r, i, 0, Math.PI * 2, !1);
}
z3.arrowShapeImpl = function(t) {
return (nS || (nS = {
polygon: J7,
"triangle-backcurve": Q7,
"triangle-tee": aS,
"circle-triangle": eq,
"triangle-cross": aS,
circle: tq
}))[t];
};
var Ta = {};
Ta.drawElement = function(t, e, r, i, n, a) {
var o = this;
e.isNode() ? o.drawNode(t, e, r, i, n, a) : o.drawEdge(t, e, r, i, n, a);
};
Ta.drawElementOverlay = function(t, e) {
var r = this;
e.isNode() ? r.drawNodeOverlay(t, e) : r.drawEdgeOverlay(t, e);
};
Ta.drawElementUnderlay = function(t, e) {
var r = this;
e.isNode() ? r.drawNodeUnderlay(t, e) : r.drawEdgeUnderlay(t, e);
};
Ta.drawCachedElementPortion = function(t, e, r, i, n, a, o, s) {
var c = this, l = r.getBoundingBox(e);
if (!(l.w === 0 || l.h === 0)) {
var u = r.getElement(e, l, i, n, a);
if (u != null) {
var d = s(c, e);
if (d === 0)
return;
var h = o(c, e), f = l.x1, p = l.y1, m = l.w, y = l.h, g, v, x, w, S;
if (h !== 0) {
var _ = r.getRotationPoint(e);
x = _.x, w = _.y, t.translate(x, w), t.rotate(h), S = c.getImgSmoothing(t), S || c.setImgSmoothing(t, !0);
var b = r.getRotationOffset(e);
g = b.x, v = b.y;
} else
g = f, v = p;
var T;
d !== 1 && (T = t.globalAlpha, t.globalAlpha = T * d), t.drawImage(u.texture.canvas, u.x, 0, u.width, u.height, g, v, m, y), d !== 1 && (t.globalAlpha = T), h !== 0 && (t.rotate(-h), t.translate(-x, -w), S || c.setImgSmoothing(t, !1));
} else
r.drawElement(t, e);
}
};
var rq = function() {
return 0;
}, iq = function(t, e) {
return t.getTextAngle(e, null);
}, nq = function(t, e) {
return t.getTextAngle(e, "source");
}, aq = function(t, e) {
return t.getTextAngle(e, "target");
}, oq = function(t, e) {
return e.effectiveOpacity();
}, Kv = function(t, e) {
return e.pstyle("text-opacity").pfValue * e.effectiveOpacity();
};
Ta.drawCachedElement = function(t, e, r, i, n, a) {
var o = this, s = o.data, c = s.eleTxrCache, l = s.lblTxrCache, u = s.slbTxrCache, d = s.tlbTxrCache, h = e.boundingBox(), f = a === !0 ? c.reasons.highQuality : null;
if (!(h.w === 0 || h.h === 0 || !e.visible()) && (!i || Db(h, i))) {
var p = e.isEdge(), m = e.element()._private.rscratch.badLine;
o.drawElementUnderlay(t, e), o.drawCachedElementPortion(t, e, c, r, n, f, rq, oq), (!p || !m) && o.drawCachedElementPortion(t, e, l, r, n, f, iq, Kv), p && !m && (o.drawCachedElementPortion(t, e, u, r, n, f, nq, Kv), o.drawCachedElementPortion(t, e, d, r, n, f, aq, Kv)), o.drawElementOverlay(t, e);
}
};
Ta.drawElements = function(t, e) {
for (var r = this, i = 0; i < e.length; i++) {
var n = e[i];
r.drawElement(t, n);
}
};
Ta.drawCachedElements = function(t, e, r, i) {
for (var n = this, a = 0; a < e.length; a++) {
var o = e[a];
n.drawCachedElement(t, o, r, i);
}
};
Ta.drawCachedNodes = function(t, e, r, i) {
for (var n = this, a = 0; a < e.length; a++) {
var o = e[a];
o.isNode() && n.drawCachedElement(t, o, r, i);
}
};
Ta.drawLayeredElements = function(t, e, r, i) {
var n = this, a = n.data.lyrTxrCache.getLayers(e, r);
if (a)
for (var o = 0; o < a.length; o++) {
var s = a[o], c = s.bb;
c.w === 0 || c.h === 0 || t.drawImage(s.canvas, c.x1, c.y1, c.w, c.h);
}
else
n.drawCachedElements(t, e, r, i);
};
var mo = {};
mo.drawEdge = function(t, e, r) {
var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this, s = e._private.rscratch;
if (!(a && !e.visible()) && !(s.badLine || s.allpts == null || isNaN(s.allpts[0]))) {
var c;
r && (c = r, t.translate(-c.x1, -c.y1));
var l = a ? e.pstyle("opacity").value : 1, u = a ? e.pstyle("line-opacity").value : 1, d = e.pstyle("curve-style").value, h = e.pstyle("line-style").value, f = e.pstyle("width").pfValue, p = e.pstyle("line-cap").value, m = e.pstyle("line-outline-width").value, y = e.pstyle("line-outline-color").value, g = l * u, v = l * u, x = function() {
var P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g;
d === "straight-triangle" ? (o.eleStrokeStyle(t, e, P), o.drawEdgeTrianglePath(e, t, s.allpts)) : (t.lineWidth = f, t.lineCap = p, o.eleStrokeStyle(t, e, P), o.drawEdgePath(e, t, s.allpts, h), t.lineCap = "butt");
}, w = function() {
var P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : g;
if (t.lineWidth = f + m, t.lineCap = p, m > 0)
o.colorStrokeStyle(t, y[0], y[1], y[2], P);
else {
t.lineCap = "butt";
return;
}
d === "straight-triangle" ? o.drawEdgeTrianglePath(e, t, s.allpts) : (o.drawEdgePath(e, t, s.allpts, h), t.lineCap = "butt");
}, S = function() {
n && o.drawEdgeOverlay(t, e);
}, _ = function() {
n && o.drawEdgeUnderlay(t, e);
}, b = function() {
var P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : v;
o.drawArrowheads(t, e, P);
}, T = function() {
o.drawElementText(t, e, null, i);
};
t.lineJoin = "round";
var E = e.pstyle("ghost").value === "yes";
if (E) {
var C = e.pstyle("ghost-offset-x").pfValue, L = e.pstyle("ghost-offset-y").pfValue, A = e.pstyle("ghost-opacity").value, k = g * A;
t.translate(C, L), x(k), b(k), t.translate(-C, -L);
} else
w();
_(), x(), b(), S(), T(), r && t.translate(c.x1, c.y1);
}
};
var $3 = function(t) {
if (!["overlay", "underlay"].includes(t))
throw new Error("Invalid state");
return function(e, r) {
if (r.visible()) {
var i = r.pstyle("".concat(t, "-opacity")).value;
if (i !== 0) {
var n = this, a = n.usePaths(), o = r._private.rscratch, s = r.pstyle("".concat(t, "-padding")).pfValue, c = 2 * s, l = r.pstyle("".concat(t, "-color")).value;
e.lineWidth = c, o.edgeType === "self" && !a ? e.lineCap = "butt" : e.lineCap = "round", n.colorStrokeStyle(e, l[0], l[1], l[2], i), n.drawEdgePath(r, e, o.allpts, "solid");
}
}
};
};
mo.drawEdgeOverlay = $3("overlay");
mo.drawEdgeUnderlay = $3("underlay");
mo.drawEdgePath = function(t, e, r, i) {
var n = t._private.rscratch, a = e, o, s = !1, c = this.usePaths(), l = t.pstyle("line-dash-pattern").pfValue, u = t.pstyle("line-dash-offset").pfValue;
if (c) {
var d = r.join("$"), h = n.pathCacheKey && n.pathCacheKey === d;
h ? (o = e = n.pathCache, s = !0) : (o = e = new Path2D(), n.pathCacheKey = d, n.pathCache = o);
}
if (a.setLineDash)
switch (i) {
case "dotted":
a.setLineDash([1, 1]);
break;
case "dashed":
a.setLineDash(l), a.lineDashOffset = u;
break;
case "solid":
a.setLineDash([]);
break;
}
if (!s && !n.badLine)
switch (e.beginPath && e.beginPath(), e.moveTo(r[0], r[1]), n.edgeType) {
case "bezier":
case "self":
case "compound":
case "multibezier":
for (var f = 2; f + 3 < r.length; f += 4)
e.quadraticCurveTo(r[f], r[f + 1], r[f + 2], r[f + 3]);
break;
case "straight":
case "haystack":
for (var p = 2; p + 1 < r.length; p += 2)
e.lineTo(r[p], r[p + 1]);
break;
case "segments":
if (n.isRound) {
var m = mA(n.roundCorners), y;
try {
for (m.s(); !(y = m.n()).done; ) {
var g = y.value;
L3(e, g);
}
} catch (x) {
m.e(x);
} finally {
m.f();
}
e.lineTo(r[r.length - 2], r[r.length - 1]);
} else
for (var v = 2; v + 1 < r.length; v += 2)
e.lineTo(r[v], r[v + 1]);
break;
}
e = a, c ? e.stroke(o) : e.stroke(), e.setLineDash && e.setLineDash([]);
};
mo.drawEdgeTrianglePath = function(t, e, r) {
e.fillStyle = e.strokeStyle;
for (var i = t.pstyle("width").pfValue, n = 0; n + 1 < r.length; n += 2) {
var a = [r[n + 2] - r[n], r[n + 3] - r[n + 1]], o = Math.sqrt(a[0] * a[0] + a[1] * a[1]), s = [a[1] / o, -a[0] / o], c = [s[0] * i / 2, s[1] * i / 2];
e.beginPath(), e.moveTo(r[n] - c[0], r[n + 1] - c[1]), e.lineTo(r[n] + c[0], r[n + 1] + c[1]), e.lineTo(r[n + 2], r[n + 3]), e.closePath(), e.fill();
}
};
mo.drawArrowheads = function(t, e, r) {
var i = e._private.rscratch, n = i.edgeType === "haystack";
n || this.drawArrowhead(t, e, "source", i.arrowStartX, i.arrowStartY, i.srcArrowAngle, r), this.drawArrowhead(t, e, "mid-target", i.midX, i.midY, i.midtgtArrowAngle, r), this.drawArrowhead(t, e, "mid-source", i.midX, i.midY, i.midsrcArrowAngle, r), n || this.drawArrowhead(t, e, "target", i.arrowEndX, i.arrowEndY, i.tgtArrowAngle, r);
};
mo.drawArrowhead = function(t, e, r, i, n, a, o) {
if (!(isNaN(i) || i == null || isNaN(n) || n == null || isNaN(a) || a == null)) {
var s = this, c = e.pstyle(r + "-arrow-shape").value;
if (c !== "none") {
var l = e.pstyle(r + "-arrow-fill").value === "hollow" ? "both" : "filled", u = e.pstyle(r + "-arrow-fill").value, d = e.pstyle("width").pfValue, h = e.pstyle(r + "-arrow-width"), f = h.value === "match-line" ? d : h.pfValue;
h.units === "%" && (f *= d);
var p = e.pstyle("opacity").value;
o === void 0 && (o = p);
var m = t.globalCompositeOperation;
(o !== 1 || u === "hollow") && (t.globalCompositeOperation = "destination-out", s.colorFillStyle(t, 255, 255, 255, 1), s.colorStrokeStyle(t, 255, 255, 255, 1), s.drawArrowShape(e, t, l, d, c, f, i, n, a), t.globalCompositeOperation = m);
var y = e.pstyle(r + "-arrow-color").value;
s.colorFillStyle(t, y[0], y[1], y[2], o), s.colorStrokeStyle(t, y[0], y[1], y[2], o), s.drawArrowShape(e, t, u, d, c, f, i, n, a);
}
}
};
mo.drawArrowShape = function(t, e, r, i, n, a, o, s, c) {
var l = this, u = this.usePaths() && n !== "triangle-cross", d = !1, h, f = e, p = {
x: o,
y: s
}, m = t.pstyle("arrow-scale").value, y = this.getArrowWidth(i, m), g = l.arrowShapes[n];
if (u) {
var v = l.arrowPathCache = l.arrowPathCache || [], x = wl(n), w = v[x];
w != null ? (h = e = w, d = !0) : (h = e = new Path2D(), v[x] = h);
}
d || (e.beginPath && e.beginPath(), u ? g.draw(e, 1, 0, {
x: 0,
y: 0
}, 1) : g.draw(e, y, c, p, i), e.closePath && e.closePath()), e = f, u && (e.translate(o, s), e.rotate(c), e.scale(y, y)), (r === "filled" || r === "both") && (u ? e.fill(h) : e.fill()), (r === "hollow" || r === "both") && (e.lineWidth = a / (u ? y : 1), e.lineJoin = "miter", u ? e.stroke(h) : e.stroke()), u && (e.scale(1 / y, 1 / y), e.rotate(-c), e.translate(-o, -s));
};
var Zb = {};
Zb.safeDrawImage = function(t, e, r, i, n, a, o, s, c, l) {
if (!(n <= 0 || a <= 0 || c <= 0 || l <= 0))
try {
t.drawImage(e, r, i, n, a, o, s, c, l);
} catch (u) {
Zt(u);
}
};
Zb.drawInscribedImage = function(t, e, r, i, n) {
var a = this, o = r.position(), s = o.x, c = o.y, l = r.cy().style(), u = l.getIndexedStyle.bind(l), d = u(r, "background-fit", "value", i), h = u(r, "background-repeat", "value", i), f = r.width(), p = r.height(), m = r.padding() * 2, y = f + (u(r, "background-width-relative-to", "value", i) === "inner" ? 0 : m), g = p + (u(r, "background-height-relative-to", "value", i) === "inner" ? 0 : m), v = r._private.rscratch, x = u(r, "background-clip", "value", i), w = x === "node", S = u(r, "background-image-opacity", "value", i) * n, _ = u(r, "background-image-smoothing", "value", i), b = r.pstyle("corner-radius").value;
b !== "auto" && (b = r.pstyle("corner-radius").pfValue);
var T = e.width || e.cachedW, E = e.height || e.cachedH;
(T == null || E == null) && (document.body.appendChild(e), T = e.cachedW = e.width || e.offsetWidth, E = e.cachedH = e.height || e.offsetHeight, document.body.removeChild(e));
var C = T, L = E;
if (u(r, "background-width", "value", i) !== "auto" && (u(r, "background-width", "units", i) === "%" ? C = u(r, "background-width", "pfValue", i) * y : C = u(r, "background-width", "pfValue", i)), u(r, "background-height", "value", i) !== "auto" && (u(r, "background-height", "units", i) === "%" ? L = u(r, "background-height", "pfValue", i) * g : L = u(r, "background-height", "pfValue", i)), !(C === 0 || L === 0)) {
if (d === "contain") {
var A = Math.min(y / C, g / L);
C *= A, L *= A;
} else if (d === "cover") {
var A = Math.max(y / C, g / L);
C *= A, L *= A;
}
var k = s - y / 2, P = u(r, "background-position-x", "units", i), R = u(r, "background-position-x", "pfValue", i);
P === "%" ? k += (y - C) * R : k += R;
var M = u(r, "background-offset-x", "units", i), O = u(r, "background-offset-x", "pfValue", i);
M === "%" ? k += (y - C) * O : k += O;
var D = c - g / 2, I = u(r, "background-position-y", "units", i), F = u(r, "background-position-y", "pfValue", i);
I === "%" ? D += (g - L) * F : D += F;
var z = u(r, "background-offset-y", "units", i), U = u(r, "background-offset-y", "pfValue", i);
z === "%" ? D += (g - L) * U : D += U, v.pathCache && (k -= s, D -= c, s = 0, c = 0);
var Z = t.globalAlpha;
t.globalAlpha = S;
var re = a.getImgSmoothing(t), K = !1;
if (_ === "no" && re ? (a.setImgSmoothing(t, !1), K = !0) : _ === "yes" && !re && (a.setImgSmoothing(t, !0), K = !0), h === "no-repeat")
w && (t.save(), v.pathCache ? t.clip(v.pathCache) : (a.nodeShapes[a.getNodeShape(r)].draw(t, s, c, y, g, b, v), t.clip())), a.safeDrawImage(t, e, 0, 0, T, E, k, D, C, L), w && t.restore();
else {
var V = t.createPattern(e, h);
t.fillStyle = V, a.nodeShapes[a.getNodeShape(r)].draw(t, s, c, y, g, b, v), t.translate(k, D), t.fill(), t.translate(-k, -D);
}
t.globalAlpha = Z, K && a.setImgSmoothing(t, re);
}
};
var Ul = {};
Ul.eleTextBiggerThanMin = function(t, e) {
if (!e) {
var r = t.cy().zoom(), i = this.getPixelRatio(), n = Math.ceil(Ob(r * i));
e = Math.pow(2, n);
}
var a = t.pstyle("font-size").pfValue * e, o = t.pstyle("min-zoomed-font-size").pfValue;
return !(a < o);
};
Ul.drawElementText = function(t, e, r, i, n) {
var a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this;
if (i == null) {
if (a && !o.eleTextBiggerThanMin(e))
return;
} else if (i === !1)
return;
if (e.isNode()) {
var s = e.pstyle("label");
if (!s || !s.value)
return;
var c = o.getLabelJustification(e);
t.textAlign = c, t.textBaseline = "bottom";
} else {
var l = e.element()._private.rscratch.badLine, u = e.pstyle("label"), d = e.pstyle("source-label"), h = e.pstyle("target-label");
if (l || (!u || !u.value) && (!d || !d.value) && (!h || !h.value))
return;
t.textAlign = "center", t.textBaseline = "bottom";
}
var f = !r, p;
r && (p = r, t.translate(-p.x1, -p.y1)), n == null ? (o.drawText(t, e, null, f, a), e.isEdge() && (o.drawText(t, e, "source", f, a), o.drawText(t, e, "target", f, a))) : o.drawText(t, e, n, f, a), r && t.translate(p.x1, p.y1);
};
Ul.getFontCache = function(t) {
var e;
this.fontCaches = this.fontCaches || [];
for (var r = 0; r < this.fontCaches.length; r++)
if (e = this.fontCaches[r], e.context === t)
return e;
return e = {
context: t
}, this.fontCaches.push(e), e;
};
Ul.setupTextStyle = function(t, e) {
var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !0, i = e.pstyle("font-style").strValue, n = e.pstyle("font-size").pfValue + "px", a = e.pstyle("font-family").strValue, o = e.pstyle("font-weight").strValue, s = r ? e.effectiveOpacity() * e.pstyle("text-opacity").value : 1, c = e.pstyle("text-outline-opacity").value * s, l = e.pstyle("color").value, u = e.pstyle("text-outline-color").value;
t.font = i + " " + o + " " + n + " " + a, t.lineJoin = "round", this.colorFillStyle(t, l[0], l[1], l[2], s), this.colorStrokeStyle(t, u[0], u[1], u[2], c);
};
function Jv(t, e, r, i, n) {
var a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5, o = arguments.length > 6 ? arguments[6] : void 0;
t.beginPath(), t.moveTo(e + a, r), t.lineTo(e + i - a, r), t.quadraticCurveTo(e + i, r, e + i, r + a), t.lineTo(e + i, r + n - a), t.quadraticCurveTo(e + i, r + n, e + i - a, r + n), t.lineTo(e + a, r + n), t.quadraticCurveTo(e, r + n, e, r + n - a), t.lineTo(e, r + a), t.quadraticCurveTo(e, r, e + a, r), t.closePath(), o ? t.stroke() : t.fill();
}
Ul.getTextAngle = function(t, e) {
var r, i = t._private, n = i.rscratch, a = e ? e + "-" : "", o = t.pstyle(a + "text-rotation"), s = $n(n, "labelAngle", e);
return o.strValue === "autorotate" ? r = t.isEdge() ? s : 0 : o.strValue === "none" ? r = 0 : r = o.pfValue, r;
};
Ul.drawText = function(t, e, r) {
var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = e._private, o = a.rscratch, s = n ? e.effectiveOpacity() : 1;
if (!(n && (s === 0 || e.pstyle("text-opacity").value === 0))) {
r === "main" && (r = null);
var c = $n(o, "labelX", r), l = $n(o, "labelY", r), u, d, h = this.getLabelText(e, r);
if (h != null && h !== "" && !isNaN(c) && !isNaN(l)) {
this.setupTextStyle(t, e, n);
var f = r ? r + "-" : "", p = $n(o, "labelWidth", r), m = $n(o, "labelHeight", r), y = e.pstyle(f + "text-margin-x").pfValue, g = e.pstyle(f + "text-margin-y").pfValue, v = e.isEdge(), x = e.pstyle("text-halign").value, w = e.pstyle("text-valign").value;
v && (x = "center", w = "center"), c += y, l += g;
var S;
switch (i ? S = this.getTextAngle(e, r) : S = 0, S !== 0 && (u = c, d = l, t.translate(u, d), t.rotate(S), c = 0, l = 0), w) {
case "top":
break;
case "center":
l += m / 2;
break;
case "bottom":
l += m;
break;
}
var _ = e.pstyle("text-background-opacity").value, b = e.pstyle("text-border-opacity").value, T = e.pstyle("text-border-width").pfValue, E = e.pstyle("text-background-padding").pfValue, C = e.pstyle("text-background-shape").strValue, L = C.indexOf("round") === 0, A = 2;
if (_ > 0 || T > 0 && b > 0) {
var k = c - E;
switch (x) {
case "left":
k -= p;
break;
case "center":
k -= p / 2;
break;
}
var P = l - m - E, R = p + 2 * E, M = m + 2 * E;
if (_ > 0) {
var O = t.fillStyle, D = e.pstyle("text-background-color").value;
t.fillStyle = "rgba(" + D[0] + "," + D[1] + "," + D[2] + "," + _ * s + ")", L ? Jv(t, k, P, R, M, A) : t.fillRect(k, P, R, M), t.fillStyle = O;
}
if (T > 0 && b > 0) {
var I = t.strokeStyle, F = t.lineWidth, z = e.pstyle("text-border-color").value, U = e.pstyle("text-border-style").value;
if (t.strokeStyle = "rgba(" + z[0] + "," + z[1] + "," + z[2] + "," + b * s + ")", t.lineWidth = T, t.setLineDash)
switch (U) {
case "dotted":
t.setLineDash([1, 1]);
break;
case "dashed":
t.setLineDash([4, 2]);
break;
case "double":
t.lineWidth = T / 4, t.setLineDash([]);
break;
case "solid":
t.setLineDash([]);
break;
}
if (L ? Jv(t, k, P, R, M, A, "stroke") : t.strokeRect(k, P, R, M), U === "double") {
var Z = T / 2;
L ? Jv(t, k + Z, P + Z, R - Z * 2, M - Z * 2, A, "stroke") : t.strokeRect(k + Z, P + Z, R - Z * 2, M - Z * 2);
}
t.setLineDash && t.setLineDash([]), t.lineWidth = F, t.strokeStyle = I;
}
}
var re = 2 * e.pstyle("text-outline-width").pfValue;
if (re > 0 && (t.lineWidth = re), e.pstyle("text-wrap").value === "wrap") {
var K = $n(o, "labelWrapCachedLines", r), V = $n(o, "labelLineHeight", r), H = p / 2, G = this.getLabelJustification(e);
switch (G === "auto" || (x === "left" ? G === "left" ? c += -p : G === "center" && (c += -H) : x === "center" ? G === "left" ? c += -H : G === "right" && (c += H) : x === "right" && (G === "center" ? c += H : G === "right" && (c += p))), w) {
case "top":
l -= (K.length - 1) * V;
break;
case "center":
case "bottom":
l -= (K.length - 1) * V;
break;
}
for (var W = 0; W < K.length; W++)
re > 0 && t.strokeText(K[W], c, l), t.fillText(K[W], c, l), l += V;
} else
re > 0 && t.strokeText(h, c, l), t.fillText(h, c, l);
S !== 0 && (t.rotate(-S), t.translate(-u, -d));
}
}
};
var Gu = {};
Gu.drawNode = function(t, e, r) {
var i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !0, n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !0, o = this, s, c, l = e._private, u = l.rscratch, d = e.position();
if (!(!Xe(d.x) || !Xe(d.y)) && !(a && !e.visible())) {
var h = a ? e.effectiveOpacity() : 1, f = o.usePaths(), p, m = !1, y = e.padding();
s = e.width() + 2 * y, c = e.height() + 2 * y;
var g;
r && (g = r, t.translate(-g.x1, -g.y1));
for (var v = e.pstyle("background-image"), x = v.value, w = new Array(x.length), S = new Array(x.length), _ = 0, b = 0; b < x.length; b++) {
var T = x[b], E = w[b] = T != null && T !== "none";
if (E) {
var C = e.cy().style().getIndexedStyle(e, "background-image-crossorigin", "value", b);
_++, S[b] = o.getCachedImage(T, C, function() {
l.backgroundTimestamp = Date.now(), e.emitAndNotify("background");
});
}
}
var L = e.pstyle("background-blacken").value, A = e.pstyle("border-width").pfValue, k = e.pstyle("background-opacity").value * h, P = e.pstyle("border-color").value, R = e.pstyle("border-style").value, M = e.pstyle("border-join").value, O = e.pstyle("border-cap").value, D = e.pstyle("border-position").value, I = e.pstyle("border-dash-pattern").pfValue, F = e.pstyle("border-dash-offset").pfValue, z = e.pstyle("border-opacity").value * h, U = e.pstyle("outline-width").pfValue, Z = e.pstyle("outline-color").value, re = e.pstyle("outline-style").value, K = e.pstyle("outline-opacity").value * h, V = e.pstyle("outline-offset").value, H = e.pstyle("corner-radius").value;
H !== "auto" && (H = e.pstyle("corner-radius").pfValue);
var G = function() {
var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : k;
o.eleFillStyle(t, e, fe);
}, W = function() {
var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : z;
o.colorStrokeStyle(t, P[0], P[1], P[2], fe);
}, Y = function() {
var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : K;
o.colorStrokeStyle(t, Z[0], Z[1], Z[2], fe);
}, X = function(fe, he, Te, He) {
var We = o.nodePathCache = o.nodePathCache || [], Ie = AA(Te === "polygon" ? Te + "," + He.join(",") : Te, "" + he, "" + fe, "" + H), qe = We[Ie], De, $e = !1;
return qe != null ? (De = qe, $e = !0, u.pathCache = De) : (De = new Path2D(), We[Ie] = u.pathCache = De), {
path: De,
cacheHit: $e
};
}, ie = e.pstyle("shape").strValue, ue = e.pstyle("shape-polygon-points").pfValue;
if (f) {
t.translate(d.x, d.y);
var $ = X(s, c, ie, ue);
p = $.path, m = $.cacheHit;
}
var J = function() {
if (!m) {
var fe = d;
f && (fe = {
x: 0,
y: 0
}), o.nodeShapes[o.getNodeShape(e)].draw(p || t, fe.x, fe.y, s, c, H, u);
}
f ? t.fill(p) : t.fill();
}, ne = function() {
for (var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : h, he = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, Te = l.backgrounding, He = 0, We = 0; We < S.length; We++) {
var Ie = e.cy().style().getIndexedStyle(e, "background-image-containment", "value", We);
if (he && Ie === "over" || !he && Ie === "inside") {
He++;
continue;
}
w[We] && S[We].complete && !S[We].error && (He++, o.drawInscribedImage(t, S[We], e, We, fe));
}
l.backgrounding = He !== _, Te !== l.backgrounding && e.updateStyle(!1);
}, j = function() {
var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, he = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : h;
o.hasPie(e) && (o.drawPie(t, e, he), fe && (f || o.nodeShapes[o.getNodeShape(e)].draw(t, d.x, d.y, s, c, H, u)));
}, q = function() {
var fe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : h, he = (L > 0 ? L : -L) * fe, Te = L > 0 ? 0 : 255;
L !== 0 && (o.colorFillStyle(t, Te, Te, Te, he), f ? t.fill(p) : t.fill());
}, ge = function() {
if (A > 0) {
if (t.lineWidth = A, t.lineCap = O, t.lineJoin = M, t.setLineDash)
switch (R) {
case "dotted":
t.setLineDash([1, 1]);
break;
case "dashed":
t.setLineDash(I), t.lineDashOffset = F;
break;
case "solid":
case "double":
t.setLineDash([]);
break;
}
if (D !== "center") {
if (t.save(), t.lineWidth *= 2, D === "inside")
f ? t.clip(p) : t.clip();
else {
var fe = new Path2D();
fe.rect(-s / 2 - A, -c / 2 - A, s + 2 * A, c + 2 * A), fe.addPath(p), t.clip(fe, "evenodd");
}
f ? t.stroke(p) : t.stroke(), t.restore();
} else
f ? t.stroke(p) : t.stroke();
if (R === "double") {
t.lineWidth = A / 3;
var he = t.globalCompositeOperation;
t.globalCompositeOperation = "destination-out", f ? t.stroke(p) : t.stroke(), t.globalCompositeOperation = he;
}
t.setLineDash && t.setLineDash([]);
}
}, ye = function() {
if (U > 0) {
if (t.lineWidth = U, t.lineCap = "butt", t.setLineDash)
switch (re) {
case "dotted":
t.setLineDash([1, 1]);
break;
case "dashed":
t.setLineDash([4, 2]);
break;
case "solid":
case "double":
t.setLineDash([]);
break;
}
var fe = d;
f && (fe = {
x: 0,
y: 0
});
var he = o.getNodeShape(e), Te = A;
D === "inside" && (Te = 0), D === "outside" && (Te *= 2);
var He = (s + Te + (U + V)) / s, We = (c + Te + (U + V)) / c, Ie = s * He, qe = c * We, De = o.nodeShapes[he].points, $e;
if (f) {
var nt = X(Ie, qe, he, De);
$e = nt.path;
}
if (he === "ellipse")
o.drawEllipsePath($e || t, fe.x, fe.y, Ie, qe);
else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(he)) {
var lt = 0, mt = 0, _t = 0;
he === "round-diamond" ? lt = (Te + V + U) * 1.4 : he === "round-heptagon" ? (lt = (Te + V + U) * 1.075, _t = -(Te / 2 + V + U) / 35) : he === "round-hexagon" ? lt = (Te + V + U) * 1.12 : he === "round-pentagon" ? (lt = (Te + V + U) * 1.13, _t = -(Te / 2 + V + U) / 15) : he === "round-tag" ? (lt = (Te + V + U) * 1.12, mt = (Te / 2 + U + V) * 0.07) : he === "round-triangle" && (lt = (Te + V + U) * (Math.PI / 2), _t = -(Te + V / 2 + U) / Math.PI), lt !== 0 && (He = (s + lt) / s, Ie = s * He, ["round-hexagon", "round-tag"].includes(he) || (We = (c + lt) / c, qe = c * We)), H = H === "auto" ? FA(Ie, qe) : H;
for (var wt = Ie / 2, me = qe / 2, Ne = H + (Te + U + V) / 2, Ue = new Array(De.length / 2), Ke = new Array(De.length / 2), ct = 0; ct < De.length / 2; ct++)
Ue[ct] = {
x: fe.x + mt + wt * De[ct * 2],
y: fe.y + _t + me * De[ct * 2 + 1]
};
var xt, At, Ft, zt, se = Ue.length;
for (At = Ue[se - 1], xt = 0; xt < se; xt++)
Ft = Ue[xt % se], zt = Ue[(xt + 1) % se], Ke[xt] = qb(At, Ft, zt, Ne), At = Ft, Ft = zt;
o.drawRoundPolygonPath($e || t, fe.x + mt, fe.y + _t, s * He, c * We, De, Ke);
} else if (["roundrectangle", "round-rectangle"].includes(he))
H = H === "auto" ? Sl(Ie, qe) : H, o.drawRoundRectanglePath($e || t, fe.x, fe.y, Ie, qe, H + (Te + U + V) / 2);
else if (["cutrectangle", "cut-rectangle"].includes(he))
H = H === "auto" ? Ib() : H, o.drawCutRectanglePath($e || t, fe.x, fe.y, Ie, qe, null, H + (Te + U + V) / 4);
else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(he))
H = H === "auto" ? Sl(Ie, qe) : H, o.drawBottomRoundRectanglePath($e || t, fe.x, fe.y, Ie, qe, H + (Te + U + V) / 2);
else if (he === "barrel")
o.drawBarrelPath($e || t, fe.x, fe.y, Ie, qe);
else if (he.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(he)) {
var ke = (Te + U + V) / s;
De = Im(Nm(De, ke)), o.drawPolygonPath($e || t, fe.x, fe.y, s, c, De);
} else {
var Ae = (Te + U + V) / s;
De = Im(Nm(De, -Ae)), o.drawPolygonPath($e || t, fe.x, fe.y, s, c, De);
}
if (f ? t.stroke($e) : t.stroke(), re === "double") {
t.lineWidth = Te / 3;
var Oe = t.globalCompositeOperation;
t.globalCompositeOperation = "destination-out", f ? t.stroke($e) : t.stroke(), t.globalCompositeOperation = Oe;
}
t.setLineDash && t.setLineDash([]);
}
}, _e = function() {
n && o.drawNodeOverlay(t, e, d, s, c);
}, Me = function() {
n && o.drawNodeUnderlay(t, e, d, s, c);
}, Ce = function() {
o.drawElementText(t, e, null, i);
}, B = e.pstyle("ghost").value === "yes";
if (B) {
var ce = e.pstyle("ghost-offset-x").pfValue, ve = e.pstyle("ghost-offset-y").pfValue, te = e.pstyle("ghost-opacity").value, pe = te * h;
t.translate(ce, ve), Y(), ye(), G(te * k), J(), ne(pe, !0), W(te * z), ge(), j(L !== 0 || A !== 0), ne(pe, !1), q(pe), t.translate(-ce, -ve);
}
f && t.translate(-d.x, -d.y), Me(), f && t.translate(d.x, d.y), Y(), ye(), G(), J(), ne(h, !0), W(), ge(), j(L !== 0 || A !== 0), ne(h, !1), q(), f && t.translate(-d.x, -d.y), Ce(), _e(), r && t.translate(g.x1, g.y1);
}
};
var V3 = function(t) {
if (!["overlay", "underlay"].includes(t))
throw new Error("Invalid state");
return function(e, r, i, n, a) {
var o = this;
if (r.visible()) {
var s = r.pstyle("".concat(t, "-padding")).pfValue, c = r.pstyle("".concat(t, "-opacity")).value, l = r.pstyle("".concat(t, "-color")).value, u = r.pstyle("".concat(t, "-shape")).value, d = r.pstyle("".concat(t, "-corner-radius")).value;
if (c > 0) {
if (i = i || r.position(), n == null || a == null) {
var h = r.padding();
n = r.width() + 2 * h, a = r.height() + 2 * h;
}
o.colorFillStyle(e, l[0], l[1], l[2], c), o.nodeShapes[u].draw(e, i.x, i.y, n + s * 2, a + s * 2, d), e.fill();
}
}
};
};
Gu.drawNodeOverlay = V3("overlay");
Gu.drawNodeUnderlay = V3("underlay");
Gu.hasPie = function(t) {
return t = t[0], t._private.hasPie;
};
Gu.drawPie = function(t, e, r, i) {
e = e[0], i = i || e.position();
var n = e.cy().style(), a = e.pstyle("pie-size"), o = i.x, s = i.y, c = e.width(), l = e.height(), u = Math.min(c, l) / 2, d = 0, h = this.usePaths();
h && (o = 0, s = 0), a.units === "%" ? u = u * a.pfValue : a.pfValue !== void 0 && (u = a.pfValue / 2);
for (var f = 1; f <= n.pieBackgroundN; f++) {
var p = e.pstyle("pie-" + f + "-background-size").value, m = e.pstyle("pie-" + f + "-background-color").value, y = e.pstyle("pie-" + f + "-background-opacity").value * r, g = p / 100;
g + d > 1 && (g = 1 - d);
var v = 1.5 * Math.PI + 2 * Math.PI * d, x = 2 * Math.PI * g, w = v + x;
p === 0 || d >= 1 || d + g > 1 || (t.beginPath(), t.moveTo(o, s), t.arc(o, s, u, v, w), t.closePath(), this.colorFillStyle(t, m[0], m[1], m[2], y), t.fill(), d += g);
}
};
var hn = {}, sq = 100;
hn.getPixelRatio = function() {
var t = this.data.contexts[0];
if (this.forcedPixelRatio != null)
return this.forcedPixelRatio;
var e = this.cy.window(), r = t.backingStorePixelRatio || t.webkitBackingStorePixelRatio || t.mozBackingStorePixelRatio || t.msBackingStorePixelRatio || t.oBackingStorePixelRatio || t.backingStorePixelRatio || 1;
return (e.devicePixelRatio || 1) / r;
};
hn.paintCache = function(t) {
for (var e = this.paintCaches = this.paintCaches || [], r = !0, i, n = 0; n < e.length; n++)
if (i = e[n], i.context === t) {
r = !1;
break;
}
return r && (i = {
context: t
}, e.push(i)), i;
};
hn.createGradientStyleFor = function(t, e, r, i, n) {
var a, o = this.usePaths(), s = r.pstyle(e + "-gradient-stop-colors").value, c = r.pstyle(e + "-gradient-stop-positions").pfValue;
if (i === "radial-gradient")
if (r.isEdge()) {
var l = r.sourceEndpoint(), u = r.targetEndpoint(), d = r.midpoint(), h = _l(l, d), f = _l(u, d);
a = t.createRadialGradient(d.x, d.y, 0, d.x, d.y, Math.max(h, f));
} else {
var p = o ? {
x: 0,
y: 0
} : r.position(), m = r.paddedWidth(), y = r.paddedHeight();
a = t.createRadialGradient(p.x, p.y, 0, p.x, p.y, Math.max(m, y));
}
else if (r.isEdge()) {
var g = r.sourceEndpoint(), v = r.targetEndpoint();
a = t.createLinearGradient(g.x, g.y, v.x, v.y);
} else {
var x = o ? {
x: 0,
y: 0
} : r.position(), w = r.paddedWidth(), S = r.paddedHeight(), _ = w / 2, b = S / 2, T = r.pstyle("background-gradient-direction").value;
switch (T) {
case "to-bottom":
a = t.createLinearGradient(x.x, x.y - b, x.x, x.y + b);
break;
case "to-top":
a = t.createLinearGradient(x.x, x.y + b, x.x, x.y - b);
break;
case "to-left":
a = t.createLinearGradient(x.x + _, x.y, x.x - _, x.y);
break;
case "to-right":
a = t.createLinearGradient(x.x - _, x.y, x.x + _, x.y);
break;
case "to-bottom-right":
case "to-right-bottom":
a = t.createLinearGradient(x.x - _, x.y - b, x.x + _, x.y + b);
break;
case "to-top-right":
case "to-right-top":
a = t.createLinearGradient(x.x - _, x.y + b, x.x + _, x.y - b);
break;
case "to-bottom-left":
case "to-left-bottom":
a = t.createLinearGradient(x.x + _, x.y - b, x.x - _, x.y + b);
break;
case "to-top-left":
case "to-left-top":
a = t.createLinearGradient(x.x + _, x.y + b, x.x - _, x.y - b);
break;
}
}
if (!a) return null;
for (var E = c.length === s.length, C = s.length, L = 0; L < C; L++)
a.addColorStop(E ? c[L] : L / (C - 1), "rgba(" + s[L][0] + "," + s[L][1] + "," + s[L][2] + "," + n + ")");
return a;
};
hn.gradientFillStyle = function(t, e, r, i) {
var n = this.createGradientStyleFor(t, "background", e, r, i);
if (!n) return null;
t.fillStyle = n;
};
hn.colorFillStyle = function(t, e, r, i, n) {
t.fillStyle = "rgba(" + e + "," + r + "," + i + "," + n + ")";
};
hn.eleFillStyle = function(t, e, r) {
var i = e.pstyle("background-fill").value;
if (i === "linear-gradient" || i === "radial-gradient")
this.gradientFillStyle(t, e, i, r);
else {
var n = e.pstyle("background-color").value;
this.colorFillStyle(t, n[0], n[1], n[2], r);
}
};
hn.gradientStrokeStyle = function(t, e, r, i) {
var n = this.createGradientStyleFor(t, "line", e, r, i);
if (!n) return null;
t.strokeStyle = n;
};
hn.colorStrokeStyle = function(t, e, r, i, n) {
t.strokeStyle = "rgba(" + e + "," + r + "," + i + "," + n + ")";
};
hn.eleStrokeStyle = function(t, e, r) {
var i = e.pstyle("line-fill").value;
if (i === "linear-gradient" || i === "radial-gradient")
this.gradientStrokeStyle(t, e, i, r);
else {
var n = e.pstyle("line-color").value;
this.colorStrokeStyle(t, n[0], n[1], n[2], r);
}
};
hn.matchCanvasSize = function(t) {
var e = this, r = e.data, i = e.findContainerClientCoords(), n = i[2], a = i[3], o = e.getPixelRatio(), s = e.motionBlurPxRatio;
(t === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE] || t === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG]) && (o = s);
var c = n * o, l = a * o, u;
if (!(c === e.canvasWidth && l === e.canvasHeight)) {
e.fontCaches = null;
var d = r.canvasContainer;
d.style.width = n + "px", d.style.height = a + "px";
for (var h = 0; h < e.CANVAS_LAYERS; h++)
u = r.canvases[h], u.width = c, u.height = l, u.style.width = n + "px", u.style.height = a + "px";
for (var h = 0; h < e.BUFFER_COUNT; h++)
u = r.bufferCanvases[h], u.width = c, u.height = l, u.style.width = n + "px", u.style.height = a + "px";
e.textureMult = 1, o <= 1 && (u = r.bufferCanvases[e.TEXTURE_BUFFER], e.textureMult = 2, u.width = c * e.textureMult, u.height = l * e.textureMult), e.canvasWidth = c, e.canvasHeight = l;
}
};
hn.renderTo = function(t, e, r, i) {
this.render({
forcedContext: t,
forcedZoom: e,
forcedPan: r,
drawAllLayers: !0,
forcedPxRatio: i
});
};
hn.render = function(t) {
t = t || PA();
var e = t.forcedContext, r = t.drawAllLayers, i = t.drawOnlyNodeLayer, n = t.forcedZoom, a = t.forcedPan, o = this, s = t.forcedPxRatio === void 0 ? this.getPixelRatio() : t.forcedPxRatio, c = o.cy, l = o.data, u = l.canvasNeedsRedraw, d = o.textureOnViewport && !e && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), h = t.motionBlur !== void 0 ? t.motionBlur : o.motionBlur, f = o.motionBlurPxRatio, p = c.hasCompoundNodes(), m = o.hoverData.draggingEles, y = !!(o.hoverData.selecting || o.touchData.selecting);
h = h && !e && o.motionBlurEnabled && !y;
var g = h;
e || (o.prevPxRatio !== s && (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", !0), o.redrawHint("drag", !0)), o.prevPxRatio = s), !e && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), h && (o.mbFrames == null && (o.mbFrames = 0), o.mbFrames++, o.mbFrames < 3 && (g = !1), o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), o.clearingMotionBlur && (o.motionBlurPxRatio = 1), o.textureDrawLastFrame && !d && (u[o.NODE] = !0, u[o.SELECT_BOX] = !0);
var v = c.style(), x = c.zoom(), w = n !== void 0 ? n : x, S = c.pan(), _ = {
x: S.x,
y: S.y
}, b = {
zoom: x,
pan: {
x: S.x,
y: S.y
}
}, T = o.prevViewport, E = T === void 0 || b.zoom !== T.zoom || b.pan.x !== T.pan.x || b.pan.y !== T.pan.y;
!E && !(m && !p) && (o.motionBlurPxRatio = 1), a && (_ = a), w *= s, _.x *= s, _.y *= s;
var C = o.getCachedZSortedEles();
function L($, J, ne, j, q) {
var ge = $.globalCompositeOperation;
$.globalCompositeOperation = "destination-out", o.colorFillStyle($, 255, 255, 255, o.motionBlurTransparency), $.fillRect(J, ne, j, q), $.globalCompositeOperation = ge;
}
function A($, J) {
var ne, j, q, ge;
!o.clearingMotionBlur && ($ === l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] || $ === l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) ? (ne = {
x: S.x * f,
y: S.y * f
}, j = x * f, q = o.canvasWidth * f, ge = o.canvasHeight * f) : (ne = _, j = w, q = o.canvasWidth, ge = o.canvasHeight), $.setTransform(1, 0, 0, 1, 0, 0), J === "motionBlur" ? L($, 0, 0, q, ge) : !e && (J === void 0 || J) && $.clearRect(0, 0, q, ge), r || ($.translate(ne.x, ne.y), $.scale(j, j)), a && $.translate(a.x, a.y), n && $.scale(n, n);
}
if (d || (o.textureDrawLastFrame = !1), d) {
if (o.textureDrawLastFrame = !0, !o.textureCache) {
o.textureCache = {}, o.textureCache.bb = c.mutableElements().boundingBox(), o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER];
var k = o.data.bufferContexts[o.TEXTURE_BUFFER];
k.setTransform(1, 0, 0, 1, 0, 0), k.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), o.render({
forcedContext: k,
drawOnlyNodeLayer: !0,
forcedPxRatio: s * o.textureMult
});
var b = o.textureCache.viewport = {
zoom: c.zoom(),
pan: c.pan(),
width: o.canvasWidth,
height: o.canvasHeight
};
b.mpan = {
x: (0 - b.pan.x) / b.zoom,
y: (0 - b.pan.y) / b.zoom
};
}
u[o.DRAG] = !1, u[o.NODE] = !1;
var P = l.contexts[o.NODE], R = o.textureCache.texture, b = o.textureCache.viewport;
P.setTransform(1, 0, 0, 1, 0, 0), h ? L(P, 0, 0, b.width, b.height) : P.clearRect(0, 0, b.width, b.height);
var M = v.core("outside-texture-bg-color").value, O = v.core("outside-texture-bg-opacity").value;
o.colorFillStyle(P, M[0], M[1], M[2], O), P.fillRect(0, 0, b.width, b.height);
var x = c.zoom();
A(P, !1), P.clearRect(b.mpan.x, b.mpan.y, b.width / b.zoom / s, b.height / b.zoom / s), P.drawImage(R, b.mpan.x, b.mpan.y, b.width / b.zoom / s, b.height / b.zoom / s);
} else o.textureOnViewport && !e && (o.textureCache = null);
var D = c.extent(), I = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), F = o.hideEdgesOnViewport && I, z = [];
if (z[o.NODE] = !u[o.NODE] && h && !o.clearedForMotionBlur[o.NODE] || o.clearingMotionBlur, z[o.NODE] && (o.clearedForMotionBlur[o.NODE] = !0), z[o.DRAG] = !u[o.DRAG] && h && !o.clearedForMotionBlur[o.DRAG] || o.clearingMotionBlur, z[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = !0), u[o.NODE] || r || i || z[o.NODE]) {
var U = h && !z[o.NODE] && f !== 1, P = e || (U ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : l.contexts[o.NODE]), Z = h && !U ? "motionBlur" : void 0;
A(P, Z), F ? o.drawCachedNodes(P, C.nondrag, s, D) : o.drawLayeredElements(P, C.nondrag, s, D), o.debug && o.drawDebugPoints(P, C.nondrag), !r && !h && (u[o.NODE] = !1);
}
if (!i && (u[o.DRAG] || r || z[o.DRAG])) {
var U = h && !z[o.DRAG] && f !== 1, P = e || (U ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : l.contexts[o.DRAG]);
A(P, h && !U ? "motionBlur" : void 0), F ? o.drawCachedNodes(P, C.drag, s, D) : o.drawCachedElements(P, C.drag, s, D), o.debug && o.drawDebugPoints(P, C.drag), !r && !h && (u[o.DRAG] = !1);
}
if (o.showFps || !i && u[o.SELECT_BOX] && !r) {
var P = e || l.contexts[o.SELECT_BOX];
if (A(P), o.selection[4] == 1 && (o.hoverData.selecting || o.touchData.selecting)) {
var x = o.cy.zoom(), re = v.core("selection-box-border-width").value / x;
P.lineWidth = re, P.fillStyle = "rgba(" + v.core("selection-box-color").value[0] + "," + v.core("selection-box-color").value[1] + "," + v.core("selection-box-color").value[2] + "," + v.core("selection-box-opacity").value + ")", P.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), re > 0 && (P.strokeStyle = "rgba(" + v.core("selection-box-border-color").value[0] + "," + v.core("selection-box-border-color").value[1] + "," + v.core("selection-box-border-color").value[2] + "," + v.core("selection-box-opacity").value + ")", P.strokeRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]));
}
if (l.bgActivePosistion && !o.hoverData.selecting) {
var x = o.cy.zoom(), K = l.bgActivePosistion;
P.fillStyle = "rgba(" + v.core("active-bg-color").value[0] + "," + v.core("active-bg-color").value[1] + "," + v.core("active-bg-color").value[2] + "," + v.core("active-bg-opacity").value + ")", P.beginPath(), P.arc(K.x, K.y, v.core("active-bg-size").pfValue / x, 0, 2 * Math.PI), P.fill();
}
var V = o.lastRedrawTime;
if (o.showFps && V) {
V = Math.round(V);
var H = Math.round(1e3 / V);
P.setTransform(1, 0, 0, 1, 0, 0), P.fillStyle = "rgba(255, 0, 0, 0.75)", P.strokeStyle = "rgba(255, 0, 0, 0.75)", P.lineWidth = 1, P.fillText("1 frame = " + V + " ms = " + H + " fps", 0, 20);
var G = 60;
P.strokeRect(0, 30, 250, 20), P.fillRect(0, 30, 250 * Math.min(H / G, 1), 20);
}
r || (u[o.SELECT_BOX] = !1);
}
if (h && f !== 1) {
var W = l.contexts[o.NODE], Y = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], X = l.contexts[o.DRAG], ie = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], ue = function($, J, ne) {
$.setTransform(1, 0, 0, 1, 0, 0), ne || !g ? $.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : L($, 0, 0, o.canvasWidth, o.canvasHeight);
var j = f;
$.drawImage(
J,
// img
0,
0,
// sx, sy
o.canvasWidth * j,
o.canvasHeight * j,
// sw, sh
0,
0,
// x, y
o.canvasWidth,
o.canvasHeight
// w, h
);
};
(u[o.NODE] || z[o.NODE]) && (ue(W, Y, z[o.NODE]), u[o.NODE] = !1), (u[o.DRAG] || z[o.DRAG]) && (ue(X, ie, z[o.DRAG]), u[o.DRAG] = !1);
}
o.prevViewport = b, o.clearingMotionBlur && (o.clearingMotionBlur = !1, o.motionBlurCleared = !0, o.motionBlur = !0), h && (o.motionBlurTimeout = setTimeout(function() {
o.motionBlurTimeout = null, o.clearedForMotionBlur[o.NODE] = !1, o.clearedForMotionBlur[o.DRAG] = !1, o.motionBlur = !1, o.clearingMotionBlur = !d, o.mbFrames = 0, u[o.NODE] = !0, u[o.DRAG] = !0, o.redraw();
}, sq)), e || c.emit("render");
};
var Ls = {};
Ls.drawPolygonPath = function(t, e, r, i, n, a) {
var o = i / 2, s = n / 2;
t.beginPath && t.beginPath(), t.moveTo(e + o * a[0], r + s * a[1]);
for (var c = 1; c < a.length / 2; c++)
t.lineTo(e + o * a[c * 2], r + s * a[c * 2 + 1]);
t.closePath();
};
Ls.drawRoundPolygonPath = function(t, e, r, i, n, a, o) {
o.forEach(function(s) {
return L3(t, s);
}), t.closePath();
};
Ls.drawRoundRectanglePath = function(t, e, r, i, n, a) {
var o = i / 2, s = n / 2, c = a === "auto" ? Sl(i, n) : Math.min(a, s, o);
t.beginPath && t.beginPath(), t.moveTo(e, r - s), t.arcTo(e + o, r - s, e + o, r, c), t.arcTo(e + o, r + s, e, r + s, c), t.arcTo(e - o, r + s, e - o, r, c), t.arcTo(e - o, r - s, e, r - s, c), t.lineTo(e, r - s), t.closePath();
};
Ls.drawBottomRoundRectanglePath = function(t, e, r, i, n, a) {
var o = i / 2, s = n / 2, c = a === "auto" ? Sl(i, n) : a;
t.beginPath && t.beginPath(), t.moveTo(e, r - s), t.lineTo(e + o, r - s), t.lineTo(e + o, r), t.arcTo(e + o, r + s, e, r + s, c), t.arcTo(e - o, r + s, e - o, r, c), t.lineTo(e - o, r - s), t.lineTo(e, r - s), t.closePath();
};
Ls.drawCutRectanglePath = function(t, e, r, i, n, a, o) {
var s = i / 2, c = n / 2, l = o === "auto" ? Ib() : o;
t.beginPath && t.beginPath(), t.moveTo(e - s + l, r - c), t.lineTo(e + s - l, r - c), t.lineTo(e + s, r - c + l), t.lineTo(e + s, r + c - l), t.lineTo(e + s - l, r + c), t.lineTo(e - s + l, r + c), t.lineTo(e - s, r + c - l), t.lineTo(e - s, r - c + l), t.closePath();
};
Ls.drawBarrelPath = function(t, e, r, i, n) {
var a = i / 2, o = n / 2, s = e - a, c = e + a, l = r - o, u = r + o, d = My(i, n), h = d.widthOffset, f = d.heightOffset, p = d.ctrlPtOffsetPct * h;
t.beginPath && t.beginPath(), t.moveTo(s, l + f), t.lineTo(s, u - f), t.quadraticCurveTo(s + p, u, s + h, u), t.lineTo(c - h, u), t.quadraticCurveTo(c - p, u, c, u - f), t.lineTo(c, l + f), t.quadraticCurveTo(c - p, l, c - h, l), t.lineTo(s + h, l), t.quadraticCurveTo(s + p, l, s, l + f), t.closePath();
};
var oS = Math.sin(0), sS = Math.cos(0), Ny = {}, By = {}, U3 = Math.PI / 40;
for (var ac = 0 * Math.PI; ac < 2 * Math.PI; ac += U3)
Ny[ac] = Math.sin(ac), By[ac] = Math.cos(ac);
Ls.drawEllipsePath = function(t, e, r, i, n) {
if (t.beginPath && t.beginPath(), t.ellipse)
t.ellipse(e, r, i / 2, n / 2, 0, 0, 2 * Math.PI);
else
for (var a, o, s = i / 2, c = n / 2, l = 0 * Math.PI; l < 2 * Math.PI; l += U3)
a = e - s * Ny[l] * oS + s * By[l] * sS, o = r + c * By[l] * oS + c * Ny[l] * sS, l === 0 ? t.moveTo(a, o) : t.lineTo(a, o);
t.closePath();
};
var cp = {};
cp.createBuffer = function(t, e) {
var r = document.createElement("canvas");
return r.width = t, r.height = e, [r, r.getContext("2d")];
};
cp.bufferCanvasImage = function(t) {
var e = this.cy, r = e.mutableElements(), i = r.boundingBox(), n = this.findContainerClientCoords(), a = t.full ? Math.ceil(i.w) : n[2], o = t.full ? Math.ceil(i.h) : n[3], s = Xe(t.maxWidth) || Xe(t.maxHeight), c = this.getPixelRatio(), l = 1;
if (t.scale !== void 0)
a *= t.scale, o *= t.scale, l = t.scale;
else if (s) {
var u = 1 / 0, d = 1 / 0;
Xe(t.maxWidth) && (u = l * t.maxWidth / a), Xe(t.maxHeight) && (d = l * t.maxHeight / o), l = Math.min(u, d), a *= l, o *= l;
}
s || (a *= c, o *= c, l *= c);
var h = document.createElement("canvas");
h.width = a, h.height = o, h.style.width = a + "px", h.style.height = o + "px";
var f = h.getContext("2d");
if (a > 0 && o > 0) {
f.clearRect(0, 0, a, o), f.globalCompositeOperation = "source-over";
var p = this.getCachedZSortedEles();
if (t.full)
f.translate(-i.x1 * l, -i.y1 * l), f.scale(l, l), this.drawElements(f, p), f.scale(1 / l, 1 / l), f.translate(i.x1 * l, i.y1 * l);
else {
var m = e.pan(), y = {
x: m.x * l,
y: m.y * l
};
l *= e.zoom(), f.translate(y.x, y.y), f.scale(l, l), this.drawElements(f, p), f.scale(1 / l, 1 / l), f.translate(-y.x, -y.y);
}
t.bg && (f.globalCompositeOperation = "destination-over", f.fillStyle = t.bg, f.rect(0, 0, a, o), f.fill());
}
return h;
};
function lq(t, e) {
for (var r = atob(t), i = new ArrayBuffer(r.length), n = new Uint8Array(i), a = 0; a < r.length; a++)
n[a] = r.charCodeAt(a);
return new Blob([i], {
type: e
});
}
function lS(t) {
var e = t.indexOf(",");
return t.substr(e + 1);
}
function j3(t, e, r) {
var i = function() {
return e.toDataURL(r, t.quality);
};
switch (t.output) {
case "blob-promise":
return new Bu(function(n, a) {
try {
e.toBlob(function(o) {
o != null ? n(o) : a(new Error("`canvas.toBlob()` sent a null value in its callback"));
}, r, t.quality);
} catch (o) {
a(o);
}
});
case "blob":
return lq(lS(i()), r);
case "base64":
return lS(i());
case "base64uri":
default:
return i();
}
}
cp.png = function(t) {
return j3(t, this.bufferCanvasImage(t), "image/png");
};
cp.jpg = function(t) {
return j3(t, this.bufferCanvasImage(t), "image/jpeg");
};
var H3 = {};
H3.nodeShapeImpl = function(t, e, r, i, n, a, o, s) {
switch (t) {
case "ellipse":
return this.drawEllipsePath(e, r, i, n, a);
case "polygon":
return this.drawPolygonPath(e, r, i, n, a, o);
case "round-polygon":
return this.drawRoundPolygonPath(e, r, i, n, a, o, s);
case "roundrectangle":
case "round-rectangle":
return this.drawRoundRectanglePath(e, r, i, n, a, s);
case "cutrectangle":
case "cut-rectangle":
return this.drawCutRectanglePath(e, r, i, n, a, o, s);
case "bottomroundrectangle":
case "bottom-round-rectangle":
return this.drawBottomRoundRectanglePath(e, r, i, n, a, s);
case "barrel":
return this.drawBarrelPath(e, r, i, n, a);
}
};
var cq = G3, jt = G3.prototype;
jt.CANVAS_LAYERS = 3;
jt.SELECT_BOX = 0;
jt.DRAG = 1;
jt.NODE = 2;
jt.BUFFER_COUNT = 3;
jt.TEXTURE_BUFFER = 0;
jt.MOTIONBLUR_BUFFER_NODE = 1;
jt.MOTIONBLUR_BUFFER_DRAG = 2;
function G3(t) {
var e = this, r = e.cy.window(), i = r.document;
e.data = {
canvases: new Array(jt.CANVAS_LAYERS),
contexts: new Array(jt.CANVAS_LAYERS),
canvasNeedsRedraw: new Array(jt.CANVAS_LAYERS),
bufferCanvases: new Array(jt.BUFFER_COUNT),
bufferContexts: new Array(jt.CANVAS_LAYERS)
};
var n = "-webkit-tap-highlight-color", a = "rgba(0,0,0,0)";
e.data.canvasContainer = i.createElement("div");
var o = e.data.canvasContainer.style;
e.data.canvasContainer.style[n] = a, o.position = "relative", o.zIndex = "0", o.overflow = "hidden";
var s = t.cy.container();
s.appendChild(e.data.canvasContainer), s.style[n] = a;
var c = {
"-webkit-user-select": "none",
"-moz-user-select": "-moz-none",
"user-select": "none",
"-webkit-tap-highlight-color": "rgba(0,0,0,0)",
"outline-style": "none"
};
X8() && (c["-ms-touch-action"] = "none", c["touch-action"] = "none");
for (var l = 0; l < jt.CANVAS_LAYERS; l++) {
var u = e.data.canvases[l] = i.createElement("canvas");
e.data.contexts[l] = u.getContext("2d"), Object.keys(c).forEach(function(G) {
u.style[G] = c[G];
}), u.style.position = "absolute", u.setAttribute("data-id", "layer" + l), u.style.zIndex = String(jt.CANVAS_LAYERS - l), e.data.canvasContainer.appendChild(u), e.data.canvasNeedsRedraw[l] = !1;
}
e.data.topCanvas = e.data.canvases[0], e.data.canvases[jt.NODE].setAttribute("data-id", "layer" + jt.NODE + "-node"), e.data.canvases[jt.SELECT_BOX].setAttribute("data-id", "layer" + jt.SELECT_BOX + "-selectbox"), e.data.canvases[jt.DRAG].setAttribute("data-id", "layer" + jt.DRAG + "-drag");
for (var l = 0; l < jt.BUFFER_COUNT; l++)
e.data.bufferCanvases[l] = i.createElement("canvas"), e.data.bufferContexts[l] = e.data.bufferCanvases[l].getContext("2d"), e.data.bufferCanvases[l].style.position = "absolute", e.data.bufferCanvases[l].setAttribute("data-id", "buffer" + l), e.data.bufferCanvases[l].style.zIndex = String(-l - 1), e.data.bufferCanvases[l].style.visibility = "hidden";
e.pathsEnabled = !0;
var d = Yi(), h = function(G) {
return {
x: (G.x1 + G.x2) / 2,
y: (G.y1 + G.y2) / 2
};
}, f = function(G) {
return {
x: -G.w / 2,
y: -G.h / 2
};
}, p = function(G) {
var W = G[0]._private, Y = W.oldBackgroundTimestamp === W.backgroundTimestamp;
return !Y;
}, m = function(G) {
return G[0]._private.nodeKey;
}, y = function(G) {
return G[0]._private.labelStyleKey;
}, g = function(G) {
return G[0]._private.sourceLabelStyleKey;
}, v = function(G) {
return G[0]._private.targetLabelStyleKey;
}, x = function(G, W, Y, X, ie) {
return e.drawElement(G, W, Y, !1, !1, ie);
}, w = function(G, W, Y, X, ie) {
return e.drawElementText(G, W, Y, X, "main", ie);
}, S = function(G, W, Y, X, ie) {
return e.drawElementText(G, W, Y, X, "source", ie);
}, _ = function(G, W, Y, X, ie) {
return e.drawElementText(G, W, Y, X, "target", ie);
}, b = function(G) {
return G.boundingBox(), G[0]._private.bodyBounds;
}, T = function(G) {
return G.boundingBox(), G[0]._private.labelBounds.main || d;
}, E = function(G) {
return G.boundingBox(), G[0]._private.labelBounds.source || d;
}, C = function(G) {
return G.boundingBox(), G[0]._private.labelBounds.target || d;
}, L = function(G, W) {
return W;
}, A = function(G) {
return h(b(G));
}, k = function(G, W, Y) {
var X = G ? G + "-" : "";
return {
x: W.x + Y.pstyle(X + "text-margin-x").pfValue,
y: W.y + Y.pstyle(X + "text-margin-y").pfValue
};
}, P = function(G, W, Y) {
var X = G[0]._private.rscratch;
return {
x: X[W],
y: X[Y]
};
}, R = function(G) {
return k("", P(G, "labelX", "labelY"), G);
}, M = function(G) {
return k("source", P(G, "sourceLabelX", "sourceLabelY"), G);
}, O = function(G) {
return k("target", P(G, "targetLabelX", "targetLabelY"), G);
}, D = function(G) {
return f(b(G));
}, I = function(G) {
return f(E(G));
}, F = function(G) {
return f(C(G));
}, z = function(G) {
var W = T(G), Y = f(T(G));
if (G.isNode()) {
switch (G.pstyle("text-halign").value) {
case "left":
Y.x = -W.w;
break;
case "right":
Y.x = 0;
break;
}
switch (G.pstyle("text-valign").value) {
case "top":
Y.y = -W.h;
break;
case "bottom":
Y.y = 0;
break;
}
}
return Y;
}, U = e.data.eleTxrCache = new $d(e, {
getKey: m,
doesEleInvalidateKey: p,
drawElement: x,
getBoundingBox: b,
getRotationPoint: A,
getRotationOffset: D,
allowEdgeTxrCaching: !1,
allowParentTxrCaching: !1
}), Z = e.data.lblTxrCache = new $d(e, {
getKey: y,
drawElement: w,
getBoundingBox: T,
getRotationPoint: R,
getRotationOffset: z,
isVisible: L
}), re = e.data.slbTxrCache = new $d(e, {
getKey: g,
drawElement: S,
getBoundingBox: E,
getRotationPoint: M,
getRotationOffset: I,
isVisible: L
}), K = e.data.tlbTxrCache = new $d(e, {
getKey: v,
drawElement: _,
getBoundingBox: C,
getRotationPoint: O,
getRotationOffset: F,
isVisible: L
}), V = e.data.lyrTxrCache = new F3(e);
e.onUpdateEleCalcs(function(G, W) {
U.invalidateElements(W), Z.invalidateElements(W), re.invalidateElements(W), K.invalidateElements(W), V.invalidateElements(W);
for (var Y = 0; Y < W.length; Y++) {
var X = W[Y]._private;
X.oldBackgroundTimestamp = X.backgroundTimestamp;
}
});
var H = function(G) {
for (var W = 0; W < G.length; W++)
V.enqueueElementRefinement(G[W].ele);
};
U.onDequeue(H), Z.onDequeue(H), re.onDequeue(H), K.onDequeue(H);
}
jt.redrawHint = function(t, e) {
var r = this;
switch (t) {
case "eles":
r.data.canvasNeedsRedraw[jt.NODE] = e;
break;
case "drag":
r.data.canvasNeedsRedraw[jt.DRAG] = e;
break;
case "select":
r.data.canvasNeedsRedraw[jt.SELECT_BOX] = e;
break;
}
};
var uq = typeof Path2D < "u";
jt.path2dEnabled = function(t) {
if (t === void 0)
return this.pathsEnabled;
this.pathsEnabled = !!t;
};
jt.usePaths = function() {
return uq && this.pathsEnabled;
};
jt.setImgSmoothing = function(t, e) {
t.imageSmoothingEnabled != null ? t.imageSmoothingEnabled = e : (t.webkitImageSmoothingEnabled = e, t.mozImageSmoothingEnabled = e, t.msImageSmoothingEnabled = e);
};
jt.getImgSmoothing = function(t) {
return t.imageSmoothingEnabled != null ? t.imageSmoothingEnabled : t.webkitImageSmoothingEnabled || t.mozImageSmoothingEnabled || t.msImageSmoothingEnabled;
};
jt.makeOffscreenCanvas = function(t, e) {
var r;
if ((typeof OffscreenCanvas > "u" ? "undefined" : Zr(OffscreenCanvas)) !== "undefined")
r = new OffscreenCanvas(t, e);
else {
var i = this.cy.window(), n = i.document;
r = n.createElement("canvas"), r.width = t, r.height = e;
}
return r;
};
[z3, Ta, mo, Zb, Ul, Gu, hn, Ls, cp, H3].forEach(function(t) {
bt(jt, t);
});
var dq = [{
name: "null",
impl: T3
}, {
name: "base",
impl: N3
}, {
name: "canvas",
impl: cq
}], hq = [{
type: "layout",
extensions: y7
}, {
type: "renderer",
extensions: dq
}], W3 = {}, q3 = {};
function X3(t, e, r) {
var i = r, n = function(b) {
Zt("Can not register `" + e + "` for `" + t + "` since `" + b + "` already exists in the prototype and can not be overridden");
};
if (t === "core") {
if (zm.prototype[e])
return n(e);
zm.prototype[e] = r;
} else if (t === "collection") {
if (mi.prototype[e])
return n(e);
mi.prototype[e] = r;
} else if (t === "layout") {
for (var a = function(b) {
this.options = b, r.call(this, b), Gt(this._private) || (this._private = {}), this._private.cy = b.cy, this._private.listeners = [], this.createEmitter();
}, o = a.prototype = Object.create(r.prototype), s = [], c = 0; c < s.length; c++) {
var l = s[c];
o[l] = o[l] || 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 u = r.prototype.stop;
o.stop = function() {
var b = this.options;
if (b && b.animate) {
var T = this.animations;
if (T)
for (var E = 0; E < T.length; E++)
T[E].stop();
}
return u ? u.call(this) : this.emit("layoutstop"), this;
}, o.destroy || (o.destroy = function() {
return this;
}), o.cy = function() {
return this._private.cy;
};
var d = function(b) {
return b._private.cy;
}, h = {
addEventFields: function(b, T) {
T.layout = b, T.cy = d(b), T.target = b;
},
bubble: function() {
return !0;
},
parent: function(b) {
return d(b);
}
};
bt(o, {
createEmitter: function() {
return this._private.emitter = new Og(h, this), this;
},
emitter: function() {
return this._private.emitter;
},
on: function(b, T) {
return this.emitter().on(b, T), this;
},
one: function(b, T) {
return this.emitter().one(b, T), this;
},
once: function(b, T) {
return this.emitter().one(b, T), this;
},
removeListener: function(b, T) {
return this.emitter().removeListener(b, T), this;
},
removeAllListeners: function() {
return this.emitter().removeAllListeners(), this;
},
emit: function(b, T) {
return this.emitter().emit(b, T), this;
}
}), Xt.eventAliasesOn(o), i = a;
} else if (t === "renderer" && e !== "null" && e !== "base") {
var f = Z3("renderer", "base"), p = f.prototype, m = r, y = r.prototype, g = function() {
f.apply(this, arguments), m.apply(this, arguments);
}, v = g.prototype;
for (var x in p) {
var w = p[x], S = y[x] != null;
if (S)
return n(x);
v[x] = w;
}
for (var _ in y)
v[_] = y[_];
p.clientFunctions.forEach(function(b) {
v[b] = v[b] || function() {
Tr("Renderer does not implement `renderer." + b + "()` on its prototype");
};
}), i = g;
} else if (t === "__proto__" || t === "constructor" || t === "prototype")
return Tr(t + " is an illegal type to be registered, possibly lead to prototype pollutions");
return wA({
map: W3,
keys: [t, e],
value: i
});
}
function Z3(t, e) {
return _A({
map: W3,
keys: [t, e]
});
}
function pq(t, e, r, i, n) {
return wA({
map: q3,
keys: [t, e, r, i],
value: n
});
}
function fq(t, e, r, i) {
return _A({
map: q3,
keys: [t, e, r, i]
});
}
var mq = function() {
if (arguments.length === 2)
return Z3.apply(null, arguments);
if (arguments.length === 3)
return X3.apply(null, arguments);
if (arguments.length === 4)
return fq.apply(null, arguments);
if (arguments.length === 5)
return pq.apply(null, arguments);
Tr("Invalid extension access syntax");
};
zm.prototype.extension = mq;
hq.forEach(function(t) {
t.extensions.forEach(function(e) {
X3(t.type, e.name, e.impl);
});
});
var gq = function t() {
if (!(this instanceof t))
return new t();
this.length = 0;
}, Tl = gq.prototype;
Tl.instanceString = function() {
return "stylesheet";
};
Tl.selector = function(t) {
var e = this.length++;
return this[e] = {
selector: t,
properties: []
}, this;
};
Tl.css = function(t, e) {
var r = this.length - 1;
if (dt(t))
this[r].properties.push({
name: t,
value: e
});
else if (Gt(t))
for (var i = t, n = Object.keys(i), a = 0; a < n.length; a++) {
var o = n[a], s = i[o];
if (s != null) {
var c = Ti.properties[o] || Ti.properties[Sg(o)];
if (c != null) {
var l = c.name, u = s;
this[r].properties.push({
name: l,
value: u
});
}
}
}
return this;
};
Tl.style = Tl.css;
Tl.generateStyle = function(t) {
var e = new Ti(t);
return this.appendToStyle(e);
};
Tl.appendToStyle = function(t) {
for (var e = 0; e < this.length; e++) {
var r = this[e], i = r.selector, n = r.properties;
t.selector(i);
for (var a = 0; a < n.length; a++) {
var o = n[a];
t.css(o.name, o.value);
}
}
return t;
};
const vq = function(t) {
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "";
}, yq = {
name: "ConnectionDialog",
props: {
connectionEntry: {
type: Object,
default: {}
},
inDrawing: {
type: Boolean,
default: !1
},
connectionExist: {
type: Boolean,
default: !1
}
},
data: function() {
return {
tooltipId: void 0
};
},
methods: {
shadowDisplay: function(t) {
return this.tooltipId === t ? "always" : "hover";
},
capitalise: function(t) {
return vq(t);
},
handleTooltip: function(t) {
this.tooltipId = this.tooltipId === t ? void 0 : t, this.$emit("featureTooltip", this.tooltipId);
}
}
}, Yb = (t) => (Hh("data-v-8168ee98"), t = t(), Gh(), t), bq = { class: "dialog-container" }, xq = /* @__PURE__ */ Yb(() => /* @__PURE__ */ Ee("span", { class: "dialog-title" }, "Finalise drawing", -1)), wq = /* @__PURE__ */ Yb(() => /* @__PURE__ */ Ee("span", { class: "dialog-title" }, "Visualise connection", -1)), _q = /* @__PURE__ */ Yb(() => /* @__PURE__ */ Ee("b", null, [
/* @__PURE__ */ Ee("span", null, "Related Features")
], -1));
function Sq(t, e, r, i, n, a) {
const o = us, s = J$, c = _g, l = Qh, u = i6;
return Q(), be("div", bq, [
oe(c, null, {
default: le(() => [
oe(l, null, {
default: le(() => [
r.inDrawing ? (Q(), Re(c, { key: 0 }, {
default: le(() => [
xq,
oe(s, null, {
default: le(() => [
oe(o, {
type: "primary",
plain: "",
onClick: e[0] || (e[0] = (d) => t.$emit("confirmDrawn", !0))
}, {
default: le(() => [
et(" Confirm ")
]),
_: 1
}),
oe(o, {
type: "primary",
plain: "",
onClick: e[1] || (e[1] = (d) => t.$emit("cancelDrawn", !0))
}, {
default: le(() => [
et(" Cancel ")
]),
_: 1
})
]),
_: 1
})
]),
_: 1
})) : (Q(), Re(c, { key: 1 }, {
default: le(() => [
wq,
oe(o, {
type: "primary",
plain: "",
onClick: e[2] || (e[2] = (d) => t.$emit("dialogDisplay", !1))
}, {
default: le(() => [
et(" Close ")
]),
_: 1
})
]),
_: 1
}))
]),
_: 1
})
]),
_: 1
}),
r.connectionExist ? (Q(), Re(c, { key: 0 }, {
default: le(() => [
oe(l, null, {
default: le(() => [
_q,
(Q(!0), be(pt, null, ir(r.connectionEntry, (d, h) => (Q(), Re(c, { key: h }, {
default: le(() => [
oe(u, {
shadow: a.shadowDisplay(h),
onClick: (f) => a.handleTooltip(h)
}, {
default: le(() => [
Ee("span", null, Ze(a.capitalise(d.label)), 1)
]),
_: 2
}, 1032, ["shadow", "onClick"])
]),
_: 2
}, 1024))), 128))
]),
_: 1
})
]),
_: 1
})) : Pe("", !0)
]);
}
const Mq = /* @__PURE__ */ Cs(yq, [["render", Sq], ["__scopeId", "data-v-8168ee98"]]), Y3 = (t, e) => {
const r = t.__vccOpts || t;
for (const [i, n] of e)
r[i] = n;
return r;
}, Eq = ["xlink:href"], Tq = {
__name: "SvgIcon",
props: {
/**
* The svg icon to show.
*/
icon: {
type: String,
required: !0
},
/**
* The option to spin the icon.
*/
spin: {
type: Boolean,
default: !1
}
},
setup(t) {
return (e, r) => (Q(), be("svg", {
class: xe(["map-icon", { "map-icon-spin": t.spin }])
}, [
Ee("use", {
"xlink:href": `#${t.icon}`
}, null, 8, Eq)
], 2));
}
}, Cq = /* @__PURE__ */ Y3(Tq, [["__scopeId", "data-v-e172d5ff"]]), K3 = `
`, J3 = `
`, Q3 = `
`, eL = `
`, tL = `
`, rL = `
`, iL = `
`, nL = `
`, aL = `
`, oL = `
`, sL = `
`, lL = `
`, cL = `
`, uL = `
`, dL = `
`, hL = `
`, pL = `
`, fL = `
`, mL = `
`, gL = `
`, vL = '', yL = `
`, bL = ``, xL = `
`, wL = `
`, _L = `
`, SL = `
`, ML = `
`, EL = `
`, TL = `
`, CL = `
`, AL = `
`, LL = `
`, kL = (t, e, r, i) => {
const n = ["title", "desc", "defs", "style"], a = ["width", "height"], o = i || [];
let s = document.createElement("div");
s.innerHTML = t, n.map((l) => {
const u = s.querySelector(l);
u && u.remove();
}), a.map((l) => {
s.querySelector("svg").removeAttribute(l);
}), i && o.map((l) => {
Object.values(s.querySelectorAll(`[${l}]`)).map((u) => {
u.removeAttribute(l);
});
});
const c = s.innerHTML;
return s = null, c;
}, PL = (t) => [
// Remove XML stuffs and comments
[/<\?xml[\s\S]*?>/gi, ""],
[//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
[/\> \<"]
// remove whitespace between tags
].reduce((e, r) => "".replace.apply(e, r), t).trim(), Aq = !0, Lq = !0, kq = ["fill"], cS = /* @__PURE__ */ Object.assign({
"/assets/icons/2horpanel.svg": K3,
"/assets/icons/2vertpanel.svg": J3,
"/assets/icons/3panel.svg": Q3,
"/assets/icons/4panel.svg": eL,
"/assets/icons/5panel.svg": tL,
"/assets/icons/6panel.svg": rL,
"/assets/icons/6panelVertical.svg": iL,
"/assets/icons/changeBckgd.svg": nL,
"/assets/icons/close-no-bk.svg": aL,
"/assets/icons/close.svg": oL,
"/assets/icons/closeFullScreen.svg": sL,
"/assets/icons/comment.svg": lL,
"/assets/icons/connection.svg": cL,
"/assets/icons/dock.svg": uL,
"/assets/icons/drawLine.svg": dL,
"/assets/icons/drawPoint.svg": hL,
"/assets/icons/drawPolygon.svg": pL,
"/assets/icons/drawTrash.svg": fL,
"/assets/icons/fitWindow.svg": mL,
"/assets/icons/fullScreen.svg": gL,
"/assets/icons/help.svg": vL,
"/assets/icons/magnifyingGlass.svg": yL,
"/assets/icons/noun-filter.svg": bL,
"/assets/icons/openMap.svg": xL,
"/assets/icons/pause.svg": wL,
"/assets/icons/permalink.svg": _L,
"/assets/icons/play.svg": SL,
"/assets/icons/resetZoom.svg": ML,
"/assets/icons/singlepanel.svg": EL,
"/assets/icons/tooltips.svg": TL,
"/assets/icons/undock.svg": CL,
"/assets/icons/zoomIn.svg": AL,
"/assets/icons/zoomOut.svg": LL
}), Pq = Object.keys(cS).map((t) => {
const e = kL(cS[t], Aq, Lq, kq), r = t.replace(/^.+\/(\w+).svg$/, "$1");
return PL(e).replace("