import { aim_default, arrow_down_default, arrow_up_default, caret_right_default, circle_check_default, circle_close_default, close_default, copy_document_default, delete_default, edit_default, finished_default, hide_default, loading_default, lock_default, search_default, unlock_default, view_default, warning_default, zoom_in_default, zoom_out_default } from "./chunk-GQENOT3W.js"; import { Comment, Fragment, Teleport, Text, Transition, cloneVNode, computed, createApp, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createStaticVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, getCurrentScope, h, inject, isRef, mergeProps, nextTick, normalizeClass, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onScopeDispose, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, reactive, readonly, ref, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, shallowRef, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, unref, useAttrs, useSlots, vModelCheckbox, vModelText, vShow, warn, watch, watchEffect, withCtx, withDirectives, withKeys, withModifiers } from "./chunk-HM42ZP2D.js"; // node_modules/@abi-software/map-utilities/dist/map-utilities.js var kT = Object.defineProperty; var _T = (t13, e, r) => e in t13 ? kT(t13, e, { enumerable: true, configurable: true, writable: true, value: r }) : t13[e] = r; var Tr = (t13, e, r) => _T(t13, typeof e != "symbol" ? e + "" : e, r); var mn = (t13, e, { checkForDefaultPrevented: r = true } = {}) => (a) => { const i = t13 == null ? void 0 : t13(a); if (r === false || !i) return e == null ? void 0 : e(a); }; var wy; var It = typeof window < "u"; var aI = (t13) => typeof t13 == "string"; var _E = () => { }; var cp = It && ((wy = window == null ? void 0 : window.navigator) == null ? void 0 : wy.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent); function TE(t13) { return typeof t13 == "function" ? t13() : unref(t13); } function iI(t13) { return t13; } function wl(t13) { return getCurrentScope() ? (onScopeDispose(t13), true) : false; } function oI(t13, e = true) { getCurrentInstance() ? onMounted(t13) : e ? t13() : nextTick(t13); } function Cn(t13) { var e; const r = TE(t13); return (e = r == null ? void 0 : r.$el) != null ? e : r; } var Cl = It ? window : void 0; function Ar(...t13) { let e, r, n, a; if (aI(t13[0]) || Array.isArray(t13[0]) ? ([r, n, a] = t13, e = Cl) : [e, r, n, a] = t13, !e) return _E; Array.isArray(r) || (r = [r]), Array.isArray(n) || (n = [n]); const i = [], o = () => { i.forEach((c) => c()), i.length = 0; }, s = (c, d, f, h10) => (c.addEventListener(d, f, h10), () => c.removeEventListener(d, f, h10)), u = watch(() => [Cn(e), TE(a)], ([c, d]) => { o(), c && i.push(...r.flatMap((f) => n.map((h10) => s(c, f, h10, d)))); }, { immediate: true, flush: "post" }), l = () => { u(), o(); }; return wl(l), l; } var Cy = false; function sI(t13, e, r = {}) { const { window: n = Cl, ignore: a = [], capture: i = true, detectIframe: o = false } = r; if (!n) return; cp && !Cy && (Cy = true, Array.from(n.document.body.children).forEach((f) => f.addEventListener("click", _E))); let s = true; const u = (f) => a.some((h10) => { if (typeof h10 == "string") return Array.from(n.document.querySelectorAll(h10)).some((v) => v === f.target || f.composedPath().includes(v)); { const v = Cn(h10); return v && (f.target === v || f.composedPath().includes(v)); } }), c = [ Ar(n, "click", (f) => { const h10 = Cn(t13); if (!(!h10 || h10 === f.target || f.composedPath().includes(h10))) { if (f.detail === 0 && (s = !u(f)), !s) { s = true; return; } e(f); } }, { passive: true, capture: i }), Ar(n, "pointerdown", (f) => { const h10 = Cn(t13); h10 && (s = !f.composedPath().includes(h10) && !u(f)); }, { passive: true }), o && Ar(n, "blur", (f) => { var h10; const v = Cn(t13); ((h10 = n.document.activeElement) == null ? void 0 : h10.tagName) === "IFRAME" && !(v != null && v.contains(n.document.activeElement)) && e(f); }) ].filter(Boolean); return () => c.forEach((f) => f()); } function IE(t13, e = false) { const r = ref(), n = () => r.value = !!t13(); return n(), oI(n, e), r; } var xy = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; var Ey = "__vueuse_ssr_handlers__"; xy[Ey] = xy[Ey] || {}; var Sy = Object.getOwnPropertySymbols; var lI = Object.prototype.hasOwnProperty; var uI = Object.prototype.propertyIsEnumerable; var cI = (t13, e) => { var r = {}; for (var n in t13) lI.call(t13, n) && e.indexOf(n) < 0 && (r[n] = t13[n]); if (t13 != null && Sy) for (var n of Sy(t13)) e.indexOf(n) < 0 && uI.call(t13, n) && (r[n] = t13[n]); return r; }; function bn(t13, e, r = {}) { const n = r, { window: a = Cl } = n, i = cI(n, ["window"]); let o; const s = IE(() => a && "ResizeObserver" in a), u = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => Cn(t13), (d) => { u(), s.value && a && d && (o = new ResizeObserver(e), o.observe(d, i)); }, { immediate: true, flush: "post" }), c = () => { u(), l(); }; return wl(c), { isSupported: s, stop: c }; } var ky = Object.getOwnPropertySymbols; var dI = Object.prototype.hasOwnProperty; var fI = Object.prototype.propertyIsEnumerable; var vI = (t13, e) => { var r = {}; for (var n in t13) dI.call(t13, n) && e.indexOf(n) < 0 && (r[n] = t13[n]); if (t13 != null && ky) for (var n of ky(t13)) e.indexOf(n) < 0 && fI.call(t13, n) && (r[n] = t13[n]); return r; }; function hI(t13, e, r = {}) { const n = r, { window: a = Cl } = n, i = vI(n, ["window"]); let o; const s = IE(() => a && "MutationObserver" in a), u = () => { o && (o.disconnect(), o = void 0); }, l = watch(() => Cn(t13), (d) => { u(), s.value && a && d && (o = new MutationObserver(e), o.observe(d, i)); }, { immediate: true }), c = () => { u(), l(); }; return wl(c), { isSupported: s, stop: c }; } var _y; (function(t13) { t13.UP = "UP", t13.RIGHT = "RIGHT", t13.DOWN = "DOWN", t13.LEFT = "LEFT", t13.NONE = "NONE"; })(_y || (_y = {})); var pI = Object.defineProperty; var Ty = Object.getOwnPropertySymbols; var gI = Object.prototype.hasOwnProperty; var yI = Object.prototype.propertyIsEnumerable; var Iy = (t13, e, r) => e in t13 ? pI(t13, e, { enumerable: true, configurable: true, writable: true, value: r }) : t13[e] = r; var mI = (t13, e) => { for (var r in e || (e = {})) gI.call(e, r) && Iy(t13, r, e[r]); if (Ty) for (var r of Ty(e)) yI.call(e, r) && Iy(t13, r, e[r]); return t13; }; var bI = { 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] }; mI({ linear: iI }, bI); var wI = () => It && /firefox/i.test(window.navigator.userAgent); var Wp = (t13) => { let e, r; return t13.type === "touchend" ? (r = t13.changedTouches[0].clientY, e = t13.changedTouches[0].clientX) : t13.type.startsWith("touch") ? (r = t13.touches[0].clientY, e = t13.touches[0].clientX) : (r = t13.clientY, e = t13.clientX), { clientX: e, clientY: r }; }; Object.freeze({}); Object.freeze([]); var Eo = () => { }; var CI = Object.prototype.hasOwnProperty; var Ta = (t13, e) => CI.call(t13, e); var hr = Array.isArray; var cr = (t13) => typeof t13 == "function"; var nr = (t13) => typeof t13 == "string"; var Gt = (t13) => t13 !== null && typeof t13 == "object"; var xI = Object.prototype.toString; var EI = (t13) => xI.call(t13); var gu = (t13) => EI(t13).slice(8, -1); var OE = (t13) => { const e = /* @__PURE__ */ Object.create(null); return (r) => e[r] || (e[r] = t13(r)); }; var SI = /-(\w)/g; var kI = OE((t13) => t13.replace(SI, (e, r) => r ? r.toUpperCase() : "")); var _I = /\B([A-Z])/g; var TI = OE( (t13) => t13.replace(_I, "-$1").toLowerCase() ); var AE = typeof global == "object" && global && global.Object === Object && global; var II = typeof self == "object" && self && self.Object === Object && self; var dn = AE || II || Function("return this")(); var sn = dn.Symbol; var PE = Object.prototype; var OI = PE.hasOwnProperty; var AI = PE.toString; var Xi = sn ? sn.toStringTag : void 0; function PI(t13) { var e = OI.call(t13, Xi), r = t13[Xi]; try { t13[Xi] = void 0; var n = true; } catch { } var a = AI.call(t13); return n && (e ? t13[Xi] = r : delete t13[Xi]), a; } var DI = Object.prototype; var RI = DI.toString; function LI(t13) { return RI.call(t13); } var FI = "[object Null]"; var MI = "[object Undefined]"; var Oy = sn ? sn.toStringTag : void 0; function Pi(t13) { return t13 == null ? t13 === void 0 ? MI : FI : Oy && Oy in Object(t13) ? PI(t13) : LI(t13); } function mi(t13) { return t13 != null && typeof t13 == "object"; } var NI = "[object Symbol]"; function xl(t13) { return typeof t13 == "symbol" || mi(t13) && Pi(t13) == NI; } function BI(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = Array(n); ++r < n; ) a[r] = e(t13[r], r, t13); return a; } var jr = Array.isArray; var $I = 1 / 0; var Ay = sn ? sn.prototype : void 0; var Py = Ay ? Ay.toString : void 0; function DE(t13) { if (typeof t13 == "string") return t13; if (jr(t13)) return BI(t13, DE) + ""; if (xl(t13)) return Py ? Py.call(t13) : ""; var e = t13 + ""; return e == "0" && 1 / t13 == -$I ? "-0" : e; } var qI = /\s/; function zI(t13) { for (var e = t13.length; e-- && qI.test(t13.charAt(e)); ) ; return e; } var VI = /^\s+/; function HI(t13) { return t13 && t13.slice(0, zI(t13) + 1).replace(VI, ""); } function Jn(t13) { var e = typeof t13; return t13 != null && (e == "object" || e == "function"); } var Dy = NaN; var KI = /^[-+]0x[0-9a-f]+$/i; var GI = /^0b[01]+$/i; var UI = /^0o[0-7]+$/i; var WI = parseInt; function Ry(t13) { if (typeof t13 == "number") return t13; if (xl(t13)) return Dy; if (Jn(t13)) { var e = typeof t13.valueOf == "function" ? t13.valueOf() : t13; t13 = Jn(e) ? e + "" : e; } if (typeof t13 != "string") return t13 === 0 ? t13 : +t13; t13 = HI(t13); var r = GI.test(t13); return r || UI.test(t13) ? WI(t13.slice(2), r ? 2 : 8) : KI.test(t13) ? Dy : +t13; } function RE(t13) { return t13; } var jI = "[object AsyncFunction]"; var YI = "[object Function]"; var ZI = "[object GeneratorFunction]"; var XI = "[object Proxy]"; function LE(t13) { if (!Jn(t13)) return false; var e = Pi(t13); return e == YI || e == ZI || e == jI || e == XI; } var yu = dn["__core-js_shared__"]; var Ly = function() { var t13 = /[^.]+$/.exec(yu && yu.keys && yu.keys.IE_PROTO || ""); return t13 ? "Symbol(src)_1." + t13 : ""; }(); function JI(t13) { return !!Ly && Ly in t13; } var QI = Function.prototype; var eO = QI.toString; function qa(t13) { if (t13 != null) { try { return eO.call(t13); } catch { } try { return t13 + ""; } catch { } } return ""; } var tO = /[\\^$.*+?()[\]{}|]/g; var rO = /^\[object .+?Constructor\]$/; var nO = Function.prototype; var aO = Object.prototype; var iO = nO.toString; var oO = aO.hasOwnProperty; var sO = RegExp( "^" + iO.call(oO).replace(tO, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function lO(t13) { if (!Jn(t13) || JI(t13)) return false; var e = LE(t13) ? sO : rO; return e.test(qa(t13)); } function uO(t13, e) { return t13 == null ? void 0 : t13[e]; } function za(t13, e) { var r = uO(t13, e); return lO(r) ? r : void 0; } var dp = za(dn, "WeakMap"); function cO(t13, e, r) { switch (r.length) { case 0: return t13.call(e); case 1: return t13.call(e, r[0]); case 2: return t13.call(e, r[0], r[1]); case 3: return t13.call(e, r[0], r[1], r[2]); } return t13.apply(e, r); } var dO = 800; var fO = 16; var vO = Date.now; function hO(t13) { var e = 0, r = 0; return function() { var n = vO(), a = fO - (n - r); if (r = n, a > 0) { if (++e >= dO) return arguments[0]; } else e = 0; return t13.apply(void 0, arguments); }; } function pO(t13) { return function() { return t13; }; } var el = function() { try { var t13 = za(Object, "defineProperty"); return t13({}, "", {}), t13; } catch { } }(); var gO = el ? function(t13, e) { return el(t13, "toString", { configurable: true, enumerable: false, value: pO(e), writable: true }); } : RE; var yO = hO(gO); function mO(t13, e, r, n) { t13.length; for (var a = r + 1; a--; ) if (e(t13[a], a, t13)) return a; return -1; } var bO = 9007199254740991; var wO = /^(?:0|[1-9]\d*)$/; function jp(t13, e) { var r = typeof t13; return e = e ?? bO, !!e && (r == "number" || r != "symbol" && wO.test(t13)) && t13 > -1 && t13 % 1 == 0 && t13 < e; } function CO(t13, e, r) { e == "__proto__" && el ? el(t13, e, { configurable: true, enumerable: true, value: r, writable: true }) : t13[e] = r; } function Yp(t13, e) { return t13 === e || t13 !== t13 && e !== e; } var xO = Object.prototype; var EO = xO.hasOwnProperty; function SO(t13, e, r) { var n = t13[e]; (!(EO.call(t13, e) && Yp(n, r)) || r === void 0 && !(e in t13)) && CO(t13, e, r); } var Fy = Math.max; function kO(t13, e, r) { return e = Fy(e === void 0 ? t13.length - 1 : e, 0), function() { for (var n = arguments, a = -1, i = Fy(n.length - e, 0), o = Array(i); ++a < i; ) o[a] = n[e + a]; a = -1; for (var s = Array(e + 1); ++a < e; ) s[a] = n[a]; return s[e] = r(o), cO(t13, this, s); }; } var _O = 9007199254740991; function Zp(t13) { return typeof t13 == "number" && t13 > -1 && t13 % 1 == 0 && t13 <= _O; } function TO(t13) { return t13 != null && Zp(t13.length) && !LE(t13); } var IO = Object.prototype; function OO(t13) { var e = t13 && t13.constructor, r = typeof e == "function" && e.prototype || IO; return t13 === r; } function AO(t13, e) { for (var r = -1, n = Array(t13); ++r < t13; ) n[r] = e(r); return n; } var PO = "[object Arguments]"; function My(t13) { return mi(t13) && Pi(t13) == PO; } var FE = Object.prototype; var DO = FE.hasOwnProperty; var RO = FE.propertyIsEnumerable; var Xp = My(/* @__PURE__ */ function() { return arguments; }()) ? My : function(t13) { return mi(t13) && DO.call(t13, "callee") && !RO.call(t13, "callee"); }; function LO() { return false; } var ME = typeof exports == "object" && exports && !exports.nodeType && exports; var Ny = ME && typeof module == "object" && module && !module.nodeType && module; var FO = Ny && Ny.exports === ME; var By = FO ? dn.Buffer : void 0; var MO = By ? By.isBuffer : void 0; var fp = MO || LO; var NO = "[object Arguments]"; var BO = "[object Array]"; var $O = "[object Boolean]"; var qO = "[object Date]"; var zO = "[object Error]"; var VO = "[object Function]"; var HO = "[object Map]"; var KO = "[object Number]"; var GO = "[object Object]"; var UO = "[object RegExp]"; var WO = "[object Set]"; var jO = "[object String]"; var YO = "[object WeakMap]"; var ZO = "[object ArrayBuffer]"; var XO = "[object DataView]"; var JO = "[object Float32Array]"; var QO = "[object Float64Array]"; var eA = "[object Int8Array]"; var tA = "[object Int16Array]"; var rA = "[object Int32Array]"; var nA = "[object Uint8Array]"; var aA = "[object Uint8ClampedArray]"; var iA = "[object Uint16Array]"; var oA = "[object Uint32Array]"; var vt = {}; vt[JO] = vt[QO] = vt[eA] = vt[tA] = vt[rA] = vt[nA] = vt[aA] = vt[iA] = vt[oA] = true; vt[NO] = vt[BO] = vt[ZO] = vt[$O] = vt[XO] = vt[qO] = vt[zO] = vt[VO] = vt[HO] = vt[KO] = vt[GO] = vt[UO] = vt[WO] = vt[jO] = vt[YO] = false; function sA(t13) { return mi(t13) && Zp(t13.length) && !!vt[Pi(t13)]; } function lA(t13) { return function(e) { return t13(e); }; } var NE = typeof exports == "object" && exports && !exports.nodeType && exports; var yo = NE && typeof module == "object" && module && !module.nodeType && module; var uA = yo && yo.exports === NE; var mu = uA && AE.process; var $y = function() { try { var t13 = yo && yo.require && yo.require("util").types; return t13 || mu && mu.binding && mu.binding("util"); } catch { } }(); var qy = $y && $y.isTypedArray; var BE = qy ? lA(qy) : sA; var cA = Object.prototype; var dA = cA.hasOwnProperty; function fA(t13, e) { var r = jr(t13), n = !r && Xp(t13), a = !r && !n && fp(t13), i = !r && !n && !a && BE(t13), o = r || n || a || i, s = o ? AO(t13.length, String) : [], u = s.length; for (var l in t13) dA.call(t13, l) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode. (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. a && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. i && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties. jp(l, u))) && s.push(l); return s; } function vA(t13, e) { return function(r) { return t13(e(r)); }; } var hA = vA(Object.keys, Object); var pA = Object.prototype; var gA = pA.hasOwnProperty; function yA(t13) { if (!OO(t13)) return hA(t13); var e = []; for (var r in Object(t13)) gA.call(t13, r) && r != "constructor" && e.push(r); return e; } function $E(t13) { return TO(t13) ? fA(t13) : yA(t13); } var mA = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var bA = /^\w*$/; function Jp(t13, e) { if (jr(t13)) return false; var r = typeof t13; return r == "number" || r == "symbol" || r == "boolean" || t13 == null || xl(t13) ? true : bA.test(t13) || !mA.test(t13) || e != null && t13 in Object(e); } var So = za(Object, "create"); function wA() { this.__data__ = So ? So(null) : {}, this.size = 0; } function CA(t13) { var e = this.has(t13) && delete this.__data__[t13]; return this.size -= e ? 1 : 0, e; } var xA = "__lodash_hash_undefined__"; var EA = Object.prototype; var SA = EA.hasOwnProperty; function kA(t13) { var e = this.__data__; if (So) { var r = e[t13]; return r === xA ? void 0 : r; } return SA.call(e, t13) ? e[t13] : void 0; } var _A = Object.prototype; var TA = _A.hasOwnProperty; function IA(t13) { var e = this.__data__; return So ? e[t13] !== void 0 : TA.call(e, t13); } var OA = "__lodash_hash_undefined__"; function AA(t13, e) { var r = this.__data__; return this.size += this.has(t13) ? 0 : 1, r[t13] = So && e === void 0 ? OA : e, this; } function Ia(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } Ia.prototype.clear = wA; Ia.prototype.delete = CA; Ia.prototype.get = kA; Ia.prototype.has = IA; Ia.prototype.set = AA; function PA() { this.__data__ = [], this.size = 0; } function El(t13, e) { for (var r = t13.length; r--; ) if (Yp(t13[r][0], e)) return r; return -1; } var DA = Array.prototype; var RA = DA.splice; function LA(t13) { var e = this.__data__, r = El(e, t13); if (r < 0) return false; var n = e.length - 1; return r == n ? e.pop() : RA.call(e, r, 1), --this.size, true; } function FA(t13) { var e = this.__data__, r = El(e, t13); return r < 0 ? void 0 : e[r][1]; } function MA(t13) { return El(this.__data__, t13) > -1; } function NA(t13, e) { var r = this.__data__, n = El(r, t13); return n < 0 ? (++this.size, r.push([t13, e])) : r[n][1] = e, this; } function In(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } In.prototype.clear = PA; In.prototype.delete = LA; In.prototype.get = FA; In.prototype.has = MA; In.prototype.set = NA; var ko = za(dn, "Map"); function BA() { this.size = 0, this.__data__ = { hash: new Ia(), map: new (ko || In)(), string: new Ia() }; } function $A(t13) { var e = typeof t13; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t13 !== "__proto__" : t13 === null; } function Sl(t13, e) { var r = t13.__data__; return $A(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } function qA(t13) { var e = Sl(this, t13).delete(t13); return this.size -= e ? 1 : 0, e; } function zA(t13) { return Sl(this, t13).get(t13); } function VA(t13) { return Sl(this, t13).has(t13); } function HA(t13, e) { var r = Sl(this, t13), n = r.size; return r.set(t13, e), this.size += r.size == n ? 0 : 1, this; } function On(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } On.prototype.clear = BA; On.prototype.delete = qA; On.prototype.get = zA; On.prototype.has = VA; On.prototype.set = HA; var KA = "Expected a function"; function Qp(t13, e) { if (typeof t13 != "function" || e != null && typeof e != "function") throw new TypeError(KA); var r = function() { var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache; if (i.has(a)) return i.get(a); var o = t13.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (Qp.Cache || On)(), r; } Qp.Cache = On; var GA = 500; function UA(t13) { var e = Qp(t13, function(n) { return r.size === GA && r.clear(), n; }), r = e.cache; return e; } var WA = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var jA = /\\(\\)?/g; var YA = UA(function(t13) { var e = []; return t13.charCodeAt(0) === 46 && e.push(""), t13.replace(WA, function(r, n, a, i) { e.push(a ? i.replace(jA, "$1") : n || r); }), e; }); function ZA(t13) { return t13 == null ? "" : DE(t13); } function kl(t13, e) { return jr(t13) ? t13 : Jp(t13, e) ? [t13] : YA(ZA(t13)); } var XA = 1 / 0; function Go(t13) { if (typeof t13 == "string" || xl(t13)) return t13; var e = t13 + ""; return e == "0" && 1 / t13 == -XA ? "-0" : e; } function eg(t13, e) { e = kl(e, t13); for (var r = 0, n = e.length; t13 != null && r < n; ) t13 = t13[Go(e[r++])]; return r && r == n ? t13 : void 0; } function wn(t13, e, r) { var n = t13 == null ? void 0 : eg(t13, e); return n === void 0 ? r : n; } function qE(t13, e) { for (var r = -1, n = e.length, a = t13.length; ++r < n; ) t13[a + r] = e[r]; return t13; } var zy = sn ? sn.isConcatSpreadable : void 0; function JA(t13) { return jr(t13) || Xp(t13) || !!(zy && t13 && t13[zy]); } function QA(t13, e, r, n, a) { var i = -1, o = t13.length; for (r || (r = JA), a || (a = []); ++i < o; ) { var s = t13[i]; r(s) ? qE(a, s) : a[a.length] = s; } return a; } function eP(t13) { var e = t13 == null ? 0 : t13.length; return e ? QA(t13) : []; } function tP(t13) { return yO(kO(t13, void 0, eP), t13 + ""); } function Kn() { if (!arguments.length) return []; var t13 = arguments[0]; return jr(t13) ? t13 : [t13]; } function rP() { this.__data__ = new In(), this.size = 0; } function nP(t13) { var e = this.__data__, r = e.delete(t13); return this.size = e.size, r; } function aP(t13) { return this.__data__.get(t13); } function iP(t13) { return this.__data__.has(t13); } var oP = 200; function sP(t13, e) { var r = this.__data__; if (r instanceof In) { var n = r.__data__; if (!ko || n.length < oP - 1) return n.push([t13, e]), this.size = ++r.size, this; r = this.__data__ = new On(n); } return r.set(t13, e), this.size = r.size, this; } function En(t13) { var e = this.__data__ = new In(t13); this.size = e.size; } En.prototype.clear = rP; En.prototype.delete = nP; En.prototype.get = aP; En.prototype.has = iP; En.prototype.set = sP; function lP(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = 0, i = []; ++r < n; ) { var o = t13[r]; e(o, r, t13) && (i[a++] = o); } return i; } function uP() { return []; } var cP = Object.prototype; var dP = cP.propertyIsEnumerable; var Vy = Object.getOwnPropertySymbols; var fP = Vy ? function(t13) { return t13 == null ? [] : (t13 = Object(t13), lP(Vy(t13), function(e) { return dP.call(t13, e); })); } : uP; function vP(t13, e, r) { var n = e(t13); return jr(t13) ? n : qE(n, r(t13)); } function Hy(t13) { return vP(t13, $E, fP); } var vp = za(dn, "DataView"); var hp = za(dn, "Promise"); var pp = za(dn, "Set"); var Ky = "[object Map]"; var hP = "[object Object]"; var Gy = "[object Promise]"; var Uy = "[object Set]"; var Wy = "[object WeakMap]"; var jy = "[object DataView]"; var pP = qa(vp); var gP = qa(ko); var yP = qa(hp); var mP = qa(pp); var bP = qa(dp); var Hn = Pi; (vp && Hn(new vp(new ArrayBuffer(1))) != jy || ko && Hn(new ko()) != Ky || hp && Hn(hp.resolve()) != Gy || pp && Hn(new pp()) != Uy || dp && Hn(new dp()) != Wy) && (Hn = function(t13) { var e = Pi(t13), r = e == hP ? t13.constructor : void 0, n = r ? qa(r) : ""; if (n) switch (n) { case pP: return jy; case gP: return Ky; case yP: return Gy; case mP: return Uy; case bP: return Wy; } return e; }); var Yy = dn.Uint8Array; var wP = "__lodash_hash_undefined__"; function CP(t13) { return this.__data__.set(t13, wP), this; } function xP(t13) { return this.__data__.has(t13); } function tl(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.__data__ = new On(); ++e < r; ) this.add(t13[e]); } tl.prototype.add = tl.prototype.push = CP; tl.prototype.has = xP; function EP(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length; ++r < n; ) if (e(t13[r], r, t13)) return true; return false; } function SP(t13, e) { return t13.has(e); } var kP = 1; var _P = 2; function zE(t13, e, r, n, a, i) { var o = r & kP, s = t13.length, u = e.length; if (s != u && !(o && u > s)) return false; var l = i.get(t13), c = i.get(e); if (l && c) return l == e && c == t13; var d = -1, f = true, h10 = r & _P ? new tl() : void 0; for (i.set(t13, e), i.set(e, t13); ++d < s; ) { var v = t13[d], p = e[d]; if (n) var g = o ? n(p, v, d, e, t13, i) : n(v, p, d, t13, e, i); if (g !== void 0) { if (g) continue; f = false; break; } if (h10) { if (!EP(e, function(y, m) { if (!SP(h10, m) && (v === y || a(v, y, r, n, i))) return h10.push(m); })) { f = false; break; } } else if (!(v === p || a(v, p, r, n, i))) { f = false; break; } } return i.delete(t13), i.delete(e), f; } function TP(t13) { var e = -1, r = Array(t13.size); return t13.forEach(function(n, a) { r[++e] = [a, n]; }), r; } function IP(t13) { var e = -1, r = Array(t13.size); return t13.forEach(function(n) { r[++e] = n; }), r; } var OP = 1; var AP = 2; var PP = "[object Boolean]"; var DP = "[object Date]"; var RP = "[object Error]"; var LP = "[object Map]"; var FP = "[object Number]"; var MP = "[object RegExp]"; var NP = "[object Set]"; var BP = "[object String]"; var $P = "[object Symbol]"; var qP = "[object ArrayBuffer]"; var zP = "[object DataView]"; var Zy = sn ? sn.prototype : void 0; var bu = Zy ? Zy.valueOf : void 0; function VP(t13, e, r, n, a, i, o) { switch (r) { case zP: if (t13.byteLength != e.byteLength || t13.byteOffset != e.byteOffset) return false; t13 = t13.buffer, e = e.buffer; case qP: return !(t13.byteLength != e.byteLength || !i(new Yy(t13), new Yy(e))); case PP: case DP: case FP: return Yp(+t13, +e); case RP: return t13.name == e.name && t13.message == e.message; case MP: case BP: return t13 == e + ""; case LP: var s = TP; case NP: var u = n & OP; if (s || (s = IP), t13.size != e.size && !u) return false; var l = o.get(t13); if (l) return l == e; n |= AP, o.set(t13, e); var c = zE(s(t13), s(e), n, a, i, o); return o.delete(t13), c; case $P: if (bu) return bu.call(t13) == bu.call(e); } return false; } var HP = 1; var KP = Object.prototype; var GP = KP.hasOwnProperty; function UP(t13, e, r, n, a, i) { var o = r & HP, s = Hy(t13), u = s.length, l = Hy(e), c = l.length; if (u != c && !o) return false; for (var d = u; d--; ) { var f = s[d]; if (!(o ? f in e : GP.call(e, f))) return false; } var h10 = i.get(t13), v = i.get(e); if (h10 && v) return h10 == e && v == t13; var p = true; i.set(t13, e), i.set(e, t13); for (var g = o; ++d < u; ) { f = s[d]; var y = t13[f], m = e[f]; if (n) var b = o ? n(m, y, f, e, t13, i) : n(y, m, f, t13, e, i); if (!(b === void 0 ? y === m || a(y, m, r, n, i) : b)) { p = false; break; } g || (g = f == "constructor"); } if (p && !g) { var w = t13.constructor, x = e.constructor; w != x && "constructor" in t13 && "constructor" in e && !(typeof w == "function" && w instanceof w && typeof x == "function" && x instanceof x) && (p = false); } return i.delete(t13), i.delete(e), p; } var WP = 1; var Xy = "[object Arguments]"; var Jy = "[object Array]"; var gs = "[object Object]"; var jP = Object.prototype; var Qy = jP.hasOwnProperty; function YP(t13, e, r, n, a, i) { var o = jr(t13), s = jr(e), u = o ? Jy : Hn(t13), l = s ? Jy : Hn(e); u = u == Xy ? gs : u, l = l == Xy ? gs : l; var c = u == gs, d = l == gs, f = u == l; if (f && fp(t13)) { if (!fp(e)) return false; o = true, c = false; } if (f && !c) return i || (i = new En()), o || BE(t13) ? zE(t13, e, r, n, a, i) : VP(t13, e, u, r, n, a, i); if (!(r & WP)) { var h10 = c && Qy.call(t13, "__wrapped__"), v = d && Qy.call(e, "__wrapped__"); if (h10 || v) { var p = h10 ? t13.value() : t13, g = v ? e.value() : e; return i || (i = new En()), a(p, g, r, n, i); } } return f ? (i || (i = new En()), UP(t13, e, r, n, a, i)) : false; } function _l(t13, e, r, n, a) { return t13 === e ? true : t13 == null || e == null || !mi(t13) && !mi(e) ? t13 !== t13 && e !== e : YP(t13, e, r, n, _l, a); } var ZP = 1; var XP = 2; function JP(t13, e, r, n) { var a = r.length, i = a; if (t13 == null) return !i; for (t13 = Object(t13); a--; ) { var o = r[a]; if (o[2] ? o[1] !== t13[o[0]] : !(o[0] in t13)) return false; } for (; ++a < i; ) { o = r[a]; var s = o[0], u = t13[s], l = o[1]; if (o[2]) { if (u === void 0 && !(s in t13)) return false; } else { var c = new En(), d; if (!(d === void 0 ? _l(l, u, ZP | XP, n, c) : d)) return false; } } return true; } function VE(t13) { return t13 === t13 && !Jn(t13); } function QP(t13) { for (var e = $E(t13), r = e.length; r--; ) { var n = e[r], a = t13[n]; e[r] = [n, a, VE(a)]; } return e; } function HE(t13, e) { return function(r) { return r == null ? false : r[t13] === e && (e !== void 0 || t13 in Object(r)); }; } function eD(t13) { var e = QP(t13); return e.length == 1 && e[0][2] ? HE(e[0][0], e[0][1]) : function(r) { return r === t13 || JP(r, t13, e); }; } function tD(t13, e) { return t13 != null && e in Object(t13); } function rD(t13, e, r) { e = kl(e, t13); for (var n = -1, a = e.length, i = false; ++n < a; ) { var o = Go(e[n]); if (!(i = t13 != null && r(t13, o))) break; t13 = t13[o]; } return i || ++n != a ? i : (a = t13 == null ? 0 : t13.length, !!a && Zp(a) && jp(o, a) && (jr(t13) || Xp(t13))); } function KE(t13, e) { return t13 != null && rD(t13, e, tD); } var nD = 1; var aD = 2; function iD(t13, e) { return Jp(t13) && VE(e) ? HE(Go(t13), e) : function(r) { var n = wn(r, t13); return n === void 0 && n === e ? KE(r, t13) : _l(e, n, nD | aD); }; } function oD(t13) { return function(e) { return e == null ? void 0 : e[t13]; }; } function sD(t13) { return function(e) { return eg(e, t13); }; } function lD(t13) { return Jp(t13) ? oD(Go(t13)) : sD(t13); } function uD(t13) { return typeof t13 == "function" ? t13 : t13 == null ? RE : typeof t13 == "object" ? jr(t13) ? iD(t13[0], t13[1]) : eD(t13) : lD(t13); } var wu = function() { return dn.Date.now(); }; var cD = "Expected a function"; var dD = Math.max; var fD = Math.min; function GE(t13, e, r) { var n, a, i, o, s, u, l = 0, c = false, d = false, f = true; if (typeof t13 != "function") throw new TypeError(cD); e = Ry(e) || 0, Jn(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? dD(Ry(r.maxWait) || 0, e) : i, f = "trailing" in r ? !!r.trailing : f); function h10(E) { var C = n, k = a; return n = a = void 0, l = E, o = t13.apply(k, C), o; } function v(E) { return l = E, s = setTimeout(y, e), c ? h10(E) : o; } function p(E) { var C = E - u, k = E - l, S = e - C; return d ? fD(S, i - k) : S; } function g(E) { var C = E - u, k = E - l; return u === void 0 || C >= e || C < 0 || d && k >= i; } function y() { var E = wu(); if (g(E)) return m(E); s = setTimeout(y, p(E)); } function m(E) { return s = void 0, f && n ? h10(E) : (n = a = void 0, o); } function b() { s !== void 0 && clearTimeout(s), l = 0, n = u = a = s = void 0; } function w() { return s === void 0 ? o : m(wu()); } function x() { var E = wu(), C = g(E); if (n = arguments, a = this, u = E, C) { if (s === void 0) return v(u); if (d) return clearTimeout(s), s = setTimeout(y, e), h10(u); } return s === void 0 && (s = setTimeout(y, e)), o; } return x.cancel = b, x.flush = w, x; } function vD(t13, e, r) { var n = t13 == null ? 0 : t13.length; if (!n) return -1; var a = n - 1; return mO(t13, uD(e), a); } function rl(t13) { for (var e = -1, r = t13 == null ? 0 : t13.length, n = {}; ++e < r; ) { var a = t13[e]; n[a[0]] = a[1]; } return n; } function nl(t13, e) { return _l(t13, e); } function Yn(t13) { return t13 == null; } function hD(t13) { return t13 === void 0; } function pD(t13, e, r, n) { if (!Jn(t13)) return t13; e = kl(e, t13); for (var a = -1, i = e.length, o = i - 1, s = t13; s != null && ++a < i; ) { var u = Go(e[a]), l = r; if (u === "__proto__" || u === "constructor" || u === "prototype") return t13; if (a != o) { var c = s[u]; l = void 0, l === void 0 && (l = Jn(c) ? c : jp(e[a + 1]) ? [] : {}); } SO(s, u, l), s = s[u]; } return t13; } function gD(t13, e, r) { for (var n = -1, a = e.length, i = {}; ++n < a; ) { var o = e[n], s = eg(t13, o); r(s, o) && pD(i, kl(o, t13), s); } return i; } function yD(t13, e) { return gD(t13, e, function(r, n) { return KE(t13, n); }); } var UE = tP(function(t13, e) { return t13 == null ? {} : yD(t13, e); }); var Un = (t13) => t13 === void 0; var bi = (t13) => typeof t13 == "boolean"; var Ut = (t13) => typeof t13 == "number"; var Ea = (t13) => typeof Element > "u" ? false : t13 instanceof Element; var al = (t13) => Yn(t13); var mD = (t13) => nr(t13) ? !Number.isNaN(Number(t13)) : false; var bD = (t13 = "") => t13.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d"); var em = (t13) => Object.keys(t13); var WE = class extends Error { constructor(e) { super(e), this.name = "ElementPlusError"; } }; function wD(t13, e) { throw new WE(`[${t13}] ${e}`); } function Ot(t13, e) { if (true) { const r = nr(t13) ? new WE(`[${t13}] ${e}`) : t13; console.warn(r); } } var CD = "utils/dom/style"; var jE = (t13 = "") => t13.split(" ").filter((e) => !!e.trim()); var gp = (t13, e) => { !t13 || !e.trim() || t13.classList.add(...jE(e)); }; var Sa = (t13, e) => { !t13 || !e.trim() || t13.classList.remove(...jE(e)); }; var Ji = (t13, e) => { var r; if (!It || !t13 || !e) return ""; let n = kI(e); n === "float" && (n = "cssFloat"); try { const a = t13.style[n]; if (a) return a; const i = (r = document.defaultView) == null ? void 0 : r.getComputedStyle(t13, ""); return i ? i[n] : ""; } catch { return t13.style[n]; } }; function wi(t13, e = "px") { if (!t13) return ""; if (Ut(t13) || mD(t13)) return `${t13}${e}`; if (nr(t13)) return t13; Ot(CD, "binding value must be a string or number"); } function xD(t13, e) { if (!It) return; if (!e) { t13.scrollTop = 0; return; } const r = []; let n = e.offsetParent; for (; n !== null && t13 !== n && t13.contains(n); ) r.push(n), n = n.offsetParent; const a = e.offsetTop + r.reduce((u, l) => u + l.offsetTop, 0), i = a + e.offsetHeight, o = t13.scrollTop, s = o + t13.clientHeight; a < o ? t13.scrollTop = a : i > s && (t13.scrollTop = i - t13.clientHeight); } var YE = "__epPropKey"; var qe = (t13) => t13; var ED = (t13) => Gt(t13) && !!t13[YE]; var Tl = (t13, e) => { if (!Gt(t13) || ED(t13)) return t13; const { values: r, required: n, default: a, type: i, validator: o } = t13, u = { type: i, required: !!n, validator: r || o ? (l) => { let c = false, d = []; if (r && (d = Array.from(r), Ta(t13, "default") && d.push(a), c || (c = d.includes(l))), o && (c || (c = o(l))), !c && d.length > 0) { const f = [...new Set(d)].map((h10) => JSON.stringify(h10)).join(", "); warn(`Invalid prop: validation failed${e ? ` for prop "${e}"` : ""}. Expected one of [${f}], got value ${JSON.stringify(l)}.`); } return c; } : void 0, [YE]: true }; return Ta(t13, "default") && (u.default = a), u; }; var rt = (t13) => rl(Object.entries(t13).map(([e, r]) => [ e, Tl(r, e) ])); var Qn = qe([ String, Object, Function ]); var ZE = { validating: loading_default, success: circle_check_default, error: circle_close_default }; var Vt = (t13, e) => { if (t13.install = (r) => { for (const n of [t13, ...Object.values(e ?? {})]) r.component(n.name, n); }, e) for (const [r, n] of Object.entries(e)) t13[r] = n; return t13; }; var SD = (t13, e) => (t13.install = (r) => { r.directive(e, t13); }, t13); var An = (t13) => (t13.install = Eo, t13); var Rt = { tab: "Tab", enter: "Enter", space: "Space", left: "ArrowLeft", up: "ArrowUp", right: "ArrowRight", down: "ArrowDown", esc: "Escape", delete: "Delete", backspace: "Backspace", numpadEnter: "NumpadEnter", pageUp: "PageUp", pageDown: "PageDown", home: "Home", end: "End" }; var Kt = "update:modelValue"; var tg = "change"; var XE = ["", "default", "small", "large"]; var kD = (t13) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t13); var oi = (t13) => t13; var _D = ["class", "style"]; var TD = /^on[A-Z]/; var ID = (t13 = {}) => { const { excludeListeners: e = false, excludeKeys: r } = t13, n = computed(() => ((r == null ? void 0 : r.value) || []).concat(_D)), a = getCurrentInstance(); return a ? computed(() => { var i; return rl(Object.entries((i = a.proxy) == null ? void 0 : i.$attrs).filter(([o]) => !n.value.includes(o) && !(e && TD.test(o)))); }) : (Ot("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"), computed(() => ({}))); }; var Ns = ({ from: t13, replacement: e, scope: r, version: n, ref: a, type: i = "API" }, o) => { watch(() => unref(o), (s) => { s && Ot(r, `[${i}] ${t13} is about to be deprecated in version ${n}, please use ${e} instead. For more detail, please visit: ${a} `); }, { immediate: true }); }; var OD = { name: "en", el: { breadcrumb: { label: "Breadcrumb" }, colorpicker: { confirm: "OK", clear: "Clear", defaultLabel: "color picker", description: "current color is {color}. press enter to select a new color.", alphaLabel: "pick alpha value" }, datepicker: { now: "Now", today: "Today", cancel: "Cancel", clear: "Clear", confirm: "OK", dateTablePrompt: "Use the arrow keys and enter to select the day of the month", monthTablePrompt: "Use the arrow keys and enter to select the month", yearTablePrompt: "Use the arrow keys and enter to select the year", selectedDate: "Selected date", selectDate: "Select date", selectTime: "Select time", startDate: "Start Date", startTime: "Start Time", endDate: "End Date", endTime: "End Time", prevYear: "Previous Year", nextYear: "Next Year", prevMonth: "Previous Month", nextMonth: "Next Month", year: "", month1: "January", month2: "February", month3: "March", month4: "April", month5: "May", month6: "June", month7: "July", month8: "August", month9: "September", month10: "October", month11: "November", month12: "December", week: "week", weeks: { sun: "Sun", mon: "Mon", tue: "Tue", wed: "Wed", thu: "Thu", fri: "Fri", sat: "Sat" }, weeksFull: { sun: "Sunday", mon: "Monday", tue: "Tuesday", wed: "Wednesday", thu: "Thursday", fri: "Friday", sat: "Saturday" }, months: { jan: "Jan", feb: "Feb", mar: "Mar", apr: "Apr", may: "May", jun: "Jun", jul: "Jul", aug: "Aug", sep: "Sep", oct: "Oct", nov: "Nov", dec: "Dec" } }, inputNumber: { decrease: "decrease number", increase: "increase number" }, select: { loading: "Loading", noMatch: "No matching data", noData: "No data", placeholder: "Select" }, mention: { loading: "Loading" }, dropdown: { toggleDropdown: "Toggle Dropdown" }, cascader: { noMatch: "No matching data", loading: "Loading", placeholder: "Select", noData: "No data" }, pagination: { goto: "Go to", pagesize: "/page", total: "Total {total}", pageClassifier: "", page: "Page", prev: "Go to previous page", next: "Go to next page", currentPage: "page {pager}", prevPages: "Previous {pager} pages", nextPages: "Next {pager} pages", deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details" }, dialog: { close: "Close this dialog" }, drawer: { close: "Close this dialog" }, messagebox: { title: "Message", confirm: "OK", cancel: "Cancel", error: "Illegal input", close: "Close this dialog" }, upload: { deleteTip: "press delete to remove", delete: "Delete", preview: "Preview", continue: "Continue" }, slider: { defaultLabel: "slider between {min} and {max}", defaultRangeStartLabel: "pick start value", defaultRangeEndLabel: "pick end value" }, table: { emptyText: "No Data", confirmFilter: "Confirm", resetFilter: "Reset", clearFilter: "All", sumText: "Sum" }, tour: { next: "Next", previous: "Previous", finish: "Finish" }, tree: { emptyText: "No Data" }, transfer: { noMatch: "No matching data", noData: "No data", titles: ["List 1", "List 2"], filterPlaceholder: "Enter keyword", noCheckedFormat: "{total} items", hasCheckedFormat: "{checked}/{total} checked" }, image: { error: "FAILED" }, pageHeader: { title: "Back" }, popconfirm: { confirmButtonText: "Yes", cancelButtonText: "No" }, carousel: { leftArrow: "Carousel arrow left", rightArrow: "Carousel arrow right", indicator: "Carousel switch to index {index}" } } }; var AD = (t13) => (e, r) => PD(e, r, unref(t13)); var PD = (t13, e, r) => wn(r, t13, t13).replace(/\{(\w+)\}/g, (n, a) => { var i; return `${(i = e == null ? void 0 : e[a]) != null ? i : `{${a}}`}`; }); var DD = (t13) => { const e = computed(() => unref(t13).name), r = isRef(t13) ? t13 : ref(t13); return { lang: e, locale: r, t: AD(t13) }; }; var JE = Symbol("localeContextKey"); var Uo = (t13) => { const e = t13 || inject(JE, ref()); return DD(computed(() => e.value || OD)); }; var Bs = "el"; var RD = "is-"; var fa = (t13, e, r, n, a) => { let i = `${t13}-${e}`; return r && (i += `-${r}`), n && (i += `__${n}`), a && (i += `--${a}`), i; }; var QE = Symbol("namespaceContextKey"); var rg = (t13) => { const e = t13 || (getCurrentInstance() ? inject(QE, ref(Bs)) : ref(Bs)); return computed(() => unref(e) || Bs); }; var Ge = (t13, e) => { const r = rg(e); return { namespace: r, b: (p = "") => fa(r.value, t13, p, "", ""), e: (p) => p ? fa(r.value, t13, "", p, "") : "", m: (p) => p ? fa(r.value, t13, "", "", p) : "", be: (p, g) => p && g ? fa(r.value, t13, p, g, "") : "", em: (p, g) => p && g ? fa(r.value, t13, "", p, g) : "", bm: (p, g) => p && g ? fa(r.value, t13, p, "", g) : "", bem: (p, g, y) => p && g && y ? fa(r.value, t13, p, g, y) : "", is: (p, ...g) => { const y = g.length >= 1 ? g[0] : true; return p && y ? `${RD}${p}` : ""; }, cssVar: (p) => { const g = {}; for (const y in p) p[y] && (g[`--${r.value}-${y}`] = p[y]); return g; }, cssVarName: (p) => `--${r.value}-${p}`, cssVarBlock: (p) => { const g = {}; for (const y in p) p[y] && (g[`--${r.value}-${t13}-${y}`] = p[y]); return g; }, cssVarBlockName: (p) => `--${r.value}-${t13}-${p}` }; }; var LD = Tl({ type: qe(Boolean), default: null }); var FD = Tl({ type: qe(Function) }); var MD = (t13) => { const e = `update:${t13}`, r = `onUpdate:${t13}`, n = [e], a = { [t13]: LD, [r]: FD }; return { useModelToggle: ({ indicator: o, toggleReason: s, shouldHideWhenRouteChanges: u, shouldProceed: l, onShow: c, onHide: d }) => { const f = getCurrentInstance(), { emit: h10 } = f, v = f.props, p = computed(() => cr(v[r])), g = computed(() => v[t13] === null), y = (C) => { o.value !== true && (o.value = true, s && (s.value = C), cr(c) && c(C)); }, m = (C) => { o.value !== false && (o.value = false, s && (s.value = C), cr(d) && d(C)); }, b = (C) => { if (v.disabled === true || cr(l) && !l()) return; const k = p.value && It; k && h10(e, true), (g.value || !k) && y(C); }, w = (C) => { if (v.disabled === true || !It) return; const k = p.value && It; k && h10(e, false), (g.value || !k) && m(C); }, x = (C) => { bi(C) && (v.disabled && C ? p.value && h10(e, false) : o.value !== C && (C ? y() : m())); }, E = () => { o.value ? w() : b(); }; return watch(() => v[t13], x), u && f.appContext.config.globalProperties.$route !== void 0 && watch(() => ({ ...f.proxy.$route }), () => { u.value && o.value && w(); }), onMounted(() => { x(v[t13]); }), { hide: w, show: b, toggle: E, hasUpdateHandler: p }; }, useModelToggleProps: a, useModelToggleEmits: n }; }; var e2 = (t13) => { const e = getCurrentInstance(); return computed(() => { var r, n; return (n = (r = e == null ? void 0 : e.proxy) == null ? void 0 : r.$props) == null ? void 0 : n[t13]; }); }; var pr = "top"; var Rr = "bottom"; var Lr = "right"; var gr = "left"; var ng = "auto"; var Wo = [pr, Rr, Lr, gr]; var Ci = "start"; var _o = "end"; var ND = "clippingParents"; var t2 = "viewport"; var Qi = "popper"; var BD = "reference"; var tm = Wo.reduce(function(t13, e) { return t13.concat([e + "-" + Ci, e + "-" + _o]); }, []); var Il = [].concat(Wo, [ng]).reduce(function(t13, e) { return t13.concat([e, e + "-" + Ci, e + "-" + _o]); }, []); var $D = "beforeRead"; var qD = "read"; var zD = "afterRead"; var VD = "beforeMain"; var HD = "main"; var KD = "afterMain"; var GD = "beforeWrite"; var UD = "write"; var WD = "afterWrite"; var jD = [$D, qD, zD, VD, HD, KD, GD, UD, WD]; function ln(t13) { return t13 ? (t13.nodeName || "").toLowerCase() : null; } function Xr(t13) { if (t13 == null) return window; if (t13.toString() !== "[object Window]") { var e = t13.ownerDocument; return e && e.defaultView || window; } return t13; } function xi(t13) { var e = Xr(t13).Element; return t13 instanceof e || t13 instanceof Element; } function Dr(t13) { var e = Xr(t13).HTMLElement; return t13 instanceof e || t13 instanceof HTMLElement; } function ag(t13) { if (typeof ShadowRoot > "u") return false; var e = Xr(t13).ShadowRoot; return t13 instanceof e || t13 instanceof ShadowRoot; } function YD(t13) { var e = t13.state; Object.keys(e.elements).forEach(function(r) { var n = e.styles[r] || {}, a = e.attributes[r] || {}, i = e.elements[r]; !Dr(i) || !ln(i) || (Object.assign(i.style, n), Object.keys(a).forEach(function(o) { var s = a[o]; s === false ? i.removeAttribute(o) : i.setAttribute(o, s === true ? "" : s); })); }); } function ZD(t13) { var e = t13.state, r = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} }; return Object.assign(e.elements.popper.style, r.popper), e.styles = r, e.elements.arrow && Object.assign(e.elements.arrow.style, r.arrow), function() { Object.keys(e.elements).forEach(function(n) { var a = e.elements[n], i = e.attributes[n] || {}, o = Object.keys(e.styles.hasOwnProperty(n) ? e.styles[n] : r[n]), s = o.reduce(function(u, l) { return u[l] = "", u; }, {}); !Dr(a) || !ln(a) || (Object.assign(a.style, s), Object.keys(i).forEach(function(u) { a.removeAttribute(u); })); }); }; } var r2 = { name: "applyStyles", enabled: true, phase: "write", fn: YD, effect: ZD, requires: ["computeStyles"] }; function an(t13) { return t13.split("-")[0]; } var ka = Math.max; var il = Math.min; var Ei = Math.round; function Si(t13, e) { e === void 0 && (e = false); var r = t13.getBoundingClientRect(), n = 1, a = 1; if (Dr(t13) && e) { var i = t13.offsetHeight, o = t13.offsetWidth; o > 0 && (n = Ei(r.width) / o || 1), i > 0 && (a = Ei(r.height) / i || 1); } return { width: r.width / n, height: r.height / a, top: r.top / a, right: r.right / n, bottom: r.bottom / a, left: r.left / n, x: r.left / n, y: r.top / a }; } function ig(t13) { var e = Si(t13), r = t13.offsetWidth, n = t13.offsetHeight; return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), { x: t13.offsetLeft, y: t13.offsetTop, width: r, height: n }; } function n2(t13, e) { var r = e.getRootNode && e.getRootNode(); if (t13.contains(e)) return true; if (r && ag(r)) { var n = e; do { if (n && t13.isSameNode(n)) return true; n = n.parentNode || n.host; } while (n); } return false; } function Sn(t13) { return Xr(t13).getComputedStyle(t13); } function XD(t13) { return ["table", "td", "th"].indexOf(ln(t13)) >= 0; } function oa(t13) { return ((xi(t13) ? t13.ownerDocument : t13.document) || window.document).documentElement; } function Ol(t13) { return ln(t13) === "html" ? t13 : t13.assignedSlot || t13.parentNode || (ag(t13) ? t13.host : null) || oa(t13); } function rm(t13) { return !Dr(t13) || Sn(t13).position === "fixed" ? null : t13.offsetParent; } function JD(t13) { var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, r = navigator.userAgent.indexOf("Trident") !== -1; if (r && Dr(t13)) { var n = Sn(t13); if (n.position === "fixed") return null; } var a = Ol(t13); for (ag(a) && (a = a.host); Dr(a) && ["html", "body"].indexOf(ln(a)) < 0; ) { var i = Sn(a); if (i.transform !== "none" || i.perspective !== "none" || i.contain === "paint" || ["transform", "perspective"].indexOf(i.willChange) !== -1 || e && i.willChange === "filter" || e && i.filter && i.filter !== "none") return a; a = a.parentNode; } return null; } function jo(t13) { for (var e = Xr(t13), r = rm(t13); r && XD(r) && Sn(r).position === "static"; ) r = rm(r); return r && (ln(r) === "html" || ln(r) === "body" && Sn(r).position === "static") ? e : r || JD(t13) || e; } function og(t13) { return ["top", "bottom"].indexOf(t13) >= 0 ? "x" : "y"; } function mo(t13, e, r) { return ka(t13, il(e, r)); } function QD(t13, e, r) { var n = mo(t13, e, r); return n > r ? r : n; } function a2() { return { top: 0, right: 0, bottom: 0, left: 0 }; } function i2(t13) { return Object.assign({}, a2(), t13); } function o2(t13, e) { return e.reduce(function(r, n) { return r[n] = t13, r; }, {}); } var eR = function(t13, e) { return t13 = typeof t13 == "function" ? t13(Object.assign({}, e.rects, { placement: e.placement })) : t13, i2(typeof t13 != "number" ? t13 : o2(t13, Wo)); }; function tR(t13) { var e, r = t13.state, n = t13.name, a = t13.options, i = r.elements.arrow, o = r.modifiersData.popperOffsets, s = an(r.placement), u = og(s), l = [gr, Lr].indexOf(s) >= 0, c = l ? "height" : "width"; if (!(!i || !o)) { var d = eR(a.padding, r), f = ig(i), h10 = u === "y" ? pr : gr, v = u === "y" ? Rr : Lr, p = r.rects.reference[c] + r.rects.reference[u] - o[u] - r.rects.popper[c], g = o[u] - r.rects.reference[u], y = jo(i), m = y ? u === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, b = p / 2 - g / 2, w = d[h10], x = m - f[c] - d[v], E = m / 2 - f[c] / 2 + b, C = mo(w, E, x), k = u; r.modifiersData[n] = (e = {}, e[k] = C, e.centerOffset = C - E, e); } } function rR(t13) { var e = t13.state, r = t13.options, n = r.element, a = n === void 0 ? "[data-popper-arrow]" : n; a != null && (typeof a == "string" && (a = e.elements.popper.querySelector(a), !a) || !n2(e.elements.popper, a) || (e.elements.arrow = a)); } var nR = { name: "arrow", enabled: true, phase: "main", fn: tR, effect: rR, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] }; function ki(t13) { return t13.split("-")[1]; } var aR = { top: "auto", right: "auto", bottom: "auto", left: "auto" }; function iR(t13) { var e = t13.x, r = t13.y, n = window, a = n.devicePixelRatio || 1; return { x: Ei(e * a) / a || 0, y: Ei(r * a) / a || 0 }; } function nm(t13) { var e, r = t13.popper, n = t13.popperRect, a = t13.placement, i = t13.variation, o = t13.offsets, s = t13.position, u = t13.gpuAcceleration, l = t13.adaptive, c = t13.roundOffsets, d = t13.isFixed, f = o.x, h10 = f === void 0 ? 0 : f, v = o.y, p = v === void 0 ? 0 : v, g = typeof c == "function" ? c({ x: h10, y: p }) : { x: h10, y: p }; h10 = g.x, p = g.y; var y = o.hasOwnProperty("x"), m = o.hasOwnProperty("y"), b = gr, w = pr, x = window; if (l) { var E = jo(r), C = "clientHeight", k = "clientWidth"; if (E === Xr(r) && (E = oa(r), Sn(E).position !== "static" && s === "absolute" && (C = "scrollHeight", k = "scrollWidth")), E = E, a === pr || (a === gr || a === Lr) && i === _o) { w = Rr; var S = d && E === x && x.visualViewport ? x.visualViewport.height : E[C]; p -= S - n.height, p *= u ? 1 : -1; } if (a === gr || (a === pr || a === Rr) && i === _o) { b = Lr; var _ = d && E === x && x.visualViewport ? x.visualViewport.width : E[k]; h10 -= _ - n.width, h10 *= u ? 1 : -1; } } var T = Object.assign({ position: s }, l && aR), O = c === true ? iR({ x: h10, y: p }) : { x: h10, y: p }; if (h10 = O.x, p = O.y, u) { var D; return Object.assign({}, T, (D = {}, D[w] = m ? "0" : "", D[b] = y ? "0" : "", D.transform = (x.devicePixelRatio || 1) <= 1 ? "translate(" + h10 + "px, " + p + "px)" : "translate3d(" + h10 + "px, " + p + "px, 0)", D)); } return Object.assign({}, T, (e = {}, e[w] = m ? p + "px" : "", e[b] = y ? h10 + "px" : "", e.transform = "", e)); } function oR(t13) { var e = t13.state, r = t13.options, n = r.gpuAcceleration, a = n === void 0 ? true : n, i = r.adaptive, o = i === void 0 ? true : i, s = r.roundOffsets, u = s === void 0 ? true : s, l = { placement: an(e.placement), variation: ki(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: a, isFixed: e.options.strategy === "fixed" }; e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, nm(Object.assign({}, l, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: o, roundOffsets: u })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, nm(Object.assign({}, l, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: u })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement }); } var s2 = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: oR, data: {} }; var ys = { passive: true }; function sR(t13) { var e = t13.state, r = t13.instance, n = t13.options, a = n.scroll, i = a === void 0 ? true : a, o = n.resize, s = o === void 0 ? true : o, u = Xr(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper); return i && l.forEach(function(c) { c.addEventListener("scroll", r.update, ys); }), s && u.addEventListener("resize", r.update, ys), function() { i && l.forEach(function(c) { c.removeEventListener("scroll", r.update, ys); }), s && u.removeEventListener("resize", r.update, ys); }; } var l2 = { name: "eventListeners", enabled: true, phase: "write", fn: function() { }, effect: sR, data: {} }; var lR = { left: "right", right: "left", bottom: "top", top: "bottom" }; function $s(t13) { return t13.replace(/left|right|bottom|top/g, function(e) { return lR[e]; }); } var uR = { start: "end", end: "start" }; function am(t13) { return t13.replace(/start|end/g, function(e) { return uR[e]; }); } function sg(t13) { var e = Xr(t13), r = e.pageXOffset, n = e.pageYOffset; return { scrollLeft: r, scrollTop: n }; } function lg(t13) { return Si(oa(t13)).left + sg(t13).scrollLeft; } function cR(t13) { var e = Xr(t13), r = oa(t13), n = e.visualViewport, a = r.clientWidth, i = r.clientHeight, o = 0, s = 0; return n && (a = n.width, i = n.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (o = n.offsetLeft, s = n.offsetTop)), { width: a, height: i, x: o + lg(t13), y: s }; } function dR(t13) { var e, r = oa(t13), n = sg(t13), a = (e = t13.ownerDocument) == null ? void 0 : e.body, i = ka(r.scrollWidth, r.clientWidth, a ? a.scrollWidth : 0, a ? a.clientWidth : 0), o = ka(r.scrollHeight, r.clientHeight, a ? a.scrollHeight : 0, a ? a.clientHeight : 0), s = -n.scrollLeft + lg(t13), u = -n.scrollTop; return Sn(a || r).direction === "rtl" && (s += ka(r.clientWidth, a ? a.clientWidth : 0) - i), { width: i, height: o, x: s, y: u }; } function ug(t13) { var e = Sn(t13), r = e.overflow, n = e.overflowX, a = e.overflowY; return /auto|scroll|overlay|hidden/.test(r + a + n); } function u2(t13) { return ["html", "body", "#document"].indexOf(ln(t13)) >= 0 ? t13.ownerDocument.body : Dr(t13) && ug(t13) ? t13 : u2(Ol(t13)); } function bo(t13, e) { var r; e === void 0 && (e = []); var n = u2(t13), a = n === ((r = t13.ownerDocument) == null ? void 0 : r.body), i = Xr(n), o = a ? [i].concat(i.visualViewport || [], ug(n) ? n : []) : n, s = e.concat(o); return a ? s : s.concat(bo(Ol(o))); } function yp(t13) { return Object.assign({}, t13, { left: t13.x, top: t13.y, right: t13.x + t13.width, bottom: t13.y + t13.height }); } function fR(t13) { var e = Si(t13); return e.top = e.top + t13.clientTop, e.left = e.left + t13.clientLeft, e.bottom = e.top + t13.clientHeight, e.right = e.left + t13.clientWidth, e.width = t13.clientWidth, e.height = t13.clientHeight, e.x = e.left, e.y = e.top, e; } function im(t13, e) { return e === t2 ? yp(cR(t13)) : xi(e) ? fR(e) : yp(dR(oa(t13))); } function vR(t13) { var e = bo(Ol(t13)), r = ["absolute", "fixed"].indexOf(Sn(t13).position) >= 0, n = r && Dr(t13) ? jo(t13) : t13; return xi(n) ? e.filter(function(a) { return xi(a) && n2(a, n) && ln(a) !== "body"; }) : []; } function hR(t13, e, r) { var n = e === "clippingParents" ? vR(t13) : [].concat(e), a = [].concat(n, [r]), i = a[0], o = a.reduce(function(s, u) { var l = im(t13, u); return s.top = ka(l.top, s.top), s.right = il(l.right, s.right), s.bottom = il(l.bottom, s.bottom), s.left = ka(l.left, s.left), s; }, im(t13, i)); return o.width = o.right - o.left, o.height = o.bottom - o.top, o.x = o.left, o.y = o.top, o; } function c2(t13) { var e = t13.reference, r = t13.element, n = t13.placement, a = n ? an(n) : null, i = n ? ki(n) : null, o = e.x + e.width / 2 - r.width / 2, s = e.y + e.height / 2 - r.height / 2, u; switch (a) { case pr: u = { x: o, y: e.y - r.height }; break; case Rr: u = { x: o, y: e.y + e.height }; break; case Lr: u = { x: e.x + e.width, y: s }; break; case gr: u = { x: e.x - r.width, y: s }; break; default: u = { x: e.x, y: e.y }; } var l = a ? og(a) : null; if (l != null) { var c = l === "y" ? "height" : "width"; switch (i) { case Ci: u[l] = u[l] - (e[c] / 2 - r[c] / 2); break; case _o: u[l] = u[l] + (e[c] / 2 - r[c] / 2); break; } } return u; } function To(t13, e) { e === void 0 && (e = {}); var r = e, n = r.placement, a = n === void 0 ? t13.placement : n, i = r.boundary, o = i === void 0 ? ND : i, s = r.rootBoundary, u = s === void 0 ? t2 : s, l = r.elementContext, c = l === void 0 ? Qi : l, d = r.altBoundary, f = d === void 0 ? false : d, h10 = r.padding, v = h10 === void 0 ? 0 : h10, p = i2(typeof v != "number" ? v : o2(v, Wo)), g = c === Qi ? BD : Qi, y = t13.rects.popper, m = t13.elements[f ? g : c], b = hR(xi(m) ? m : m.contextElement || oa(t13.elements.popper), o, u), w = Si(t13.elements.reference), x = c2({ reference: w, element: y, strategy: "absolute", placement: a }), E = yp(Object.assign({}, y, x)), C = c === Qi ? E : w, k = { top: b.top - C.top + p.top, bottom: C.bottom - b.bottom + p.bottom, left: b.left - C.left + p.left, right: C.right - b.right + p.right }, S = t13.modifiersData.offset; if (c === Qi && S) { var _ = S[a]; Object.keys(k).forEach(function(T) { var O = [Lr, Rr].indexOf(T) >= 0 ? 1 : -1, D = [pr, Rr].indexOf(T) >= 0 ? "y" : "x"; k[T] += _[D] * O; }); } return k; } function pR(t13, e) { e === void 0 && (e = {}); var r = e, n = r.placement, a = r.boundary, i = r.rootBoundary, o = r.padding, s = r.flipVariations, u = r.allowedAutoPlacements, l = u === void 0 ? Il : u, c = ki(n), d = c ? s ? tm : tm.filter(function(v) { return ki(v) === c; }) : Wo, f = d.filter(function(v) { return l.indexOf(v) >= 0; }); f.length === 0 && (f = d); var h10 = f.reduce(function(v, p) { return v[p] = To(t13, { placement: p, boundary: a, rootBoundary: i, padding: o })[an(p)], v; }, {}); return Object.keys(h10).sort(function(v, p) { return h10[v] - h10[p]; }); } function gR(t13) { if (an(t13) === ng) return []; var e = $s(t13); return [am(t13), e, am(e)]; } function yR(t13) { var e = t13.state, r = t13.options, n = t13.name; if (!e.modifiersData[n]._skip) { for (var a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, s = o === void 0 ? true : o, u = r.fallbackPlacements, l = r.padding, c = r.boundary, d = r.rootBoundary, f = r.altBoundary, h10 = r.flipVariations, v = h10 === void 0 ? true : h10, p = r.allowedAutoPlacements, g = e.options.placement, y = an(g), m = y === g, b = u || (m || !v ? [$s(g)] : gR(g)), w = [g].concat(b).reduce(function(B, $) { return B.concat(an($) === ng ? pR(e, { placement: $, boundary: c, rootBoundary: d, padding: l, flipVariations: v, allowedAutoPlacements: p }) : $); }, []), x = e.rects.reference, E = e.rects.popper, C = /* @__PURE__ */ new Map(), k = true, S = w[0], _ = 0; _ < w.length; _++) { var T = w[_], O = an(T), D = ki(T) === Ci, A = [pr, Rr].indexOf(O) >= 0, F = A ? "width" : "height", R = To(e, { placement: T, boundary: c, rootBoundary: d, altBoundary: f, padding: l }), M = A ? D ? Lr : gr : D ? Rr : pr; x[F] > E[F] && (M = $s(M)); var L = $s(M), V = []; if (i && V.push(R[O] <= 0), s && V.push(R[M] <= 0, R[L] <= 0), V.every(function(B) { return B; })) { S = T, k = false; break; } C.set(T, V); } if (k) for (var Y = v ? 3 : 1, H = function(B) { var $ = w.find(function(z) { var W = C.get(z); if (W) return W.slice(0, B).every(function(Z) { return Z; }); }); if ($) return S = $, "break"; }, K = Y; K > 0; K--) { var ne = H(K); if (ne === "break") break; } e.placement !== S && (e.modifiersData[n]._skip = true, e.placement = S, e.reset = true); } } var mR = { name: "flip", enabled: true, phase: "main", fn: yR, requiresIfExists: ["offset"], data: { _skip: false } }; function om(t13, e, r) { return r === void 0 && (r = { x: 0, y: 0 }), { top: t13.top - e.height - r.y, right: t13.right - e.width + r.x, bottom: t13.bottom - e.height + r.y, left: t13.left - e.width - r.x }; } function sm(t13) { return [pr, Lr, Rr, gr].some(function(e) { return t13[e] >= 0; }); } function bR(t13) { var e = t13.state, r = t13.name, n = e.rects.reference, a = e.rects.popper, i = e.modifiersData.preventOverflow, o = To(e, { elementContext: "reference" }), s = To(e, { altBoundary: true }), u = om(o, n), l = om(s, a, i), c = sm(u), d = sm(l); e.modifiersData[r] = { referenceClippingOffsets: u, popperEscapeOffsets: l, isReferenceHidden: c, hasPopperEscaped: d }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": c, "data-popper-escaped": d }); } var wR = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: bR }; function CR(t13, e, r) { var n = an(t13), a = [gr, pr].indexOf(n) >= 0 ? -1 : 1, i = typeof r == "function" ? r(Object.assign({}, e, { placement: t13 })) : r, o = i[0], s = i[1]; return o = o || 0, s = (s || 0) * a, [gr, Lr].indexOf(n) >= 0 ? { x: s, y: o } : { x: o, y: s }; } function xR(t13) { var e = t13.state, r = t13.options, n = t13.name, a = r.offset, i = a === void 0 ? [0, 0] : a, o = Il.reduce(function(c, d) { return c[d] = CR(d, e.rects, i), c; }, {}), s = o[e.placement], u = s.x, l = s.y; e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += u, e.modifiersData.popperOffsets.y += l), e.modifiersData[n] = o; } var ER = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: xR }; function SR(t13) { var e = t13.state, r = t13.name; e.modifiersData[r] = c2({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement }); } var d2 = { name: "popperOffsets", enabled: true, phase: "read", fn: SR, data: {} }; function kR(t13) { return t13 === "x" ? "y" : "x"; } function _R(t13) { var e = t13.state, r = t13.options, n = t13.name, a = r.mainAxis, i = a === void 0 ? true : a, o = r.altAxis, s = o === void 0 ? false : o, u = r.boundary, l = r.rootBoundary, c = r.altBoundary, d = r.padding, f = r.tether, h10 = f === void 0 ? true : f, v = r.tetherOffset, p = v === void 0 ? 0 : v, g = To(e, { boundary: u, rootBoundary: l, padding: d, altBoundary: c }), y = an(e.placement), m = ki(e.placement), b = !m, w = og(y), x = kR(w), E = e.modifiersData.popperOffsets, C = e.rects.reference, k = e.rects.popper, S = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, _ = typeof S == "number" ? { mainAxis: S, altAxis: S } : Object.assign({ mainAxis: 0, altAxis: 0 }, S), T = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, O = { x: 0, y: 0 }; if (E) { if (i) { var D, A = w === "y" ? pr : gr, F = w === "y" ? Rr : Lr, R = w === "y" ? "height" : "width", M = E[w], L = M + g[A], V = M - g[F], Y = h10 ? -k[R] / 2 : 0, H = m === Ci ? C[R] : k[R], K = m === Ci ? -k[R] : -C[R], ne = e.elements.arrow, B = h10 && ne ? ig(ne) : { width: 0, height: 0 }, $ = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : a2(), z = $[A], W = $[F], Z = mo(0, C[R], B[R]), N = b ? C[R] / 2 - Y - Z - z - _.mainAxis : H - Z - z - _.mainAxis, X = b ? -C[R] / 2 + Y + Z + W + _.mainAxis : K + Z + W + _.mainAxis, Q = e.elements.arrow && jo(e.elements.arrow), ge = Q ? w === "y" ? Q.clientTop || 0 : Q.clientLeft || 0 : 0, we = (D = T == null ? void 0 : T[w]) != null ? D : 0, fe = M + N - we - ge, ce = M + X - we, be = mo(h10 ? il(L, fe) : L, M, h10 ? ka(V, ce) : V); E[w] = be, O[w] = be - M; } if (s) { var ve, xe = w === "x" ? pr : gr, _e = w === "x" ? Rr : Lr, He = E[x], Ve = x === "y" ? "height" : "width", De = He + g[xe], Ne = He - g[_e], ue = [pr, gr].indexOf(y) !== -1, I = (ve = T == null ? void 0 : T[x]) != null ? ve : 0, G = ue ? De : He - C[Ve] - k[Ve] - I + _.altAxis, se = ue ? He + C[Ve] + k[Ve] - I - _.altAxis : Ne, ee = h10 && ue ? QD(G, He, se) : mo(h10 ? G : De, He, h10 ? se : Ne); E[x] = ee, O[x] = ee - He; } e.modifiersData[n] = O; } } var TR = { name: "preventOverflow", enabled: true, phase: "main", fn: _R, requiresIfExists: ["offset"] }; function IR(t13) { return { scrollLeft: t13.scrollLeft, scrollTop: t13.scrollTop }; } function OR(t13) { return t13 === Xr(t13) || !Dr(t13) ? sg(t13) : IR(t13); } function AR(t13) { var e = t13.getBoundingClientRect(), r = Ei(e.width) / t13.offsetWidth || 1, n = Ei(e.height) / t13.offsetHeight || 1; return r !== 1 || n !== 1; } function PR(t13, e, r) { r === void 0 && (r = false); var n = Dr(e), a = Dr(e) && AR(e), i = oa(e), o = Si(t13, a), s = { scrollLeft: 0, scrollTop: 0 }, u = { x: 0, y: 0 }; return (n || !n && !r) && ((ln(e) !== "body" || ug(i)) && (s = OR(e)), Dr(e) ? (u = Si(e, true), u.x += e.clientLeft, u.y += e.clientTop) : i && (u.x = lg(i))), { x: o.left + s.scrollLeft - u.x, y: o.top + s.scrollTop - u.y, width: o.width, height: o.height }; } function DR(t13) { var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = []; t13.forEach(function(i) { e.set(i.name, i); }); function a(i) { r.add(i.name); var o = [].concat(i.requires || [], i.requiresIfExists || []); o.forEach(function(s) { if (!r.has(s)) { var u = e.get(s); u && a(u); } }), n.push(i); } return t13.forEach(function(i) { r.has(i.name) || a(i); }), n; } function RR(t13) { var e = DR(t13); return jD.reduce(function(r, n) { return r.concat(e.filter(function(a) { return a.phase === n; })); }, []); } function LR(t13) { var e; return function() { return e || (e = new Promise(function(r) { Promise.resolve().then(function() { e = void 0, r(t13()); }); })), e; }; } function FR(t13) { var e = t13.reduce(function(r, n) { var a = r[n.name]; return r[n.name] = a ? Object.assign({}, a, n, { options: Object.assign({}, a.options, n.options), data: Object.assign({}, a.data, n.data) }) : n, r; }, {}); return Object.keys(e).map(function(r) { return e[r]; }); } var lm = { placement: "bottom", modifiers: [], strategy: "absolute" }; function um() { for (var t13 = arguments.length, e = new Array(t13), r = 0; r < t13; r++) e[r] = arguments[r]; return !e.some(function(n) { return !(n && typeof n.getBoundingClientRect == "function"); }); } function cg(t13) { t13 === void 0 && (t13 = {}); var e = t13, r = e.defaultModifiers, n = r === void 0 ? [] : r, a = e.defaultOptions, i = a === void 0 ? lm : a; return function(o, s, u) { u === void 0 && (u = i); var l = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, lm, i), modifiersData: {}, elements: { reference: o, popper: s }, attributes: {}, styles: {} }, c = [], d = false, f = { state: l, setOptions: function(p) { var g = typeof p == "function" ? p(l.options) : p; v(), l.options = Object.assign({}, i, l.options, g), l.scrollParents = { reference: xi(o) ? bo(o) : o.contextElement ? bo(o.contextElement) : [], popper: bo(s) }; var y = RR(FR([].concat(n, l.options.modifiers))); return l.orderedModifiers = y.filter(function(m) { return m.enabled; }), h10(), f.update(); }, forceUpdate: function() { if (!d) { var p = l.elements, g = p.reference, y = p.popper; if (um(g, y)) { l.rects = { reference: PR(g, jo(y), l.options.strategy === "fixed"), popper: ig(y) }, l.reset = false, l.placement = l.options.placement, l.orderedModifiers.forEach(function(k) { return l.modifiersData[k.name] = Object.assign({}, k.data); }); for (var m = 0; m < l.orderedModifiers.length; m++) { if (l.reset === true) { l.reset = false, m = -1; continue; } var b = l.orderedModifiers[m], w = b.fn, x = b.options, E = x === void 0 ? {} : x, C = b.name; typeof w == "function" && (l = w({ state: l, options: E, name: C, instance: f }) || l); } } } }, update: LR(function() { return new Promise(function(p) { f.forceUpdate(), p(l); }); }), destroy: function() { v(), d = true; } }; if (!um(o, s)) return f; f.setOptions(u).then(function(p) { !d && u.onFirstUpdate && u.onFirstUpdate(p); }); function h10() { l.orderedModifiers.forEach(function(p) { var g = p.name, y = p.options, m = y === void 0 ? {} : y, b = p.effect; if (typeof b == "function") { var w = b({ state: l, name: g, instance: f, options: m }), x = function() { }; c.push(w || x); } }); } function v() { c.forEach(function(p) { return p(); }), c = []; } return f; }; } cg(); var MR = [l2, d2, s2, r2]; cg({ defaultModifiers: MR }); var NR = [l2, d2, s2, r2, ER, mR, TR, nR, wR]; var BR = cg({ defaultModifiers: NR }); var $R = (t13, e, r = {}) => { const n = { name: "updateState", enabled: true, phase: "write", fn: ({ state: u }) => { const l = qR(u); Object.assign(o.value, l); }, requires: ["computeStyles"] }, a = computed(() => { const { onFirstUpdate: u, placement: l, strategy: c, modifiers: d } = unref(r); return { onFirstUpdate: u, placement: l || "bottom", strategy: c || "absolute", modifiers: [ ...d || [], n, { name: "applyStyles", enabled: false } ] }; }), i = shallowRef(), o = ref({ styles: { popper: { position: unref(a).strategy, left: "0", top: "0" }, arrow: { position: "absolute" } }, attributes: {} }), s = () => { i.value && (i.value.destroy(), i.value = void 0); }; return watch(a, (u) => { const l = unref(i); l && l.setOptions(u); }, { deep: true }), watch([t13, e], ([u, l]) => { s(), !(!u || !l) && (i.value = BR(u, l, unref(a))); }), onBeforeUnmount(() => { s(); }), { state: computed(() => { var u; return { ...((u = unref(i)) == null ? void 0 : u.state) || {} }; }), styles: computed(() => unref(o).styles), attributes: computed(() => unref(o).attributes), update: () => { var u; return (u = unref(i)) == null ? void 0 : u.update(); }, forceUpdate: () => { var u; return (u = unref(i)) == null ? void 0 : u.forceUpdate(); }, instanceRef: computed(() => unref(i)) }; }; function qR(t13) { const e = Object.keys(t13.elements), r = rl(e.map((a) => [a, t13.styles[a] || {}])), n = rl(e.map((a) => [a, t13.attributes[a]])); return { styles: r, attributes: n }; } function cm() { let t13; const e = (n, a) => { r(), t13 = window.setTimeout(n, a); }, r = () => window.clearTimeout(t13); return wl(() => r()), { registerTimeout: e, cancelTimeout: r }; } var mp = { prefix: Math.floor(Math.random() * 1e4), current: 0 }; var zR = Symbol("elIdInjection"); var f2 = () => getCurrentInstance() ? inject(zR, mp) : mp; var Al = (t13) => { const e = f2(); !It && e === mp && Ot("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 = rg(); return computed(() => unref(t13) || `${r.value}-id-${e.prefix}-${e.current++}`); }; var si = []; var dm = (t13) => { const e = t13; e.key === Rt.esc && si.forEach((r) => r(e)); }; var VR = (t13) => { onMounted(() => { si.length === 0 && document.addEventListener("keydown", dm), It && si.push(t13); }), onBeforeUnmount(() => { si = si.filter((e) => e !== t13), si.length === 0 && It && document.removeEventListener("keydown", dm); }); }; var fm; var v2 = () => { const t13 = rg(), e = f2(), r = computed(() => `${t13.value}-popper-container-${e.prefix}`), n = computed(() => `#${r.value}`); return { id: r, selector: n }; }; var HR = (t13) => { const e = document.createElement("div"); return e.id = t13, document.body.appendChild(e), e; }; var KR = () => { const { id: t13, selector: e } = v2(); return onBeforeMount(() => { It && (!fm || !document.body.querySelector(e.value)) && (fm = HR(t13.value)); }), { id: t13, selector: e }; }; var GR = rt({ showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 } }); var UR = ({ showAfter: t13, hideAfter: e, autoClose: r, open: n, close: a }) => { const { registerTimeout: i } = cm(), { registerTimeout: o, cancelTimeout: s } = cm(); return { onOpen: (c) => { i(() => { n(c); const d = unref(r); Ut(d) && d > 0 && o(() => { a(c); }, d); }, unref(t13)); }, onClose: (c) => { s(), i(() => { a(c); }, unref(e)); } }; }; var h2 = Symbol("elForwardRef"); var WR = (t13) => { provide(h2, { setForwardRef: (r) => { t13.value = r; } }); }; var jR = (t13) => ({ mounted(e) { t13(e); }, updated(e) { t13(e); }, unmounted() { t13(null); } }); var vm = { current: 0 }; var hm = ref(0); var p2 = 2e3; var pm = Symbol("elZIndexContextKey"); var g2 = Symbol("zIndexContextKey"); var y2 = (t13) => { const e = getCurrentInstance() ? inject(pm, vm) : vm, r = t13 || (getCurrentInstance() ? inject(g2, void 0) : void 0), n = computed(() => { const o = unref(r); return Ut(o) ? o : p2; }), a = computed(() => n.value + hm.value), i = () => (e.current++, hm.value = e.current, a.value); return !It && !inject(pm) && Ot("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`), { initialZIndex: n, currentZIndex: a, nextZIndex: i }; }; function YR(t13) { let e; function r() { if (t13.value == null) return; const { selectionStart: a, selectionEnd: i, value: o } = t13.value; if (a == null || i == null) return; const s = o.slice(0, Math.max(0, a)), u = o.slice(Math.max(0, i)); e = { selectionStart: a, selectionEnd: i, value: o, beforeTxt: s, afterTxt: u }; } function n() { if (t13.value == null || e == null) return; const { value: a } = t13.value, { beforeTxt: i, afterTxt: o, selectionStart: s } = e; if (i == null || o == null || s == null) return; let u = a.length; if (a.endsWith(o)) u = a.length - o.length; else if (a.startsWith(i)) u = i.length; else { const l = i[s - 1], c = a.indexOf(l, s - 1); c !== -1 && (u = c + 1); } t13.value.setSelectionRange(u, u); } return [r, n]; } var Di = Tl({ type: String, values: XE, required: false }); var m2 = Symbol("size"); var ZR = () => { const t13 = inject(m2, {}); return computed(() => unref(t13.size) || ""); }; function dg(t13, { beforeFocus: e, afterFocus: r, beforeBlur: n, afterBlur: a } = {}) { const i = getCurrentInstance(), { emit: o } = i, s = shallowRef(), u = ref(false), l = (f) => { cr(e) && e(f) || u.value || (u.value = true, o("focus", f), r == null || r()); }, c = (f) => { var h10; cr(n) && n(f) || f.relatedTarget && ((h10 = s.value) != null && h10.contains(f.relatedTarget)) || (u.value = false, o("blur", f), a == null || a()); }, d = () => { var f, h10; (f = s.value) != null && f.contains(document.activeElement) && s.value !== document.activeElement || (h10 = t13.value) == null || h10.focus(); }; return watch(s, (f) => { f && f.setAttribute("tabindex", "-1"); }), Ar(s, "focus", l, true), Ar(s, "blur", c, true), Ar(s, "click", d, true), false, { isFocused: u, wrapperRef: s, handleFocus: l, handleBlur: c }; } function b2({ afterComposition: t13, emit: e }) { const r = ref(false), n = (s) => { e == null || e("compositionstart", s), r.value = true; }, a = (s) => { var u; e == null || e("compositionupdate", s); const l = (u = s.target) == null ? void 0 : u.value, c = l[l.length - 1] || ""; r.value = !kD(c); }, i = (s) => { e == null || e("compositionend", s), r.value && (r.value = false, nextTick(() => t13(s))); }; return { isComposing: r, handleComposition: (s) => { s.type === "compositionend" ? i(s) : a(s); }, handleCompositionStart: n, handleCompositionUpdate: a, handleCompositionEnd: i }; } var w2 = Symbol("emptyValuesContextKey"); var XR = "use-empty-values"; var JR = ["", void 0, null]; var QR = void 0; var eL = rt({ emptyValues: Array, valueOnClear: { type: [String, Number, Boolean, Function], default: void 0, validator: (t13) => cr(t13) ? !t13() : !t13 } }); var tL = (t13, e) => { const r = getCurrentInstance() ? inject(w2, ref({})) : ref({}), n = computed(() => t13.emptyValues || r.value.emptyValues || JR), a = computed(() => cr(t13.valueOnClear) ? t13.valueOnClear() : t13.valueOnClear !== void 0 ? t13.valueOnClear : cr(r.value.valueOnClear) ? r.value.valueOnClear() : r.value.valueOnClear !== void 0 ? r.value.valueOnClear : QR), i = (o) => n.value.includes(o); return n.value.includes(a.value) || Ot(XR, "value-on-clear should be a value of empty-values"), { emptyValues: n, valueOnClear: a, isEmptyValue: i }; }; var rL = rt({ ariaLabel: String, ariaOrientation: { type: String, values: ["horizontal", "vertical", "undefined"] }, ariaControls: String }); var sa = (t13) => UE(rL, t13); var C2 = Symbol(); var ol = ref(); function fg(t13, e = void 0) { const r = getCurrentInstance() ? inject(C2, ol) : ol; return t13 ? computed(() => { var n, a; return (a = (n = r.value) == null ? void 0 : n[t13]) != null ? a : e; }) : r; } function nL(t13, e) { const r = fg(), n = Ge(t13, computed(() => { var s; return ((s = r.value) == null ? void 0 : s.namespace) || Bs; })), a = Uo(computed(() => { var s; return (s = r.value) == null ? void 0 : s.locale; })), i = y2(computed(() => { var s; return ((s = r.value) == null ? void 0 : s.zIndex) || p2; })), o = computed(() => { var s; return unref(e) || ((s = r.value) == null ? void 0 : s.size) || ""; }); return aL(computed(() => unref(r) || {})), { ns: n, locale: a, zIndex: i, size: o }; } var aL = (t13, e, r = false) => { var n; const a = !!getCurrentInstance(), i = a ? fg() : void 0, o = (n = void 0) != null ? n : a ? provide : void 0; if (!o) { Ot("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup()."); return; } const s = computed(() => { const u = unref(t13); return i != null && i.value ? iL(i.value, u) : u; }); return o(C2, s), o(JE, computed(() => s.value.locale)), o(QE, computed(() => s.value.namespace)), o(g2, computed(() => s.value.zIndex)), o(m2, { size: computed(() => s.value.size || "") }), o(w2, computed(() => ({ emptyValues: s.value.emptyValues, valueOnClear: s.value.valueOnClear }))), (r || !ol.value) && (ol.value = s.value), s; }; var iL = (t13, e) => { const r = [.../* @__PURE__ */ new Set([...em(t13), ...em(e)])], n = {}; for (const a of r) n[a] = e[a] !== void 0 ? e[a] : t13[a]; return n; }; var Ke = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var oL = rt({ size: { type: qe([Number, String]) }, color: { type: String } }); var sL = defineComponent({ name: "ElIcon", inheritAttrs: false }); var lL = defineComponent({ ...sL, props: oL, setup(t13) { const e = t13, r = Ge("icon"), n = computed(() => { const { size: a, color: i } = e; return !a && !i ? {} : { fontSize: Un(a) ? void 0 : wi(a), "--color": i }; }); return (a, i) => (openBlock(), createElementBlock("i", mergeProps({ class: unref(r).b(), style: unref(n) }, a.$attrs), [ renderSlot(a.$slots, "default") ], 16)); } }); var uL = Ke(lL, [["__file", "icon.vue"]]); var Ft = Vt(uL); var vg = Symbol("formContextKey"); var Io = Symbol("formItemContextKey"); var Oa = (t13, e = {}) => { const r = ref(void 0), n = e.prop ? r : e2("size"), a = e.global ? r : ZR(), i = e.form ? { size: void 0 } : inject(vg, void 0), o = e.formItem ? { size: void 0 } : inject(Io, void 0); return computed(() => n.value || unref(t13) || (o == null ? void 0 : o.size) || (i == null ? void 0 : i.size) || a.value || ""); }; var Yo = (t13) => { const e = e2("disabled"), r = inject(vg, void 0); return computed(() => e.value || unref(t13) || (r == null ? void 0 : r.disabled) || false); }; var Va = () => { const t13 = inject(vg, void 0), e = inject(Io, void 0); return { form: t13, formItem: e }; }; var Zo = (t13, { formItemContext: e, disableIdGeneration: r, disableIdManagement: n }) => { r || (r = ref(false)), n || (n = ref(false)); const a = ref(); let i; const o = computed(() => { var s; return !!(!(t13.label || t13.ariaLabel) && e && e.inputIds && ((s = e.inputIds) == null ? void 0 : s.length) <= 1); }); return onMounted(() => { i = watch([toRef(t13, "id"), r], ([s, u]) => { const l = s ?? (u ? void 0 : Al().value); l !== a.value && (e != null && e.removeInputId && (a.value && e.removeInputId(a.value), !(n != null && n.value) && !u && l && e.addInputId(l)), a.value = l); }, { immediate: true }); }), onUnmounted(() => { i && i(), e != null && e.removeInputId && a.value && e.removeInputId(a.value); }), { isLabeledByFormItem: o, inputId: a }; }; var qr; var cL = ` height:0 !important; visibility:hidden !important; ${wI() ? "" : "overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `; var dL = [ "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 fL(t13) { const e = window.getComputedStyle(t13), r = e.getPropertyValue("box-sizing"), n = Number.parseFloat(e.getPropertyValue("padding-bottom")) + Number.parseFloat(e.getPropertyValue("padding-top")), a = Number.parseFloat(e.getPropertyValue("border-bottom-width")) + Number.parseFloat(e.getPropertyValue("border-top-width")); return { contextStyle: dL.map((o) => `${o}:${e.getPropertyValue(o)}`).join(";"), paddingSize: n, borderSize: a, boxSizing: r }; } function gm(t13, e = 1, r) { var n; qr || (qr = document.createElement("textarea"), document.body.appendChild(qr)); const { paddingSize: a, borderSize: i, boxSizing: o, contextStyle: s } = fL(t13); qr.setAttribute("style", `${s};${cL}`), qr.value = t13.value || t13.placeholder || ""; let u = qr.scrollHeight; const l = {}; o === "border-box" ? u = u + i : o === "content-box" && (u = u - a), qr.value = ""; const c = qr.scrollHeight - a; if (Ut(e)) { let d = c * e; o === "border-box" && (d = d + a + i), u = Math.max(d, u), l.minHeight = `${d}px`; } if (Ut(r)) { let d = c * r; o === "border-box" && (d = d + a + i), u = Math.min(d, u); } return l.height = `${u}px`, (n = qr.parentNode) == null || n.removeChild(qr), qr = void 0, l; } var vL = rt({ id: { type: String, default: void 0 }, size: Di, disabled: Boolean, modelValue: { type: qe([ 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: qe([Boolean, Object]), default: false }, autocomplete: { type: String, default: "off" }, formatter: { type: Function }, parser: { type: Function }, placeholder: { type: String }, form: { type: String }, readonly: Boolean, clearable: Boolean, showPassword: Boolean, showWordLimit: Boolean, suffixIcon: { type: Qn }, prefixIcon: { type: Qn }, containerRole: { type: String, default: void 0 }, tabindex: { type: [String, Number], default: 0 }, validateEvent: { type: Boolean, default: true }, inputStyle: { type: qe([Object, Array, String]), default: () => oi({}) }, autofocus: Boolean, rows: { type: Number, default: 2 }, ...sa(["ariaLabel"]) }); var hL = { [Kt]: (t13) => nr(t13), input: (t13) => nr(t13), change: (t13) => nr(t13), focus: (t13) => t13 instanceof FocusEvent, blur: (t13) => t13 instanceof FocusEvent, clear: () => true, mouseleave: (t13) => t13 instanceof MouseEvent, mouseenter: (t13) => t13 instanceof MouseEvent, keydown: (t13) => t13 instanceof Event, compositionstart: (t13) => t13 instanceof CompositionEvent, compositionupdate: (t13) => t13 instanceof CompositionEvent, compositionend: (t13) => t13 instanceof CompositionEvent }; var pL = defineComponent({ name: "ElInput", inheritAttrs: false }); var gL = defineComponent({ ...pL, props: vL, emits: hL, setup(t13, { expose: e, emit: r }) { const n = t13, a = useAttrs(), i = useSlots(), o = computed(() => { const I = {}; return n.containerRole === "combobox" && (I["aria-haspopup"] = a["aria-haspopup"], I["aria-owns"] = a["aria-owns"], I["aria-expanded"] = a["aria-expanded"]), I; }), s = computed(() => [ n.type === "textarea" ? g.b() : p.b(), p.m(h10.value), p.is("disabled", v.value), p.is("exceed", ne.value), { [p.b("group")]: i.prepend || i.append, [p.m("prefix")]: i.prefix || n.prefixIcon, [p.m("suffix")]: i.suffix || n.suffixIcon || n.clearable || n.showPassword, [p.bm("suffix", "password-clear")]: V.value && Y.value, [p.b("hidden")]: n.type === "hidden" }, a.class ]), u = computed(() => [ p.e("wrapper"), p.is("focus", S.value) ]), l = ID({ excludeKeys: computed(() => Object.keys(o.value)) }), { form: c, formItem: d } = Va(), { inputId: f } = Zo(n, { formItemContext: d }), h10 = Oa(), v = Yo(), p = Ge("input"), g = Ge("textarea"), y = shallowRef(), m = shallowRef(), b = ref(false), w = ref(false), x = ref(), E = shallowRef(n.inputStyle), C = computed(() => y.value || m.value), { wrapperRef: k, isFocused: S, handleFocus: _, handleBlur: T } = dg(C, { beforeFocus() { return v.value; }, afterBlur() { var I; n.validateEvent && ((I = d == null ? void 0 : d.validate) == null || I.call(d, "blur").catch((G) => Ot(G))); } }), O = computed(() => { var I; return (I = c == null ? void 0 : c.statusIcon) != null ? I : false; }), D = computed(() => (d == null ? void 0 : d.validateState) || ""), A = computed(() => D.value && ZE[D.value]), F = computed(() => w.value ? view_default : hide_default), R = computed(() => [ a.style ]), M = computed(() => [ n.inputStyle, E.value, { resize: n.resize } ]), L = computed(() => Yn(n.modelValue) ? "" : String(n.modelValue)), V = computed(() => n.clearable && !v.value && !n.readonly && !!L.value && (S.value || b.value)), Y = computed(() => n.showPassword && !v.value && !n.readonly && !!L.value && (!!L.value || S.value)), H = computed(() => n.showWordLimit && !!n.maxlength && (n.type === "text" || n.type === "textarea") && !v.value && !n.readonly && !n.showPassword), K = computed(() => L.value.length), ne = computed(() => !!H.value && K.value > Number(n.maxlength)), B = computed(() => !!i.suffix || !!n.suffixIcon || V.value || n.showPassword || H.value || !!D.value && O.value), [$, z] = YR(y); bn(m, (I) => { if (N(), !H.value || n.resize !== "both") return; const G = I[0], { width: se } = G.contentRect; x.value = { right: `calc(100% - ${se + 15 + 6}px)` }; }); const W = () => { const { type: I, autosize: G } = n; if (!(!It || I !== "textarea" || !m.value)) if (G) { const se = Gt(G) ? G.minRows : void 0, ee = Gt(G) ? G.maxRows : void 0, te = gm(m.value, se, ee); E.value = { overflowY: "hidden", ...te }, nextTick(() => { m.value.offsetHeight, E.value = te; }); } else E.value = { minHeight: gm(m.value).minHeight }; }, N = /* @__PURE__ */ ((I) => { let G = false; return () => { var se; if (G || !n.autosize) return; ((se = m.value) == null ? void 0 : se.offsetParent) === null || (I(), G = true); }; })(W), X = () => { const I = C.value, G = n.formatter ? n.formatter(L.value) : L.value; !I || I.value === G || (I.value = G); }, Q = async (I) => { $(); let { value: G } = I.target; if (n.formatter && (G = n.parser ? n.parser(G) : G), !we.value) { if (G === L.value) { X(); return; } r(Kt, G), r("input", G), await nextTick(), X(), z(); } }, ge = (I) => { r("change", I.target.value); }, { isComposing: we, handleCompositionStart: fe, handleCompositionUpdate: ce, handleCompositionEnd: be } = b2({ emit: r, afterComposition: Q }), ve = () => { w.value = !w.value, xe(); }, xe = async () => { var I; await nextTick(), (I = C.value) == null || I.focus(); }, _e = () => { var I; return (I = C.value) == null ? void 0 : I.blur(); }, He = (I) => { b.value = false, r("mouseleave", I); }, Ve = (I) => { b.value = true, r("mouseenter", I); }, De = (I) => { r("keydown", I); }, Ne = () => { var I; (I = C.value) == null || I.select(); }, ue = () => { r(Kt, ""), r("change", ""), r("clear"), r("input", ""); }; return watch(() => n.modelValue, () => { var I; nextTick(() => W()), n.validateEvent && ((I = d == null ? void 0 : d.validate) == null || I.call(d, "change").catch((G) => Ot(G))); }), watch(L, () => X()), watch(() => n.type, async () => { await nextTick(), X(), W(); }), onMounted(() => { !n.formatter && n.parser && Ot("ElInput", "If you set the parser, you also need to set the formatter."), X(), nextTick(W); }), e({ input: y, textarea: m, ref: C, textareaStyle: M, autosize: toRef(n, "autosize"), isComposing: we, focus: xe, blur: _e, select: Ne, clear: ue, resizeTextarea: W }), (I, G) => (openBlock(), createElementBlock("div", mergeProps(unref(o), { class: [ unref(s), { [unref(p).bm("group", "append")]: I.$slots.append, [unref(p).bm("group", "prepend")]: I.$slots.prepend } ], style: unref(R), role: I.containerRole, onMouseenter: Ve, onMouseleave: He }), [ createCommentVNode(" input "), I.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createCommentVNode(" prepend slot "), I.$slots.prepend ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(p).be("group", "prepend")) }, [ renderSlot(I.$slots, "prepend") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref_key: "wrapperRef", ref: k, class: normalizeClass(unref(u)) }, [ createCommentVNode(" prefix slot "), I.$slots.prefix || I.prefixIcon ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(p).e("prefix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("prefix-inner")) }, [ renderSlot(I.$slots, "prefix"), I.prefixIcon ? (openBlock(), createBlock(unref(Ft), { key: 0, class: normalizeClass(unref(p).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(I.prefixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("input", mergeProps({ id: unref(f), ref_key: "input", ref: y, class: unref(p).e("inner") }, unref(l), { minlength: I.minlength, maxlength: I.maxlength, type: I.showPassword ? w.value ? "text" : "password" : I.type, disabled: unref(v), readonly: I.readonly, autocomplete: I.autocomplete, tabindex: I.tabindex, "aria-label": I.ariaLabel, placeholder: I.placeholder, style: I.inputStyle, form: I.form, autofocus: I.autofocus, onCompositionstart: unref(fe), onCompositionupdate: unref(ce), onCompositionend: unref(be), onInput: Q, onChange: ge, onKeydown: De }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "onCompositionstart", "onCompositionupdate", "onCompositionend"]), createCommentVNode(" suffix slot "), unref(B) ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(unref(p).e("suffix")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("suffix-inner")) }, [ !unref(V) || !unref(Y) || !unref(H) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ renderSlot(I.$slots, "suffix"), I.suffixIcon ? (openBlock(), createBlock(unref(Ft), { key: 0, class: normalizeClass(unref(p).e("icon")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(I.suffixIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 64)) : createCommentVNode("v-if", true), unref(V) ? (openBlock(), createBlock(unref(Ft), { key: 1, class: normalizeClass([unref(p).e("icon"), unref(p).e("clear")]), onMousedown: withModifiers(unref(Eo), ["prevent"]), onClick: ue }, { default: withCtx(() => [ createVNode(unref(circle_close_default)) ]), _: 1 }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true), unref(Y) ? (openBlock(), createBlock(unref(Ft), { key: 2, class: normalizeClass([unref(p).e("icon"), unref(p).e("password")]), onClick: ve }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(F)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), unref(H) ? (openBlock(), createElementBlock("span", { key: 3, class: normalizeClass(unref(p).e("count")) }, [ createBaseVNode("span", { class: normalizeClass(unref(p).e("count-inner")) }, toDisplayString(unref(K)) + " / " + toDisplayString(I.maxlength), 3) ], 2)) : createCommentVNode("v-if", true), unref(D) && unref(A) && unref(O) ? (openBlock(), createBlock(unref(Ft), { key: 4, class: normalizeClass([ unref(p).e("icon"), unref(p).e("validateIcon"), unref(p).is("loading", unref(D) === "validating") ]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(unref(A)))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 2)) : createCommentVNode("v-if", true) ], 2), createCommentVNode(" append slot "), I.$slots.append ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(p).be("group", "append")) }, [ renderSlot(I.$slots, "append") ], 2)) : createCommentVNode("v-if", true) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createCommentVNode(" textarea "), createBaseVNode("textarea", mergeProps({ id: unref(f), ref_key: "textarea", ref: m, class: [unref(g).e("inner"), unref(p).is("focus", unref(S))] }, unref(l), { minlength: I.minlength, maxlength: I.maxlength, tabindex: I.tabindex, disabled: unref(v), readonly: I.readonly, autocomplete: I.autocomplete, style: unref(M), "aria-label": I.ariaLabel, placeholder: I.placeholder, form: I.form, autofocus: I.autofocus, rows: I.rows, onCompositionstart: unref(fe), onCompositionupdate: unref(ce), onCompositionend: unref(be), onInput: Q, onFocus: unref(_), onBlur: unref(T), onChange: ge, onKeydown: De }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]), unref(H) ? (openBlock(), createElementBlock("span", { key: 0, style: normalizeStyle(x.value), class: normalizeClass(unref(p).e("count")) }, toDisplayString(unref(K)) + " / " + toDisplayString(I.maxlength), 7)) : createCommentVNode("v-if", true) ], 64)) ], 16, ["role"])); } }); var yL = Ke(gL, [["__file", "input.vue"]]); var Xo = Vt(yL); var Ja = 4; var mL = { vertical: { offset: "offsetHeight", scroll: "scrollTop", scrollSize: "scrollHeight", size: "height", key: "vertical", axis: "Y", client: "clientY", direction: "top" }, horizontal: { offset: "offsetWidth", scroll: "scrollLeft", scrollSize: "scrollWidth", size: "width", key: "horizontal", axis: "X", client: "clientX", direction: "left" } }; var bL = ({ move: t13, size: e, bar: r }) => ({ [r.size]: e, transform: `translate${r.axis}(${t13}%)` }); var hg = Symbol("scrollbarContextKey"); var wL = rt({ vertical: Boolean, size: String, move: Number, ratio: { type: Number, required: true }, always: Boolean }); var CL = "Thumb"; var xL = defineComponent({ __name: "thumb", props: wL, setup(t13) { const e = t13, r = inject(hg), n = Ge("scrollbar"); r || wD(CL, "can not inject scrollbar context"); const a = ref(), i = ref(), o = ref({}), s = ref(false); let u = false, l = false, c = It ? document.onselectstart : null; const d = computed(() => mL[e.vertical ? "vertical" : "horizontal"]), f = computed(() => bL({ size: e.size, move: e.move, bar: d.value })), h10 = computed(() => a.value[d.value.offset] ** 2 / r.wrapElement[d.value.scrollSize] / e.ratio / i.value[d.value.offset]), v = (E) => { var C; if (E.stopPropagation(), E.ctrlKey || [1, 2].includes(E.button)) return; (C = window.getSelection()) == null || C.removeAllRanges(), g(E); const k = E.currentTarget; k && (o.value[d.value.axis] = k[d.value.offset] - (E[d.value.client] - k.getBoundingClientRect()[d.value.direction])); }, p = (E) => { if (!i.value || !a.value || !r.wrapElement) return; const C = Math.abs(E.target.getBoundingClientRect()[d.value.direction] - E[d.value.client]), k = i.value[d.value.offset] / 2, S = (C - k) * 100 * h10.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = S * r.wrapElement[d.value.scrollSize] / 100; }, g = (E) => { E.stopImmediatePropagation(), u = true, document.addEventListener("mousemove", y), document.addEventListener("mouseup", m), c = document.onselectstart, document.onselectstart = () => false; }, y = (E) => { if (!a.value || !i.value || u === false) return; const C = o.value[d.value.axis]; if (!C) return; const k = (a.value.getBoundingClientRect()[d.value.direction] - E[d.value.client]) * -1, S = i.value[d.value.offset] - C, _ = (k - S) * 100 * h10.value / a.value[d.value.offset]; r.wrapElement[d.value.scroll] = _ * r.wrapElement[d.value.scrollSize] / 100; }, m = () => { u = false, o.value[d.value.axis] = 0, document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", m), x(), l && (s.value = false); }, b = () => { l = false, s.value = !!e.size; }, w = () => { l = true, s.value = u; }; onBeforeUnmount(() => { x(), document.removeEventListener("mouseup", m); }); const x = () => { document.onselectstart !== c && (document.onselectstart = c); }; return Ar(toRef(r, "scrollbarElement"), "mousemove", b), Ar(toRef(r, "scrollbarElement"), "mouseleave", w), (E, C) => (openBlock(), createBlock(Transition, { name: unref(n).b("fade"), persisted: "" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", { ref_key: "instance", ref: a, class: normalizeClass([unref(n).e("bar"), unref(n).is(unref(d).key)]), onMousedown: p }, [ createBaseVNode("div", { ref_key: "thumb", ref: i, class: normalizeClass(unref(n).e("thumb")), style: normalizeStyle(unref(f)), onMousedown: v }, null, 38) ], 34), [ [vShow, E.always || s.value] ]) ]), _: 1 }, 8, ["name"])); } }); var ym = Ke(xL, [["__file", "thumb.vue"]]); var EL = rt({ always: { type: Boolean, default: true }, minSize: { type: Number, required: true } }); var SL = defineComponent({ __name: "bar", props: EL, setup(t13, { expose: e }) { const r = t13, n = inject(hg), a = ref(0), i = ref(0), o = ref(""), s = ref(""), u = ref(1), l = ref(1); return e({ handleScroll: (f) => { if (f) { const h10 = f.offsetHeight - Ja, v = f.offsetWidth - Ja; i.value = f.scrollTop * 100 / h10 * u.value, a.value = f.scrollLeft * 100 / v * l.value; } }, update: () => { const f = n == null ? void 0 : n.wrapElement; if (!f) return; const h10 = f.offsetHeight - Ja, v = f.offsetWidth - Ja, p = h10 ** 2 / f.scrollHeight, g = v ** 2 / f.scrollWidth, y = Math.max(p, r.minSize), m = Math.max(g, r.minSize); u.value = p / (h10 - p) / (y / (h10 - y)), l.value = g / (v - g) / (m / (v - m)), s.value = y + Ja < h10 ? `${y}px` : "", o.value = m + Ja < v ? `${m}px` : ""; } }), (f, h10) => (openBlock(), createElementBlock(Fragment, null, [ createVNode(ym, { move: a.value, ratio: l.value, size: o.value, always: f.always }, null, 8, ["move", "ratio", "size", "always"]), createVNode(ym, { move: i.value, ratio: u.value, size: s.value, vertical: "", always: f.always }, null, 8, ["move", "ratio", "size", "always"]) ], 64)); } }); var kL = Ke(SL, [["__file", "bar.vue"]]); var _L = rt({ height: { type: [String, Number], default: "" }, maxHeight: { type: [String, Number], default: "" }, native: { type: Boolean, default: false }, wrapStyle: { type: qe([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, ...sa(["ariaLabel", "ariaOrientation"]) }); var TL = { scroll: ({ scrollTop: t13, scrollLeft: e }) => [t13, e].every(Ut) }; var bp = "ElScrollbar"; var IL = defineComponent({ name: bp }); var OL = defineComponent({ ...IL, props: _L, emits: TL, setup(t13, { expose: e, emit: r }) { const n = t13, a = Ge("scrollbar"); let i, o, s = 0, u = 0; const l = ref(), c = ref(), d = ref(), f = ref(), h10 = computed(() => { const x = {}; return n.height && (x.height = wi(n.height)), n.maxHeight && (x.maxHeight = wi(n.maxHeight)), [n.wrapStyle, x]; }), v = computed(() => [ n.wrapClass, a.e("wrap"), { [a.em("wrap", "hidden-default")]: !n.native } ]), p = computed(() => [a.e("view"), n.viewClass]), g = () => { var x; c.value && ((x = f.value) == null || x.handleScroll(c.value), s = c.value.scrollTop, u = c.value.scrollLeft, r("scroll", { scrollTop: c.value.scrollTop, scrollLeft: c.value.scrollLeft })); }; function y(x, E) { Gt(x) ? c.value.scrollTo(x) : Ut(x) && Ut(E) && c.value.scrollTo(x, E); } const m = (x) => { if (!Ut(x)) { Ot(bp, "value must be a number"); return; } c.value.scrollTop = x; }, b = (x) => { if (!Ut(x)) { Ot(bp, "value must be a number"); return; } c.value.scrollLeft = x; }, w = () => { var x; (x = f.value) == null || x.update(); }; return watch(() => n.noresize, (x) => { x ? (i == null || i(), o == null || o()) : ({ stop: i } = bn(d, w), o = Ar("resize", w)); }, { immediate: true }), watch(() => [n.maxHeight, n.height], () => { n.native || nextTick(() => { var x; w(), c.value && ((x = f.value) == null || x.handleScroll(c.value)); }); }), provide(hg, reactive({ scrollbarElement: l, wrapElement: c })), onActivated(() => { c.value && (c.value.scrollTop = s, c.value.scrollLeft = u); }), onMounted(() => { n.native || nextTick(() => { w(); }); }), onUpdated(() => w()), e({ wrapRef: c, update: w, scrollTo: y, setScrollTop: m, setScrollLeft: b, handleScroll: g }), (x, E) => (openBlock(), createElementBlock("div", { ref_key: "scrollbarRef", ref: l, class: normalizeClass(unref(a).b()) }, [ createBaseVNode("div", { ref_key: "wrapRef", ref: c, class: normalizeClass(unref(v)), style: normalizeStyle(unref(h10)), tabindex: x.tabindex, onScroll: g }, [ (openBlock(), createBlock(resolveDynamicComponent(x.tag), { id: x.id, ref_key: "resizeRef", ref: d, class: normalizeClass(unref(p)), style: normalizeStyle(x.viewStyle), role: x.role, "aria-label": x.ariaLabel, "aria-orientation": x.ariaOrientation }, { default: withCtx(() => [ renderSlot(x.$slots, "default") ]), _: 3 }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"])) ], 46, ["tabindex"]), x.native ? createCommentVNode("v-if", true) : (openBlock(), createBlock(kL, { key: 0, ref_key: "barRef", ref: f, always: x.always, "min-size": x.minSize }, null, 8, ["always", "min-size"])) ], 2)); } }); var AL = Ke(OL, [["__file", "scrollbar.vue"]]); var PL = Vt(AL); var pg = Symbol("popper"); var x2 = Symbol("popperContent"); var DL = [ "dialog", "grid", "group", "listbox", "menu", "navigation", "tooltip", "tree" ]; var E2 = rt({ role: { type: String, values: DL, default: "tooltip" } }); var RL = defineComponent({ name: "ElPopper", inheritAttrs: false }); var LL = defineComponent({ ...RL, props: E2, setup(t13, { expose: e }) { const r = t13, n = ref(), a = ref(), i = ref(), o = ref(), s = computed(() => r.role), u = { triggerRef: n, popperInstanceRef: a, contentRef: i, referenceRef: o, role: s }; return e(u), provide(pg, u), (l, c) => renderSlot(l.$slots, "default"); } }); var FL = Ke(LL, [["__file", "popper.vue"]]); var S2 = rt({ arrowOffset: { type: Number, default: 5 } }); var ML = defineComponent({ name: "ElPopperArrow", inheritAttrs: false }); var NL = defineComponent({ ...ML, props: S2, setup(t13, { expose: e }) { const r = t13, n = Ge("popper"), { arrowOffset: a, arrowRef: i, arrowStyle: o } = inject(x2, void 0); return watch(() => r.arrowOffset, (s) => { a.value = s; }), onBeforeUnmount(() => { i.value = void 0; }), e({ arrowRef: i }), (s, u) => (openBlock(), createElementBlock("span", { ref_key: "arrowRef", ref: i, class: normalizeClass(unref(n).e("arrow")), style: normalizeStyle(unref(o)), "data-popper-arrow": "" }, null, 6)); } }); var BL = Ke(NL, [["__file", "arrow.vue"]]); var Cu = "ElOnlyChild"; var $L = defineComponent({ name: Cu, setup(t13, { slots: e, attrs: r }) { var n; const a = inject(h2), i = jR((n = a == null ? void 0 : a.setForwardRef) != null ? n : Eo); return () => { var o; const s = (o = e.default) == null ? void 0 : o.call(e, r); if (!s) return null; if (s.length > 1) return Ot(Cu, "requires exact only one valid child."), null; const u = k2(s); return u ? withDirectives(cloneVNode(u, r), [[i]]) : (Ot(Cu, "no valid child node found"), null); }; } }); function k2(t13) { if (!t13) return null; const e = t13; for (const r of e) { if (Gt(r)) switch (r.type) { case Comment: continue; case Text: case "svg": return mm(r); case Fragment: return k2(r.children); default: return r; } return mm(r); } return null; } function mm(t13) { const e = Ge("only-child"); return createVNode("span", { class: e.e("content") }, [t13]); } var _2 = rt({ virtualRef: { type: qe(Object) }, virtualTriggering: Boolean, onMouseenter: { type: qe(Function) }, onMouseleave: { type: qe(Function) }, onClick: { type: qe(Function) }, onKeydown: { type: qe(Function) }, onFocus: { type: qe(Function) }, onBlur: { type: qe(Function) }, onContextmenu: { type: qe(Function) }, id: String, open: Boolean }); var qL = defineComponent({ name: "ElPopperTrigger", inheritAttrs: false }); var zL = defineComponent({ ...qL, props: _2, setup(t13, { expose: e }) { const r = t13, { role: n, triggerRef: a } = inject(pg, void 0); WR(a); const i = computed(() => s.value ? r.id : void 0), o = computed(() => { if (n && n.value === "tooltip") return r.open && r.id ? r.id : void 0; }), s = computed(() => { if (n && n.value !== "tooltip") return n.value; }), u = computed(() => s.value ? `${r.open}` : void 0); let l; const c = [ "onMouseenter", "onMouseleave", "onClick", "onKeydown", "onFocus", "onBlur", "onContextmenu" ]; return onMounted(() => { watch(() => r.virtualRef, (d) => { d && (a.value = Cn(d)); }, { immediate: true }), watch(a, (d, f) => { l == null || l(), l = void 0, Ea(d) && (c.forEach((h10) => { var v; const p = r[h10]; p && (d.addEventListener(h10.slice(2).toLowerCase(), p), (v = f == null ? void 0 : f.removeEventListener) == null || v.call(f, h10.slice(2).toLowerCase(), p)); }), l = watch([i, o, s, u], (h10) => { [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((v, p) => { Yn(h10[p]) ? d.removeAttribute(v) : d.setAttribute(v, h10[p]); }); }, { immediate: true })), Ea(f) && [ "aria-controls", "aria-describedby", "aria-haspopup", "aria-expanded" ].forEach((h10) => f.removeAttribute(h10)); }, { immediate: true }); }), onBeforeUnmount(() => { if (l == null || l(), l = void 0, a.value && Ea(a.value)) { const d = a.value; c.forEach((f) => { const h10 = r[f]; h10 && d.removeEventListener(f.slice(2).toLowerCase(), h10); }), a.value = void 0; } }), e({ triggerRef: a }), (d, f) => d.virtualTriggering ? createCommentVNode("v-if", true) : (openBlock(), createBlock(unref($L), mergeProps({ key: 0 }, d.$attrs, { "aria-controls": unref(i), "aria-describedby": unref(o), "aria-expanded": unref(u), "aria-haspopup": unref(s) }), { default: withCtx(() => [ renderSlot(d.$slots, "default") ]), _: 3 }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])); } }); var VL = Ke(zL, [["__file", "trigger.vue"]]); var xu = "focus-trap.focus-after-trapped"; var Eu = "focus-trap.focus-after-released"; var HL = "focus-trap.focusout-prevented"; var bm = { cancelable: true, bubbles: false }; var KL = { cancelable: true, bubbles: false }; var wm = "focusAfterTrapped"; var Cm = "focusAfterReleased"; var GL = Symbol("elFocusTrap"); var gg = ref(); var Pl = ref(0); var yg = ref(0); var ms = 0; var T2 = (t13) => { const e = [], r = document.createTreeWalker(t13, NodeFilter.SHOW_ELEMENT, { acceptNode: (n) => { const a = n.tagName === "INPUT" && n.type === "hidden"; return n.disabled || n.hidden || a ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 || n === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); for (; r.nextNode(); ) e.push(r.currentNode); return e; }; var xm = (t13, e) => { for (const r of t13) if (!UL(r, e)) return r; }; var UL = (t13, e) => { if (false) return false; if (getComputedStyle(t13).visibility === "hidden") return true; for (; t13; ) { if (e && t13 === e) return false; if (getComputedStyle(t13).display === "none") return true; t13 = t13.parentElement; } return false; }; var WL = (t13) => { const e = T2(t13), r = xm(e, t13), n = xm(e.reverse(), t13); return [r, n]; }; var jL = (t13) => t13 instanceof HTMLInputElement && "select" in t13; var zn = (t13, e) => { if (t13 && t13.focus) { const r = document.activeElement; t13.focus({ preventScroll: true }), yg.value = window.performance.now(), t13 !== r && jL(t13) && e && t13.select(); } }; function Em(t13, e) { const r = [...t13], n = t13.indexOf(e); return n !== -1 && r.splice(n, 1), r; } var YL = () => { let t13 = []; return { push: (n) => { const a = t13[0]; a && n !== a && a.pause(), t13 = Em(t13, n), t13.unshift(n); }, remove: (n) => { var a, i; t13 = Em(t13, n), (i = (a = t13[0]) == null ? void 0 : a.resume) == null || i.call(a); } }; }; var ZL = (t13, e = false) => { const r = document.activeElement; for (const n of t13) if (zn(n, e), document.activeElement !== r) return; }; var Sm = YL(); var XL = () => Pl.value > yg.value; var bs = () => { gg.value = "pointer", Pl.value = window.performance.now(); }; var km = () => { gg.value = "keyboard", Pl.value = window.performance.now(); }; var JL = () => (onMounted(() => { ms === 0 && (document.addEventListener("mousedown", bs), document.addEventListener("touchstart", bs), document.addEventListener("keydown", km)), ms++; }), onBeforeUnmount(() => { ms--, ms <= 0 && (document.removeEventListener("mousedown", bs), document.removeEventListener("touchstart", bs), document.removeEventListener("keydown", km)); }), { focusReason: gg, lastUserFocusTimestamp: Pl, lastAutomatedFocusTimestamp: yg }); var ws = (t13) => new CustomEvent(HL, { ...KL, detail: t13 }); var QL = defineComponent({ name: "ElFocusTrap", inheritAttrs: false, props: { loop: Boolean, trapped: Boolean, focusTrapEl: Object, focusStartEl: { type: [Object, String], default: "first" } }, emits: [ wm, Cm, "focusin", "focusout", "focusout-prevented", "release-requested" ], setup(t13, { emit: e }) { const r = ref(); let n, a; const { focusReason: i } = JL(); VR((v) => { t13.trapped && !o.paused && e("release-requested", v); }); const o = { paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }, s = (v) => { if (!t13.loop && !t13.trapped || o.paused) return; const { key: p, altKey: g, ctrlKey: y, metaKey: m, currentTarget: b, shiftKey: w } = v, { loop: x } = t13, E = p === Rt.tab && !g && !y && !m, C = document.activeElement; if (E && C) { const k = b, [S, _] = WL(k); if (S && _) { if (!w && C === _) { const O = ws({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || (v.preventDefault(), x && zn(S, true)); } else if (w && [S, k].includes(C)) { const O = ws({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || (v.preventDefault(), x && zn(_, true)); } } else if (C === k) { const O = ws({ focusReason: i.value }); e("focusout-prevented", O), O.defaultPrevented || v.preventDefault(); } } }; provide(GL, { focusTrapRef: r, onKeydown: s }), watch(() => t13.focusTrapEl, (v) => { v && (r.value = v); }, { immediate: true }), watch([r], ([v], [p]) => { v && (v.addEventListener("keydown", s), v.addEventListener("focusin", c), v.addEventListener("focusout", d)), p && (p.removeEventListener("keydown", s), p.removeEventListener("focusin", c), p.removeEventListener("focusout", d)); }); const u = (v) => { e(wm, v); }, l = (v) => e(Cm, v), c = (v) => { const p = unref(r); if (!p) return; const g = v.target, y = v.relatedTarget, m = g && p.contains(g); t13.trapped || y && p.contains(y) || (n = y), m && e("focusin", v), !o.paused && t13.trapped && (m ? a = g : zn(a, true)); }, d = (v) => { const p = unref(r); if (!(o.paused || !p)) if (t13.trapped) { const g = v.relatedTarget; !Yn(g) && !p.contains(g) && setTimeout(() => { if (!o.paused && t13.trapped) { const y = ws({ focusReason: i.value }); e("focusout-prevented", y), y.defaultPrevented || zn(a, true); } }, 0); } else { const g = v.target; g && p.contains(g) || e("focusout", v); } }; async function f() { await nextTick(); const v = unref(r); if (v) { Sm.push(o); const p = v.contains(document.activeElement) ? n : document.activeElement; if (n = p, !v.contains(p)) { const y = new Event(xu, bm); v.addEventListener(xu, u), v.dispatchEvent(y), y.defaultPrevented || nextTick(() => { let m = t13.focusStartEl; nr(m) || (zn(m), document.activeElement !== m && (m = "first")), m === "first" && ZL(T2(v), true), (document.activeElement === p || m === "container") && zn(v); }); } } } function h10() { const v = unref(r); if (v) { v.removeEventListener(xu, u); const p = new CustomEvent(Eu, { ...bm, detail: { focusReason: i.value } }); v.addEventListener(Eu, l), v.dispatchEvent(p), !p.defaultPrevented && (i.value == "keyboard" || !XL() || v.contains(document.activeElement)) && zn(n ?? document.body), v.removeEventListener(Eu, l), Sm.remove(o); } } return onMounted(() => { t13.trapped && f(), watch(() => t13.trapped, (v) => { v ? f() : h10(); }); }), onBeforeUnmount(() => { t13.trapped && h10(), r.value && (r.value.removeEventListener("keydown", s), r.value.removeEventListener("focusin", c), r.value.removeEventListener("focusout", d), r.value = void 0); }), { onKeydown: s }; } }); function eF(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default", { handleKeydown: t13.onKeydown }); } var tF = Ke(QL, [["render", eF], ["__file", "focus-trap.vue"]]); var rF = ["fixed", "absolute"]; var nF = rt({ boundariesPadding: { type: Number, default: 0 }, fallbackPlacements: { type: qe(Array), default: void 0 }, gpuAcceleration: { type: Boolean, default: true }, offset: { type: Number, default: 12 }, placement: { type: String, values: Il, default: "bottom" }, popperOptions: { type: qe(Object), default: () => ({}) }, strategy: { type: String, values: rF, default: "absolute" } }); var I2 = rt({ ...nF, id: String, style: { type: qe([String, Array, Object]) }, className: { type: qe([String, Array, Object]) }, effect: { type: qe(String), default: "dark" }, visible: Boolean, enterable: { type: Boolean, default: true }, pure: Boolean, focusOnShow: { type: Boolean, default: false }, trapping: { type: Boolean, default: false }, popperClass: { type: qe([String, Array, Object]) }, popperStyle: { type: qe([String, Array, Object]) }, referenceEl: { type: qe(Object) }, triggerTargetEl: { type: qe(Object) }, stopPopperMouseEvent: { type: Boolean, default: true }, virtualTriggering: Boolean, zIndex: Number, ...sa(["ariaLabel"]) }); var aF = { mouseenter: (t13) => t13 instanceof MouseEvent, mouseleave: (t13) => t13 instanceof MouseEvent, focus: () => true, blur: () => true, close: () => true }; var iF = (t13, e = []) => { const { placement: r, strategy: n, popperOptions: a } = t13, i = { placement: r, strategy: n, ...a, modifiers: [...sF(t13), ...e] }; return lF(i, a == null ? void 0 : a.modifiers), i; }; var oF = (t13) => { if (It) return Cn(t13); }; function sF(t13) { const { offset: e, gpuAcceleration: r, fallbackPlacements: n } = t13; return [ { name: "offset", options: { offset: [0, e ?? 12] } }, { name: "preventOverflow", options: { padding: { top: 2, bottom: 2, left: 5, right: 5 } } }, { name: "flip", options: { padding: 5, fallbackPlacements: n } }, { name: "computeStyles", options: { gpuAcceleration: r } } ]; } function lF(t13, e) { e && (t13.modifiers = [...t13.modifiers, ...e ?? []]); } var uF = 0; var cF = (t13) => { const { popperInstanceRef: e, contentRef: r, triggerRef: n, role: a } = inject(pg, void 0), i = ref(), o = ref(), s = computed(() => ({ name: "eventListeners", enabled: !!t13.visible })), u = computed(() => { var y; const m = unref(i), b = (y = unref(o)) != null ? y : uF; return { name: "arrow", enabled: !hD(m), options: { element: m, padding: b } }; }), l = computed(() => ({ onFirstUpdate: () => { v(); }, ...iF(t13, [ unref(u), unref(s) ]) })), c = computed(() => oF(t13.referenceEl) || unref(n)), { attributes: d, state: f, styles: h10, update: v, forceUpdate: p, instanceRef: g } = $R(c, r, l); return watch(g, (y) => e.value = y), onMounted(() => { watch(() => { var y; return (y = unref(c)) == null ? void 0 : y.getBoundingClientRect(); }, () => { v(); }); }), { attributes: d, arrowRef: i, contentRef: r, instanceRef: g, state: f, styles: h10, role: a, forceUpdate: p, update: v }; }; var dF = (t13, { attributes: e, styles: r, role: n }) => { const { nextZIndex: a } = y2(), i = Ge("popper"), o = computed(() => unref(e).popper), s = ref(Ut(t13.zIndex) ? t13.zIndex : a()), u = computed(() => [ i.b(), i.is("pure", t13.pure), i.is(t13.effect), t13.popperClass ]), l = computed(() => [ { zIndex: unref(s) }, unref(r).popper, t13.popperStyle || {} ]), c = computed(() => n.value === "dialog" ? "false" : void 0), d = computed(() => unref(r).arrow || {}); return { ariaModal: c, arrowStyle: d, contentAttrs: o, contentClass: u, contentStyle: l, contentZIndex: s, updateZIndex: () => { s.value = Ut(t13.zIndex) ? t13.zIndex : a(); } }; }; var fF = (t13, e) => { const r = ref(false), n = ref(); return { focusStartRef: n, trapped: r, onFocusAfterReleased: (l) => { var c; ((c = l.detail) == null ? void 0 : c.focusReason) !== "pointer" && (n.value = "first", e("blur")); }, onFocusAfterTrapped: () => { e("focus"); }, onFocusInTrap: (l) => { t13.visible && !r.value && (l.target && (n.value = l.target), r.value = true); }, onFocusoutPrevented: (l) => { t13.trapping || (l.detail.focusReason === "pointer" && l.preventDefault(), r.value = false); }, onReleaseRequested: () => { r.value = false, e("close"); } }; }; var vF = defineComponent({ name: "ElPopperContent" }); var hF = defineComponent({ ...vF, props: I2, emits: aF, setup(t13, { expose: e, emit: r }) { const n = t13, { focusStartRef: a, trapped: i, onFocusAfterReleased: o, onFocusAfterTrapped: s, onFocusInTrap: u, onFocusoutPrevented: l, onReleaseRequested: c } = fF(n, r), { attributes: d, arrowRef: f, contentRef: h10, styles: v, instanceRef: p, role: g, update: y } = cF(n), { ariaModal: m, arrowStyle: b, contentAttrs: w, contentClass: x, contentStyle: E, updateZIndex: C } = dF(n, { styles: v, attributes: d, role: g }), k = inject(Io, void 0), S = ref(); provide(x2, { arrowStyle: b, arrowRef: f, arrowOffset: S }), k && provide(Io, { ...k, addInputId: Eo, removeInputId: Eo }); let _; const T = (D = true) => { y(), D && C(); }, O = () => { T(false), n.visible && n.focusOnShow ? i.value = true : n.visible === false && (i.value = false); }; return onMounted(() => { watch(() => n.triggerTargetEl, (D, A) => { _ == null || _(), _ = void 0; const F = unref(D || h10.value), R = unref(A || h10.value); Ea(F) && (_ = watch([g, () => n.ariaLabel, m, () => n.id], (M) => { ["role", "aria-label", "aria-modal", "id"].forEach((L, V) => { Yn(M[V]) ? F.removeAttribute(L) : F.setAttribute(L, M[V]); }); }, { immediate: true })), R !== F && Ea(R) && ["role", "aria-label", "aria-modal", "id"].forEach((M) => { R.removeAttribute(M); }); }, { immediate: true }), watch(() => n.visible, O, { immediate: true }); }), onBeforeUnmount(() => { _ == null || _(), _ = void 0; }), e({ popperContentRef: h10, popperInstanceRef: p, updatePopper: T, contentStyle: E }), (D, A) => (openBlock(), createElementBlock("div", mergeProps({ ref_key: "contentRef", ref: h10 }, unref(w), { style: unref(E), class: unref(x), tabindex: "-1", onMouseenter: (F) => D.$emit("mouseenter", F), onMouseleave: (F) => D.$emit("mouseleave", F) }), [ createVNode(unref(tF), { trapped: unref(i), "trap-on-focus-in": true, "focus-trap-el": unref(h10), "focus-start-el": unref(a), onFocusAfterTrapped: unref(s), onFocusAfterReleased: unref(o), onFocusin: unref(u), onFocusoutPrevented: unref(l), onReleaseRequested: unref(c) }, { default: withCtx(() => [ renderSlot(D.$slots, "default") ]), _: 3 }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"]) ], 16, ["onMouseenter", "onMouseleave"])); } }); var pF = Ke(hF, [["__file", "content.vue"]]); var gF = Vt(FL); var mg = Symbol("elTooltip"); var fr = rt({ ...GR, ...I2, appendTo: { type: qe([String, Object]) }, content: { type: String, default: "" }, rawContent: Boolean, persistent: Boolean, visible: { type: qe(Boolean), default: null }, transition: String, teleported: { type: Boolean, default: true }, disabled: Boolean, ...sa(["ariaLabel"]) }); var Oo = rt({ ..._2, disabled: Boolean, trigger: { type: qe([String, Array]), default: "hover" }, triggerKeys: { type: qe(Array), default: () => [Rt.enter, Rt.space] } }); var { useModelToggleProps: yF, useModelToggleEmits: mF, useModelToggle: bF } = MD("visible"); var wF = rt({ ...E2, ...yF, ...fr, ...Oo, ...S2, showArrow: { type: Boolean, default: true } }); var CF = [ ...mF, "before-show", "before-hide", "show", "hide", "open", "close" ]; var xF = (t13, e) => hr(t13) ? t13.includes(e) : t13 === e; var Qa = (t13, e, r) => (n) => { xF(unref(t13), e) && r(n); }; var EF = defineComponent({ name: "ElTooltipTrigger" }); var SF = defineComponent({ ...EF, props: Oo, setup(t13, { expose: e }) { const r = t13, n = Ge("tooltip"), { controlled: a, id: i, open: o, onOpen: s, onClose: u, onToggle: l } = inject(mg, void 0), c = ref(null), d = () => { if (unref(a) || r.disabled) return true; }, f = toRef(r, "trigger"), h10 = mn(d, Qa(f, "hover", s)), v = mn(d, Qa(f, "hover", u)), p = mn(d, Qa(f, "click", (w) => { w.button === 0 && l(w); })), g = mn(d, Qa(f, "focus", s)), y = mn(d, Qa(f, "focus", u)), m = mn(d, Qa(f, "contextmenu", (w) => { w.preventDefault(), l(w); })), b = mn(d, (w) => { const { code: x } = w; r.triggerKeys.includes(x) && (w.preventDefault(), l(w)); }); return e({ triggerRef: c }), (w, x) => (openBlock(), createBlock(unref(VL), { id: unref(i), "virtual-ref": w.virtualRef, open: unref(o), "virtual-triggering": w.virtualTriggering, class: normalizeClass(unref(n).e("trigger")), onBlur: unref(y), onClick: unref(p), onContextmenu: unref(m), onFocus: unref(g), onMouseenter: unref(h10), onMouseleave: unref(v), onKeydown: unref(b) }, { default: withCtx(() => [ renderSlot(w.$slots, "default") ]), _: 3 }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"])); } }); var kF = Ke(SF, [["__file", "trigger.vue"]]); var _F = rt({ to: { type: qe([String, Object]), required: true }, disabled: Boolean }); var TF = defineComponent({ __name: "teleport", props: _F, setup(t13) { return (e, r) => e.disabled ? renderSlot(e.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport, { key: 1, to: e.to }, [ renderSlot(e.$slots, "default") ], 8, ["to"])); } }); var IF = Ke(TF, [["__file", "teleport.vue"]]); var OF = Vt(IF); var AF = defineComponent({ name: "ElTooltipContent", inheritAttrs: false }); var PF = defineComponent({ ...AF, props: fr, setup(t13, { expose: e }) { const r = t13, { selector: n } = v2(), a = Ge("tooltip"), i = ref(null); let o; const { controlled: s, id: u, open: l, trigger: c, onClose: d, onOpen: f, onShow: h10, onHide: v, onBeforeShow: p, onBeforeHide: g } = inject(mg, void 0), y = computed(() => r.transition || `${a.namespace.value}-fade-in-linear`), m = computed(() => false ? true : r.persistent); onBeforeUnmount(() => { o == null || o(); }); const b = computed(() => unref(m) ? true : unref(l)), w = computed(() => r.disabled ? false : unref(l)), x = computed(() => r.appendTo || n.value), E = computed(() => { var R; return (R = r.style) != null ? R : {}; }), C = ref(true), k = () => { v(), C.value = true; }, S = () => { if (unref(s)) return true; }, _ = mn(S, () => { r.enterable && unref(c) === "hover" && f(); }), T = mn(S, () => { unref(c) === "hover" && d(); }), O = () => { var R, M; (M = (R = i.value) == null ? void 0 : R.updatePopper) == null || M.call(R), p == null || p(); }, D = () => { g == null || g(); }, A = () => { h10(), o = sI(computed(() => { var R; return (R = i.value) == null ? void 0 : R.popperContentRef; }), () => { if (unref(s)) return; unref(c) !== "hover" && d(); }); }, F = () => { r.virtualTriggering || d(); }; return watch(() => unref(l), (R) => { R ? C.value = false : o == null || o(); }, { flush: "post" }), watch(() => r.content, () => { var R, M; (M = (R = i.value) == null ? void 0 : R.updatePopper) == null || M.call(R); }), e({ contentRef: i }), (R, M) => (openBlock(), createBlock(unref(OF), { disabled: !R.teleported, to: unref(x) }, { default: withCtx(() => [ createVNode(Transition, { name: unref(y), onAfterLeave: k, onBeforeEnter: O, onAfterEnter: A, onBeforeLeave: D }, { default: withCtx(() => [ unref(b) ? withDirectives((openBlock(), createBlock(unref(pF), mergeProps({ key: 0, id: unref(u), ref_key: "contentRef", ref: i }, R.$attrs, { "aria-label": R.ariaLabel, "aria-hidden": C.value, "boundaries-padding": R.boundariesPadding, "fallback-placements": R.fallbackPlacements, "gpu-acceleration": R.gpuAcceleration, offset: R.offset, placement: R.placement, "popper-options": R.popperOptions, strategy: R.strategy, effect: R.effect, enterable: R.enterable, pure: R.pure, "popper-class": R.popperClass, "popper-style": [R.popperStyle, unref(E)], "reference-el": R.referenceEl, "trigger-target-el": R.triggerTargetEl, visible: unref(w), "z-index": R.zIndex, onMouseenter: unref(_), onMouseleave: unref(T), onBlur: F, onClose: unref(d) }), { default: withCtx(() => [ renderSlot(R.$slots, "default") ]), _: 3 }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [ [vShow, unref(w)] ]) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["name"]) ]), _: 3 }, 8, ["disabled", "to"])); } }); var DF = Ke(PF, [["__file", "content.vue"]]); var RF = defineComponent({ name: "ElTooltip" }); var LF = defineComponent({ ...RF, props: wF, emits: CF, setup(t13, { expose: e, emit: r }) { const n = t13; KR(); const a = Al(), i = ref(), o = ref(), s = () => { var y; const m = unref(i); m && ((y = m.popperInstanceRef) == null || y.update()); }, u = ref(false), l = ref(), { show: c, hide: d, hasUpdateHandler: f } = bF({ indicator: u, toggleReason: l }), { onOpen: h10, onClose: v } = UR({ showAfter: toRef(n, "showAfter"), hideAfter: toRef(n, "hideAfter"), autoClose: toRef(n, "autoClose"), open: c, close: d }), p = computed(() => bi(n.visible) && !f.value); provide(mg, { controlled: p, id: a, open: readonly(u), trigger: toRef(n, "trigger"), onOpen: (y) => { h10(y); }, onClose: (y) => { v(y); }, onToggle: (y) => { unref(u) ? v(y) : h10(y); }, onShow: () => { r("show", l.value); }, onHide: () => { r("hide", l.value); }, onBeforeShow: () => { r("before-show", l.value); }, onBeforeHide: () => { r("before-hide", l.value); }, updatePopper: s }), watch(() => n.disabled, (y) => { y && u.value && (u.value = false); }); const g = (y) => { var m, b; const w = (b = (m = o.value) == null ? void 0 : m.contentRef) == null ? void 0 : b.popperContentRef, x = (y == null ? void 0 : y.relatedTarget) || document.activeElement; return w && w.contains(x); }; return onDeactivated(() => u.value && d()), e({ popperRef: i, contentRef: o, isFocusInsideContent: g, updatePopper: s, onOpen: h10, onClose: v, hide: d }), (y, m) => (openBlock(), createBlock(unref(gF), { ref_key: "popperRef", ref: i, role: y.role }, { default: withCtx(() => [ createVNode(kF, { disabled: y.disabled, trigger: y.trigger, "trigger-keys": y.triggerKeys, "virtual-ref": y.virtualRef, "virtual-triggering": y.virtualTriggering }, { default: withCtx(() => [ y.$slots.default ? renderSlot(y.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]), createVNode(DF, { ref_key: "contentRef", ref: o, "aria-label": y.ariaLabel, "boundaries-padding": y.boundariesPadding, content: y.content, disabled: y.disabled, effect: y.effect, enterable: y.enterable, "fallback-placements": y.fallbackPlacements, "hide-after": y.hideAfter, "gpu-acceleration": y.gpuAcceleration, offset: y.offset, persistent: y.persistent, "popper-class": y.popperClass, "popper-style": y.popperStyle, placement: y.placement, "popper-options": y.popperOptions, pure: y.pure, "raw-content": y.rawContent, "reference-el": y.referenceEl, "trigger-target-el": y.triggerTargetEl, "show-after": y.showAfter, strategy: y.strategy, teleported: y.teleported, transition: y.transition, "virtual-triggering": y.virtualTriggering, "z-index": y.zIndex, "append-to": y.appendTo }, { default: withCtx(() => [ renderSlot(y.$slots, "content", {}, () => [ y.rawContent ? (openBlock(), createElementBlock("span", { key: 0, innerHTML: y.content }, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(y.content), 1)) ]), y.showArrow ? (openBlock(), createBlock(unref(BL), { key: 0, "arrow-offset": y.arrowOffset }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true) ]), _: 3 }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"]) ]), _: 3 }, 8, ["role"])); } }); var FF = Ke(LF, [["__file", "tooltip.vue"]]); var Jo = Vt(FF); var O2 = Symbol("buttonGroupContextKey"); var MF = (t13, e) => { Ns({ from: "type.text", replacement: "link", version: "3.0.0", scope: "props", ref: "https://element-plus.org/en-US/component/button.html#button-attributes" }, computed(() => t13.type === "text")); const r = inject(O2, void 0), n = fg("button"), { form: a } = Va(), i = Oa(computed(() => r == null ? void 0 : r.size)), o = Yo(), s = ref(), u = useSlots(), l = computed(() => t13.type || (r == null ? void 0 : r.type) || ""), c = computed(() => { var v, p, g; return (g = (p = t13.autoInsertSpace) != null ? p : (v = n.value) == null ? void 0 : v.autoInsertSpace) != null ? g : false; }), d = computed(() => t13.tag === "button" ? { ariaDisabled: o.value || t13.loading, disabled: o.value || t13.loading, autofocus: t13.autofocus, type: t13.nativeType } : {}), f = computed(() => { var v; const p = (v = u.default) == null ? void 0 : v.call(u); if (c.value && (p == null ? void 0 : p.length) === 1) { const g = p[0]; if ((g == null ? void 0 : g.type) === Text) { const y = g.children; return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(y.trim()); } } return false; }); return { _disabled: o, _size: i, _type: l, _ref: s, _props: d, shouldAddSpace: f, handleClick: (v) => { if (o.value || t13.loading) { v.stopPropagation(); return; } t13.nativeType === "reset" && (a == null || a.resetFields()), e("click", v); } }; }; var NF = [ "default", "primary", "success", "warning", "info", "danger", "text", "" ]; var BF = ["button", "submit", "reset"]; var wp = rt({ size: Di, disabled: Boolean, type: { type: String, values: NF, default: "" }, icon: { type: Qn }, nativeType: { type: String, values: BF, default: "button" }, loading: Boolean, loadingIcon: { type: Qn, default: () => loading_default }, 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: qe([String, Object]), default: "button" } }); var $F = { click: (t13) => t13 instanceof MouseEvent }; function Wt(t13, e) { qF(t13) && (t13 = "100%"); var r = zF(t13); return t13 = e === 360 ? t13 : Math.min(e, Math.max(0, parseFloat(t13))), r && (t13 = parseInt(String(t13 * e), 10) / 100), Math.abs(t13 - e) < 1e-6 ? 1 : (e === 360 ? t13 = (t13 < 0 ? t13 % e + e : t13 % e) / parseFloat(String(e)) : t13 = t13 % e / parseFloat(String(e)), t13); } function Cs(t13) { return Math.min(1, Math.max(0, t13)); } function qF(t13) { return typeof t13 == "string" && t13.indexOf(".") !== -1 && parseFloat(t13) === 1; } function zF(t13) { return typeof t13 == "string" && t13.indexOf("%") !== -1; } function A2(t13) { return t13 = parseFloat(t13), (isNaN(t13) || t13 < 0 || t13 > 1) && (t13 = 1), t13; } function xs(t13) { return t13 <= 1 ? "".concat(Number(t13) * 100, "%") : t13; } function Ca(t13) { return t13.length === 1 ? "0" + t13 : String(t13); } function VF(t13, e, r) { return { r: Wt(t13, 255) * 255, g: Wt(e, 255) * 255, b: Wt(r, 255) * 255 }; } function _m(t13, e, r) { t13 = Wt(t13, 255), e = Wt(e, 255), r = Wt(r, 255); var n = Math.max(t13, e, r), a = Math.min(t13, e, r), i = 0, o = 0, s = (n + a) / 2; if (n === a) o = 0, i = 0; else { var u = n - a; switch (o = s > 0.5 ? u / (2 - n - a) : u / (n + a), n) { case t13: i = (e - r) / u + (e < r ? 6 : 0); break; case e: i = (r - t13) / u + 2; break; case r: i = (t13 - e) / u + 4; break; } i /= 6; } return { h: i, s: o, l: s }; } function Su(t13, e, r) { return r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t13 + (e - t13) * (6 * r) : r < 1 / 2 ? e : r < 2 / 3 ? t13 + (e - t13) * (2 / 3 - r) * 6 : t13; } function HF(t13, e, r) { var n, a, i; if (t13 = Wt(t13, 360), e = Wt(e, 100), r = Wt(r, 100), e === 0) a = r, i = r, n = r; else { var o = r < 0.5 ? r * (1 + e) : r + e - r * e, s = 2 * r - o; n = Su(s, o, t13 + 1 / 3), a = Su(s, o, t13), i = Su(s, o, t13 - 1 / 3); } return { r: n * 255, g: a * 255, b: i * 255 }; } function Tm(t13, e, r) { t13 = Wt(t13, 255), e = Wt(e, 255), r = Wt(r, 255); var n = Math.max(t13, e, r), a = Math.min(t13, e, r), i = 0, o = n, s = n - a, u = n === 0 ? 0 : s / n; if (n === a) i = 0; else { switch (n) { case t13: i = (e - r) / s + (e < r ? 6 : 0); break; case e: i = (r - t13) / s + 2; break; case r: i = (t13 - e) / s + 4; break; } i /= 6; } return { h: i, s: u, v: o }; } function KF(t13, e, r) { t13 = Wt(t13, 360) * 6, e = Wt(e, 100), r = Wt(r, 100); var n = Math.floor(t13), a = t13 - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), u = n % 6, l = [r, o, i, i, s, r][u], c = [s, r, r, o, i, i][u], d = [i, i, s, r, r, o][u]; return { r: l * 255, g: c * 255, b: d * 255 }; } function Im(t13, e, r, n) { var a = [ Ca(Math.round(t13).toString(16)), Ca(Math.round(e).toString(16)), Ca(Math.round(r).toString(16)) ]; return n && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join(""); } function GF(t13, e, r, n, a) { var i = [ Ca(Math.round(t13).toString(16)), Ca(Math.round(e).toString(16)), Ca(Math.round(r).toString(16)), Ca(UF(n)) ]; return a && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join(""); } function UF(t13) { return Math.round(parseFloat(t13) * 255).toString(16); } function Om(t13) { return Cr(t13) / 255; } function Cr(t13) { return parseInt(t13, 16); } function WF(t13) { return { r: t13 >> 16, g: (t13 & 65280) >> 8, b: t13 & 255 }; } var Cp = { 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 jF(t13) { var e = { r: 0, g: 0, b: 0 }, r = 1, n = null, a = null, i = null, o = false, s = false; return typeof t13 == "string" && (t13 = XF(t13)), typeof t13 == "object" && (gn(t13.r) && gn(t13.g) && gn(t13.b) ? (e = VF(t13.r, t13.g, t13.b), o = true, s = String(t13.r).substr(-1) === "%" ? "prgb" : "rgb") : gn(t13.h) && gn(t13.s) && gn(t13.v) ? (n = xs(t13.s), a = xs(t13.v), e = KF(t13.h, n, a), o = true, s = "hsv") : gn(t13.h) && gn(t13.s) && gn(t13.l) && (n = xs(t13.s), i = xs(t13.l), e = HF(t13.h, n, i), o = true, s = "hsl"), Object.prototype.hasOwnProperty.call(t13, "a") && (r = t13.a)), r = A2(r), { ok: o, format: t13.format || s, r: Math.min(255, Math.max(e.r, 0)), g: Math.min(255, Math.max(e.g, 0)), b: Math.min(255, Math.max(e.b, 0)), a: r }; } var YF = "[-\\+]?\\d+%?"; var ZF = "[-\\+]?\\d*\\.\\d+%?"; var Wn = "(?:".concat(ZF, ")|(?:").concat(YF, ")"); var ku = "[\\s|\\(]+(".concat(Wn, ")[,|\\s]+(").concat(Wn, ")[,|\\s]+(").concat(Wn, ")\\s*\\)?"); var _u = "[\\s|\\(]+(".concat(Wn, ")[,|\\s]+(").concat(Wn, ")[,|\\s]+(").concat(Wn, ")[,|\\s]+(").concat(Wn, ")\\s*\\)?"); var zr = { CSS_UNIT: new RegExp(Wn), rgb: new RegExp("rgb" + ku), rgba: new RegExp("rgba" + _u), hsl: new RegExp("hsl" + ku), hsla: new RegExp("hsla" + _u), hsv: new RegExp("hsv" + ku), hsva: new RegExp("hsva" + _u), 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 XF(t13) { if (t13 = t13.trim().toLowerCase(), t13.length === 0) return false; var e = false; if (Cp[t13]) t13 = Cp[t13], e = true; else if (t13 === "transparent") return { r: 0, g: 0, b: 0, a: 0, format: "name" }; var r = zr.rgb.exec(t13); return r ? { r: r[1], g: r[2], b: r[3] } : (r = zr.rgba.exec(t13), r ? { r: r[1], g: r[2], b: r[3], a: r[4] } : (r = zr.hsl.exec(t13), r ? { h: r[1], s: r[2], l: r[3] } : (r = zr.hsla.exec(t13), r ? { h: r[1], s: r[2], l: r[3], a: r[4] } : (r = zr.hsv.exec(t13), r ? { h: r[1], s: r[2], v: r[3] } : (r = zr.hsva.exec(t13), r ? { h: r[1], s: r[2], v: r[3], a: r[4] } : (r = zr.hex8.exec(t13), r ? { r: Cr(r[1]), g: Cr(r[2]), b: Cr(r[3]), a: Om(r[4]), format: e ? "name" : "hex8" } : (r = zr.hex6.exec(t13), r ? { r: Cr(r[1]), g: Cr(r[2]), b: Cr(r[3]), format: e ? "name" : "hex" } : (r = zr.hex4.exec(t13), r ? { r: Cr(r[1] + r[1]), g: Cr(r[2] + r[2]), b: Cr(r[3] + r[3]), a: Om(r[4] + r[4]), format: e ? "name" : "hex8" } : (r = zr.hex3.exec(t13), r ? { r: Cr(r[1] + r[1]), g: Cr(r[2] + r[2]), b: Cr(r[3] + r[3]), format: e ? "name" : "hex" } : false))))))))); } function gn(t13) { return !!zr.CSS_UNIT.exec(String(t13)); } var JF = ( /** @class */ function() { function t13(e, r) { e === void 0 && (e = ""), r === void 0 && (r = {}); var n; if (e instanceof t13) return e; typeof e == "number" && (e = WF(e)), this.originalInput = e; var a = jF(e); this.originalInput = e, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = (n = r.format) !== null && n !== void 0 ? n : a.format, this.gradientType = r.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok; } return t13.prototype.isDark = function() { return this.getBrightness() < 128; }, t13.prototype.isLight = function() { return !this.isDark(); }, t13.prototype.getBrightness = function() { var e = this.toRgb(); return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3; }, t13.prototype.getLuminance = function() { var e = this.toRgb(), r, n, a, i = e.r / 255, o = e.g / 255, s = e.b / 255; return i <= 0.03928 ? r = i / 12.92 : r = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? n = o / 12.92 : n = Math.pow((o + 0.055) / 1.055, 2.4), s <= 0.03928 ? a = s / 12.92 : a = Math.pow((s + 0.055) / 1.055, 2.4), 0.2126 * r + 0.7152 * n + 0.0722 * a; }, t13.prototype.getAlpha = function() { return this.a; }, t13.prototype.setAlpha = function(e) { return this.a = A2(e), this.roundA = Math.round(100 * this.a) / 100, this; }, t13.prototype.isMonochrome = function() { var e = this.toHsl().s; return e === 0; }, t13.prototype.toHsv = function() { var e = Tm(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, v: e.v, a: this.a }; }, t13.prototype.toHsvString = function() { var e = Tm(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.v * 100); return this.a === 1 ? "hsv(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsva(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, t13.prototype.toHsl = function() { var e = _m(this.r, this.g, this.b); return { h: e.h * 360, s: e.s, l: e.l, a: this.a }; }, t13.prototype.toHslString = function() { var e = _m(this.r, this.g, this.b), r = Math.round(e.h * 360), n = Math.round(e.s * 100), a = Math.round(e.l * 100); return this.a === 1 ? "hsl(".concat(r, ", ").concat(n, "%, ").concat(a, "%)") : "hsla(".concat(r, ", ").concat(n, "%, ").concat(a, "%, ").concat(this.roundA, ")"); }, t13.prototype.toHex = function(e) { return e === void 0 && (e = false), Im(this.r, this.g, this.b, e); }, t13.prototype.toHexString = function(e) { return e === void 0 && (e = false), "#" + this.toHex(e); }, t13.prototype.toHex8 = function(e) { return e === void 0 && (e = false), GF(this.r, this.g, this.b, this.a, e); }, t13.prototype.toHex8String = function(e) { return e === void 0 && (e = false), "#" + this.toHex8(e); }, t13.prototype.toHexShortString = function(e) { return e === void 0 && (e = false), this.a === 1 ? this.toHexString(e) : this.toHex8String(e); }, t13.prototype.toRgb = function() { return { r: Math.round(this.r), g: Math.round(this.g), b: Math.round(this.b), a: this.a }; }, t13.prototype.toRgbString = function() { var e = Math.round(this.r), r = Math.round(this.g), n = Math.round(this.b); return this.a === 1 ? "rgb(".concat(e, ", ").concat(r, ", ").concat(n, ")") : "rgba(".concat(e, ", ").concat(r, ", ").concat(n, ", ").concat(this.roundA, ")"); }, t13.prototype.toPercentageRgb = function() { var e = function(r) { return "".concat(Math.round(Wt(r, 255) * 100), "%"); }; return { r: e(this.r), g: e(this.g), b: e(this.b), a: this.a }; }, t13.prototype.toPercentageRgbString = function() { var e = function(r) { return Math.round(Wt(r, 255) * 100); }; return this.a === 1 ? "rgb(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%)") : "rgba(".concat(e(this.r), "%, ").concat(e(this.g), "%, ").concat(e(this.b), "%, ").concat(this.roundA, ")"); }, t13.prototype.toName = function() { if (this.a === 0) return "transparent"; if (this.a < 1) return false; for (var e = "#" + Im(this.r, this.g, this.b, false), r = 0, n = Object.entries(Cp); r < n.length; r++) { var a = n[r], i = a[0], o = a[1]; if (e === o) return i; } return false; }, t13.prototype.toString = function(e) { var r = !!e; e = e ?? this.format; var n = false, a = this.a < 1 && this.a >= 0, i = !r && a && (e.startsWith("hex") || e === "name"); return i ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(true)), e === "hex4" && (n = this.toHex8String(true)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString()); }, t13.prototype.toNumber = function() { return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b); }, t13.prototype.clone = function() { return new t13(this.toString()); }, t13.prototype.lighten = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l += e / 100, r.l = Cs(r.l), new t13(r); }, t13.prototype.brighten = function(e) { e === void 0 && (e = 10); var r = this.toRgb(); return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(e / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(e / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(e / 100)))), new t13(r); }, t13.prototype.darken = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.l -= e / 100, r.l = Cs(r.l), new t13(r); }, t13.prototype.tint = function(e) { return e === void 0 && (e = 10), this.mix("white", e); }, t13.prototype.shade = function(e) { return e === void 0 && (e = 10), this.mix("black", e); }, t13.prototype.desaturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s -= e / 100, r.s = Cs(r.s), new t13(r); }, t13.prototype.saturate = function(e) { e === void 0 && (e = 10); var r = this.toHsl(); return r.s += e / 100, r.s = Cs(r.s), new t13(r); }, t13.prototype.greyscale = function() { return this.desaturate(100); }, t13.prototype.spin = function(e) { var r = this.toHsl(), n = (r.h + e) % 360; return r.h = n < 0 ? 360 + n : n, new t13(r); }, t13.prototype.mix = function(e, r) { r === void 0 && (r = 50); var n = this.toRgb(), a = new t13(e).toRgb(), i = r / 100, o = { r: (a.r - n.r) * i + n.r, g: (a.g - n.g) * i + n.g, b: (a.b - n.b) * i + n.b, a: (a.a - n.a) * i + n.a }; return new t13(o); }, t13.prototype.analogous = function(e, r) { e === void 0 && (e = 6), r === void 0 && (r = 30); var n = this.toHsl(), a = 360 / r, i = [this]; for (n.h = (n.h - (a * e >> 1) + 720) % 360; --e; ) n.h = (n.h + a) % 360, i.push(new t13(n)); return i; }, t13.prototype.complement = function() { var e = this.toHsl(); return e.h = (e.h + 180) % 360, new t13(e); }, t13.prototype.monochromatic = function(e) { e === void 0 && (e = 6); for (var r = this.toHsv(), n = r.h, a = r.s, i = r.v, o = [], s = 1 / e; e--; ) o.push(new t13({ h: n, s: a, v: i })), i = (i + s) % 1; return o; }, t13.prototype.splitcomplement = function() { var e = this.toHsl(), r = e.h; return [ this, new t13({ h: (r + 72) % 360, s: e.s, l: e.l }), new t13({ h: (r + 216) % 360, s: e.s, l: e.l }) ]; }, t13.prototype.onBackground = function(e) { var r = this.toRgb(), n = new t13(e).toRgb(), a = r.a + n.a * (1 - r.a); return new t13({ r: (r.r * r.a + n.r * n.a * (1 - r.a)) / a, g: (r.g * r.a + n.g * n.a * (1 - r.a)) / a, b: (r.b * r.a + n.b * n.a * (1 - r.a)) / a, a }); }, t13.prototype.triad = function() { return this.polyad(3); }, t13.prototype.tetrad = function() { return this.polyad(4); }, t13.prototype.polyad = function(e) { for (var r = this.toHsl(), n = r.h, a = [this], i = 360 / e, o = 1; o < e; o++) a.push(new t13({ h: (n + o * i) % 360, s: r.s, l: r.l })); return a; }, t13.prototype.equals = function(e) { return this.toRgbString() === new t13(e).toRgbString(); }, t13; }() ); function Bn(t13, e = 20) { return t13.mix("#141414", e).toString(); } function QF(t13) { const e = Yo(), r = Ge("button"); return computed(() => { let n = {}, a = t13.color; if (a) { const i = a.match(/var\((.*?)\)/); i && (a = window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1])); const o = new JF(a), s = t13.dark ? o.tint(20).toString() : Bn(o, 20); if (t13.plain) n = r.cssVarBlock({ "bg-color": t13.dark ? Bn(o, 90) : o.tint(90).toString(), "text-color": a, "border-color": t13.dark ? Bn(o, 50) : o.tint(50).toString(), "hover-text-color": `var(${r.cssVarName("color-white")})`, "hover-bg-color": a, "hover-border-color": a, "active-bg-color": s, "active-text-color": `var(${r.cssVarName("color-white")})`, "active-border-color": s }), e.value && (n[r.cssVarBlockName("disabled-bg-color")] = t13.dark ? Bn(o, 90) : o.tint(90).toString(), n[r.cssVarBlockName("disabled-text-color")] = t13.dark ? Bn(o, 50) : o.tint(50).toString(), n[r.cssVarBlockName("disabled-border-color")] = t13.dark ? Bn(o, 80) : o.tint(80).toString()); else { const u = t13.dark ? Bn(o, 30) : o.tint(30).toString(), l = o.isDark() ? `var(${r.cssVarName("color-white")})` : `var(${r.cssVarName("color-black")})`; if (n = r.cssVarBlock({ "bg-color": a, "text-color": l, "border-color": a, "hover-bg-color": u, "hover-text-color": l, "hover-border-color": u, "active-bg-color": s, "active-border-color": s }), e.value) { const c = t13.dark ? Bn(o, 50) : o.tint(50).toString(); n[r.cssVarBlockName("disabled-bg-color")] = c, n[r.cssVarBlockName("disabled-text-color")] = t13.dark ? "rgba(255, 255, 255, 0.5)" : `var(${r.cssVarName("color-white")})`, n[r.cssVarBlockName("disabled-border-color")] = c; } } } return n; }); } var eM = defineComponent({ name: "ElButton" }); var tM = defineComponent({ ...eM, props: wp, emits: $F, setup(t13, { expose: e, emit: r }) { const n = t13, a = QF(n), i = Ge("button"), { _ref: o, _size: s, _type: u, _disabled: l, _props: c, shouldAddSpace: d, handleClick: f } = MF(n, r), h10 = computed(() => [ i.b(), i.m(u.value), i.m(s.value), i.is("disabled", l.value), i.is("loading", n.loading), i.is("plain", n.plain), i.is("round", n.round), i.is("circle", n.circle), i.is("text", n.text), i.is("link", n.link), i.is("has-bg", n.bg) ]); return e({ ref: o, size: s, type: u, disabled: l, shouldAddSpace: d }), (v, p) => (openBlock(), createBlock(resolveDynamicComponent(v.tag), mergeProps({ ref_key: "_ref", ref: o }, unref(c), { class: unref(h10), style: unref(a), onClick: unref(f) }), { default: withCtx(() => [ v.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ v.$slots.loading ? renderSlot(v.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(Ft), { key: 1, class: normalizeClass(unref(i).is("loading")) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(v.loadingIcon))) ]), _: 1 }, 8, ["class"])) ], 64)) : v.icon || v.$slots.icon ? (openBlock(), createBlock(unref(Ft), { key: 1 }, { default: withCtx(() => [ v.icon ? (openBlock(), createBlock(resolveDynamicComponent(v.icon), { key: 0 })) : renderSlot(v.$slots, "icon", { key: 1 }) ]), _: 3 })) : createCommentVNode("v-if", true), v.$slots.default ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass({ [unref(i).em("text", "expand")]: unref(d) }) }, [ renderSlot(v.$slots, "default") ], 2)) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["class", "style", "onClick"])); } }); var rM = Ke(tM, [["__file", "button.vue"]]); var nM = { size: wp.size, type: wp.type }; var aM = defineComponent({ name: "ElButtonGroup" }); var iM = defineComponent({ ...aM, props: nM, setup(t13) { const e = t13; provide(O2, reactive({ size: toRef(e, "size"), type: toRef(e, "type") })); const r = Ge("button"); return (n, a) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(r).b("group")) }, [ renderSlot(n.$slots, "default") ], 2)); } }); var P2 = Ke(iM, [["__file", "button-group.vue"]]); var mr = Vt(rM, { ButtonGroup: P2 }); An(P2); var oo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function oM(t13) { return t13 && t13.__esModule && Object.prototype.hasOwnProperty.call(t13, "default") ? t13.default : t13; } var Vn = /* @__PURE__ */ new Map(); if (It) { let t13; document.addEventListener("mousedown", (e) => t13 = e), document.addEventListener("mouseup", (e) => { if (t13) { for (const r of Vn.values()) for (const { documentHandler: n } of r) n(e, t13); t13 = void 0; } }); } function Am(t13, e) { let r = []; return Array.isArray(e.arg) ? r = e.arg : Ea(e.arg) && r.push(e.arg), function(n, a) { const i = e.instance.popperRef, o = n.target, s = a == null ? void 0 : a.target, u = !e || !e.instance, l = !o || !s, c = t13.contains(o) || t13.contains(s), d = t13 === o, f = r.length && r.some((v) => v == null ? void 0 : v.contains(o)) || r.length && r.includes(s), h10 = i && (i.contains(o) || i.contains(s)); u || l || c || d || f || h10 || e.value(n, a); }; } var D2 = { beforeMount(t13, e) { Vn.has(t13) || Vn.set(t13, []), Vn.get(t13).push({ documentHandler: Am(t13, e), bindingFn: e.value }); }, updated(t13, e) { Vn.has(t13) || Vn.set(t13, []); const r = Vn.get(t13), n = r.findIndex((i) => i.bindingFn === e.oldValue), a = { documentHandler: Am(t13, e), bindingFn: e.value }; n >= 0 ? r.splice(n, 1, a) : r.push(a); }, unmounted(t13) { Vn.delete(t13); } }; var sM = rt({ header: { type: String, default: "" }, footer: { type: String, default: "" }, bodyStyle: { type: qe([String, Object, Array]), default: "" }, bodyClass: String, shadow: { type: String, values: ["always", "hover", "never"], default: "always" } }); var lM = defineComponent({ name: "ElCard" }); var uM = defineComponent({ ...lM, props: sM, setup(t13) { const e = Ge("card"); return (r, n) => (openBlock(), createElementBlock("div", { class: normalizeClass([unref(e).b(), unref(e).is(`${r.shadow}-shadow`)]) }, [ r.$slots.header || r.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(e).e("header")) }, [ renderSlot(r.$slots, "header", {}, () => [ createTextVNode(toDisplayString(r.header), 1) ]) ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass([unref(e).e("body"), r.bodyClass]), style: normalizeStyle(r.bodyStyle) }, [ renderSlot(r.$slots, "default") ], 6), r.$slots.footer || r.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(unref(e).e("footer")) }, [ renderSlot(r.$slots, "footer", {}, () => [ createTextVNode(toDisplayString(r.footer), 1) ]) ], 2)) : createCommentVNode("v-if", true) ], 2)); } }); var cM = Ke(uM, [["__file", "card.vue"]]); var dM = Vt(cM); var R2 = { 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: Di, tabindex: [String, Number], validateEvent: { type: Boolean, default: true }, ...sa(["ariaControls"]) }; var L2 = { [Kt]: (t13) => nr(t13) || Ut(t13) || bi(t13), change: (t13) => nr(t13) || Ut(t13) || bi(t13) }; var Ri = Symbol("checkboxGroupContextKey"); var fM = ({ model: t13, isChecked: e }) => { const r = inject(Ri, void 0), n = computed(() => { var i, o; const s = (i = r == null ? void 0 : r.max) == null ? void 0 : i.value, u = (o = r == null ? void 0 : r.min) == null ? void 0 : o.value; return !Un(s) && t13.value.length >= s && !e.value || !Un(u) && t13.value.length <= u && e.value; }); return { isDisabled: Yo(computed(() => (r == null ? void 0 : r.disabled.value) || n.value)), isLimitDisabled: n }; }; var vM = (t13, { model: e, isLimitExceeded: r, hasOwnLabel: n, isDisabled: a, isLabeledByFormItem: i }) => { const o = inject(Ri, void 0), { formItem: s } = Va(), { emit: u } = getCurrentInstance(); function l(v) { var p, g, y, m; return [true, t13.trueValue, t13.trueLabel].includes(v) ? (g = (p = t13.trueValue) != null ? p : t13.trueLabel) != null ? g : true : (m = (y = t13.falseValue) != null ? y : t13.falseLabel) != null ? m : false; } function c(v, p) { u("change", l(v), p); } function d(v) { if (r.value) return; const p = v.target; u("change", l(p.checked), v); } async function f(v) { r.value || !n.value && !a.value && i.value && (v.composedPath().some((y) => y.tagName === "LABEL") || (e.value = l([false, t13.falseValue, t13.falseLabel].includes(e.value)), await nextTick(), c(e.value, v))); } const h10 = computed(() => (o == null ? void 0 : o.validateEvent) || t13.validateEvent); return watch(() => t13.modelValue, () => { h10.value && (s == null || s.validate("change").catch((v) => Ot(v))); }), { handleChange: d, onClickRoot: f }; }; var hM = (t13) => { const e = ref(false), { emit: r } = getCurrentInstance(), n = inject(Ri, void 0), a = computed(() => Un(n) === false), i = ref(false), o = computed({ get() { var s, u; return a.value ? (s = n == null ? void 0 : n.modelValue) == null ? void 0 : s.value : (u = t13.modelValue) != null ? u : e.value; }, set(s) { var u, l; a.value && hr(s) ? (i.value = ((u = n == null ? void 0 : n.max) == null ? void 0 : u.value) !== void 0 && s.length > (n == null ? void 0 : n.max.value) && s.length > o.value.length, i.value === false && ((l = n == null ? void 0 : n.changeEvent) == null || l.call(n, s))) : (r(Kt, s), e.value = s); } }); return { model: o, isGroup: a, isLimitExceeded: i }; }; var pM = (t13, e, { model: r }) => { const n = inject(Ri, void 0), a = ref(false), i = computed(() => al(t13.value) ? t13.label : t13.value), o = computed(() => { const c = r.value; return bi(c) ? c : hr(c) ? Gt(i.value) ? c.map(toRaw).some((d) => nl(d, i.value)) : c.map(toRaw).includes(i.value) : c != null ? c === t13.trueValue || c === t13.trueLabel : !!c; }), s = Oa(computed(() => { var c; return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value; }), { prop: true }), u = Oa(computed(() => { var c; return (c = n == null ? void 0 : n.size) == null ? void 0 : c.value; })), l = computed(() => !!e.default || !al(i.value)); return { checkboxButtonSize: s, isChecked: o, isFocused: a, checkboxSize: u, hasOwnLabel: l, actualValue: i }; }; var F2 = (t13, e) => { const { formItem: r } = Va(), { model: n, isGroup: a, isLimitExceeded: i } = hM(t13), { isFocused: o, isChecked: s, checkboxButtonSize: u, checkboxSize: l, hasOwnLabel: c, actualValue: d } = pM(t13, e, { model: n }), { isDisabled: f } = fM({ model: n, isChecked: s }), { inputId: h10, isLabeledByFormItem: v } = Zo(t13, { formItemContext: r, disableIdGeneration: c, disableIdManagement: a }), { handleChange: p, onClickRoot: g } = vM(t13, { model: n, isLimitExceeded: i, hasOwnLabel: c, isDisabled: f, isLabeledByFormItem: v }); return (() => { function m() { var b, w; hr(n.value) && !n.value.includes(d.value) ? n.value.push(d.value) : n.value = (w = (b = t13.trueValue) != null ? b : t13.trueLabel) != null ? w : true; } t13.checked && m(); })(), Ns({ from: "label act as value", replacement: "value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => a.value && al(t13.value))), Ns({ from: "true-label", replacement: "true-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => !!t13.trueLabel)), Ns({ from: "false-label", replacement: "false-value", version: "3.0.0", scope: "el-checkbox", ref: "https://element-plus.org/en-US/component/checkbox.html" }, computed(() => !!t13.falseLabel)), { inputId: h10, isLabeledByFormItem: v, isChecked: s, isDisabled: f, isFocused: o, checkboxButtonSize: u, checkboxSize: l, hasOwnLabel: c, model: n, actualValue: d, handleChange: p, onClickRoot: g }; }; var gM = defineComponent({ name: "ElCheckbox" }); var yM = defineComponent({ ...gM, props: R2, emits: L2, setup(t13) { const e = t13, r = useSlots(), { inputId: n, isLabeledByFormItem: a, isChecked: i, isDisabled: o, isFocused: s, checkboxSize: u, hasOwnLabel: l, model: c, actualValue: d, handleChange: f, onClickRoot: h10 } = F2(e, r), v = Ge("checkbox"), p = computed(() => [ v.b(), v.m(u.value), v.is("disabled", o.value), v.is("bordered", e.border), v.is("checked", i.value) ]), g = computed(() => [ v.e("input"), v.is("disabled", o.value), v.is("checked", i.value), v.is("indeterminate", e.indeterminate), v.is("focus", s.value) ]); return (y, m) => (openBlock(), createBlock(resolveDynamicComponent(!unref(l) && unref(a) ? "span" : "label"), { class: normalizeClass(unref(p)), "aria-controls": y.indeterminate ? y.ariaControls : null, onClick: unref(h10) }, { default: withCtx(() => { var b, w, x, E; return [ createBaseVNode("span", { class: normalizeClass(unref(g)) }, [ y.trueValue || y.falseValue || y.trueLabel || y.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { key: 0, id: unref(n), "onUpdate:modelValue": (C) => isRef(c) ? c.value = C : null, class: normalizeClass(unref(v).e("original")), type: "checkbox", indeterminate: y.indeterminate, name: y.name, tabindex: y.tabindex, disabled: unref(o), "true-value": (w = (b = y.trueValue) != null ? b : y.trueLabel) != null ? w : true, "false-value": (E = (x = y.falseValue) != null ? x : y.falseLabel) != null ? E : false, onChange: unref(f), onFocus: (C) => s.value = true, onBlur: (C) => s.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(c)] ]) : withDirectives((openBlock(), createElementBlock("input", { key: 1, id: unref(n), "onUpdate:modelValue": (C) => isRef(c) ? c.value = C : null, class: normalizeClass(unref(v).e("original")), type: "checkbox", indeterminate: y.indeterminate, disabled: unref(o), value: unref(d), name: y.name, tabindex: y.tabindex, onChange: unref(f), onFocus: (C) => s.value = true, onBlur: (C) => s.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(c)] ]), createBaseVNode("span", { class: normalizeClass(unref(v).e("inner")) }, null, 2) ], 2), unref(l) ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(v).e("label")) }, [ renderSlot(y.$slots, "default"), y.$slots.default ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createTextVNode(toDisplayString(y.label), 1) ], 64)) ], 2)) : createCommentVNode("v-if", true) ]; }), _: 3 }, 8, ["class", "aria-controls", "onClick"])); } }); var mM = Ke(yM, [["__file", "checkbox.vue"]]); var bM = defineComponent({ name: "ElCheckboxButton" }); var wM = defineComponent({ ...bM, props: R2, emits: L2, setup(t13) { const e = t13, r = useSlots(), { isFocused: n, isChecked: a, isDisabled: i, checkboxButtonSize: o, model: s, actualValue: u, handleChange: l } = F2(e, r), c = inject(Ri, void 0), d = Ge("checkbox"), f = computed(() => { var v, p, g, y; const m = (p = (v = c == null ? void 0 : c.fill) == null ? void 0 : v.value) != null ? p : ""; return { backgroundColor: m, borderColor: m, color: (y = (g = c == null ? void 0 : c.textColor) == null ? void 0 : g.value) != null ? y : "", boxShadow: m ? `-1px 0 0 0 ${m}` : void 0 }; }), h10 = computed(() => [ d.b("button"), d.bm("button", o.value), d.is("disabled", i.value), d.is("checked", a.value), d.is("focus", n.value) ]); return (v, p) => { var g, y, m, b; return openBlock(), createElementBlock("label", { class: normalizeClass(unref(h10)) }, [ v.trueValue || v.falseValue || v.trueLabel || v.falseLabel ? withDirectives((openBlock(), createElementBlock("input", { key: 0, "onUpdate:modelValue": (w) => isRef(s) ? s.value = w : null, class: normalizeClass(unref(d).be("button", "original")), type: "checkbox", name: v.name, tabindex: v.tabindex, disabled: unref(i), "true-value": (y = (g = v.trueValue) != null ? g : v.trueLabel) != null ? y : true, "false-value": (b = (m = v.falseValue) != null ? m : v.falseLabel) != null ? b : false, onChange: unref(l), onFocus: (w) => n.value = true, onBlur: (w) => n.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(s)] ]) : withDirectives((openBlock(), createElementBlock("input", { key: 1, "onUpdate:modelValue": (w) => isRef(s) ? s.value = w : null, class: normalizeClass(unref(d).be("button", "original")), type: "checkbox", name: v.name, tabindex: v.tabindex, disabled: unref(i), value: unref(u), onChange: unref(l), onFocus: (w) => n.value = true, onBlur: (w) => n.value = false, onClick: withModifiers(() => { }, ["stop"]) }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [ [vModelCheckbox, unref(s)] ]), v.$slots.default || v.label ? (openBlock(), createElementBlock("span", { key: 2, class: normalizeClass(unref(d).be("button", "inner")), style: normalizeStyle(unref(a) ? unref(f) : void 0) }, [ renderSlot(v.$slots, "default", {}, () => [ createTextVNode(toDisplayString(v.label), 1) ]) ], 6)) : createCommentVNode("v-if", true) ], 2); }; } }); var M2 = Ke(wM, [["__file", "checkbox-button.vue"]]); var CM = rt({ modelValue: { type: qe(Array), default: () => [] }, disabled: Boolean, min: Number, max: Number, size: Di, fill: String, textColor: String, tag: { type: String, default: "div" }, validateEvent: { type: Boolean, default: true }, ...sa(["ariaLabel"]) }); var xM = { [Kt]: (t13) => hr(t13), change: (t13) => hr(t13) }; var EM = defineComponent({ name: "ElCheckboxGroup" }); var SM = defineComponent({ ...EM, props: CM, emits: xM, setup(t13, { emit: e }) { const r = t13, n = Ge("checkbox"), { formItem: a } = Va(), { inputId: i, isLabeledByFormItem: o } = Zo(r, { formItemContext: a }), s = async (l) => { e(Kt, l), await nextTick(), e("change", l); }, u = computed({ get() { return r.modelValue; }, set(l) { s(l); } }); return provide(Ri, { ...UE(toRefs(r), [ "size", "min", "max", "disabled", "validateEvent", "fill", "textColor" ]), modelValue: u, changeEvent: s }), watch(() => r.modelValue, () => { r.validateEvent && (a == null || a.validate("change").catch((l) => Ot(l))); }), (l, c) => { var d; return openBlock(), createBlock(resolveDynamicComponent(l.tag), { id: unref(i), class: normalizeClass(unref(n).b("group")), role: "group", "aria-label": unref(o) ? void 0 : l.ariaLabel || "checkbox-group", "aria-labelledby": unref(o) ? (d = unref(a)) == null ? void 0 : d.labelId : void 0 }, { default: withCtx(() => [ renderSlot(l.$slots, "default") ]), _: 3 }, 8, ["id", "class", "aria-label", "aria-labelledby"]); }; } }); var N2 = Ke(SM, [["__file", "checkbox-group.vue"]]); var kM = Vt(mM, { CheckboxButton: M2, CheckboxGroup: N2 }); An(M2); An(N2); var xp = rt({ type: { type: String, values: ["primary", "success", "info", "warning", "danger"], default: "primary" }, closable: Boolean, disableTransitions: Boolean, hit: Boolean, color: String, size: { type: String, values: XE }, effect: { type: String, values: ["dark", "light", "plain"], default: "light" }, round: Boolean }); var _M = { close: (t13) => t13 instanceof MouseEvent, click: (t13) => t13 instanceof MouseEvent }; var TM = defineComponent({ name: "ElTag" }); var IM = defineComponent({ ...TM, props: xp, emits: _M, setup(t13, { emit: e }) { const r = t13, n = Oa(), a = Ge("tag"), i = computed(() => { const { type: l, hit: c, effect: d, closable: f, round: h10 } = r; return [ a.b(), a.is("closable", f), a.m(l || "primary"), a.m(n.value), a.m(d), a.is("hit", c), a.is("round", h10) ]; }), o = (l) => { e("close", l); }, s = (l) => { e("click", l); }, u = (l) => { l.component.subTree.component.bum = null; }; return (l, c) => l.disableTransitions ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(unref(i)), style: normalizeStyle({ backgroundColor: l.color }), onClick: s }, [ createBaseVNode("span", { class: normalizeClass(unref(a).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(Ft), { key: 0, class: normalizeClass(unref(a).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(close_default)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6)) : (openBlock(), createBlock(Transition, { key: 1, name: `${unref(a).namespace.value}-zoom-in-center`, appear: "", onVnodeMounted: u }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(unref(i)), style: normalizeStyle({ backgroundColor: l.color }), onClick: s }, [ createBaseVNode("span", { class: normalizeClass(unref(a).e("content")) }, [ renderSlot(l.$slots, "default") ], 2), l.closable ? (openBlock(), createBlock(unref(Ft), { key: 0, class: normalizeClass(unref(a).e("close")), onClick: withModifiers(o, ["stop"]) }, { default: withCtx(() => [ createVNode(unref(close_default)) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true) ], 6) ]), _: 3 }, 8, ["name"])); } }); var OM = Ke(IM, [["__file", "tag.vue"]]); var AM = Vt(OM); var B2 = Symbol("rowContextKey"); var PM = [ "start", "center", "end", "space-around", "space-between", "space-evenly" ]; var DM = ["top", "middle", "bottom"]; var RM = rt({ tag: { type: String, default: "div" }, gutter: { type: Number, default: 0 }, justify: { type: String, values: PM, default: "start" }, align: { type: String, values: DM } }); var LM = defineComponent({ name: "ElRow" }); var FM = defineComponent({ ...LM, props: RM, setup(t13) { const e = t13, r = Ge("row"), n = computed(() => e.gutter); provide(B2, { gutter: n }); const a = computed(() => { const o = {}; return e.gutter && (o.marginRight = o.marginLeft = `-${e.gutter / 2}px`), o; }), i = computed(() => [ r.b(), r.is(`justify-${e.justify}`, e.justify !== "start"), r.is(`align-${e.align}`, !!e.align) ]); return (o, s) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(i)), style: normalizeStyle(unref(a)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var MM = Ke(FM, [["__file", "row.vue"]]); var Dl = Vt(MM); var NM = rt({ tag: { type: String, default: "div" }, span: { type: Number, default: 24 }, offset: { type: Number, default: 0 }, pull: { type: Number, default: 0 }, push: { type: Number, default: 0 }, xs: { type: qe([Number, Object]), default: () => oi({}) }, sm: { type: qe([Number, Object]), default: () => oi({}) }, md: { type: qe([Number, Object]), default: () => oi({}) }, lg: { type: qe([Number, Object]), default: () => oi({}) }, xl: { type: qe([Number, Object]), default: () => oi({}) } }); var BM = defineComponent({ name: "ElCol" }); var $M = defineComponent({ ...BM, props: NM, setup(t13) { const e = t13, { gutter: r } = inject(B2, { gutter: computed(() => 0) }), n = Ge("col"), a = computed(() => { const o = {}; return r.value && (o.paddingLeft = o.paddingRight = `${r.value / 2}px`), o; }), i = computed(() => { const o = []; return ["span", "offset", "pull", "push"].forEach((l) => { const c = e[l]; Ut(c) && (l === "span" ? o.push(n.b(`${e[l]}`)) : c > 0 && o.push(n.b(`${l}-${e[l]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((l) => { Ut(e[l]) ? o.push(n.b(`${l}-${e[l]}`)) : Gt(e[l]) && Object.entries(e[l]).forEach(([c, d]) => { o.push(c !== "span" ? n.b(`${l}-${c}-${d}`) : n.b(`${l}-${d}`)); }); }), r.value && o.push(n.is("guttered")), [n.b(), o]; }); return (o, s) => (openBlock(), createBlock(resolveDynamicComponent(o.tag), { class: normalizeClass(unref(i)), style: normalizeStyle(unref(a)) }, { default: withCtx(() => [ renderSlot(o.$slots, "default") ]), _: 3 }, 8, ["class", "style"])); } }); var qM = Ke($M, [["__file", "col.vue"]]); var Qo = Vt(qM); var zM = defineComponent({ name: "ElCollapseTransition" }); var VM = defineComponent({ ...zM, setup(t13) { const e = Ge("collapse-transition"), r = (a) => { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom; }, n = { beforeEnter(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.style.height && (a.dataset.elExistsHeight = a.style.height), a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0; }, enter(a) { requestAnimationFrame(() => { a.dataset.oldOverflow = a.style.overflow, a.dataset.elExistsHeight ? a.style.maxHeight = a.dataset.elExistsHeight : a.scrollHeight !== 0 ? a.style.maxHeight = `${a.scrollHeight}px` : a.style.maxHeight = 0, a.style.paddingTop = a.dataset.oldPaddingTop, a.style.paddingBottom = a.dataset.oldPaddingBottom, a.style.overflow = "hidden"; }); }, afterEnter(a) { a.style.maxHeight = "", a.style.overflow = a.dataset.oldOverflow; }, enterCancelled(a) { r(a); }, beforeLeave(a) { a.dataset || (a.dataset = {}), a.dataset.oldPaddingTop = a.style.paddingTop, a.dataset.oldPaddingBottom = a.style.paddingBottom, a.dataset.oldOverflow = a.style.overflow, a.style.maxHeight = `${a.scrollHeight}px`, a.style.overflow = "hidden"; }, leave(a) { a.scrollHeight !== 0 && (a.style.maxHeight = 0, a.style.paddingTop = 0, a.style.paddingBottom = 0); }, afterLeave(a) { r(a); }, leaveCancelled(a) { r(a); } }; return (a, i) => (openBlock(), createBlock(Transition, mergeProps({ name: unref(e).b() }, toHandlers(n)), { default: withCtx(() => [ renderSlot(a.$slots, "default") ]), _: 3 }, 16, ["name"])); } }); var HM = Ke(VM, [["__file", "collapse-transition.vue"]]); var KM = Vt(HM); var GM = rt({ color: { type: qe(Object), required: true }, vertical: { type: Boolean, default: false } }); var Tu = false; function Ao(t13, e) { if (!It) return; const r = function(i) { var o; (o = e.drag) == null || o.call(e, i); }, n = function(i) { var o; document.removeEventListener("mousemove", r), document.removeEventListener("mouseup", n), document.removeEventListener("touchmove", r), document.removeEventListener("touchend", n), document.onselectstart = null, document.ondragstart = null, Tu = false, (o = e.end) == null || o.call(e, i); }, a = function(i) { var o; Tu || (i.preventDefault(), document.onselectstart = () => false, document.ondragstart = () => false, document.addEventListener("mousemove", r), document.addEventListener("mouseup", n), document.addEventListener("touchmove", r), document.addEventListener("touchend", n), Tu = true, (o = e.start) == null || o.call(e, i)); }; t13.addEventListener("mousedown", a), t13.addEventListener("touchstart", a, { passive: false }); } var UM = (t13) => { const e = getCurrentInstance(), { t: r } = Uo(), n = shallowRef(), a = shallowRef(), i = computed(() => t13.color.get("alpha")), o = computed(() => r("el.colorpicker.alphaLabel")); function s(d) { var f; d.target !== n.value && u(d), (f = n.value) == null || f.focus(); } function u(d) { if (!a.value || !n.value) return; const h10 = e.vnode.el.getBoundingClientRect(), { clientX: v, clientY: p } = Wp(d); if (t13.vertical) { let g = p - h10.top; g = Math.max(n.value.offsetHeight / 2, g), g = Math.min(g, h10.height - n.value.offsetHeight / 2), t13.color.set("alpha", Math.round((g - n.value.offsetHeight / 2) / (h10.height - n.value.offsetHeight) * 100)); } else { let g = v - h10.left; g = Math.max(n.value.offsetWidth / 2, g), g = Math.min(g, h10.width - n.value.offsetWidth / 2), t13.color.set("alpha", Math.round((g - n.value.offsetWidth / 2) / (h10.width - n.value.offsetWidth) * 100)); } } function l(d) { const { code: f, shiftKey: h10 } = d, v = h10 ? 10 : 1; switch (f) { case Rt.left: case Rt.down: d.preventDefault(), d.stopPropagation(), c(-v); break; case Rt.right: case Rt.up: d.preventDefault(), d.stopPropagation(), c(v); break; } } function c(d) { let f = i.value + d; f = f < 0 ? 0 : f > 100 ? 100 : f, t13.color.set("alpha", f); } return { thumb: n, bar: a, alpha: i, alphaLabel: o, handleDrag: u, handleClick: s, handleKeydown: l }; }; var WM = (t13, { bar: e, thumb: r, handleDrag: n }) => { const a = getCurrentInstance(), i = Ge("color-alpha-slider"), o = ref(0), s = ref(0), u = ref(); function l() { if (!r.value || t13.vertical) return 0; const m = a.vnode.el, b = t13.color.get("alpha"); return m ? Math.round(b * (m.offsetWidth - r.value.offsetWidth / 2) / 100) : 0; } function c() { if (!r.value) return 0; const m = a.vnode.el; if (!t13.vertical) return 0; const b = t13.color.get("alpha"); return m ? Math.round(b * (m.offsetHeight - r.value.offsetHeight / 2) / 100) : 0; } function d() { if (t13.color && t13.color.value) { const { r: m, g: b, b: w } = t13.color.toRgb(); return `linear-gradient(to right, rgba(${m}, ${b}, ${w}, 0) 0%, rgba(${m}, ${b}, ${w}, 1) 100%)`; } return ""; } function f() { o.value = l(), s.value = c(), u.value = d(); } onMounted(() => { if (!e.value || !r.value) return; const m = { drag: (b) => { n(b); }, end: (b) => { n(b); } }; Ao(e.value, m), Ao(r.value, m), f(); }), watch(() => t13.color.get("alpha"), () => f()), watch(() => t13.color.value, () => f()); const h10 = computed(() => [i.b(), i.is("vertical", t13.vertical)]), v = computed(() => i.e("bar")), p = computed(() => i.e("thumb")), g = computed(() => ({ background: u.value })), y = computed(() => ({ left: wi(o.value), top: wi(s.value) })); return { rootKls: h10, barKls: v, barStyle: g, thumbKls: p, thumbStyle: y, update: f }; }; var jM = "ElColorAlphaSlider"; var YM = defineComponent({ name: jM }); var ZM = defineComponent({ ...YM, props: GM, setup(t13, { expose: e }) { const r = t13, { alpha: n, alphaLabel: a, bar: i, thumb: o, handleDrag: s, handleClick: u, handleKeydown: l } = UM(r), { rootKls: c, barKls: d, barStyle: f, thumbKls: h10, thumbStyle: v, update: p } = WM(r, { bar: i, thumb: o, handleDrag: s }); return e({ update: p, bar: i, thumb: o }), (g, y) => (openBlock(), createElementBlock("div", { class: normalizeClass(unref(c)) }, [ createBaseVNode("div", { ref_key: "bar", ref: i, class: normalizeClass(unref(d)), style: normalizeStyle(unref(f)), onClick: unref(u) }, null, 14, ["onClick"]), createBaseVNode("div", { ref_key: "thumb", ref: o, class: normalizeClass(unref(h10)), style: normalizeStyle(unref(v)), "aria-label": unref(a), "aria-valuenow": unref(n), "aria-orientation": g.vertical ? "vertical" : "horizontal", "aria-valuemin": "0", "aria-valuemax": "100", role: "slider", tabindex: "0", onKeydown: unref(l) }, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"]) ], 2)); } }); var XM = Ke(ZM, [["__file", "alpha-slider.vue"]]); var JM = defineComponent({ name: "ElColorHueSlider", props: { color: { type: Object, required: true }, vertical: Boolean }, setup(t13) { const e = Ge("color-hue-slider"), r = getCurrentInstance(), n = ref(), a = ref(), i = ref(0), o = ref(0), s = computed(() => t13.color.get("hue")); watch(() => s.value, () => { f(); }); function u(h10) { h10.target !== n.value && l(h10); } function l(h10) { if (!a.value || !n.value) return; const p = r.vnode.el.getBoundingClientRect(), { clientX: g, clientY: y } = Wp(h10); let m; if (t13.vertical) { let b = y - p.top; b = Math.min(b, p.height - n.value.offsetHeight / 2), b = Math.max(n.value.offsetHeight / 2, b), m = Math.round((b - n.value.offsetHeight / 2) / (p.height - n.value.offsetHeight) * 360); } else { let b = g - p.left; b = Math.min(b, p.width - n.value.offsetWidth / 2), b = Math.max(n.value.offsetWidth / 2, b), m = Math.round((b - n.value.offsetWidth / 2) / (p.width - n.value.offsetWidth) * 360); } t13.color.set("hue", m); } function c() { if (!n.value) return 0; const h10 = r.vnode.el; if (t13.vertical) return 0; const v = t13.color.get("hue"); return h10 ? Math.round(v * (h10.offsetWidth - n.value.offsetWidth / 2) / 360) : 0; } function d() { if (!n.value) return 0; const h10 = r.vnode.el; if (!t13.vertical) return 0; const v = t13.color.get("hue"); return h10 ? Math.round(v * (h10.offsetHeight - n.value.offsetHeight / 2) / 360) : 0; } function f() { i.value = c(), o.value = d(); } return onMounted(() => { if (!a.value || !n.value) return; const h10 = { drag: (v) => { l(v); }, end: (v) => { l(v); } }; Ao(a.value, h10), Ao(n.value, h10), f(); }), { bar: a, thumb: n, thumbLeft: i, thumbTop: o, hueValue: s, handleClick: u, update: f, ns: e }; } }); function QM(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass([t13.ns.b(), t13.ns.is("vertical", t13.vertical)]) }, [ createBaseVNode("div", { ref: "bar", class: normalizeClass(t13.ns.e("bar")), onClick: t13.handleClick }, null, 10, ["onClick"]), createBaseVNode("div", { ref: "thumb", class: normalizeClass(t13.ns.e("thumb")), style: normalizeStyle({ left: t13.thumbLeft + "px", top: t13.thumbTop + "px" }) }, null, 6) ], 2); } var eN = Ke(JM, [["render", QM], ["__file", "hue-slider.vue"]]); var tN = rt({ modelValue: String, id: String, showAlpha: Boolean, colorFormat: String, disabled: Boolean, size: Di, popperClass: { type: String, default: "" }, tabindex: { type: [String, Number], default: 0 }, teleported: fr.teleported, predefine: { type: qe(Array) }, validateEvent: { type: Boolean, default: true }, ...sa(["ariaLabel"]) }); var rN = { [Kt]: (t13) => nr(t13) || Yn(t13), [tg]: (t13) => nr(t13) || Yn(t13), activeChange: (t13) => nr(t13) || Yn(t13), focus: (t13) => t13 instanceof FocusEvent, blur: (t13) => t13 instanceof FocusEvent }; var $2 = Symbol("colorPickerContextKey"); var Pm = function(t13, e, r) { return [ t13, e * r / ((t13 = (2 - e) * r) < 1 ? t13 : 2 - t13) || 0, t13 / 2 ]; }; var nN = function(t13) { return typeof t13 == "string" && t13.includes(".") && Number.parseFloat(t13) === 1; }; var aN = function(t13) { return typeof t13 == "string" && t13.includes("%"); }; var di = function(t13, e) { nN(t13) && (t13 = "100%"); const r = aN(t13); return t13 = Math.min(e, Math.max(0, Number.parseFloat(`${t13}`))), r && (t13 = Number.parseInt(`${t13 * e}`, 10) / 100), Math.abs(t13 - e) < 1e-6 ? 1 : t13 % e / Number.parseFloat(e); }; var Dm = { 10: "A", 11: "B", 12: "C", 13: "D", 14: "E", 15: "F" }; var qs = (t13) => { t13 = Math.min(Math.round(t13), 255); const e = Math.floor(t13 / 16), r = t13 % 16; return `${Dm[e] || e}${Dm[r] || r}`; }; var Rm = function({ r: t13, g: e, b: r }) { return Number.isNaN(+t13) || Number.isNaN(+e) || Number.isNaN(+r) ? "" : `#${qs(t13)}${qs(e)}${qs(r)}`; }; var Iu = { A: 10, B: 11, C: 12, D: 13, E: 14, F: 15 }; var va = function(t13) { return t13.length === 2 ? (Iu[t13[0].toUpperCase()] || +t13[0]) * 16 + (Iu[t13[1].toUpperCase()] || +t13[1]) : Iu[t13[1].toUpperCase()] || +t13[1]; }; var iN = function(t13, e, r) { e = e / 100, r = r / 100; let n = e; const a = Math.max(r, 0.01); r *= 2, e *= r <= 1 ? r : 2 - r, n *= a <= 1 ? a : 2 - a; const i = (r + e) / 2, o = r === 0 ? 2 * n / (a + n) : 2 * e / (r + e); return { h: t13, s: o * 100, v: i * 100 }; }; var Lm = (t13, e, r) => { t13 = di(t13, 255), e = di(e, 255), r = di(r, 255); const n = Math.max(t13, e, r), a = Math.min(t13, e, r); let i; const o = n, s = n - a, u = n === 0 ? 0 : s / n; if (n === a) i = 0; else { switch (n) { case t13: { i = (e - r) / s + (e < r ? 6 : 0); break; } case e: { i = (r - t13) / s + 2; break; } case r: { i = (t13 - e) / s + 4; break; } } i /= 6; } return { h: i * 360, s: u * 100, v: o * 100 }; }; var eo = function(t13, e, r) { t13 = di(t13, 360) * 6, e = di(e, 100), r = di(r, 100); const n = Math.floor(t13), a = t13 - n, i = r * (1 - e), o = r * (1 - a * e), s = r * (1 - (1 - a) * e), u = n % 6, l = [r, o, i, i, s, r][u], c = [s, r, r, o, i, i][u], d = [i, i, s, r, r, o][u]; return { r: Math.round(l * 255), g: Math.round(c * 255), b: Math.round(d * 255) }; }; var wo = class { constructor(e = {}) { this._hue = 0, this._saturation = 100, this._value = 100, this._alpha = 100, this.enableAlpha = false, this.format = "hex", this.value = ""; for (const r in e) Ta(e, r) && (this[r] = e[r]); e.value ? this.fromString(e.value) : this.doOnChange(); } set(e, r) { if (arguments.length === 1 && typeof e == "object") { for (const n in e) Ta(e, n) && this.set(n, e[n]); return; } this[`_${e}`] = r, this.doOnChange(); } get(e) { return e === "alpha" ? Math.floor(this[`_${e}`]) : this[`_${e}`]; } toRgb() { return eo(this._hue, this._saturation, this._value); } fromString(e) { if (!e) { this._hue = 0, this._saturation = 100, this._value = 100, this.doOnChange(); return; } const r = (n, a, i) => { this._hue = Math.max(0, Math.min(360, n)), this._saturation = Math.max(0, Math.min(100, a)), this._value = Math.max(0, Math.min(100, i)), this.doOnChange(); }; if (e.includes("hsl")) { const n = e.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) { const { h: a, s: i, v: o } = iN(n[0], n[1], n[2]); r(a, i, o); } } else if (e.includes("hsv")) { const n = e.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3 && r(n[0], n[1], n[2]); } else if (e.includes("rgb")) { const n = e.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((a) => a !== "").map((a, i) => i > 2 ? Number.parseFloat(a) : Number.parseInt(a, 10)); if (n.length === 4 ? this._alpha = Number.parseFloat(n[3]) * 100 : n.length === 3 && (this._alpha = 100), n.length >= 3) { const { h: a, s: i, v: o } = Lm(n[0], n[1], n[2]); r(a, i, o); } } else if (e.includes("#")) { const n = e.replace("#", "").trim(); if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(n)) return; let a, i, o; n.length === 3 ? (a = va(n[0] + n[0]), i = va(n[1] + n[1]), o = va(n[2] + n[2])) : (n.length === 6 || n.length === 8) && (a = va(n.slice(0, 2)), i = va(n.slice(2, 4)), o = va(n.slice(4, 6))), n.length === 8 ? this._alpha = va(n.slice(6)) / 255 * 100 : (n.length === 3 || n.length === 6) && (this._alpha = 100); const { h: s, s: u, v: l } = Lm(a, i, o); r(s, u, 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: n, _alpha: a, format: i } = this; if (this.enableAlpha) switch (i) { case "hsl": { const o = Pm(e, r / 100, n / 100); this.value = `hsla(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%, ${this.get("alpha") / 100})`; break; } case "hsv": { this.value = `hsva(${e}, ${Math.round(r)}%, ${Math.round(n)}%, ${this.get("alpha") / 100})`; break; } case "hex": { this.value = `${Rm(eo(e, r, n))}${qs(a * 255 / 100)}`; break; } default: { const { r: o, g: s, b: u } = eo(e, r, n); this.value = `rgba(${o}, ${s}, ${u}, ${this.get("alpha") / 100})`; } } else switch (i) { case "hsl": { const o = Pm(e, r / 100, n / 100); this.value = `hsl(${e}, ${Math.round(o[1] * 100)}%, ${Math.round(o[2] * 100)}%)`; break; } case "hsv": { this.value = `hsv(${e}, ${Math.round(r)}%, ${Math.round(n)}%)`; break; } case "rgb": { const { r: o, g: s, b: u } = eo(e, r, n); this.value = `rgb(${o}, ${s}, ${u})`; break; } default: this.value = Rm(eo(e, r, n)); } } }; var oN = defineComponent({ props: { colors: { type: Array, required: true }, color: { type: Object, required: true }, enableAlpha: { type: Boolean, required: true } }, setup(t13) { const e = Ge("color-predefine"), { currentColor: r } = inject($2), n = ref(i(t13.colors, t13.color)); watch(() => r.value, (o) => { const s = new wo(); s.fromString(o), n.value.forEach((u) => { u.selected = s.compare(u); }); }), watchEffect(() => { n.value = i(t13.colors, t13.color); }); function a(o) { t13.color.fromString(t13.colors[o]); } function i(o, s) { return o.map((u) => { const l = new wo(); return l.enableAlpha = t13.enableAlpha, l.format = "rgba", l.fromString(u), l.selected = l.value === s.value, l; }); } return { rgbaColors: n, handleSelect: a, ns: e }; } }); function sN(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass(t13.ns.b()) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.e("colors")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.rgbaColors, (o, s) => (openBlock(), createElementBlock("div", { key: t13.colors[s], class: normalizeClass([ t13.ns.e("color-selector"), t13.ns.is("alpha", o._alpha < 100), { selected: o.selected } ]), onClick: (u) => t13.handleSelect(s) }, [ createBaseVNode("div", { style: normalizeStyle({ backgroundColor: o.value }) }, null, 4) ], 10, ["onClick"]))), 128)) ], 2) ], 2); } var lN = Ke(oN, [["render", sN], ["__file", "predefine.vue"]]); var uN = defineComponent({ name: "ElSlPanel", props: { color: { type: Object, required: true } }, setup(t13) { const e = Ge("color-svpanel"), r = getCurrentInstance(), n = ref(0), a = ref(0), i = ref("hsl(0, 100%, 50%)"), o = computed(() => { const l = t13.color.get("hue"), c = t13.color.get("value"); return { hue: l, value: c }; }); function s() { const l = t13.color.get("saturation"), c = t13.color.get("value"), d = r.vnode.el, { clientWidth: f, clientHeight: h10 } = d; a.value = l * f / 100, n.value = (100 - c) * h10 / 100, i.value = `hsl(${t13.color.get("hue")}, 100%, 50%)`; } function u(l) { const d = r.vnode.el.getBoundingClientRect(), { clientX: f, clientY: h10 } = Wp(l); let v = f - d.left, p = h10 - d.top; v = Math.max(0, v), v = Math.min(v, d.width), p = Math.max(0, p), p = Math.min(p, d.height), a.value = v, n.value = p, t13.color.set({ saturation: v / d.width * 100, value: 100 - p / d.height * 100 }); } return watch(() => o.value, () => { s(); }), onMounted(() => { Ao(r.vnode.el, { drag: (l) => { u(l); }, end: (l) => { u(l); } }), s(); }), { cursorTop: n, cursorLeft: a, background: i, colorValue: o, handleDrag: u, update: s, ns: e }; } }); function cN(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass(t13.ns.b()), style: normalizeStyle({ backgroundColor: t13.background }) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.e("white")) }, null, 2), createBaseVNode("div", { class: normalizeClass(t13.ns.e("black")) }, null, 2), createBaseVNode("div", { class: normalizeClass(t13.ns.e("cursor")), style: normalizeStyle({ top: t13.cursorTop + "px", left: t13.cursorLeft + "px" }) }, [ createBaseVNode("div") ], 6) ], 6); } var dN = Ke(uN, [["render", cN], ["__file", "sv-panel.vue"]]); var fN = defineComponent({ name: "ElColorPicker" }); var vN = defineComponent({ ...fN, props: tN, emits: rN, setup(t13, { expose: e, emit: r }) { const n = t13, { t: a } = Uo(), i = Ge("color"), { formItem: o } = Va(), s = Oa(), u = Yo(), { inputId: l, isLabeledByFormItem: c } = Zo(n, { formItemContext: o }), d = ref(), f = ref(), h10 = ref(), v = ref(), p = ref(), g = ref(), { isFocused: y, handleFocus: m, handleBlur: b } = dg(p, { beforeFocus() { return u.value; }, beforeBlur(N) { var X; return (X = v.value) == null ? void 0 : X.isFocusInsideContent(N); }, afterBlur() { F(false), V(); } }); let w = true; const x = reactive(new wo({ enableAlpha: n.showAlpha, format: n.colorFormat || "", value: n.modelValue })), E = ref(false), C = ref(false), k = ref(""), S = computed(() => !n.modelValue && !C.value ? "transparent" : A(x, n.showAlpha)), _ = computed(() => !n.modelValue && !C.value ? "" : x.value), T = computed(() => c.value ? void 0 : n.ariaLabel || a("el.colorpicker.defaultLabel")), O = computed(() => c.value ? o == null ? void 0 : o.labelId : void 0), D = computed(() => [ i.b("picker"), i.is("disabled", u.value), i.bm("picker", s.value), i.is("focused", y.value) ]); function A(N, X) { if (!(N instanceof wo)) throw new TypeError("color should be instance of _color Class"); const { r: Q, g: ge, b: we } = N.toRgb(); return X ? `rgba(${Q}, ${ge}, ${we}, ${N.get("alpha") / 100})` : `rgb(${Q}, ${ge}, ${we})`; } function F(N) { E.value = N; } const R = GE(F, 100, { leading: true }); function M() { u.value || F(true); } function L() { R(false), V(); } function V() { nextTick(() => { n.modelValue ? x.fromString(n.modelValue) : (x.value = "", nextTick(() => { C.value = false; })); }); } function Y() { u.value || R(!E.value); } function H() { x.fromString(k.value); } function K() { const N = x.value; r(Kt, N), r("change", N), n.validateEvent && (o == null || o.validate("change").catch((X) => Ot(X))), R(false), nextTick(() => { const X = new wo({ enableAlpha: n.showAlpha, format: n.colorFormat || "", value: n.modelValue }); x.compare(X) || V(); }); } function ne() { R(false), r(Kt, null), r("change", null), n.modelValue !== null && n.validateEvent && (o == null || o.validate("change").catch((N) => Ot(N))), V(); } function B() { E.value && (L(), y.value && W()); } function $(N) { N.preventDefault(), N.stopPropagation(), F(false), V(); } function z(N) { switch (N.code) { case Rt.enter: case Rt.space: N.preventDefault(), N.stopPropagation(), M(), g.value.focus(); break; case Rt.esc: $(N); break; } } function W() { p.value.focus(); } function Z() { p.value.blur(); } return onMounted(() => { n.modelValue && (k.value = _.value); }), watch(() => n.modelValue, (N) => { N ? N && N !== x.value && (w = false, x.fromString(N)) : C.value = false; }), watch(() => [n.colorFormat, n.showAlpha], () => { x.enableAlpha = n.showAlpha, x.format = n.colorFormat || x.format, x.doOnChange(), r(Kt, x.value); }), watch(() => _.value, (N) => { k.value = N, w && r("activeChange", N), w = true; }), watch(() => x.value, () => { !n.modelValue && !C.value && (C.value = true); }), watch(() => E.value, () => { nextTick(() => { var N, X, Q; (N = d.value) == null || N.update(), (X = f.value) == null || X.update(), (Q = h10.value) == null || Q.update(); }); }), provide($2, { currentColor: _ }), e({ color: x, show: M, hide: L, focus: W, blur: Z }), (N, X) => (openBlock(), createBlock(unref(Jo), { ref_key: "popper", ref: v, visible: E.value, "show-arrow": false, "fallback-placements": ["bottom", "top", "right", "left"], offset: 0, "gpu-acceleration": false, "popper-class": [unref(i).be("picker", "panel"), unref(i).b("dropdown"), N.popperClass], "stop-popper-mouse-event": false, effect: "light", trigger: "click", teleported: N.teleported, transition: `${unref(i).namespace.value}-zoom-in-top`, persistent: "", onHide: (Q) => F(false) }, { content: withCtx(() => [ withDirectives((openBlock(), createElementBlock("div", { onKeydown: withKeys($, ["esc"]) }, [ createBaseVNode("div", { class: normalizeClass(unref(i).be("dropdown", "main-wrapper")) }, [ createVNode(eN, { ref_key: "hue", ref: d, class: "hue-slider", color: unref(x), vertical: "" }, null, 8, ["color"]), createVNode(dN, { ref_key: "sv", ref: f, color: unref(x) }, null, 8, ["color"]) ], 2), N.showAlpha ? (openBlock(), createBlock(XM, { key: 0, ref_key: "alpha", ref: h10, color: unref(x) }, null, 8, ["color"])) : createCommentVNode("v-if", true), N.predefine ? (openBlock(), createBlock(lN, { key: 1, ref: "predefine", "enable-alpha": N.showAlpha, color: unref(x), colors: N.predefine }, null, 8, ["enable-alpha", "color", "colors"])) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(i).be("dropdown", "btns")) }, [ createBaseVNode("span", { class: normalizeClass(unref(i).be("dropdown", "value")) }, [ createVNode(unref(Xo), { ref_key: "inputRef", ref: g, modelValue: k.value, "onUpdate:modelValue": (Q) => k.value = Q, "validate-event": false, size: "small", onKeyup: withKeys(H, ["enter"]), onBlur: H }, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"]) ], 2), createVNode(unref(mr), { class: normalizeClass(unref(i).be("dropdown", "link-btn")), text: "", size: "small", onClick: ne }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(a)("el.colorpicker.clear")), 1) ]), _: 1 }, 8, ["class"]), createVNode(unref(mr), { plain: "", size: "small", class: normalizeClass(unref(i).be("dropdown", "btn")), onClick: K }, { default: withCtx(() => [ createTextVNode(toDisplayString(unref(a)("el.colorpicker.confirm")), 1) ]), _: 1 }, 8, ["class"]) ], 2) ], 40, ["onKeydown"])), [ [unref(D2), B] ]) ]), default: withCtx(() => [ createBaseVNode("div", mergeProps({ id: unref(l), ref_key: "triggerRef", ref: p }, N.$attrs, { class: unref(D), role: "button", "aria-label": unref(T), "aria-labelledby": unref(O), "aria-description": unref(a)("el.colorpicker.description", { color: N.modelValue || "" }), "aria-disabled": unref(u), tabindex: unref(u) ? -1 : N.tabindex, onKeydown: z, onFocus: unref(m), onBlur: unref(b) }), [ unref(u) ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(i).be("picker", "mask")) }, null, 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { class: normalizeClass(unref(i).be("picker", "trigger")), onClick: Y }, [ createBaseVNode("span", { class: normalizeClass([unref(i).be("picker", "color"), unref(i).is("alpha", N.showAlpha)]) }, [ createBaseVNode("span", { class: normalizeClass(unref(i).be("picker", "color-inner")), style: normalizeStyle({ backgroundColor: unref(S) }) }, [ withDirectives(createVNode(unref(Ft), { class: normalizeClass([unref(i).be("picker", "icon"), unref(i).is("icon-arrow-down")]) }, { default: withCtx(() => [ createVNode(unref(arrow_down_default)) ]), _: 1 }, 8, ["class"]), [ [vShow, N.modelValue || C.value] ]), withDirectives(createVNode(unref(Ft), { class: normalizeClass([unref(i).be("picker", "empty"), unref(i).is("icon-close")]) }, { default: withCtx(() => [ createVNode(unref(close_default)) ]), _: 1 }, 8, ["class"]), [ [vShow, !N.modelValue && !C.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 hN = Ke(vN, [["__file", "color-picker.vue"]]); var pN = Vt(hN); var gN = defineComponent({ name: "ElContainer" }); var yN = defineComponent({ ...gN, props: { direction: { type: String } }, setup(t13) { const e = t13, r = useSlots(), n = Ge("container"), a = computed(() => e.direction === "vertical" ? true : e.direction === "horizontal" ? false : r && r.default ? r.default().some((o) => { const s = o.type.name; return s === "ElHeader" || s === "ElFooter"; }) : false); return (i, o) => (openBlock(), createElementBlock("section", { class: normalizeClass([unref(n).b(), unref(n).is("vertical", unref(a))]) }, [ renderSlot(i.$slots, "default") ], 2)); } }); var mN = Ke(yN, [["__file", "container.vue"]]); var bN = defineComponent({ name: "ElAside" }); var wN = defineComponent({ ...bN, props: { width: { type: String, default: null } }, setup(t13) { const e = t13, r = Ge("aside"), n = computed(() => e.width ? r.cssVarBlock({ width: e.width }) : {}); return (a, i) => (openBlock(), createElementBlock("aside", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var q2 = Ke(wN, [["__file", "aside.vue"]]); var CN = defineComponent({ name: "ElFooter" }); var xN = defineComponent({ ...CN, props: { height: { type: String, default: null } }, setup(t13) { const e = t13, r = Ge("footer"), n = computed(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (a, i) => (openBlock(), createElementBlock("footer", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var z2 = Ke(xN, [["__file", "footer.vue"]]); var EN = defineComponent({ name: "ElHeader" }); var SN = defineComponent({ ...EN, props: { height: { type: String, default: null } }, setup(t13) { const e = t13, r = Ge("header"), n = computed(() => e.height ? r.cssVarBlock({ height: e.height }) : {}); return (a, i) => (openBlock(), createElementBlock("header", { class: normalizeClass(unref(r).b()), style: normalizeStyle(unref(n)) }, [ renderSlot(a.$slots, "default") ], 6)); } }); var V2 = Ke(SN, [["__file", "header.vue"]]); var kN = defineComponent({ name: "ElMain" }); var _N = defineComponent({ ...kN, setup(t13) { const e = Ge("main"); return (r, n) => (openBlock(), createElementBlock("main", { class: normalizeClass(unref(e).b()) }, [ renderSlot(r.$slots, "default") ], 2)); } }); var H2 = Ke(_N, [["__file", "main.vue"]]); var bg = Vt(mN, { Aside: q2, Footer: z2, Header: V2, Main: H2 }); An(q2); An(z2); var K2 = An(V2); var wg = An(H2); var TN = defineComponent({ inheritAttrs: false }); function IN(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default"); } var ON = Ke(TN, [["render", IN], ["__file", "collection.vue"]]); var AN = defineComponent({ name: "ElCollectionItem", inheritAttrs: false }); function PN(t13, e, r, n, a, i) { return renderSlot(t13.$slots, "default"); } var DN = Ke(AN, [["render", PN], ["__file", "collection-item.vue"]]); var RN = "data-el-collection-item"; var LN = (t13) => { const e = `El${t13}Collection`, r = `${e}Item`, n = Symbol(e), a = Symbol(r), i = { ...ON, name: e, setup() { const s = ref(null), u = /* @__PURE__ */ new Map(); provide(n, { itemMap: u, getItems: () => { const c = unref(s); if (!c) return []; const d = Array.from(c.querySelectorAll(`[${RN}]`)); return [...u.values()].sort((h10, v) => d.indexOf(h10.ref) - d.indexOf(v.ref)); }, collectionRef: s }); } }, o = { ...DN, name: r, setup(s, { attrs: u }) { const l = ref(null), c = inject(n, void 0); provide(a, { collectionItemRef: l }), onMounted(() => { const d = unref(l); d && c.itemMap.set(d, { ref: d, ...u }); }), onBeforeUnmount(() => { const d = unref(l); c.itemMap.delete(d); }); } }; return { COLLECTION_INJECTION_KEY: n, COLLECTION_ITEM_INJECTION_KEY: a, ElCollection: i, ElCollectionItem: o }; }; var Ou = rt({ trigger: Oo.trigger, effect: { ...fr.effect, default: "light" }, type: { type: qe(String) }, placement: { type: qe(String), default: "bottom" }, popperOptions: { type: qe(Object), default: () => ({}) }, id: String, size: { type: String, default: "" }, splitButton: Boolean, hideOnClick: { type: Boolean, default: true }, loop: { type: Boolean, default: true }, showTimeout: { type: Number, default: 150 }, hideTimeout: { type: Number, default: 150 }, tabindex: { type: qe([Number, String]), default: 0 }, maxHeight: { type: qe([Number, String]), default: "" }, popperClass: { type: String, default: "" }, disabled: Boolean, role: { type: String, default: "menu" }, buttonProps: { type: qe(Object) }, teleported: fr.teleported }); rt({ command: { type: [Object, String, Number], default: () => ({}) }, disabled: Boolean, divided: Boolean, textValue: String, icon: { type: Qn } }); rt({ onKeydown: { type: qe(Function) } }); LN("Dropdown"); var G2 = Symbol("ElSelectGroup"); var es = Symbol("ElSelect"); function FN(t13, e) { const r = inject(es), n = inject(G2, { disabled: false }), a = computed(() => c(Kn(r.props.modelValue), t13.value)), i = computed(() => { var h10; if (r.props.multiple) { const v = Kn((h10 = r.props.modelValue) != null ? h10 : []); return !a.value && v.length >= r.props.multipleLimit && r.props.multipleLimit > 0; } else return false; }), o = computed(() => t13.label || (Gt(t13.value) ? "" : t13.value)), s = computed(() => t13.value || t13.label || ""), u = computed(() => t13.disabled || e.groupDisabled || i.value), l = getCurrentInstance(), c = (h10 = [], v) => { if (Gt(t13.value)) { const p = r.props.valueKey; return h10 && h10.some((g) => toRaw(wn(g, p)) === wn(v, p)); } else return h10 && h10.includes(v); }, d = () => { !t13.disabled && !n.disabled && (r.states.hoveringIndex = r.optionsArray.indexOf(l.proxy)); }, f = (h10) => { const v = new RegExp(bD(h10), "i"); e.visible = v.test(o.value) || t13.created; }; return watch(() => o.value, () => { !t13.created && !r.props.remote && r.setSelected(); }), watch(() => t13.value, (h10, v) => { const { remote: p, valueKey: g } = r.props; if (h10 !== v && (r.onOptionDestroy(v, l.proxy), r.onOptionCreate(l.proxy)), !t13.created && !p) { if (g && Gt(h10) && Gt(v) && h10[g] === v[g]) return; r.setSelected(); } }), watch(() => n.disabled, () => { e.groupDisabled = n.disabled; }, { immediate: true }), { select: r, currentLabel: o, currentValue: s, itemSelected: a, isDisabled: u, hoverItem: d, updateOption: f }; } var MN = defineComponent({ name: "ElOption", componentName: "ElOption", props: { value: { required: true, type: [String, Number, Boolean, Object] }, label: [String, Number], created: Boolean, disabled: Boolean }, setup(t13) { const e = Ge("select"), r = Al(), n = computed(() => [ e.be("dropdown", "item"), e.is("disabled", unref(s)), e.is("selected", unref(o)), e.is("hovering", unref(f)) ]), a = reactive({ index: -1, groupDisabled: false, visible: true, hover: false }), { currentLabel: i, itemSelected: o, isDisabled: s, select: u, hoverItem: l, updateOption: c } = FN(t13, a), { visible: d, hover: f } = toRefs(a), h10 = getCurrentInstance().proxy; u.onOptionCreate(h10), onBeforeUnmount(() => { const p = h10.value, { selected: g } = u.states, m = (u.props.multiple ? g : [g]).some((b) => b.value === h10.value); nextTick(() => { u.states.cachedOptions.get(p) === h10 && !m && u.states.cachedOptions.delete(p); }), u.onOptionDestroy(p, h10); }); function v() { s.value || u.handleOptionSelect(h10); } return { ns: e, id: r, containerKls: n, currentLabel: i, itemSelected: o, isDisabled: s, select: u, hoverItem: l, updateOption: c, visible: d, hover: f, selectOptionClick: v, states: a }; } }); function NN(t13, e, r, n, a, i) { return withDirectives((openBlock(), createElementBlock("li", { id: t13.id, class: normalizeClass(t13.containerKls), role: "option", "aria-disabled": t13.isDisabled || void 0, "aria-selected": t13.itemSelected, onMouseenter: t13.hoverItem, onClick: withModifiers(t13.selectOptionClick, ["stop"]) }, [ renderSlot(t13.$slots, "default", {}, () => [ createBaseVNode("span", null, toDisplayString(t13.currentLabel), 1) ]) ], 42, ["id", "aria-disabled", "aria-selected", "onMouseenter", "onClick"])), [ [vShow, t13.visible] ]); } var Cg = Ke(MN, [["render", NN], ["__file", "option.vue"]]); var BN = defineComponent({ name: "ElSelectDropdown", componentName: "ElSelectDropdown", setup() { const t13 = inject(es), e = Ge("select"), r = computed(() => t13.props.popperClass), n = computed(() => t13.props.multiple), a = computed(() => t13.props.fitInputWidth), i = ref(""); function o() { var s; i.value = `${(s = t13.selectRef) == null ? void 0 : s.offsetWidth}px`; } return onMounted(() => { o(), bn(t13.selectRef, o); }), { ns: e, minWidth: i, popperClass: r, isMultiple: n, isFitInputWidth: a }; } }); function $N(t13, e, r, n, a, i) { return openBlock(), createElementBlock("div", { class: normalizeClass([t13.ns.b("dropdown"), t13.ns.is("multiple", t13.isMultiple), t13.popperClass]), style: normalizeStyle({ [t13.isFitInputWidth ? "width" : "minWidth"]: t13.minWidth }) }, [ t13.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.be("dropdown", "header")) }, [ renderSlot(t13.$slots, "header") ], 2)) : createCommentVNode("v-if", true), renderSlot(t13.$slots, "default"), t13.$slots.footer ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(t13.ns.be("dropdown", "footer")) }, [ renderSlot(t13.$slots, "footer") ], 2)) : createCommentVNode("v-if", true) ], 6); } var qN = Ke(BN, [["render", $N], ["__file", "select-dropdown.vue"]]); var zN = 11; var VN = (t13, e) => { const { t: r } = Uo(), n = Al(), a = Ge("select"), i = Ge("input"), o = reactive({ inputValue: "", options: /* @__PURE__ */ new Map(), cachedOptions: /* @__PURE__ */ new Map(), disabledOptions: /* @__PURE__ */ new Map(), optionValues: [], selected: [], selectionWidth: 0, calculatorWidth: 0, collapseItemWidth: 0, selectedLabel: "", hoveringIndex: -1, previousQuery: null, inputHovering: false, menuVisibleOnFocus: false, isBeforeHide: false }), s = ref(null), u = ref(null), l = ref(null), c = ref(null), d = ref(null), f = ref(null), h10 = ref(null), v = ref(null), p = ref(null), g = ref(null), y = ref(null), m = ref(null), { isComposing: b, handleCompositionStart: w, handleCompositionUpdate: x, handleCompositionEnd: E } = b2({ afterComposition: (re) => se(re) }), { wrapperRef: C, isFocused: k } = dg(d, { beforeFocus() { return R.value; }, afterFocus() { t13.automaticDropdown && !S.value && (S.value = true, o.menuVisibleOnFocus = true); }, beforeBlur(re) { var Ee, We; return ((Ee = l.value) == null ? void 0 : Ee.isFocusInsideContent(re)) || ((We = c.value) == null ? void 0 : We.isFocusInsideContent(re)); }, afterBlur() { S.value = false, o.menuVisibleOnFocus = false; } }), S = ref(false), _ = ref(), { form: T, formItem: O } = Va(), { inputId: D } = Zo(t13, { formItemContext: O }), { valueOnClear: A, isEmptyValue: F } = tL(t13), R = computed(() => t13.disabled || (T == null ? void 0 : T.disabled)), M = computed(() => hr(t13.modelValue) ? t13.modelValue.length > 0 : !F(t13.modelValue)), L = computed(() => t13.clearable && !R.value && o.inputHovering && M.value), V = computed(() => t13.remote && t13.filterable && !t13.remoteShowSuffix ? "" : t13.suffixIcon), Y = computed(() => a.is("reverse", V.value && S.value)), H = computed(() => (O == null ? void 0 : O.validateState) || ""), K = computed(() => ZE[H.value]), ne = computed(() => t13.remote ? 300 : 0), B = computed(() => t13.loading ? t13.loadingText || r("el.select.loading") : t13.remote && !o.inputValue && o.options.size === 0 ? false : t13.filterable && o.inputValue && o.options.size > 0 && $.value === 0 ? t13.noMatchText || r("el.select.noMatch") : o.options.size === 0 ? t13.noDataText || r("el.select.noData") : null), $ = computed(() => z.value.filter((re) => re.visible).length), z = computed(() => { const re = Array.from(o.options.values()), Ee = []; return o.optionValues.forEach((We) => { const at = re.findIndex((Qr) => Qr.value === We); at > -1 && Ee.push(re[at]); }), Ee.length >= re.length ? Ee : re; }), W = computed(() => Array.from(o.cachedOptions.values())), Z = computed(() => { const re = z.value.filter((Ee) => !Ee.created).some((Ee) => Ee.currentLabel === o.inputValue); return t13.filterable && t13.allowCreate && o.inputValue !== "" && !re; }), N = () => { t13.filterable && cr(t13.filterMethod) || t13.filterable && t13.remote && cr(t13.remoteMethod) || z.value.forEach((re) => { var Ee; (Ee = re.updateOption) == null || Ee.call(re, o.inputValue); }); }, X = Oa(), Q = computed(() => ["small"].includes(X.value) ? "small" : "default"), ge = computed({ get() { return S.value && B.value !== false; }, set(re) { S.value = re; } }), we = computed(() => { if (t13.multiple && !Un(t13.modelValue)) return Kn(t13.modelValue).length === 0 && !o.inputValue; const re = hr(t13.modelValue) ? t13.modelValue[0] : t13.modelValue; return t13.filterable || Un(re) ? !o.inputValue : true; }), fe = computed(() => { var re; const Ee = (re = t13.placeholder) != null ? re : r("el.select.placeholder"); return t13.multiple || !M.value ? Ee : o.selectedLabel; }), ce = computed(() => cp ? null : "mouseenter"); watch(() => t13.modelValue, (re, Ee) => { t13.multiple && t13.filterable && !t13.reserveKeyword && (o.inputValue = "", be("")), xe(), !nl(re, Ee) && t13.validateEvent && (O == null || O.validate("change").catch((We) => Ot(We))); }, { flush: "post", deep: true }), watch(() => S.value, (re) => { re ? be(o.inputValue) : (o.inputValue = "", o.previousQuery = null, o.isBeforeHide = true), e("visible-change", re); }), watch(() => o.options.entries(), () => { var re; if (!It) return; const Ee = ((re = s.value) == null ? void 0 : re.querySelectorAll("input")) || []; (!t13.filterable && !t13.defaultFirstOption && !Un(t13.modelValue) || !Array.from(Ee).includes(document.activeElement)) && xe(), t13.defaultFirstOption && (t13.filterable || t13.remote) && $.value && ve(); }, { flush: "post" }), watch(() => o.hoveringIndex, (re) => { Ut(re) && re > -1 ? _.value = z.value[re] || {} : _.value = {}, z.value.forEach((Ee) => { Ee.hover = _.value === Ee; }); }), watchEffect(() => { o.isBeforeHide || N(); }); const be = (re) => { o.previousQuery === re || b.value || (o.previousQuery = re, t13.filterable && cr(t13.filterMethod) ? t13.filterMethod(re) : t13.filterable && t13.remote && cr(t13.remoteMethod) && t13.remoteMethod(re), t13.defaultFirstOption && (t13.filterable || t13.remote) && $.value ? nextTick(ve) : nextTick(He)); }, ve = () => { const re = z.value.filter((at) => at.visible && !at.disabled && !at.states.groupDisabled), Ee = re.find((at) => at.created), We = re[0]; o.hoveringIndex = Ae(z.value, Ee || We); }, xe = () => { if (t13.multiple) o.selectedLabel = ""; else { const Ee = hr(t13.modelValue) ? t13.modelValue[0] : t13.modelValue, We = _e(Ee); o.selectedLabel = We.currentLabel, o.selected = [We]; return; } const re = []; Un(t13.modelValue) || Kn(t13.modelValue).forEach((Ee) => { re.push(_e(Ee)); }), o.selected = re; }, _e = (re) => { let Ee; const We = gu(re).toLowerCase() === "object", at = gu(re).toLowerCase() === "null", Qr = gu(re).toLowerCase() === "undefined"; for (let pn = o.cachedOptions.size - 1; pn >= 0; pn--) { const _r = W.value[pn]; if (We ? wn(_r.value, t13.valueKey) === wn(re, t13.valueKey) : _r.value === re) { Ee = { value: re, currentLabel: _r.currentLabel, get isDisabled() { return _r.isDisabled; } }; break; } } if (Ee) return Ee; const Mn = We ? re.label : !at && !Qr ? re : ""; return { value: re, currentLabel: Mn }; }, He = () => { o.hoveringIndex = z.value.findIndex((re) => o.selected.some((Ee) => Qt(Ee) === Qt(re))); }, Ve = () => { o.selectionWidth = u.value.getBoundingClientRect().width; }, De = () => { o.calculatorWidth = f.value.getBoundingClientRect().width; }, Ne = () => { o.collapseItemWidth = y.value.getBoundingClientRect().width; }, ue = () => { var re, Ee; (Ee = (re = l.value) == null ? void 0 : re.updatePopper) == null || Ee.call(re); }, I = () => { var re, Ee; (Ee = (re = c.value) == null ? void 0 : re.updatePopper) == null || Ee.call(re); }, G = () => { o.inputValue.length > 0 && !S.value && (S.value = true), be(o.inputValue); }, se = (re) => { if (o.inputValue = re.target.value, t13.remote) ee(); else return G(); }, ee = GE(() => { G(); }, ne.value), te = (re) => { nl(t13.modelValue, re) || e(tg, re); }, ye = (re) => vD(re, (Ee) => !o.disabledOptions.has(Ee)), oe = (re) => { if (t13.multiple && re.code !== Rt.delete && re.target.value.length <= 0) { const Ee = Kn(t13.modelValue).slice(), We = ye(Ee); if (We < 0) return; const at = Ee[We]; Ee.splice(We, 1), e(Kt, Ee), te(Ee), e("remove-tag", at); } }, he = (re, Ee) => { const We = o.selected.indexOf(Ee); if (We > -1 && !R.value) { const at = Kn(t13.modelValue).slice(); at.splice(We, 1), e(Kt, at), te(at), e("remove-tag", Ee.value); } re.stopPropagation(), kt(); }, Oe = (re) => { re.stopPropagation(); const Ee = t13.multiple ? [] : A.value; if (t13.multiple) for (const We of o.selected) We.isDisabled && Ee.push(We.value); e(Kt, Ee), te(Ee), o.hoveringIndex = -1, S.value = false, e("clear"), kt(); }, Pe = (re) => { var Ee; if (t13.multiple) { const We = Kn((Ee = t13.modelValue) != null ? Ee : []).slice(), at = Ae(We, re.value); at > -1 ? We.splice(at, 1) : (t13.multipleLimit <= 0 || We.length < t13.multipleLimit) && We.push(re.value), e(Kt, We), te(We), re.created && be(""), t13.filterable && !t13.reserveKeyword && (o.inputValue = ""); } else e(Kt, re.value), te(re.value), S.value = false; kt(), !S.value && nextTick(() => { $e(re); }); }, Ae = (re = [], Ee) => { if (!Gt(Ee)) return re.indexOf(Ee); const We = t13.valueKey; let at = -1; return re.some((Qr, Mn) => toRaw(wn(Qr, We)) === wn(Ee, We) ? (at = Mn, true) : false), at; }, $e = (re) => { var Ee, We, at, Qr, Mn; const Xa = hr(re) ? re[0] : re; let pn = null; if (Xa != null && Xa.value) { const _r = z.value.filter((Nn) => Nn.value === Xa.value); _r.length > 0 && (pn = _r[0].$el); } if (l.value && pn) { const _r = (Qr = (at = (We = (Ee = l.value) == null ? void 0 : Ee.popperRef) == null ? void 0 : We.contentRef) == null ? void 0 : at.querySelector) == null ? void 0 : Qr.call(at, `.${a.be("dropdown", "wrap")}`); _r && xD(_r, pn); } (Mn = m.value) == null || Mn.handleScroll(); }, Ie = (re) => { o.options.set(re.value, re), o.cachedOptions.set(re.value, re), re.disabled && o.disabledOptions.set(re.value, re); }, Le = (re, Ee) => { o.options.get(re) === Ee && o.options.delete(re); }, ut = computed(() => { var re, Ee; return (Ee = (re = l.value) == null ? void 0 : re.popperRef) == null ? void 0 : Ee.contentRef; }), nt = () => { o.isBeforeHide = false, nextTick(() => $e(o.selected)); }, kt = () => { var re; (re = d.value) == null || re.focus(); }, _t = () => { var re; (re = d.value) == null || re.blur(); }, Ct = (re) => { Oe(re); }, Jt = () => { S.value = false, k.value && _t(); }, Pt = () => { o.inputValue.length > 0 ? o.inputValue = "" : S.value = false; }, $t = () => { R.value || (cp && (o.inputHovering = true), o.menuVisibleOnFocus ? o.menuVisibleOnFocus = false : S.value = !S.value); }, wr = () => { S.value ? z.value[o.hoveringIndex] && Pe(z.value[o.hoveringIndex]) : $t(); }, Qt = (re) => Gt(re.value) ? wn(re.value, t13.valueKey) : re.value, er = computed(() => z.value.filter((re) => re.visible).every((re) => re.disabled)), kr = computed(() => t13.multiple ? t13.collapseTags ? o.selected.slice(0, t13.maxCollapseTags) : o.selected : []), Nr = computed(() => t13.multiple ? t13.collapseTags ? o.selected.slice(t13.maxCollapseTags) : [] : []), dr = (re) => { if (!S.value) { S.value = true; return; } if (!(o.options.size === 0 || o.filteredOptionsCount === 0 || b.value) && !er.value) { re === "next" ? (o.hoveringIndex++, o.hoveringIndex === o.options.size && (o.hoveringIndex = 0)) : re === "prev" && (o.hoveringIndex--, o.hoveringIndex < 0 && (o.hoveringIndex = o.options.size - 1)); const Ee = z.value[o.hoveringIndex]; (Ee.disabled === true || Ee.states.groupDisabled === true || !Ee.visible) && dr(re), nextTick(() => $e(_.value)); } }, xt = () => { if (!u.value) return 0; const re = window.getComputedStyle(u.value); return Number.parseFloat(re.gap || "6px"); }, Tt = computed(() => { const re = xt(); return { maxWidth: `${y.value && t13.maxCollapseTags === 1 ? o.selectionWidth - o.collapseItemWidth - re : o.selectionWidth}px` }; }), qt = computed(() => ({ maxWidth: `${o.selectionWidth}px` })), Fn = computed(() => ({ width: `${Math.max(o.calculatorWidth, zN)}px` })); return bn(u, Ve), bn(f, De), bn(p, ue), bn(C, ue), bn(g, I), bn(y, Ne), onMounted(() => { xe(); }), { inputId: D, contentId: n, nsSelect: a, nsInput: i, states: o, isFocused: k, expanded: S, optionsArray: z, hoverOption: _, selectSize: X, filteredOptionsCount: $, resetCalculatorWidth: De, updateTooltip: ue, updateTagTooltip: I, debouncedOnInputChange: ee, onInput: se, deletePrevTag: oe, deleteTag: he, deleteSelected: Oe, handleOptionSelect: Pe, scrollToOption: $e, hasModelValue: M, shouldShowPlaceholder: we, currentPlaceholder: fe, mouseEnterEventName: ce, showClose: L, iconComponent: V, iconReverse: Y, validateState: H, validateIcon: K, showNewOption: Z, updateOptions: N, collapseTagSize: Q, setSelected: xe, selectDisabled: R, emptyText: B, handleCompositionStart: w, handleCompositionUpdate: x, handleCompositionEnd: E, onOptionCreate: Ie, onOptionDestroy: Le, handleMenuEnter: nt, focus: kt, blur: _t, handleClearClick: Ct, handleClickOutside: Jt, handleEsc: Pt, toggleMenu: $t, selectOption: wr, getValueKey: Qt, navigateOptions: dr, dropdownMenuVisible: ge, showTagList: kr, collapseTagList: Nr, tagStyle: Tt, collapseTagStyle: qt, inputStyle: Fn, popperRef: ut, inputRef: d, tooltipRef: l, tagTooltipRef: c, calculatorRef: f, prefixRef: h10, suffixRef: v, selectRef: s, wrapperRef: C, selectionRef: u, scrollbarRef: m, menuRef: p, tagMenuRef: g, collapseItemRef: y }; }; var HN = defineComponent({ name: "ElOptions", setup(t13, { slots: e }) { const r = inject(es); let n = []; return () => { var a, i; const o = (a = e.default) == null ? void 0 : a.call(e), s = []; function u(l) { hr(l) && l.forEach((c) => { var d, f, h10, v; const p = (d = (c == null ? void 0 : c.type) || {}) == null ? void 0 : d.name; p === "ElOptionGroup" ? u(!nr(c.children) && !hr(c.children) && cr((f = c.children) == null ? void 0 : f.default) ? (h10 = c.children) == null ? void 0 : h10.default() : c.children) : p === "ElOption" ? s.push((v = c.props) == null ? void 0 : v.value) : hr(c.children) && u(c.children); }); } return o.length && u((i = o[0]) == null ? void 0 : i.children), nl(s, n) || (n = s, r && (r.states.optionValues = s)), o; }; } }); var KN = rt({ name: String, id: String, modelValue: { type: [Array, String, Number, Boolean, Object], default: void 0 }, autocomplete: { type: String, default: "off" }, automaticDropdown: Boolean, size: Di, effect: { type: qe(String), default: "light" }, disabled: Boolean, clearable: Boolean, filterable: Boolean, allowCreate: Boolean, loading: Boolean, popperClass: { type: String, default: "" }, popperOptions: { type: qe(Object), default: () => ({}) }, remote: Boolean, loadingText: String, noMatchText: String, noDataText: String, remoteMethod: Function, filterMethod: Function, multiple: Boolean, multipleLimit: { type: Number, default: 0 }, placeholder: { type: String }, defaultFirstOption: Boolean, reserveKeyword: { type: Boolean, default: true }, valueKey: { type: String, default: "value" }, collapseTags: Boolean, collapseTagsTooltip: Boolean, maxCollapseTags: { type: Number, default: 1 }, teleported: fr.teleported, persistent: { type: Boolean, default: true }, clearIcon: { type: Qn, default: circle_close_default }, fitInputWidth: Boolean, suffixIcon: { type: Qn, default: arrow_down_default }, tagType: { ...xp.type, default: "info" }, tagEffect: { ...xp.effect, default: "light" }, validateEvent: { type: Boolean, default: true }, remoteShowSuffix: Boolean, placement: { type: qe(String), values: Il, default: "bottom-start" }, fallbackPlacements: { type: qe(Array), default: ["bottom-start", "top-start", "right", "left"] }, appendTo: String, ...eL, ...sa(["ariaLabel"]) }); var Fm = "ElSelect"; var GN = defineComponent({ name: Fm, componentName: Fm, components: { ElSelectMenu: qN, ElOption: Cg, ElOptions: HN, ElTag: AM, ElScrollbar: PL, ElTooltip: Jo, ElIcon: Ft }, directives: { ClickOutside: D2 }, props: KN, emits: [ Kt, tg, "remove-tag", "clear", "visible-change", "focus", "blur" ], setup(t13, { emit: e }) { const r = computed(() => { const { modelValue: i, multiple: o } = t13, s = o ? [] : void 0; return hr(i) ? o ? i : s : o ? s : i; }), n = reactive({ ...toRefs(t13), modelValue: r }), a = VN(n, e); return provide(es, reactive({ props: n, states: a.states, optionsArray: a.optionsArray, handleOptionSelect: a.handleOptionSelect, onOptionCreate: a.onOptionCreate, onOptionDestroy: a.onOptionDestroy, selectRef: a.selectRef, setSelected: a.setSelected })), { ...a, modelValue: r }; } }); function UN(t13, e, r, n, a, i) { const o = resolveComponent("el-tag"), s = resolveComponent("el-tooltip"), u = resolveComponent("el-icon"), l = resolveComponent("el-option"), c = resolveComponent("el-options"), d = resolveComponent("el-scrollbar"), f = resolveComponent("el-select-menu"), h10 = resolveDirective("click-outside"); return withDirectives((openBlock(), createElementBlock("div", { ref: "selectRef", class: normalizeClass([t13.nsSelect.b(), t13.nsSelect.m(t13.selectSize)]), [toHandlerKey(t13.mouseEnterEventName)]: (v) => t13.states.inputHovering = true, onMouseleave: (v) => t13.states.inputHovering = false }, [ createVNode(s, { ref: "tooltipRef", visible: t13.dropdownMenuVisible, placement: t13.placement, teleported: t13.teleported, "popper-class": [t13.nsSelect.e("popper"), t13.popperClass], "popper-options": t13.popperOptions, "fallback-placements": t13.fallbackPlacements, effect: t13.effect, pure: "", trigger: "click", transition: `${t13.nsSelect.namespace.value}-zoom-in-top`, "stop-popper-mouse-event": false, "gpu-acceleration": false, persistent: t13.persistent, "append-to": t13.appendTo, onBeforeShow: t13.handleMenuEnter, onHide: (v) => t13.states.isBeforeHide = false }, { default: withCtx(() => { var v; return [ createBaseVNode("div", { ref: "wrapperRef", class: normalizeClass([ t13.nsSelect.e("wrapper"), t13.nsSelect.is("focused", t13.isFocused), t13.nsSelect.is("hovering", t13.states.inputHovering), t13.nsSelect.is("filterable", t13.filterable), t13.nsSelect.is("disabled", t13.selectDisabled) ]), onClick: withModifiers(t13.toggleMenu, ["prevent"]) }, [ t13.$slots.prefix ? (openBlock(), createElementBlock("div", { key: 0, ref: "prefixRef", class: normalizeClass(t13.nsSelect.e("prefix")) }, [ renderSlot(t13.$slots, "prefix") ], 2)) : createCommentVNode("v-if", true), createBaseVNode("div", { ref: "selectionRef", class: normalizeClass([ t13.nsSelect.e("selection"), t13.nsSelect.is("near", t13.multiple && !t13.$slots.prefix && !!t13.states.selected.length) ]) }, [ t13.multiple ? renderSlot(t13.$slots, "tag", { key: 0 }, () => [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.showTagList, (p) => (openBlock(), createElementBlock("div", { key: t13.getValueKey(p), class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: !t13.selectDisabled && !p.isDisabled, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", style: normalizeStyle(t13.tagStyle), onClose: (g) => t13.deleteTag(g, p) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, [ renderSlot(t13.$slots, "label", { label: p.currentLabel, value: p.value }, () => [ createTextVNode(toDisplayString(p.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "style", "onClose"]) ], 2))), 128)), t13.collapseTags && t13.states.selected.length > t13.maxCollapseTags ? (openBlock(), createBlock(s, { key: 0, ref: "tagTooltipRef", disabled: t13.dropdownMenuVisible || !t13.collapseTagsTooltip, "fallback-placements": ["bottom", "top", "right", "left"], effect: t13.effect, placement: "bottom", teleported: t13.teleported }, { default: withCtx(() => [ createBaseVNode("div", { ref: "collapseItemRef", class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { closable: false, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", style: normalizeStyle(t13.collapseTagStyle) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, " + " + toDisplayString(t13.states.selected.length - t13.maxCollapseTags), 3) ]), _: 1 }, 8, ["size", "type", "effect", "style"]) ], 2) ]), content: withCtx(() => [ createBaseVNode("div", { ref: "tagMenuRef", class: normalizeClass(t13.nsSelect.e("selection")) }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.collapseTagList, (p) => (openBlock(), createElementBlock("div", { key: t13.getValueKey(p), class: normalizeClass(t13.nsSelect.e("selected-item")) }, [ createVNode(o, { class: "in-tooltip", closable: !t13.selectDisabled && !p.isDisabled, size: t13.collapseTagSize, type: t13.tagType, effect: t13.tagEffect, "disable-transitions": "", onClose: (g) => t13.deleteTag(g, p) }, { default: withCtx(() => [ createBaseVNode("span", { class: normalizeClass(t13.nsSelect.e("tags-text")) }, [ renderSlot(t13.$slots, "label", { label: p.currentLabel, value: p.value }, () => [ createTextVNode(toDisplayString(p.currentLabel), 1) ]) ], 2) ]), _: 2 }, 1032, ["closable", "size", "type", "effect", "onClose"]) ], 2))), 128)) ], 2) ]), _: 3 }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true) ]) : createCommentVNode("v-if", true), t13.selectDisabled ? createCommentVNode("v-if", true) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass([ t13.nsSelect.e("selected-item"), t13.nsSelect.e("input-wrapper"), t13.nsSelect.is("hidden", !t13.filterable) ]) }, [ withDirectives(createBaseVNode("input", { id: t13.inputId, ref: "inputRef", "onUpdate:modelValue": (p) => t13.states.inputValue = p, type: "text", name: t13.name, class: normalizeClass([t13.nsSelect.e("input"), t13.nsSelect.is(t13.selectSize)]), disabled: t13.selectDisabled, autocomplete: t13.autocomplete, style: normalizeStyle(t13.inputStyle), role: "combobox", readonly: !t13.filterable, spellcheck: "false", "aria-activedescendant": ((v = t13.hoverOption) == null ? void 0 : v.id) || "", "aria-controls": t13.contentId, "aria-expanded": t13.dropdownMenuVisible, "aria-label": t13.ariaLabel, "aria-autocomplete": "none", "aria-haspopup": "listbox", onKeydown: [ withKeys(withModifiers((p) => t13.navigateOptions("next"), ["stop", "prevent"]), ["down"]), withKeys(withModifiers((p) => t13.navigateOptions("prev"), ["stop", "prevent"]), ["up"]), withKeys(withModifiers(t13.handleEsc, ["stop", "prevent"]), ["esc"]), withKeys(withModifiers(t13.selectOption, ["stop", "prevent"]), ["enter"]), withKeys(withModifiers(t13.deletePrevTag, ["stop"]), ["delete"]) ], onCompositionstart: t13.handleCompositionStart, onCompositionupdate: t13.handleCompositionUpdate, onCompositionend: t13.handleCompositionEnd, onInput: t13.onInput, onClick: withModifiers(t13.toggleMenu, ["stop"]) }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [ [vModelText, t13.states.inputValue] ]), t13.filterable ? (openBlock(), createElementBlock("span", { key: 0, ref: "calculatorRef", "aria-hidden": "true", class: normalizeClass(t13.nsSelect.e("input-calculator")), textContent: toDisplayString(t13.states.inputValue) }, null, 10, ["textContent"])) : createCommentVNode("v-if", true) ], 2)), t13.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass([ t13.nsSelect.e("selected-item"), t13.nsSelect.e("placeholder"), t13.nsSelect.is("transparent", !t13.hasModelValue || t13.expanded && !t13.states.inputValue) ]) }, [ t13.hasModelValue ? renderSlot(t13.$slots, "label", { key: 0, label: t13.currentPlaceholder, value: t13.modelValue }, () => [ createBaseVNode("span", null, toDisplayString(t13.currentPlaceholder), 1) ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(t13.currentPlaceholder), 1)) ], 2)) : createCommentVNode("v-if", true) ], 2), createBaseVNode("div", { ref: "suffixRef", class: normalizeClass(t13.nsSelect.e("suffix")) }, [ t13.iconComponent && !t13.showClose ? (openBlock(), createBlock(u, { key: 0, class: normalizeClass([t13.nsSelect.e("caret"), t13.nsSelect.e("icon"), t13.iconReverse]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.iconComponent))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), t13.showClose && t13.clearIcon ? (openBlock(), createBlock(u, { key: 1, class: normalizeClass([ t13.nsSelect.e("caret"), t13.nsSelect.e("icon"), t13.nsSelect.e("clear") ]), onClick: t13.handleClearClick }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.clearIcon))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), t13.validateState && t13.validateIcon ? (openBlock(), createBlock(u, { key: 2, class: normalizeClass([t13.nsInput.e("icon"), t13.nsInput.e("validateIcon")]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.validateIcon))) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true) ], 2) ], 10, ["onClick"]) ]; }), content: withCtx(() => [ createVNode(f, { ref: "menuRef" }, { default: withCtx(() => [ t13.$slots.header ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.nsSelect.be("dropdown", "header")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(t13.$slots, "header") ], 10, ["onClick"])) : createCommentVNode("v-if", true), withDirectives(createVNode(d, { id: t13.contentId, ref: "scrollbarRef", tag: "ul", "wrap-class": t13.nsSelect.be("dropdown", "wrap"), "view-class": t13.nsSelect.be("dropdown", "list"), class: normalizeClass([t13.nsSelect.is("empty", t13.filteredOptionsCount === 0)]), role: "listbox", "aria-label": t13.ariaLabel, "aria-orientation": "vertical" }, { default: withCtx(() => [ t13.showNewOption ? (openBlock(), createBlock(l, { key: 0, value: t13.states.inputValue, created: true }, null, 8, ["value"])) : createCommentVNode("v-if", true), createVNode(c, null, { default: withCtx(() => [ renderSlot(t13.$slots, "default") ]), _: 3 }) ]), _: 3 }, 8, ["id", "wrap-class", "view-class", "class", "aria-label"]), [ [vShow, t13.states.options.size > 0 && !t13.loading] ]), t13.$slots.loading && t13.loading ? (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(t13.nsSelect.be("dropdown", "loading")) }, [ renderSlot(t13.$slots, "loading") ], 2)) : t13.loading || t13.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", { key: 2, class: normalizeClass(t13.nsSelect.be("dropdown", "empty")) }, [ renderSlot(t13.$slots, "empty", {}, () => [ createBaseVNode("span", null, toDisplayString(t13.emptyText), 1) ]) ], 2)) : createCommentVNode("v-if", true), t13.$slots.footer ? (openBlock(), createElementBlock("div", { key: 3, class: normalizeClass(t13.nsSelect.be("dropdown", "footer")), onClick: withModifiers(() => { }, ["stop"]) }, [ renderSlot(t13.$slots, "footer") ], 10, ["onClick"])) : createCommentVNode("v-if", true) ]), _: 3 }, 512) ]), _: 3 }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "onBeforeShow", "onHide"]) ], 16, ["onMouseleave"])), [ [h10, t13.handleClickOutside, t13.popperRef] ]); } var WN = Ke(GN, [["render", UN], ["__file", "select.vue"]]); var jN = defineComponent({ name: "ElOptionGroup", componentName: "ElOptionGroup", props: { label: String, disabled: Boolean }, setup(t13) { const e = Ge("select"), r = ref(null), n = getCurrentInstance(), a = ref([]); provide(G2, reactive({ ...toRefs(t13) })); const i = computed(() => a.value.some((l) => l.visible === true)), o = (l) => { var c, d; return ((c = l.type) == null ? void 0 : c.name) === "ElOption" && !!((d = l.component) != null && d.proxy); }, s = (l) => { const c = Kn(l), d = []; return c.forEach((f) => { var h10, v; o(f) ? d.push(f.component.proxy) : (h10 = f.children) != null && h10.length ? d.push(...s(f.children)) : (v = f.component) != null && v.subTree && d.push(...s(f.component.subTree)); }), d; }, u = () => { a.value = s(n.subTree); }; return onMounted(() => { u(); }), hI(r, u, { attributes: true, subtree: true, childList: true }), { groupRef: r, visible: i, ns: e }; } }); function YN(t13, e, r, n, a, i) { return withDirectives((openBlock(), createElementBlock("ul", { ref: "groupRef", class: normalizeClass(t13.ns.be("group", "wrap")) }, [ createBaseVNode("li", { class: normalizeClass(t13.ns.be("group", "title")) }, toDisplayString(t13.label), 3), createBaseVNode("li", null, [ createBaseVNode("ul", { class: normalizeClass(t13.ns.b("group")) }, [ renderSlot(t13.$slots, "default") ], 2) ]) ], 2)), [ [vShow, t13.visible] ]); } var U2 = Ke(jN, [["render", YN], ["__file", "option-group.vue"]]); var ZN = Vt(WN, { Option: Cg, OptionGroup: U2 }); var XN = An(Cg); An(U2); var JN = rt({ trigger: Oo.trigger, placement: Ou.placement, disabled: Oo.disabled, visible: fr.visible, transition: fr.transition, popperOptions: Ou.popperOptions, tabindex: Ou.tabindex, content: fr.content, popperStyle: fr.popperStyle, popperClass: fr.popperClass, enterable: { ...fr.enterable, default: true }, effect: { ...fr.effect, default: "light" }, teleported: fr.teleported, title: String, width: { type: [String, Number], default: 150 }, offset: { type: Number, default: void 0 }, showAfter: { type: Number, default: 0 }, hideAfter: { type: Number, default: 200 }, autoClose: { type: Number, default: 0 }, showArrow: { type: Boolean, default: true }, persistent: { type: Boolean, default: true }, "onUpdate:visible": { type: Function } }); var QN = { "update:visible": (t13) => bi(t13), "before-enter": () => true, "before-leave": () => true, "after-enter": () => true, "after-leave": () => true }; var e5 = "onUpdate:visible"; var t5 = defineComponent({ name: "ElPopover" }); var r5 = defineComponent({ ...t5, props: JN, emits: QN, setup(t13, { expose: e, emit: r }) { const n = t13, a = computed(() => n[e5]), i = Ge("popover"), o = ref(), s = computed(() => { var g; return (g = unref(o)) == null ? void 0 : g.popperRef; }), u = computed(() => [ { width: wi(n.width) }, n.popperStyle ]), l = computed(() => [i.b(), n.popperClass, { [i.m("plain")]: !!n.content }]), c = computed(() => n.transition === `${i.namespace.value}-fade-in-linear`), d = () => { var g; (g = o.value) == null || g.hide(); }, f = () => { r("before-enter"); }, h10 = () => { r("before-leave"); }, v = () => { r("after-enter"); }, p = () => { r("update:visible", false), r("after-leave"); }; return e({ popperRef: s, hide: d }), (g, y) => (openBlock(), createBlock(unref(Jo), mergeProps({ ref_key: "tooltipRef", ref: o }, g.$attrs, { trigger: g.trigger, placement: g.placement, disabled: g.disabled, visible: g.visible, transition: g.transition, "popper-options": g.popperOptions, tabindex: g.tabindex, content: g.content, offset: g.offset, "show-after": g.showAfter, "hide-after": g.hideAfter, "auto-close": g.autoClose, "show-arrow": g.showArrow, "aria-label": g.title, effect: g.effect, enterable: g.enterable, "popper-class": unref(l), "popper-style": unref(u), teleported: g.teleported, persistent: g.persistent, "gpu-acceleration": unref(c), "onUpdate:visible": unref(a), onBeforeShow: f, onBeforeHide: h10, onShow: v, onHide: p }), { content: withCtx(() => [ g.title ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(unref(i).e("title")), role: "title" }, toDisplayString(g.title), 3)) : createCommentVNode("v-if", true), renderSlot(g.$slots, "default", {}, () => [ createTextVNode(toDisplayString(g.content), 1) ]) ]), default: withCtx(() => [ g.$slots.reference ? renderSlot(g.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true) ]), _: 3 }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"])); } }); var n5 = Ke(r5, [["__file", "popover.vue"]]); var Mm = (t13, e) => { const r = e.arg || e.value, n = r == null ? void 0 : r.popperRef; n && (n.triggerRef = t13); }; var a5 = { mounted(t13, e) { Mm(t13, e); }, updated(t13, e) { Mm(t13, e); } }; var i5 = "popover"; var o5 = SD(a5, i5); var Li = Vt(n5, { directive: o5 }); var fi = "$treeNodeId"; var Nm = function(t13, e) { !e || e[fi] || Object.defineProperty(e, fi, { value: t13.id, enumerable: false, configurable: false, writable: false }); }; var xg = function(t13, e) { return t13 ? e[t13] : e[fi]; }; var Ep = (t13, e, r) => { const n = t13.value.currentNode; r(); const a = t13.value.currentNode; n !== a && e("current-change", a ? a.data : null, a); }; var Sp = (t13) => { let e = true, r = true, n = true; for (let a = 0, i = t13.length; a < i; a++) { const o = t13[a]; (o.checked !== true || o.indeterminate) && (e = false, o.disabled || (n = false)), (o.checked !== false || o.indeterminate) && (r = false); } return { all: e, none: r, allWithoutDisable: n, half: !e && !r }; }; var so = function(t13) { if (t13.childNodes.length === 0 || t13.loading) return; const { all: e, none: r, half: n } = Sp(t13.childNodes); e ? (t13.checked = true, t13.indeterminate = false) : n ? (t13.checked = false, t13.indeterminate = true) : r && (t13.checked = false, t13.indeterminate = false); const a = t13.parent; !a || a.level === 0 || t13.store.checkStrictly || so(a); }; var Es = function(t13, e) { const r = t13.store.props, n = t13.data || {}, a = r[e]; if (typeof a == "function") return a(n, t13); if (typeof a == "string") return n[a]; if (typeof a > "u") { const i = n[e]; return i === void 0 ? "" : i; } }; var s5 = 0; var _a = class __a { constructor(e) { this.id = s5++, this.text = null, this.checked = false, this.indeterminate = false, this.data = null, this.expanded = false, this.parent = null, this.visible = true, this.isCurrent = false, this.canFocus = false; for (const r in e) Ta(e, r) && (this[r] = e[r]); this.level = 0, this.loaded = false, this.childNodes = [], this.loading = false, this.parent && (this.level = this.parent.level + 1); } initialize() { const e = this.store; if (!e) throw new Error("[Node]store is required!"); e.registerNode(this); const r = e.props; if (r && typeof r.isLeaf < "u") { const i = Es(this, "isLeaf"); typeof i == "boolean" && (this.isLeafByUser = i); } if (e.lazy !== true && this.data ? (this.setData(this.data), e.defaultExpandAll && (this.expanded = true, this.canFocus = true)) : this.level > 0 && e.lazy && e.defaultExpandAll && !this.isLeafByUser && this.expand(), Array.isArray(this.data) || Nm(this, this.data), !this.data) return; const n = e.defaultExpandedKeys, a = e.key; a && n && n.includes(this.key) && this.expand(null, e.autoExpandParent), a && e.currentNodeKey !== void 0 && this.key === e.currentNodeKey && (e.currentNode = this, e.currentNode.isCurrent = true), e.lazy && e._initDefaultCheckedNode(this), this.updateLeafState(), this.parent && (this.level === 1 || this.parent.expanded === true) && (this.canFocus = true); } setData(e) { Array.isArray(e) || Nm(this, e), this.data = e, this.childNodes = []; let r; this.level === 0 && Array.isArray(this.data) ? r = this.data : r = Es(this, "children") || []; for (let n = 0, a = r.length; n < a; n++) this.insertChild({ data: r[n] }); } get label() { return Es(this, "label"); } get key() { const e = this.store.key; return this.data ? this.data[e] : null; } get disabled() { return Es(this, "disabled"); } get nextSibling() { const e = this.parent; if (e) { const r = e.childNodes.indexOf(this); if (r > -1) return e.childNodes[r + 1]; } return null; } get previousSibling() { const e = this.parent; if (e) { const r = e.childNodes.indexOf(this); if (r > -1) return r > 0 ? e.childNodes[r - 1] : null; } return null; } contains(e, r = true) { return (this.childNodes || []).some((n) => n === e || r && n.contains(e)); } remove() { const e = this.parent; e && e.removeChild(this); } insertChild(e, r, n) { if (!e) throw new Error("InsertChild error: child is required."); if (!(e instanceof __a)) { if (!n) { const a = this.getChildren(true); a.includes(e.data) || (typeof r > "u" || r < 0 ? a.push(e.data) : a.splice(r, 0, e.data)); } Object.assign(e, { parent: this, store: this.store }), e = reactive(new __a(e)), e instanceof __a && e.initialize(); } e.level = this.level + 1, typeof r > "u" || r < 0 ? this.childNodes.push(e) : this.childNodes.splice(r, 0, e), this.updateLeafState(); } insertBefore(e, r) { let n; r && (n = this.childNodes.indexOf(r)), this.insertChild(e, n); } insertAfter(e, r) { let n; r && (n = this.childNodes.indexOf(r), n !== -1 && (n += 1)), this.insertChild(e, n); } removeChild(e) { const r = this.getChildren() || [], n = r.indexOf(e.data); n > -1 && r.splice(n, 1); const a = this.childNodes.indexOf(e); a > -1 && (this.store && this.store.deregisterNode(e), e.parent = null, this.childNodes.splice(a, 1)), this.updateLeafState(); } removeChildByData(e) { let r = null; for (let n = 0; n < this.childNodes.length; n++) if (this.childNodes[n].data === e) { r = this.childNodes[n]; break; } r && this.removeChild(r); } expand(e, r) { const n = () => { if (r) { let a = this.parent; for (; a.level > 0; ) a.expanded = true, a = a.parent; } this.expanded = true, e && e(), this.childNodes.forEach((a) => { a.canFocus = true; }); }; this.shouldLoadData() ? this.loadData((a) => { Array.isArray(a) && (this.checked ? this.setChecked(true, true) : this.store.checkStrictly || so(this), n()); }) : n(); } doCreateChildren(e, r = {}) { e.forEach((n) => { this.insertChild(Object.assign({ data: n }, r), void 0, true); }); } collapse() { this.expanded = false, this.childNodes.forEach((e) => { e.canFocus = false; }); } shouldLoadData() { return this.store.lazy === true && this.store.load && !this.loaded; } updateLeafState() { if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser < "u") { this.isLeaf = this.isLeafByUser; return; } const e = this.childNodes; if (!this.store.lazy || this.store.lazy === true && this.loaded === true) { this.isLeaf = !e || e.length === 0; return; } this.isLeaf = false; } setChecked(e, r, n, a) { if (this.indeterminate = e === "half", this.checked = e === true, this.store.checkStrictly) return; if (!(this.shouldLoadData() && !this.store.checkDescendants)) { const { all: o, allWithoutDisable: s } = Sp(this.childNodes); !this.isLeaf && !o && s && (this.checked = false, e = false); const u = () => { if (r) { const l = this.childNodes; for (let f = 0, h10 = l.length; f < h10; f++) { const v = l[f]; a = a || e !== false; const p = v.disabled ? v.checked : a; v.setChecked(p, r, true, a); } const { half: c, all: d } = Sp(l); d || (this.checked = d, this.indeterminate = c); } }; if (this.shouldLoadData()) { this.loadData(() => { u(), so(this); }, { checked: e !== false }); return; } else u(); } const i = this.parent; !i || i.level === 0 || n || so(i); } getChildren(e = false) { if (this.level === 0) return this.data; const r = this.data; if (!r) return null; const n = this.store.props; let a = "children"; return n && (a = n.children || "children"), r[a] === void 0 && (r[a] = null), e && !r[a] && (r[a] = []), r[a]; } updateChildren() { const e = this.getChildren() || [], r = this.childNodes.map((i) => i.data), n = {}, a = []; e.forEach((i, o) => { const s = i[fi]; !!s && r.findIndex((l) => l[fi] === s) >= 0 ? n[s] = { index: o, data: i } : a.push({ index: o, data: i }); }), this.store.lazy || r.forEach((i) => { n[i[fi]] || this.removeChildByData(i); }), a.forEach(({ index: i, data: o }) => { this.insertChild({ data: o }, i); }), this.updateLeafState(); } loadData(e, r = {}) { if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(r).length)) { this.loading = true; const n = (i) => { this.childNodes = [], this.doCreateChildren(i, r), this.loaded = true, this.loading = false, this.updateLeafState(), e && e.call(this, i); }, a = () => { this.loading = false; }; this.store.load(this, n, a); } else e && e.call(this); } eachNode(e) { const r = [this]; for (; r.length; ) { const n = r.shift(); r.unshift(...n.childNodes), e(n); } } reInitChecked() { this.store.checkStrictly || so(this); } }; var l5 = class { constructor(e) { this.currentNode = null, this.currentNodeKey = null; for (const r in e) Ta(e, r) && (this[r] = e[r]); this.nodesMap = {}; } initialize() { if (this.root = new _a({ data: this.data, store: this }), this.root.initialize(), this.lazy && this.load) { const e = this.load; e(this.root, (r) => { this.root.doCreateChildren(r), this._initDefaultCheckedNodes(); }); } else this._initDefaultCheckedNodes(); } filter(e) { const r = this.filterNodeMethod, n = this.lazy, a = function(i) { const o = i.root ? i.root.childNodes : i.childNodes; if (o.forEach((s) => { s.visible = r.call(s, e, s.data, s), a(s); }), !i.visible && o.length) { let s = true; s = !o.some((u) => u.visible), i.root ? i.root.visible = s === false : i.visible = s === false; } e && i.visible && !i.isLeaf && (!n || i.loaded) && i.expand(); }; a(this); } setData(e) { e !== this.root.data ? (this.nodesMap = {}, this.root.setData(e), this._initDefaultCheckedNodes()) : this.root.updateChildren(); } getNode(e) { if (e instanceof _a) return e; const r = Gt(e) ? xg(this.key, e) : e; return this.nodesMap[r] || null; } insertBefore(e, r) { const n = this.getNode(r); n.parent.insertBefore({ data: e }, n); } insertAfter(e, r) { const n = this.getNode(r); n.parent.insertAfter({ data: e }, n); } remove(e) { const r = this.getNode(e); r && r.parent && (r === this.currentNode && (this.currentNode = null), r.parent.removeChild(r)); } append(e, r) { const n = al(r) ? this.root : this.getNode(r); n && n.insertChild({ data: e }); } _initDefaultCheckedNodes() { const e = this.defaultCheckedKeys || [], r = this.nodesMap; e.forEach((n) => { const a = r[n]; a && a.setChecked(true, !this.checkStrictly); }); } _initDefaultCheckedNode(e) { (this.defaultCheckedKeys || []).includes(e.key) && e.setChecked(true, !this.checkStrictly); } setDefaultCheckedKey(e) { e !== this.defaultCheckedKeys && (this.defaultCheckedKeys = e, this._initDefaultCheckedNodes()); } registerNode(e) { const r = this.key; !e || !e.data || (r ? e.key !== void 0 && (this.nodesMap[e.key] = e) : this.nodesMap[e.id] = e); } deregisterNode(e) { !this.key || !e || !e.data || (e.childNodes.forEach((n) => { this.deregisterNode(n); }), delete this.nodesMap[e.key]); } getCheckedNodes(e = false, r = false) { const n = [], a = function(i) { (i.root ? i.root.childNodes : i.childNodes).forEach((s) => { (s.checked || r && s.indeterminate) && (!e || e && s.isLeaf) && n.push(s.data), a(s); }); }; return a(this), n; } getCheckedKeys(e = false) { return this.getCheckedNodes(e).map((r) => (r || {})[this.key]); } getHalfCheckedNodes() { const e = [], r = function(n) { (n.root ? n.root.childNodes : n.childNodes).forEach((i) => { i.indeterminate && e.push(i.data), r(i); }); }; return r(this), e; } getHalfCheckedKeys() { return this.getHalfCheckedNodes().map((e) => (e || {})[this.key]); } _getAllNodes() { const e = [], r = this.nodesMap; for (const n in r) Ta(r, n) && e.push(r[n]); return e; } updateChildren(e, r) { const n = this.nodesMap[e]; if (!n) return; const a = n.childNodes; for (let i = a.length - 1; i >= 0; i--) { const o = a[i]; this.remove(o.data); } for (let i = 0, o = r.length; i < o; i++) { const s = r[i]; this.append(s, n.data); } } _setCheckedKeys(e, r = false, n) { const a = this._getAllNodes().sort((u, l) => u.level - l.level), i = /* @__PURE__ */ Object.create(null), o = Object.keys(n); a.forEach((u) => u.setChecked(false, false)); const s = (u) => { u.childNodes.forEach((l) => { var c; i[l.data[e]] = true, (c = l.childNodes) != null && c.length && s(l); }); }; for (let u = 0, l = a.length; u < l; u++) { const c = a[u], d = c.data[e].toString(); if (!o.includes(d)) { c.checked && !i[d] && c.setChecked(false, false); continue; } if (c.childNodes.length && s(c), c.isLeaf || this.checkStrictly) { c.setChecked(true, false); continue; } if (c.setChecked(true, true), r) { c.setChecked(false, false); const h10 = function(v) { v.childNodes.forEach((g) => { g.isLeaf || g.setChecked(false, false), h10(g); }); }; h10(c); } } } setCheckedNodes(e, r = false) { const n = this.key, a = {}; e.forEach((i) => { a[(i || {})[n]] = true; }), this._setCheckedKeys(n, r, a); } setCheckedKeys(e, r = false) { this.defaultCheckedKeys = e; const n = this.key, a = {}; e.forEach((i) => { a[i] = true; }), this._setCheckedKeys(n, r, a); } setDefaultExpandedKeys(e) { e = e || [], this.defaultExpandedKeys = e, e.forEach((r) => { const n = this.getNode(r); n && n.expand(null, this.autoExpandParent); }); } setChecked(e, r, n) { const a = this.getNode(e); a && a.setChecked(!!r, n); } getCurrentNode() { return this.currentNode; } setCurrentNode(e) { const r = this.currentNode; r && (r.isCurrent = false), this.currentNode = e, this.currentNode.isCurrent = true; } setUserCurrentNode(e, r = true) { const n = e[this.key], a = this.nodesMap[n]; this.setCurrentNode(a), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, true); } setCurrentNodeKey(e, r = true) { if (e == null) { this.currentNode && (this.currentNode.isCurrent = false), this.currentNode = null; return; } const n = this.getNode(e); n && (this.setCurrentNode(n), r && this.currentNode.level > 1 && this.currentNode.parent.expand(null, true)); } }; var u5 = defineComponent({ name: "ElTreeNodeContent", props: { node: { type: Object, required: true }, renderContent: Function }, setup(t13) { const e = Ge("tree"), r = inject("NodeInstance"), n = inject("RootTree"); return () => { const a = t13.node, { data: i, store: o } = a; return t13.renderContent ? t13.renderContent(h, { _self: r, node: a, data: i, store: o }) : renderSlot(n.ctx.slots, "default", { node: a, data: i }, () => [ h("span", { class: e.be("node", "label") }, [a.label]) ]); }; } }); var c5 = Ke(u5, [["__file", "tree-node-content.vue"]]); function W2(t13) { const e = inject("TreeNodeMap", null), r = { treeNodeExpand: (n) => { t13.node !== n && t13.node.collapse(); }, children: [] }; return e && e.children.push(r), provide("TreeNodeMap", r), { broadcastExpanded: (n) => { if (t13.accordion) for (const a of r.children) a.treeNodeExpand(n); } }; } var j2 = Symbol("dragEvents"); function d5({ props: t13, ctx: e, el$: r, dropIndicator$: n, store: a }) { const i = Ge("tree"), o = ref({ showDropIndicator: false, draggingNode: null, dropNode: null, allowDrop: true, dropType: null }); return provide(j2, { treeNodeDragStart: ({ event: c, treeNode: d }) => { if (typeof t13.allowDrag == "function" && !t13.allowDrag(d.node)) return c.preventDefault(), false; c.dataTransfer.effectAllowed = "move"; try { c.dataTransfer.setData("text/plain", ""); } catch { } o.value.draggingNode = d, e.emit("node-drag-start", d.node, c); }, treeNodeDragOver: ({ event: c, treeNode: d }) => { const f = d, h10 = o.value.dropNode; h10 && h10.node.id !== f.node.id && Sa(h10.$el, i.is("drop-inner")); const v = o.value.draggingNode; if (!v || !f) return; let p = true, g = true, y = true, m = true; typeof t13.allowDrop == "function" && (p = t13.allowDrop(v.node, f.node, "prev"), m = g = t13.allowDrop(v.node, f.node, "inner"), y = t13.allowDrop(v.node, f.node, "next")), c.dataTransfer.dropEffect = g || p || y ? "move" : "none", (p || g || y) && (h10 == null ? void 0 : h10.node.id) !== f.node.id && (h10 && e.emit("node-drag-leave", v.node, h10.node, c), e.emit("node-drag-enter", v.node, f.node, c)), p || g || y ? o.value.dropNode = f : o.value.dropNode = null, f.node.nextSibling === v.node && (y = false), f.node.previousSibling === v.node && (p = false), f.node.contains(v.node, false) && (g = false), (v.node === f.node || v.node.contains(f.node)) && (p = false, g = false, y = false); const b = f.$el.querySelector(`.${i.be("node", "content")}`).getBoundingClientRect(), w = r.value.getBoundingClientRect(); let x; const E = p ? g ? 0.25 : y ? 0.45 : 1 : -1, C = y ? g ? 0.75 : p ? 0.55 : 0 : 1; let k = -9999; const S = c.clientY - b.top; S < b.height * E ? x = "before" : S > b.height * C ? x = "after" : g ? x = "inner" : x = "none"; const _ = f.$el.querySelector(`.${i.be("node", "expand-icon")}`).getBoundingClientRect(), T = n.value; x === "before" ? k = _.top - w.top : x === "after" && (k = _.bottom - w.top), T.style.top = `${k}px`, T.style.left = `${_.right - w.left}px`, x === "inner" ? gp(f.$el, i.is("drop-inner")) : Sa(f.$el, i.is("drop-inner")), o.value.showDropIndicator = x === "before" || x === "after", o.value.allowDrop = o.value.showDropIndicator || m, o.value.dropType = x, e.emit("node-drag-over", v.node, f.node, c); }, treeNodeDragEnd: (c) => { const { draggingNode: d, dropType: f, dropNode: h10 } = o.value; if (c.preventDefault(), c.dataTransfer && (c.dataTransfer.dropEffect = "move"), d && h10) { const v = { data: d.node.data }; f !== "none" && d.node.remove(), f === "before" ? h10.node.parent.insertBefore(v, h10.node) : f === "after" ? h10.node.parent.insertAfter(v, h10.node) : f === "inner" && h10.node.insertChild(v), f !== "none" && (a.value.registerNode(v), a.value.key && d.node.eachNode((p) => { var g; (g = a.value.nodesMap[p.data[a.value.key]]) == null || g.setChecked(p.checked, !a.value.checkStrictly); })), Sa(h10.$el, i.is("drop-inner")), e.emit("node-drag-end", d.node, h10.node, f, c), f !== "none" && e.emit("node-drop", d.node, h10.node, f, c); } d && !h10 && e.emit("node-drag-end", d.node, null, f, c), o.value.showDropIndicator = false, o.value.draggingNode = null, o.value.dropNode = null, o.value.allowDrop = true; } }), { dragState: o }; } var f5 = defineComponent({ name: "ElTreeNode", components: { ElCollapseTransition: KM, ElCheckbox: kM, NodeContent: c5, ElIcon: Ft, Loading: loading_default }, props: { node: { type: _a, default: () => ({}) }, props: { type: Object, default: () => ({}) }, accordion: Boolean, renderContent: Function, renderAfterExpand: Boolean, showCheckbox: { type: Boolean, default: false } }, emits: ["node-expand"], setup(t13, e) { const r = Ge("tree"), { broadcastExpanded: n } = W2(t13), a = inject("RootTree"), i = ref(false), o = ref(false), s = ref(null), u = ref(null), l = ref(null), c = inject(j2), d = getCurrentInstance(); provide("NodeInstance", d), a || Ot("Tree", "Can not find node's tree."), t13.node.expanded && (i.value = true, o.value = true); const f = a.props.props.children || "children"; watch(() => { const S = t13.node.data[f]; return S && [...S]; }, () => { t13.node.updateChildren(); }), watch(() => t13.node.indeterminate, (S) => { p(t13.node.checked, S); }), watch(() => t13.node.checked, (S) => { p(S, t13.node.indeterminate); }), watch(() => t13.node.childNodes.length, () => t13.node.reInitChecked()), watch(() => t13.node.expanded, (S) => { nextTick(() => i.value = S), S && (o.value = true); }); const h10 = (S) => xg(a.props.nodeKey, S.data), v = (S) => { const _ = t13.props.class; if (!_) return {}; let T; if (cr(_)) { const { data: O } = S; T = _(O, S); } else T = _; return nr(T) ? { [T]: true } : T; }, p = (S, _) => { (s.value !== S || u.value !== _) && a.ctx.emit("check-change", t13.node.data, S, _), s.value = S, u.value = _; }, g = (S) => { Ep(a.store, a.ctx.emit, () => a.store.value.setCurrentNode(t13.node)), a.currentNode.value = t13.node, a.props.expandOnClickNode && m(), a.props.checkOnClickNode && !t13.node.disabled && b(null, { target: { checked: !t13.node.checked } }), a.ctx.emit("node-click", t13.node.data, t13.node, d, S); }, y = (S) => { a.instance.vnode.props.onNodeContextmenu && (S.stopPropagation(), S.preventDefault()), a.ctx.emit("node-contextmenu", S, t13.node.data, t13.node, d); }, m = () => { t13.node.isLeaf || (i.value ? (a.ctx.emit("node-collapse", t13.node.data, t13.node, d), t13.node.collapse()) : t13.node.expand(() => { e.emit("node-expand", t13.node.data, t13.node, d); })); }, b = (S, _) => { t13.node.setChecked(_.target.checked, !a.props.checkStrictly), nextTick(() => { const T = a.store.value; a.ctx.emit("check", t13.node.data, { checkedNodes: T.getCheckedNodes(), checkedKeys: T.getCheckedKeys(), halfCheckedNodes: T.getHalfCheckedNodes(), halfCheckedKeys: T.getHalfCheckedKeys() }); }); }; return { ns: r, node$: l, tree: a, expanded: i, childNodeRendered: o, oldChecked: s, oldIndeterminate: u, getNodeKey: h10, getNodeClass: v, handleSelectChange: p, handleClick: g, handleContextMenu: y, handleExpandIconClick: m, handleCheckChange: b, handleChildNodeExpand: (S, _, T) => { n(_), a.ctx.emit("node-expand", S, _, T); }, handleDragStart: (S) => { a.props.draggable && c.treeNodeDragStart({ event: S, treeNode: t13 }); }, handleDragOver: (S) => { S.preventDefault(), a.props.draggable && c.treeNodeDragOver({ event: S, treeNode: { $el: l.value, node: t13.node } }); }, handleDrop: (S) => { S.preventDefault(); }, handleDragEnd: (S) => { a.props.draggable && c.treeNodeDragEnd(S); }, CaretRight: caret_right_default }; } }); function v5(t13, e, r, n, a, i) { const o = resolveComponent("el-icon"), s = resolveComponent("el-checkbox"), u = resolveComponent("loading"), l = resolveComponent("node-content"), c = resolveComponent("el-tree-node"), d = resolveComponent("el-collapse-transition"); return withDirectives((openBlock(), createElementBlock("div", { ref: "node$", class: normalizeClass([ t13.ns.b("node"), t13.ns.is("expanded", t13.expanded), t13.ns.is("current", t13.node.isCurrent), t13.ns.is("hidden", !t13.node.visible), t13.ns.is("focusable", !t13.node.disabled), t13.ns.is("checked", !t13.node.disabled && t13.node.checked), t13.getNodeClass(t13.node) ]), role: "treeitem", tabindex: "-1", "aria-expanded": t13.expanded, "aria-disabled": t13.node.disabled, "aria-checked": t13.node.checked, draggable: t13.tree.props.draggable, "data-key": t13.getNodeKey(t13.node), onClick: withModifiers(t13.handleClick, ["stop"]), onContextmenu: t13.handleContextMenu, onDragstart: withModifiers(t13.handleDragStart, ["stop"]), onDragover: withModifiers(t13.handleDragOver, ["stop"]), onDragend: withModifiers(t13.handleDragEnd, ["stop"]), onDrop: withModifiers(t13.handleDrop, ["stop"]) }, [ createBaseVNode("div", { class: normalizeClass(t13.ns.be("node", "content")), style: normalizeStyle({ paddingLeft: (t13.node.level - 1) * t13.tree.props.indent + "px" }) }, [ t13.tree.props.icon || t13.CaretRight ? (openBlock(), createBlock(o, { key: 0, class: normalizeClass([ t13.ns.be("node", "expand-icon"), t13.ns.is("leaf", t13.node.isLeaf), { expanded: !t13.node.isLeaf && t13.expanded } ]), onClick: withModifiers(t13.handleExpandIconClick, ["stop"]) }, { default: withCtx(() => [ (openBlock(), createBlock(resolveDynamicComponent(t13.tree.props.icon || t13.CaretRight))) ]), _: 1 }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true), t13.showCheckbox ? (openBlock(), createBlock(s, { key: 1, "model-value": t13.node.checked, indeterminate: t13.node.indeterminate, disabled: !!t13.node.disabled, onClick: withModifiers(() => { }, ["stop"]), onChange: t13.handleCheckChange }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : createCommentVNode("v-if", true), t13.node.loading ? (openBlock(), createBlock(o, { key: 2, class: normalizeClass([t13.ns.be("node", "loading-icon"), t13.ns.is("loading")]) }, { default: withCtx(() => [ createVNode(u) ]), _: 1 }, 8, ["class"])) : createCommentVNode("v-if", true), createVNode(l, { node: t13.node, "render-content": t13.renderContent }, null, 8, ["node", "render-content"]) ], 6), createVNode(d, null, { default: withCtx(() => [ !t13.renderAfterExpand || t13.childNodeRendered ? withDirectives((openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.be("node", "children")), role: "group", "aria-expanded": t13.expanded }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.node.childNodes, (f) => (openBlock(), createBlock(c, { key: t13.getNodeKey(f), "render-content": t13.renderContent, "render-after-expand": t13.renderAfterExpand, "show-checkbox": t13.showCheckbox, node: f, accordion: t13.accordion, props: t13.props, onNodeExpand: t13.handleChildNodeExpand }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]))), 128)) ], 10, ["aria-expanded"])), [ [vShow, t13.expanded] ]) : createCommentVNode("v-if", true) ]), _: 1 }) ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [ [vShow, t13.node.visible] ]); } var h5 = Ke(f5, [["render", v5], ["__file", "tree-node.vue"]]); function p5({ el$: t13 }, e) { const r = Ge("tree"), n = shallowRef([]), a = shallowRef([]); onMounted(() => { o(); }), onUpdated(() => { n.value = Array.from(t13.value.querySelectorAll("[role=treeitem]")), a.value = Array.from(t13.value.querySelectorAll("input[type=checkbox]")); }), watch(a, (s) => { s.forEach((u) => { u.setAttribute("tabindex", "-1"); }); }), Ar(t13, "keydown", (s) => { const u = s.target; if (!u.className.includes(r.b("node"))) return; const l = s.code; n.value = Array.from(t13.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)); const c = n.value.indexOf(u); let d; if ([Rt.up, Rt.down].includes(l)) { if (s.preventDefault(), l === Rt.up) { d = c === -1 ? 0 : c !== 0 ? c - 1 : n.value.length - 1; const h10 = d; for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) { if (d--, d === h10) { d = -1; break; } d < 0 && (d = n.value.length - 1); } } else { d = c === -1 ? 0 : c < n.value.length - 1 ? c + 1 : 0; const h10 = d; for (; !e.value.getNode(n.value[d].dataset.key).canFocus; ) { if (d++, d === h10) { d = -1; break; } d >= n.value.length && (d = 0); } } d !== -1 && n.value[d].focus(); } [Rt.left, Rt.right].includes(l) && (s.preventDefault(), u.click()); const f = u.querySelector('[type="checkbox"]'); [Rt.enter, Rt.space].includes(l) && f && (s.preventDefault(), f.click()); }); const o = () => { var s; n.value = Array.from(t13.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)), a.value = Array.from(t13.value.querySelectorAll("input[type=checkbox]")); const u = t13.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`); if (u.length) { u[0].setAttribute("tabindex", "0"); return; } (s = n.value[0]) == null || s.setAttribute("tabindex", "0"); }; } var g5 = defineComponent({ name: "ElTree", components: { ElTreeNode: h5 }, props: { data: { type: Array, default: () => [] }, emptyText: { type: String }, renderAfterExpand: { type: Boolean, default: true }, nodeKey: String, checkStrictly: Boolean, defaultExpandAll: Boolean, expandOnClickNode: { type: Boolean, default: true }, checkOnClickNode: Boolean, checkDescendants: { type: Boolean, default: false }, autoExpandParent: { type: Boolean, default: true }, defaultCheckedKeys: Array, defaultExpandedKeys: Array, currentNodeKey: [String, Number], renderContent: Function, showCheckbox: { type: Boolean, default: false }, draggable: { type: Boolean, default: false }, allowDrag: Function, allowDrop: Function, props: { type: Object, default: () => ({ children: "children", label: "label", disabled: "disabled" }) }, lazy: { type: Boolean, default: false }, highlightCurrent: Boolean, load: Function, filterNodeMethod: Function, accordion: Boolean, indent: { type: Number, default: 18 }, icon: { type: Qn } }, emits: [ "check-change", "current-change", "node-click", "node-contextmenu", "node-collapse", "node-expand", "check", "node-drag-start", "node-drag-end", "node-drop", "node-drag-leave", "node-drag-enter", "node-drag-over" ], setup(t13, e) { const { t: r } = Uo(), n = Ge("tree"), a = inject(es, null), i = ref(new l5({ key: t13.nodeKey, data: t13.data, lazy: t13.lazy, props: t13.props, load: t13.load, currentNodeKey: t13.currentNodeKey, checkStrictly: t13.checkStrictly, checkDescendants: t13.checkDescendants, defaultCheckedKeys: t13.defaultCheckedKeys, defaultExpandedKeys: t13.defaultExpandedKeys, autoExpandParent: t13.autoExpandParent, defaultExpandAll: t13.defaultExpandAll, filterNodeMethod: t13.filterNodeMethod })); i.value.initialize(); const o = ref(i.value.root), s = ref(null), u = ref(null), l = ref(null), { broadcastExpanded: c } = W2(t13), { dragState: d } = d5({ props: t13, ctx: e, el$: u, dropIndicator$: l, store: i }); p5({ el$: u }, i); const f = computed(() => { const { childNodes: L } = o.value, V = a ? a.hasFilteredOptions !== 0 : false; return (!L || L.length === 0 || L.every(({ visible: Y }) => !Y)) && !V; }); watch(() => t13.currentNodeKey, (L) => { i.value.setCurrentNodeKey(L); }), watch(() => t13.defaultCheckedKeys, (L) => { i.value.setDefaultCheckedKey(L); }), watch(() => t13.defaultExpandedKeys, (L) => { i.value.setDefaultExpandedKeys(L); }), watch(() => t13.data, (L) => { i.value.setData(L); }, { deep: true }), watch(() => t13.checkStrictly, (L) => { i.value.checkStrictly = L; }); const h10 = (L) => { if (!t13.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter"); i.value.filter(L); }, v = (L) => xg(t13.nodeKey, L.data), p = (L) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in getNodePath"); const V = i.value.getNode(L); if (!V) return []; const Y = [V.data]; let H = V.parent; for (; H && H !== o.value; ) Y.push(H.data), H = H.parent; return Y.reverse(); }, g = (L, V) => i.value.getCheckedNodes(L, V), y = (L) => i.value.getCheckedKeys(L), m = () => { const L = i.value.getCurrentNode(); return L ? L.data : null; }, b = () => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in getCurrentKey"); const L = m(); return L ? L[t13.nodeKey] : null; }, w = (L, V) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedNodes"); i.value.setCheckedNodes(L, V); }, x = (L, V) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCheckedKeys"); i.value.setCheckedKeys(L, V); }, E = (L, V, Y) => { i.value.setChecked(L, V, Y); }, C = () => i.value.getHalfCheckedNodes(), k = () => i.value.getHalfCheckedKeys(), S = (L, V = true) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentNode"); Ep(i, e.emit, () => { c(L), i.value.setUserCurrentNode(L, V); }); }, _ = (L, V = true) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in setCurrentKey"); Ep(i, e.emit, () => { c(), i.value.setCurrentNodeKey(L, V); }); }, T = (L) => i.value.getNode(L), O = (L) => { i.value.remove(L); }, D = (L, V) => { i.value.append(L, V); }, A = (L, V) => { i.value.insertBefore(L, V); }, F = (L, V) => { i.value.insertAfter(L, V); }, R = (L, V, Y) => { c(V), e.emit("node-expand", L, V, Y); }, M = (L, V) => { if (!t13.nodeKey) throw new Error("[Tree] nodeKey is required in updateKeyChild"); i.value.updateChildren(L, V); }; return provide("RootTree", { ctx: e, props: t13, store: i, root: o, currentNode: s, instance: getCurrentInstance() }), provide(Io, void 0), { ns: n, store: i, root: o, currentNode: s, dragState: d, el$: u, dropIndicator$: l, isEmpty: f, filter: h10, getNodeKey: v, getNodePath: p, getCheckedNodes: g, getCheckedKeys: y, getCurrentNode: m, getCurrentKey: b, setCheckedNodes: w, setCheckedKeys: x, setChecked: E, getHalfCheckedNodes: C, getHalfCheckedKeys: k, setCurrentNode: S, setCurrentKey: _, t: r, getNode: T, remove: O, append: D, insertBefore: A, insertAfter: F, handleNodeExpand: R, updateKeyChildren: M }; } }); function y5(t13, e, r, n, a, i) { const o = resolveComponent("el-tree-node"); return openBlock(), createElementBlock("div", { ref: "el$", class: normalizeClass([ t13.ns.b(), t13.ns.is("dragging", !!t13.dragState.draggingNode), t13.ns.is("drop-not-allow", !t13.dragState.allowDrop), t13.ns.is("drop-inner", t13.dragState.dropType === "inner"), { [t13.ns.m("highlight-current")]: t13.highlightCurrent } ]), role: "tree" }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.root.childNodes, (s) => (openBlock(), createBlock(o, { key: t13.getNodeKey(s), node: s, props: t13.props, accordion: t13.accordion, "render-after-expand": t13.renderAfterExpand, "show-checkbox": t13.showCheckbox, "render-content": t13.renderContent, onNodeExpand: t13.handleNodeExpand }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]))), 128)), t13.isEmpty ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(t13.ns.e("empty-block")) }, [ renderSlot(t13.$slots, "empty", {}, () => { var s; return [ createBaseVNode("span", { class: normalizeClass(t13.ns.e("empty-text")) }, toDisplayString((s = t13.emptyText) != null ? s : t13.t("el.tree.emptyText")), 3) ]; }) ], 2)) : createCommentVNode("v-if", true), withDirectives(createBaseVNode("div", { ref: "dropIndicator$", class: normalizeClass(t13.ns.e("drop-indicator")) }, null, 2), [ [vShow, t13.dragState.showDropIndicator] ]) ], 2); } var m5 = Ke(g5, [["render", y5], ["__file", "tree.vue"]]); var b5 = Vt(m5); function w5(t13) { let e; const r = ref(false), n = reactive({ ...t13, originalPosition: "", originalOverflow: "", visible: false }); function a(f) { n.text = f; } function i() { const f = n.parent, h10 = d.ns; if (!f.vLoadingAddClassList) { let v = f.getAttribute("loading-number"); v = Number.parseInt(v) - 1, v ? f.setAttribute("loading-number", v.toString()) : (Sa(f, h10.bm("parent", "relative")), f.removeAttribute("loading-number")), Sa(f, h10.bm("parent", "hidden")); } o(), c.unmount(); } function o() { var f, h10; (h10 = (f = d.$el) == null ? void 0 : f.parentNode) == null || h10.removeChild(d.$el); } function s() { var f; t13.beforeClose && !t13.beforeClose() || (r.value = true, clearTimeout(e), e = setTimeout(u, 400), n.visible = false, (f = t13.closed) == null || f.call(t13)); } function u() { if (!r.value) return; const f = n.parent; r.value = false, f.vLoadingAddClassList = void 0, i(); } const l = defineComponent({ name: "ElLoading", setup(f, { expose: h10 }) { const { ns: v, zIndex: p } = nL("loading"); return h10({ ns: v, zIndex: p }), () => { const g = n.spinner || n.svg, y = h("svg", { class: "circular", viewBox: n.svgViewBox ? n.svgViewBox : "0 0 50 50", ...g ? { innerHTML: g } : {} }, [ h("circle", { class: "path", cx: "25", cy: "25", r: "20", fill: "none" }) ]), m = n.text ? h("p", { class: v.b("text") }, [n.text]) : void 0; return h(Transition, { name: v.b("fade"), onAfterLeave: u }, { default: withCtx(() => [ withDirectives(createVNode("div", { style: { backgroundColor: n.background || "" }, class: [ v.b("mask"), n.customClass, n.fullscreen ? "is-fullscreen" : "" ] }, [ h("div", { class: v.b("spinner") }, [y, m]) ]), [[vShow, n.visible]]) ]) }); }; } }), c = createApp(l), d = c.mount(document.createElement("div")); return { ...toRefs(n), setText: a, removeElLoadingChild: o, close: s, handleAfterLeave: u, vm: d, get $el() { return d.$el; } }; } var Ss; var C5 = function(t13 = {}) { if (!It) return; const e = x5(t13); if (e.fullscreen && Ss) return Ss; const r = w5({ ...e, closed: () => { var a; (a = e.closed) == null || a.call(e), e.fullscreen && (Ss = void 0); } }); E5(e, e.parent, r), Bm(e, e.parent, r), e.parent.vLoadingAddClassList = () => Bm(e, e.parent, r); let n = e.parent.getAttribute("loading-number"); return n ? n = `${Number.parseInt(n) + 1}` : n = "1", e.parent.setAttribute("loading-number", n), e.parent.appendChild(r.$el), nextTick(() => r.visible.value = e.visible), e.fullscreen && (Ss = r), r; }; var x5 = (t13) => { var e, r, n, a; let i; return nr(t13.target) ? i = (e = document.querySelector(t13.target)) != null ? e : document.body : i = t13.target || document.body, { parent: i === document.body || t13.body ? document.body : i, background: t13.background || "", svg: t13.svg || "", svgViewBox: t13.svgViewBox || "", spinner: t13.spinner || false, text: t13.text || "", fullscreen: i === document.body && ((r = t13.fullscreen) != null ? r : true), lock: (n = t13.lock) != null ? n : false, customClass: t13.customClass || "", visible: (a = t13.visible) != null ? a : true, beforeClose: t13.beforeClose, closed: t13.closed, target: i }; }; var E5 = async (t13, e, r) => { const { nextZIndex: n } = r.vm.zIndex || r.vm._.exposed.zIndex, a = {}; if (t13.fullscreen) r.originalPosition.value = Ji(document.body, "position"), r.originalOverflow.value = Ji(document.body, "overflow"), a.zIndex = n(); else if (t13.parent === document.body) { r.originalPosition.value = Ji(document.body, "position"), await nextTick(); for (const i of ["top", "left"]) { const o = i === "top" ? "scrollTop" : "scrollLeft"; a[i] = `${t13.target.getBoundingClientRect()[i] + document.body[o] + document.documentElement[o] - Number.parseInt(Ji(document.body, `margin-${i}`), 10)}px`; } for (const i of ["height", "width"]) a[i] = `${t13.target.getBoundingClientRect()[i]}px`; } else r.originalPosition.value = Ji(e, "position"); for (const [i, o] of Object.entries(a)) r.$el.style[i] = o; }; var Bm = (t13, e, r) => { const n = r.vm.ns || r.vm._.exposed.ns; ["absolute", "fixed", "sticky"].includes(r.originalPosition.value) ? Sa(e, n.bm("parent", "relative")) : gp(e, n.bm("parent", "relative")), t13.fullscreen && t13.lock ? gp(e, n.bm("parent", "hidden")) : Sa(e, n.bm("parent", "hidden")); }; var zs = Symbol("ElLoading"); var $m = (t13, e) => { var r, n, a, i; const o = e.instance, s = (f) => Gt(e.value) ? e.value[f] : void 0, u = (f) => { const h10 = nr(f) && (o == null ? void 0 : o[f]) || f; return h10 && ref(h10); }, l = (f) => u(s(f) || t13.getAttribute(`element-loading-${TI(f)}`)), c = (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: c, target: (n = s("target")) != null ? n : c ? void 0 : t13, body: (a = s("body")) != null ? a : e.modifiers.body, lock: (i = s("lock")) != null ? i : e.modifiers.lock }; t13[zs] = { options: d, instance: C5(d) }; }; var S5 = (t13, e) => { for (const r of Object.keys(e)) isRef(e[r]) && (e[r].value = t13[r]); }; var Eg = { mounted(t13, e) { e.value && $m(t13, e); }, updated(t13, e) { const r = t13[zs]; e.oldValue !== e.value && (e.value && !e.oldValue ? $m(t13, e) : e.value && e.oldValue ? Gt(e.value) && S5(e.value, r.options) : r == null || r.instance.close()); }, unmounted(t13) { var e; (e = t13[zs]) == null || e.instance.close(), t13[zs] = null; } }; var Er = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var k5 = "Copy to clipboard"; var _5 = "Copied!"; var T5 = { name: "CopyToClipboard", props: { content: { type: String, default: "" }, label: { type: String, default: k5 }, /** * `theme: light` will show white button, * to use when the button is over other readable text content. * Default button is transparent. */ theme: { type: String, default: "" } }, data: function() { return { textLabel: this.label, autoHideTimeout: 0, tooltipContainer: null }; }, mounted() { const t13 = document.querySelector(".mapcontent"); t13 ? this.tooltipContainer = t13 : this.tooltipContainer = document.body; }, methods: { copyToClipboard: async function() { let t13 = true; this.autoHideTimeout = 600; try { const e = this.content.replaceAll(` `, ""), r = document.createElement("div"); r.innerHTML = this.content; const n = r.textContent || r.innerText || "", a = new Blob([e], { type: "text/html" }), i = new Blob([n], { type: "text/plain" }), o = new ClipboardItem({ "text/html": a, "text/plain": i }); await navigator.clipboard.write([o]); } catch (e) { console.error( "Error when trying to use navigator.clipboard.write()", e ), t13 = false; } t13 ? this.textLabel = _5 : this.textLabel = "Error trying to copy to clipboard!"; }, resetSettings: function() { this.autoHideTimeout = 0, this.textLabel = this.label; } } }; var I5 = { class: "visually-hidden" }; function O5(t13, e, r, n, a, i) { const o = copy_document_default, s = Ft, u = mr, l = Jo; return openBlock(), createBlock(l, { content: t13.textLabel, placement: "bottom", "hide-after": t13.autoHideTimeout, effect: "clipboard-tooltip", onHide: i.resetSettings, teleported: true, "append-to": t13.tooltipContainer }, { default: withCtx(() => [ createVNode(u, { class: normalizeClass(["copy-clipboard-button", r.theme]), size: "small", onClick: i.copyToClipboard, disabled: !r.content }, { default: withCtx(() => [ createVNode(s, { color: r.content ? "#8300bf" : "#dab3ec" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }, 8, ["color"]), createBaseVNode("span", I5, toDisplayString(t13.textLabel), 1) ]), _: 1 }, 8, ["class", "onClick", "disabled"]) ]), _: 1 }, 8, ["content", "hide-after", "onHide", "append-to"]); } var Sg = Er(T5, [["render", O5], ["__scopeId", "data-v-91c822cd"]]); var A5 = { name: "AnnotationPopup", props: { annotationEntry: { type: Array } }, inject: ["$annotator", "userApiKey"], data: function() { return { displayPair: { "Feature ID": "featureId", Label: "label", Ontology: "models", Name: "name", Resource: "resourceId" }, editing: false, evidencePrefixes: [ { value: "DOI:", label: "DOI:" }, { value: "PMID:", label: "PMID:" }, { value: "", label: "Other:" } ], evidencePrefix: "DOI:", evidence: [], authenticated: false, newEvidence: "", comment: "", prevSubs: [], showSubmissions: true, errorMessage: "", creator: void 0, copyContent: "", entryIndex: 0 }; }, computed: { entry: function() { return this.annotationEntry[this.entryIndex]; }, previousLabel: function() { var t13; return this.entryIndex === 0 ? "This is the first item. Click 'Next' to see more information." : (t13 = this.annotationEntry[this.entryIndex - 1]) == null ? void 0 : t13.label; }, nextLabel: function() { var t13; return this.entryIndex === this.annotationEntry.length - 1 ? "This is the last item. Click 'Previous' to see more information." : (t13 = this.annotationEntry[this.entryIndex + 1]) == null ? void 0 : t13.label; }, isEditable: function() { return this.entry.resourceId && this.entry.featureId; }, isPositionUpdated: function() { return this.entry.resourceId && this.entry.type === "updated" && this.entry.positionUpdated; }, isDeleted: function() { return this.entry.resourceId && this.entry.type === "deleted"; }, ontologyLink: function() { const t13 = this.entry.models; if (t13 && t13.startsWith("UBERON")) return `http://purl.obolibrary.org/obo/${this.entry.models.replace(":", "_")}`; }, updatedCopyContent: function() { return this.getUpdateCopyContent(); }, offlineAnnotationEnabled: function() { return this.entry ? this.entry.offline : false; } }, methods: { previous: function() { this.entryIndex !== 0 && (this.entryIndex = this.entryIndex - 1, this.emitActiveItemChange()); }, next: function() { this.entryIndex !== this.annotationEntry.length - 1 && (this.entryIndex = this.entryIndex + 1, this.emitActiveItemChange()); }, emitActiveItemChange: function() { const t13 = { tabType: "annotation" }, e = this.annotationEntry[this.entryIndex], r = { ...t13, ...e }; this.$emit("hover-changed", r); }, processEvidences: function(t13) { var r; const e = []; return (r = t13 == null ? void 0 : t13.body) != null && r.evidence && t13.body.evidence.forEach((n) => { if (typeof n == "object") e.push(n); else { const a = {}; if (n.includes("https://doi.org/")) { const i = n.replace("https://doi.org/", "DOI:"); a[i] = n; } else if (n.includes("https://pubmed.ncbi.nlm.nih.gov/")) { const i = n.replace("https://pubmed.ncbi.nlm.nih.gov/", "PMID:"); a[i] = n; } Object.keys(a).length > 0 ? e.push(a) : e.push(n); } }), e; }, evidenceEntered: function(t13) { t13 && (this.evidence.push(this.evidencePrefix + t13), this.newEvidence = ""); }, formatTime: function(t13) { const e = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric" }; return new Date(t13).toLocaleDateString(void 0, e); }, updatePrevSubmissions: function() { var t13; if (this.offlineAnnotationEnabled) { const e = JSON.parse(sessionStorage.getItem("anonymous-annotation")) || []; this.prevSubs = e.filter((r) => r.resource === this.entry.resourceId && r.item.id === this.entry.featureId); } else this.$annotator && this.authenticated && this.entry.resourceId && this.entry.featureId && ((t13 = this.$annotator) == null || t13.itemAnnotations( this.userApiKey, this.entry.resourceId, this.entry.featureId ).then((e) => { this.prevSubs = e; }).catch((e) => { console.log(e); })); }, submit: function() { var t13; if (this.entry.type === "updated" && this.entry.positionUpdated ? this.comment = this.comment ? `Position Updated: ${this.comment}` : "Position Updated" : this.entry.type === "deleted" && (this.comment = this.comment ? `Feature Deleted: ${this.comment}` : "Feature Deleted"), (this.evidence.length > 0 || this.comment) && this.entry.resourceId && this.entry.featureId) { const e = []; this.evidence.forEach((n) => { if (n.includes("DOI:")) { const a = n.replace("DOI:", "https://doi.org/"); e.push(new URL(a)); } else if (n.includes("PMID:")) { const a = n.replace( "PMID:", "https://pubmed.ncbi.nlm.nih.gov/" ); e.push(new URL(a)); } else e.push(n); }); const r = { resource: this.entry.resourceId, item: Object.assign( { id: this.entry.featureId }, Object.fromEntries( Object.entries(this.entry).filter( ([n]) => ["label", "models"].includes(n) ) ) ), body: { evidence: e, comment: this.comment }, feature: this.entry.feature }; Object.assign(r.body, this.entry.body), this.entry.type === "deleted" && (r.feature = void 0), this.creator && (r.creator = this.creator), (t13 = this.$annotator) == null || t13.addAnnotation(this.userApiKey, r).then(() => { this.errorMessage = "", this.resetSubmission(), this.updatePrevSubmissions(); }).catch(() => { this.errorMessage = "There is a problem with the submission, please try again later"; }), this.$emit("annotation", r); } }, removeEvidence: function(t13) { this.evidence.splice(t13, 1); }, resetSubmission: function() { this.editing = false, this.evidence = [], this.newFeature = "", this.comment = ""; }, getUpdateCopyContent: function() { if (!this.entry) return ""; const t13 = []; if (this.entry.featureId && t13.push(`
Feature ID:${this.entry.featureId}
`), this.entry.label && t13.push(`
Label:${this.entry.label}
`), this.entry.models && (t13.push(`
Ontology:${this.entry.models}
`), this.ontologyLink && t13.push(`
Ontology Link:${this.ontologyLink}
`)), this.entry.resourceId && t13.push(`
Resource:${this.entry.resourceId}
`), this.prevSubs.length) { let e = `
Annotations:

`; this.prevSubs.map((r, n) => { if (r.creator && (e += `
Created:${this.formatTime(r.created)}

`, e += `
Creator:${r.creator.name}

`, e += `
Email:${r.creator.email}

`), r.body.evidence.length) { let a = ""; r.body.evidence.forEach((i, o) => { a += `${typeof i == "object" ? Object.values(i)[0] : i}`, o !== r.body.evidence.length - 1 && (a += ", "); }), e += `
Evidence:${a}

`; } e += `
Comment:${r.body.comment}

`; }), t13.push(`
${e}
`); } return t13.join(`
`); } }, watch: { annotationEntry: { deep: true, immediate: true, handler: function(t13, e) { t13 !== e && (this.entryIndex = 0, t13 != null && t13.length && this.emitActiveItemChange()); } }, entry: { deep: true, immediate: true, handler: function(t13, e) { t13 && t13 !== e && (this.resetSubmission(), this.updatePrevSubmissions()); } } }, mounted: function() { var t13; (t13 = this.$annotator) == null || t13.authenticate(this.userApiKey).then((e) => { e.name && e.email && e.canUpdate ? (this.creator = e, e.orcid || (this.creator.orcid = "0000-0000-0000-0000"), this.authenticated = true) : this.errorMessage = "", this.updatePrevSubmissions(); }); } }; var Ha = (t13) => (pushScopeId("data-v-52f81058"), t13 = t13(), popScopeId(), t13); var P5 = { key: 0, class: "toggle-button" }; var D5 = { class: "block" }; var R5 = Ha(() => createBaseVNode("div", { class: "title" }, "Feature Annotations", -1)); var L5 = { class: "title-buttons" }; var F5 = { key: 0 }; var M5 = ["href"]; var N5 = Ha(() => createBaseVNode("strong", { class: "sub-title" }, "Previous submissions:", -1)); var B5 = Ha(() => createBaseVNode("strong", null, "Evidence:  ", -1)); var $5 = ["href"]; var q5 = { key: 1 }; var z5 = { key: 2 }; var V5 = Ha(() => createBaseVNode("strong", null, "Comment:  ", -1)); var H5 = Ha(() => createBaseVNode("strong", { class: "sub-title" }, "Suggest changes:", -1)); var K5 = Ha(() => createBaseVNode("strong", null, "Evidence:", -1)); var G5 = Ha(() => createBaseVNode("strong", null, "Comment:", -1)); var U5 = { class: "sub-title" }; function W5(t13, e, r, n, a, i) { const o = mr, s = Li, u = Sg, l = Dl, c = arrow_up_default, d = Ft, f = arrow_down_default, h10 = edit_default, v = delete_default, p = finished_default, g = Qo, y = close_default, m = XN, b = ZN, w = Xo, x = wg; return openBlock(), createBlock(x, { class: "main" }, { default: withCtx(() => [ r.annotationEntry.length > 1 ? (openBlock(), createElementBlock("div", P5, [ createVNode(s, { width: "auto", trigger: "hover", teleported: false }, { reference: withCtx(() => [ createVNode(o, { class: "button", onClick: i.previous, disabled: this.entryIndex === 0 }, { default: withCtx(() => [ createTextVNode(" Previous ") ]), _: 1 }, 8, ["onClick", "disabled"]) ]), default: withCtx(() => [ createBaseVNode("span", null, toDisplayString(i.previousLabel), 1) ]), _: 1 }), createVNode(s, { width: "auto", trigger: "hover", teleported: false }, { reference: withCtx(() => [ createVNode(o, { class: "button", onClick: i.next, disabled: this.entryIndex === this.annotationEntry.length - 1 }, { default: withCtx(() => [ createTextVNode(" Next ") ]), _: 1 }, 8, ["onClick", "disabled"]) ]), default: withCtx(() => [ createBaseVNode("span", null, toDisplayString(i.nextLabel), 1) ]), _: 1 }) ])) : createCommentVNode("", true), createBaseVNode("div", D5, [ createVNode(l, { class: "info-field" }, { default: withCtx(() => [ R5, createBaseVNode("div", L5, [ createVNode(u, { content: i.updatedCopyContent }, null, 8, ["content"]) ]) ]), _: 1 }), i.entry ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.displayPair, (E, C) => withDirectives((openBlock(), createBlock(l, { class: "dialog-text", key: E }, { default: withCtx(() => [ createBaseVNode("strong", null, toDisplayString(C) + ": ", 1), createTextVNode("  "), C !== "Ontology" ? (openBlock(), createElementBlock("span", F5, toDisplayString(i.entry[E]), 1)) : (openBlock(), createElementBlock("a", { key: 1, href: i.ontologyLink, target: "_blank" }, toDisplayString(i.entry[E]), 9, M5)) ]), _: 2 }, 1024)), [ [vShow, i.entry[E]] ])), 128)), t13.prevSubs.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ withDirectives(createBaseVNode("div", { class: "hide", onClick: e[0] || (e[0] = (E) => t13.showSubmissions = false) }, [ createTextVNode(" Hide previous submissions "), createVNode(d, null, { default: withCtx(() => [ createVNode(c) ]), _: 1 }) ], 512), [ [vShow, t13.showSubmissions] ]), withDirectives(createBaseVNode("div", { class: "hide", onClick: e[1] || (e[1] = (E) => t13.showSubmissions = true) }, [ createTextVNode(" Show previous " + toDisplayString(t13.prevSubs.length) + " submission(s) ", 1), createVNode(d, null, { default: withCtx(() => [ createVNode(f) ]), _: 1 }) ], 512), [ [vShow, !t13.showSubmissions] ]), t13.showSubmissions ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(l, { class: "dialog-spacer" }), createVNode(l, { class: "dialog-text" }, { default: withCtx(() => [ N5 ]), _: 1 }), (openBlock(true), createElementBlock(Fragment, null, renderList(t13.prevSubs, (E, C) => (openBlock(), createElementBlock("div", { class: "entry", key: C }, [ E.creator ? (openBlock(), createBlock(l, { key: 0, class: "dialog-text" }, { default: withCtx(() => [ createBaseVNode("strong", null, toDisplayString(i.formatTime(E.created)), 1), createTextVNode(" " + toDisplayString(E.creator.name), 1) ]), _: 2 }, 1024)) : createCommentVNode("", true), createVNode(l, { class: "dialog-text" }, { default: withCtx(() => [ B5, (openBlock(true), createElementBlock(Fragment, null, renderList(i.processEvidences(E), (k, S) => (openBlock(), createBlock(l, { key: k, class: "dialog-text" }, { default: withCtx(() => [ typeof k == "object" ? (openBlock(), createElementBlock("a", { key: 0, href: Object.values(k)[0], target: "_blank" }, toDisplayString(Object.keys(k)[0]), 9, $5)) : (openBlock(), createElementBlock("span", q5, toDisplayString(k), 1)), S !== E.body.evidence.length - 1 ? (openBlock(), createElementBlock("span", z5, ", ")) : createCommentVNode("", true) ]), _: 2 }, 1024))), 128)) ]), _: 2 }, 1024), createVNode(l, { class: "dialog-text" }, { default: withCtx(() => [ V5, createTextVNode(" " + toDisplayString(E.body.comment), 1) ]), _: 2 }, 1024) ]))), 128)) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true), t13.authenticated || i.offlineAnnotationEnabled ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ i.isEditable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(l, { class: "dialog-spacer" }), t13.editing ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ createVNode(l, { class: "dialog-text" }, { default: withCtx(() => [ H5 ]), _: 1 }), i.isDeleted ? createCommentVNode("", true) : (openBlock(), createElementBlock(Fragment, { key: 0 }, [ createVNode(l, { class: "dialog-text" }, { default: withCtx(() => [ K5 ]), _: 1 }), (openBlock(true), createElementBlock(Fragment, null, renderList(t13.evidence, (E, C) => (openBlock(), createBlock(l, { key: E }, { default: withCtx(() => [ createVNode(g, { span: 20 }, { default: withCtx(() => [ createTextVNode(toDisplayString(t13.evidence[C]), 1) ]), _: 2 }, 1024), createVNode(g, { span: 4 }, { default: withCtx(() => [ createVNode(d, { class: "standard-icon" }, { default: withCtx(() => [ createVNode(y, { onClick: (k) => i.removeEvidence(C) }, null, 8, ["onClick"]) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1024))), 128)), createVNode(l, null, { default: withCtx(() => [ createVNode(w, { size: "small", placeholder: "Enter", modelValue: t13.newEvidence, "onUpdate:modelValue": e[4] || (e[4] = (E) => t13.newEvidence = E), onChange: e[5] || (e[5] = (E) => i.evidenceEntered(E)) }, { prepend: withCtx(() => [ createVNode(b, { teleported: false, modelValue: t13.evidencePrefix, "onUpdate:modelValue": e[3] || (e[3] = (E) => t13.evidencePrefix = E), placeholder: "Other:", class: "select-box", "popper-class": "flatmap_dropdown" }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.evidencePrefixes, (E) => (openBlock(), createBlock(m, { key: E.label, value: E.value }, { default: withCtx(() => [ createVNode(l, null, { default: withCtx(() => [ createVNode(g, { span: 12 }, { default: withCtx(() => [ createTextVNode(toDisplayString(E.label), 1) ]), _: 2 }, 1024) ]), _: 2 }, 1024) ]), _: 2 }, 1032, ["value"]))), 128)) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }, 8, ["modelValue"]) ]), _: 1 }) ], 64)), createVNode(l, null, { default: withCtx(() => [ G5 ]), _: 1 }), createVNode(l, { class: "dialog-text" }, { default: withCtx(() => [ createVNode(w, { type: "textarea", autosize: { minRows: 2, maxRows: 4 }, placeholder: "Enter", modelValue: t13.comment, "onUpdate:modelValue": e[6] || (e[6] = (E) => t13.comment = E) }, null, 8, ["modelValue"]) ]), _: 1 }), createVNode(l, { class: "dialog-text" }, { default: withCtx(() => [ createVNode(o, { class: "button", type: "primary", plain: "", onClick: i.submit }, { default: withCtx(() => [ createTextVNode(" Submit ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ], 64)) : (openBlock(), createBlock(l, { key: 0 }, { default: withCtx(() => [ createVNode(d, { class: "standard-icon" }, { default: withCtx(() => [ createVNode(h10, { onClick: e[2] || (e[2] = (E) => t13.editing = true) }) ]), _: 1 }), i.isDeleted ? (openBlock(), createBlock(d, { key: 0, class: "standard-icon" }, { default: withCtx(() => [ createVNode(v, { onClick: i.submit }, null, 8, ["onClick"]) ]), _: 1 })) : i.isPositionUpdated ? (openBlock(), createBlock(d, { key: 1, class: "standard-icon" }, { default: withCtx(() => [ createVNode(p, { onClick: i.submit }, null, 8, ["onClick"]) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 })), t13.errorMessage ? (openBlock(), createBlock(l, { key: 2, class: "dialog-text" }, { default: withCtx(() => [ createBaseVNode("strong", U5, toDisplayString(t13.errorMessage), 1) ]), _: 1 })) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ], 64)) : createCommentVNode("", true) ]) ]), _: 1 }); } var j5 = Er(A5, [["render", W5], ["__scopeId", "data-v-52f81058"]]); var Y5 = { name: "CreateTooltipContent", components: { Button: mr, Col: Qo, Container: bg, Header: K2, Input: Xo, Main: wg }, props: { createData: { type: Object } }, watch: { "createData.shape": { handler: function(t13, e) { this.group = t13, e !== void 0 && this.$emit("cancel-create"); }, immediate: true } }, computed: { confirmText: function() { return this.createData.editingIndex > -1 ? "Edit" : "Confirm"; } }, data: function() { return { group: "default", region: "", showPoint: false }; }, methods: { confirm: function() { this.$emit( "confirm-create", { region: "__annotation/" + this.region, group: this.group, shape: this.createData.shape, editingIndex: this.createData.editingIndex } ), this.group = this.createData.shape; }, cancel: function() { this.$emit("cancel-create"); } } }; var Z5 = (t13) => (pushScopeId("data-v-d61c5879"), t13 = t13(), popScopeId(), t13); var X5 = Z5(() => createBaseVNode("span", { class: "create-text" }, " Primitives will be created in the __annotation region ", -1)); function J5(t13, e, r, n, a, i) { const o = K2, s = Qo, u = Dl, l = Xo, c = mr, d = wg, f = bg; return openBlock(), createBlock(f, { class: "create-container" }, { default: withCtx(() => [ createVNode(o, { height: "30px", class: "header" }, { default: withCtx(() => [ createBaseVNode("div", null, "Create " + toDisplayString(r.createData.shape), 1) ]), _: 1 }), createVNode(d, { class: "slides-block" }, { default: withCtx(() => [ X5, withDirectives(createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Position: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ (openBlock(true), createElementBlock(Fragment, null, renderList(r.createData.points, ({ value: h10, i: v }) => (openBlock(), createBlock(u, { key: v, class: "value" }, { default: withCtx(() => [ createTextVNode(toDisplayString(v), 1) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 }, 512), [ [vShow, t13.showPoint] ]), createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Region: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(l, { modelValue: t13.region, "onUpdate:modelValue": e[0] || (e[0] = (h10) => t13.region = h10), placeholder: "__annotation", size: "small" }, null, 8, ["modelValue"]) ]), _: 1 }) ]), _: 1 }), createVNode(u, { class: "row" }, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 8 }, { default: withCtx(() => [ createTextVNode(" Group: ") ]), _: 1 }), createVNode(s, { offset: 0, span: 16 }, { default: withCtx(() => [ createVNode(l, { modelValue: t13.group, "onUpdate:modelValue": e[1] || (e[1] = (h10) => t13.group = h10), placeholder: r.createData.shape, size: "small" }, null, 8, ["modelValue", "placeholder"]) ]), _: 1 }) ]), _: 1 }), createVNode(u, null, { default: withCtx(() => [ createVNode(s, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(c, { type: "primary", plain: "", onClick: i.confirm }, { default: withCtx(() => [ createTextVNode(toDisplayString(i.confirmText), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }), createVNode(s, { offset: 0, span: 12 }, { default: withCtx(() => [ createVNode(c, { type: "primary", plain: "", onClick: i.cancel }, { default: withCtx(() => [ createTextVNode(" Cancel ") ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }); } var M7 = Er(Y5, [["render", J5], ["__scopeId", "data-v-d61c5879"]]); function Nt(t13) { "@babel/helpers - typeof"; return Nt = 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; }, Nt(t13); } function kg(t13, e) { if (!(t13 instanceof e)) throw new TypeError("Cannot call a class as a function"); } function Q5(t13, e) { for (var r = 0; r < e.length; r++) { var n = e[r]; n.enumerable = n.enumerable || false, n.configurable = true, "value" in n && (n.writable = true), Object.defineProperty(t13, n.key, n); } } function _g(t13, e, r) { return e && Q5(t13.prototype, e), Object.defineProperty(t13, "prototype", { writable: false }), t13; } function Y2(t13, e, r) { return e in t13 ? Object.defineProperty(t13, e, { value: r, enumerable: true, configurable: true, writable: true }) : t13[e] = r, t13; } function Vr(t13, e) { return eB(t13) || tB(t13, e) || Z2(t13, e) || rB(); } function eB(t13) { if (Array.isArray(t13)) return t13; } function tB(t13, e) { var r = t13 == null ? null : typeof Symbol < "u" && t13[Symbol.iterator] || t13["@@iterator"]; if (r != null) { var n = [], a = true, i = false, o, s; try { for (r = r.call(t13); !(a = (o = r.next()).done) && (n.push(o.value), !(e && n.length === e)); a = true) ; } catch (u) { i = true, s = u; } finally { try { !a && r.return != null && r.return(); } finally { if (i) throw s; } } return n; } } function Z2(t13, e) { if (t13) { if (typeof t13 == "string") return qm(t13, e); var r = Object.prototype.toString.call(t13).slice(8, -1); if (r === "Object" && t13.constructor && (r = t13.constructor.name), r === "Map" || r === "Set") return Array.from(t13); if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return qm(t13, e); } } function qm(t13, e) { (e == null || e > t13.length) && (e = t13.length); for (var r = 0, n = new Array(e); r < e; r++) n[r] = t13[r]; return n; } function rB() { 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 X2(t13, e) { var r = typeof Symbol < "u" && t13[Symbol.iterator] || t13["@@iterator"]; if (!r) { if (Array.isArray(t13) || (r = Z2(t13)) || e) { r && (t13 = r); var n = 0, a = function() { }; return { s: a, n: function() { return n >= t13.length ? { done: true } : { done: false, value: t13[n++] }; }, e: function(u) { throw u; }, f: a }; } throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`); } var i = true, o = false, s; return { s: function() { r = r.call(t13); }, n: function() { var u = r.next(); return i = u.done, u; }, e: function(u) { o = true, s = u; }, f: function() { try { !i && r.return != null && r.return(); } finally { if (o) throw s; } } }; } var Dt = typeof window > "u" ? null : window; var zm = Dt ? Dt.navigator : null; Dt && Dt.document; var nB = Nt(""); var J2 = Nt({}); var aB = Nt(function() { }); var iB = typeof HTMLElement > "u" ? "undefined" : Nt(HTMLElement); var ts = function(e) { return e && e.instanceString && yt(e.instanceString) ? e.instanceString() : null; }; var Me = function(e) { return e != null && Nt(e) == nB; }; var yt = function(e) { return e != null && Nt(e) === aB; }; var lt = function(e) { return !xr(e) && (Array.isArray ? Array.isArray(e) : e != null && e instanceof Array); }; var Xe = function(e) { return e != null && Nt(e) === J2 && !lt(e) && e.constructor === Object; }; var oB = function(e) { return e != null && Nt(e) === J2; }; var Ce = function(e) { return e != null && Nt(e) === Nt(1) && !isNaN(e); }; var sB = function(e) { return Ce(e) && Math.floor(e) === e; }; var sl = function(e) { if (iB !== "undefined") return e != null && e instanceof HTMLElement; }; var xr = function(e) { return rs(e) || Q2(e); }; var rs = function(e) { return ts(e) === "collection" && e._private.single; }; var Q2 = function(e) { return ts(e) === "collection" && !e._private.single; }; var Tg = function(e) { return ts(e) === "core"; }; var eS = function(e) { return ts(e) === "stylesheet"; }; var lB = function(e) { return ts(e) === "event"; }; var ea = function(e) { return e == null ? true : !!(e === "" || e.match(/^\s+$/)); }; var uB = function(e) { return typeof HTMLElement > "u" ? false : e instanceof HTMLElement; }; var cB = function(e) { return Xe(e) && Ce(e.x1) && Ce(e.x2) && Ce(e.y1) && Ce(e.y2); }; var dB = function(e) { return oB(e) && yt(e.then); }; var fB = function() { return zm && zm.userAgent.match(/msie|trident|edge/i); }; var Po = function(e, r) { r || (r = function() { if (arguments.length === 1) return arguments[0]; if (arguments.length === 0) return "undefined"; for (var i = [], o = 0; o < arguments.length; o++) i.push(arguments[o]); return i.join("$"); }); var n = function a() { var i = this, o = arguments, s, u = r.apply(i, o), l = a.cache; return (s = l[u]) || (s = l[u] = e.apply(i, o)), s; }; return n.cache = {}, n; }; var Ig = Po(function(t13) { return t13.replace(/([A-Z])/g, function(e) { return "-" + e.toLowerCase(); }); }); var Rl = Po(function(t13) { return t13.replace(/(-\w)/g, function(e) { return e[1].toUpperCase(); }); }); var tS = Po(function(t13, e) { return t13 + e[0].toUpperCase() + e.substring(1); }, function(t13, e) { return t13 + "$" + e; }); var Vm = function(e) { return ea(e) ? e : e.charAt(0).toUpperCase() + e.substring(1); }; var Mt = "(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))"; var vB = "rgb[a]?\\((" + Mt + "[%]?)\\s*,\\s*(" + Mt + "[%]?)\\s*,\\s*(" + Mt + "[%]?)(?:\\s*,\\s*(" + Mt + "))?\\)"; var hB = "rgb[a]?\\((?:" + Mt + "[%]?)\\s*,\\s*(?:" + Mt + "[%]?)\\s*,\\s*(?:" + Mt + "[%]?)(?:\\s*,\\s*(?:" + Mt + "))?\\)"; var pB = "hsl[a]?\\((" + Mt + ")\\s*,\\s*(" + Mt + "[%])\\s*,\\s*(" + Mt + "[%])(?:\\s*,\\s*(" + Mt + "))?\\)"; var gB = "hsl[a]?\\((?:" + Mt + ")\\s*,\\s*(?:" + Mt + "[%])\\s*,\\s*(?:" + Mt + "[%])(?:\\s*,\\s*(?:" + Mt + "))?\\)"; var yB = "\\#[0-9a-fA-F]{3}"; var mB = "\\#[0-9a-fA-F]{6}"; var rS = function(e, r) { return e < r ? -1 : e > r ? 1 : 0; }; var bB = function(e, r) { return -1 * rS(e, r); }; var ze = Object.assign != null ? Object.assign.bind(Object) : function(t13) { for (var e = arguments, r = 1; r < e.length; r++) { var n = e[r]; if (n != null) for (var a = Object.keys(n), i = 0; i < a.length; i++) { var o = a[i]; t13[o] = n[o]; } } return t13; }; var wB = function(e) { if (!(!(e.length === 4 || e.length === 7) || e[0] !== "#")) { var r = e.length === 4, n, a, i, o = 16; return r ? (n = parseInt(e[1] + e[1], o), a = parseInt(e[2] + e[2], o), i = parseInt(e[3] + e[3], o)) : (n = parseInt(e[1] + e[2], o), a = parseInt(e[3] + e[4], o), i = parseInt(e[5] + e[6], o)), [n, a, i]; } }; var CB = function(e) { var r, n, a, i, o, s, u, l; function c(v, p, g) { return g < 0 && (g += 1), g > 1 && (g -= 1), g < 1 / 6 ? v + (p - v) * 6 * g : g < 1 / 2 ? p : g < 2 / 3 ? v + (p - v) * (2 / 3 - g) * 6 : v; } var d = new RegExp("^" + pB + "$").exec(e); if (d) { if (n = parseInt(d[1]), n < 0 ? n = (360 - -1 * n % 360) % 360 : n > 360 && (n = n % 360), n /= 360, a = parseFloat(d[2]), a < 0 || a > 100 || (a = a / 100, i = parseFloat(d[3]), i < 0 || i > 100) || (i = i / 100, o = d[4], o !== void 0 && (o = parseFloat(o), o < 0 || o > 1))) return; if (a === 0) s = u = l = Math.round(i * 255); else { var f = i < 0.5 ? i * (1 + a) : i + a - i * a, h10 = 2 * i - f; s = Math.round(255 * c(h10, f, n + 1 / 3)), u = Math.round(255 * c(h10, f, n)), l = Math.round(255 * c(h10, f, n - 1 / 3)); } r = [s, u, l, o]; } return r; }; var xB = function(e) { var r, n = new RegExp("^" + vB + "$").exec(e); if (n) { r = []; for (var a = [], i = 1; i <= 3; i++) { var o = n[i]; if (o[o.length - 1] === "%" && (a[i] = true), o = parseFloat(o), a[i] && (o = o / 100 * 255), o < 0 || o > 255) return; r.push(Math.floor(o)); } var s = a[1] || a[2] || a[3], u = a[1] && a[2] && a[3]; if (s && !u) return; var l = n[4]; if (l !== void 0) { if (l = parseFloat(l), l < 0 || l > 1) return; r.push(l); } } return r; }; var EB = function(e) { return kB[e.toLowerCase()]; }; var SB = function(e) { return (lt(e) ? e : null) || EB(e) || wB(e) || xB(e) || CB(e); }; var kB = { // special colour names transparent: [0, 0, 0, 0], // NB alpha === 0 // regular colours aliceblue: [240, 248, 255], antiquewhite: [250, 235, 215], aqua: [0, 255, 255], aquamarine: [127, 255, 212], azure: [240, 255, 255], beige: [245, 245, 220], bisque: [255, 228, 196], black: [0, 0, 0], blanchedalmond: [255, 235, 205], blue: [0, 0, 255], blueviolet: [138, 43, 226], brown: [165, 42, 42], burlywood: [222, 184, 135], cadetblue: [95, 158, 160], chartreuse: [127, 255, 0], chocolate: [210, 105, 30], coral: [255, 127, 80], cornflowerblue: [100, 149, 237], cornsilk: [255, 248, 220], crimson: [220, 20, 60], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgoldenrod: [184, 134, 11], darkgray: [169, 169, 169], darkgreen: [0, 100, 0], darkgrey: [169, 169, 169], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkseagreen: [143, 188, 143], darkslateblue: [72, 61, 139], darkslategray: [47, 79, 79], darkslategrey: [47, 79, 79], darkturquoise: [0, 206, 209], darkviolet: [148, 0, 211], deeppink: [255, 20, 147], deepskyblue: [0, 191, 255], dimgray: [105, 105, 105], dimgrey: [105, 105, 105], dodgerblue: [30, 144, 255], firebrick: [178, 34, 34], floralwhite: [255, 250, 240], forestgreen: [34, 139, 34], fuchsia: [255, 0, 255], gainsboro: [220, 220, 220], ghostwhite: [248, 248, 255], gold: [255, 215, 0], goldenrod: [218, 165, 32], gray: [128, 128, 128], grey: [128, 128, 128], green: [0, 128, 0], greenyellow: [173, 255, 47], honeydew: [240, 255, 240], hotpink: [255, 105, 180], indianred: [205, 92, 92], indigo: [75, 0, 130], ivory: [255, 255, 240], khaki: [240, 230, 140], lavender: [230, 230, 250], lavenderblush: [255, 240, 245], lawngreen: [124, 252, 0], lemonchiffon: [255, 250, 205], lightblue: [173, 216, 230], lightcoral: [240, 128, 128], lightcyan: [224, 255, 255], lightgoldenrodyellow: [250, 250, 210], lightgray: [211, 211, 211], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightsalmon: [255, 160, 122], lightseagreen: [32, 178, 170], lightskyblue: [135, 206, 250], lightslategray: [119, 136, 153], lightslategrey: [119, 136, 153], lightsteelblue: [176, 196, 222], lightyellow: [255, 255, 224], lime: [0, 255, 0], limegreen: [50, 205, 50], linen: [250, 240, 230], magenta: [255, 0, 255], maroon: [128, 0, 0], mediumaquamarine: [102, 205, 170], mediumblue: [0, 0, 205], mediumorchid: [186, 85, 211], mediumpurple: [147, 112, 219], mediumseagreen: [60, 179, 113], mediumslateblue: [123, 104, 238], mediumspringgreen: [0, 250, 154], mediumturquoise: [72, 209, 204], mediumvioletred: [199, 21, 133], midnightblue: [25, 25, 112], mintcream: [245, 255, 250], mistyrose: [255, 228, 225], moccasin: [255, 228, 181], navajowhite: [255, 222, 173], navy: [0, 0, 128], oldlace: [253, 245, 230], olive: [128, 128, 0], olivedrab: [107, 142, 35], orange: [255, 165, 0], orangered: [255, 69, 0], orchid: [218, 112, 214], palegoldenrod: [238, 232, 170], palegreen: [152, 251, 152], paleturquoise: [175, 238, 238], palevioletred: [219, 112, 147], papayawhip: [255, 239, 213], peachpuff: [255, 218, 185], peru: [205, 133, 63], pink: [255, 192, 203], plum: [221, 160, 221], powderblue: [176, 224, 230], purple: [128, 0, 128], red: [255, 0, 0], rosybrown: [188, 143, 143], royalblue: [65, 105, 225], saddlebrown: [139, 69, 19], salmon: [250, 128, 114], sandybrown: [244, 164, 96], seagreen: [46, 139, 87], seashell: [255, 245, 238], sienna: [160, 82, 45], silver: [192, 192, 192], skyblue: [135, 206, 235], slateblue: [106, 90, 205], slategray: [112, 128, 144], slategrey: [112, 128, 144], snow: [255, 250, 250], springgreen: [0, 255, 127], steelblue: [70, 130, 180], tan: [210, 180, 140], teal: [0, 128, 128], thistle: [216, 191, 216], tomato: [255, 99, 71], turquoise: [64, 224, 208], violet: [238, 130, 238], wheat: [245, 222, 179], white: [255, 255, 255], whitesmoke: [245, 245, 245], yellow: [255, 255, 0], yellowgreen: [154, 205, 50] }; var nS = function(e) { for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) { var o = n[i]; if (Xe(o)) throw Error("Tried to set map with object key"); i < n.length - 1 ? (r[o] == null && (r[o] = {}), r = r[o]) : r[o] = e.value; } }; var aS = function(e) { for (var r = e.map, n = e.keys, a = n.length, i = 0; i < a; i++) { var o = n[i]; if (Xe(o)) throw Error("Tried to get map with object key"); if (r = r[o], r == null) return r; } return r; }; function _B(t13) { var e = typeof t13; return t13 != null && (e == "object" || e == "function"); } var Aa = _B; var lo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function TB(t13, e) { return e = { exports: {} }, t13(e, e.exports), e.exports; } var IB = typeof lo == "object" && lo && lo.Object === Object && lo; var OB = IB; var AB = typeof self == "object" && self && self.Object === Object && self; var PB = OB || AB || Function("return this")(); var Ll = PB; var DB = function() { return Ll.Date.now(); }; var Au = DB; var RB = /\s/; function LB(t13) { for (var e = t13.length; e-- && RB.test(t13.charAt(e)); ) ; return e; } var FB = LB; var MB = /^\s+/; function NB(t13) { return t13 && t13.slice(0, FB(t13) + 1).replace(MB, ""); } var BB = NB; var $B = Ll.Symbol; var _i = $B; var iS = Object.prototype; var qB = iS.hasOwnProperty; var zB = iS.toString; var to = _i ? _i.toStringTag : void 0; function VB(t13) { var e = qB.call(t13, to), r = t13[to]; try { t13[to] = void 0; var n = true; } catch { } var a = zB.call(t13); return n && (e ? t13[to] = r : delete t13[to]), a; } var HB = VB; var KB = Object.prototype; var GB = KB.toString; function UB(t13) { return GB.call(t13); } var WB = UB; var jB = "[object Null]"; var YB = "[object Undefined]"; var Hm = _i ? _i.toStringTag : void 0; function ZB(t13) { return t13 == null ? t13 === void 0 ? YB : jB : Hm && Hm in Object(t13) ? HB(t13) : WB(t13); } var oS = ZB; function XB(t13) { return t13 != null && typeof t13 == "object"; } var JB = XB; var QB = "[object Symbol]"; function e$(t13) { return typeof t13 == "symbol" || JB(t13) && oS(t13) == QB; } var ns = e$; var Km = NaN; var t$ = /^[-+]0x[0-9a-f]+$/i; var r$ = /^0b[01]+$/i; var n$ = /^0o[0-7]+$/i; var a$ = parseInt; function i$(t13) { if (typeof t13 == "number") return t13; if (ns(t13)) return Km; if (Aa(t13)) { var e = typeof t13.valueOf == "function" ? t13.valueOf() : t13; t13 = Aa(e) ? e + "" : e; } if (typeof t13 != "string") return t13 === 0 ? t13 : +t13; t13 = BB(t13); var r = r$.test(t13); return r || n$.test(t13) ? a$(t13.slice(2), r ? 2 : 8) : t$.test(t13) ? Km : +t13; } var Gm = i$; var o$ = "Expected a function"; var s$ = Math.max; var l$ = Math.min; function u$(t13, e, r) { var n, a, i, o, s, u, l = 0, c = false, d = false, f = true; if (typeof t13 != "function") throw new TypeError(o$); e = Gm(e) || 0, Aa(r) && (c = !!r.leading, d = "maxWait" in r, i = d ? s$(Gm(r.maxWait) || 0, e) : i, f = "trailing" in r ? !!r.trailing : f); function h10(E) { var C = n, k = a; return n = a = void 0, l = E, o = t13.apply(k, C), o; } function v(E) { return l = E, s = setTimeout(y, e), c ? h10(E) : o; } function p(E) { var C = E - u, k = E - l, S = e - C; return d ? l$(S, i - k) : S; } function g(E) { var C = E - u, k = E - l; return u === void 0 || C >= e || C < 0 || d && k >= i; } function y() { var E = Au(); if (g(E)) return m(E); s = setTimeout(y, p(E)); } function m(E) { return s = void 0, f && n ? h10(E) : (n = a = void 0, o); } function b() { s !== void 0 && clearTimeout(s), l = 0, n = u = a = s = void 0; } function w() { return s === void 0 ? o : m(Au()); } function x() { var E = Au(), C = g(E); if (n = arguments, a = this, u = E, C) { if (s === void 0) return v(u); if (d) return clearTimeout(s), s = setTimeout(y, e), h10(u); } return s === void 0 && (s = setTimeout(y, e)), o; } return x.cancel = b, x.flush = w, x; } var Fl = u$; var Pu = Dt ? Dt.performance : null; var sS = Pu && Pu.now ? function() { return Pu.now(); } : function() { return Date.now(); }; var c$ = function() { if (Dt) { if (Dt.requestAnimationFrame) return function(t13) { Dt.requestAnimationFrame(t13); }; if (Dt.mozRequestAnimationFrame) return function(t13) { Dt.mozRequestAnimationFrame(t13); }; if (Dt.webkitRequestAnimationFrame) return function(t13) { Dt.webkitRequestAnimationFrame(t13); }; if (Dt.msRequestAnimationFrame) return function(t13) { Dt.msRequestAnimationFrame(t13); }; } return function(t13) { t13 && setTimeout(function() { t13(sS()); }, 1e3 / 60); }; }(); var ll = function(e) { return c$(e); }; var kn = sS; var li = 9261; var lS = 65599; var uo = 5381; var uS = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : li, n = r, a; a = e.next(), !a.done; ) n = n * lS + a.value | 0; return n; }; var Do = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : li; return r * lS + e | 0; }; var Ro = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : uo; return (r << 5) + r + e | 0; }; var d$ = function(e, r) { return e * 2097152 + r; }; var $n = function(e) { return e[0] * 2097152 + e[1]; }; var ks = function(e, r) { return [Do(e[0], r[0]), Ro(e[1], r[1])]; }; var f$ = function(e, r) { var n = { value: 0, done: false }, a = 0, i = e.length, o = { next: function() { return a < i ? n.value = e[a++] : n.done = true, n; } }; return uS(o, r); }; var Pa = function(e, r) { var n = { value: 0, done: false }, a = 0, i = e.length, o = { next: function() { return a < i ? n.value = e.charCodeAt(a++) : n.done = true, n; } }; return uS(o, r); }; var cS = function() { return v$(arguments); }; var v$ = function(e) { for (var r, n = 0; n < e.length; n++) { var a = e[n]; n === 0 ? r = Pa(a) : r = Pa(a, r); } return r; }; var Um = true; var h$ = console.warn != null; var p$ = console.trace != null; var Og = Number.MAX_SAFE_INTEGER || 9007199254740991; var dS = function() { return true; }; var ul = function() { return false; }; var Wm = function() { return 0; }; var Ag = function() { }; var bt = function(e) { throw new Error(e); }; var fS = function(e) { if (e !== void 0) Um = !!e; else return Um; }; var tt = function(e) { fS() && (h$ ? console.warn(e) : (console.log(e), p$ && console.trace())); }; var g$ = function(e) { return ze({}, e); }; var rn = function(e) { return e == null ? e : lt(e) ? e.slice() : Xe(e) ? g$(e) : e; }; var y$ = function(e) { return e.slice(); }; var vS = function(e, r) { for ( // loop :) r = e = ""; // b - result , a - numeric letiable e++ < 36; // r += e * 51 & 52 ? ( // return a random number or 4 (e ^ 15 ? ( // generate a random number from 0 to 15 8 ^ Math.random() * (e ^ 20 ? 16 : 4) ) : 4).toString(16) ) : "-" ) ; return r; }; var m$ = {}; var hS = function() { return m$; }; var Zt = function(e) { var r = Object.keys(e); return function(n) { for (var a = {}, i = 0; i < r.length; i++) { var o = r[i], s = n == null ? void 0 : n[o]; a[o] = s === void 0 ? e[o] : s; } return a; }; }; var ta = function(e, r, n) { for (var a = e.length - 1; a >= 0; a--) e[a] === r && e.splice(a, 1); }; var Pg = function(e) { e.splice(0, e.length); }; var b$ = function(e, r) { for (var n = 0; n < r.length; n++) { var a = r[n]; e.push(a); } }; var Kr = function(e, r, n) { return n && (r = tS(n, r)), e[r]; }; var Gn = function(e, r, n, a) { n && (r = tS(n, r)), e[r] = a; }; var w$ = function() { function t13() { kg(this, t13), this._obj = {}; } return _g(t13, [{ key: "set", value: function(r, n) { return this._obj[r] = n, this; } }, { key: "delete", value: function(r) { return this._obj[r] = void 0, this; } }, { key: "clear", value: function() { this._obj = {}; } }, { key: "has", value: function(r) { return this._obj[r] !== void 0; } }, { key: "get", value: function(r) { return this._obj[r]; } }]), t13; }(); var nn = typeof Map < "u" ? Map : w$; var C$ = "undefined"; var x$ = function() { function t13(e) { if (kg(this, t13), this._obj = /* @__PURE__ */ Object.create(null), this.size = 0, e != null) { var r; e.instanceString != null && e.instanceString() === this.instanceString() ? r = e.toArray() : r = e; for (var n = 0; n < r.length; n++) this.add(r[n]); } } return _g(t13, [{ key: "instanceString", value: function() { return "set"; } }, { key: "add", value: function(r) { var n = this._obj; n[r] !== 1 && (n[r] = 1, this.size++); } }, { key: "delete", value: function(r) { var n = this._obj; n[r] === 1 && (n[r] = 0, this.size--); } }, { key: "clear", value: function() { this._obj = /* @__PURE__ */ Object.create(null); } }, { key: "has", value: function(r) { return this._obj[r] === 1; } }, { key: "toArray", value: function() { var r = this; return Object.keys(this._obj).filter(function(n) { return r.has(n); }); } }, { key: "forEach", value: function(r, n) { return this.toArray().forEach(r, n); } }]), t13; }(); var Fi = (typeof Set > "u" ? "undefined" : Nt(Set)) !== C$ ? Set : x$; var Ml = function(e, r) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; if (e === void 0 || r === void 0 || !Tg(e)) { bt("An element must have a core reference and parameters set"); return; } var a = r.group; if (a == null && (r.data && r.data.source != null && r.data.target != null ? a = "edges" : a = "nodes"), a !== "nodes" && a !== "edges") { bt("An element must be of type `nodes` or `edges`; you specified `" + a + "`"); return; } this.length = 1, this[0] = this; var i = this._private = { cy: e, single: true, // indicates this is an element data: r.data || {}, // data object position: r.position || { x: 0, y: 0 }, // (x, y) position pair autoWidth: void 0, // width and height of nodes calculated by the renderer when set to special 'auto' value autoHeight: void 0, autoPadding: void 0, compoundBoundsClean: false, // whether the compound dimensions need to be recalculated the next time dimensions are read listeners: [], // array of bound listeners group: a, // string; 'nodes' or 'edges' style: {}, // properties as set by the style rstyle: {}, // properties for style sent from the renderer to the core styleCxts: [], // applied style contexts from the styler styleKeys: {}, // per-group keys of style property values removed: true, // whether it's inside the vis; true if removed (set true here since we call restore) selected: !!r.selected, // whether it's selected selectable: r.selectable === void 0 ? true : !!r.selectable, // whether it's selectable locked: !!r.locked, // whether the element is locked (cannot be moved) grabbed: false, // whether the element is grabbed by the mouse; renderer sets this privately grabbable: r.grabbable === void 0 ? true : !!r.grabbable, // whether the element can be grabbed pannable: r.pannable === void 0 ? a === "edges" : !!r.pannable, // whether the element has passthrough panning enabled active: false, // whether the element is active from user interaction classes: new Fi(), // map ( className => true ) animation: { // object for currently-running animations current: [], queue: [] }, rscratch: {}, // object in which the renderer can store information scratch: r.scratch || {}, // scratch objects edges: [], // array of connected edges children: [], // array of children parent: r.parent && r.parent.isNode() ? r.parent : null, // parent ref traversalCache: {}, // cache of output of traversal functions backgrounding: false, // whether background images are loading bbCache: null, // cache of the current bounding box bbCacheShift: { x: 0, y: 0 }, // shift applied to cached bb to be applied on next get bodyBounds: null, // bounds cache of element body, w/o overlay overlayBounds: null, // bounds cache of element body, including overlay labelBounds: { // bounds cache of labels all: null, source: null, target: null, main: null }, arrowBounds: { // bounds cache of edge arrows source: null, target: null, "mid-source": null, "mid-target": null } }; if (i.position.x == null && (i.position.x = 0), i.position.y == null && (i.position.y = 0), r.renderedPosition) { var o = r.renderedPosition, s = e.pan(), u = e.zoom(); i.position = { x: (o.x - s.x) / u, y: (o.y - s.y) / u }; } var l = []; lt(r.classes) ? l = r.classes : Me(r.classes) && (l = r.classes.split(/\s+/)); for (var c = 0, d = l.length; c < d; c++) { var f = l[c]; !f || f === "" || i.classes.add(f); } this.createEmitter(); var h10 = r.style || r.css; h10 && (tt("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."), this.style(h10)), (n === void 0 || n) && this.restore(); }; var jm = function(e) { return e = { bfs: e.bfs || !e.dfs, dfs: e.dfs || !e.bfs }, function(n, a, i) { var o; Xe(n) && !xr(n) && (o = n, n = o.roots || o.root, a = o.visit, i = o.directed), i = arguments.length === 2 && !yt(a) ? a : i, a = yt(a) ? a : function() { }; for (var s = this._private.cy, u = n = Me(n) ? this.filter(n) : n, l = [], c = [], d = {}, f = {}, h10 = {}, v = 0, p, g = this.byGroup(), y = g.nodes, m = g.edges, b = 0; b < u.length; b++) { var w = u[b], x = w.id(); w.isNode() && (l.unshift(w), e.bfs && (h10[x] = true, c.push(w)), f[x] = 0); } for (var E = function() { var D = e.bfs ? l.shift() : l.pop(), A = D.id(); if (e.dfs) { if (h10[A]) return "continue"; h10[A] = true, c.push(D); } var F = f[A], R = d[A], M = R != null ? R.source() : null, L = R != null ? R.target() : null, V = R == null ? void 0 : D.same(M) ? L[0] : M[0], Y = void 0; if (Y = a(D, R, V, v++, F), Y === true) return p = D, "break"; if (Y === false) return "break"; for (var H = D.connectedEdges().filter(function(z) { return (!i || z.source().same(D)) && m.has(z); }), K = 0; K < H.length; K++) { var ne = H[K], B = ne.connectedNodes().filter(function(z) { return !z.same(D) && y.has(z); }), $ = B.id(); B.length !== 0 && !h10[$] && (B = B[0], l.push(B), e.bfs && (h10[$] = true, c.push(B)), d[$] = ne, f[$] = f[A] + 1); } }; l.length !== 0; ) { var C = E(); if (C !== "continue" && C === "break") break; } for (var k = s.collection(), S = 0; S < c.length; S++) { var _ = c[S], T = d[_.id()]; T != null && k.push(T), k.push(_); } return { path: s.collection(k), found: s.collection(p) }; }; }; var Lo = { breadthFirstSearch: jm({ bfs: true }), depthFirstSearch: jm({ dfs: true }) }; Lo.bfs = Lo.breadthFirstSearch; Lo.dfs = Lo.depthFirstSearch; var E$ = TB(function(t13, e) { (function() { var r, n, a, i, o, s, u, l, c, d, f, h10, v, p, g; a = Math.floor, d = Math.min, n = function(y, m) { return y < m ? -1 : y > m ? 1 : 0; }, c = function(y, m, b, w, x) { var E; if (b == null && (b = 0), x == null && (x = n), b < 0) throw new Error("lo must be non-negative"); for (w == null && (w = y.length); b < w; ) E = a((b + w) / 2), x(m, y[E]) < 0 ? w = E : b = E + 1; return [].splice.apply(y, [b, b - b].concat(m)), m; }, s = function(y, m, b) { return b == null && (b = n), y.push(m), p(y, 0, y.length - 1, b); }, o = function(y, m) { var b, w; return m == null && (m = n), b = y.pop(), y.length ? (w = y[0], y[0] = b, g(y, 0, m)) : w = b, w; }, l = function(y, m, b) { var w; return b == null && (b = n), w = y[0], y[0] = m, g(y, 0, b), w; }, u = function(y, m, b) { var w; return b == null && (b = n), y.length && b(y[0], m) < 0 && (w = [y[0], m], m = w[0], y[0] = w[1], g(y, 0, b)), m; }, i = function(y, m) { var b, w, x, E, C, k; for (m == null && (m = n), E = (function() { k = []; for (var S = 0, _ = a(y.length / 2); 0 <= _ ? S < _ : S > _; 0 <= _ ? S++ : S--) k.push(S); return k; }).apply(this).reverse(), C = [], w = 0, x = E.length; w < x; w++) b = E[w], C.push(g(y, b, m)); return C; }, v = function(y, m, b) { var w; if (b == null && (b = n), w = y.indexOf(m), w !== -1) return p(y, 0, w, b), g(y, w, b); }, f = function(y, m, b) { var w, x, E, C, k; if (b == null && (b = n), x = y.slice(0, m), !x.length) return x; for (i(x, b), k = y.slice(m), E = 0, C = k.length; E < C; E++) w = k[E], u(x, w, b); return x.sort(b).reverse(); }, h10 = function(y, m, b) { var w, x, E, C, k, S, _, T, O; if (b == null && (b = n), m * 10 <= y.length) { if (E = y.slice(0, m).sort(b), !E.length) return E; for (x = E[E.length - 1], _ = y.slice(m), C = 0, S = _.length; C < S; C++) w = _[C], b(w, x) < 0 && (c(E, w, 0, null, b), E.pop(), x = E[E.length - 1]); return E; } for (i(y, b), O = [], k = 0, T = d(m, y.length); 0 <= T ? k < T : k > T; 0 <= T ? ++k : --k) O.push(o(y, b)); return O; }, p = function(y, m, b, w) { var x, E, C; for (w == null && (w = n), x = y[b]; b > m; ) { if (C = b - 1 >> 1, E = y[C], w(x, E) < 0) { y[b] = E, b = C; continue; } break; } return y[b] = x; }, g = function(y, m, b) { var w, x, E, C, k; for (b == null && (b = n), x = y.length, k = m, E = y[m], w = 2 * m + 1; w < x; ) C = w + 1, C < x && !(b(y[w], y[C]) < 0) && (w = C), y[m] = y[w], m = w, w = 2 * m + 1; return y[m] = E, p(y, k, m, b); }, r = function() { y.push = s, y.pop = o, y.replace = l, y.pushpop = u, y.heapify = i, y.updateItem = v, y.nlargest = f, y.nsmallest = h10; function y(m) { this.cmp = m ?? n, this.nodes = []; } return y.prototype.push = function(m) { return s(this.nodes, m, this.cmp); }, y.prototype.pop = function() { return o(this.nodes, this.cmp); }, y.prototype.peek = function() { return this.nodes[0]; }, y.prototype.contains = function(m) { return this.nodes.indexOf(m) !== -1; }, y.prototype.replace = function(m) { return l(this.nodes, m, this.cmp); }, y.prototype.pushpop = function(m) { return u(this.nodes, m, this.cmp); }, y.prototype.heapify = function() { return i(this.nodes, this.cmp); }, y.prototype.updateItem = function(m) { return v(this.nodes, m, this.cmp); }, y.prototype.clear = function() { return this.nodes = []; }, y.prototype.empty = function() { return this.nodes.length === 0; }, y.prototype.size = function() { return this.nodes.length; }, y.prototype.clone = function() { var m; return m = new y(), m.nodes = this.nodes.slice(0), m; }, y.prototype.toArray = function() { return this.nodes.slice(0); }, y.prototype.insert = y.prototype.push, y.prototype.top = y.prototype.peek, y.prototype.front = y.prototype.peek, y.prototype.has = y.prototype.contains, y.prototype.copy = y.prototype.clone, y; }(), function(y, m) { return t13.exports = m(); }(this, function() { return r; }); }).call(lo); }); var as = E$; var S$ = Zt({ root: null, weight: function(e) { return 1; }, directed: false }); var k$ = { dijkstra: function(e) { if (!Xe(e)) { var r = arguments; e = { root: r[0], weight: r[1], directed: r[2] }; } var n = S$(e), a = n.root, i = n.weight, o = n.directed, s = this, u = i, l = Me(a) ? this.filter(a)[0] : a[0], c = {}, d = {}, f = {}, h10 = this.byGroup(), v = h10.nodes, p = h10.edges; p.unmergeBy(function(F) { return F.isLoop(); }); for (var g = function(R) { return c[R.id()]; }, y = function(R, M) { c[R.id()] = M, m.updateItem(R); }, m = new as(function(F, R) { return g(F) - g(R); }), b = 0; b < v.length; b++) { var w = v[b]; c[w.id()] = w.same(l) ? 0 : 1 / 0, m.push(w); } for (var x = function(R, M) { for (var L = (o ? R.edgesTo(M) : R.edgesWith(M)).intersect(p), V = 1 / 0, Y, H = 0; H < L.length; H++) { var K = L[H], ne = u(K); (ne < V || !Y) && (V = ne, Y = K); } return { edge: Y, dist: V }; }; m.size() > 0; ) { var E = m.pop(), C = g(E), k = E.id(); if (f[k] = C, C !== 1 / 0) for (var S = E.neighborhood().intersect(v), _ = 0; _ < S.length; _++) { var T = S[_], O = T.id(), D = x(E, T), A = C + D.dist; A < g(T) && (y(T, A), d[O] = { node: E, edge: D.edge }); } } return { distanceTo: function(R) { var M = Me(R) ? v.filter(R)[0] : R[0]; return f[M.id()]; }, pathTo: function(R) { var M = Me(R) ? v.filter(R)[0] : R[0], L = [], V = M, Y = V.id(); if (M.length > 0) for (L.unshift(M); d[Y]; ) { var H = d[Y]; L.unshift(H.edge), L.unshift(H.node), V = H.node, Y = V.id(); } return s.spawn(L); } }; } }; var _$ = { // kruskal's algorithm (finds min spanning tree, assuming undirected graph) // implemented from pseudocode from wikipedia kruskal: function(e) { e = e || function(b) { return 1; }; for (var r = this.byGroup(), n = r.nodes, a = r.edges, i = n.length, o = new Array(i), s = n, u = function(w) { for (var x = 0; x < o.length; x++) { var E = o[x]; if (E.has(w)) return x; } }, l = 0; l < i; l++) o[l] = this.spawn(n[l]); for (var c = a.sort(function(b, w) { return e(b) - e(w); }), d = 0; d < c.length; d++) { var f = c[d], h10 = f.source()[0], v = f.target()[0], p = u(h10), g = u(v), y = o[p], m = o[g]; p !== g && (s.merge(f), y.merge(m), o.splice(g, 1)); } return s; } }; var T$ = Zt({ root: null, goal: null, weight: function(e) { return 1; }, heuristic: function(e) { return 0; }, directed: false }); var I$ = { // Implemented from pseudocode from wikipedia aStar: function(e) { var r = this.cy(), n = T$(e), a = n.root, i = n.goal, o = n.heuristic, s = n.directed, u = n.weight; a = r.collection(a)[0], i = r.collection(i)[0]; var l = a.id(), c = i.id(), d = {}, f = {}, h10 = {}, v = new as(function(Y, H) { return f[Y.id()] - f[H.id()]; }), p = new Fi(), g = {}, y = {}, m = function(H, K) { v.push(H), p.add(K); }, b, w, x = function() { b = v.pop(), w = b.id(), p.delete(w); }, E = function(H) { return p.has(H); }; m(a, l), d[l] = 0, f[l] = o(a); for (var C = 0; v.size() > 0; ) { if (x(), C++, w === c) { for (var k = [], S = i, _ = c, T = y[_]; k.unshift(S), T != null && k.unshift(T), S = g[_], S != null; ) _ = S.id(), T = y[_]; return { found: true, distance: d[w], path: this.spawn(k), steps: C }; } h10[w] = true; for (var O = b._private.edges, D = 0; D < O.length; D++) { var A = O[D]; if (this.hasElementWithId(A.id()) && !(s && A.data("source") !== w)) { var F = A.source(), R = A.target(), M = F.id() !== w ? F : R, L = M.id(); if (this.hasElementWithId(L) && !h10[L]) { var V = d[w] + u(A); if (!E(L)) { d[L] = V, f[L] = V + o(M), m(M, L), g[L] = b, y[L] = A; continue; } V < d[L] && (d[L] = V, f[L] = V + o(M), g[L] = b, y[L] = A); } } } } return { found: false, distance: void 0, path: void 0, steps: C }; } }; var O$ = Zt({ weight: function(e) { return 1; }, directed: false }); var A$ = { // Implemented from pseudocode from wikipedia floydWarshall: function(e) { for (var r = this.cy(), n = O$(e), a = n.weight, i = n.directed, o = a, s = this.byGroup(), u = s.nodes, l = s.edges, c = u.length, d = c * c, f = function(ne) { return u.indexOf(ne); }, h10 = function(ne) { return u[ne]; }, v = new Array(d), p = 0; p < d; p++) { var g = p % c, y = (p - g) / c; y === g ? v[p] = 0 : v[p] = 1 / 0; } for (var m = new Array(d), b = new Array(d), w = 0; w < l.length; w++) { var x = l[w], E = x.source()[0], C = x.target()[0]; if (E !== C) { var k = f(E), S = f(C), _ = k * c + S, T = o(x); if (v[_] > T && (v[_] = T, m[_] = S, b[_] = x), !i) { var O = S * c + k; !i && v[O] > T && (v[O] = T, m[O] = k, b[O] = x); } } } for (var D = 0; D < c; D++) for (var A = 0; A < c; A++) for (var F = A * c + D, R = 0; R < c; R++) { var M = A * c + R, L = D * c + R; v[F] + v[L] < v[M] && (v[M] = v[F] + v[L], m[M] = m[F]); } var V = function(ne) { return (Me(ne) ? r.filter(ne) : ne)[0]; }, Y = function(ne) { return f(V(ne)); }, H = { distance: function(ne, B) { var $ = Y(ne), z = Y(B); return v[$ * c + z]; }, path: function(ne, B) { var $ = Y(ne), z = Y(B), W = h10($); if ($ === z) return W.collection(); if (m[$ * c + z] == null) return r.collection(); var Z = r.collection(), N = $, X; for (Z.merge(W); $ !== z; ) N = $, $ = m[$ * c + z], X = b[N * c + $], Z.merge(X), Z.merge(h10($)); return Z; } }; return H; } // floydWarshall }; var P$ = Zt({ weight: function(e) { return 1; }, directed: false, root: null }); var D$ = { // Implemented from pseudocode from wikipedia bellmanFord: function(e) { var r = this, n = P$(e), a = n.weight, i = n.directed, o = n.root, s = a, u = this, l = this.cy(), c = this.byGroup(), d = c.edges, f = c.nodes, h10 = f.length, v = new nn(), p = false, g = []; o = l.collection(o)[0], d.unmergeBy(function(ve) { return ve.isLoop(); }); for (var y = d.length, m = function(xe) { var _e = v.get(xe.id()); return _e || (_e = {}, v.set(xe.id(), _e)), _e; }, b = function(xe) { return (Me(xe) ? l.$(xe) : xe)[0]; }, w = function(xe) { return m(b(xe)).dist; }, x = function(xe) { for (var _e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o, He = b(xe), Ve = [], De = He; ; ) { if (De == null) return r.spawn(); var Ne = m(De), ue = Ne.edge, I = Ne.pred; if (Ve.unshift(De[0]), De.same(_e) && Ve.length > 0) break; ue != null && Ve.unshift(ue), De = I; } return u.spawn(Ve); }, E = 0; E < h10; E++) { var C = f[E], k = m(C); C.same(o) ? k.dist = 0 : k.dist = 1 / 0, k.pred = null, k.edge = null; } for (var S = false, _ = function(xe, _e, He, Ve, De, Ne) { var ue = Ve.dist + Ne; ue < De.dist && !He.same(Ve.edge) && (De.dist = ue, De.pred = xe, De.edge = He, S = true); }, T = 1; T < h10; T++) { S = false; for (var O = 0; O < y; O++) { var D = d[O], A = D.source(), F = D.target(), R = s(D), M = m(A), L = m(F); _(A, F, D, M, L, R), i || _(F, A, D, L, M, R); } if (!S) break; } if (S) for (var V = [], Y = 0; Y < y; Y++) { var H = d[Y], K = H.source(), ne = H.target(), B = s(H), $ = m(K).dist, z = m(ne).dist; if ($ + B < z || !i && z + B < $) if (p || (tt("Graph contains a negative weight cycle for Bellman-Ford"), p = true), e.findNegativeWeightCycles !== false) { var W = []; $ + B < z && W.push(K), !i && z + B < $ && W.push(ne); for (var Z = W.length, N = 0; N < Z; N++) { var X = W[N], Q = [X]; Q.push(m(X).edge); for (var ge = m(X).pred; Q.indexOf(ge) === -1; ) Q.push(ge), Q.push(m(ge).edge), ge = m(ge).pred; Q = Q.slice(Q.indexOf(ge)); for (var we = Q[0].id(), fe = 0, ce = 2; ce < Q.length; ce += 2) Q[ce].id() < we && (we = Q[ce].id(), fe = ce); Q = Q.slice(fe).concat(Q.slice(0, fe)), Q.push(Q[0]); var be = Q.map(function(ve) { return ve.id(); }).join(","); V.indexOf(be) === -1 && (g.push(u.spawn(Q)), V.push(be)); } } else break; } return { distanceTo: w, pathTo: x, hasNegativeWeightCycle: p, negativeWeightCycles: g }; } // bellmanFord }; var R$ = Math.sqrt(2); var L$ = function(e, r, n) { n.length === 0 && bt("Karger-Stein must be run on a connected (sub)graph"); for (var a = n[e], i = a[1], o = a[2], s = r[i], u = r[o], l = n, c = l.length - 1; c >= 0; c--) { var d = l[c], f = d[1], h10 = d[2]; (r[f] === s && r[h10] === u || r[f] === u && r[h10] === s) && l.splice(c, 1); } for (var v = 0; v < l.length; v++) { var p = l[v]; p[1] === u ? (l[v] = p.slice(), l[v][1] = s) : p[2] === u && (l[v] = p.slice(), l[v][2] = s); } for (var g = 0; g < r.length; g++) r[g] === u && (r[g] = s); return l; }; var Du = function(e, r, n, a) { for (; n > a; ) { var i = Math.floor(Math.random() * r.length); r = L$(i, e, r), n--; } return r; }; var F$ = { // Computes the minimum cut of an undirected graph // Returns the correct answer with high probability kargerStein: function() { var e = this, r = this.byGroup(), n = r.nodes, a = r.edges; a.unmergeBy(function(L) { return L.isLoop(); }); var i = n.length, o = a.length, s = Math.ceil(Math.pow(Math.log(i) / Math.LN2, 2)), u = Math.floor(i / R$); if (i < 2) { bt("At least 2 nodes are required for Karger-Stein algorithm"); return; } for (var l = [], c = 0; c < o; c++) { var d = a[c]; l.push([c, n.indexOf(d.source()), n.indexOf(d.target())]); } for (var f = 1 / 0, h10 = [], v = new Array(i), p = new Array(i), g = new Array(i), y = function(V, Y) { for (var H = 0; H < i; H++) Y[H] = V[H]; }, m = 0; m <= s; m++) { for (var b = 0; b < i; b++) p[b] = b; var w = Du(p, l.slice(), i, u), x = w.slice(); y(p, g); var E = Du(p, w, u, 2), C = Du(g, x, u, 2); E.length <= C.length && E.length < f ? (f = E.length, h10 = E, y(p, v)) : C.length <= E.length && C.length < f && (f = C.length, h10 = C, y(g, v)); } for (var k = this.spawn(h10.map(function(L) { return a[L[0]]; })), S = this.spawn(), _ = this.spawn(), T = v[0], O = 0; O < v.length; O++) { var D = v[O], A = n[O]; D === T ? S.merge(A) : _.merge(A); } var F = function(V) { var Y = e.spawn(); return V.forEach(function(H) { Y.merge(H), H.connectedEdges().forEach(function(K) { e.contains(K) && !k.contains(K) && Y.merge(K); }); }), Y; }, R = [F(S), F(_)], M = { cut: k, components: R, // n.b. partitions are included to be compatible with the old api spec // (could be removed in a future major version) partition1: S, partition2: _ }; return M; } }; var M$ = function(e) { return { x: e.x, y: e.y }; }; var Nl = function(e, r, n) { return { x: e.x * r + n.x, y: e.y * r + n.y }; }; var pS = function(e, r, n) { return { x: (e.x - n.x) / r, y: (e.y - n.y) / r }; }; var ui = function(e) { return { x: e[0], y: e[1] }; }; var N$ = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = 1 / 0, i = r; i < n; i++) { var o = e[i]; isFinite(o) && (a = Math.min(o, a)); } return a; }; var B$ = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = -1 / 0, i = r; i < n; i++) { var o = e[i]; isFinite(o) && (a = Math.max(o, a)); } return a; }; var $$ = function(e) { for (var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = 0, i = 0, o = r; o < n; o++) { var s = e[o]; isFinite(s) && (a += s, i++); } return a / i; }; var q$ = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : e.length, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true; a ? e = e.slice(r, n) : (n < e.length && e.splice(n, e.length - n), r > 0 && e.splice(0, r)); for (var s = 0, u = e.length - 1; u >= 0; u--) { var l = e[u]; o ? isFinite(l) || (e[u] = -1 / 0, s++) : e.splice(u, 1); } i && e.sort(function(f, h10) { return f - h10; }); var c = e.length, d = Math.floor(c / 2); return c % 2 !== 0 ? e[d + 1 + s] : (e[d - 1 + s] + e[d + s]) / 2; }; var z$ = function(e) { return Math.PI * e / 180; }; var _s = function(e, r) { return Math.atan2(r, e) - Math.PI / 2; }; var Dg = Math.log2 || function(t13) { return Math.log(t13) / Math.log(2); }; var gS = function(e) { return e > 0 ? 1 : e < 0 ? -1 : 0; }; var Da = function(e, r) { return Math.sqrt(pa(e, r)); }; var pa = function(e, r) { var n = r.x - e.x, a = r.y - e.y; return n * n + a * a; }; var V$ = function(e) { for (var r = e.length, n = 0, a = 0; a < r; a++) n += e[a]; for (var i = 0; i < r; i++) e[i] = e[i] / n; return e; }; var zt = function(e, r, n, a) { return (1 - a) * (1 - a) * e + 2 * (1 - a) * a * r + a * a * n; }; var vi = function(e, r, n, a) { return { x: zt(e.x, r.x, n.x, a), y: zt(e.y, r.y, n.y, a) }; }; var H$ = function(e, r, n, a) { var i = { x: r.x - e.x, y: r.y - e.y }, o = Da(e, r), s = { x: i.x / o, y: i.y / o }; return n = n ?? 0, a = a ?? n * o, { x: e.x + s.x * a, y: e.y + s.y * a }; }; var Fo = function(e, r, n) { return Math.max(e, Math.min(n, r)); }; var br = function(e) { if (e == null) return { x1: 1 / 0, y1: 1 / 0, x2: -1 / 0, y2: -1 / 0, w: 0, h: 0 }; if (e.x1 != null && e.y1 != null) { if (e.x2 != null && e.y2 != null && e.x2 >= e.x1 && e.y2 >= e.y1) return { x1: e.x1, y1: e.y1, x2: e.x2, y2: e.y2, w: e.x2 - e.x1, h: e.y2 - e.y1 }; if (e.w != null && e.h != null && e.w >= 0 && e.h >= 0) return { x1: e.x1, y1: e.y1, x2: e.x1 + e.w, y2: e.y1 + e.h, w: e.w, h: e.h }; } }; var K$ = function(e) { return { x1: e.x1, x2: e.x2, w: e.w, y1: e.y1, y2: e.y2, h: e.h }; }; var G$ = function(e) { e.x1 = 1 / 0, e.y1 = 1 / 0, e.x2 = -1 / 0, e.y2 = -1 / 0, e.w = 0, e.h = 0; }; var U$ = function(e, r, n) { return { x1: e.x1 + r, x2: e.x2 + r, y1: e.y1 + n, y2: e.y2 + n, w: e.w, h: e.h }; }; var yS = function(e, r) { e.x1 = Math.min(e.x1, r.x1), e.x2 = Math.max(e.x2, r.x2), e.w = e.x2 - e.x1, e.y1 = Math.min(e.y1, r.y1), e.y2 = Math.max(e.y2, r.y2), e.h = e.y2 - e.y1; }; var W$ = function(e, r, n) { e.x1 = Math.min(e.x1, r), e.x2 = Math.max(e.x2, r), e.w = e.x2 - e.x1, e.y1 = Math.min(e.y1, n), e.y2 = Math.max(e.y2, n), e.h = e.y2 - e.y1; }; var Vs = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0; return e.x1 -= r, e.x2 += r, e.y1 -= r, e.y2 += r, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e; }; var Hs = function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [0], n, a, i, o; if (r.length === 1) n = a = i = o = r[0]; else if (r.length === 2) n = i = r[0], o = a = r[1]; else if (r.length === 4) { var s = Vr(r, 4); n = s[0], a = s[1], i = s[2], o = s[3]; } return e.x1 -= o, e.x2 += a, e.y1 -= n, e.y2 += i, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1, e; }; var Ym = function(e, r) { e.x1 = r.x1, e.y1 = r.y1, e.x2 = r.x2, e.y2 = r.y2, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1; }; var Rg = function(e, r) { return !(e.x1 > r.x2 || r.x1 > e.x2 || e.x2 < r.x1 || r.x2 < e.x1 || e.y2 < r.y1 || r.y2 < e.y1 || e.y1 > r.y2 || r.y1 > e.y2); }; var Ti = function(e, r, n) { return e.x1 <= r && r <= e.x2 && e.y1 <= n && n <= e.y2; }; var j$ = function(e, r) { return Ti(e, r.x, r.y); }; var mS = function(e, r) { return Ti(e, r.x1, r.y1) && Ti(e, r.x2, r.y2); }; var bS = function(e, r, n, a, i, o, s) { var u = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : "auto", l = u === "auto" ? Ra(i, o) : u, c = i / 2, d = o / 2; l = Math.min(l, c, d); var f = l !== c, h10 = l !== d, v; if (f) { var p = n - c + l - s, g = a - d - s, y = n + c - l + s, m = g; if (v = jn(e, r, n, a, p, g, y, m, false), v.length > 0) return v; } if (h10) { var b = n + c + s, w = a - d + l - s, x = b, E = a + d - l + s; if (v = jn(e, r, n, a, b, w, x, E, false), v.length > 0) return v; } if (f) { var C = n - c + l - s, k = a + d + s, S = n + c - l + s, _ = k; if (v = jn(e, r, n, a, C, k, S, _, false), v.length > 0) return v; } if (h10) { var T = n - c - s, O = a - d + l - s, D = T, A = a + d - l + s; if (v = jn(e, r, n, a, T, O, D, A, false), v.length > 0) return v; } var F; { var R = n - c + l, M = a - d + l; if (F = co(e, r, n, a, R, M, l + s), F.length > 0 && F[0] <= R && F[1] <= M) return [F[0], F[1]]; } { var L = n + c - l, V = a - d + l; if (F = co(e, r, n, a, L, V, l + s), F.length > 0 && F[0] >= L && F[1] <= V) return [F[0], F[1]]; } { var Y = n + c - l, H = a + d - l; if (F = co(e, r, n, a, Y, H, l + s), F.length > 0 && F[0] >= Y && F[1] >= H) return [F[0], F[1]]; } { var K = n - c + l, ne = a + d - l; if (F = co(e, r, n, a, K, ne, l + s), F.length > 0 && F[0] <= K && F[1] >= ne) return [F[0], F[1]]; } return []; }; var Y$ = function(e, r, n, a, i, o, s) { var u = s, l = Math.min(n, i), c = Math.max(n, i), d = Math.min(a, o), f = Math.max(a, o); return l - u <= e && e <= c + u && d - u <= r && r <= f + u; }; var Z$ = function(e, r, n, a, i, o, s, u, l) { var c = { x1: Math.min(n, s, i) - l, x2: Math.max(n, s, i) + l, y1: Math.min(a, u, o) - l, y2: Math.max(a, u, o) + l }; return !(e < c.x1 || e > c.x2 || r < c.y1 || r > c.y2); }; var X$ = function(e, r, n, a) { n -= a; var i = r * r - 4 * e * n; if (i < 0) return []; var o = Math.sqrt(i), s = 2 * e, u = (-r + o) / s, l = (-r - o) / s; return [u, l]; }; var J$ = function(e, r, n, a, i) { var o = 1e-5; e === 0 && (e = o), r /= e, n /= e, a /= e; var s, u, l, c, d, f, h10, v; if (u = (3 * n - r * r) / 9, l = -(27 * a) + r * (9 * n - 2 * (r * r)), l /= 54, s = u * u * u + l * l, i[1] = 0, h10 = r / 3, s > 0) { d = l + Math.sqrt(s), d = d < 0 ? -Math.pow(-d, 1 / 3) : Math.pow(d, 1 / 3), f = l - Math.sqrt(s), f = f < 0 ? -Math.pow(-f, 1 / 3) : Math.pow(f, 1 / 3), i[0] = -h10 + d + f, h10 += (d + f) / 2, i[4] = i[2] = -h10, h10 = Math.sqrt(3) * (-f + d) / 2, i[3] = h10, i[5] = -h10; return; } if (i[5] = i[3] = 0, s === 0) { v = l < 0 ? -Math.pow(-l, 1 / 3) : Math.pow(l, 1 / 3), i[0] = -h10 + 2 * v, i[4] = i[2] = -(v + h10); return; } u = -u, c = u * u * u, c = Math.acos(l / Math.sqrt(c)), v = 2 * Math.sqrt(u), i[0] = -h10 + v * Math.cos(c / 3), i[2] = -h10 + v * Math.cos((c + 2 * Math.PI) / 3), i[4] = -h10 + v * Math.cos((c + 4 * Math.PI) / 3); }; var Q$ = function(e, r, n, a, i, o, s, u) { var l = 1 * n * n - 4 * n * i + 2 * n * s + 4 * i * i - 4 * i * s + s * s + a * a - 4 * a * o + 2 * a * u + 4 * o * o - 4 * o * u + u * u, c = 1 * 9 * n * i - 3 * n * n - 3 * n * s - 6 * i * i + 3 * i * s + 9 * a * o - 3 * a * a - 3 * a * u - 6 * o * o + 3 * o * u, d = 1 * 3 * n * n - 6 * n * i + n * s - n * e + 2 * i * i + 2 * i * e - s * e + 3 * a * a - 6 * a * o + a * u - a * r + 2 * o * o + 2 * o * r - u * r, f = 1 * n * i - n * n + n * e - i * e + a * o - a * a + a * r - o * r, h10 = []; J$(l, c, d, f, h10); for (var v = 1e-7, p = [], g = 0; g < 6; g += 2) Math.abs(h10[g + 1]) < v && h10[g] >= 0 && h10[g] <= 1 && p.push(h10[g]); p.push(1), p.push(0); for (var y = -1, m, b, w, x = 0; x < p.length; x++) m = Math.pow(1 - p[x], 2) * n + 2 * (1 - p[x]) * p[x] * i + p[x] * p[x] * s, b = Math.pow(1 - p[x], 2) * a + 2 * (1 - p[x]) * p[x] * o + p[x] * p[x] * u, w = Math.pow(m - e, 2) + Math.pow(b - r, 2), y >= 0 ? w < y && (y = w) : y = w; return y; }; var eq = function(e, r, n, a, i, o) { var s = [e - n, r - a], u = [i - n, o - a], l = u[0] * u[0] + u[1] * u[1], c = s[0] * s[0] + s[1] * s[1], d = s[0] * u[0] + s[1] * u[1], f = d * d / l; return d < 0 ? c : f > l ? (e - i) * (e - i) + (r - o) * (r - o) : c - f; }; var vr = function(e, r, n) { for (var a, i, o, s, u, l = 0, c = 0; c < n.length / 2; c++) if (a = n[c * 2], i = n[c * 2 + 1], c + 1 < n.length / 2 ? (o = n[(c + 1) * 2], s = n[(c + 1) * 2 + 1]) : (o = n[(c + 1 - n.length / 2) * 2], s = n[(c + 1 - n.length / 2) * 2 + 1]), !(a == e && o == e)) if (a >= e && e >= o || a <= e && e <= o) u = (e - a) / (o - a) * (s - i) + i, u > r && l++; else continue; return l % 2 !== 0; }; var _n = function(e, r, n, a, i, o, s, u, l) { var c = new Array(n.length), d; u[0] != null ? (d = Math.atan(u[1] / u[0]), u[0] < 0 ? d = d + Math.PI / 2 : d = -d - Math.PI / 2) : d = u; for (var f = Math.cos(-d), h10 = Math.sin(-d), v = 0; v < c.length / 2; v++) c[v * 2] = o / 2 * (n[v * 2] * f - n[v * 2 + 1] * h10), c[v * 2 + 1] = s / 2 * (n[v * 2 + 1] * f + n[v * 2] * h10), c[v * 2] += a, c[v * 2 + 1] += i; var p; if (l > 0) { var g = dl(c, -l); p = cl(g); } else p = c; return vr(e, r, p); }; var tq = function(e, r, n, a, i, o, s, u) { for (var l = new Array(n.length * 2), c = 0; c < u.length; c++) { var d = u[c]; l[c * 4 + 0] = d.startX, l[c * 4 + 1] = d.startY, l[c * 4 + 2] = d.stopX, l[c * 4 + 3] = d.stopY; var f = Math.pow(d.cx - e, 2) + Math.pow(d.cy - r, 2); if (f <= Math.pow(d.radius, 2)) return true; } return vr(e, r, l); }; var cl = function(e) { for (var r = new Array(e.length / 2), n, a, i, o, s, u, l, c, d = 0; d < e.length / 4; d++) { n = e[d * 4], a = e[d * 4 + 1], i = e[d * 4 + 2], o = e[d * 4 + 3], d < e.length / 4 - 1 ? (s = e[(d + 1) * 4], u = e[(d + 1) * 4 + 1], l = e[(d + 1) * 4 + 2], c = e[(d + 1) * 4 + 3]) : (s = e[0], u = e[1], l = e[2], c = e[3]); var f = jn(n, a, i, o, s, u, l, c, true); r[d * 2] = f[0], r[d * 2 + 1] = f[1]; } return r; }; var dl = function(e, r) { for (var n = new Array(e.length * 2), a, i, o, s, u = 0; u < e.length / 2; u++) { a = e[u * 2], i = e[u * 2 + 1], u < e.length / 2 - 1 ? (o = e[(u + 1) * 2], s = e[(u + 1) * 2 + 1]) : (o = e[0], s = e[1]); var l = s - i, c = -(o - a), d = Math.sqrt(l * l + c * c), f = l / d, h10 = c / d; n[u * 4] = a + f * r, n[u * 4 + 1] = i + h10 * r, n[u * 4 + 2] = o + f * r, n[u * 4 + 3] = s + h10 * r; } return n; }; var rq = function(e, r, n, a, i, o) { var s = n - e, u = a - r; s /= i, u /= o; var l = Math.sqrt(s * s + u * u), c = l - 1; if (c < 0) return []; var d = c / l; return [(n - e) * d + e, (a - r) * d + r]; }; var xa = function(e, r, n, a, i, o, s) { return e -= i, r -= o, e /= n / 2 + s, r /= a / 2 + s, e * e + r * r <= 1; }; var co = function(e, r, n, a, i, o, s) { var u = [n - e, a - r], l = [e - i, r - o], c = u[0] * u[0] + u[1] * u[1], d = 2 * (l[0] * u[0] + l[1] * u[1]), f = l[0] * l[0] + l[1] * l[1] - s * s, h10 = d * d - 4 * c * f; if (h10 < 0) return []; var v = (-d + Math.sqrt(h10)) / (2 * c), p = (-d - Math.sqrt(h10)) / (2 * c), g = Math.min(v, p), y = Math.max(v, p), m = []; if (g >= 0 && g <= 1 && m.push(g), y >= 0 && y <= 1 && m.push(y), m.length === 0) return []; var b = m[0] * u[0] + e, w = m[0] * u[1] + r; if (m.length > 1) { if (m[0] == m[1]) return [b, w]; var x = m[1] * u[0] + e, E = m[1] * u[1] + r; return [b, w, x, E]; } else return [b, w]; }; var Ru = function(e, r, n) { return r <= e && e <= n || n <= e && e <= r ? e : e <= r && r <= n || n <= r && r <= e ? r : n; }; var jn = function(e, r, n, a, i, o, s, u, l) { var c = e - i, d = n - e, f = s - i, h10 = r - o, v = a - r, p = u - o, g = f * h10 - p * c, y = d * h10 - v * c, m = p * d - f * v; if (m !== 0) { var b = g / m, w = y / m, x = 1e-3, E = 0 - x, C = 1 + x; return E <= b && b <= C && E <= w && w <= C ? [e + b * d, r + b * v] : l ? [e + b * d, r + b * v] : []; } else return g === 0 || y === 0 ? Ru(e, n, s) === s ? [s, u] : Ru(e, n, i) === i ? [i, o] : Ru(i, s, n) === n ? [n, a] : [] : []; }; var Mo = function(e, r, n, a, i, o, s, u) { var l = [], c, d = new Array(n.length), f = true; o == null && (f = false); var h10; if (f) { for (var v = 0; v < d.length / 2; v++) d[v * 2] = n[v * 2] * o + a, d[v * 2 + 1] = n[v * 2 + 1] * s + i; if (u > 0) { var p = dl(d, -u); h10 = cl(p); } else h10 = d; } else h10 = n; for (var g, y, m, b, w = 0; w < h10.length / 2; w++) g = h10[w * 2], y = h10[w * 2 + 1], w < h10.length / 2 - 1 ? (m = h10[(w + 1) * 2], b = h10[(w + 1) * 2 + 1]) : (m = h10[0], b = h10[1]), c = jn(e, r, a, i, g, y, m, b), c.length !== 0 && l.push(c[0], c[1]); return l; }; var nq = function(e, r, n, a, i, o, s, u, l) { var c = [], d, f = new Array(n.length * 2); l.forEach(function(m, b) { b === 0 ? (f[f.length - 2] = m.startX, f[f.length - 1] = m.startY) : (f[b * 4 - 2] = m.startX, f[b * 4 - 1] = m.startY), f[b * 4] = m.stopX, f[b * 4 + 1] = m.stopY, d = co(e, r, a, i, m.cx, m.cy, m.radius), d.length !== 0 && c.push(d[0], d[1]); }); for (var h10 = 0; h10 < f.length / 4; h10++) d = jn(e, r, a, i, f[h10 * 4], f[h10 * 4 + 1], f[h10 * 4 + 2], f[h10 * 4 + 3], false), d.length !== 0 && c.push(d[0], d[1]); if (c.length > 2) { for (var v = [c[0], c[1]], p = Math.pow(v[0] - e, 2) + Math.pow(v[1] - r, 2), g = 1; g < c.length / 2; g++) { var y = Math.pow(c[g * 2] - e, 2) + Math.pow(c[g * 2 + 1] - r, 2); y <= p && (v[0] = c[g * 2], v[1] = c[g * 2 + 1], p = y); } return v; } return c; }; var Ts = function(e, r, n) { var a = [e[0] - r[0], e[1] - r[1]], i = Math.sqrt(a[0] * a[0] + a[1] * a[1]), o = (i - n) / i; return o < 0 && (o = 1e-5), [r[0] + o * a[0], r[1] + o * a[1]]; }; var ur = function(e, r) { var n = kp(e, r); return n = wS(n), n; }; var wS = function(e) { for (var r, n, a = e.length / 2, i = 1 / 0, o = 1 / 0, s = -1 / 0, u = -1 / 0, l = 0; l < a; l++) r = e[2 * l], n = e[2 * l + 1], i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), u = Math.max(u, n); for (var c = 2 / (s - i), d = 2 / (u - o), f = 0; f < a; f++) r = e[2 * f] = e[2 * f] * c, n = e[2 * f + 1] = e[2 * f + 1] * d, i = Math.min(i, r), s = Math.max(s, r), o = Math.min(o, n), u = Math.max(u, n); if (o < -1) for (var h10 = 0; h10 < a; h10++) n = e[2 * h10 + 1] = e[2 * h10 + 1] + (-1 - o); return e; }; var kp = function(e, r) { var n = 1 / e * 2 * Math.PI, a = e % 2 === 0 ? Math.PI / 2 + n / 2 : Math.PI / 2; a += r; for (var i = new Array(e * 2), o, s = 0; s < e; s++) o = s * n + a, i[2 * s] = Math.cos(o), i[2 * s + 1] = Math.sin(-o); return i; }; var Ra = function(e, r) { return Math.min(e / 4, r / 4, 8); }; var CS = function(e, r) { return Math.min(e / 10, r / 10, 8); }; var Lg = function() { return 8; }; var aq = function(e, r, n) { return [e - 2 * r + n, 2 * (r - e), e]; }; var _p = function(e, r) { return { heightOffset: Math.min(15, 0.05 * r), widthOffset: Math.min(100, 0.25 * e), ctrlPtOffsetPct: 0.05 }; }; var iq = Zt({ dampingFactor: 0.8, precision: 1e-6, iterations: 200, weight: function(e) { return 1; } }); var oq = { pageRank: function(e) { for (var r = iq(e), n = r.dampingFactor, a = r.precision, i = r.iterations, o = r.weight, s = this._private.cy, u = this.byGroup(), l = u.nodes, c = u.edges, d = l.length, f = d * d, h10 = c.length, v = new Array(f), p = new Array(d), g = (1 - n) / d, y = 0; y < d; y++) { for (var m = 0; m < d; m++) { var b = y * d + m; v[b] = 0; } p[y] = 0; } for (var w = 0; w < h10; w++) { var x = c[w], E = x.data("source"), C = x.data("target"); if (E !== C) { var k = l.indexOfId(E), S = l.indexOfId(C), _ = o(x), T = S * d + k; v[T] += _, p[k] += _; } } for (var O = 1 / d + g, D = 0; D < d; D++) if (p[D] === 0) for (var A = 0; A < d; A++) { var F = A * d + D; v[F] = O; } else for (var R = 0; R < d; R++) { var M = R * d + D; v[M] = v[M] / p[D] + g; } for (var L = new Array(d), V = new Array(d), Y, H = 0; H < d; H++) L[H] = 1; for (var K = 0; K < i; K++) { for (var ne = 0; ne < d; ne++) V[ne] = 0; for (var B = 0; B < d; B++) for (var $ = 0; $ < d; $++) { var z = B * d + $; V[B] += v[z] * L[$]; } V$(V), Y = L, L = V, V = Y; for (var W = 0, Z = 0; Z < d; Z++) { var N = Y[Z] - L[Z]; W += N * N; } if (W < a) break; } var X = { rank: function(ge) { return ge = s.collection(ge)[0], L[l.indexOf(ge)]; } }; return X; } // pageRank }; var Zm = Zt({ root: null, weight: function(e) { return 1; }, directed: false, alpha: 0 }); var hi = { degreeCentralityNormalized: function(e) { e = Zm(e); var r = this.cy(), n = this.nodes(), a = n.length; if (e.directed) { for (var c = {}, d = {}, f = 0, h10 = 0, v = 0; v < a; v++) { var p = n[v], g = p.id(); e.root = p; var y = this.degreeCentrality(e); f < y.indegree && (f = y.indegree), h10 < y.outdegree && (h10 = y.outdegree), c[g] = y.indegree, d[g] = y.outdegree; } return { indegree: function(b) { return f == 0 ? 0 : (Me(b) && (b = r.filter(b)), c[b.id()] / f); }, outdegree: function(b) { return h10 === 0 ? 0 : (Me(b) && (b = r.filter(b)), d[b.id()] / h10); } }; } else { for (var i = {}, o = 0, s = 0; s < a; s++) { var u = n[s]; e.root = u; var l = this.degreeCentrality(e); o < l.degree && (o = l.degree), i[u.id()] = l.degree; } return { degree: function(b) { return o === 0 ? 0 : (Me(b) && (b = r.filter(b)), i[b.id()] / o); } }; } }, // degreeCentralityNormalized // Implemented from the algorithm in Opsahl's paper // "Node centrality in weighted networks: Generalizing degree and shortest paths" // check the heading 2 "Degree" degreeCentrality: function(e) { e = Zm(e); var r = this.cy(), n = this, a = e, i = a.root, o = a.weight, s = a.directed, u = a.alpha; if (i = r.collection(i)[0], s) { for (var h10 = i.connectedEdges(), v = h10.filter(function(E) { return E.target().same(i) && n.has(E); }), p = h10.filter(function(E) { return E.source().same(i) && n.has(E); }), g = v.length, y = p.length, m = 0, b = 0, w = 0; w < v.length; w++) m += o(v[w]); for (var x = 0; x < p.length; x++) b += o(p[x]); return { indegree: Math.pow(g, 1 - u) * Math.pow(m, u), outdegree: Math.pow(y, 1 - u) * Math.pow(b, u) }; } else { for (var l = i.connectedEdges().intersection(n), c = l.length, d = 0, f = 0; f < l.length; f++) d += o(l[f]); return { degree: Math.pow(c, 1 - u) * Math.pow(d, u) }; } } // degreeCentrality }; hi.dc = hi.degreeCentrality; hi.dcn = hi.degreeCentralityNormalised = hi.degreeCentralityNormalized; var Xm = Zt({ harmonic: true, weight: function() { return 1; }, directed: false, root: null }); var pi = { closenessCentralityNormalized: function(e) { for (var r = Xm(e), n = r.harmonic, a = r.weight, i = r.directed, o = this.cy(), s = {}, u = 0, l = this.nodes(), c = this.floydWarshall({ weight: a, directed: i }), d = 0; d < l.length; d++) { for (var f = 0, h10 = l[d], v = 0; v < l.length; v++) if (d !== v) { var p = c.distance(h10, l[v]); n ? f += 1 / p : f += p; } n || (f = 1 / f), u < f && (u = f), s[h10.id()] = f; } return { closeness: function(y) { return u == 0 ? 0 : (Me(y) ? y = o.filter(y)[0].id() : y = y.id(), s[y] / u); } }; }, // Implemented from pseudocode from wikipedia closenessCentrality: function(e) { var r = Xm(e), n = r.root, a = r.weight, i = r.directed, o = r.harmonic; n = this.filter(n)[0]; for (var s = this.dijkstra({ root: n, weight: a, directed: i }), u = 0, l = this.nodes(), c = 0; c < l.length; c++) { var d = l[c]; if (!d.same(n)) { var f = s.distanceTo(d); o ? u += 1 / f : u += f; } } return o ? u : 1 / u; } // closenessCentrality }; pi.cc = pi.closenessCentrality; pi.ccn = pi.closenessCentralityNormalised = pi.closenessCentralityNormalized; var sq = Zt({ weight: null, directed: false }); var Tp = { // Implemented from the algorithm in the paper "On Variants of Shortest-Path Betweenness Centrality and their Generic Computation" by Ulrik Brandes betweennessCentrality: function(e) { for (var r = sq(e), n = r.directed, a = r.weight, i = a != null, o = this.cy(), s = this.nodes(), u = {}, l = {}, c = 0, d = { set: function(b, w) { l[b] = w, w > c && (c = w); }, get: function(b) { return l[b]; } }, f = 0; f < s.length; f++) { var h10 = s[f], v = h10.id(); n ? u[v] = h10.outgoers().nodes() : u[v] = h10.openNeighborhood().nodes(), d.set(v, 0); } for (var p = function(b) { for (var w = s[b].id(), x = [], E = {}, C = {}, k = {}, S = new as(function($, z) { return k[$] - k[z]; }), _ = 0; _ < s.length; _++) { var T = s[_].id(); E[T] = [], C[T] = 0, k[T] = 1 / 0; } for (C[w] = 1, k[w] = 0, S.push(w); !S.empty(); ) { var O = S.pop(); if (x.push(O), i) for (var D = 0; D < u[O].length; D++) { var A = u[O][D], F = o.getElementById(O), R = void 0; F.edgesTo(A).length > 0 ? R = F.edgesTo(A)[0] : R = A.edgesTo(F)[0]; var M = a(R); A = A.id(), k[A] > k[O] + M && (k[A] = k[O] + M, S.nodes.indexOf(A) < 0 ? S.push(A) : S.updateItem(A), C[A] = 0, E[A] = []), k[A] == k[O] + M && (C[A] = C[A] + C[O], E[A].push(O)); } else for (var L = 0; L < u[O].length; L++) { var V = u[O][L].id(); k[V] == 1 / 0 && (S.push(V), k[V] = k[O] + 1), k[V] == k[O] + 1 && (C[V] = C[V] + C[O], E[V].push(O)); } } for (var Y = {}, H = 0; H < s.length; H++) Y[s[H].id()] = 0; for (; x.length > 0; ) { for (var K = x.pop(), ne = 0; ne < E[K].length; ne++) { var B = E[K][ne]; Y[B] = Y[B] + C[B] / C[K] * (1 + Y[K]); } K != s[b].id() && d.set(K, d.get(K) + Y[K]); } }, g = 0; g < s.length; g++) p(g); var y = { betweenness: function(b) { var w = o.collection(b).id(); return d.get(w); }, betweennessNormalized: function(b) { if (c == 0) return 0; var w = o.collection(b).id(); return d.get(w) / c; } }; return y.betweennessNormalised = y.betweennessNormalized, y; } // betweennessCentrality }; Tp.bc = Tp.betweennessCentrality; var lq = Zt({ expandFactor: 2, // affects time of computation and cluster granularity to some extent: M * M inflateFactor: 2, // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j) multFactor: 1, // optional self loops for each node. Use a neutral value to improve cluster computations. maxIterations: 20, // maximum number of iterations of the MCL algorithm in a single run attributes: [ // attributes/features used to group nodes, ie. similarity values between nodes function(t13) { return 1; } ] }); var uq = function(e) { return lq(e); }; var cq = function(e, r) { for (var n = 0, a = 0; a < r.length; a++) n += r[a](e); return n; }; var dq = function(e, r, n) { for (var a = 0; a < r; a++) e[a * r + a] = n; }; var xS = function(e, r) { for (var n, a = 0; a < r; a++) { n = 0; for (var i = 0; i < r; i++) n += e[i * r + a]; for (var o = 0; o < r; o++) e[o * r + a] = e[o * r + a] / n; } }; var fq = function(e, r, n) { for (var a = new Array(n * n), i = 0; i < n; i++) { for (var o = 0; o < n; o++) a[i * n + o] = 0; for (var s = 0; s < n; s++) for (var u = 0; u < n; u++) a[i * n + u] += e[i * n + s] * r[s * n + u]; } return a; }; var vq = function(e, r, n) { for (var a = e.slice(0), i = 1; i < n; i++) e = fq(e, a, r); return e; }; var hq = function(e, r, n) { for (var a = new Array(r * r), i = 0; i < r * r; i++) a[i] = Math.pow(e[i], n); return xS(a, r), a; }; var pq = function(e, r, n, a) { for (var i = 0; i < n; i++) { var o = Math.round(e[i] * Math.pow(10, a)) / Math.pow(10, a), s = Math.round(r[i] * Math.pow(10, a)) / Math.pow(10, a); if (o !== s) return false; } return true; }; var gq = function(e, r, n, a) { for (var i = [], o = 0; o < r; o++) { for (var s = [], u = 0; u < r; u++) Math.round(e[o * r + u] * 1e3) / 1e3 > 0 && s.push(n[u]); s.length !== 0 && i.push(a.collection(s)); } return i; }; var yq = function(e, r) { for (var n = 0; n < e.length; n++) if (!r[n] || e[n].id() !== r[n].id()) return false; return true; }; var mq = function(e) { for (var r = 0; r < e.length; r++) for (var n = 0; n < e.length; n++) r != n && yq(e[r], e[n]) && e.splice(n, 1); return e; }; var Jm = function(e) { for (var r = this.nodes(), n = this.edges(), a = this.cy(), i = uq(e), o = {}, s = 0; s < r.length; s++) o[r[s].id()] = s; for (var u = r.length, l = u * u, c = new Array(l), d, f = 0; f < l; f++) c[f] = 0; for (var h10 = 0; h10 < n.length; h10++) { var v = n[h10], p = o[v.source().id()], g = o[v.target().id()], y = cq(v, i.attributes); c[p * u + g] += y, c[g * u + p] += y; } dq(c, u, i.multFactor), xS(c, u); for (var m = true, b = 0; m && b < i.maxIterations; ) m = false, d = vq(c, u, i.expandFactor), c = hq(d, u, i.inflateFactor), pq(c, d, l, 4) || (m = true), b++; var w = gq(c, u, r, a); return w = mq(w), w; }; var bq = { markovClustering: Jm, mcl: Jm }; var wq = function(e) { return e; }; var ES = function(e, r) { return Math.abs(r - e); }; var Qm = function(e, r, n) { return e + ES(r, n); }; var e0 = function(e, r, n) { return e + Math.pow(n - r, 2); }; var Cq = function(e) { return Math.sqrt(e); }; var xq = function(e, r, n) { return Math.max(e, ES(r, n)); }; var ro = function(e, r, n, a, i) { for (var o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : wq, s = a, u, l, c = 0; c < e; c++) u = r(c), l = n(c), s = i(s, u, l); return o(s); }; var Ii = { euclidean: function(e, r, n) { return e >= 2 ? ro(e, r, n, 0, e0, Cq) : ro(e, r, n, 0, Qm); }, squaredEuclidean: function(e, r, n) { return ro(e, r, n, 0, e0); }, manhattan: function(e, r, n) { return ro(e, r, n, 0, Qm); }, max: function(e, r, n) { return ro(e, r, n, -1 / 0, xq); } }; Ii["squared-euclidean"] = Ii.squaredEuclidean; Ii.squaredeuclidean = Ii.squaredEuclidean; function Bl(t13, e, r, n, a, i) { var o; return yt(t13) ? o = t13 : o = Ii[t13] || Ii.euclidean, e === 0 && yt(t13) ? o(a, i) : o(e, r, n, a, i); } var Eq = Zt({ k: 2, m: 2, sensitivityThreshold: 1e-4, distance: "euclidean", maxIterations: 10, attributes: [], testMode: false, testCentroids: null }); var Fg = function(e) { return Eq(e); }; var fl = function(e, r, n, a, i) { var o = i !== "kMedoids", s = o ? function(d) { return n[d]; } : function(d) { return a[d](n); }, u = function(f) { return a[f](r); }, l = n, c = r; return Bl(e, a.length, s, u, l, c); }; var Lu = function(e, r, n) { for (var a = n.length, i = new Array(a), o = new Array(a), s = new Array(r), u = null, l = 0; l < a; l++) i[l] = e.min(n[l]).value, o[l] = e.max(n[l]).value; for (var c = 0; c < r; c++) { u = []; for (var d = 0; d < a; d++) u[d] = Math.random() * (o[d] - i[d]) + i[d]; s[c] = u; } return s; }; var SS = function(e, r, n, a, i) { for (var o = 1 / 0, s = 0, u = 0; u < r.length; u++) { var l = fl(n, e, r[u], a, i); l < o && (o = l, s = u); } return s; }; var kS = function(e, r, n) { for (var a = [], i = null, o = 0; o < r.length; o++) i = r[o], n[i.id()] === e && a.push(i); return a; }; var Sq = function(e, r, n) { return Math.abs(r - e) <= n; }; var kq = function(e, r, n) { for (var a = 0; a < e.length; a++) for (var i = 0; i < e[a].length; i++) { var o = Math.abs(e[a][i] - r[a][i]); if (o > n) return false; } return true; }; var _q = function(e, r, n) { for (var a = 0; a < n; a++) if (e === r[a]) return true; return false; }; var t0 = function(e, r) { var n = new Array(r); if (e.length < 50) for (var a = 0; a < r; a++) { for (var i = e[Math.floor(Math.random() * e.length)]; _q(i, n, a); ) i = e[Math.floor(Math.random() * e.length)]; n[a] = i; } else for (var o = 0; o < r; o++) n[o] = e[Math.floor(Math.random() * e.length)]; return n; }; var r0 = function(e, r, n) { for (var a = 0, i = 0; i < r.length; i++) a += fl("manhattan", r[i], e, n, "kMedoids"); return a; }; var Tq = function(e) { var r = this.cy(), n = this.nodes(), a = null, i = Fg(e), o = new Array(i.k), s = {}, u; i.testMode ? typeof i.testCentroids == "number" ? (i.testCentroids, u = Lu(n, i.k, i.attributes)) : Nt(i.testCentroids) === "object" ? u = i.testCentroids : u = Lu(n, i.k, i.attributes) : u = Lu(n, i.k, i.attributes); for (var l = true, c = 0; l && c < i.maxIterations; ) { for (var d = 0; d < n.length; d++) a = n[d], s[a.id()] = SS(a, u, i.distance, i.attributes, "kMeans"); l = false; for (var f = 0; f < i.k; f++) { var h10 = kS(f, n, s); if (h10.length !== 0) { for (var v = i.attributes.length, p = u[f], g = new Array(v), y = new Array(v), m = 0; m < v; m++) { y[m] = 0; for (var b = 0; b < h10.length; b++) a = h10[b], y[m] += i.attributes[m](a); g[m] = y[m] / h10.length, Sq(g[m], p[m], i.sensitivityThreshold) || (l = true); } u[f] = g, o[f] = r.collection(h10); } } c++; } return o; }; var Iq = function(e) { var r = this.cy(), n = this.nodes(), a = null, i = Fg(e), o = new Array(i.k), s, u = {}, l, c = new Array(i.k); i.testMode ? typeof i.testCentroids == "number" || (Nt(i.testCentroids) === "object" ? s = i.testCentroids : s = t0(n, i.k)) : s = t0(n, i.k); for (var d = true, f = 0; d && f < i.maxIterations; ) { for (var h10 = 0; h10 < n.length; h10++) a = n[h10], u[a.id()] = SS(a, s, i.distance, i.attributes, "kMedoids"); d = false; for (var v = 0; v < s.length; v++) { var p = kS(v, n, u); if (p.length !== 0) { c[v] = r0(s[v], p, i.attributes); for (var g = 0; g < p.length; g++) l = r0(p[g], p, i.attributes), l < c[v] && (c[v] = l, s[v] = p[g], d = true); o[v] = r.collection(p); } } f++; } return o; }; var Oq = function(e, r, n, a, i) { for (var o, s, u = 0; u < r.length; u++) for (var l = 0; l < e.length; l++) a[u][l] = Math.pow(n[u][l], i.m); for (var c = 0; c < e.length; c++) for (var d = 0; d < i.attributes.length; d++) { o = 0, s = 0; for (var f = 0; f < r.length; f++) o += a[f][c] * i.attributes[d](r[f]), s += a[f][c]; e[c][d] = o / s; } }; var Aq = function(e, r, n, a, i) { for (var o = 0; o < e.length; o++) r[o] = e[o].slice(); for (var s, u, l, c = 2 / (i.m - 1), d = 0; d < n.length; d++) for (var f = 0; f < a.length; f++) { s = 0; for (var h10 = 0; h10 < n.length; h10++) u = fl(i.distance, a[f], n[d], i.attributes, "cmeans"), l = fl(i.distance, a[f], n[h10], i.attributes, "cmeans"), s += Math.pow(u / l, c); e[f][d] = 1 / s; } }; var Pq = function(e, r, n, a) { for (var i = new Array(n.k), o = 0; o < i.length; o++) i[o] = []; for (var s, u, l = 0; l < r.length; l++) { s = -1 / 0, u = -1; for (var c = 0; c < r[0].length; c++) r[l][c] > s && (s = r[l][c], u = c); i[u].push(e[l]); } for (var d = 0; d < i.length; d++) i[d] = a.collection(i[d]); return i; }; var n0 = function(e) { var r = this.cy(), n = this.nodes(), a = Fg(e), i, o, s, u, l; u = new Array(n.length); for (var c = 0; c < n.length; c++) u[c] = new Array(a.k); s = new Array(n.length); for (var d = 0; d < n.length; d++) s[d] = new Array(a.k); for (var f = 0; f < n.length; f++) { for (var h10 = 0, v = 0; v < a.k; v++) s[f][v] = Math.random(), h10 += s[f][v]; for (var p = 0; p < a.k; p++) s[f][p] = s[f][p] / h10; } o = new Array(a.k); for (var g = 0; g < a.k; g++) o[g] = new Array(a.attributes.length); l = new Array(n.length); for (var y = 0; y < n.length; y++) l[y] = new Array(a.k); for (var m = true, b = 0; m && b < a.maxIterations; ) m = false, Oq(o, n, s, l, a), Aq(s, u, o, n, a), kq(s, u, a.sensitivityThreshold) || (m = true), b++; return i = Pq(n, s, a, r), { clusters: i, degreeOfMembership: s }; }; var Dq = { kMeans: Tq, kMedoids: Iq, fuzzyCMeans: n0, fcm: n0 }; var Rq = Zt({ distance: "euclidean", // distance metric to compare nodes linkage: "min", // linkage criterion : how to determine the distance between clusters of nodes mode: "threshold", // mode:'threshold' => clusters must be threshold distance apart threshold: 1 / 0, // the distance threshold // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters addDendrogram: false, // whether to add the dendrogram to the graph for viz dendrogramDepth: 0, // depth at which dendrogram branches are merged into the returned clusters attributes: [] // array of attr functions }); var Lq = { single: "min", complete: "max" }; var Fq = function(e) { var r = Rq(e), n = Lq[r.linkage]; return n != null && (r.linkage = n), r; }; var a0 = function(e, r, n, a, i) { for (var o = 0, s = 1 / 0, u, l = i.attributes, c = function(S, _) { return Bl(i.distance, l.length, function(T) { return l[T](S); }, function(T) { return l[T](_); }, S, _); }, d = 0; d < e.length; d++) { var f = e[d].key, h10 = n[f][a[f]]; h10 < s && (o = f, s = h10); } if (i.mode === "threshold" && s >= i.threshold || i.mode === "dendrogram" && e.length === 1) return false; var v = r[o], p = r[a[o]], g; i.mode === "dendrogram" ? g = { left: v, right: p, key: v.key } : g = { value: v.value.concat(p.value), key: v.key }, e[v.index] = g, e.splice(p.index, 1), r[v.key] = g; for (var y = 0; y < e.length; y++) { var m = e[y]; v.key === m.key ? u = 1 / 0 : i.linkage === "min" ? (u = n[v.key][m.key], n[v.key][m.key] > n[p.key][m.key] && (u = n[p.key][m.key])) : i.linkage === "max" ? (u = n[v.key][m.key], n[v.key][m.key] < n[p.key][m.key] && (u = n[p.key][m.key])) : i.linkage === "mean" ? u = (n[v.key][m.key] * v.size + n[p.key][m.key] * p.size) / (v.size + p.size) : i.mode === "dendrogram" ? u = c(m.value, v.value) : u = c(m.value[0], v.value[0]), n[v.key][m.key] = n[m.key][v.key] = u; } for (var b = 0; b < e.length; b++) { var w = e[b].key; if (a[w] === v.key || a[w] === p.key) { for (var x = w, E = 0; E < e.length; E++) { var C = e[E].key; n[w][C] < n[w][x] && (x = C); } a[w] = x; } e[b].index = b; } return v.key = p.key = v.index = p.index = null, true; }; var Is = function t(e, r, n) { e && (e.value ? r.push(e.value) : (e.left && t(e.left, r), e.right && t(e.right, r))); }; var Mq = function t3(e, r) { if (!e) return ""; if (e.left && e.right) { var n = t3(e.left, r), a = t3(e.right, r), i = r.add({ group: "nodes", data: { id: n + "," + a } }); return r.add({ group: "edges", data: { source: n, target: i.id() } }), r.add({ group: "edges", data: { source: a, target: i.id() } }), i.id(); } else if (e.value) return e.value.id(); }; var Nq = function t4(e, r, n) { if (!e) return []; var a = [], i = [], o = []; return r === 0 ? (e.left && Is(e.left, a), e.right && Is(e.right, i), o = a.concat(i), [n.collection(o)]) : r === 1 ? e.value ? [n.collection(e.value)] : (e.left && Is(e.left, a), e.right && Is(e.right, i), [n.collection(a), n.collection(i)]) : e.value ? [n.collection(e.value)] : (e.left && (a = t4(e.left, r - 1, n)), e.right && (i = t4(e.right, r - 1, n)), a.concat(i)); }; var i0 = function(e) { for (var r = this.cy(), n = this.nodes(), a = Fq(e), i = a.attributes, o = function(b, w) { return Bl(a.distance, i.length, function(x) { return i[x](b); }, function(x) { return i[x](w); }, b, w); }, s = [], u = [], l = [], c = [], d = 0; d < n.length; d++) { var f = { value: a.mode === "dendrogram" ? n[d] : [n[d]], key: d, index: d }; s[d] = f, c[d] = f, u[d] = [], l[d] = 0; } for (var h10 = 0; h10 < s.length; h10++) for (var v = 0; v <= h10; v++) { var p = void 0; a.mode === "dendrogram" ? p = h10 === v ? 1 / 0 : o(s[h10].value, s[v].value) : p = h10 === v ? 1 / 0 : o(s[h10].value[0], s[v].value[0]), u[h10][v] = p, u[v][h10] = p, p < u[h10][l[h10]] && (l[h10] = v); } for (var g = a0(s, c, u, l, a); g; ) g = a0(s, c, u, l, a); var y; return a.mode === "dendrogram" ? (y = Nq(s[0], a.dendrogramDepth, r), a.addDendrogram && Mq(s[0], r)) : (y = new Array(s.length), s.forEach(function(m, b) { m.key = m.index = null, y[b] = r.collection(m.value); })), y; }; var Bq = { hierarchicalClustering: i0, hca: i0 }; var $q = Zt({ distance: "euclidean", // distance metric to compare attributes between two nodes preference: "median", // suitability of a data point to serve as an exemplar damping: 0.8, // damping factor between [0.5, 1) maxIterations: 1e3, // max number of iterations to run minIterations: 100, // min number of iterations to run in order for clustering to stop attributes: [ // functions to quantify the similarity between any two points // e.g. node => node.data('weight') ] }); var qq = function(e) { var r = e.damping, n = e.preference; 0.5 <= r && r < 1 || bt("Damping must range on [0.5, 1). Got: ".concat(r)); var a = ["median", "mean", "min", "max"]; return a.some(function(i) { return i === n; }) || Ce(n) || bt("Preference must be one of [".concat(a.map(function(i) { return "'".concat(i, "'"); }).join(", "), "] or a number. Got: ").concat(n)), $q(e); }; var zq = function(e, r, n, a) { var i = function(s, u) { return a[u](s); }; return -Bl(e, a.length, function(o) { return i(r, o); }, function(o) { return i(n, o); }, r, n); }; var Vq = function(e, r) { var n = null; return r === "median" ? n = q$(e) : r === "mean" ? n = $$(e) : r === "min" ? n = N$(e) : r === "max" ? n = B$(e) : n = r, n; }; var Hq = function(e, r, n) { for (var a = [], i = 0; i < e; i++) r[i * e + i] + n[i * e + i] > 0 && a.push(i); return a; }; var o0 = function(e, r, n) { for (var a = [], i = 0; i < e; i++) { for (var o = -1, s = -1 / 0, u = 0; u < n.length; u++) { var l = n[u]; r[i * e + l] > s && (o = l, s = r[i * e + l]); } o > 0 && a.push(o); } for (var c = 0; c < n.length; c++) a[n[c]] = n[c]; return a; }; var Kq = function(e, r, n) { for (var a = o0(e, r, n), i = 0; i < n.length; i++) { for (var o = [], s = 0; s < a.length; s++) a[s] === n[i] && o.push(s); for (var u = -1, l = -1 / 0, c = 0; c < o.length; c++) { for (var d = 0, f = 0; f < o.length; f++) d += r[o[f] * e + o[c]]; d > l && (u = c, l = d); } n[i] = o[u]; } return a = o0(e, r, n), a; }; var s0 = function(e) { for (var r = this.cy(), n = this.nodes(), a = qq(e), i = {}, o = 0; o < n.length; o++) i[n[o].id()] = o; var s, u, l, c, d, f; s = n.length, u = s * s, l = new Array(u); for (var h10 = 0; h10 < u; h10++) l[h10] = -1 / 0; for (var v = 0; v < s; v++) for (var p = 0; p < s; p++) v !== p && (l[v * s + p] = zq(a.distance, n[v], n[p], a.attributes)); c = Vq(l, a.preference); for (var g = 0; g < s; g++) l[g * s + g] = c; d = new Array(u); for (var y = 0; y < u; y++) d[y] = 0; f = new Array(u); for (var m = 0; m < u; m++) f[m] = 0; for (var b = new Array(s), w = new Array(s), x = new Array(s), E = 0; E < s; E++) b[E] = 0, w[E] = 0, x[E] = 0; for (var C = new Array(s * a.minIterations), k = 0; k < C.length; k++) C[k] = 0; var S; for (S = 0; S < a.maxIterations; S++) { for (var _ = 0; _ < s; _++) { for (var T = -1 / 0, O = -1 / 0, D = -1, A = 0, F = 0; F < s; F++) b[F] = d[_ * s + F], A = f[_ * s + F] + l[_ * s + F], A >= T ? (O = T, T = A, D = F) : A > O && (O = A); for (var R = 0; R < s; R++) d[_ * s + R] = (1 - a.damping) * (l[_ * s + R] - T) + a.damping * b[R]; d[_ * s + D] = (1 - a.damping) * (l[_ * s + D] - O) + a.damping * b[D]; } for (var M = 0; M < s; M++) { for (var L = 0, V = 0; V < s; V++) b[V] = f[V * s + M], w[V] = Math.max(0, d[V * s + M]), L += w[V]; L -= w[M], w[M] = d[M * s + M], L += w[M]; for (var Y = 0; Y < s; Y++) f[Y * s + M] = (1 - a.damping) * Math.min(0, L - w[Y]) + a.damping * b[Y]; f[M * s + M] = (1 - a.damping) * (L - w[M]) + a.damping * b[M]; } for (var H = 0, K = 0; K < s; K++) { var ne = f[K * s + K] + d[K * s + K] > 0 ? 1 : 0; C[S % a.minIterations * s + K] = ne, H += ne; } if (H > 0 && (S >= a.minIterations - 1 || S == a.maxIterations - 1)) { for (var B = 0, $ = 0; $ < s; $++) { x[$] = 0; for (var z = 0; z < a.minIterations; z++) x[$] += C[z * s + $]; (x[$] === 0 || x[$] === a.minIterations) && B++; } if (B === s) break; } } for (var W = Hq(s, d, f), Z = Kq(s, l, W), N = {}, X = 0; X < W.length; X++) N[W[X]] = []; for (var Q = 0; Q < n.length; Q++) { var ge = i[n[Q].id()], we = Z[ge]; we != null && N[we].push(n[Q]); } for (var fe = new Array(W.length), ce = 0; ce < W.length; ce++) fe[ce] = r.collection(N[W[ce]]); return fe; }; var Gq = { affinityPropagation: s0, ap: s0 }; var Uq = Zt({ root: void 0, directed: false }); var Wq = { hierholzer: function(e) { if (!Xe(e)) { var r = arguments; e = { root: r[0], directed: r[1] }; } var n = Uq(e), a = n.root, i = n.directed, o = this, s = false, u, l, c; a && (c = Me(a) ? this.filter(a)[0].id() : a[0].id()); var d = {}, f = {}; i ? o.forEach(function(m) { var b = m.id(); if (m.isNode()) { var w = m.indegree(true), x = m.outdegree(true), E = w - x, C = x - w; E == 1 ? u ? s = true : u = b : C == 1 ? l ? s = true : l = b : (C > 1 || E > 1) && (s = true), d[b] = [], m.outgoers().forEach(function(k) { k.isEdge() && d[b].push(k.id()); }); } else f[b] = [void 0, m.target().id()]; }) : o.forEach(function(m) { var b = m.id(); if (m.isNode()) { var w = m.degree(true); w % 2 && (u ? l ? s = true : l = b : u = b), d[b] = [], m.connectedEdges().forEach(function(x) { return d[b].push(x.id()); }); } else f[b] = [m.source().id(), m.target().id()]; }); var h10 = { found: false, trail: void 0 }; if (s) return h10; if (l && u) if (i) { if (c && l != c) return h10; c = l; } else { if (c && l != c && u != c) return h10; c || (c = l); } else c || (c = o[0].id()); var v = function(b) { for (var w = b, x = [b], E, C, k; d[w].length; ) E = d[w].shift(), C = f[E][0], k = f[E][1], w != k ? (d[k] = d[k].filter(function(S) { return S != E; }), w = k) : !i && w != C && (d[C] = d[C].filter(function(S) { return S != E; }), w = C), x.unshift(E), x.unshift(w); return x; }, p = [], g = []; for (g = v(c); g.length != 1; ) d[g[0]].length == 0 ? (p.unshift(o.getElementById(g.shift())), p.unshift(o.getElementById(g.shift()))) : g = v(g.shift()).concat(g); p.unshift(o.getElementById(g.shift())); for (var y in d) if (d[y].length) return h10; return h10.found = true, h10.trail = this.spawn(p, true), h10; } }; var Os = function() { var e = this, r = {}, n = 0, a = 0, i = [], o = [], s = {}, u = function(f, h10) { for (var v = o.length - 1, p = [], g = e.spawn(); o[v].x != f || o[v].y != h10; ) p.push(o.pop().edge), v--; p.push(o.pop().edge), p.forEach(function(y) { var m = y.connectedNodes().intersection(e); g.merge(y), m.forEach(function(b) { var w = b.id(), x = b.connectedEdges().intersection(e); g.merge(b), r[w].cutVertex ? g.merge(x.filter(function(E) { return E.isLoop(); })) : g.merge(x); }); }), i.push(g); }, l = function d(f, h10, v) { f === v && (a += 1), r[h10] = { id: n, low: n++, cutVertex: false }; var p = e.getElementById(h10).connectedEdges().intersection(e); if (p.size() === 0) i.push(e.spawn(e.getElementById(h10))); else { var g, y, m, b; p.forEach(function(w) { g = w.source().id(), y = w.target().id(), m = g === h10 ? y : g, m !== v && (b = w.id(), s[b] || (s[b] = true, o.push({ x: h10, y: m, edge: w })), m in r ? r[h10].low = Math.min(r[h10].low, r[m].id) : (d(f, m, h10), r[h10].low = Math.min(r[h10].low, r[m].low), r[h10].id <= r[m].low && (r[h10].cutVertex = true, u(h10, m)))); }); } }; e.forEach(function(d) { if (d.isNode()) { var f = d.id(); f in r || (a = 0, l(f, f), r[f].cutVertex = a > 1); } }); var c = Object.keys(r).filter(function(d) { return r[d].cutVertex; }).map(function(d) { return e.getElementById(d); }); return { cut: e.spawn(c), components: i }; }; var jq = { hopcroftTarjanBiconnected: Os, htbc: Os, htb: Os, hopcroftTarjanBiconnectedComponents: Os }; var As = function() { var e = this, r = {}, n = 0, a = [], i = [], o = e.spawn(e), s = function u(l) { i.push(l), r[l] = { index: n, low: n++, explored: false }; var c = e.getElementById(l).connectedEdges().intersection(e); if (c.forEach(function(p) { var g = p.target().id(); g !== l && (g in r || u(g), r[g].explored || (r[l].low = Math.min(r[l].low, r[g].low))); }), r[l].index === r[l].low) { for (var d = e.spawn(); ; ) { var f = i.pop(); if (d.merge(e.getElementById(f)), r[f].low = r[l].index, r[f].explored = true, f === l) break; } var h10 = d.edgesWith(d), v = d.merge(h10); a.push(v), o = o.difference(v); } }; return e.forEach(function(u) { if (u.isNode()) { var l = u.id(); l in r || s(l); } }), { cut: o, components: a }; }; var Yq = { tarjanStronglyConnected: As, tsc: As, tscc: As, tarjanStronglyConnectedComponents: As }; var _S = {}; [Lo, k$, _$, I$, A$, D$, F$, oq, hi, pi, Tp, bq, Dq, Bq, Gq, Wq, jq, Yq].forEach(function(t13) { ze(_S, t13); }); var TS = 0; var IS = 1; var OS = 2; var Tn = function t6(e) { if (!(this instanceof t6)) return new t6(e); this.id = "Thenable/1.0.7", this.state = TS, 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)); }; Tn.prototype = { /* promise resolving methods */ fulfill: function(e) { return l0(this, IS, "fulfillValue", e); }, reject: function(e) { return l0(this, OS, "rejectReason", e); }, /* "The then Method" [Promises/A+ 1.1, 1.2, 2.2] */ then: function(e, r) { var n = this, a = new Tn(); return n.onFulfilled.push(c0(e, a, "fulfill")), n.onRejected.push(c0(r, a, "reject")), AS(n), a.proxy; } }; var l0 = function(e, r, n, a) { return e.state === TS && (e.state = r, e[n] = a, AS(e)), e; }; var AS = function(e) { e.state === IS ? u0(e, "onFulfilled", e.fulfillValue) : e.state === OS && u0(e, "onRejected", e.rejectReason); }; var u0 = function(e, r, n) { if (e[r].length !== 0) { var a = e[r]; e[r] = []; var i = function() { for (var s = 0; s < a.length; s++) a[s](n); }; typeof setImmediate == "function" ? setImmediate(i) : setTimeout(i, 0); } }; var c0 = function(e, r, n) { return function(a) { if (typeof e != "function") r[n].call(r, a); else { var i; try { i = e(a); } catch (o) { r.reject(o); return; } Zq(r, i); } }; }; var Zq = function t7(e, r) { if (e === r || e.proxy === r) { e.reject(new TypeError("cannot resolve promise with itself")); return; } var n; if (Nt(r) === "object" && r !== null || typeof r == "function") try { n = r.then; } catch (i) { e.reject(i); return; } if (typeof n == "function") { var a = false; try { n.call( r, /* resolvePromise */ /* [Promises/A+ 2.3.3.3.1] */ function(i) { a || (a = true, i === r ? e.reject(new TypeError("circular thenable chain")) : t7(e, i)); }, /* rejectPromise */ /* [Promises/A+ 2.3.3.3.2] */ function(i) { a || (a = true, e.reject(i)); } ); } catch (i) { a || e.reject(i); } return; } e.fulfill(r); }; Tn.all = function(t13) { return new Tn(function(e, r) { for (var n = new Array(t13.length), a = 0, i = function(u, l) { n[u] = l, a++, a === t13.length && e(n); }, o = 0; o < t13.length; o++) (function(s) { var u = t13[s], l = u != null && u.then != null; if (l) u.then(function(d) { i(s, d); }, function(d) { r(d); }); else { var c = u; i(s, c); } })(o); }); }; Tn.resolve = function(t13) { return new Tn(function(e, r) { e(t13); }); }; Tn.reject = function(t13) { return new Tn(function(e, r) { r(t13); }); }; var Mi = typeof Promise < "u" ? Promise : Tn; var Ip = function(e, r, n) { var a = Tg(e), i = !a, o = this._private = ze({ duration: 1e3 }, r, n); if (o.target = e, o.style = o.style || o.css, o.started = false, o.playing = false, o.hooked = false, o.applying = false, o.progress = 0, o.completes = [], o.frames = [], o.complete && yt(o.complete) && o.completes.push(o.complete), i) { var s = e.position(); o.startPosition = o.startPosition || { x: s.x, y: s.y }, o.startStyle = o.startStyle || e.cy().style().getAnimationStartStyle(e, o.style); } if (a) { var u = e.pan(); o.startPan = { x: u.x, y: u.y }, o.startZoom = e.zoom(); } this.length = 1, this[0] = this; }; var La = Ip.prototype; ze(La, { instanceString: function() { return "animation"; }, hook: function() { var e = this._private; if (!e.hooked) { var r, n = e.target._private.animation; e.queue ? r = n.queue : r = n.current, r.push(this), xr(e.target) && e.target.cy().addToAnimationPool(e.target), e.hooked = true; } return this; }, play: function() { var e = this._private; return e.progress === 1 && (e.progress = 0), e.playing = true, e.started = false, e.stopped = false, this.hook(), this; }, playing: function() { return this._private.playing; }, apply: function() { var e = this._private; return e.applying = true, e.started = false, e.stopped = false, this.hook(), this; }, applying: function() { return this._private.applying; }, pause: function() { var e = this._private; return e.playing = false, e.started = false, this; }, stop: function() { var e = this._private; return e.playing = false, e.started = false, e.stopped = true, this; }, rewind: function() { return this.progress(0); }, fastforward: function() { return this.progress(1); }, time: function(e) { var r = this._private; return e === void 0 ? r.progress * r.duration : this.progress(e / r.duration); }, progress: function(e) { var r = this._private, n = r.playing; return e === void 0 ? r.progress : (n && this.pause(), r.progress = e, r.started = false, n && this.play(), this); }, completed: function() { return this._private.progress === 1; }, reverse: function() { var e = this._private, r = e.playing; r && this.pause(), e.progress = 1 - e.progress, e.started = false; var n = function(l, c) { var d = e[l]; d != null && (e[l] = e[c], e[c] = d); }; if (n("zoom", "startZoom"), n("pan", "startPan"), n("position", "startPosition"), e.style) for (var a = 0; a < e.style.length; a++) { var i = e.style[a], o = i.name, s = e.startStyle[o]; e.startStyle[o] = i, e.style[a] = s; } return r && this.play(), this; }, promise: function(e) { var r = this._private, n; switch (e) { case "frame": n = r.frames; break; default: case "complete": case "completed": n = r.completes; } return new Mi(function(a, i) { n.push(function() { a(); }); }); } }); La.complete = La.completed; La.run = La.play; La.running = La.playing; var Xq = { animated: function() { return function() { var r = this, n = r.length !== void 0, a = n ? r : [r], i = this._private.cy || this; if (!i.styleEnabled()) return false; var o = a[0]; if (o) return o._private.animation.current.length > 0; }; }, // animated clearQueue: function() { return function() { var r = this, n = r.length !== void 0, a = n ? r : [r], i = this._private.cy || this; if (!i.styleEnabled()) return this; for (var o = 0; o < a.length; o++) { var s = a[o]; s._private.animation.queue = []; } return this; }; }, // clearQueue delay: function() { return function(r, n) { var a = this._private.cy || this; return a.styleEnabled() ? this.animate({ delay: r, duration: r, complete: n }) : this; }; }, // delay delayAnimation: function() { return function(r, n) { var a = this._private.cy || this; return a.styleEnabled() ? this.animation({ delay: r, duration: r, complete: n }) : this; }; }, // delay animation: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this, u = !i, l = !u; if (!s.styleEnabled()) return this; var c = s.style(); r = ze({}, r, n); var d = Object.keys(r).length === 0; if (d) return new Ip(o[0], r); switch (r.duration === void 0 && (r.duration = 400), r.duration) { case "slow": r.duration = 600; break; case "fast": r.duration = 200; break; } if (l && (r.style = c.getPropsList(r.style || r.css), r.css = void 0), l && r.renderedPosition != null) { var f = r.renderedPosition, h10 = s.pan(), v = s.zoom(); r.position = pS(f, v, h10); } if (u && r.panBy != null) { var p = r.panBy, g = s.pan(); r.pan = { x: g.x + p.x, y: g.y + p.y }; } var y = r.center || r.centre; if (u && y != null) { var m = s.getCenterPan(y.eles, r.zoom); m != null && (r.pan = m); } if (u && r.fit != null) { var b = r.fit, w = s.getFitViewport(b.eles || b.boundingBox, b.padding); w != null && (r.pan = w.pan, r.zoom = w.zoom); } if (u && Xe(r.zoom)) { var x = s.getZoomedViewport(r.zoom); x != null ? (x.zoomed && (r.zoom = x.zoom), x.panned && (r.pan = x.pan)) : r.zoom = null; } return new Ip(o[0], r); }; }, // animate animate: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this; if (!s.styleEnabled()) return this; n && (r = ze({}, r, n)); for (var u = 0; u < o.length; u++) { var l = o[u], c = l.animated() && (r.queue === void 0 || r.queue), d = l.animation(r, c ? { queue: true } : void 0); d.play(); } return this; }; }, // animate stop: function() { return function(r, n) { var a = this, i = a.length !== void 0, o = i ? a : [a], s = this._private.cy || this; if (!s.styleEnabled()) return this; for (var u = 0; u < o.length; u++) { for (var l = o[u], c = l._private, d = c.animation.current, f = 0; f < d.length; f++) { var h10 = d[f], v = h10._private; n && (v.duration = 0); } r && (c.animation.queue = []), n || (c.animation.current = []); } return s.notify("draw"), this; }; } // stop }; var Jq = Array.isArray; var $l = Jq; var Qq = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; var e3 = /^\w*$/; function t32(t13, e) { if ($l(t13)) return false; var r = typeof t13; return r == "number" || r == "symbol" || r == "boolean" || t13 == null || ns(t13) ? true : e3.test(t13) || !Qq.test(t13) || e != null && t13 in Object(e); } var r3 = t32; var n3 = "[object AsyncFunction]"; var a3 = "[object Function]"; var i3 = "[object GeneratorFunction]"; var o3 = "[object Proxy]"; function s3(t13) { if (!Aa(t13)) return false; var e = oS(t13); return e == a3 || e == i3 || e == n3 || e == o3; } var l3 = s3; var u3 = Ll["__core-js_shared__"]; var Fu = u3; var d0 = function() { var t13 = /[^.]+$/.exec(Fu && Fu.keys && Fu.keys.IE_PROTO || ""); return t13 ? "Symbol(src)_1." + t13 : ""; }(); function c3(t13) { return !!d0 && d0 in t13; } var d3 = c3; var f3 = Function.prototype; var v3 = f3.toString; function h3(t13) { if (t13 != null) { try { return v3.call(t13); } catch { } try { return t13 + ""; } catch { } } return ""; } var p3 = h3; var g3 = /[\\^$.*+?()[\]{}|]/g; var y3 = /^\[object .+?Constructor\]$/; var m3 = Function.prototype; var b3 = Object.prototype; var w3 = m3.toString; var C3 = b3.hasOwnProperty; var x3 = RegExp( "^" + w3.call(C3).replace(g3, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function E3(t13) { if (!Aa(t13) || d3(t13)) return false; var e = l3(t13) ? x3 : y3; return e.test(p3(t13)); } var S3 = E3; function k3(t13, e) { return t13 == null ? void 0 : t13[e]; } var _3 = k3; function T3(t13, e) { var r = _3(t13, e); return S3(r) ? r : void 0; } var Mg = T3; var I3 = Mg(Object, "create"); var No = I3; function O3() { this.__data__ = No ? No(null) : {}, this.size = 0; } var A3 = O3; function P3(t13) { var e = this.has(t13) && delete this.__data__[t13]; return this.size -= e ? 1 : 0, e; } var D3 = P3; var R3 = "__lodash_hash_undefined__"; var L3 = Object.prototype; var F3 = L3.hasOwnProperty; function M3(t13) { var e = this.__data__; if (No) { var r = e[t13]; return r === R3 ? void 0 : r; } return F3.call(e, t13) ? e[t13] : void 0; } var N3 = M3; var B3 = Object.prototype; var $3 = B3.hasOwnProperty; function q3(t13) { var e = this.__data__; return No ? e[t13] !== void 0 : $3.call(e, t13); } var z3 = q3; var V3 = "__lodash_hash_undefined__"; function H3(t13, e) { var r = this.__data__; return this.size += this.has(t13) ? 0 : 1, r[t13] = No && e === void 0 ? V3 : e, this; } var K3 = H3; function Ni(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } Ni.prototype.clear = A3; Ni.prototype.delete = D3; Ni.prototype.get = N3; Ni.prototype.has = z3; Ni.prototype.set = K3; var f0 = Ni; function G3() { this.__data__ = [], this.size = 0; } var U3 = G3; function W3(t13, e) { return t13 === e || t13 !== t13 && e !== e; } var PS = W3; function j3(t13, e) { for (var r = t13.length; r--; ) if (PS(t13[r][0], e)) return r; return -1; } var ql = j3; var Y3 = Array.prototype; var Z3 = Y3.splice; function X3(t13) { var e = this.__data__, r = ql(e, t13); if (r < 0) return false; var n = e.length - 1; return r == n ? e.pop() : Z3.call(e, r, 1), --this.size, true; } var J3 = X3; function Q3(t13) { var e = this.__data__, r = ql(e, t13); return r < 0 ? void 0 : e[r][1]; } var e4 = Q3; function t42(t13) { return ql(this.__data__, t13) > -1; } var r4 = t42; function n4(t13, e) { var r = this.__data__, n = ql(r, t13); return n < 0 ? (++this.size, r.push([t13, e])) : r[n][1] = e, this; } var a4 = n4; function Bi(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } Bi.prototype.clear = U3; Bi.prototype.delete = J3; Bi.prototype.get = e4; Bi.prototype.has = r4; Bi.prototype.set = a4; var i4 = Bi; var o4 = Mg(Ll, "Map"); var s4 = o4; function l4() { this.size = 0, this.__data__ = { hash: new f0(), map: new (s4 || i4)(), string: new f0() }; } var u4 = l4; function c4(t13) { var e = typeof t13; return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t13 !== "__proto__" : t13 === null; } var d4 = c4; function f4(t13, e) { var r = t13.__data__; return d4(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map; } var zl = f4; function v4(t13) { var e = zl(this, t13).delete(t13); return this.size -= e ? 1 : 0, e; } var h4 = v4; function p4(t13) { return zl(this, t13).get(t13); } var g4 = p4; function y4(t13) { return zl(this, t13).has(t13); } var m4 = y4; function b4(t13, e) { var r = zl(this, t13), n = r.size; return r.set(t13, e), this.size += r.size == n ? 0 : 1, this; } var w4 = b4; function $i(t13) { var e = -1, r = t13 == null ? 0 : t13.length; for (this.clear(); ++e < r; ) { var n = t13[e]; this.set(n[0], n[1]); } } $i.prototype.clear = u4; $i.prototype.delete = h4; $i.prototype.get = g4; $i.prototype.has = m4; $i.prototype.set = w4; var DS = $i; var C4 = "Expected a function"; function Ng(t13, e) { if (typeof t13 != "function" || e != null && typeof e != "function") throw new TypeError(C4); var r = function() { var n = arguments, a = e ? e.apply(this, n) : n[0], i = r.cache; if (i.has(a)) return i.get(a); var o = t13.apply(this, n); return r.cache = i.set(a, o) || i, o; }; return r.cache = new (Ng.Cache || DS)(), r; } Ng.Cache = DS; var x4 = Ng; var E4 = 500; function S4(t13) { var e = x4(t13, function(n) { return r.size === E4 && r.clear(), n; }), r = e.cache; return e; } var k4 = S4; var _4 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; var T4 = /\\(\\)?/g; var I4 = k4(function(t13) { var e = []; return t13.charCodeAt(0) === 46 && e.push(""), t13.replace(_4, function(r, n, a, i) { e.push(a ? i.replace(T4, "$1") : n || r); }), e; }); var RS = I4; function O4(t13, e) { for (var r = -1, n = t13 == null ? 0 : t13.length, a = Array(n); ++r < n; ) a[r] = e(t13[r], r, t13); return a; } var LS = O4; var A4 = 1 / 0; var v0 = _i ? _i.prototype : void 0; var h0 = v0 ? v0.toString : void 0; function FS(t13) { if (typeof t13 == "string") return t13; if ($l(t13)) return LS(t13, FS) + ""; if (ns(t13)) return h0 ? h0.call(t13) : ""; var e = t13 + ""; return e == "0" && 1 / t13 == -A4 ? "-0" : e; } var P4 = FS; function D4(t13) { return t13 == null ? "" : P4(t13); } var MS = D4; function R4(t13, e) { return $l(t13) ? t13 : r3(t13, e) ? [t13] : RS(MS(t13)); } var NS = R4; var L4 = 1 / 0; function F4(t13) { if (typeof t13 == "string" || ns(t13)) return t13; var e = t13 + ""; return e == "0" && 1 / t13 == -L4 ? "-0" : e; } var Bg = F4; function M4(t13, e) { e = NS(e, t13); for (var r = 0, n = e.length; t13 != null && r < n; ) t13 = t13[Bg(e[r++])]; return r && r == n ? t13 : void 0; } var N4 = M4; function B4(t13, e, r) { var n = t13 == null ? void 0 : N4(t13, e); return n === void 0 ? r : n; } var $4 = B4; var q4 = function() { try { var t13 = Mg(Object, "defineProperty"); return t13({}, "", {}), t13; } catch { } }(); var p0 = q4; function z4(t13, e, r) { e == "__proto__" && p0 ? p0(t13, e, { configurable: true, enumerable: true, value: r, writable: true }) : t13[e] = r; } var V4 = z4; var H4 = Object.prototype; var K4 = H4.hasOwnProperty; function G4(t13, e, r) { var n = t13[e]; (!(K4.call(t13, e) && PS(n, r)) || r === void 0 && !(e in t13)) && V4(t13, e, r); } var U4 = G4; var W4 = 9007199254740991; var j4 = /^(?:0|[1-9]\d*)$/; function Y4(t13, e) { var r = typeof t13; return e = e ?? W4, !!e && (r == "number" || r != "symbol" && j4.test(t13)) && t13 > -1 && t13 % 1 == 0 && t13 < e; } var Z4 = Y4; function X4(t13, e, r, n) { if (!Aa(t13)) return t13; e = NS(e, t13); for (var a = -1, i = e.length, o = i - 1, s = t13; s != null && ++a < i; ) { var u = Bg(e[a]), l = r; if (u === "__proto__" || u === "constructor" || u === "prototype") return t13; if (a != o) { var c = s[u]; l = n ? n(c, u, s) : void 0, l === void 0 && (l = Aa(c) ? c : Z4(e[a + 1]) ? [] : {}); } U4(s, u, l), s = s[u]; } return t13; } var J4 = X4; function Q4(t13, e, r) { return t13 == null ? t13 : J4(t13, e, r); } var ez = Q4; function tz(t13, e) { var r = -1, n = t13.length; for (e || (e = Array(n)); ++r < n; ) e[r] = t13[r]; return e; } var rz = tz; function nz(t13) { return $l(t13) ? LS(t13, Bg) : ns(t13) ? [t13] : rz(RS(MS(t13))); } var az = nz; var iz = { // access data field data: function(e) { var r = { field: "data", bindingEvent: "data", allowBinding: false, allowSetting: false, allowGetting: false, settingEvent: "data", settingTriggersEvent: false, triggerFnName: "trigger", immutableKeys: {}, // key => true if immutable updateStyle: false, beforeGet: function(a) { }, beforeSet: function(a, i) { }, onSet: function(a) { }, canSet: function(a) { return true; } }; return e = ze({}, r, e), function(a, i) { var o = e, s = this, u = s.length !== void 0, l = u ? s : [s], c = u ? s[0] : s; if (Me(a)) { var d = a.indexOf(".") !== -1, f = d && az(a); if (o.allowGetting && i === void 0) { var h10; return c && (o.beforeGet(c), f && c._private[o.field][a] === void 0 ? h10 = $4(c._private[o.field], f) : h10 = c._private[o.field][a]), h10; } else if (o.allowSetting && i !== void 0) { var v = !o.immutableKeys[a]; if (v) { var p = Y2({}, a, i); o.beforeSet(s, p); for (var g = 0, y = l.length; g < y; g++) { var m = l[g]; o.canSet(m) && (f && c._private[o.field][a] === void 0 ? ez(m._private[o.field], f, i) : m._private[o.field][a] = i); } o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent); } } } else if (o.allowSetting && Xe(a)) { var b = a, w, x, E = Object.keys(b); o.beforeSet(s, b); for (var C = 0; C < E.length; C++) { w = E[C], x = b[w]; var k = !o.immutableKeys[w]; if (k) for (var S = 0; S < l.length; S++) { var _ = l[S]; o.canSet(_) && (_._private[o.field][w] = x); } } o.updateStyle && s.updateStyle(), o.onSet(s), o.settingTriggersEvent && s[o.triggerFnName](o.settingEvent); } else if (o.allowBinding && yt(a)) { var T = a; s.on(o.bindingEvent, T); } else if (o.allowGetting && a === void 0) { var O; return c && (o.beforeGet(c), O = c._private[o.field]), O; } return s; }; }, // data // remove data field removeData: function(e) { var r = { field: "data", event: "data", triggerFnName: "trigger", triggerEvent: false, immutableKeys: {} // key => true if immutable }; return e = ze({}, r, e), function(a) { var i = e, o = this, s = o.length !== void 0, u = s ? o : [o]; if (Me(a)) { for (var l = a.split(/\s+/), c = l.length, d = 0; d < c; d++) { var f = l[d]; if (!ea(f)) { var h10 = !i.immutableKeys[f]; if (h10) for (var v = 0, p = u.length; v < p; v++) u[v]._private[i.field][f] = void 0; } } i.triggerEvent && o[i.triggerFnName](i.event); } else if (a === void 0) { for (var g = 0, y = u.length; g < y; g++) for (var m = u[g]._private[i.field], b = Object.keys(m), w = 0; w < b.length; w++) { var x = b[w], E = !i.immutableKeys[x]; E && (m[x] = void 0); } i.triggerEvent && o[i.triggerFnName](i.event); } return o; }; } // removeData }; var oz = { eventAliasesOn: function(e) { var r = e; r.addListener = r.listen = r.bind = r.on, r.unlisten = r.unbind = r.off = r.removeListener, r.trigger = r.emit, r.pon = r.promiseOn = function(n, a) { var i = this, o = Array.prototype.slice.call(arguments, 0); return new Mi(function(s, u) { var l = function(h10) { i.off.apply(i, d), s(h10); }, c = o.concat([l]), d = c.concat([]); i.on.apply(i, c); }); }; } }; var et = {}; [Xq, iz, oz].forEach(function(t13) { ze(et, t13); }); var sz = { animate: et.animate(), animation: et.animation(), animated: et.animated(), clearQueue: et.clearQueue(), delay: et.delay(), delayAnimation: et.delayAnimation(), stop: et.stop() }; var Ks = { classes: function(e) { var r = this; if (e === void 0) { var n = []; return r[0]._private.classes.forEach(function(v) { return n.push(v); }), n; } else lt(e) || (e = (e || "").match(/\S+/g) || []); for (var a = [], i = new Fi(e), o = 0; o < r.length; o++) { for (var s = r[o], u = s._private, l = u.classes, c = false, d = 0; d < e.length; d++) { var f = e[d], h10 = l.has(f); if (!h10) { c = true; break; } } c || (c = l.size !== e.length), c && (u.classes = i, a.push(s)); } return a.length > 0 && this.spawn(a).updateStyle().emit("class"), r; }, addClass: function(e) { return this.toggleClass(e, true); }, hasClass: function(e) { var r = this[0]; return r != null && r._private.classes.has(e); }, toggleClass: function(e, r) { lt(e) || (e = e.match(/\S+/g) || []); for (var n = this, a = r === void 0, i = [], o = 0, s = n.length; o < s; o++) for (var u = n[o], l = u._private.classes, c = false, d = 0; d < e.length; d++) { var f = e[d], h10 = l.has(f), v = false; r || a && !h10 ? (l.add(f), v = true) : (!r || a && h10) && (l.delete(f), v = true), !c && v && (i.push(u), c = true); } return i.length > 0 && this.spawn(i).updateStyle().emit("class"), n; }, removeClass: function(e) { return this.toggleClass(e, false); }, flashClass: function(e, r) { var n = this; if (r == null) r = 250; else if (r === 0) return n; return n.addClass(e), setTimeout(function() { n.removeClass(e); }, r), n; } }; Ks.className = Ks.classNames = Ks.classes; var Ze = { 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: Mt, // 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+" }; Ze.variable = "(?:[\\w-.]|(?:\\\\" + Ze.metaChar + "))+"; Ze.className = "(?:[\\w-]|(?:\\\\" + Ze.metaChar + "))+"; Ze.value = Ze.string + "|" + Ze.number; Ze.id = Ze.variable; (function() { var t13, e, r; for (t13 = Ze.comparatorOp.split("|"), r = 0; r < t13.length; r++) e = t13[r], Ze.comparatorOp += "|@" + e; for (t13 = Ze.comparatorOp.split("|"), r = 0; r < t13.length; r++) e = t13[r], !(e.indexOf("!") >= 0) && e !== "=" && (Ze.comparatorOp += "|\\!" + e); })(); var it = function() { return { checks: [] }; }; var Te = { /** E.g. node */ GROUP: 0, /** A collection of elements */ COLLECTION: 1, /** A filter(ele) function */ FILTER: 2, /** E.g. [foo > 1] */ DATA_COMPARE: 3, /** E.g. [foo] */ DATA_EXIST: 4, /** E.g. [?foo] */ DATA_BOOL: 5, /** E.g. [[degree > 2]] */ META_COMPARE: 6, /** E.g. :selected */ STATE: 7, /** E.g. #foo */ ID: 8, /** E.g. .foo */ CLASS: 9, /** E.g. #foo <-> #bar */ UNDIRECTED_EDGE: 10, /** E.g. #foo -> #bar */ DIRECTED_EDGE: 11, /** E.g. $#foo -> #bar */ NODE_SOURCE: 12, /** E.g. #foo -> $#bar */ NODE_TARGET: 13, /** E.g. $#foo <-> #bar */ NODE_NEIGHBOR: 14, /** E.g. #foo > #bar */ CHILD: 15, /** E.g. #foo #bar */ DESCENDANT: 16, /** E.g. $#foo > #bar */ PARENT: 17, /** E.g. $#foo #bar */ ANCESTOR: 18, /** E.g. #foo > $bar > #baz */ COMPOUND_SPLIT: 19, /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */ TRUE: 20 }; var Op = [{ selector: ":selected", matches: function(e) { return e.selected(); } }, { selector: ":unselected", matches: function(e) { return !e.selected(); } }, { selector: ":selectable", matches: function(e) { return e.selectable(); } }, { selector: ":unselectable", matches: function(e) { return !e.selectable(); } }, { selector: ":locked", matches: function(e) { return e.locked(); } }, { selector: ":unlocked", matches: function(e) { return !e.locked(); } }, { selector: ":visible", matches: function(e) { return e.visible(); } }, { selector: ":hidden", matches: function(e) { return !e.visible(); } }, { selector: ":transparent", matches: function(e) { return e.transparent(); } }, { selector: ":grabbed", matches: function(e) { return e.grabbed(); } }, { selector: ":free", matches: function(e) { return !e.grabbed(); } }, { selector: ":removed", matches: function(e) { return e.removed(); } }, { selector: ":inside", matches: function(e) { return !e.removed(); } }, { selector: ":grabbable", matches: function(e) { return e.grabbable(); } }, { selector: ":ungrabbable", matches: function(e) { return !e.grabbable(); } }, { selector: ":animated", matches: function(e) { return e.animated(); } }, { selector: ":unanimated", matches: function(e) { return !e.animated(); } }, { selector: ":parent", matches: function(e) { return e.isParent(); } }, { selector: ":childless", matches: function(e) { return e.isChildless(); } }, { selector: ":child", matches: function(e) { return e.isChild(); } }, { selector: ":orphan", matches: function(e) { return e.isOrphan(); } }, { selector: ":nonorphan", matches: function(e) { return e.isChild(); } }, { selector: ":compound", matches: function(e) { return e.isNode() ? e.isParent() : e.source().isParent() || e.target().isParent(); } }, { selector: ":loop", matches: function(e) { return e.isLoop(); } }, { selector: ":simple", matches: function(e) { return e.isSimple(); } }, { selector: ":active", matches: function(e) { return e.active(); } }, { selector: ":inactive", matches: function(e) { return !e.active(); } }, { selector: ":backgrounding", matches: function(e) { return e.backgrounding(); } }, { selector: ":nonbackgrounding", matches: function(e) { return !e.backgrounding(); } }].sort(function(t13, e) { return bB(t13.selector, e.selector); }); var lz = function() { for (var t13 = {}, e, r = 0; r < Op.length; r++) e = Op[r], t13[e.selector] = e.matches; return t13; }(); var uz = function(e, r) { return lz[e](r); }; var cz = "(" + Op.map(function(t13) { return t13.selector; }).join("|") + ")"; var ei = function(e) { return e.replace(new RegExp("\\\\(" + Ze.metaChar + ")", "g"), function(r, n) { return n; }); }; var qn = function(e, r, n) { e[e.length - 1] = n; }; var Ap = [{ name: "group", // just used for identifying when debugging query: true, regex: "(" + Ze.group + ")", populate: function(e, r, n) { var a = Vr(n, 1), i = a[0]; r.checks.push({ type: Te.GROUP, value: i === "*" ? i : i + "s" }); } }, { name: "state", query: true, regex: cz, populate: function(e, r, n) { var a = Vr(n, 1), i = a[0]; r.checks.push({ type: Te.STATE, value: i }); } }, { name: "id", query: true, regex: "\\#(" + Ze.id + ")", populate: function(e, r, n) { var a = Vr(n, 1), i = a[0]; r.checks.push({ type: Te.ID, value: ei(i) }); } }, { name: "className", query: true, regex: "\\.(" + Ze.className + ")", populate: function(e, r, n) { var a = Vr(n, 1), i = a[0]; r.checks.push({ type: Te.CLASS, value: ei(i) }); } }, { name: "dataExists", query: true, regex: "\\[\\s*(" + Ze.variable + ")\\s*\\]", populate: function(e, r, n) { var a = Vr(n, 1), i = a[0]; r.checks.push({ type: Te.DATA_EXIST, field: ei(i) }); } }, { name: "dataCompare", query: true, regex: "\\[\\s*(" + Ze.variable + ")\\s*(" + Ze.comparatorOp + ")\\s*(" + Ze.value + ")\\s*\\]", populate: function(e, r, n) { var a = Vr(n, 3), i = a[0], o = a[1], s = a[2], u = new RegExp("^" + Ze.string + "$").exec(s) != null; u ? s = s.substring(1, s.length - 1) : s = parseFloat(s), r.checks.push({ type: Te.DATA_COMPARE, field: ei(i), operator: o, value: s }); } }, { name: "dataBool", query: true, regex: "\\[\\s*(" + Ze.boolOp + ")\\s*(" + Ze.variable + ")\\s*\\]", populate: function(e, r, n) { var a = Vr(n, 2), i = a[0], o = a[1]; r.checks.push({ type: Te.DATA_BOOL, field: ei(o), operator: i }); } }, { name: "metaCompare", query: true, regex: "\\[\\[\\s*(" + Ze.meta + ")\\s*(" + Ze.comparatorOp + ")\\s*(" + Ze.number + ")\\s*\\]\\]", populate: function(e, r, n) { var a = Vr(n, 3), i = a[0], o = a[1], s = a[2]; r.checks.push({ type: Te.META_COMPARE, field: ei(i), operator: o, value: parseFloat(s) }); } }, { name: "nextQuery", separator: true, regex: Ze.separator, populate: function(e, r) { var n = e.currentSubject, a = e.edgeCount, i = e.compoundCount, o = e[e.length - 1]; n != null && (o.subject = n, e.currentSubject = null), o.edgeCount = a, o.compoundCount = i, e.edgeCount = 0, e.compoundCount = 0; var s = e[e.length++] = it(); return s; } }, { name: "directedEdge", separator: true, regex: Ze.directedEdge, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = r, i = it(); return n.checks.push({ type: Te.DIRECTED_EDGE, source: a, target: i }), qn(e, r, n), e.edgeCount++, i; } else { var o = it(), s = r, u = it(); return o.checks.push({ type: Te.NODE_SOURCE, source: s, target: u }), qn(e, r, o), e.edgeCount++, u; } } }, { name: "undirectedEdge", separator: true, regex: Ze.undirectedEdge, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = r, i = it(); return n.checks.push({ type: Te.UNDIRECTED_EDGE, nodes: [a, i] }), qn(e, r, n), e.edgeCount++, i; } else { var o = it(), s = r, u = it(); return o.checks.push({ type: Te.NODE_NEIGHBOR, node: s, neighbor: u }), qn(e, r, o), u; } } }, { name: "child", separator: true, regex: Ze.child, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = it(), i = e[e.length - 1]; return n.checks.push({ type: Te.CHILD, parent: i, child: a }), qn(e, r, n), e.compoundCount++, a; } else if (e.currentSubject === r) { var o = it(), s = e[e.length - 1], u = it(), l = it(), c = it(), d = it(); return o.checks.push({ type: Te.COMPOUND_SPLIT, left: s, right: u, subject: l }), l.checks = r.checks, r.checks = [{ type: Te.TRUE }], d.checks.push({ type: Te.TRUE }), u.checks.push({ type: Te.PARENT, // type is swapped on right side queries parent: d, child: c // empty for now }), qn(e, s, o), e.currentSubject = l, e.compoundCount++, c; } else { var f = it(), h10 = it(), v = [{ type: Te.PARENT, parent: f, child: h10 }]; return f.checks = r.checks, r.checks = v, e.compoundCount++, h10; } } }, { name: "descendant", separator: true, regex: Ze.descendant, populate: function(e, r) { if (e.currentSubject == null) { var n = it(), a = it(), i = e[e.length - 1]; return n.checks.push({ type: Te.DESCENDANT, ancestor: i, descendant: a }), qn(e, r, n), e.compoundCount++, a; } else if (e.currentSubject === r) { var o = it(), s = e[e.length - 1], u = it(), l = it(), c = it(), d = it(); return o.checks.push({ type: Te.COMPOUND_SPLIT, left: s, right: u, subject: l }), l.checks = r.checks, r.checks = [{ type: Te.TRUE }], d.checks.push({ type: Te.TRUE }), u.checks.push({ type: Te.ANCESTOR, // type is swapped on right side queries ancestor: d, descendant: c // empty for now }), qn(e, s, o), e.currentSubject = l, e.compoundCount++, c; } else { var f = it(), h10 = it(), v = [{ type: Te.ANCESTOR, ancestor: f, descendant: h10 }]; return f.checks = r.checks, r.checks = v, e.compoundCount++, h10; } } }, { name: "subject", modifier: true, regex: Ze.subject, populate: function(e, r) { if (e.currentSubject != null && e.currentSubject !== r) return tt("Redefinition of subject in selector `" + e.toString() + "`"), false; e.currentSubject = r; var n = e[e.length - 1], a = n.checks[0], i = a == null ? null : a.type; i === Te.DIRECTED_EDGE ? a.type = Te.NODE_TARGET : i === Te.UNDIRECTED_EDGE && (a.type = Te.NODE_NEIGHBOR, a.node = a.nodes[1], a.neighbor = a.nodes[0], a.nodes = null); } }]; Ap.forEach(function(t13) { return t13.regexObj = new RegExp("^" + t13.regex); }); var dz = function(e) { for (var r, n, a, i = 0; i < Ap.length; i++) { var o = Ap[i], s = o.name, u = e.match(o.regexObj); if (u != null) { n = u, r = o, a = s; var l = u[0]; e = e.substring(l.length); break; } } return { expr: r, match: n, name: a, remaining: e }; }; var fz = function(e) { var r = e.match(/^\s+/); if (r) { var n = r[0]; e = e.substring(n.length); } return e; }; var vz = function(e) { var r = this, n = r.inputText = e, a = r[0] = it(); for (r.length = 1, n = fz(n); ; ) { var i = dz(n); if (i.expr == null) return tt("The selector `" + e + "`is invalid"), false; var o = i.match.slice(1), s = i.expr.populate(r, a, o); if (s === false) return false; if (s != null && (a = s), n = i.remaining, n.match(/^\s*$/)) break; } var u = r[r.length - 1]; r.currentSubject != null && (u.subject = r.currentSubject), u.edgeCount = r.edgeCount, u.compoundCount = r.compoundCount; for (var l = 0; l < r.length; l++) { var c = r[l]; if (c.compoundCount > 0 && c.edgeCount > 0) return tt("The selector `" + e + "` is invalid because it uses both a compound selector and an edge selector"), false; if (c.edgeCount > 1) return tt("The selector `" + e + "` is invalid because it uses multiple edge selectors"), false; c.edgeCount === 1 && tt("The selector `" + e + "` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes."); } return true; }; var hz = function() { if (this.toStringCache != null) return this.toStringCache; for (var e = function(c) { return c ?? ""; }, r = function(c) { return Me(c) ? '"' + c + '"' : e(c); }, n = function(c) { return " " + c + " "; }, a = function(c, d) { var f = c.type, h10 = c.value; switch (f) { case Te.GROUP: { var v = e(h10); return v.substring(0, v.length - 1); } case Te.DATA_COMPARE: { var p = c.field, g = c.operator; return "[" + p + n(e(g)) + r(h10) + "]"; } case Te.DATA_BOOL: { var y = c.operator, m = c.field; return "[" + e(y) + m + "]"; } case Te.DATA_EXIST: { var b = c.field; return "[" + b + "]"; } case Te.META_COMPARE: { var w = c.operator, x = c.field; return "[[" + x + n(e(w)) + r(h10) + "]]"; } case Te.STATE: return h10; case Te.ID: return "#" + h10; case Te.CLASS: return "." + h10; case Te.PARENT: case Te.CHILD: return i(c.parent, d) + n(">") + i(c.child, d); case Te.ANCESTOR: case Te.DESCENDANT: return i(c.ancestor, d) + " " + i(c.descendant, d); case Te.COMPOUND_SPLIT: { var E = i(c.left, d), C = i(c.subject, d), k = i(c.right, d); return E + (E.length > 0 ? " " : "") + C + k; } case Te.TRUE: return ""; } }, i = function(c, d) { return c.checks.reduce(function(f, h10, v) { return f + (d === c && v === 0 ? "$" : "") + a(h10, d); }, ""); }, o = "", s = 0; s < this.length; s++) { var u = this[s]; o += i(u, u.subject), this.length > 1 && s < this.length - 1 && (o += ", "); } return this.toStringCache = o, o; }; var pz = { parse: vz, toString: hz }; var BS = function(e, r, n) { var a, i = Me(e), o = Ce(e), s = Me(n), u, l, c = false, d = false, f = false; switch (r.indexOf("!") >= 0 && (r = r.replace("!", ""), d = true), r.indexOf("@") >= 0 && (r = r.replace("@", ""), c = true), (i || s || c) && (u = !i && !o ? "" : "" + e, l = "" + n), c && (e = u = u.toLowerCase(), n = l = l.toLowerCase()), r) { case "*=": a = u.indexOf(l) >= 0; break; case "$=": a = u.indexOf(l, u.length - l.length) >= 0; break; case "^=": a = u.indexOf(l) === 0; break; case "=": a = e === n; break; case ">": f = true, a = e > n; break; case ">=": f = true, a = e >= n; break; case "<": f = true, a = e < n; break; case "<=": f = true, a = e <= n; break; default: a = false; break; } return d && (e != null || !f) && (a = !a), a; }; var gz = function(e, r) { switch (r) { case "?": return !!e; case "!": return !e; case "^": return e === void 0; } }; var yz = function(e) { return e !== void 0; }; var $g = function(e, r) { return e.data(r); }; var mz = function(e, r) { return e[r](); }; var wt = []; var ht = function(e, r) { return e.checks.every(function(n) { return wt[n.type](n, r); }); }; wt[Te.GROUP] = function(t13, e) { var r = t13.value; return r === "*" || r === e.group(); }; wt[Te.STATE] = function(t13, e) { var r = t13.value; return uz(r, e); }; wt[Te.ID] = function(t13, e) { var r = t13.value; return e.id() === r; }; wt[Te.CLASS] = function(t13, e) { var r = t13.value; return e.hasClass(r); }; wt[Te.META_COMPARE] = function(t13, e) { var r = t13.field, n = t13.operator, a = t13.value; return BS(mz(e, r), n, a); }; wt[Te.DATA_COMPARE] = function(t13, e) { var r = t13.field, n = t13.operator, a = t13.value; return BS($g(e, r), n, a); }; wt[Te.DATA_BOOL] = function(t13, e) { var r = t13.field, n = t13.operator; return gz($g(e, r), n); }; wt[Te.DATA_EXIST] = function(t13, e) { var r = t13.field; return t13.operator, yz($g(e, r)); }; wt[Te.UNDIRECTED_EDGE] = function(t13, e) { var r = t13.nodes[0], n = t13.nodes[1], a = e.source(), i = e.target(); return ht(r, a) && ht(n, i) || ht(n, a) && ht(r, i); }; wt[Te.NODE_NEIGHBOR] = function(t13, e) { return ht(t13.node, e) && e.neighborhood().some(function(r) { return r.isNode() && ht(t13.neighbor, r); }); }; wt[Te.DIRECTED_EDGE] = function(t13, e) { return ht(t13.source, e.source()) && ht(t13.target, e.target()); }; wt[Te.NODE_SOURCE] = function(t13, e) { return ht(t13.source, e) && e.outgoers().some(function(r) { return r.isNode() && ht(t13.target, r); }); }; wt[Te.NODE_TARGET] = function(t13, e) { return ht(t13.target, e) && e.incomers().some(function(r) { return r.isNode() && ht(t13.source, r); }); }; wt[Te.CHILD] = function(t13, e) { return ht(t13.child, e) && ht(t13.parent, e.parent()); }; wt[Te.PARENT] = function(t13, e) { return ht(t13.parent, e) && e.children().some(function(r) { return ht(t13.child, r); }); }; wt[Te.DESCENDANT] = function(t13, e) { return ht(t13.descendant, e) && e.ancestors().some(function(r) { return ht(t13.ancestor, r); }); }; wt[Te.ANCESTOR] = function(t13, e) { return ht(t13.ancestor, e) && e.descendants().some(function(r) { return ht(t13.descendant, r); }); }; wt[Te.COMPOUND_SPLIT] = function(t13, e) { return ht(t13.subject, e) && ht(t13.left, e) && ht(t13.right, e); }; wt[Te.TRUE] = function() { return true; }; wt[Te.COLLECTION] = function(t13, e) { var r = t13.value; return r.has(e); }; wt[Te.FILTER] = function(t13, e) { var r = t13.value; return r(e); }; var bz = function(e) { var r = this; if (r.length === 1 && r[0].checks.length === 1 && r[0].checks[0].type === Te.ID) return e.getElementById(r[0].checks[0].value).collection(); var n = function(i) { for (var o = 0; o < r.length; o++) { var s = r[o]; if (ht(s, i)) return true; } return false; }; return r.text() == null && (n = function() { return true; }), e.filter(n); }; var wz = function(e) { for (var r = this, n = 0; n < r.length; n++) { var a = r[n]; if (ht(a, e)) return true; } return false; }; var Cz = { matches: wz, filter: bz }; var ra = function(e) { this.inputText = e, this.currentSubject = null, this.compoundCount = 0, this.edgeCount = 0, this.length = 0, e == null || Me(e) && e.match(/^\s*$/) || (xr(e) ? this.addQuery({ checks: [{ type: Te.COLLECTION, value: e.collection() }] }) : yt(e) ? this.addQuery({ checks: [{ type: Te.FILTER, value: e }] }) : Me(e) ? this.parse(e) || (this.invalid = true) : bt("A selector must be created from a string; found ")); }; var na = ra.prototype; [pz, Cz].forEach(function(t13) { return ze(na, t13); }); na.text = function() { return this.inputText; }; na.size = function() { return this.length; }; na.eq = function(t13) { return this[t13]; }; na.sameText = function(t13) { return !this.invalid && !t13.invalid && this.text() === t13.text(); }; na.addQuery = function(t13) { this[this.length++] = t13; }; na.selector = na.toString; var Zn = { allAre: function(e) { var r = new ra(e); return this.every(function(n) { return r.matches(n); }); }, is: function(e) { var r = new ra(e); return this.some(function(n) { return r.matches(n); }); }, some: function(e, r) { for (var n = 0; n < this.length; n++) { var a = r ? e.apply(r, [this[n], n, this]) : e(this[n], n, this); if (a) return true; } return false; }, every: function(e, r) { for (var n = 0; n < this.length; n++) { var a = r ? e.apply(r, [this[n], n, this]) : e(this[n], n, this); if (!a) return false; } return true; }, same: function(e) { if (this === e) return true; e = this.cy().collection(e); var r = this.length, n = e.length; return r !== n ? false : r === 1 ? this[0] === e[0] : this.every(function(a) { return e.hasElementWithId(a.id()); }); }, anySame: function(e) { return e = this.cy().collection(e), this.some(function(r) { return e.hasElementWithId(r.id()); }); }, allAreNeighbors: function(e) { e = this.cy().collection(e); var r = this.neighborhood(); return e.every(function(n) { return r.hasElementWithId(n.id()); }); }, contains: function(e) { e = this.cy().collection(e); var r = this; return e.every(function(n) { return r.hasElementWithId(n.id()); }); } }; Zn.allAreNeighbours = Zn.allAreNeighbors; Zn.has = Zn.contains; Zn.equal = Zn.equals = Zn.same; var Pr = function(e, r) { return function(a, i, o, s) { var u = a, l = this, c; if (u == null ? c = "" : xr(u) && u.length === 1 && (c = u.id()), l.length === 1 && c) { var d = l[0]._private, f = d.traversalCache = d.traversalCache || {}, h10 = f[r] = f[r] || [], v = Pa(c), p = h10[v]; return p || (h10[v] = e.call(l, a, i, o, s)); } else return e.call(l, a, i, o, s); }; }; var Oi = { parent: function(e) { var r = []; if (this.length === 1) { var n = this[0]._private.parent; if (n) return n; } for (var a = 0; a < this.length; a++) { var i = this[a], o = i._private.parent; o && r.push(o); } return this.spawn(r, true).filter(e); }, parents: function(e) { for (var r = [], n = this.parent(); n.nonempty(); ) { for (var a = 0; a < n.length; a++) { var i = n[a]; r.push(i); } n = n.parent(); } return this.spawn(r, true).filter(e); }, commonAncestors: function(e) { for (var r, n = 0; n < this.length; n++) { var a = this[n], i = a.parents(); r = r || i, r = r.intersect(i); } return r.filter(e); }, orphans: function(e) { return this.stdFilter(function(r) { return r.isOrphan(); }).filter(e); }, nonorphans: function(e) { return this.stdFilter(function(r) { return r.isChild(); }).filter(e); }, children: Pr(function(t13) { for (var e = [], r = 0; r < this.length; r++) for (var n = this[r], a = n._private.children, i = 0; i < a.length; i++) e.push(a[i]); return this.spawn(e, true).filter(t13); }, "children"), siblings: function(e) { return this.parent().children().not(this).filter(e); }, isParent: function() { var e = this[0]; if (e) return e.isNode() && e._private.children.length !== 0; }, isChildless: function() { var e = this[0]; if (e) return e.isNode() && e._private.children.length === 0; }, isChild: function() { var e = this[0]; if (e) return e.isNode() && e._private.parent != null; }, isOrphan: function() { var e = this[0]; if (e) return e.isNode() && e._private.parent == null; }, descendants: function(e) { var r = []; function n(a) { for (var i = 0; i < a.length; i++) { var o = a[i]; r.push(o), o.children().nonempty() && n(o.children()); } } return n(this.children()), this.spawn(r, true).filter(e); } }; function qg(t13, e, r, n) { for (var a = [], i = new Fi(), o = t13.cy(), s = o.hasCompoundNodes(), u = 0; u < t13.length; u++) { var l = t13[u]; r ? a.push(l) : s && n(a, i, l); } for (; a.length > 0; ) { var c = a.shift(); e(c), i.add(c.id()), s && n(a, i, c); } return t13; } function $S(t13, e, r) { if (r.isParent()) for (var n = r._private.children, a = 0; a < n.length; a++) { var i = n[a]; e.has(i.id()) || t13.push(i); } } Oi.forEachDown = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return qg(this, t13, e, $S); }; function qS(t13, e, r) { if (r.isChild()) { var n = r._private.parent; e.has(n.id()) || t13.push(n); } } Oi.forEachUp = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return qg(this, t13, e, qS); }; function xz(t13, e, r) { qS(t13, e, r), $S(t13, e, r); } Oi.forEachUpAndDown = function(t13) { var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; return qg(this, t13, e, xz); }; Oi.ancestors = Oi.parents; var Bo; var zS; Bo = zS = { data: et.data({ field: "data", bindingEvent: "data", allowBinding: true, allowSetting: true, settingEvent: "data", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, immutableKeys: { id: true, source: true, target: true, parent: true }, updateStyle: true }), removeData: et.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: true, immutableKeys: { id: true, source: true, target: true, parent: true }, updateStyle: true }), scratch: et.data({ field: "scratch", bindingEvent: "scratch", allowBinding: true, allowSetting: true, settingEvent: "scratch", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeScratch: et.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }), rscratch: et.data({ field: "rscratch", allowBinding: false, allowSetting: true, settingTriggersEvent: false, allowGetting: true }), removeRscratch: et.removeData({ field: "rscratch", triggerEvent: false }), id: function() { var e = this[0]; if (e) return e._private.data.id; } }; Bo.attr = Bo.data; Bo.removeAttr = Bo.removeData; var Ez = zS; var Vl = {}; function Mu(t13) { return function(e) { var r = this; if (e === void 0 && (e = true), r.length !== 0) if (r.isNode() && !r.removed()) { for (var n = 0, a = r[0], i = a._private.edges, o = 0; o < i.length; o++) { var s = i[o]; !e && s.isLoop() || (n += t13(a, s)); } return n; } else return; }; } ze(Vl, { degree: Mu(function(t13, e) { return e.source().same(e.target()) ? 2 : 1; }), indegree: Mu(function(t13, e) { return e.target().same(t13) ? 1 : 0; }), outdegree: Mu(function(t13, e) { return e.source().same(t13) ? 1 : 0; }) }); function ti(t13, e) { return function(r) { for (var n, a = this.nodes(), i = 0; i < a.length; i++) { var o = a[i], s = o[t13](r); s !== void 0 && (n === void 0 || e(s, n)) && (n = s); } return n; }; } ze(Vl, { minDegree: ti("degree", function(t13, e) { return t13 < e; }), maxDegree: ti("degree", function(t13, e) { return t13 > e; }), minIndegree: ti("indegree", function(t13, e) { return t13 < e; }), maxIndegree: ti("indegree", function(t13, e) { return t13 > e; }), minOutdegree: ti("outdegree", function(t13, e) { return t13 < e; }), maxOutdegree: ti("outdegree", function(t13, e) { return t13 > e; }) }); ze(Vl, { totalDegree: function(e) { for (var r = 0, n = this.nodes(), a = 0; a < n.length; a++) r += n[a].degree(e); return r; } }); var Wr; var VS; var HS = function(e, r, n) { for (var a = 0; a < e.length; a++) { var i = e[a]; if (!i.locked()) { var o = i._private.position, s = { x: r.x != null ? r.x - o.x : 0, y: r.y != null ? r.y - o.y : 0 }; i.isParent() && !(s.x === 0 && s.y === 0) && i.children().shift(s, n), i.dirtyBoundingBoxCache(); } } }; var g0 = { field: "position", bindingEvent: "position", allowBinding: true, allowSetting: true, settingEvent: "position", settingTriggersEvent: true, triggerFnName: "emitAndNotify", allowGetting: true, validKeys: ["x", "y"], beforeGet: function(e) { e.updateCompoundBounds(); }, beforeSet: function(e, r) { HS(e, r, false); }, onSet: function(e) { e.dirtyCompoundBoundsCache(); }, canSet: function(e) { return !e.locked(); } }; Wr = VS = { position: et.data(g0), // position but no notification to renderer silentPosition: et.data(ze({}, g0, { allowBinding: false, allowSetting: true, settingTriggersEvent: false, allowGetting: false, beforeSet: function(e, r) { HS(e, r, true); }, onSet: function(e) { e.dirtyCompoundBoundsCache(); } })), positions: function(e, r) { if (Xe(e)) r ? this.silentPosition(e) : this.position(e); else if (yt(e)) { var n = e, a = this.cy(); a.startBatch(); for (var i = 0; i < this.length; i++) { var o = this[i], s = void 0; (s = n(o, i)) && (r ? o.silentPosition(s) : o.position(s)); } a.endBatch(); } return this; }, silentPositions: function(e) { return this.positions(e, true); }, shift: function(e, r, n) { var a; if (Xe(e) ? (a = { x: Ce(e.x) ? e.x : 0, y: Ce(e.y) ? e.y : 0 }, n = r) : Me(e) && Ce(r) && (a = { x: 0, y: 0 }, a[e] = r), a != null) { var i = this.cy(); i.startBatch(); for (var o = 0; o < this.length; o++) { var s = this[o]; if (!(i.hasCompoundNodes() && s.isChild() && s.ancestors().anySame(this))) { var u = s.position(), l = { x: u.x + a.x, y: u.y + a.y }; n ? s.silentPosition(l) : s.position(l); } } i.endBatch(); } return this; }, silentShift: function(e, r) { return Xe(e) ? this.shift(e, true) : Me(e) && Ce(r) && this.shift(e, r, true), this; }, // get/set the rendered (i.e. on screen) positon of the element renderedPosition: function(e, r) { var n = this[0], a = this.cy(), i = a.zoom(), o = a.pan(), s = Xe(e) ? e : void 0, u = s !== void 0 || r !== void 0 && Me(e); if (n && n.isNode()) if (u) for (var l = 0; l < this.length; l++) { var c = this[l]; r !== void 0 ? c.position(e, (r - o[e]) / i) : s !== void 0 && c.position(pS(s, i, o)); } else { var d = n.position(); return s = Nl(d, i, o), e === void 0 ? s : s[e]; } else if (!u) return; return this; }, // get/set the position relative to the parent relativePosition: function(e, r) { var n = this[0], a = this.cy(), i = Xe(e) ? e : void 0, o = i !== void 0 || r !== void 0 && Me(e), s = a.hasCompoundNodes(); if (n && n.isNode()) if (o) for (var u = 0; u < this.length; u++) { var l = this[u], c = s ? l.parent() : null, d = c && c.length > 0, f = d; d && (c = c[0]); var h10 = f ? c.position() : { x: 0, y: 0 }; r !== void 0 ? l.position(e, r + h10[e]) : i !== void 0 && l.position({ x: i.x + h10.x, y: i.y + h10.y }); } else { var v = n.position(), p = s ? n.parent() : null, g = p && p.length > 0, y = g; g && (p = p[0]); var m = y ? p.position() : { x: 0, y: 0 }; return i = { x: v.x - m.x, y: v.y - m.y }, e === void 0 ? i : i[e]; } else if (!o) return; return this; } }; Wr.modelPosition = Wr.point = Wr.position; Wr.modelPositions = Wr.points = Wr.positions; Wr.renderedPoint = Wr.renderedPosition; Wr.relativePoint = Wr.relativePosition; var Sz = VS; var gi; var la; gi = la = {}; la.renderedBoundingBox = function(t13) { var e = this.boundingBox(t13), r = this.cy(), n = r.zoom(), a = r.pan(), i = e.x1 * n + a.x, o = e.x2 * n + a.x, s = e.y1 * n + a.y, u = e.y2 * n + a.y; return { x1: i, x2: o, y1: s, y2: u, w: o - i, h: u - s }; }; la.dirtyCompoundBoundsCache = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, e = this.cy(); return !e.styleEnabled() || !e.hasCompoundNodes() ? this : (this.forEachUp(function(r) { if (r.isParent()) { var n = r._private; n.compoundBoundsClean = false, n.bbCache = null, t13 || r.emitAndNotify("bounds"); } }), this); }; la.updateCompoundBounds = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, e = this.cy(); if (!e.styleEnabled() || !e.hasCompoundNodes()) return this; if (!t13 && e.batching()) return this; function r(o) { if (!o.isParent()) return; var s = o._private, u = o.children(), l = o.pstyle("compound-sizing-wrt-labels").value === "include", c = { width: { val: o.pstyle("min-width").pfValue, left: o.pstyle("min-width-bias-left"), right: o.pstyle("min-width-bias-right") }, height: { val: o.pstyle("min-height").pfValue, top: o.pstyle("min-height-bias-top"), bottom: o.pstyle("min-height-bias-bottom") } }, d = u.boundingBox({ includeLabels: l, includeOverlays: false, // updating the compound bounds happens outside of the regular // cache cycle (i.e. before fired events) useCache: false }), f = s.position; (d.w === 0 || d.h === 0) && (d = { w: o.pstyle("width").pfValue, h: o.pstyle("height").pfValue }, d.x1 = f.x - d.w / 2, d.x2 = f.x + d.w / 2, d.y1 = f.y - d.h / 2, d.y2 = f.y + d.h / 2); function h10(S, _, T) { var O = 0, D = 0, A = _ + T; return S > 0 && A > 0 && (O = _ / A * S, D = T / A * S), { biasDiff: O, biasComplementDiff: D }; } function v(S, _, T, O) { if (T.units === "%") switch (O) { case "width": return S > 0 ? T.pfValue * S : 0; case "height": return _ > 0 ? T.pfValue * _ : 0; case "average": return S > 0 && _ > 0 ? T.pfValue * (S + _) / 2 : 0; case "min": return S > 0 && _ > 0 ? S > _ ? T.pfValue * _ : T.pfValue * S : 0; case "max": return S > 0 && _ > 0 ? S > _ ? T.pfValue * S : T.pfValue * _ : 0; default: return 0; } else return T.units === "px" ? T.pfValue : 0; } var p = c.width.left.value; c.width.left.units === "px" && c.width.val > 0 && (p = p * 100 / c.width.val); var g = c.width.right.value; c.width.right.units === "px" && c.width.val > 0 && (g = g * 100 / c.width.val); var y = c.height.top.value; c.height.top.units === "px" && c.height.val > 0 && (y = y * 100 / c.height.val); var m = c.height.bottom.value; c.height.bottom.units === "px" && c.height.val > 0 && (m = m * 100 / c.height.val); var b = h10(c.width.val - d.w, p, g), w = b.biasDiff, x = b.biasComplementDiff, E = h10(c.height.val - d.h, y, m), C = E.biasDiff, k = E.biasComplementDiff; s.autoPadding = v(d.w, d.h, o.pstyle("padding"), o.pstyle("padding-relative-to").value), s.autoWidth = Math.max(d.w, c.width.val), f.x = (-w + d.x1 + d.x2 + x) / 2, s.autoHeight = Math.max(d.h, c.height.val), f.y = (-C + d.y1 + d.y2 + k) / 2; } for (var n = 0; n < this.length; n++) { var a = this[n], i = a._private; (!i.compoundBoundsClean || t13) && (r(a), e.batching() || (i.compoundBoundsClean = true)); } return this; }; var Or = function(e) { return e === 1 / 0 || e === -1 / 0 ? 0 : e; }; var Hr = function(e, r, n, a, i) { a - r === 0 || i - n === 0 || r == null || n == null || a == null || i == null || (e.x1 = r < e.x1 ? r : e.x1, e.x2 = a > e.x2 ? a : e.x2, e.y1 = n < e.y1 ? n : e.y1, e.y2 = i > e.y2 ? i : e.y2, e.w = e.x2 - e.x1, e.h = e.y2 - e.y1); }; var ga = function(e, r) { return r == null ? e : Hr(e, r.x1, r.y1, r.x2, r.y2); }; var no = function(e, r, n) { return Kr(e, r, n); }; var Ps = function(e, r, n) { if (!r.cy().headless()) { var a = r._private, i = a.rstyle, o = i.arrowWidth / 2, s = r.pstyle(n + "-arrow-shape").value, u, l; if (s !== "none") { n === "source" ? (u = i.srcX, l = i.srcY) : n === "target" ? (u = i.tgtX, l = i.tgtY) : (u = i.midX, l = i.midY); var c = a.arrowBounds = a.arrowBounds || {}, d = c[n] = c[n] || {}; d.x1 = u - o, d.y1 = l - o, d.x2 = u + o, d.y2 = l + o, d.w = d.x2 - d.x1, d.h = d.y2 - d.y1, Vs(d, 1), Hr(e, d.x1, d.y1, d.x2, d.y2); } } }; var Nu = function(e, r, n) { if (!r.cy().headless()) { var a; n ? a = n + "-" : a = ""; var i = r._private, o = i.rstyle, s = r.pstyle(a + "label").strValue; if (s) { var u = r.pstyle("text-halign"), l = r.pstyle("text-valign"), c = no(o, "labelWidth", n), d = no(o, "labelHeight", n), f = no(o, "labelX", n), h10 = no(o, "labelY", n), v = r.pstyle(a + "text-margin-x").pfValue, p = r.pstyle(a + "text-margin-y").pfValue, g = r.isEdge(), y = r.pstyle(a + "text-rotation"), m = r.pstyle("text-outline-width").pfValue, b = r.pstyle("text-border-width").pfValue, w = b / 2, x = r.pstyle("text-background-padding").pfValue, E = 2, C = d, k = c, S = k / 2, _ = C / 2, T, O, D, A; if (g) T = f - S, O = f + S, D = h10 - _, A = h10 + _; else { switch (u.value) { case "left": T = f - k, O = f; break; case "center": T = f - S, O = f + S; break; case "right": T = f, O = f + k; break; } switch (l.value) { case "top": D = h10 - C, A = h10; break; case "center": D = h10 - _, A = h10 + _; break; case "bottom": D = h10, A = h10 + C; break; } } T += v - Math.max(m, w) - x - E, O += v + Math.max(m, w) + x + E, D += p - Math.max(m, w) - x - E, A += p + Math.max(m, w) + x + E; var F = n || "main", R = i.labelBounds, M = R[F] = R[F] || {}; M.x1 = T, M.y1 = D, M.x2 = O, M.y2 = A, M.w = O - T, M.h = A - D; var L = g && y.strValue === "autorotate", V = y.pfValue != null && y.pfValue !== 0; if (L || V) { var Y = L ? no(i.rstyle, "labelAngle", n) : y.pfValue, H = Math.cos(Y), K = Math.sin(Y), ne = (T + O) / 2, B = (D + A) / 2; if (!g) { switch (u.value) { case "left": ne = O; break; case "right": ne = T; break; } switch (l.value) { case "top": B = A; break; case "bottom": B = D; break; } } var $ = function(we, fe) { return we = we - ne, fe = fe - B, { x: we * H - fe * K + ne, y: we * K + fe * H + B }; }, z = $(T, D), W = $(T, A), Z = $(O, D), N = $(O, A); T = Math.min(z.x, W.x, Z.x, N.x), O = Math.max(z.x, W.x, Z.x, N.x), D = Math.min(z.y, W.y, Z.y, N.y), A = Math.max(z.y, W.y, Z.y, N.y); } var X = F + "Rot", Q = R[X] = R[X] || {}; Q.x1 = T, Q.y1 = D, Q.x2 = O, Q.y2 = A, Q.w = O - T, Q.h = A - D, Hr(e, T, D, O, A), Hr(i.labelBounds.all, T, D, O, A); } return e; } }; var kz = function(e, r) { if (!r.cy().headless()) { var n = r.pstyle("outline-opacity").value, a = r.pstyle("outline-width").value; if (n > 0 && a > 0) { var i = r.pstyle("outline-offset").value, o = r.pstyle("shape").value, s = a + i, u = (e.w + s * 2) / e.w, l = (e.h + s * 2) / e.h, c = 0, d = 0; ["diamond", "pentagon", "round-triangle"].includes(o) ? (u = (e.w + s * 2.4) / e.w, d = -s / 3.6) : ["concave-hexagon", "rhomboid", "right-rhomboid"].includes(o) ? u = (e.w + s * 2.4) / e.w : o === "star" ? (u = (e.w + s * 2.8) / e.w, l = (e.h + s * 2.6) / e.h, d = -s / 3.8) : o === "triangle" ? (u = (e.w + s * 2.8) / e.w, l = (e.h + s * 2.4) / e.h, d = -s / 1.4) : o === "vee" && (u = (e.w + s * 4.4) / e.w, l = (e.h + s * 3.8) / e.h, d = -s * 0.5); var f = e.h * l - e.h, h10 = e.w * u - e.w; if (Hs(e, [Math.ceil(f / 2), Math.ceil(h10 / 2)]), c != 0 || d !== 0) { var v = U$(e, c, d); yS(e, v); } } } }; var _z = function(e, r) { var n = e._private.cy, a = n.styleEnabled(), i = n.headless(), o = br(), s = e._private, u = e.isNode(), l = e.isEdge(), c, d, f, h10, v, p, g = s.rstyle, y = u && a ? e.pstyle("bounds-expansion").pfValue : [0], m = function(be) { return be.pstyle("display").value !== "none"; }, b = !a || m(e) && (!l || m(e.source()) && m(e.target())); if (b) { var w = 0, x = 0; a && r.includeOverlays && (w = e.pstyle("overlay-opacity").value, w !== 0 && (x = e.pstyle("overlay-padding").value)); var E = 0, C = 0; a && r.includeUnderlays && (E = e.pstyle("underlay-opacity").value, E !== 0 && (C = e.pstyle("underlay-padding").value)); var k = Math.max(x, C), S = 0, _ = 0; if (a && (S = e.pstyle("width").pfValue, _ = S / 2), u && r.includeNodes) { var T = e.position(); v = T.x, p = T.y; var O = e.outerWidth(), D = O / 2, A = e.outerHeight(), F = A / 2; c = v - D, d = v + D, f = p - F, h10 = p + F, Hr(o, c, f, d, h10), a && r.includeOutlines && kz(o, e); } else if (l && r.includeEdges) if (a && !i) { var R = e.pstyle("curve-style").strValue; if (c = Math.min(g.srcX, g.midX, g.tgtX), d = Math.max(g.srcX, g.midX, g.tgtX), f = Math.min(g.srcY, g.midY, g.tgtY), h10 = Math.max(g.srcY, g.midY, g.tgtY), c -= _, d += _, f -= _, h10 += _, Hr(o, c, f, d, h10), R === "haystack") { var M = g.haystackPts; if (M && M.length === 2) { if (c = M[0].x, f = M[0].y, d = M[1].x, h10 = M[1].y, c > d) { var L = c; c = d, d = L; } if (f > h10) { var V = f; f = h10, h10 = V; } Hr(o, c - _, f - _, d + _, h10 + _); } } else if (R === "bezier" || R === "unbundled-bezier" || R.endsWith("segments") || R.endsWith("taxi")) { var Y; switch (R) { case "bezier": case "unbundled-bezier": Y = g.bezierPts; break; case "segments": case "taxi": case "round-segments": case "round-taxi": Y = g.linePts; break; } if (Y != null) for (var H = 0; H < Y.length; H++) { var K = Y[H]; c = K.x - _, d = K.x + _, f = K.y - _, h10 = K.y + _, Hr(o, c, f, d, h10); } } } else { var ne = e.source(), B = ne.position(), $ = e.target(), z = $.position(); if (c = B.x, d = z.x, f = B.y, h10 = z.y, c > d) { var W = c; c = d, d = W; } if (f > h10) { var Z = f; f = h10, h10 = Z; } c -= _, d += _, f -= _, h10 += _, Hr(o, c, f, d, h10); } if (a && r.includeEdges && l && (Ps(o, e, "mid-source"), Ps(o, e, "mid-target"), Ps(o, e, "source"), Ps(o, e, "target")), a) { var N = e.pstyle("ghost").value === "yes"; if (N) { var X = e.pstyle("ghost-offset-x").pfValue, Q = e.pstyle("ghost-offset-y").pfValue; Hr(o, o.x1 + X, o.y1 + Q, o.x2 + X, o.y2 + Q); } } var ge = s.bodyBounds = s.bodyBounds || {}; Ym(ge, o), Hs(ge, y), Vs(ge, 1), a && (c = o.x1, d = o.x2, f = o.y1, h10 = o.y2, Hr(o, c - k, f - k, d + k, h10 + k)); var we = s.overlayBounds = s.overlayBounds || {}; Ym(we, o), Hs(we, y), Vs(we, 1); var fe = s.labelBounds = s.labelBounds || {}; fe.all != null ? G$(fe.all) : fe.all = br(), a && r.includeLabels && (r.includeMainLabels && Nu(o, e, null), l && (r.includeSourceLabels && Nu(o, e, "source"), r.includeTargetLabels && Nu(o, e, "target"))); } return o.x1 = Or(o.x1), o.y1 = Or(o.y1), o.x2 = Or(o.x2), o.y2 = Or(o.y2), o.w = Or(o.x2 - o.x1), o.h = Or(o.y2 - o.y1), o.w > 0 && o.h > 0 && b && (Hs(o, y), Vs(o, 1)), o; }; var KS = function(e) { var r = 0, n = function(o) { return (o ? 1 : 0) << r++; }, a = 0; return a += n(e.incudeNodes), a += n(e.includeEdges), a += n(e.includeLabels), a += n(e.includeMainLabels), a += n(e.includeSourceLabels), a += n(e.includeTargetLabels), a += n(e.includeOverlays), a += n(e.includeOutlines), a; }; var GS = function(e) { if (e.isEdge()) { var r = e.source().position(), n = e.target().position(), a = function(o) { return Math.round(o); }; return f$([a(r.x), a(r.y), a(n.x), a(n.y)]); } else return 0; }; var y0 = function(e, r) { var n = e._private, a, i = e.isEdge(), o = r == null ? m0 : KS(r), s = o === m0, u = GS(e), l = n.bbCachePosKey === u, c = r.useCache && l, d = function(p) { return p._private.bbCache == null || p._private.styleDirty; }, f = !c || d(e) || i && d(e.source()) || d(e.target()); if (f ? (l || e.recalculateRenderedStyle(c), a = _z(e, $o), n.bbCache = a, n.bbCachePosKey = u) : a = n.bbCache, !s) { var h10 = e.isNode(); a = br(), (r.includeNodes && h10 || r.includeEdges && !h10) && (r.includeOverlays ? ga(a, n.overlayBounds) : ga(a, n.bodyBounds)), r.includeLabels && (r.includeMainLabels && (!i || r.includeSourceLabels && r.includeTargetLabels) ? ga(a, n.labelBounds.all) : (r.includeMainLabels && ga(a, n.labelBounds.mainRot), r.includeSourceLabels && ga(a, n.labelBounds.sourceRot), r.includeTargetLabels && ga(a, n.labelBounds.targetRot))), a.w = a.x2 - a.x1, a.h = a.y2 - a.y1; } return a; }; var $o = { includeNodes: true, includeEdges: true, includeLabels: true, includeMainLabels: true, includeSourceLabels: true, includeTargetLabels: true, includeOverlays: true, includeUnderlays: true, includeOutlines: true, useCache: true }; var m0 = KS($o); var b0 = Zt($o); la.boundingBox = function(t13) { var e; if (this.length === 1 && this[0]._private.bbCache != null && !this[0]._private.styleDirty && (t13 === void 0 || t13.useCache === void 0 || t13.useCache === true)) t13 === void 0 ? t13 = $o : t13 = b0(t13), e = y0(this[0], t13); else { e = br(), t13 = t13 || $o; var r = b0(t13), n = this, a = n.cy(), i = a.styleEnabled(); if (i) for (var o = 0; o < n.length; o++) { var s = n[o], u = s._private, l = GS(s), c = u.bbCachePosKey === l, d = r.useCache && c && !u.styleDirty; s.recalculateRenderedStyle(d); } this.updateCompoundBounds(!t13.useCache); for (var f = 0; f < n.length; f++) { var h10 = n[f]; ga(e, y0(h10, r)); } } return e.x1 = Or(e.x1), e.y1 = Or(e.y1), e.x2 = Or(e.x2), e.y2 = Or(e.y2), e.w = Or(e.x2 - e.x1), e.h = Or(e.y2 - e.y1), e; }; la.dirtyBoundingBoxCache = function() { for (var t13 = 0; t13 < this.length; t13++) { var e = this[t13]._private; e.bbCache = null, e.bbCachePosKey = null, e.bodyBounds = null, e.overlayBounds = null, e.labelBounds.all = null, e.labelBounds.source = null, e.labelBounds.target = null, e.labelBounds.main = null, e.labelBounds.sourceRot = null, e.labelBounds.targetRot = null, e.labelBounds.mainRot = null, e.arrowBounds.source = null, e.arrowBounds.target = null, e.arrowBounds["mid-source"] = null, e.arrowBounds["mid-target"] = null; } return this.emitAndNotify("bounds"), this; }; la.boundingBoxAt = function(t13) { var e = this.nodes(), r = this.cy(), n = r.hasCompoundNodes(), a = r.collection(); if (n && (a = e.filter(function(l) { return l.isParent(); }), e = e.not(a)), Xe(t13)) { var i = t13; t13 = function() { return i; }; } var o = function(c, d) { return c._private.bbAtOldPos = t13(c, d); }, s = function(c) { return c._private.bbAtOldPos; }; r.startBatch(), e.forEach(o).silentPositions(t13), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(true)); var u = K$(this.boundingBox({ useCache: false })); return e.silentPositions(s), n && (a.dirtyCompoundBoundsCache(), a.dirtyBoundingBoxCache(), a.updateCompoundBounds(true)), r.endBatch(), u; }; gi.boundingbox = gi.bb = gi.boundingBox; gi.renderedBoundingbox = gi.renderedBoundingBox; var Tz = la; var fo; var is; fo = is = {}; var US = function(e) { e.uppercaseName = Vm(e.name), e.autoName = "auto" + e.uppercaseName, e.labelName = "label" + e.uppercaseName, e.outerName = "outer" + e.uppercaseName, e.uppercaseOuterName = Vm(e.outerName), fo[e.name] = function() { var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled; if (n) if (o) { if (n.isParent()) return n.updateCompoundBounds(), a[e.autoName] || 0; var s = n.pstyle(e.name); switch (s.strValue) { case "label": return n.recalculateRenderedStyle(), a.rstyle[e.labelName] || 0; default: return s.pfValue; } } else return 1; }, fo["outer" + e.uppercaseName] = function() { var n = this[0], a = n._private, i = a.cy, o = i._private.styleEnabled; if (n) if (o) { var s = n[e.name](), u = n.pstyle("border-width").pfValue, l = 2 * n.padding(); return s + u + l; } else return 1; }, fo["rendered" + e.uppercaseName] = function() { var n = this[0]; if (n) { var a = n[e.name](); return a * this.cy().zoom(); } }, fo["rendered" + e.uppercaseOuterName] = function() { var n = this[0]; if (n) { var a = n[e.outerName](); return a * this.cy().zoom(); } }; }; US({ name: "width" }); US({ name: "height" }); is.padding = function() { var t13 = this[0], e = t13._private; return t13.isParent() ? (t13.updateCompoundBounds(), e.autoPadding !== void 0 ? e.autoPadding : t13.pstyle("padding").pfValue) : t13.pstyle("padding").pfValue; }; is.paddedHeight = function() { var t13 = this[0]; return t13.height() + 2 * t13.padding(); }; is.paddedWidth = function() { var t13 = this[0]; return t13.width() + 2 * t13.padding(); }; var Iz = is; var Oz = function(e, r) { if (e.isEdge()) return r(e); }; var Az = function(e, r) { if (e.isEdge()) { var n = e.cy(); return Nl(r(e), n.zoom(), n.pan()); } }; var Pz = function(e, r) { if (e.isEdge()) { var n = e.cy(), a = n.pan(), i = n.zoom(); return r(e).map(function(o) { return Nl(o, i, a); }); } }; var Dz = function(e) { return e.renderer().getControlPoints(e); }; var Rz = function(e) { return e.renderer().getSegmentPoints(e); }; var Lz = function(e) { return e.renderer().getSourceEndpoint(e); }; var Fz = function(e) { return e.renderer().getTargetEndpoint(e); }; var Mz = function(e) { return e.renderer().getEdgeMidpoint(e); }; var w0 = { controlPoints: { get: Dz, mult: true }, segmentPoints: { get: Rz, mult: true }, sourceEndpoint: { get: Lz }, targetEndpoint: { get: Fz }, midpoint: { get: Mz } }; var Nz = function(e) { return "rendered" + e[0].toUpperCase() + e.substr(1); }; var Bz = Object.keys(w0).reduce(function(t13, e) { var r = w0[e], n = Nz(e); return t13[e] = function() { return Oz(this, r.get); }, r.mult ? t13[n] = function() { return Pz(this, r.get); } : t13[n] = function() { return Az(this, r.get); }, t13; }, {}); var $z = ze({}, Sz, Tz, Iz, Bz); var WS = function(e, r) { this.recycle(e, r); }; function ao() { return false; } function Ds() { return true; } WS.prototype = { instanceString: function() { return "event"; }, recycle: function(e, r) { if (this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = ao, e != null && e.preventDefault ? (this.type = e.type, this.isDefaultPrevented = e.defaultPrevented ? Ds : ao) : e != null && e.type ? r = e : this.type = e, r != null && (this.originalEvent = r.originalEvent, this.type = r.type != null ? r.type : this.type, this.cy = r.cy, this.target = r.target, this.position = r.position, this.renderedPosition = r.renderedPosition, this.namespace = r.namespace, this.layout = r.layout), this.cy != null && this.position != null && this.renderedPosition == null) { var n = this.position, a = this.cy.zoom(), i = this.cy.pan(); this.renderedPosition = { x: n.x * a + i.x, y: n.y * a + i.y }; } this.timeStamp = e && e.timeStamp || Date.now(); }, preventDefault: function() { this.isDefaultPrevented = Ds; var e = this.originalEvent; e && e.preventDefault && e.preventDefault(); }, stopPropagation: function() { this.isPropagationStopped = Ds; var e = this.originalEvent; e && e.stopPropagation && e.stopPropagation(); }, stopImmediatePropagation: function() { this.isImmediatePropagationStopped = Ds, this.stopPropagation(); }, isDefaultPrevented: ao, isPropagationStopped: ao, isImmediatePropagationStopped: ao }; var jS = /^([^.]+)(\.(?:[^.]+))?$/; var qz = ".*"; var YS = { qualifierCompare: function(e, r) { return e === r; }, eventMatches: function() { return true; }, addEventFields: function() { }, callbackContext: function(e) { return e; }, beforeEmit: function() { }, afterEmit: function() { }, bubble: function() { return false; }, parent: function() { return null; }, context: null }; var C0 = Object.keys(YS); var zz = {}; function Hl() { for (var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : zz, e = arguments.length > 1 ? arguments[1] : void 0, r = 0; r < C0.length; r++) { var n = C0[r]; this[n] = t13[n] || YS[n]; } this.context = e || this.context, this.listeners = [], this.emitting = 0; } var aa = Hl.prototype; var ZS = function(e, r, n, a, i, o, s) { yt(a) && (i = a, a = null), s && (o == null ? o = s : o = ze({}, o, s)); for (var u = lt(n) ? n : n.split(/\s+/), l = 0; l < u.length; l++) { var c = u[l]; if (!ea(c)) { var d = c.match(jS); if (d) { var f = d[1], h10 = d[2] ? d[2] : null, v = r(e, c, f, h10, a, i, o); if (v === false) break; } } } }; var x0 = function(e, r) { return e.addEventFields(e.context, r), new WS(r.type, r); }; var Vz = function(e, r, n) { if (lB(n)) { r(e, n); return; } else if (Xe(n)) { r(e, x0(e, n)); return; } for (var a = lt(n) ? n : n.split(/\s+/), i = 0; i < a.length; i++) { var o = a[i]; if (!ea(o)) { var s = o.match(jS); if (s) { var u = s[1], l = s[2] ? s[2] : null, c = x0(e, { type: u, namespace: l, target: e.context }); r(e, c); } } } }; aa.on = aa.addListener = function(t13, e, r, n, a) { return ZS(this, function(i, o, s, u, l, c, d) { yt(c) && i.listeners.push({ event: o, // full event string callback: c, // callback to run type: s, // the event type (e.g. 'click') namespace: u, // the event namespace (e.g. ".foo") qualifier: l, // a restriction on whether to match this emitter conf: d // additional configuration }); }, t13, e, r, n, a), this; }; aa.one = function(t13, e, r, n) { return this.on(t13, e, r, n, { one: true }); }; aa.removeListener = aa.off = function(t13, e, r, n) { var a = this; this.emitting !== 0 && (this.listeners = y$(this.listeners)); for (var i = this.listeners, o = function(l) { var c = i[l]; ZS(a, function(d, f, h10, v, p, g) { if ((c.type === h10 || t13 === "*") && (!v && c.namespace !== ".*" || c.namespace === v) && (!p || d.qualifierCompare(c.qualifier, p)) && (!g || c.callback === g)) return i.splice(l, 1), false; }, t13, e, r, n); }, s = i.length - 1; s >= 0; s--) o(s); return this; }; aa.removeAllListeners = function() { return this.removeListener("*"); }; aa.emit = aa.trigger = function(t13, e, r) { var n = this.listeners, a = n.length; return this.emitting++, lt(e) || (e = [e]), Vz(this, function(i, o) { r != null && (n = [{ event: o.event, type: o.type, namespace: o.namespace, callback: r }], a = n.length); for (var s = function(c) { var d = n[c]; if (d.type === o.type && (!d.namespace || d.namespace === o.namespace || d.namespace === qz) && i.eventMatches(i.context, d, o)) { var f = [o]; e != null && b$(f, e), i.beforeEmit(i.context, d, o), d.conf && d.conf.one && (i.listeners = i.listeners.filter(function(p) { return p !== d; })); var h10 = i.callbackContext(i.context, d, o), v = d.callback.apply(h10, f); i.afterEmit(i.context, d, o), v === false && (o.stopPropagation(), o.preventDefault()); } }, u = 0; u < a; u++) s(u); i.bubble(i.context) && !o.isPropagationStopped() && i.parent(i.context).emit(o, e); }, t13), this.emitting--, this; }; var Hz = { qualifierCompare: function(e, r) { return e == null || r == null ? e == null && r == null : e.sameText(r); }, eventMatches: function(e, r, n) { var a = r.qualifier; return a != null ? e !== n.target && rs(n.target) && a.matches(n.target) : true; }, addEventFields: function(e, r) { r.cy = e.cy(), r.target = e; }, callbackContext: function(e, r, n) { return r.qualifier != null ? n.target : e; }, beforeEmit: function(e, r) { r.conf && r.conf.once && r.conf.onceCollection.removeListener(r.event, r.qualifier, r.callback); }, bubble: function() { return true; }, parent: function(e) { return e.isChild() ? e.parent() : e.cy(); } }; var Rs = function(e) { return Me(e) ? new ra(e) : e; }; var XS = { createEmitter: function() { for (var e = 0; e < this.length; e++) { var r = this[e], n = r._private; n.emitter || (n.emitter = new Hl(Hz, r)); } return this; }, emitter: function() { return this._private.emitter; }, on: function(e, r, n) { for (var a = Rs(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().on(e, a, n); } return this; }, removeListener: function(e, r, n) { for (var a = Rs(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().removeListener(e, a, n); } return this; }, removeAllListeners: function() { for (var e = 0; e < this.length; e++) { var r = this[e]; r.emitter().removeAllListeners(); } return this; }, one: function(e, r, n) { for (var a = Rs(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().one(e, a, n); } return this; }, once: function(e, r, n) { for (var a = Rs(r), i = 0; i < this.length; i++) { var o = this[i]; o.emitter().on(e, a, n, { once: true, onceCollection: this }); } }, emit: function(e, r) { for (var n = 0; n < this.length; n++) { var a = this[n]; a.emitter().emit(e, r); } return this; }, emitAndNotify: function(e, r) { if (this.length !== 0) return this.cy().notify(e, this), this.emit(e, r), this; } }; et.eventAliasesOn(XS); var JS = { nodes: function(e) { return this.filter(function(r) { return r.isNode(); }).filter(e); }, edges: function(e) { return this.filter(function(r) { return r.isEdge(); }).filter(e); }, // internal helper to get nodes and edges as separate collections with single iteration over elements byGroup: function() { for (var e = this.spawn(), r = this.spawn(), n = 0; n < this.length; n++) { var a = this[n]; a.isNode() ? e.push(a) : r.push(a); } return { nodes: e, edges: r }; }, filter: function(e, r) { if (e === void 0) return this; if (Me(e) || xr(e)) return new ra(e).filter(this); if (yt(e)) { for (var n = this.spawn(), a = this, i = 0; i < a.length; i++) { var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a); s && n.push(o); } return n; } return this.spawn(); }, not: function(e) { if (e) { Me(e) && (e = this.filter(e)); for (var r = this.spawn(), n = 0; n < this.length; n++) { var a = this[n], i = e.has(a); i || r.push(a); } return r; } else return this; }, absoluteComplement: function() { var e = this.cy(); return e.mutableElements().not(this); }, intersect: function(e) { if (Me(e)) { var r = e; return this.filter(r); } for (var n = this.spawn(), a = this, i = e, o = this.length < e.length, s = o ? a : i, u = o ? i : a, l = 0; l < s.length; l++) { var c = s[l]; u.has(c) && n.push(c); } return n; }, xor: function(e) { var r = this._private.cy; Me(e) && (e = r.$(e)); var n = this.spawn(), a = this, i = e, o = function(u, l) { for (var c = 0; c < u.length; c++) { var d = u[c], f = d._private.data.id, h10 = l.hasElementWithId(f); h10 || n.push(d); } }; return o(a, i), o(i, a), n; }, diff: function(e) { var r = this._private.cy; Me(e) && (e = r.$(e)); var n = this.spawn(), a = this.spawn(), i = this.spawn(), o = this, s = e, u = function(c, d, f) { for (var h10 = 0; h10 < c.length; h10++) { var v = c[h10], p = v._private.data.id, g = d.hasElementWithId(p); g ? i.merge(v) : f.push(v); } }; return u(o, s, n), u(s, o, a), { left: n, right: a, both: i }; }, add: function(e) { var r = this._private.cy; if (!e) return this; if (Me(e)) { var n = e; e = r.mutableElements().filter(n); } for (var a = this.spawnSelf(), i = 0; i < e.length; i++) { var o = e[i], s = !this.has(o); s && a.push(o); } return a; }, // in place merge on calling collection merge: function(e) { var r = this._private, n = r.cy; if (!e) return this; if (e && Me(e)) { var a = e; e = n.mutableElements().filter(a); } for (var i = r.map, o = 0; o < e.length; o++) { var s = e[o], u = s._private.data.id, l = !i.has(u); if (l) { var c = this.length++; this[c] = s, i.set(u, { ele: s, index: c }); } } return this; }, unmergeAt: function(e) { var r = this[e], n = r.id(), a = this._private, i = a.map; this[e] = void 0, i.delete(n); var o = e === this.length - 1; if (this.length > 1 && !o) { var s = this.length - 1, u = this[s], l = u._private.data.id; this[s] = void 0, this[e] = u, i.set(l, { ele: u, index: e }); } return this.length--, this; }, // remove single ele in place in calling collection unmergeOne: function(e) { e = e[0]; var r = this._private, n = e._private.data.id, a = r.map, i = a.get(n); if (!i) return this; var o = i.index; return this.unmergeAt(o), this; }, // remove eles in place on calling collection unmerge: function(e) { var r = this._private.cy; if (!e) return this; if (e && Me(e)) { var n = e; e = r.mutableElements().filter(n); } for (var a = 0; a < e.length; a++) this.unmergeOne(e[a]); return this; }, unmergeBy: function(e) { for (var r = this.length - 1; r >= 0; r--) { var n = this[r]; e(n) && this.unmergeAt(r); } return this; }, map: function(e, r) { for (var n = [], a = this, i = 0; i < a.length; i++) { var o = a[i], s = r ? e.apply(r, [o, i, a]) : e(o, i, a); n.push(s); } return n; }, reduce: function(e, r) { for (var n = r, a = this, i = 0; i < a.length; i++) n = e(n, a[i], i, a); return n; }, max: function(e, r) { for (var n = -1 / 0, a, i = this, o = 0; o < i.length; o++) { var s = i[o], u = r ? e.apply(r, [s, o, i]) : e(s, o, i); u > n && (n = u, a = s); } return { value: n, ele: a }; }, min: function(e, r) { for (var n = 1 / 0, a, i = this, o = 0; o < i.length; o++) { var s = i[o], u = r ? e.apply(r, [s, o, i]) : e(s, o, i); u < n && (n = u, a = s); } return { value: n, ele: a }; } }; var Qe = JS; Qe.u = Qe["|"] = Qe["+"] = Qe.union = Qe.or = Qe.add; Qe["\\"] = Qe["!"] = Qe["-"] = Qe.difference = Qe.relativeComplement = Qe.subtract = Qe.not; Qe.n = Qe["&"] = Qe["."] = Qe.and = Qe.intersection = Qe.intersect; Qe["^"] = Qe["(+)"] = Qe["(-)"] = Qe.symmetricDifference = Qe.symdiff = Qe.xor; Qe.fnFilter = Qe.filterFn = Qe.stdFilter = Qe.filter; Qe.complement = Qe.abscomp = Qe.absoluteComplement; var Kz = { isNode: function() { return this.group() === "nodes"; }, isEdge: function() { return this.group() === "edges"; }, isLoop: function() { return this.isEdge() && this.source()[0] === this.target()[0]; }, isSimple: function() { return this.isEdge() && this.source()[0] !== this.target()[0]; }, group: function() { var e = this[0]; if (e) return e._private.group; } }; var QS = function(e, r) { var n = e.cy(), a = n.hasCompoundNodes(); function i(c) { var d = c.pstyle("z-compound-depth"); return d.value === "auto" ? a ? c.zDepth() : 0 : d.value === "bottom" ? -1 : d.value === "top" ? Og : 0; } var o = i(e) - i(r); if (o !== 0) return o; function s(c) { var d = c.pstyle("z-index-compare"); return d.value === "auto" && c.isNode() ? 1 : 0; } var u = s(e) - s(r); if (u !== 0) return u; var l = e.pstyle("z-index").value - r.pstyle("z-index").value; return l !== 0 ? l : e.poolIndex() - r.poolIndex(); }; var vl = { forEach: function(e, r) { if (yt(e)) for (var n = this.length, a = 0; a < n; a++) { var i = this[a], o = r ? e.apply(r, [i, a, this]) : e(i, a, this); if (o === false) break; } return this; }, toArray: function() { for (var e = [], r = 0; r < this.length; r++) e.push(this[r]); return e; }, slice: function(e, r) { var n = [], a = this.length; r == null && (r = a), e == null && (e = 0), e < 0 && (e = a + e), r < 0 && (r = a + r); for (var i = e; i >= 0 && i < r && i < a; i++) n.push(this[i]); return this.spawn(n); }, size: function() { return this.length; }, eq: function(e) { return this[e] || this.spawn(); }, first: function() { return this[0] || this.spawn(); }, last: function() { return this[this.length - 1] || this.spawn(); }, empty: function() { return this.length === 0; }, nonempty: function() { return !this.empty(); }, sort: function(e) { if (!yt(e)) return this; var r = this.toArray().sort(e); return this.spawn(r); }, sortByZIndex: function() { return this.sort(QS); }, zDepth: function() { var e = this[0]; if (e) { var r = e._private, n = r.group; if (n === "nodes") { var a = r.data.parent ? e.parents().size() : 0; return e.isParent() ? a : Og - 1; } else { var i = r.source, o = r.target, s = i.zDepth(), u = o.zDepth(); return Math.max(s, u, 0); } } } }; vl.each = vl.forEach; var Gz = function() { var e = "undefined", r = (typeof Symbol > "u" ? "undefined" : Nt(Symbol)) != e && Nt(Symbol.iterator) != e; r && (vl[Symbol.iterator] = function() { var n = this, a = { value: void 0, done: false }, i = 0, o = this.length; return Y2({ next: function() { return i < o ? a.value = n[i++] : (a.value = void 0, a.done = true), a; } }, Symbol.iterator, function() { return this; }); }); }; Gz(); var Uz = Zt({ nodeDimensionsIncludeLabels: false }); var Gs = { // Calculates and returns node dimensions { x, y } based on options given layoutDimensions: function(e) { e = Uz(e); var r; if (!this.takesUpSpace()) r = { w: 0, h: 0 }; else if (e.nodeDimensionsIncludeLabels) { var n = this.boundingBox(); r = { w: n.w, h: n.h }; } else r = { w: this.outerWidth(), h: this.outerHeight() }; return (r.w === 0 || r.h === 0) && (r.w = r.h = 1), r; }, // using standard layout options, apply position function (w/ or w/o animation) layoutPositions: function(e, r, n) { var a = this.nodes().filter(function(x) { return !x.isParent(); }), i = this.cy(), o = r.eles, s = function(E) { return E.id(); }, u = Po(n, s); e.emit({ type: "layoutstart", layout: e }), e.animations = []; var l = function(E, C, k) { var S = { x: C.x1 + C.w / 2, y: C.y1 + C.h / 2 }, _ = { // scale from center of bounding box (not necessarily 0,0) x: (k.x - S.x) * E, y: (k.y - S.y) * E }; return { x: S.x + _.x, y: S.y + _.y }; }, c = r.spacingFactor && r.spacingFactor !== 1, d = function() { if (!c) return null; for (var E = br(), C = 0; C < a.length; C++) { var k = a[C], S = u(k, C); W$(E, S.x, S.y); } return E; }, f = d(), h10 = Po(function(x, E) { var C = u(x, E); if (c) { var k = Math.abs(r.spacingFactor); C = l(k, f, C); } return r.transform != null && (C = r.transform(x, C)), C; }, s); if (r.animate) { for (var v = 0; v < a.length; v++) { var p = a[v], g = h10(p, v), y = r.animateFilter == null || r.animateFilter(p, v); if (y) { var m = p.animation({ position: g, duration: r.animationDuration, easing: r.animationEasing }); e.animations.push(m); } else p.position(g); } if (r.fit) { var b = i.animation({ fit: { boundingBox: o.boundingBoxAt(h10), padding: r.padding }, duration: r.animationDuration, easing: r.animationEasing }); e.animations.push(b); } else if (r.zoom !== void 0 && r.pan !== void 0) { var w = i.animation({ zoom: r.zoom, pan: r.pan, duration: r.animationDuration, easing: r.animationEasing }); e.animations.push(w); } e.animations.forEach(function(x) { return x.play(); }), e.one("layoutready", r.ready), e.emit({ type: "layoutready", layout: e }), Mi.all(e.animations.map(function(x) { return x.promise(); })).then(function() { e.one("layoutstop", r.stop), e.emit({ type: "layoutstop", layout: e }); }); } else a.positions(h10), r.fit && i.fit(r.eles, r.padding), r.zoom != null && i.zoom(r.zoom), r.pan && i.pan(r.pan), e.one("layoutready", r.ready), e.emit({ type: "layoutready", layout: e }), e.one("layoutstop", r.stop), e.emit({ type: "layoutstop", layout: e }); return this; }, layout: function(e) { var r = this.cy(); return r.makeLayout(ze({}, e, { eles: this })); } }; Gs.createLayout = Gs.makeLayout = Gs.layout; function ek(t13, e, r) { var n = r._private, a = n.styleCache = n.styleCache || [], i; return (i = a[t13]) != null || (i = a[t13] = e(r)), i; } function Kl(t13, e) { return t13 = Pa(t13), function(n) { return ek(t13, e, n); }; } function Gl(t13, e) { t13 = Pa(t13); var r = function(a) { return e.call(a); }; return function() { var a = this[0]; if (a) return ek(t13, r, a); }; } var jt = { recalculateRenderedStyle: function(e) { var r = this.cy(), n = r.renderer(), a = r.styleEnabled(); return n && a && n.recalculateRenderedStyle(this, e), this; }, dirtyStyleCache: function() { var e = this.cy(), r = function(i) { return i._private.styleCache = null; }; if (e.hasCompoundNodes()) { var n; n = this.spawnSelf().merge(this.descendants()).merge(this.parents()), n.merge(n.connectedEdges()), n.forEach(r); } else this.forEach(function(a) { r(a), a.connectedEdges().forEach(r); }); return this; }, // fully updates (recalculates) the style for the elements updateStyle: function(e) { var r = this._private.cy; if (!r.styleEnabled()) return this; if (r.batching()) { var n = r._private.batchStyleEles; return n.merge(this), this; } var a = r.hasCompoundNodes(), i = this; e = !!(e || e === void 0), a && (i = this.spawnSelf().merge(this.descendants()).merge(this.parents())); var o = i; return e ? o.emitAndNotify("style") : o.emit("style"), i.forEach(function(s) { return s._private.styleDirty = true; }), this; }, // private: clears dirty flag and recalculates style cleanStyle: function() { var e = this.cy(); if (e.styleEnabled()) for (var r = 0; r < this.length; r++) { var n = this[r]; n._private.styleDirty && (n._private.styleDirty = false, e.style().apply(n)); } }, // get the internal parsed style object for the specified property parsedStyle: function(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, n = this[0], a = n.cy(); if (a.styleEnabled() && n) { this.cleanStyle(); var i = n._private.style[e]; return i ?? (r ? a.style().getDefaultProperty(e) : null); } }, numericStyle: function(e) { var r = this[0]; if (r.cy().styleEnabled() && r) { var n = r.pstyle(e); return n.pfValue !== void 0 ? n.pfValue : n.value; } }, numericStyleUnits: function(e) { var r = this[0]; if (r.cy().styleEnabled() && r) return r.pstyle(e).units; }, // get the specified css property as a rendered value (i.e. on-screen value) // or get the whole rendered style if no property specified (NB doesn't allow setting) renderedStyle: function(e) { var r = this.cy(); if (!r.styleEnabled()) return this; var n = this[0]; if (n) return r.style().getRenderedStyle(n, e); }, // read the calculated css style of the element or override the style (via a bypass) style: function(e, r) { var n = this.cy(); if (!n.styleEnabled()) return this; var a = false, i = n.style(); if (Xe(e)) { var o = e; i.applyBypass(this, o, a), this.emitAndNotify("style"); } else if (Me(e)) if (r === void 0) { var s = this[0]; return s ? i.getStylePropertyValue(s, e) : void 0; } else i.applyBypass(this, e, r, a), this.emitAndNotify("style"); else if (e === void 0) { var u = this[0]; return u ? i.getRawStyle(u) : void 0; } return this; }, removeStyle: function(e) { var r = this.cy(); if (!r.styleEnabled()) return this; var n = false, a = r.style(), i = this; if (e === void 0) for (var o = 0; o < i.length; o++) { var s = i[o]; a.removeAllBypasses(s, n); } else { e = e.split(/\s+/); for (var u = 0; u < i.length; u++) { var l = i[u]; a.removeBypasses(l, e, n); } } return this.emitAndNotify("style"), this; }, show: function() { return this.css("display", "element"), this; }, hide: function() { return this.css("display", "none"), this; }, effectiveOpacity: function() { var e = this.cy(); if (!e.styleEnabled()) return 1; var r = e.hasCompoundNodes(), n = this[0]; if (n) { var a = n._private, i = n.pstyle("opacity").value; if (!r) return i; var o = a.data.parent ? n.parents() : null; if (o) for (var s = 0; s < o.length; s++) { var u = o[s], l = u.pstyle("opacity").value; i = l * i; } return i; } }, transparent: function() { var e = this.cy(); if (!e.styleEnabled()) return false; var r = this[0], n = r.cy().hasCompoundNodes(); if (r) return n ? r.effectiveOpacity() === 0 : r.pstyle("opacity").value === 0; }, backgrounding: function() { var e = this.cy(); if (!e.styleEnabled()) return false; var r = this[0]; return !!r._private.backgrounding; } }; function Bu(t13, e) { var r = t13._private, n = r.data.parent ? t13.parents() : null; if (n) for (var a = 0; a < n.length; a++) { var i = n[a]; if (!e(i)) return false; } return true; } function zg(t13) { var e = t13.ok, r = t13.edgeOkViaNode || t13.ok, n = t13.parentOk || t13.ok; return function() { var a = this.cy(); if (!a.styleEnabled()) return true; var i = this[0], o = a.hasCompoundNodes(); if (i) { var s = i._private; if (!e(i)) return false; if (i.isNode()) return !o || Bu(i, n); var u = s.source, l = s.target; return r(u) && (!o || Bu(u, r)) && (u === l || r(l) && (!o || Bu(l, r))); } }; } var qi = Kl("eleTakesUpSpace", function(t13) { return t13.pstyle("display").value === "element" && t13.width() !== 0 && (t13.isNode() ? t13.height() !== 0 : true); }); jt.takesUpSpace = Gl("takesUpSpace", zg({ ok: qi })); var Wz = Kl("eleInteractive", function(t13) { return t13.pstyle("events").value === "yes" && t13.pstyle("visibility").value === "visible" && qi(t13); }); var jz = Kl("parentInteractive", function(t13) { return t13.pstyle("visibility").value === "visible" && qi(t13); }); jt.interactive = Gl("interactive", zg({ ok: Wz, parentOk: jz, edgeOkViaNode: qi })); jt.noninteractive = function() { var t13 = this[0]; if (t13) return !t13.interactive(); }; var Yz = Kl("eleVisible", function(t13) { return t13.pstyle("visibility").value === "visible" && t13.pstyle("opacity").pfValue !== 0 && qi(t13); }); var Zz = qi; jt.visible = Gl("visible", zg({ ok: Yz, edgeOkViaNode: Zz })); jt.hidden = function() { var t13 = this[0]; if (t13) return !t13.visible(); }; jt.isBundledBezier = Gl("isBundledBezier", function() { return this.cy().styleEnabled() ? !this.removed() && this.pstyle("curve-style").value === "bezier" && this.takesUpSpace() : false; }); jt.bypass = jt.css = jt.style; jt.renderedCss = jt.renderedStyle; jt.removeBypass = jt.removeCss = jt.removeStyle; jt.pstyle = jt.parsedStyle; var Xn = {}; function E0(t13) { return function() { var e = arguments, r = []; if (e.length === 2) { var n = e[0], a = e[1]; this.on(t13.event, n, a); } else if (e.length === 1 && yt(e[0])) { var i = e[0]; this.on(t13.event, i); } else if (e.length === 0 || e.length === 1 && lt(e[0])) { for (var o = e.length === 1 ? e[0] : null, s = 0; s < this.length; s++) { var u = this[s], l = !t13.ableField || u._private[t13.ableField], c = u._private[t13.field] != t13.value; if (t13.overrideAble) { var d = t13.overrideAble(u); if (d !== void 0 && (l = d, !d)) return this; } l && (u._private[t13.field] = t13.value, c && r.push(u)); } var f = this.spawn(r); f.updateStyle(), f.emit(t13.event), o && f.emit(o); } return this; }; } function zi(t13) { Xn[t13.field] = function() { var e = this[0]; if (e) { if (t13.overrideField) { var r = t13.overrideField(e); if (r !== void 0) return r; } return e._private[t13.field]; } }, Xn[t13.on] = E0({ event: t13.on, field: t13.field, ableField: t13.ableField, overrideAble: t13.overrideAble, value: true }), Xn[t13.off] = E0({ event: t13.off, field: t13.field, ableField: t13.ableField, overrideAble: t13.overrideAble, value: false }); } zi({ field: "locked", overrideField: function(e) { return e.cy().autolock() ? true : void 0; }, on: "lock", off: "unlock" }); zi({ field: "grabbable", overrideField: function(e) { return e.cy().autoungrabify() || e.pannable() ? false : void 0; }, on: "grabify", off: "ungrabify" }); zi({ field: "selected", ableField: "selectable", overrideAble: function(e) { return e.cy().autounselectify() ? false : void 0; }, on: "select", off: "unselect" }); zi({ field: "selectable", overrideField: function(e) { return e.cy().autounselectify() ? false : void 0; }, on: "selectify", off: "unselectify" }); Xn.deselect = Xn.unselect; Xn.grabbed = function() { var t13 = this[0]; if (t13) return t13._private.grabbed; }; zi({ field: "active", on: "activate", off: "unactivate" }); zi({ field: "pannable", on: "panify", off: "unpanify" }); Xn.inactive = function() { var t13 = this[0]; if (t13) return !t13._private.active; }; var ir = {}; var S0 = function(e) { return function(n) { for (var a = this, i = [], o = 0; o < a.length; o++) { var s = a[o]; if (s.isNode()) { for (var u = false, l = s.connectedEdges(), c = 0; c < l.length; c++) { var d = l[c], f = d.source(), h10 = d.target(); if (e.noIncomingEdges && h10 === s && f !== s || e.noOutgoingEdges && f === s && h10 !== s) { u = true; break; } } u || i.push(s); } } return this.spawn(i, true).filter(n); }; }; var k0 = function(e) { return function(r) { for (var n = this, a = [], i = 0; i < n.length; i++) { var o = n[i]; if (o.isNode()) for (var s = o.connectedEdges(), u = 0; u < s.length; u++) { var l = s[u], c = l.source(), d = l.target(); e.outgoing && c === o ? (a.push(l), a.push(d)) : e.incoming && d === o && (a.push(l), a.push(c)); } } return this.spawn(a, true).filter(r); }; }; var _0 = function(e) { return function(r) { for (var n = this, a = [], i = {}; ; ) { var o = e.outgoing ? n.outgoers() : n.incomers(); if (o.length === 0) break; for (var s = false, u = 0; u < o.length; u++) { var l = o[u], c = l.id(); i[c] || (i[c] = true, a.push(l), s = true); } if (!s) break; n = o; } return this.spawn(a, true).filter(r); }; }; ir.clearTraversalCache = function() { for (var t13 = 0; t13 < this.length; t13++) this[t13]._private.traversalCache = null; }; ze(ir, { // get the root nodes in the DAG roots: S0({ noIncomingEdges: true }), // get the leaf nodes in the DAG leaves: S0({ noOutgoingEdges: true }), // normally called children in graph theory // these nodes =edges=> outgoing nodes outgoers: Pr(k0({ outgoing: true }), "outgoers"), // aka DAG descendants successors: _0({ outgoing: true }), // normally called parents in graph theory // these nodes <=edges= incoming nodes incomers: Pr(k0({ incoming: true }), "incomers"), // aka DAG ancestors predecessors: _0({ incoming: true }) }); ze(ir, { neighborhood: Pr(function(t13) { for (var e = [], r = this.nodes(), n = 0; n < r.length; n++) for (var a = r[n], i = a.connectedEdges(), o = 0; o < i.length; o++) { var s = i[o], u = s.source(), l = s.target(), c = a === u ? l : u; c.length > 0 && e.push(c[0]), e.push(s[0]); } return this.spawn(e, true).filter(t13); }, "neighborhood"), closedNeighborhood: function(e) { return this.neighborhood().add(this).filter(e); }, openNeighborhood: function(e) { return this.neighborhood(e); } }); ir.neighbourhood = ir.neighborhood; ir.closedNeighbourhood = ir.closedNeighborhood; ir.openNeighbourhood = ir.openNeighborhood; ze(ir, { source: Pr(function(e) { var r = this[0], n; return r && (n = r._private.source || r.cy().collection()), n && e ? n.filter(e) : n; }, "source"), target: Pr(function(e) { var r = this[0], n; return r && (n = r._private.target || r.cy().collection()), n && e ? n.filter(e) : n; }, "target"), sources: T0({ attr: "source" }), targets: T0({ attr: "target" }) }); function T0(t13) { return function(r) { for (var n = [], a = 0; a < this.length; a++) { var i = this[a], o = i._private[t13.attr]; o && n.push(o); } return this.spawn(n, true).filter(r); }; } ze(ir, { edgesWith: Pr(I0(), "edgesWith"), edgesTo: Pr(I0({ thisIsSrc: true }), "edgesTo") }); function I0(t13) { return function(r) { var n = [], a = this._private.cy, i = t13 || {}; Me(r) && (r = a.$(r)); for (var o = 0; o < r.length; o++) for (var s = r[o]._private.edges, u = 0; u < s.length; u++) { var l = s[u], c = l._private.data, d = this.hasElementWithId(c.source) && r.hasElementWithId(c.target), f = r.hasElementWithId(c.source) && this.hasElementWithId(c.target), h10 = d || f; h10 && ((i.thisIsSrc || i.thisIsTgt) && (i.thisIsSrc && !d || i.thisIsTgt && !f) || n.push(l)); } return this.spawn(n, true); }; } ze(ir, { connectedEdges: Pr(function(t13) { for (var e = [], r = this, n = 0; n < r.length; n++) { var a = r[n]; if (a.isNode()) for (var i = a._private.edges, o = 0; o < i.length; o++) { var s = i[o]; e.push(s); } } return this.spawn(e, true).filter(t13); }, "connectedEdges"), connectedNodes: Pr(function(t13) { for (var e = [], r = this, n = 0; n < r.length; n++) { var a = r[n]; a.isEdge() && (e.push(a.source()[0]), e.push(a.target()[0])); } return this.spawn(e, true).filter(t13); }, "connectedNodes"), parallelEdges: Pr(O0(), "parallelEdges"), codirectedEdges: Pr(O0({ codirected: true }), "codirectedEdges") }); function O0(t13) { var e = { codirected: false }; return t13 = ze({}, e, t13), function(n) { for (var a = [], i = this.edges(), o = t13, s = 0; s < i.length; s++) for (var u = i[s], l = u._private, c = l.source, d = c._private.data.id, f = l.data.target, h10 = c._private.edges, v = 0; v < h10.length; v++) { var p = h10[v], g = p._private.data, y = g.target, m = g.source, b = y === f && m === d, w = d === y && f === m; (o.codirected && b || !o.codirected && (b || w)) && a.push(p); } return this.spawn(a, true).filter(n); }; } ze(ir, { components: function(e) { var r = this, n = r.cy(), a = n.collection(), i = e == null ? r.nodes() : e.nodes(), o = []; e != null && i.empty() && (i = e.sources()); var s = function(c, d) { a.merge(c), i.unmerge(c), d.merge(c); }; if (i.empty()) return r.spawn(); var u = function() { var c = n.collection(); o.push(c); var d = i[0]; s(d, c), r.bfs({ directed: false, roots: d, visit: function(h10) { return s(h10, c); } }), c.forEach(function(f) { f.connectedEdges().forEach(function(h10) { r.has(h10) && c.has(h10.source()) && c.has(h10.target()) && c.merge(h10); }); }); }; do u(); while (i.length > 0); return o; }, component: function() { var e = this[0]; return e.cy().mutableElements().components(e)[0]; } }); ir.componentsOf = ir.components; var Yt = function(e, r) { var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, a = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; if (e === void 0) { bt("A collection must have a reference to the core"); return; } var i = new nn(), o = false; if (!r) r = []; else if (r.length > 0 && Xe(r[0]) && !rs(r[0])) { o = true; for (var s = [], u = new Fi(), l = 0, c = r.length; l < c; l++) { var d = r[l]; d.data == null && (d.data = {}); var f = d.data; if (f.id == null) f.id = vS(); else if (e.hasElementWithId(f.id) || u.has(f.id)) continue; var h10 = new Ml(e, d, false); s.push(h10), u.add(f.id); } r = s; } this.length = 0; for (var v = 0, p = r.length; v < p; v++) { var g = r[v][0]; if (g != null) { var y = g._private.data.id; (!n || !i.has(y)) && (n && i.set(y, { index: this.length, ele: g }), this[this.length] = g, this.length++); } } this._private = { eles: this, cy: e, get map() { return this.lazyMap == null && this.rebuildMap(), this.lazyMap; }, set map(m) { this.lazyMap = m; }, rebuildMap: function() { for (var b = this.lazyMap = new nn(), w = this.eles, x = 0; x < w.length; x++) { var E = w[x]; b.set(E.id(), { index: x, ele: E }); } } }, n && (this._private.map = i), o && !a && this.restore(); }; var ft = Ml.prototype = Yt.prototype = Object.create(Array.prototype); ft.instanceString = function() { return "collection"; }; ft.spawn = function(t13, e) { return new Yt(this.cy(), t13, e); }; ft.spawnSelf = function() { return this.spawn(this); }; ft.cy = function() { return this._private.cy; }; ft.renderer = function() { return this._private.cy.renderer(); }; ft.element = function() { return this[0]; }; ft.collection = function() { return Q2(this) ? this : new Yt(this._private.cy, [this]); }; ft.unique = function() { return new Yt(this._private.cy, this, true); }; ft.hasElementWithId = function(t13) { return t13 = "" + t13, this._private.map.has(t13); }; ft.getElementById = function(t13) { t13 = "" + t13; var e = this._private.cy, r = this._private.map.get(t13); return r ? r.ele : new Yt(e); }; ft.$id = ft.getElementById; ft.poolIndex = function() { var t13 = this._private.cy, e = t13._private.elements, r = this[0]._private.data.id; return e._private.map.get(r).index; }; ft.indexOf = function(t13) { var e = t13[0]._private.data.id; return this._private.map.get(e).index; }; ft.indexOfId = function(t13) { return t13 = "" + t13, this._private.map.get(t13).index; }; ft.json = function(t13) { var e = this.element(), r = this.cy(); if (e == null && t13) return this; if (e != null) { var n = e._private; if (Xe(t13)) { if (r.startBatch(), t13.data) { e.data(t13.data); var a = n.data; if (e.isEdge()) { var i = false, o = {}, s = t13.data.source, u = t13.data.target; s != null && s != a.source && (o.source = "" + s, i = true), u != null && u != a.target && (o.target = "" + u, i = true), i && (e = e.move(o)); } else { var l = "parent" in t13.data, c = t13.data.parent; l && (c != null || a.parent != null) && c != a.parent && (c === void 0 && (c = null), c != null && (c = "" + c), e = e.move({ parent: c })); } } t13.position && e.position(t13.position); var d = function(p, g, y) { var m = t13[p]; m != null && m !== n[p] && (m ? e[g]() : 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"), t13.classes != null && e.classes(t13.classes), r.endBatch(), this; } else if (t13 === void 0) { var f = { data: rn(n.data), position: rn(n.position), group: n.group, removed: n.removed, selected: n.selected, selectable: n.selectable, locked: n.locked, grabbable: n.grabbable, pannable: n.pannable, classes: null }; f.classes = ""; var h10 = 0; return n.classes.forEach(function(v) { return f.classes += h10++ === 0 ? v : " " + v; }), f; } } }; ft.jsons = function() { for (var t13 = [], e = 0; e < this.length; e++) { var r = this[e], n = r.json(); t13.push(n); } return t13; }; ft.clone = function() { for (var t13 = this.cy(), e = [], r = 0; r < this.length; r++) { var n = this[r], a = n.json(), i = new Ml(t13, a, false); e.push(i); } return new Yt(t13, e); }; ft.copy = ft.clone; ft.restore = function() { for (var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, r = this, n = r.cy(), a = n._private, i = [], o = [], s, u = 0, l = r.length; u < l; u++) { var c = r[u]; e && !c.removed() || (c.isNode() ? i.push(c) : o.push(c)); } s = i.concat(o); var d, f = function() { s.splice(d, 1), d--; }; for (d = 0; d < s.length; d++) { var h10 = s[d], v = h10._private, p = v.data; if (h10.clearTraversalCache(), !(!e && !v.removed)) { if (p.id === void 0) p.id = vS(); else if (Ce(p.id)) p.id = "" + p.id; else if (ea(p.id) || !Me(p.id)) { bt("Can not create element with invalid string ID `" + p.id + "`"), f(); continue; } else if (n.hasElementWithId(p.id)) { bt("Can not create second element with ID `" + p.id + "`"), f(); continue; } } var g = p.id; if (h10.isNode()) { var y = v.position; y.x == null && (y.x = 0), y.y == null && (y.y = 0); } if (h10.isEdge()) { for (var m = h10, b = ["source", "target"], w = b.length, x = false, E = 0; E < w; E++) { var C = b[E], k = p[C]; Ce(k) && (k = p[C] = "" + p[C]), k == null || k === "" ? (bt("Can not create edge `" + g + "` with unspecified " + C), x = true) : n.hasElementWithId(k) || (bt("Can not create edge `" + g + "` with nonexistant " + C + " `" + k + "`"), x = true); } if (x) { f(); continue; } var S = n.getElementById(p.source), _ = n.getElementById(p.target); S.same(_) ? S._private.edges.push(m) : (S._private.edges.push(m), _._private.edges.push(m)), m._private.source = S, m._private.target = _; } v.map = new nn(), v.map.set(g, { ele: h10, index: 0 }), v.removed = false, e && n.addToPool(h10); } for (var T = 0; T < i.length; T++) { var O = i[T], D = O._private.data; Ce(D.parent) && (D.parent = "" + D.parent); var A = D.parent, F = A != null; if (F || O._private.parent) { var R = O._private.parent ? n.collection().merge(O._private.parent) : n.getElementById(A); if (R.empty()) D.parent = void 0; else if (R[0].removed()) tt("Node added with missing parent, reference to parent removed"), D.parent = void 0, O._private.parent = null; else { for (var M = false, L = R; !L.empty(); ) { if (O.same(L)) { M = true, D.parent = void 0; break; } L = L.parent(); } M || (R[0]._private.children.push(O), O._private.parent = R[0], a.hasCompoundNodes = true); } } } if (s.length > 0) { for (var V = s.length === r.length ? r : new Yt(n, s), Y = 0; Y < V.length; Y++) { var H = V[Y]; H.isNode() || (H.parallelEdges().clearTraversalCache(), H.source().clearTraversalCache(), H.target().clearTraversalCache()); } var K; a.hasCompoundNodes ? K = n.collection().merge(V).merge(V.connectedNodes()).merge(V.parent()) : K = V, K.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(t13), t13 ? V.emitAndNotify("add") : e && V.emit("add"); } return r; }; ft.removed = function() { var t13 = this[0]; return t13 && t13._private.removed; }; ft.inside = function() { var t13 = this[0]; return t13 && !t13._private.removed; }; ft.remove = function() { var t13 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, r = this, n = [], a = {}, i = r._private.cy; function o(A) { for (var F = A._private.edges, R = 0; R < F.length; R++) u(F[R]); } function s(A) { for (var F = A._private.children, R = 0; R < F.length; R++) u(F[R]); } function u(A) { var F = a[A.id()]; e && A.removed() || F || (a[A.id()] = true, A.isNode() ? (n.push(A), o(A), s(A)) : n.unshift(A)); } for (var l = 0, c = r.length; l < c; l++) { var d = r[l]; u(d); } function f(A, F) { var R = A._private.edges; ta(R, F), A.clearTraversalCache(); } function h10(A) { A.clearTraversalCache(); } var v = []; v.ids = {}; function p(A, F) { F = F[0], A = A[0]; var R = A._private.children, M = A.id(); ta(R, F), F._private.parent = null, v.ids[M] || (v.ids[M] = true, v.push(A)); } r.dirtyCompoundBoundsCache(), e && i.removeFromPool(n); for (var g = 0; g < n.length; g++) { var y = n[g]; if (y.isEdge()) { var m = y.source()[0], b = y.target()[0]; f(m, y), f(b, y); for (var w = y.parallelEdges(), x = 0; x < w.length; x++) { var E = w[x]; h10(E), E.isBundledBezier() && E.dirtyBoundingBoxCache(); } } else { var C = y.parent(); C.length !== 0 && p(C, y); } e && (y._private.removed = true); } var k = i._private.elements; i._private.hasCompoundNodes = false; for (var S = 0; S < k.length; S++) { var _ = k[S]; if (_.isParent()) { i._private.hasCompoundNodes = true; break; } } var T = new Yt(this.cy(), n); T.size() > 0 && (t13 ? T.emitAndNotify("remove") : e && T.emit("remove")); for (var O = 0; O < v.length; O++) { var D = v[O]; (!e || !D.removed()) && D.updateStyle(); } return T; }; ft.move = function(t13) { var e = this._private.cy, r = this, n = false, a = false, i = function(v) { return v == null ? v : "" + v; }; if (t13.source !== void 0 || t13.target !== void 0) { var o = i(t13.source), s = i(t13.target), u = o != null && e.hasElementWithId(o), l = s != null && e.hasElementWithId(s); (u || l) && (e.batch(function() { r.remove(n, a), r.emitAndNotify("moveout"); for (var h10 = 0; h10 < r.length; h10++) { var v = r[h10], p = v._private.data; v.isEdge() && (u && (p.source = o), l && (p.target = s)); } r.restore(n, a); }), r.emitAndNotify("move")); } else if (t13.parent !== void 0) { var c = i(t13.parent), d = c === null || e.hasElementWithId(c); if (d) { var f = c === null ? void 0 : c; e.batch(function() { var h10 = r.remove(n, a); h10.emitAndNotify("moveout"); for (var v = 0; v < r.length; v++) { var p = r[v], g = p._private.data; p.isNode() && (g.parent = f); } h10.restore(n, a); }), r.emitAndNotify("move"); } } return this; }; [_S, sz, Ks, Zn, Oi, Ez, Vl, $z, XS, JS, Kz, vl, Gs, jt, Xn, ir].forEach(function(t13) { ze(ft, t13); }); var Xz = { add: function(e) { var r, n = this; if (xr(e)) { var a = e; if (a._private.cy === n) r = a.restore(); else { for (var i = [], o = 0; o < a.length; o++) { var s = a[o]; i.push(s.json()); } r = new Yt(n, i); } } else if (lt(e)) { var u = e; r = new Yt(n, u); } else if (Xe(e) && (lt(e.nodes) || lt(e.edges))) { for (var l = e, c = [], d = ["nodes", "edges"], f = 0, h10 = d.length; f < h10; f++) { var v = d[f], p = l[v]; if (lt(p)) for (var g = 0, y = p.length; g < y; g++) { var m = ze({ group: v }, p[g]); c.push(m); } } r = new Yt(n, c); } else { var b = e; r = new Ml(n, b).collection(); } return r; }, remove: function(e) { if (!xr(e)) { if (Me(e)) { var r = e; e = this.$(r); } } return e.remove(); } }; function Jz(t13, e, r, n) { var a = 4, i = 1e-3, o = 1e-7, s = 10, u = 11, l = 1 / (u - 1), c = typeof Float32Array < "u"; if (arguments.length !== 4) return false; for (var d = 0; d < 4; ++d) if (typeof arguments[d] != "number" || isNaN(arguments[d]) || !isFinite(arguments[d])) return false; t13 = Math.min(t13, 1), r = Math.min(r, 1), t13 = Math.max(t13, 0), r = Math.max(r, 0); var f = c ? new Float32Array(u) : new Array(u); function h10(_, T) { return 1 - 3 * T + 3 * _; } function v(_, T) { return 3 * T - 6 * _; } function p(_) { return 3 * _; } function g(_, T, O) { return ((h10(T, O) * _ + v(T, O)) * _ + p(T)) * _; } function y(_, T, O) { return 3 * h10(T, O) * _ * _ + 2 * v(T, O) * _ + p(T); } function m(_, T) { for (var O = 0; O < a; ++O) { var D = y(T, t13, r); if (D === 0) return T; var A = g(T, t13, r) - _; T -= A / D; } return T; } function b() { for (var _ = 0; _ < u; ++_) f[_] = g(_ * l, t13, r); } function w(_, T, O) { var D, A, F = 0; do A = T + (O - T) / 2, D = g(A, t13, r) - _, D > 0 ? O = A : T = A; while (Math.abs(D) > o && ++F < s); return A; } function x(_) { for (var T = 0, O = 1, D = u - 1; O !== D && f[O] <= _; ++O) T += l; --O; var A = (_ - f[O]) / (f[O + 1] - f[O]), F = T + A * l, R = y(F, t13, r); return R >= i ? m(_, F) : R === 0 ? F : w(_, T, T + l); } var E = false; function C() { E = true, (t13 !== e || r !== n) && b(); } var k = function(T) { return E || C(), t13 === e && r === n ? T : T === 0 ? 0 : T === 1 ? 1 : g(x(T), e, n); }; k.getControlPoints = function() { return [{ x: t13, y: e }, { x: r, y: n }]; }; var S = "generateBezier(" + [t13, e, r, n] + ")"; return k.toString = function() { return S; }, k; } var Qz = /* @__PURE__ */ function() { function t13(n) { return -n.tension * n.x - n.friction * n.v; } function e(n, a, i) { var o = { x: n.x + i.dx * a, v: n.v + i.dv * a, tension: n.tension, friction: n.friction }; return { dx: o.v, dv: t13(o) }; } function r(n, a) { var i = { dx: n.v, dv: t13(n) }, o = e(n, a * 0.5, i), s = e(n, a * 0.5, o), u = e(n, a, s), l = 1 / 6 * (i.dx + 2 * (o.dx + s.dx) + u.dx), c = 1 / 6 * (i.dv + 2 * (o.dv + s.dv) + u.dv); return n.x = n.x + l * a, n.v = n.v + c * a, n; } return function n(a, i, o) { var s = { x: -1, v: 0, tension: null, friction: null }, u = [0], l = 0, c = 1 / 1e4, d = 16 / 1e3, f, h10, v; for (a = parseFloat(a) || 500, i = parseFloat(i) || 20, o = o || null, s.tension = a, s.friction = i, f = o !== null, f ? (l = n(a, i), h10 = l / o * d) : h10 = d; v = r(v || s, h10), u.push(1 + v.x), l += 16, Math.abs(v.x) > c && Math.abs(v.v) > c; ) ; return f ? function(p) { return u[p * (u.length - 1) | 0]; } : l; }; }(); var ct = function(e, r, n, a) { var i = Jz(e, r, n, a); return function(o, s, u) { return o + (s - o) * i(u); }; }; var Us = { linear: function(e, r, n) { return e + (r - e) * n; }, // default easings ease: ct(0.25, 0.1, 0.25, 1), "ease-in": ct(0.42, 0, 1, 1), "ease-out": ct(0, 0, 0.58, 1), "ease-in-out": ct(0.42, 0, 0.58, 1), // sine "ease-in-sine": ct(0.47, 0, 0.745, 0.715), "ease-out-sine": ct(0.39, 0.575, 0.565, 1), "ease-in-out-sine": ct(0.445, 0.05, 0.55, 0.95), // quad "ease-in-quad": ct(0.55, 0.085, 0.68, 0.53), "ease-out-quad": ct(0.25, 0.46, 0.45, 0.94), "ease-in-out-quad": ct(0.455, 0.03, 0.515, 0.955), // cubic "ease-in-cubic": ct(0.55, 0.055, 0.675, 0.19), "ease-out-cubic": ct(0.215, 0.61, 0.355, 1), "ease-in-out-cubic": ct(0.645, 0.045, 0.355, 1), // quart "ease-in-quart": ct(0.895, 0.03, 0.685, 0.22), "ease-out-quart": ct(0.165, 0.84, 0.44, 1), "ease-in-out-quart": ct(0.77, 0, 0.175, 1), // quint "ease-in-quint": ct(0.755, 0.05, 0.855, 0.06), "ease-out-quint": ct(0.23, 1, 0.32, 1), "ease-in-out-quint": ct(0.86, 0, 0.07, 1), // expo "ease-in-expo": ct(0.95, 0.05, 0.795, 0.035), "ease-out-expo": ct(0.19, 1, 0.22, 1), "ease-in-out-expo": ct(1, 0, 0, 1), // circ "ease-in-circ": ct(0.6, 0.04, 0.98, 0.335), "ease-out-circ": ct(0.075, 0.82, 0.165, 1), "ease-in-out-circ": ct(0.785, 0.135, 0.15, 0.86), // user param easings... spring: function(e, r, n) { if (n === 0) return Us.linear; var a = Qz(e, r, n); return function(i, o, s) { return i + (o - i) * a(s); }; }, "cubic-bezier": ct }; function A0(t13, e, r, n, a) { if (n === 1 || e === r) return r; var i = a(e, r, n); return t13 == null || ((t13.roundValue || t13.color) && (i = Math.round(i)), t13.min !== void 0 && (i = Math.max(i, t13.min)), t13.max !== void 0 && (i = Math.min(i, t13.max))), i; } function P0(t13, e) { return t13.pfValue != null || t13.value != null ? t13.pfValue != null && (e == null || e.type.units !== "%") ? t13.pfValue : t13.value : t13; } function ri(t13, e, r, n, a) { var i = a != null ? a.type : null; r < 0 ? r = 0 : r > 1 && (r = 1); var o = P0(t13, a), s = P0(e, a); if (Ce(o) && Ce(s)) return A0(i, o, s, r, n); if (lt(o) && lt(s)) { for (var u = [], l = 0; l < s.length; l++) { var c = o[l], d = s[l]; if (c != null && d != null) { var f = A0(i, c, d, r, n); u.push(f); } else u.push(d); } return u; } } function e8(t13, e, r, n) { var a = !n, i = t13._private, o = e._private, s = o.easing, u = o.startTime, l = n ? t13 : t13.cy(), c = l.style(); if (!o.easingImpl) if (s == null) o.easingImpl = Us.linear; else { var d; if (Me(s)) { var f = c.parse("transition-timing-function", s); d = f.value; } else d = s; var h10, v; Me(d) ? (h10 = d, v = []) : (h10 = d[1], v = d.slice(2).map(function(V) { return +V; })), v.length > 0 ? (h10 === "spring" && v.push(o.duration), o.easingImpl = Us[h10].apply(null, v)) : o.easingImpl = Us[h10]; } var p = o.easingImpl, g; if (o.duration === 0 ? g = 1 : g = (r - u) / o.duration, o.applying && (g = o.progress), g < 0 ? g = 0 : g > 1 && (g = 1), o.delay == null) { var y = o.startPosition, m = o.position; if (m && a && !t13.locked()) { var b = {}; io(y.x, m.x) && (b.x = ri(y.x, m.x, g, p)), io(y.y, m.y) && (b.y = ri(y.y, m.y, g, p)), t13.position(b); } var w = o.startPan, x = o.pan, E = i.pan, C = x != null && n; C && (io(w.x, x.x) && (E.x = ri(w.x, x.x, g, p)), io(w.y, x.y) && (E.y = ri(w.y, x.y, g, p)), t13.emit("pan")); var k = o.startZoom, S = o.zoom, _ = S != null && n; _ && (io(k, S) && (i.zoom = Fo(i.minZoom, ri(k, S, g, p), i.maxZoom)), t13.emit("zoom")), (C || _) && t13.emit("viewport"); var T = o.style; if (T && T.length > 0 && a) { for (var O = 0; O < T.length; O++) { var D = T[O], A = D.name, F = D, R = o.startStyle[A], M = c.properties[R.name], L = ri(R, F, g, p, M); c.overrideBypass(t13, A, L); } t13.emit("style"); } } return o.progress = g, g; } function io(t13, e) { return t13 == null || e == null ? false : Ce(t13) && Ce(e) ? true : !!(t13 && e); } function t8(t13, e, r, n) { var a = e._private; a.started = true, a.startTime = r - a.progress * a.duration; } function D0(t13, e) { var r = e._private.aniEles, n = []; function a(c, d) { var f = c._private, h10 = f.animation.current, v = f.animation.queue, p = false; if (h10.length === 0) { var g = v.shift(); g && h10.push(g); } for (var y = function(E) { for (var C = E.length - 1; C >= 0; C--) { var k = E[C]; k(); } E.splice(0, E.length); }, m = h10.length - 1; m >= 0; m--) { var b = h10[m], w = b._private; if (w.stopped) { h10.splice(m, 1), w.hooked = false, w.playing = false, w.started = false, y(w.frames); continue; } !w.playing && !w.applying || (w.playing && w.applying && (w.applying = false), w.started || t8(c, b, t13), e8(c, b, t13, d), w.applying && (w.applying = false), y(w.frames), w.step != null && w.step(t13), b.completed() && (h10.splice(m, 1), w.hooked = false, w.playing = false, w.started = false, y(w.completes)), p = true); } return !d && h10.length === 0 && v.length === 0 && n.push(c), p; } for (var i = false, o = 0; o < r.length; o++) { var s = r[o], u = a(s); i = i || u; } var l = a(e, true); (i || l) && (r.length > 0 ? e.notify("draw", r) : e.notify("draw")), r.unmerge(n), e.emit("step"); } var r8 = { // pull in animation functions animate: et.animate(), animation: et.animation(), animated: et.animated(), clearQueue: et.clearQueue(), delay: et.delay(), delayAnimation: et.delayAnimation(), stop: et.stop(), addToAnimationPool: function(e) { var r = this; r.styleEnabled() && r._private.aniEles.merge(e); }, stopAnimationLoop: function() { this._private.animationsRunning = false; }, startAnimationLoop: function() { var e = this; if (e._private.animationsRunning = true, !e.styleEnabled()) return; function r() { e._private.animationsRunning && ll(function(i) { D0(i, e), r(); }); } var n = e.renderer(); n && n.beforeRender ? n.beforeRender(function(i, o) { D0(o, e); }, n.beforeRenderPriorities.animations) : r(); } }; var n8 = { qualifierCompare: function(e, r) { return e == null || r == null ? e == null && r == null : e.sameText(r); }, eventMatches: function(e, r, n) { var a = r.qualifier; return a != null ? e !== n.target && rs(n.target) && a.matches(n.target) : true; }, addEventFields: function(e, r) { r.cy = e, r.target = e; }, callbackContext: function(e, r, n) { return r.qualifier != null ? n.target : e; } }; var Ls = function(e) { return Me(e) ? new ra(e) : e; }; var tk = { createEmitter: function() { var e = this._private; return e.emitter || (e.emitter = new Hl(n8, this)), this; }, emitter: function() { return this._private.emitter; }, on: function(e, r, n) { return this.emitter().on(e, Ls(r), n), this; }, removeListener: function(e, r, n) { return this.emitter().removeListener(e, Ls(r), n), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, one: function(e, r, n) { return this.emitter().one(e, Ls(r), n), this; }, once: function(e, r, n) { return this.emitter().one(e, Ls(r), n), this; }, emit: function(e, r) { return this.emitter().emit(e, r), this; }, emitAndNotify: function(e, r) { return this.emit(e), this.notify(e, r), this; } }; et.eventAliasesOn(tk); var Pp = { png: function(e) { var r = this._private.renderer; return e = e || {}, r.png(e); }, jpg: function(e) { var r = this._private.renderer; return e = e || {}, e.bg = e.bg || "#fff", r.jpg(e); } }; Pp.jpeg = Pp.jpg; var Ws = { layout: function(e) { var r = this; if (e == null) { bt("Layout options must be specified to make a layout"); return; } if (e.name == null) { bt("A `name` must be specified to make a layout"); return; } var n = e.name, a = r.extension("layout", n); if (a == null) { bt("No such layout `" + n + "` found. Did you forget to import it and `cytoscape.use()` it?"); return; } var i; Me(e.eles) ? i = r.$(e.eles) : i = e.eles != null ? e.eles : r.$(); var o = new a(ze({}, e, { cy: r, eles: i })); return o; } }; Ws.createLayout = Ws.makeLayout = Ws.layout; var a8 = { notify: function(e, r) { var n = this._private; if (this.batching()) { n.batchNotifications = n.batchNotifications || {}; var a = n.batchNotifications[e] = n.batchNotifications[e] || this.collection(); r != null && a.merge(r); return; } if (n.notificationsEnabled) { var i = this.renderer(); this.destroyed() || !i || i.notify(e, r); } }, notifications: function(e) { var r = this._private; return e === void 0 ? r.notificationsEnabled : (r.notificationsEnabled = !!e, this); }, noNotifications: function(e) { this.notifications(false), e(), this.notifications(true); }, batching: function() { return this._private.batchCount > 0; }, startBatch: function() { var e = this._private; return e.batchCount == null && (e.batchCount = 0), e.batchCount === 0 && (e.batchStyleEles = this.collection(), e.batchNotifications = {}), e.batchCount++, this; }, endBatch: function() { var e = this._private; if (e.batchCount === 0) return this; if (e.batchCount--, e.batchCount === 0) { e.batchStyleEles.updateStyle(); var r = this.renderer(); Object.keys(e.batchNotifications).forEach(function(n) { var a = e.batchNotifications[n]; a.empty() ? r.notify(n) : r.notify(n, a); }); } return this; }, batch: function(e) { return this.startBatch(), e(), this.endBatch(), this; }, // for backwards compatibility batchData: function(e) { var r = this; return this.batch(function() { for (var n = Object.keys(e), a = 0; a < n.length; a++) { var i = n[a], o = e[i], s = r.getElementById(i); s.data(o); } }); } }; var i8 = Zt({ hideEdgesOnViewport: false, textureOnViewport: false, motionBlur: false, motionBlurOpacity: 0.05, pixelRatio: void 0, desktopTapThreshold: 4, touchTapThreshold: 8, wheelSensitivity: 1, debug: false, showFps: false }); var Dp = { renderTo: function(e, r, n, a) { var i = this._private.renderer; return i.renderTo(e, r, n, a), this; }, renderer: function() { return this._private.renderer; }, forceRender: function() { return this.notify("draw"), this; }, resize: function() { return this.invalidateSize(), this.emitAndNotify("resize"), this; }, initRenderer: function(e) { var r = this, n = r.extension("renderer", e.name); if (n == null) { bt("Can not initialise: No such renderer `".concat(e.name, "` found. Did you forget to import it and `cytoscape.use()` it?")); return; } e.wheelSensitivity !== void 0 && tt("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine."); var a = i8(e); a.cy = r, r._private.renderer = new n(a), this.notify("init"); }, destroyRenderer: function() { var e = this; e.notify("destroy"); var r = e.container(); if (r) for (r._cyreg = null; r.childNodes.length > 0; ) r.removeChild(r.childNodes[0]); e._private.renderer = null, e.mutableElements().forEach(function(n) { var a = n._private; a.rscratch = {}, a.rstyle = {}, a.animation.current = [], a.animation.queue = []; }); }, onRender: function(e) { return this.on("render", e); }, offRender: function(e) { return this.off("render", e); } }; Dp.invalidateDimensions = Dp.resize; var js = { // get a collection // - empty collection on no args // - collection of elements in the graph on selector arg // - guarantee a returned collection when elements or collection specified collection: function(e, r) { return Me(e) ? this.$(e) : xr(e) ? e.collection() : lt(e) ? (r || (r = {}), new Yt(this, e, r.unique, r.removed)) : new Yt(this); }, nodes: function(e) { var r = this.$(function(n) { return n.isNode(); }); return e ? r.filter(e) : r; }, edges: function(e) { var r = this.$(function(n) { return n.isEdge(); }); return e ? r.filter(e) : r; }, // search the graph like jQuery $: function(e) { var r = this._private.elements; return e ? r.filter(e) : r.spawnSelf(); }, mutableElements: function() { return this._private.elements; } }; js.elements = js.filter = js.$; var sr = {}; var Co = "t"; var o8 = "f"; sr.apply = function(t13) { for (var e = this, r = e._private, n = r.cy, a = n.collection(), i = 0; i < t13.length; i++) { var o = t13[i], s = e.getContextMeta(o); if (!s.empty) { var u = e.getContextStyle(s), l = e.applyContextStyle(s, u, o); o._private.appliedInitStyle ? e.updateTransitions(o, l.diffProps) : o._private.appliedInitStyle = true; var c = e.updateStyleHints(o); c && a.push(o); } } return a; }; sr.getPropertiesDiff = function(t13, e) { var r = this, n = r._private.propDiffs = r._private.propDiffs || {}, a = t13 + "-" + e, i = n[a]; if (i) return i; for (var o = [], s = {}, u = 0; u < r.length; u++) { var l = r[u], c = t13[u] === Co, d = e[u] === Co, f = c !== d, h10 = l.mappedProperties.length > 0; if (f || d && h10) { var v = void 0; f && h10 || f ? v = l.properties : h10 && (v = l.mappedProperties); for (var p = 0; p < v.length; p++) { for (var g = v[p], y = g.name, m = false, b = u + 1; b < r.length; b++) { var w = r[b], x = e[b] === Co; if (x && (m = w.properties[g.name] != null, m)) break; } !s[y] && !m && (s[y] = true, o.push(y)); } } } return n[a] = o, o; }; sr.getContextMeta = function(t13) { for (var e = this, r = "", n, a = t13._private.styleCxtKey || "", i = 0; i < e.length; i++) { var o = e[i], s = o.selector && o.selector.matches(t13); s ? r += Co : r += o8; } return n = e.getPropertiesDiff(a, r), t13._private.styleCxtKey = r, { key: r, diffPropNames: n, empty: n.length === 0 }; }; sr.getContextStyle = function(t13) { var e = t13.key, r = this, n = this._private.contextStyles = this._private.contextStyles || {}; if (n[e]) return n[e]; for (var a = { _private: { key: e } }, i = 0; i < r.length; i++) { var o = r[i], s = e[i] === Co; if (s) for (var u = 0; u < o.properties.length; u++) { var l = o.properties[u]; a[l.name] = l; } } return n[e] = a, a; }; sr.applyContextStyle = function(t13, e, r) { for (var n = this, a = t13.diffPropNames, i = {}, o = n.types, s = 0; s < a.length; s++) { var u = a[s], l = e[u], c = r.pstyle(u); if (!l) if (c) c.bypass ? l = { name: u, deleteBypassed: true } : l = { name: u, delete: true }; else continue; if (c !== l) { if (l.mapped === o.fn && c != null && c.mapping != null && c.mapping.value === l.value) { var d = c.mapping, f = d.fnValue = l.value(r); if (f === d.prevFnValue) continue; } var h10 = i[u] = { prev: c }; n.applyParsedProperty(r, l), h10.next = r.pstyle(u), h10.next && h10.next.bypass && (h10.next = h10.next.bypassed); } } return { diffProps: i }; }; sr.updateStyleHints = function(t13) { var e = t13._private, r = this, n = r.propertyGroupNames, a = r.propertyGroupKeys, i = function(Q, ge, we) { return r.getPropertiesHash(Q, ge, we); }, o = e.styleKey; if (t13.removed()) return false; var s = e.group === "nodes", u = t13._private.style; n = Object.keys(u); for (var l = 0; l < a.length; l++) { var c = a[l]; e.styleKeys[c] = [li, uo]; } for (var d = function(Q, ge) { return e.styleKeys[ge][0] = Do(Q, e.styleKeys[ge][0]); }, f = function(Q, ge) { return e.styleKeys[ge][1] = Ro(Q, e.styleKeys[ge][1]); }, h10 = function(Q, ge) { d(Q, ge), f(Q, ge); }, v = function(Q, ge) { for (var we = 0; we < Q.length; we++) { var fe = Q.charCodeAt(we); d(fe, ge), f(fe, ge); } }, p = 2e9, g = function(Q) { return -128 < Q && Q < 128 && Math.floor(Q) !== Q ? p - (Q * 1024 | 0) : Q; }, y = 0; y < n.length; y++) { var m = n[y], b = u[m]; if (b != null) { var w = this.properties[m], x = w.type, E = w.groupKey, C = void 0; w.hashOverride != null ? C = w.hashOverride(t13, b) : b.pfValue != null && (C = b.pfValue); var k = w.enums == null ? b.value : null, S = C != null, _ = k != null, T = S || _, O = b.units; if (x.number && T && !x.multiple) { var D = S ? C : k; h10(g(D), E), !S && O != null && v(O, E); } else v(b.strValue, E); } } for (var A = [li, uo], F = 0; F < a.length; F++) { var R = a[F], M = e.styleKeys[R]; A[0] = Do(M[0], A[0]), A[1] = Ro(M[1], A[1]); } e.styleKey = d$(A[0], A[1]); var L = e.styleKeys; e.labelDimsKey = $n(L.labelDimensions); var V = i(t13, ["label"], L.labelDimensions); if (e.labelKey = $n(V), e.labelStyleKey = $n(ks(L.commonLabel, V)), !s) { var Y = i(t13, ["source-label"], L.labelDimensions); e.sourceLabelKey = $n(Y), e.sourceLabelStyleKey = $n(ks(L.commonLabel, Y)); var H = i(t13, ["target-label"], L.labelDimensions); e.targetLabelKey = $n(H), e.targetLabelStyleKey = $n(ks(L.commonLabel, H)); } if (s) { var K = e.styleKeys, ne = K.nodeBody, B = K.nodeBorder, $ = K.nodeOutline, z = K.backgroundImage, W = K.compound, Z = K.pie, N = [ne, B, $, z, W, Z].filter(function(X) { return X != null; }).reduce(ks, [li, uo]); e.nodeKey = $n(N), e.hasPie = Z != null && Z[0] !== li && Z[1] !== uo; } return o !== e.styleKey; }; sr.clearStyleHints = function(t13) { var e = t13._private; e.styleCxtKey = "", e.styleKeys = {}, e.styleKey = null, e.labelKey = null, e.labelStyleKey = null, e.sourceLabelKey = null, e.sourceLabelStyleKey = null, e.targetLabelKey = null, e.targetLabelStyleKey = null, e.nodeKey = null, e.hasPie = null; }; sr.applyParsedProperty = function(t13, e) { var r = this, n = e, a = t13._private.style, i, o = r.types, s = r.properties[n.name].type, u = n.bypass, l = a[n.name], c = l && l.bypass, d = t13._private, f = "mapping", h10 = function(ne) { return ne == null ? null : ne.pfValue != null ? ne.pfValue : ne.value; }, v = function() { var ne = h10(l), B = h10(n); r.checkTriggers(t13, n.name, ne, B); }; if (e.name === "curve-style" && t13.isEdge() && // loops must be bundled beziers (e.value !== "bezier" && t13.isLoop() || // edges connected to compound nodes can not be haystacks e.value === "haystack" && (t13.source().isParent() || t13.target().isParent())) && (n = e = this.parse(e.name, "bezier", u)), n.delete) return a[n.name] = void 0, v(), true; if (n.deleteBypassed) return l ? l.bypass ? (l.bypassed = void 0, v(), true) : false : (v(), true); if (n.deleteBypass) return l ? l.bypass ? (a[n.name] = l.bypassed, v(), true) : false : (v(), true); var p = function() { tt("Do not assign mappings to elements without corresponding data (i.e. ele `" + t13.id() + "` has no mapping for property `" + n.name + "` with data field `" + n.field + "`); try a `[" + n.field + "]` selector to limit scope to elements with `" + n.field + "` defined"); }; switch (n.mapped) { case o.mapData: { for (var g = n.field.split("."), y = d.data, m = 0; m < g.length && y; m++) { var b = g[m]; y = y[b]; } if (y == null) return p(), false; var w; if (Ce(y)) { var x = n.fieldMax - n.fieldMin; x === 0 ? w = 0 : w = (y - n.fieldMin) / x; } else return tt("Do not use continuous mappers without specifying numeric data (i.e. `" + n.field + ": " + y + "` for `" + t13.id() + "` is non-numeric)"), false; if (w < 0 ? w = 0 : w > 1 && (w = 1), s.color) { var E = n.valueMin[0], C = n.valueMax[0], k = n.valueMin[1], S = n.valueMax[1], _ = n.valueMin[2], T = n.valueMax[2], O = n.valueMin[3] == null ? 1 : n.valueMin[3], D = n.valueMax[3] == null ? 1 : n.valueMax[3], A = [Math.round(E + (C - E) * w), Math.round(k + (S - k) * w), Math.round(_ + (T - _) * w), Math.round(O + (D - O) * w)]; i = { // colours are simple, so just create the flat property instead of expensive string parsing bypass: n.bypass, // we're a bypass if the mapping property is a bypass name: n.name, value: A, strValue: "rgb(" + A[0] + ", " + A[1] + ", " + A[2] + ")" }; } else if (s.number) { var F = n.valueMin + (n.valueMax - n.valueMin) * w; i = this.parse(n.name, F, n.bypass, f); } else return false; if (!i) return p(), false; i.mapping = n, n = i; break; } case o.data: { for (var R = n.field.split("."), M = d.data, L = 0; L < R.length && M; L++) { var V = R[L]; M = M[V]; } if (M != null && (i = this.parse(n.name, M, n.bypass, f)), !i) return p(), false; i.mapping = n, n = i; break; } case o.fn: { var Y = n.value, H = n.fnValue != null ? n.fnValue : Y(t13); if (n.prevFnValue = H, H == null) return tt("Custom function mappers may not return null (i.e. `" + n.name + "` for ele `" + t13.id() + "` is null)"), false; if (i = this.parse(n.name, H, n.bypass, f), !i) return tt("Custom function mappers may not return invalid values for the property type (i.e. `" + n.name + "` for ele `" + t13.id() + "` is invalid)"), false; i.mapping = rn(n), n = i; break; } case void 0: break; default: return false; } return u ? (c ? n.bypassed = l.bypassed : n.bypassed = l, a[n.name] = n) : c ? l.bypassed = n : a[n.name] = n, v(), true; }; sr.cleanElements = function(t13, e) { for (var r = 0; r < t13.length; r++) { var n = t13[r]; if (this.clearStyleHints(n), n.dirtyCompoundBoundsCache(), n.dirtyBoundingBoxCache(), !e) n._private.style = {}; else for (var a = n._private.style, i = Object.keys(a), o = 0; o < i.length; o++) { var s = i[o], u = a[s]; u != null && (u.bypass ? u.bypassed = null : a[s] = null); } } }; sr.update = function() { var t13 = this._private.cy, e = t13.mutableElements(); e.updateStyle(); }; sr.updateTransitions = function(t13, e) { var r = this, n = t13._private, a = t13.pstyle("transition-property").value, i = t13.pstyle("transition-duration").pfValue, o = t13.pstyle("transition-delay").pfValue; if (a.length > 0 && i > 0) { for (var s = {}, u = false, l = 0; l < a.length; l++) { var c = a[l], d = t13.pstyle(c), f = e[c]; if (f) { var h10 = f.prev, v = h10, p = f.next != null ? f.next : d, g = false, y = void 0, m = 1e-6; v && (Ce(v.pfValue) && Ce(p.pfValue) ? (g = p.pfValue - v.pfValue, y = v.pfValue + m * g) : Ce(v.value) && Ce(p.value) ? (g = p.value - v.value, y = v.value + m * g) : lt(v.value) && lt(p.value) && (g = v.value[0] !== p.value[0] || v.value[1] !== p.value[1] || v.value[2] !== p.value[2], y = v.strValue), g && (s[c] = p.strValue, this.applyBypass(t13, c, y), u = true)); } } if (!u) return; n.transitioning = true, new Mi(function(b) { o > 0 ? t13.delayAnimation(o).play().promise().then(b) : b(); }).then(function() { return t13.animation({ style: s, duration: i, easing: t13.pstyle("transition-timing-function").value, queue: false }).play().promise(); }).then(function() { r.removeBypasses(t13, a), t13.emitAndNotify("style"), n.transitioning = false; }); } else n.transitioning && (this.removeBypasses(t13, a), t13.emitAndNotify("style"), n.transitioning = false); }; sr.checkTrigger = function(t13, e, r, n, a, i) { var o = this.properties[e], s = a(o); s != null && s(r, n) && i(o); }; sr.checkZOrderTrigger = function(t13, e, r, n) { var a = this; this.checkTrigger(t13, e, r, n, function(i) { return i.triggersZOrder; }, function() { a._private.cy.notify("zorder", t13); }); }; sr.checkBoundsTrigger = function(t13, e, r, n) { this.checkTrigger(t13, e, r, n, function(a) { return a.triggersBounds; }, function(a) { t13.dirtyCompoundBoundsCache(), t13.dirtyBoundingBoxCache(), // only for beziers -- so performance of other edges isn't affected a.triggersBoundsOfParallelBeziers && e === "curve-style" && (r === "bezier" || n === "bezier") && t13.parallelEdges().forEach(function(i) { i.isBundledBezier() && i.dirtyBoundingBoxCache(); }), a.triggersBoundsOfConnectedEdges && e === "display" && (r === "none" || n === "none") && t13.connectedEdges().forEach(function(i) { i.dirtyBoundingBoxCache(); }); }); }; sr.checkTriggers = function(t13, e, r, n) { t13.dirtyStyleCache(), this.checkZOrderTrigger(t13, e, r, n), this.checkBoundsTrigger(t13, e, r, n); }; var os = {}; os.applyBypass = function(t13, e, r, n) { var a = this, i = [], o = true; if (e === "*" || e === "**") { if (r !== void 0) for (var s = 0; s < a.properties.length; s++) { var u = a.properties[s], l = u.name, c = this.parse(l, r, true); c && i.push(c); } } else if (Me(e)) { var d = this.parse(e, r, true); d && i.push(d); } else if (Xe(e)) { var f = e; n = r; for (var h10 = Object.keys(f), v = 0; v < h10.length; v++) { var p = h10[v], g = f[p]; if (g === void 0 && (g = f[Rl(p)]), g !== void 0) { var y = this.parse(p, g, true); y && i.push(y); } } } else return false; if (i.length === 0) return false; for (var m = false, b = 0; b < t13.length; b++) { for (var w = t13[b], x = {}, E = void 0, C = 0; C < i.length; C++) { var k = i[C]; if (n) { var S = w.pstyle(k.name); E = x[k.name] = { prev: S }; } m = this.applyParsedProperty(w, rn(k)) || m, n && (E.next = w.pstyle(k.name)); } m && this.updateStyleHints(w), n && this.updateTransitions(w, x, o); } return m; }; os.overrideBypass = function(t13, e, r) { e = Ig(e); for (var n = 0; n < t13.length; n++) { var a = t13[n], i = a._private.style[e], o = this.properties[e].type, s = o.color, u = o.mutiple, l = i ? i.pfValue != null ? i.pfValue : i.value : null; !i || !i.bypass ? this.applyBypass(a, e, r) : (i.value = r, i.pfValue != null && (i.pfValue = r), s ? i.strValue = "rgb(" + r.join(",") + ")" : u ? i.strValue = r.join(" ") : i.strValue = "" + r, this.updateStyleHints(a)), this.checkTriggers(a, e, l, r); } }; os.removeAllBypasses = function(t13, e) { return this.removeBypasses(t13, this.propertyNames, e); }; os.removeBypasses = function(t13, e, r) { for (var n = true, a = 0; a < t13.length; a++) { for (var i = t13[a], o = {}, s = 0; s < e.length; s++) { var u = e[s], l = this.properties[u], c = i.pstyle(l.name); if (!(!c || !c.bypass)) { var d = "", f = this.parse(u, d, true), h10 = o[l.name] = { prev: c }; this.applyParsedProperty(i, f), h10.next = i.pstyle(l.name); } } this.updateStyleHints(i), r && this.updateTransitions(i, o, n); } }; var Vg = {}; Vg.getEmSizeInPixels = function() { var t13 = this.containerCss("font-size"); return t13 != null ? parseFloat(t13) : 1; }; Vg.containerCss = function(t13) { var e = this._private.cy, r = e.container(), n = e.window(); if (n && r && n.getComputedStyle) return n.getComputedStyle(r).getPropertyValue(t13); }; var un = {}; un.getRenderedStyle = function(t13, e) { return e ? this.getStylePropertyValue(t13, e, true) : this.getRawStyle(t13, true); }; un.getRawStyle = function(t13, e) { var r = this; if (t13 = t13[0], t13) { for (var n = {}, a = 0; a < r.properties.length; a++) { var i = r.properties[a], o = r.getStylePropertyValue(t13, i.name, e); o != null && (n[i.name] = o, n[Rl(i.name)] = o); } return n; } }; un.getIndexedStyle = function(t13, e, r, n) { var a = t13.pstyle(e)[r][n]; return a ?? t13.cy().style().getDefaultProperty(e)[r][0]; }; un.getStylePropertyValue = function(t13, e, r) { var n = this; if (t13 = t13[0], t13) { var a = n.properties[e]; a.alias && (a = a.pointsTo); var i = a.type, o = t13.pstyle(a.name); if (o) { var s = o.value, u = o.units, l = o.strValue; if (r && i.number && s != null && Ce(s)) { var c = t13.cy().zoom(), d = function(g) { return g * c; }, f = function(g, y) { return d(g) + y; }, h10 = lt(s), v = h10 ? u.every(function(p) { return p != null; }) : u != null; return v ? h10 ? s.map(function(p, g) { return f(p, u[g]); }).join(" ") : f(s, u) : h10 ? s.map(function(p) { return Me(p) ? p : "" + d(p); }).join(" ") : "" + d(s); } else if (l != null) return l; } return null; } }; un.getAnimationStartStyle = function(t13, e) { for (var r = {}, n = 0; n < e.length; n++) { var a = e[n], i = a.name, o = t13.pstyle(i); o !== void 0 && (Xe(o) ? o = this.parse(i, o.strValue) : o = this.parse(i, o)), o && (r[i] = o); } return r; }; un.getPropsList = function(t13) { var e = this, r = [], n = t13, a = e.properties; if (n) for (var i = Object.keys(n), o = 0; o < i.length; o++) { var s = i[o], u = n[s], l = a[s] || a[Ig(s)], c = this.parse(l.name, u); c && r.push(c); } return r; }; un.getNonDefaultPropertiesHash = function(t13, e, r) { var n = r.slice(), a, i, o, s, u, l; for (u = 0; u < e.length; u++) if (a = e[u], i = t13.pstyle(a, false), i != null) if (i.pfValue != null) n[0] = Do(s, n[0]), n[1] = Ro(s, n[1]); else for (o = i.strValue, l = 0; l < o.length; l++) s = o.charCodeAt(l), n[0] = Do(s, n[0]), n[1] = Ro(s, n[1]); return n; }; un.getPropertiesHash = un.getNonDefaultPropertiesHash; var Ul = {}; Ul.appendFromJson = function(t13) { for (var e = this, r = 0; r < t13.length; r++) { var n = t13[r], a = n.selector, i = n.style || n.css, o = Object.keys(i); e.selector(a); for (var s = 0; s < o.length; s++) { var u = o[s], l = i[u]; e.css(u, l); } } return e; }; Ul.fromJson = function(t13) { var e = this; return e.resetToDefault(), e.appendFromJson(t13), e; }; Ul.json = function() { for (var t13 = [], e = this.defaultLength; e < this.length; e++) { for (var r = this[e], n = r.selector, a = r.properties, i = {}, o = 0; o < a.length; o++) { var s = a[o]; i[s.name] = s.strValue; } t13.push({ selector: n ? n.toString() : "core", style: i }); } return t13; }; var Hg = {}; Hg.appendFromString = function(t13) { var e = this, r = this, n = "" + t13, a, i, o; n = n.replace(/[/][*](\s|.)+?[*][/]/g, ""); function s() { n.length > a.length ? n = n.substr(a.length) : n = ""; } function u() { i.length > o.length ? i = i.substr(o.length) : i = ""; } for (; ; ) { var l = n.match(/^\s*$/); if (l) break; var c = n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/); if (!c) { tt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: " + n); break; } a = c[0]; var d = c[1]; if (d !== "core") { var f = new ra(d); if (f.invalid) { tt("Skipping parsing of block: Invalid selector found in string stylesheet: " + d), s(); continue; } } var h10 = c[2], v = false; i = h10; for (var p = []; ; ) { var g = i.match(/^\s*$/); if (g) break; var y = i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/); if (!y) { tt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:" + h10), v = true; break; } o = y[0]; var m = y[1], b = y[2], w = e.properties[m]; if (!w) { tt("Skipping property: Invalid property name in: " + o), u(); continue; } var x = r.parse(m, b); if (!x) { tt("Skipping property: Invalid property definition in: " + o), u(); continue; } p.push({ name: m, val: b }), u(); } if (v) { s(); break; } r.selector(d); for (var E = 0; E < p.length; E++) { var C = p[E]; r.css(C.name, C.val); } s(); } return r; }; Hg.fromString = function(t13) { var e = this; return e.resetToDefault(), e.appendFromString(t13), e; }; var Ht = {}; (function() { var t13 = Mt, e = hB, r = gB, n = yB, a = mB, i = function(N) { return "^" + N + "\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"; }, o = function(N) { var X = t13 + "|\\w+|" + e + "|" + r + "|" + n + "|" + a; return "^" + N + "\\s*\\(([\\w\\.]+)\\s*\\,\\s*(" + t13 + ")\\s*\\,\\s*(" + t13 + ")\\s*,\\s*(" + X + ")\\s*\\,\\s*(" + X + ")\\)$"; }, s = [`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`, "^(none)$", "^(.+)$"]; Ht.types = { time: { number: true, min: 0, units: "s|ms", implicitUnits: "ms" }, percent: { number: true, min: 0, max: 100, units: "%", implicitUnits: "%" }, percentages: { number: true, min: 0, max: 100, units: "%", implicitUnits: "%", multiple: true }, zeroOneNumber: { number: true, min: 0, max: 1, unitless: true }, zeroOneNumbers: { number: true, min: 0, max: 1, unitless: true, multiple: true }, nOneOneNumber: { number: true, min: -1, max: 1, unitless: true }, nonNegativeInt: { number: true, min: 0, integer: true, unitless: true }, nonNegativeNumber: { number: true, min: 0, unitless: true }, position: { enums: ["parent", "origin"] }, nodeSize: { number: true, min: 0, enums: ["label"] }, number: { number: true, unitless: true }, numbers: { number: true, unitless: true, multiple: true }, positiveNumber: { number: true, unitless: true, min: 0, strictMin: true }, size: { number: true, min: 0 }, bidirectionalSize: { number: true }, // allows negative bidirectionalSizeMaybePercent: { number: true, allowPercent: true }, // allows negative bidirectionalSizes: { number: true, multiple: true }, // allows negative sizeMaybePercent: { number: true, min: 0, allowPercent: true }, axisDirection: { enums: ["horizontal", "leftward", "rightward", "vertical", "upward", "downward", "auto"] }, paddingRelativeTo: { enums: ["width", "height", "average", "min", "max"] }, bgWH: { number: true, min: 0, allowPercent: true, enums: ["auto"], multiple: true }, bgPos: { number: true, allowPercent: true, multiple: true }, bgRelativeTo: { enums: ["inner", "include-padding"], multiple: true }, bgRepeat: { enums: ["repeat", "repeat-x", "repeat-y", "no-repeat"], multiple: true }, bgFit: { enums: ["none", "contain", "cover"], multiple: true }, bgCrossOrigin: { enums: ["anonymous", "use-credentials", "null"], multiple: true }, bgClip: { enums: ["none", "node"], multiple: true }, bgContainment: { enums: ["inside", "over"], multiple: true }, color: { color: true }, colors: { color: true, multiple: true }, fill: { enums: ["solid", "linear-gradient", "radial-gradient"] }, bool: { enums: ["yes", "no"] }, bools: { enums: ["yes", "no"], multiple: true }, lineStyle: { enums: ["solid", "dotted", "dashed"] }, lineCap: { enums: ["butt", "round", "square"] }, linePosition: { enums: ["center", "inside", "outside"] }, lineJoin: { enums: ["round", "bevel", "miter"] }, borderStyle: { enums: ["solid", "dotted", "dashed", "double"] }, curveStyle: { enums: ["bezier", "unbundled-bezier", "haystack", "segments", "straight", "straight-triangle", "taxi", "round-segments", "round-taxi"] }, radiusType: { enums: ["arc-radius", "influence-radius"], multiple: true }, fontFamily: { regex: '^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$' }, fontStyle: { enums: ["italic", "normal", "oblique"] }, fontWeight: { enums: ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "800", "900", 100, 200, 300, 400, 500, 600, 700, 800, 900] }, textDecoration: { enums: ["none", "underline", "overline", "line-through"] }, textTransform: { enums: ["none", "uppercase", "lowercase"] }, textWrap: { enums: ["none", "wrap", "ellipsis"] }, textOverflowWrap: { enums: ["whitespace", "anywhere"] }, textBackgroundShape: { enums: ["rectangle", "roundrectangle", "round-rectangle"] }, nodeShape: { enums: ["rectangle", "roundrectangle", "round-rectangle", "cutrectangle", "cut-rectangle", "bottomroundrectangle", "bottom-round-rectangle", "barrel", "ellipse", "triangle", "round-triangle", "square", "pentagon", "round-pentagon", "hexagon", "round-hexagon", "concavehexagon", "concave-hexagon", "heptagon", "round-heptagon", "octagon", "round-octagon", "tag", "round-tag", "star", "diamond", "round-diamond", "vee", "rhomboid", "right-rhomboid", "polygon"] }, overlayShape: { enums: ["roundrectangle", "round-rectangle", "ellipse"] }, cornerRadius: { number: true, min: 0, units: "px|em", implicitUnits: "px", enums: ["auto"] }, compoundIncludeLabels: { enums: ["include", "exclude"] }, arrowShape: { enums: ["tee", "triangle", "triangle-tee", "circle-triangle", "triangle-cross", "triangle-backcurve", "vee", "square", "circle", "diamond", "chevron", "none"] }, arrowFill: { enums: ["filled", "hollow"] }, arrowWidth: { number: true, units: "%|px|em", implicitUnits: "px", enums: ["match-line"] }, display: { enums: ["element", "none"] }, visibility: { enums: ["hidden", "visible"] }, zCompoundDepth: { enums: ["bottom", "orphan", "auto", "top"] }, zIndexCompare: { enums: ["auto", "manual"] }, valign: { enums: ["top", "center", "bottom"] }, halign: { enums: ["left", "center", "right"] }, justification: { enums: ["left", "center", "right", "auto"] }, text: { string: true }, data: { mapping: true, regex: i("data") }, layoutData: { mapping: true, regex: i("layoutData") }, scratch: { mapping: true, regex: i("scratch") }, mapData: { mapping: true, regex: o("mapData") }, mapLayoutData: { mapping: true, regex: o("mapLayoutData") }, mapScratch: { mapping: true, regex: o("mapScratch") }, fn: { mapping: true, fn: true }, url: { regexes: s, singleRegexMatchValue: true }, urls: { regexes: s, singleRegexMatchValue: true, multiple: true }, propList: { propList: true }, angle: { number: true, units: "deg|rad", implicitUnits: "rad" }, textRotation: { number: true, units: "deg|rad", implicitUnits: "rad", enums: ["none", "autorotate"] }, polygonPointList: { number: true, multiple: true, evenMultiple: true, min: -1, max: 1, unitless: true }, edgeDistances: { enums: ["intersection", "node-position", "endpoints"] }, edgeEndpoint: { number: true, multiple: true, units: "%|px|em|deg|rad", implicitUnits: "px", enums: ["inside-to-node", "outside-to-node", "outside-to-node-or-label", "outside-to-line", "outside-to-line-or-label"], singleEnum: true, validate: function(N, X) { switch (N.length) { case 2: return X[0] !== "deg" && X[0] !== "rad" && X[1] !== "deg" && X[1] !== "rad"; case 1: return Me(N[0]) || X[0] === "deg" || X[0] === "rad"; default: return false; } } }, easing: { regexes: ["^(spring)\\s*\\(\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*\\)$", "^(cubic-bezier)\\s*\\(\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*,\\s*(" + t13 + ")\\s*\\)$"], enums: ["linear", "ease", "ease-in", "ease-out", "ease-in-out", "ease-in-sine", "ease-out-sine", "ease-in-out-sine", "ease-in-quad", "ease-out-quad", "ease-in-out-quad", "ease-in-cubic", "ease-out-cubic", "ease-in-out-cubic", "ease-in-quart", "ease-out-quart", "ease-in-out-quart", "ease-in-quint", "ease-out-quint", "ease-in-out-quint", "ease-in-expo", "ease-out-expo", "ease-in-out-expo", "ease-in-circ", "ease-out-circ", "ease-in-out-circ"] }, gradientDirection: { enums: [ "to-bottom", "to-top", "to-left", "to-right", "to-bottom-right", "to-bottom-left", "to-top-right", "to-top-left", "to-right-bottom", "to-left-bottom", "to-right-top", "to-left-top" // different order ] }, boundsExpansion: { number: true, multiple: true, min: 0, validate: function(N) { var X = N.length; return X === 1 || X === 2 || X === 4; } } }; var u = { zeroNonZero: function(N, X) { return (N == null || X == null) && N !== X || N == 0 && X != 0 ? true : N != 0 && X == 0; }, any: function(N, X) { return N != X; }, emptyNonEmpty: function(N, X) { var Q = ea(N), ge = ea(X); return Q && !ge || !Q && ge; } }, l = Ht.types, c = [{ name: "label", type: l.text, triggersBounds: u.any, triggersZOrder: u.emptyNonEmpty }, { name: "text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }], d = [{ name: "source-label", type: l.text, triggersBounds: u.any }, { name: "source-text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "source-text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "source-text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "source-text-offset", type: l.size, triggersBounds: u.any }], f = [{ name: "target-label", type: l.text, triggersBounds: u.any }, { name: "target-text-rotation", type: l.textRotation, triggersBounds: u.any }, { name: "target-text-margin-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "target-text-margin-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "target-text-offset", type: l.size, triggersBounds: u.any }], h10 = [{ name: "font-family", type: l.fontFamily, triggersBounds: u.any }, { name: "font-style", type: l.fontStyle, triggersBounds: u.any }, { name: "font-weight", type: l.fontWeight, triggersBounds: u.any }, { name: "font-size", type: l.size, triggersBounds: u.any }, { name: "text-transform", type: l.textTransform, triggersBounds: u.any }, { name: "text-wrap", type: l.textWrap, triggersBounds: u.any }, { name: "text-overflow-wrap", type: l.textOverflowWrap, triggersBounds: u.any }, { name: "text-max-width", type: l.size, triggersBounds: u.any }, { name: "text-outline-width", type: l.size, triggersBounds: u.any }, { name: "line-height", type: l.positiveNumber, triggersBounds: u.any }], v = [{ name: "text-valign", type: l.valign, triggersBounds: u.any }, { name: "text-halign", type: l.halign, triggersBounds: u.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: u.any }, { name: "text-border-opacity", type: l.zeroOneNumber }, { name: "text-border-color", type: l.color }, { name: "text-border-width", type: l.size, triggersBounds: u.any }, { name: "text-border-style", type: l.borderStyle, triggersBounds: u.any }, { name: "text-background-shape", type: l.textBackgroundShape, triggersBounds: u.any }, { name: "text-justification", type: l.justification }], p = [{ name: "events", type: l.bool, triggersZOrder: u.any }, { name: "text-events", type: l.bool, triggersZOrder: u.any }], g = [{ name: "display", type: l.display, triggersZOrder: u.any, triggersBounds: u.any, triggersBoundsOfConnectedEdges: true }, { name: "visibility", type: l.visibility, triggersZOrder: u.any }, { name: "opacity", type: l.zeroOneNumber, triggersZOrder: u.zeroNonZero }, { name: "text-opacity", type: l.zeroOneNumber }, { name: "min-zoomed-font-size", type: l.size }, { name: "z-compound-depth", type: l.zCompoundDepth, triggersZOrder: u.any }, { name: "z-index-compare", type: l.zIndexCompare, triggersZOrder: u.any }, { name: "z-index", type: l.number, triggersZOrder: u.any }], y = [{ name: "overlay-padding", type: l.size, triggersBounds: u.any }, { name: "overlay-color", type: l.color }, { name: "overlay-opacity", type: l.zeroOneNumber, triggersBounds: u.zeroNonZero }, { name: "overlay-shape", type: l.overlayShape, triggersBounds: u.any }, { name: "overlay-corner-radius", type: l.cornerRadius }], m = [{ name: "underlay-padding", type: l.size, triggersBounds: u.any }, { name: "underlay-color", type: l.color }, { name: "underlay-opacity", type: l.zeroOneNumber, triggersBounds: u.zeroNonZero }, { name: "underlay-shape", type: l.overlayShape, triggersBounds: u.any }, { name: "underlay-corner-radius", type: l.cornerRadius }], b = [{ 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(N, X) { return X.value === "label" ? -N.poolIndex() : X.pfValue; }, x = [{ name: "height", type: l.nodeSize, triggersBounds: u.any, hashOverride: w }, { name: "width", type: l.nodeSize, triggersBounds: u.any, hashOverride: w }, { name: "shape", type: l.nodeShape, triggersBounds: u.any }, { name: "shape-polygon-points", type: l.polygonPointList, triggersBounds: u.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: u.any }, { name: "padding-relative-to", type: l.paddingRelativeTo, triggersBounds: u.any }, { name: "bounds-expansion", type: l.boundsExpansion, triggersBounds: u.any }], E = [{ name: "border-color", type: l.color }, { name: "border-opacity", type: l.zeroOneNumber }, { name: "border-width", type: l.size, triggersBounds: u.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 }], C = [{ name: "outline-color", type: l.color }, { name: "outline-opacity", type: l.zeroOneNumber }, { name: "outline-width", type: l.size, triggersBounds: u.any }, { name: "outline-style", type: l.borderStyle }, { name: "outline-offset", type: l.size, triggersBounds: u.any }], k = [{ 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 }], S = [{ name: "position", type: l.position, triggersBounds: u.any }, { name: "compound-sizing-wrt-labels", type: l.compoundIncludeLabels, triggersBounds: u.any }, { name: "min-width", type: l.size, triggersBounds: u.any }, { name: "min-width-bias-left", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-width-bias-right", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-height", type: l.size, triggersBounds: u.any }, { name: "min-height-bias-top", type: l.sizeMaybePercent, triggersBounds: u.any }, { name: "min-height-bias-bottom", type: l.sizeMaybePercent, triggersBounds: u.any }], _ = [{ 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: u.any, triggersBoundsOfParallelBeziers: true }, { name: "haystack-radius", type: l.zeroOneNumber, triggersBounds: u.any }, { name: "source-endpoint", type: l.edgeEndpoint, triggersBounds: u.any }, { name: "target-endpoint", type: l.edgeEndpoint, triggersBounds: u.any }, { name: "control-point-step-size", type: l.size, triggersBounds: u.any }, { name: "control-point-distances", type: l.bidirectionalSizes, triggersBounds: u.any }, { name: "control-point-weights", type: l.numbers, triggersBounds: u.any }, { name: "segment-distances", type: l.bidirectionalSizes, triggersBounds: u.any }, { name: "segment-weights", type: l.numbers, triggersBounds: u.any }, { name: "segment-radii", type: l.numbers, triggersBounds: u.any }, { name: "radius-type", type: l.radiusType, triggersBounds: u.any }, { name: "taxi-turn", type: l.bidirectionalSizeMaybePercent, triggersBounds: u.any }, { name: "taxi-turn-min-distance", type: l.size, triggersBounds: u.any }, { name: "taxi-direction", type: l.axisDirection, triggersBounds: u.any }, { name: "taxi-radius", type: l.number, triggersBounds: u.any }, { name: "edge-distances", type: l.edgeDistances, triggersBounds: u.any }, { name: "arrow-scale", type: l.positiveNumber, triggersBounds: u.any }, { name: "loop-direction", type: l.angle, triggersBounds: u.any }, { name: "loop-sweep", type: l.angle, triggersBounds: u.any }, { name: "source-distance-from-node", type: l.size, triggersBounds: u.any }, { name: "target-distance-from-node", type: l.size, triggersBounds: u.any }], T = [{ name: "ghost", type: l.bool, triggersBounds: u.any }, { name: "ghost-offset-x", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "ghost-offset-y", type: l.bidirectionalSize, triggersBounds: u.any }, { name: "ghost-opacity", type: l.zeroOneNumber }], O = [{ 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 }], D = []; Ht.pieBackgroundN = 16, D.push({ name: "pie-size", type: l.sizeMaybePercent }); for (var A = 1; A <= Ht.pieBackgroundN; A++) D.push({ name: "pie-" + A + "-background-color", type: l.color }), D.push({ name: "pie-" + A + "-background-size", type: l.percent }), D.push({ name: "pie-" + A + "-background-opacity", type: l.zeroOneNumber }); var F = [], R = Ht.arrowPrefixes = ["source", "mid-source", "target", "mid-target"]; [{ name: "arrow-shape", type: l.arrowShape, triggersBounds: u.any }, { name: "arrow-color", type: l.color }, { name: "arrow-fill", type: l.arrowFill }, { name: "arrow-width", type: l.arrowWidth }].forEach(function(Z) { R.forEach(function(N) { var X = N + "-" + Z.name, Q = Z.type, ge = Z.triggersBounds; F.push({ name: X, type: Q, triggersBounds: ge }); }); }, {}); var M = Ht.properties = [].concat(p, b, g, y, m, T, v, h10, c, d, f, x, E, C, k, D, S, _, F, O), L = Ht.propertyGroups = { // common to all eles behavior: p, transition: b, visibility: g, overlay: y, underlay: m, ghost: T, // labels commonLabel: v, labelDimensions: h10, mainLabel: c, sourceLabel: d, targetLabel: f, // node props nodeBody: x, nodeBorder: E, nodeOutline: C, backgroundImage: k, pie: D, compound: S, // edge props edgeLine: _, edgeArrow: F, core: O }, V = Ht.propertyGroupNames = {}, Y = Ht.propertyGroupKeys = Object.keys(L); Y.forEach(function(Z) { V[Z] = L[Z].map(function(N) { return N.name; }), L[Z].forEach(function(N) { return N.groupKey = Z; }); }); var H = Ht.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" }]; Ht.propertyNames = M.map(function(Z) { return Z.name; }); for (var K = 0; K < M.length; K++) { var ne = M[K]; M[ne.name] = ne; } for (var B = 0; B < H.length; B++) { var $ = H[B], z = M[$.pointsTo], W = { name: $.name, alias: true, pointsTo: z }; M.push(W), M[$.name] = W; } })(); Ht.getDefaultProperty = function(t13) { return this.getDefaultProperties()[t13]; }; Ht.getDefaultProperties = function() { var t13 = this._private; if (t13.defaultProperties != null) return t13.defaultProperties; for (var e = ze({ // core props "selection-box-color": "#ddd", "selection-box-opacity": 0.65, "selection-box-border-color": "#aaa", "selection-box-border-width": 1, "active-bg-color": "black", "active-bg-opacity": 0.15, "active-bg-size": 30, "outside-texture-bg-color": "#000", "outside-texture-bg-opacity": 0.125, // common node/edge props events: "yes", "text-events": "no", "text-valign": "top", "text-halign": "center", "text-justification": "auto", "line-height": 1, color: "#000", "text-outline-color": "#000", "text-outline-width": 0, "text-outline-opacity": 1, "text-opacity": 1, "text-decoration": "none", "text-transform": "none", "text-wrap": "none", "text-overflow-wrap": "whitespace", "text-max-width": 9999, "text-background-color": "#000", "text-background-opacity": 0, "text-background-shape": "rectangle", "text-background-padding": 0, "text-border-opacity": 0, "text-border-width": 0, "text-border-style": "solid", "text-border-color": "#000", "font-family": "Helvetica Neue, Helvetica, sans-serif", "font-style": "normal", "font-weight": "normal", "font-size": 16, "min-zoomed-font-size": 0, "text-rotation": "none", "source-text-rotation": "none", "target-text-rotation": "none", visibility: "visible", display: "element", opacity: 1, "z-compound-depth": "auto", "z-index-compare": "auto", "z-index": 0, label: "", "text-margin-x": 0, "text-margin-y": 0, "source-label": "", "source-text-offset": 0, "source-text-margin-x": 0, "source-text-margin-y": 0, "target-label": "", "target-text-offset": 0, "target-text-margin-x": 0, "target-text-margin-y": 0, "overlay-opacity": 0, "overlay-color": "#000", "overlay-padding": 10, "overlay-shape": "round-rectangle", "overlay-corner-radius": "auto", "underlay-opacity": 0, "underlay-color": "#000", "underlay-padding": 10, "underlay-shape": "round-rectangle", "underlay-corner-radius": "auto", "transition-property": "none", "transition-duration": 0, "transition-delay": 0, "transition-timing-function": "linear", // node props "background-blacken": 0, "background-color": "#999", "background-fill": "solid", "background-opacity": 1, "background-image": "none", "background-image-crossorigin": "anonymous", "background-image-opacity": 1, "background-image-containment": "inside", "background-image-smoothing": "yes", "background-position-x": "50%", "background-position-y": "50%", "background-offset-x": 0, "background-offset-y": 0, "background-width-relative-to": "include-padding", "background-height-relative-to": "include-padding", "background-repeat": "no-repeat", "background-fit": "none", "background-clip": "node", "background-width": "auto", "background-height": "auto", "border-color": "#000", "border-opacity": 1, "border-width": 0, "border-style": "solid", "border-dash-pattern": [4, 2], "border-dash-offset": 0, "border-cap": "butt", "border-join": "miter", "border-position": "center", "outline-color": "#999", "outline-opacity": 1, "outline-width": 0, "outline-offset": 0, "outline-style": "solid", height: 30, width: 30, shape: "ellipse", "shape-polygon-points": "-1, -1, 1, -1, 1, 1, -1, 1", "corner-radius": "auto", "bounds-expansion": 0, // node gradient "background-gradient-direction": "to-bottom", "background-gradient-stop-colors": "#999", "background-gradient-stop-positions": "0%", // ghost props ghost: "no", "ghost-offset-y": 0, "ghost-offset-x": 0, "ghost-opacity": 0, // compound props padding: 0, "padding-relative-to": "width", position: "origin", "compound-sizing-wrt-labels": "include", "min-width": 0, "min-width-bias-left": 0, "min-width-bias-right": 0, "min-height": 0, "min-height-bias-top": 0, "min-height-bias-bottom": 0 }, { // node pie bg "pie-size": "100%" }, [{ name: "pie-{{i}}-background-color", value: "black" }, { name: "pie-{{i}}-background-size", value: "0%" }, { name: "pie-{{i}}-background-opacity", value: 1 }].reduce(function(u, l) { for (var c = 1; c <= Ht.pieBackgroundN; c++) { var d = l.name.replace("{{i}}", c), f = l.value; u[d] = f; } return u; }, {}), { // 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(u, l) { return Ht.arrowPrefixes.forEach(function(c) { var d = c + "-" + l.name, f = l.value; u[d] = f; }), u; }, {})), r = {}, n = 0; n < this.properties.length; n++) { var a = this.properties[n]; if (!a.pointsTo) { var i = a.name, o = e[i], s = this.parse(i, o); r[i] = s; } } return t13.defaultProperties = r, t13.defaultProperties; }; Ht.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 Wl = {}; Wl.parse = function(t13, e, r, n) { var a = this; if (yt(e)) return a.parseImplWarn(t13, e, r, n); var i = n === "mapping" || n === true || n === false || n == null ? "dontcare" : n, o = r ? "t" : "f", s = "" + e, u = cS(t13, s, o, i), l = a.propCache = a.propCache || [], c; return (c = l[u]) || (c = l[u] = a.parseImplWarn(t13, e, r, n)), (r || n === "mapping") && (c = rn(c), c && (c.value = rn(c.value))), c; }; Wl.parseImplWarn = function(t13, e, r, n) { var a = this.parseImpl(t13, e, r, n); return !a && e != null && tt("The style property `".concat(t13, ": ").concat(e, "` is invalid")), a && (a.name === "width" || a.name === "height") && e === "label" && tt("The style value of `label` is deprecated for `" + a.name + "`"), a; }; Wl.parseImpl = function(t13, e, r, n) { var a = this; t13 = Ig(t13); var i = a.properties[t13], o = e, s = a.types; if (!i || e === void 0) return null; i.alias && (i = i.pointsTo, t13 = i.name); var u = Me(e); u && (e = e.trim()); var l = i.type; if (!l) return null; if (r && (e === "" || e === null)) return { name: t13, value: e, bypass: true, deleteBypass: true }; if (yt(e)) return { name: t13, value: e, strValue: "fn", mapped: s.fn, bypass: r }; var c, d; if (!(!u || n || e.length < 7 || e[1] !== "a")) { if (e.length >= 7 && e[0] === "d" && (c = new RegExp(s.data.regex).exec(e))) { if (r) return false; var f = s.data; return { name: t13, value: c, strValue: "" + e, mapped: f, field: c[1], bypass: r }; } else if (e.length >= 10 && e[0] === "m" && (d = new RegExp(s.mapData.regex).exec(e))) { if (r || l.multiple) return false; var h10 = s.mapData; if (!(l.color || l.number)) return false; var v = this.parse(t13, d[4]); if (!v || v.mapped) return false; var p = this.parse(t13, d[5]); if (!p || p.mapped) return false; if (v.pfValue === p.pfValue || v.strValue === p.strValue) return tt("`" + t13 + ": " + e + "` is not a valid mapper because the output range is zero; converting to `" + t13 + ": " + v.strValue + "`"), this.parse(t13, v.strValue); if (l.color) { var g = v.value, y = p.value, m = g[0] === y[0] && g[1] === y[1] && g[2] === y[2] && // optional alpha (g[3] === y[3] || (g[3] == null || g[3] === 1) && (y[3] == null || y[3] === 1)); if (m) return false; } return { name: t13, value: d, strValue: "" + e, mapped: h10, field: d[1], fieldMin: parseFloat(d[2]), // min & max are numeric fieldMax: parseFloat(d[3]), valueMin: v.value, valueMax: p.value, bypass: r }; } } if (l.multiple && n !== "multiple") { var b; if (u ? b = e.split(/\s+/) : lt(e) ? b = e : b = [e], l.evenMultiple && b.length % 2 !== 0) return null; for (var w = [], x = [], E = [], C = "", k = false, S = 0; S < b.length; S++) { var _ = a.parse(t13, b[S], r, "multiple"); k = k || Me(_.value), w.push(_.value), E.push(_.pfValue != null ? _.pfValue : _.value), x.push(_.units), C += (S > 0 ? " " : "") + _.strValue; } return l.validate && !l.validate(w, x) ? null : l.singleEnum && k ? w.length === 1 && Me(w[0]) ? { name: t13, value: w[0], strValue: w[0], bypass: r } : null : { name: t13, value: w, pfValue: E, strValue: C, bypass: r, units: x }; } var T = function() { for (var N = 0; N < l.enums.length; N++) { var X = l.enums[N]; if (X === e) return { name: t13, value: e, strValue: "" + e, bypass: r }; } return null; }; if (l.number) { var O, D = "px"; if (l.units && (O = l.units), l.implicitUnits && (D = l.implicitUnits), !l.unitless) if (u) { var A = "px|em" + (l.allowPercent ? "|\\%" : ""); O && (A = O); var F = e.match("^(" + Mt + ")(" + A + ")?$"); F && (e = F[1], O = F[2] || D); } else (!O || l.implicitUnits) && (O = D); if (e = parseFloat(e), isNaN(e) && l.enums === void 0) return null; if (isNaN(e) && l.enums !== void 0) return e = o, T(); if (l.integer && !sB(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 R = { name: t13, value: e, strValue: "" + e + (O || ""), units: O, bypass: r }; return l.unitless || O !== "px" && O !== "em" ? R.pfValue = e : R.pfValue = O === "px" || !O ? e : this.getEmSizeInPixels() * e, (O === "ms" || O === "s") && (R.pfValue = O === "ms" ? e : 1e3 * e), (O === "deg" || O === "rad") && (R.pfValue = O === "rad" ? e : z$(e)), O === "%" && (R.pfValue = e / 100), R; } else if (l.propList) { var M = [], L = "" + e; if (L !== "none") { for (var V = L.split(/\s*,\s*|\s+/), Y = 0; Y < V.length; Y++) { var H = V[Y].trim(); a.properties[H] ? M.push(H) : tt("`" + H + "` is not a valid property name"); } if (M.length === 0) return null; } return { name: t13, value: M, strValue: M.length === 0 ? "none" : M.join(" "), bypass: r }; } else if (l.color) { var K = SB(e); return K ? { name: t13, value: K, pfValue: K, strValue: "rgb(" + K[0] + "," + K[1] + "," + K[2] + ")", // n.b. no spaces b/c of multiple support bypass: r } : null; } else if (l.regex || l.regexes) { if (l.enums) { var ne = T(); if (ne) return ne; } for (var B = l.regexes ? l.regexes : [l.regex], $ = 0; $ < B.length; $++) { var z = new RegExp(B[$]), W = z.exec(e); if (W) return { name: t13, value: l.singleRegexMatchValue ? W[1] : W, strValue: "" + e, bypass: r }; } return null; } else return l.string ? { name: t13, value: "" + e, strValue: "" + e, bypass: r } : l.enums ? T() : null; }; var ar = function t9(e) { if (!(this instanceof t9)) return new t9(e); if (!Tg(e)) { bt("A style must have a core reference"); return; } this._private = { cy: e, coreStyle: {} }, this.length = 0, this.resetToDefault(); }; var or = ar.prototype; or.instanceString = function() { return "style"; }; or.clear = function() { for (var t13 = this._private, e = t13.cy, r = e.elements(), n = 0; n < this.length; n++) this[n] = void 0; return this.length = 0, t13.contextStyles = {}, t13.propDiffs = {}, this.cleanElements(r, true), r.forEach(function(a) { var i = a[0]._private; i.styleDirty = true, i.appliedInitStyle = false; }), this; }; or.resetToDefault = function() { return this.clear(), this.addDefaultStylesheet(), this; }; or.core = function(t13) { return this._private.coreStyle[t13] || this.getDefaultProperty(t13); }; or.selector = function(t13) { var e = t13 === "core" ? null : new ra(t13), r = this.length++; return this[r] = { selector: e, properties: [], mappedProperties: [], index: r }, this; }; or.css = function() { var t13 = this, e = arguments; if (e.length === 1) for (var r = e[0], n = 0; n < t13.properties.length; n++) { var a = t13.properties[n], i = r[a.name]; i === void 0 && (i = r[Rl(a.name)]), i !== void 0 && this.cssRule(a.name, i); } else e.length === 2 && this.cssRule(e[0], e[1]); return this; }; or.style = or.css; or.cssRule = function(t13, e) { var r = this.parse(t13, e); if (r) { var n = this.length - 1; this[n].properties.push(r), this[n].properties[r.name] = r, r.name.match(/pie-(\d+)-background-size/) && r.value && (this._private.hasPie = true), r.mapped && this[n].mappedProperties.push(r); var a = !this[n].selector; a && (this._private.coreStyle[r.name] = r); } return this; }; or.append = function(t13) { return eS(t13) ? t13.appendToStyle(this) : lt(t13) ? this.appendFromJson(t13) : Me(t13) && this.appendFromString(t13), this; }; ar.fromJson = function(t13, e) { var r = new ar(t13); return r.fromJson(e), r; }; ar.fromString = function(t13, e) { return new ar(t13).fromString(e); }; [sr, os, Vg, un, Ul, Hg, Ht, Wl].forEach(function(t13) { ze(or, t13); }); ar.types = or.types; ar.properties = or.properties; ar.propertyGroups = or.propertyGroups; ar.propertyGroupNames = or.propertyGroupNames; ar.propertyGroupKeys = or.propertyGroupKeys; var s8 = { style: function(e) { if (e) { var r = this.setStyle(e); r.update(); } return this._private.style; }, setStyle: function(e) { var r = this._private; return eS(e) ? r.style = e.generateStyle(this) : lt(e) ? r.style = ar.fromJson(this, e) : Me(e) ? r.style = ar.fromString(this, e) : r.style = ar(this), r.style; }, // e.g. cy.data() changed => recalc ele mappers updateStyle: function() { this.mutableElements().updateStyle(); } }; var l8 = "single"; var Fa = { autolock: function(e) { if (e !== void 0) this._private.autolock = !!e; else return this._private.autolock; return this; }, autoungrabify: function(e) { if (e !== void 0) this._private.autoungrabify = !!e; else return this._private.autoungrabify; return this; }, autounselectify: function(e) { if (e !== void 0) this._private.autounselectify = !!e; else return this._private.autounselectify; return this; }, selectionType: function(e) { var r = this._private; if (r.selectionType == null && (r.selectionType = l8), e !== void 0) (e === "additive" || e === "single") && (r.selectionType = e); else return r.selectionType; return this; }, panningEnabled: function(e) { if (e !== void 0) this._private.panningEnabled = !!e; else return this._private.panningEnabled; return this; }, userPanningEnabled: function(e) { if (e !== void 0) this._private.userPanningEnabled = !!e; else return this._private.userPanningEnabled; return this; }, zoomingEnabled: function(e) { if (e !== void 0) this._private.zoomingEnabled = !!e; else return this._private.zoomingEnabled; return this; }, userZoomingEnabled: function(e) { if (e !== void 0) this._private.userZoomingEnabled = !!e; else return this._private.userZoomingEnabled; return this; }, boxSelectionEnabled: function(e) { if (e !== void 0) this._private.boxSelectionEnabled = !!e; else return this._private.boxSelectionEnabled; return this; }, pan: function() { var e = arguments, r = this._private.pan, n, a, i, o, s; switch (e.length) { case 0: return r; case 1: if (Me(e[0])) return n = e[0], r[n]; if (Xe(e[0])) { if (!this._private.panningEnabled) return this; i = e[0], o = i.x, s = i.y, Ce(o) && (r.x = o), Ce(s) && (r.y = s), this.emit("pan viewport"); } break; case 2: if (!this._private.panningEnabled) return this; n = e[0], a = e[1], (n === "x" || n === "y") && Ce(a) && (r[n] = a), this.emit("pan viewport"); break; } return this.notify("viewport"), this; }, panBy: function(e, r) { var n = arguments, a = this._private.pan, i, o, s, u, l; if (!this._private.panningEnabled) return this; switch (n.length) { case 1: Xe(e) && (s = n[0], u = s.x, l = s.y, Ce(u) && (a.x += u), Ce(l) && (a.y += l), this.emit("pan viewport")); break; case 2: i = e, o = r, (i === "x" || i === "y") && Ce(o) && (a[i] += o), this.emit("pan viewport"); break; } return this.notify("viewport"), this; }, fit: function(e, r) { var n = this.getFitViewport(e, r); if (n) { var a = this._private; a.zoom = n.zoom, a.pan = n.pan, this.emit("pan zoom viewport"), this.notify("viewport"); } return this; }, getFitViewport: function(e, r) { if (Ce(e) && r === void 0 && (r = e, e = void 0), !(!this._private.panningEnabled || !this._private.zoomingEnabled)) { var n; if (Me(e)) { var a = e; e = this.$(a); } else if (cB(e)) { var i = e; n = { x1: i.x1, y1: i.y1, x2: i.x2, y2: i.y2 }, n.w = n.x2 - n.x1, n.h = n.y2 - n.y1; } else xr(e) || (e = this.mutableElements()); if (!(xr(e) && e.empty())) { n = n || e.boundingBox(); var o = this.width(), s = this.height(), u; if (r = Ce(r) ? r : 0, !isNaN(o) && !isNaN(s) && o > 0 && s > 0 && !isNaN(n.w) && !isNaN(n.h) && n.w > 0 && n.h > 0) { u = Math.min((o - 2 * r) / n.w, (s - 2 * r) / n.h), u = u > this._private.maxZoom ? this._private.maxZoom : u, u = u < this._private.minZoom ? this._private.minZoom : u; var l = { // now pan to middle x: (o - u * (n.x1 + n.x2)) / 2, y: (s - u * (n.y1 + n.y2)) / 2 }; return { zoom: u, pan: l }; } } } }, zoomRange: function(e, r) { var n = this._private; if (r == null) { var a = e; e = a.min, r = a.max; } return Ce(e) && Ce(r) && e <= r ? (n.minZoom = e, n.maxZoom = r) : Ce(e) && r === void 0 && e <= n.maxZoom ? n.minZoom = e : Ce(r) && e === void 0 && r >= n.minZoom && (n.maxZoom = r), this; }, minZoom: function(e) { return e === void 0 ? this._private.minZoom : this.zoomRange({ min: e }); }, maxZoom: function(e) { return e === void 0 ? this._private.maxZoom : this.zoomRange({ max: e }); }, getZoomedViewport: function(e) { var r = this._private, n = r.pan, a = r.zoom, i, o, s = false; if (r.zoomingEnabled || (s = true), Ce(e) ? o = e : Xe(e) && (o = e.level, e.position != null ? i = Nl(e.position, a, n) : e.renderedPosition != null && (i = e.renderedPosition), i != null && !r.panningEnabled && (s = true)), o = o > r.maxZoom ? r.maxZoom : o, o = o < r.minZoom ? r.minZoom : o, s || !Ce(o) || o === a || i != null && (!Ce(i.x) || !Ce(i.y))) return null; if (i != null) { var u = n, l = a, c = o, d = { x: -c / l * (i.x - u.x) + i.x, y: -c / l * (i.y - u.y) + i.y }; return { zoomed: true, panned: true, zoom: c, pan: d }; } else return { zoomed: true, panned: false, zoom: o, pan: n }; }, zoom: function(e) { if (e === void 0) return this._private.zoom; var r = this.getZoomedViewport(e), n = this._private; return r == null || !r.zoomed ? this : (n.zoom = r.zoom, r.panned && (n.pan.x = r.pan.x, n.pan.y = r.pan.y), this.emit("zoom" + (r.panned ? " pan" : "") + " viewport"), this.notify("viewport"), this); }, viewport: function(e) { var r = this._private, n = true, a = true, i = [], o = false, s = false; if (!e) return this; if (Ce(e.zoom) || (n = false), Xe(e.pan) || (a = false), !n && !a) return this; if (n) { var u = e.zoom; u < r.minZoom || u > r.maxZoom || !r.zoomingEnabled ? o = true : (r.zoom = u, i.push("zoom")); } if (a && (!o || !e.cancelOnFailedZoom) && r.panningEnabled) { var l = e.pan; Ce(l.x) && (r.pan.x = l.x, s = false), Ce(l.y) && (r.pan.y = l.y, s = false), s || i.push("pan"); } return i.length > 0 && (i.push("viewport"), this.emit(i.join(" ")), this.notify("viewport")), this; }, center: function(e) { var r = this.getCenterPan(e); return r && (this._private.pan = r, this.emit("pan viewport"), this.notify("viewport")), this; }, getCenterPan: function(e, r) { if (this._private.panningEnabled) { if (Me(e)) { var n = e; e = this.mutableElements().filter(n); } else xr(e) || (e = this.mutableElements()); if (e.length !== 0) { var a = e.boundingBox(), i = this.width(), o = this.height(); r = r === void 0 ? this._private.zoom : r; var s = { // middle x: (i - r * (a.x1 + a.x2)) / 2, y: (o - r * (a.y1 + a.y2)) / 2 }; return s; } } }, reset: function() { return !this._private.panningEnabled || !this._private.zoomingEnabled ? this : (this.viewport({ pan: { x: 0, y: 0 }, zoom: 1 }), this); }, invalidateSize: function() { this._private.sizeCache = null; }, size: function() { var e = this._private, r = e.container, n = this; return e.sizeCache = e.sizeCache || (r ? function() { var a = n.window().getComputedStyle(r), i = function(s) { return parseFloat(a.getPropertyValue(s)); }; return { width: r.clientWidth - i("padding-left") - i("padding-right"), height: r.clientHeight - i("padding-top") - i("padding-bottom") }; }() : { // fallback if no container (not 0 b/c can be used for dividing etc) width: 1, height: 1 }); }, width: function() { return this.size().width; }, height: function() { return this.size().height; }, extent: function() { var e = this._private.pan, r = this._private.zoom, n = this.renderedExtent(), a = { x1: (n.x1 - e.x) / r, x2: (n.x2 - e.x) / r, y1: (n.y1 - e.y) / r, y2: (n.y2 - e.y) / r }; return a.w = a.x2 - a.x1, a.h = a.y2 - a.y1, a; }, renderedExtent: function() { var e = this.width(), r = this.height(); return { x1: 0, y1: 0, x2: e, y2: r, w: e, h: r }; }, multiClickDebounceTime: function(e) { if (e) this._private.multiClickDebounceTime = e; else return this._private.multiClickDebounceTime; return this; } }; Fa.centre = Fa.center; Fa.autolockNodes = Fa.autolock; Fa.autoungrabifyNodes = Fa.autoungrabify; var qo = { data: et.data({ field: "data", bindingEvent: "data", allowBinding: true, allowSetting: true, settingEvent: "data", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeData: et.removeData({ field: "data", event: "data", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }), scratch: et.data({ field: "scratch", bindingEvent: "scratch", allowBinding: true, allowSetting: true, settingEvent: "scratch", settingTriggersEvent: true, triggerFnName: "trigger", allowGetting: true, updateStyle: true }), removeScratch: et.removeData({ field: "scratch", event: "scratch", triggerFnName: "trigger", triggerEvent: true, updateStyle: true }) }; qo.attr = qo.data; qo.removeAttr = qo.removeData; var zo = function(e) { var r = this; e = ze({}, e); var n = e.container; n && !sl(n) && sl(n[0]) && (n = n[0]); var a = n ? n._cyreg : null; a = a || {}, a && a.cy && (a.cy.destroy(), a = {}); var i = a.readies = a.readies || []; n && (n._cyreg = a), a.cy = r; var o = Dt !== void 0 && n !== void 0 && !e.headless, s = e; s.layout = ze({ name: o ? "grid" : "null" }, s.layout), s.renderer = ze({ name: o ? "canvas" : "null" }, s.renderer); var u = function(v, p, g) { return p !== void 0 ? p : g !== void 0 ? g : v; }, l = this._private = { container: n, // html dom ele container ready: false, // whether ready has been triggered options: s, // cached options elements: new Yt(this), // elements in the graph listeners: [], // list of listeners aniEles: new Yt(this), // elements being animated data: s.data || {}, // data for the core scratch: {}, // scratch object for core layout: null, renderer: null, destroyed: false, // whether destroy was called notificationsEnabled: true, // whether notifications are sent to the renderer minZoom: 1e-50, maxZoom: 1e50, zoomingEnabled: u(true, s.zoomingEnabled), userZoomingEnabled: u(true, s.userZoomingEnabled), panningEnabled: u(true, s.panningEnabled), userPanningEnabled: u(true, s.userPanningEnabled), boxSelectionEnabled: u(true, s.boxSelectionEnabled), autolock: u(false, s.autolock, s.autolockNodes), autoungrabify: u(false, s.autoungrabify, s.autoungrabifyNodes), autounselectify: u(false, s.autounselectify), styleEnabled: s.styleEnabled === void 0 ? o : s.styleEnabled, zoom: Ce(s.zoom) ? s.zoom : 1, pan: { x: Xe(s.pan) && Ce(s.pan.x) ? s.pan.x : 0, y: Xe(s.pan) && Ce(s.pan.y) ? s.pan.y : 0 }, animation: { // object for currently-running animations current: [], queue: [] }, hasCompoundNodes: false, multiClickDebounceTime: u(250, s.multiClickDebounceTime) }; this.createEmitter(), this.selectionType(s.selectionType), this.zoomRange({ min: s.minZoom, max: s.maxZoom }); var c = function(v, p) { var g = v.some(dB); if (g) return Mi.all(v).then(p); p(v); }; l.styleEnabled && r.setStyle([]); var d = ze({}, s, s.renderer); r.initRenderer(d); var f = function(v, p, g) { r.notifications(false); var y = r.mutableElements(); y.length > 0 && y.remove(), v != null && (Xe(v) || lt(v)) && r.add(v), r.one("layoutready", function(b) { r.notifications(true), r.emit(b), r.one("load", p), r.emitAndNotify("load"); }).one("layoutstop", function() { r.one("done", g), r.emit("done"); }); var m = ze({}, r._private.options.layout); m.eles = r.elements(), r.layout(m).run(); }; c([s.style, s.elements], function(h10) { var v = h10[0], p = h10[1]; l.styleEnabled && r.style().append(v), f(p, function() { r.startAnimationLoop(), l.ready = true, yt(s.ready) && r.on("ready", s.ready); for (var g = 0; g < i.length; g++) { var y = i[g]; r.on("ready", y); } a && (a.readies = []), r.emit("ready"); }, s.done); }); }; var hl = zo.prototype; ze(hl, { instanceString: function() { return "core"; }, isReady: function() { return this._private.ready; }, destroyed: function() { return this._private.destroyed; }, ready: function(e) { return this.isReady() ? this.emitter().emit("ready", [], e) : this.on("ready", e), this; }, destroy: function() { var e = this; if (!e.destroyed()) return e.stopAnimationLoop(), e.destroyRenderer(), this.emit("destroy"), e._private.destroyed = true, e; }, hasElementWithId: function(e) { return this._private.elements.hasElementWithId(e); }, getElementById: function(e) { return this._private.elements.getElementById(e); }, hasCompoundNodes: function() { return this._private.hasCompoundNodes; }, headless: function() { return this._private.renderer.isHeadless(); }, styleEnabled: function() { return this._private.styleEnabled; }, addToPool: function(e) { return this._private.elements.merge(e), this; }, removeFromPool: function(e) { return this._private.elements.unmerge(e), this; }, container: function() { return this._private.container || null; }, window: function() { var e = this._private.container; if (e == null) return Dt; var r = this._private.container.ownerDocument; return r === void 0 || r == null ? Dt : r.defaultView || Dt; }, mount: function(e) { if (e != null) { var r = this, n = r._private, a = n.options; return !sl(e) && sl(e[0]) && (e = e[0]), r.stopAnimationLoop(), r.destroyRenderer(), n.container = e, n.styleEnabled = true, r.invalidateSize(), r.initRenderer(ze({}, a, a.renderer, { // allow custom renderer name to be re-used, otherwise use canvas name: a.renderer.name === "null" ? "canvas" : a.renderer.name })), r.startAnimationLoop(), r.style(a.style), r.emit("mount"), r; } }, unmount: function() { var e = this; return e.stopAnimationLoop(), e.destroyRenderer(), e.initRenderer({ name: "null" }), e.emit("unmount"), e; }, options: function() { return rn(this._private.options); }, json: function(e) { var r = this, n = r._private, a = r.mutableElements(), i = function(w) { return r.getElementById(w.id()); }; if (Xe(e)) { if (r.startBatch(), e.elements) { var o = {}, s = function(w, x) { for (var E = [], C = [], k = 0; k < w.length; k++) { var S = w[k]; if (!S.data.id) { tt("cy.json() cannot handle elements without an ID attribute"); continue; } var _ = "" + S.data.id, T = r.getElementById(_); o[_] = true, T.length !== 0 ? C.push({ ele: T, json: S }) : (x && (S.group = x), E.push(S)); } r.add(E); for (var O = 0; O < C.length; O++) { var D = C[O], A = D.ele, F = D.json; A.json(F); } }; if (lt(e.elements)) s(e.elements); else for (var u = ["nodes", "edges"], l = 0; l < u.length; l++) { var c = u[l], d = e.elements[c]; lt(d) && s(d, c); } var f = r.collection(); a.filter(function(b) { return !o[b.id()]; }).forEach(function(b) { b.isParent() ? f.merge(b) : b.remove(); }), f.forEach(function(b) { return b.children().move({ parent: null }); }), f.forEach(function(b) { return i(b).remove(); }); } e.style && r.style(e.style), e.zoom != null && e.zoom !== n.zoom && r.zoom(e.zoom), e.pan && (e.pan.x !== n.pan.x || e.pan.y !== n.pan.y) && r.pan(e.pan), e.data && r.data(e.data); for (var h10 = ["minZoom", "maxZoom", "zoomingEnabled", "userZoomingEnabled", "panningEnabled", "userPanningEnabled", "boxSelectionEnabled", "autolock", "autoungrabify", "autounselectify", "multiClickDebounceTime"], v = 0; v < h10.length; v++) { var p = h10[v]; e[p] != null && r[p](e[p]); } return r.endBatch(), this; } else { var g = !!e, y = {}; g ? y.elements = this.elements().map(function(b) { return b.json(); }) : (y.elements = {}, a.forEach(function(b) { var w = b.group(); y.elements[w] || (y.elements[w] = []), y.elements[w].push(b.json()); })), this._private.styleEnabled && (y.style = r.style().json()), y.data = rn(r.data()); var m = n.options; return y.zoomingEnabled = n.zoomingEnabled, y.userZoomingEnabled = n.userZoomingEnabled, y.zoom = n.zoom, y.minZoom = n.minZoom, y.maxZoom = n.maxZoom, y.panningEnabled = n.panningEnabled, y.userPanningEnabled = n.userPanningEnabled, y.pan = rn(n.pan), y.boxSelectionEnabled = n.boxSelectionEnabled, y.renderer = rn(m.renderer), y.hideEdgesOnViewport = m.hideEdgesOnViewport, y.textureOnViewport = m.textureOnViewport, y.wheelSensitivity = m.wheelSensitivity, y.motionBlur = m.motionBlur, y.multiClickDebounceTime = m.multiClickDebounceTime, y; } } }); hl.$id = hl.getElementById; [Xz, r8, tk, Pp, Ws, a8, Dp, js, s8, Fa, qo].forEach(function(t13) { ze(hl, t13); }); var u8 = { fit: true, // whether to fit the viewport to the graph directed: false, // whether the tree is directed downwards (or edges can point in any direction if false) padding: 30, // padding on fit circle: false, // put depths in concentric circles if true, put depths top down if false grid: false, // whether to create an even grid into which the DAG is placed (circle:false only) spacingFactor: 1.75, // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap) boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm roots: void 0, // the roots of the trees depthSort: void 0, // a sorting function to order nodes at equal depth. e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled, animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; var c8 = { maximal: false, // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only); setting acyclic to true sets maximal to true also acyclic: false // whether the tree is acyclic and thus a node could be shifted (due to the maximal option) multiple times without causing an infinite loop; setting to true sets maximal to true also; if you are uncertain whether a tree is acyclic, set to false to avoid potential infinite loops }; var ni = function(e) { return e.scratch("breadthfirst"); }; var R0 = function(e, r) { return e.scratch("breadthfirst", r); }; function rk(t13) { this.options = ze({}, u8, c8, t13); } rk.prototype.run = function() { var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = n.nodes().filter(function(fe) { return !fe.isParent(); }), i = n, o = e.directed, s = e.acyclic || e.maximal || e.maximalAdjustments > 0, u = br(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }), l; if (xr(e.roots)) l = e.roots; else if (lt(e.roots)) { for (var c = [], d = 0; d < e.roots.length; d++) { var f = e.roots[d], h10 = r.getElementById(f); c.push(h10); } l = r.collection(c); } else if (Me(e.roots)) l = r.$(e.roots); else if (o) l = a.roots(); else { var v = n.components(); l = r.collection(); for (var p = function(ce) { var be = v[ce], ve = be.maxDegree(false), xe = be.filter(function(_e) { return _e.degree(false) === ve; }); l = l.add(xe); }, g = 0; g < v.length; g++) p(g); } var y = [], m = {}, b = function(ce, be) { y[be] == null && (y[be] = []); var ve = y[be].length; y[be].push(ce), R0(ce, { index: ve, depth: be }); }, w = function(ce, be) { var ve = ni(ce), xe = ve.depth, _e = ve.index; y[xe][_e] = null, b(ce, be); }; i.bfs({ roots: l, directed: e.directed, visit: function(ce, be, ve, xe, _e) { var He = ce[0], Ve = He.id(); b(He, _e), m[Ve] = true; } }); for (var x = [], E = 0; E < a.length; E++) { var C = a[E]; m[C.id()] || x.push(C); } var k = function(ce) { for (var be = y[ce], ve = 0; ve < be.length; ve++) { var xe = be[ve]; if (xe == null) { be.splice(ve, 1), ve--; continue; } R0(xe, { depth: ce, index: ve }); } }, S = function() { for (var ce = 0; ce < y.length; ce++) k(ce); }, _ = function(ce, be) { for (var ve = ni(ce), xe = ce.incomers().filter(function(I) { return I.isNode() && n.has(I); }), _e = -1, He = ce.id(), Ve = 0; Ve < xe.length; Ve++) { var De = xe[Ve], Ne = ni(De); _e = Math.max(_e, Ne.depth); } if (ve.depth <= _e) { if (!e.acyclic && be[He]) return null; var ue = _e + 1; return w(ce, ue), be[He] = ue, true; } return false; }; if (o && s) { var T = [], O = {}, D = function(ce) { return T.push(ce); }, A = function() { return T.shift(); }; for (a.forEach(function(fe) { return T.push(fe); }); T.length > 0; ) { var F = A(), R = _(F, O); if (R) F.outgoers().filter(function(fe) { return fe.isNode() && n.has(fe); }).forEach(D); else if (R === null) { tt("Detected double maximal shift for node `" + F.id() + "`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs."); break; } } } S(); var M = 0; if (e.avoidOverlap) for (var L = 0; L < a.length; L++) { var V = a[L], Y = V.layoutDimensions(e), H = Y.w, K = Y.h; M = Math.max(M, H, K); } var ne = {}, B = function(ce) { if (ne[ce.id()]) return ne[ce.id()]; for (var be = ni(ce).depth, ve = ce.neighborhood(), xe = 0, _e = 0, He = 0; He < ve.length; He++) { var Ve = ve[He]; if (!(Ve.isEdge() || Ve.isParent() || !a.has(Ve))) { var De = ni(Ve); if (De != null) { var Ne = De.index, ue = De.depth; if (!(Ne == null || ue == null)) { var I = y[ue].length; ue < be && (xe += Ne / I, _e++); } } } } return _e = Math.max(1, _e), xe = xe / _e, _e === 0 && (xe = 0), ne[ce.id()] = xe, xe; }, $ = function(ce, be) { var ve = B(ce), xe = B(be), _e = ve - xe; return _e === 0 ? rS(ce.id(), be.id()) : _e; }; e.depthSort !== void 0 && ($ = e.depthSort); for (var z = 0; z < y.length; z++) y[z].sort($), k(z); for (var W = [], Z = 0; Z < x.length; Z++) W.push(x[Z]); y.unshift(W), S(); for (var N = 0, X = 0; X < y.length; X++) N = Math.max(y[X].length, N); var Q = { x: u.x1 + u.w / 2, y: u.x1 + u.h / 2 }, ge = y.reduce(function(fe, ce) { return Math.max(fe, ce.length); }, 0), we = function(ce) { var be = ni(ce), ve = be.depth, xe = be.index, _e = y[ve].length, He = Math.max(u.w / ((e.grid ? ge : _e) + 1), M), Ve = Math.max(u.h / (y.length + 1), M), De = Math.min(u.w / 2 / y.length, u.h / 2 / y.length); if (De = Math.max(De, M), e.circle) { var ue = De * ve + De - (y.length > 0 && y[0].length <= 3 ? De / 2 : 0), I = 2 * Math.PI / y[ve].length * xe; return ve === 0 && y[0].length === 1 && (ue = 1), { x: Q.x + ue * Math.cos(I), y: Q.y + ue * Math.sin(I) }; } else { var Ne = { x: Q.x + (xe + 1 - (_e + 1) / 2) * He, y: (ve + 1) * Ve }; return Ne; } }; return n.nodes().layoutPositions(this, e, we), this; }; var d8 = { fit: true, // whether to fit the viewport to the graph padding: 30, // the padding on fit boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: true, // prevents node overlap, may overflow boundingBox and radius if not enough space nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up radius: void 0, // the radius of the circle startAngle: 3 / 2 * Math.PI, // where nodes start in radians sweep: void 0, // how many radians should be between the first and last node (defaults to full circle) clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function nk(t13) { this.options = ze({}, d8, t13); } nk.prototype.run = function() { var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, i = n.nodes().not(":parent"); e.sort && (i = i.sort(e.sort)); for (var o = br(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 }, u = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / i.length : e.sweep, l = u / Math.max(1, i.length - 1), c, d = 0, f = 0; f < i.length; f++) { var h10 = i[f], v = h10.layoutDimensions(e), p = v.w, g = v.h; d = Math.max(d, p, g); } if (Ce(e.radius) ? c = e.radius : i.length <= 1 ? c = 0 : c = Math.min(o.h, o.w) / 2 - d, i.length > 1 && e.avoidOverlap) { d *= 1.75; var y = Math.cos(l) - Math.cos(0), m = Math.sin(l) - Math.sin(0), b = Math.sqrt(d * d / (y * y + m * m)); c = Math.max(b, c); } var w = function(E, C) { var k = e.startAngle + C * l * (a ? 1 : -1), S = c * Math.cos(k), _ = c * Math.sin(k), T = { x: s.x + S, y: s.y + _ }; return T; }; return n.nodes().layoutPositions(this, e, w), this; }; var f8 = { fit: true, // whether to fit the viewport to the graph padding: 30, // the padding on fit startAngle: 3 / 2 * Math.PI, // where nodes start in radians sweep: void 0, // how many radians should be between the first and last node (defaults to full circle) clockwise: true, // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) equidistant: false, // whether levels have an equal radial distance betwen them, may cause bounding box overflow minNodeSpacing: 10, // min spacing between outside of nodes (used for radius adjustment) boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm height: void 0, // height of layout area (overrides container height) width: void 0, // width of layout area (overrides container width) spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up concentric: function(e) { return e.degree(); }, levelWidth: function(e) { return e.maxDegree() / 4; }, animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function ak(t13) { this.options = ze({}, f8, t13); } ak.prototype.run = function() { for (var t13 = this.options, e = t13, r = e.counterclockwise !== void 0 ? !e.counterclockwise : e.clockwise, n = t13.cy, a = e.eles, i = a.nodes().not(":parent"), o = br(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: n.width(), h: n.height() }), s = { x: o.x1 + o.w / 2, y: o.y1 + o.h / 2 }, u = [], l = 0, c = 0; c < i.length; c++) { var d = i[c], f = void 0; f = e.concentric(d), u.push({ value: f, node: d }), d._private.scratch.concentric = f; } i.updateStyle(); for (var h10 = 0; h10 < i.length; h10++) { var v = i[h10], p = v.layoutDimensions(e); l = Math.max(l, p.w, p.h); } u.sort(function(fe, ce) { return ce.value - fe.value; }); for (var g = e.levelWidth(i), y = [[]], m = y[0], b = 0; b < u.length; b++) { var w = u[b]; if (m.length > 0) { var x = Math.abs(m[0].value - w.value); x >= g && (m = [], y.push(m)); } m.push(w); } var E = l + e.minNodeSpacing; if (!e.avoidOverlap) { var C = y.length > 0 && y[0].length > 1, k = Math.min(o.w, o.h) / 2 - E, S = k / (y.length + C ? 1 : 0); E = Math.min(E, S); } for (var _ = 0, T = 0; T < y.length; T++) { var O = y[T], D = e.sweep === void 0 ? 2 * Math.PI - 2 * Math.PI / O.length : e.sweep, A = O.dTheta = D / Math.max(1, O.length - 1); if (O.length > 1 && e.avoidOverlap) { var F = Math.cos(A) - Math.cos(0), R = Math.sin(A) - Math.sin(0), M = Math.sqrt(E * E / (F * F + R * R)); _ = Math.max(M, _); } O.r = _, _ += E; } if (e.equidistant) { for (var L = 0, V = 0, Y = 0; Y < y.length; Y++) { var H = y[Y], K = H.r - V; L = Math.max(L, K); } V = 0; for (var ne = 0; ne < y.length; ne++) { var B = y[ne]; ne === 0 && (V = B.r), B.r = V, V += L; } } for (var $ = {}, z = 0; z < y.length; z++) for (var W = y[z], Z = W.dTheta, N = W.r, X = 0; X < W.length; X++) { var Q = W[X], ge = e.startAngle + (r ? 1 : -1) * Z * X, we = { x: s.x + N * Math.cos(ge), y: s.y + N * Math.sin(ge) }; $[Q.node.id()] = we; } return a.nodes().layoutPositions(this, e, function(fe) { var ce = fe.id(); return $[ce]; }), this; }; var $u; var v8 = { // Called on `layoutready` ready: function() { }, // Called on `layoutstop` stop: function() { }, // Whether to animate while running the layout // true : Animate continuously as the layout is running // false : Just show the end result // 'end' : Animate with the end result, from the initial positions to the end positions animate: true, // Easing of the animation for animate:'end' animationEasing: void 0, // The duration of the animation for animate:'end' animationDuration: void 0, // A function that determines whether the node should be animated // All nodes animated by default on animate enabled // Non-animated nodes are positioned immediately when the layout starts animateFilter: function(e, r) { return true; }, // The layout animates only after this many milliseconds for animate:true // (prevents flashing on fast runs) animationThreshold: 250, // Number of iterations between consecutive screen positions update refresh: 20, // Whether to fit the network view after when done fit: true, // Padding on fit padding: 30, // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } boundingBox: void 0, // Excludes the label when calculating node bounding boxes for the layout algorithm nodeDimensionsIncludeLabels: false, // Randomize the initial positions of the nodes (true) or use existing positions (false) randomize: false, // Extra spacing between components in non-compound graphs componentSpacing: 40, // Node repulsion (non overlapping) multiplier nodeRepulsion: function(e) { return 2048; }, // Node repulsion (overlapping) multiplier nodeOverlap: 4, // Ideal edge (non nested) length idealEdgeLength: function(e) { return 32; }, // Divisor to compute edge forces edgeElasticity: function(e) { return 32; }, // Nesting factor (multiplier) to compute ideal edge length for nested edges nestingFactor: 1.2, // Gravity force (constant) gravity: 1, // Maximum number of iterations to perform numIter: 1e3, // Initial temperature (maximum node displacement) initialTemp: 1e3, // Cooling factor (how the temperature is reduced between consecutive iterations coolingFactor: 0.99, // Lower temperature threshold (below this point the layout will end) minTemp: 1 }; function jl(t13) { this.options = ze({}, v8, t13), this.options.layout = this; var e = this.options.eles.nodes(), r = this.options.eles.edges(), n = r.filter(function(a) { var i = a.source().data("id"), o = a.target().data("id"), s = e.some(function(l) { return l.data("id") === i; }), u = e.some(function(l) { return l.data("id") === o; }); return !s || !u; }); this.options.eles = this.options.eles.not(n); } jl.prototype.run = function() { var t13 = this.options, e = t13.cy, r = this; r.stopped = false, (t13.animate === true || t13.animate === false) && r.emit({ type: "layoutstart", layout: r }), t13.debug === true ? $u = true : $u = false; var n = h8(e, r, t13); $u && y8(n), t13.randomize && m8(n); var a = kn(), i = function() { b8(n, e, t13), t13.fit === true && e.fit(t13.padding); }, o = function(f) { return !(r.stopped || f >= t13.numIter || (w8(n, t13), n.temperature = n.temperature * t13.coolingFactor, n.temperature < t13.minTemp)); }, s = function() { if (t13.animate === true || t13.animate === false) i(), r.one("layoutstop", t13.stop), r.emit({ type: "layoutstop", layout: r }); else { var f = t13.eles.nodes(), h10 = ik(n, t13, f); f.layoutPositions(r, t13, h10); } }, u = 0, l = true; if (t13.animate === true) { var c = function d() { for (var f = 0; l && f < t13.refresh; ) l = o(u), u++, f++; if (!l) F0(n, t13), s(); else { var h10 = kn(); h10 - a >= t13.animationThreshold && i(), ll(d); } }; c(); } else { for (; l; ) l = o(u), u++; F0(n, t13), s(); } return this; }; jl.prototype.stop = function() { return this.stopped = true, this.thread && this.thread.stop(), this.emit("layoutstop"), this; }; jl.prototype.destroy = function() { return this.thread && this.thread.stop(), this; }; var h8 = function(e, r, n) { for (var a = n.eles.edges(), i = n.eles.nodes(), o = br(n.boundingBox ? n.boundingBox : { x1: 0, y1: 0, w: e.width(), h: e.height() }), s = { isCompound: e.hasCompoundNodes(), layoutNodes: [], idToIndex: {}, nodeSize: i.size(), graphSet: [], indexToGraph: [], layoutEdges: [], edgeSize: a.size(), temperature: n.initialTemp, clientWidth: o.w, clientHeight: o.h, boundingBox: o }, u = n.eles.components(), l = {}, c = 0; c < u.length; c++) for (var d = u[c], f = 0; f < d.length; f++) { var h10 = d[f]; l[h10.id()] = c; } for (var c = 0; c < s.nodeSize; c++) { var v = i[c], p = v.layoutDimensions(n), g = {}; g.isLocked = v.locked(), g.id = v.data("id"), g.parentId = v.data("parent"), g.cmptId = l[v.id()], g.children = [], g.positionX = v.position("x"), g.positionY = v.position("y"), g.offsetX = 0, g.offsetY = 0, g.height = p.w, g.width = p.h, g.maxX = g.positionX + g.width / 2, g.minX = g.positionX - g.width / 2, g.maxY = g.positionY + g.height / 2, g.minY = g.positionY - g.height / 2, g.padLeft = parseFloat(v.style("padding")), g.padRight = parseFloat(v.style("padding")), g.padTop = parseFloat(v.style("padding")), g.padBottom = parseFloat(v.style("padding")), g.nodeRepulsion = yt(n.nodeRepulsion) ? n.nodeRepulsion(v) : n.nodeRepulsion, s.layoutNodes.push(g), s.idToIndex[g.id] = c; } for (var y = [], m = 0, b = -1, w = [], c = 0; c < s.nodeSize; c++) { var v = s.layoutNodes[c], x = v.parentId; x != null ? s.layoutNodes[s.idToIndex[x]].children.push(v.id) : (y[++b] = v.id, w.push(v.id)); } for (s.graphSet.push(w); m <= b; ) { var E = y[m++], C = s.idToIndex[E], h10 = s.layoutNodes[C], k = h10.children; if (k.length > 0) { s.graphSet.push(k); for (var c = 0; c < k.length; c++) y[++b] = k[c]; } } for (var c = 0; c < s.graphSet.length; c++) for (var S = s.graphSet[c], f = 0; f < S.length; f++) { var _ = s.idToIndex[S[f]]; s.indexToGraph[_] = c; } for (var c = 0; c < s.edgeSize; c++) { var T = a[c], O = {}; O.id = T.data("id"), O.sourceId = T.data("source"), O.targetId = T.data("target"); var D = yt(n.idealEdgeLength) ? n.idealEdgeLength(T) : n.idealEdgeLength, A = yt(n.edgeElasticity) ? n.edgeElasticity(T) : n.edgeElasticity, F = s.idToIndex[O.sourceId], R = s.idToIndex[O.targetId], M = s.indexToGraph[F], L = s.indexToGraph[R]; if (M != L) { for (var V = p8(O.sourceId, O.targetId, s), Y = s.graphSet[V], H = 0, g = s.layoutNodes[F]; Y.indexOf(g.id) === -1; ) g = s.layoutNodes[s.idToIndex[g.parentId]], H++; for (g = s.layoutNodes[R]; Y.indexOf(g.id) === -1; ) g = s.layoutNodes[s.idToIndex[g.parentId]], H++; D *= H * n.nestingFactor; } O.idealLength = D, O.elasticity = A, s.layoutEdges.push(O); } return s; }; var p8 = function(e, r, n) { var a = g8(e, r, 0, n); return 2 > a.count ? 0 : a.graph; }; var g8 = function t10(e, r, n, a) { var i = a.graphSet[n]; if (-1 < i.indexOf(e) && -1 < i.indexOf(r)) return { count: 2, graph: n }; for (var o = 0, s = 0; s < i.length; s++) { var u = i[s], l = a.idToIndex[u], c = a.layoutNodes[l].children; if (c.length !== 0) { var d = a.indexToGraph[a.idToIndex[c[0]]], f = t10(e, r, d, a); if (f.count !== 0) if (f.count === 1) { if (o++, o === 2) break; } else return f; } } return { count: o, graph: n }; }; var y8; var m8 = function(e, r) { for (var n = e.clientWidth, a = e.clientHeight, i = 0; i < e.nodeSize; i++) { var o = e.layoutNodes[i]; o.children.length === 0 && !o.isLocked && (o.positionX = Math.random() * n, o.positionY = Math.random() * a); } }; var ik = function(e, r, n) { var a = e.boundingBox, i = { x1: 1 / 0, x2: -1 / 0, y1: 1 / 0, y2: -1 / 0 }; return r.boundingBox && (n.forEach(function(o) { var s = e.layoutNodes[e.idToIndex[o.data("id")]]; i.x1 = Math.min(i.x1, s.positionX), i.x2 = Math.max(i.x2, s.positionX), i.y1 = Math.min(i.y1, s.positionY), i.y2 = Math.max(i.y2, s.positionY); }), i.w = i.x2 - i.x1, i.h = i.y2 - i.y1), function(o, s) { var u = e.layoutNodes[e.idToIndex[o.data("id")]]; if (r.boundingBox) { var l = (u.positionX - i.x1) / i.w, c = (u.positionY - i.y1) / i.h; return { x: a.x1 + l * a.w, y: a.y1 + c * a.h }; } else return { x: u.positionX, y: u.positionY }; }; }; var b8 = function(e, r, n) { var a = n.layout, i = n.eles.nodes(), o = ik(e, n, i); i.positions(o), e.ready !== true && (e.ready = true, a.one("layoutready", n.ready), a.emit({ type: "layoutready", layout: this })); }; var w8 = function(e, r, n) { C8(e, r), S8(e), k8(e, r), _8(e), T8(e); }; var C8 = function(e, r) { for (var n = 0; n < e.graphSet.length; n++) for (var a = e.graphSet[n], i = a.length, o = 0; o < i; o++) for (var s = e.layoutNodes[e.idToIndex[a[o]]], u = o + 1; u < i; u++) { var l = e.layoutNodes[e.idToIndex[a[u]]]; x8(s, l, e, r); } }; var L0 = function(e) { return -e + 2 * e * Math.random(); }; var x8 = function(e, r, n, a) { var i = e.cmptId, o = r.cmptId; if (!(i !== o && !n.isCompound)) { var s = r.positionX - e.positionX, u = r.positionY - e.positionY, l = 1; s === 0 && u === 0 && (s = L0(l), u = L0(l)); var c = E8(e, r, s, u); if (c > 0) var d = a.nodeOverlap * c, f = Math.sqrt(s * s + u * u), h10 = d * s / f, v = d * u / f; else var p = pl(e, s, u), g = pl(r, -1 * s, -1 * u), y = g.x - p.x, m = g.y - p.y, b = y * y + m * m, f = Math.sqrt(b), d = (e.nodeRepulsion + r.nodeRepulsion) / b, h10 = d * y / f, v = d * m / f; e.isLocked || (e.offsetX -= h10, e.offsetY -= v), r.isLocked || (r.offsetX += h10, r.offsetY += v); } }; var E8 = function(e, r, n, a) { if (n > 0) var i = e.maxX - r.minX; else var i = r.maxX - e.minX; if (a > 0) var o = e.maxY - r.minY; else var o = r.maxY - e.minY; return i >= 0 && o >= 0 ? Math.sqrt(i * i + o * o) : 0; }; var pl = function(e, r, n) { var a = e.positionX, i = e.positionY, o = e.height || 1, s = e.width || 1, u = n / r, l = o / s, c = {}; return r === 0 && 0 < n || r === 0 && 0 > n ? (c.x = a, c.y = i + o / 2, c) : 0 < r && -1 * l <= u && u <= l ? (c.x = a + s / 2, c.y = i + s * n / 2 / r, c) : 0 > r && -1 * l <= u && u <= l ? (c.x = a - s / 2, c.y = i - s * n / 2 / r, c) : 0 < n && (u <= -1 * l || u >= l) ? (c.x = a + o * r / 2 / n, c.y = i + o / 2, c) : (0 > n && (u <= -1 * l || u >= l) && (c.x = a - o * r / 2 / n, c.y = i - o / 2), c); }; var S8 = function(e, r) { for (var n = 0; n < e.edgeSize; n++) { var a = e.layoutEdges[n], i = e.idToIndex[a.sourceId], o = e.layoutNodes[i], s = e.idToIndex[a.targetId], u = e.layoutNodes[s], l = u.positionX - o.positionX, c = u.positionY - o.positionY; if (!(l === 0 && c === 0)) { var d = pl(o, l, c), f = pl(u, -1 * l, -1 * c), h10 = f.x - d.x, v = f.y - d.y, p = Math.sqrt(h10 * h10 + v * v), g = Math.pow(a.idealLength - p, 2) / a.elasticity; if (p !== 0) var y = g * h10 / p, m = g * v / p; else var y = 0, m = 0; o.isLocked || (o.offsetX += y, o.offsetY += m), u.isLocked || (u.offsetX -= y, u.offsetY -= m); } } }; var k8 = function(e, r) { if (r.gravity !== 0) for (var n = 1, a = 0; a < e.graphSet.length; a++) { var i = e.graphSet[a], o = i.length; if (a === 0) var s = e.clientHeight / 2, u = e.clientWidth / 2; else var l = e.layoutNodes[e.idToIndex[i[0]]], c = e.layoutNodes[e.idToIndex[l.parentId]], s = c.positionX, u = c.positionY; for (var d = 0; d < o; d++) { var f = e.layoutNodes[e.idToIndex[i[d]]]; if (!f.isLocked) { var h10 = s - f.positionX, v = u - f.positionY, p = Math.sqrt(h10 * h10 + v * v); if (p > n) { var g = r.gravity * h10 / p, y = r.gravity * v / p; f.offsetX += g, f.offsetY += y; } } } } }; var _8 = function(e, r) { var n = [], a = 0, i = -1; for (n.push.apply(n, e.graphSet[0]), i += e.graphSet[0].length; a <= i; ) { var o = n[a++], s = e.idToIndex[o], u = e.layoutNodes[s], l = u.children; if (0 < l.length && !u.isLocked) { for (var c = u.offsetX, d = u.offsetY, f = 0; f < l.length; f++) { var h10 = e.layoutNodes[e.idToIndex[l[f]]]; h10.offsetX += c, h10.offsetY += d, n[++i] = l[f]; } u.offsetX = 0, u.offsetY = 0; } } }; var T8 = function(e, r) { for (var n = 0; n < e.nodeSize; n++) { var a = e.layoutNodes[n]; 0 < a.children.length && (a.maxX = void 0, a.minX = void 0, a.maxY = void 0, a.minY = void 0); } for (var n = 0; n < e.nodeSize; n++) { var a = e.layoutNodes[n]; if (!(0 < a.children.length || a.isLocked)) { var i = I8(a.offsetX, a.offsetY, e.temperature); a.positionX += i.x, a.positionY += i.y, a.offsetX = 0, a.offsetY = 0, a.minX = a.positionX - a.width, a.maxX = a.positionX + a.width, a.minY = a.positionY - a.height, a.maxY = a.positionY + a.height, O8(a, e); } } for (var n = 0; n < e.nodeSize; n++) { var a = e.layoutNodes[n]; 0 < a.children.length && !a.isLocked && (a.positionX = (a.maxX + a.minX) / 2, a.positionY = (a.maxY + a.minY) / 2, a.width = a.maxX - a.minX, a.height = a.maxY - a.minY); } }; var I8 = function(e, r, n) { var a = Math.sqrt(e * e + r * r); if (a > n) var i = { x: n * e / a, y: n * r / a }; else var i = { x: e, y: r }; return i; }; var O8 = function t11(e, r) { var n = e.parentId; if (n != null) { var a = r.layoutNodes[r.idToIndex[n]], i = false; if ((a.maxX == null || e.maxX + a.padRight > a.maxX) && (a.maxX = e.maxX + a.padRight, i = true), (a.minX == null || e.minX - a.padLeft < a.minX) && (a.minX = e.minX - a.padLeft, i = true), (a.maxY == null || e.maxY + a.padBottom > a.maxY) && (a.maxY = e.maxY + a.padBottom, i = true), (a.minY == null || e.minY - a.padTop < a.minY) && (a.minY = e.minY - a.padTop, i = true), i) return t11(a, r); } }; var F0 = function(e, r) { for (var n = e.layoutNodes, a = [], i = 0; i < n.length; i++) { var o = n[i], s = o.cmptId, u = a[s] = a[s] || []; u.push(o); } for (var l = 0, i = 0; i < a.length; i++) { var c = a[i]; if (c) { c.x1 = 1 / 0, c.x2 = -1 / 0, c.y1 = 1 / 0, c.y2 = -1 / 0; for (var d = 0; d < c.length; d++) { var f = c[d]; c.x1 = Math.min(c.x1, f.positionX - f.width / 2), c.x2 = Math.max(c.x2, f.positionX + f.width / 2), c.y1 = Math.min(c.y1, f.positionY - f.height / 2), c.y2 = Math.max(c.y2, f.positionY + f.height / 2); } c.w = c.x2 - c.x1, c.h = c.y2 - c.y1, l += c.w * c.h; } } a.sort(function(m, b) { return b.w * b.h - m.w * m.h; }); for (var h10 = 0, v = 0, p = 0, g = 0, y = Math.sqrt(l) * e.clientWidth / e.clientHeight, i = 0; i < a.length; i++) { var c = a[i]; if (c) { for (var d = 0; d < c.length; d++) { var f = c[d]; f.isLocked || (f.positionX += h10 - c.x1, f.positionY += v - c.y1); } h10 += c.w + r.componentSpacing, p += c.w + r.componentSpacing, g = Math.max(g, c.h), p > y && (v += g + r.componentSpacing, h10 = 0, p = 0, g = 0); } } }; var A8 = { fit: true, // whether to fit the viewport to the graph padding: 30, // padding used on fit boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } avoidOverlap: true, // prevents node overlap, may overflow boundingBox if not enough space avoidOverlapPadding: 10, // extra spacing around nodes when avoidOverlap: true nodeDimensionsIncludeLabels: false, // Excludes the label when calculating node bounding boxes for the layout algorithm spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up condense: false, // uses all available space on false, uses minimal space on true rows: void 0, // force num of rows in the grid cols: void 0, // force num of columns in the grid position: function(e) { }, // returns { row, col } for element sort: void 0, // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') } animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function ok(t13) { this.options = ze({}, A8, t13); } ok.prototype.run = function() { var t13 = this.options, e = t13, r = t13.cy, n = e.eles, a = n.nodes().not(":parent"); e.sort && (a = a.sort(e.sort)); var i = br(e.boundingBox ? e.boundingBox : { x1: 0, y1: 0, w: r.width(), h: r.height() }); if (i.h === 0 || i.w === 0) n.nodes().layoutPositions(this, e, function(ne) { return { x: i.x1, y: i.y1 }; }); else { var o = a.size(), s = Math.sqrt(o * i.h / i.w), u = Math.round(s), l = Math.round(i.w / i.h * s), c = function(B) { if (B == null) return Math.min(u, l); var $ = Math.min(u, l); $ == u ? u = B : l = B; }, d = function(B) { if (B == null) return Math.max(u, l); var $ = Math.max(u, l); $ == u ? u = B : l = B; }, f = e.rows, h10 = e.cols != null ? e.cols : e.columns; if (f != null && h10 != null) u = f, l = h10; else if (f != null && h10 == null) u = f, l = Math.ceil(o / u); else if (f == null && h10 != null) l = h10, u = Math.ceil(o / l); else if (l * u > o) { var v = c(), p = d(); (v - 1) * p >= o ? c(v - 1) : (p - 1) * v >= o && d(p - 1); } else for (; l * u < o; ) { var g = c(), y = d(); (y + 1) * g >= o ? d(y + 1) : c(g + 1); } var m = i.w / l, b = i.h / u; if (e.condense && (m = 0, b = 0), e.avoidOverlap) for (var w = 0; w < a.length; w++) { var x = a[w], E = x._private.position; (E.x == null || E.y == null) && (E.x = 0, E.y = 0); var C = x.layoutDimensions(e), k = e.avoidOverlapPadding, S = C.w + k, _ = C.h + k; m = Math.max(m, S), b = Math.max(b, _); } for (var T = {}, O = function(B, $) { return !!T["c-" + B + "-" + $]; }, D = function(B, $) { T["c-" + B + "-" + $] = true; }, A = 0, F = 0, R = function() { F++, F >= l && (F = 0, A++); }, M = {}, L = 0; L < a.length; L++) { var V = a[L], Y = e.position(V); if (Y && (Y.row !== void 0 || Y.col !== void 0)) { var H = { row: Y.row, col: Y.col }; if (H.col === void 0) for (H.col = 0; O(H.row, H.col); ) H.col++; else if (H.row === void 0) for (H.row = 0; O(H.row, H.col); ) H.row++; M[V.id()] = H, D(H.row, H.col); } } var K = function(B, $) { var z, W; if (B.locked() || B.isParent()) return false; var Z = M[B.id()]; if (Z) z = Z.col * m + m / 2 + i.x1, W = Z.row * b + b / 2 + i.y1; else { for (; O(A, F); ) R(); z = F * m + m / 2 + i.x1, W = A * b + b / 2 + i.y1, D(A, F), R(); } return { x: z, y: W }; }; a.layoutPositions(this, e, K); } return this; }; var P8 = { ready: function() { }, // on layoutready stop: function() { } // on layoutstop }; function Kg(t13) { this.options = ze({}, P8, t13); } Kg.prototype.run = function() { var t13 = this.options, e = t13.eles, r = this; return t13.cy, r.emit("layoutstart"), e.nodes().positions(function() { return { x: 0, y: 0 }; }), r.one("layoutready", t13.ready), r.emit("layoutready"), r.one("layoutstop", t13.stop), r.emit("layoutstop"), this; }; Kg.prototype.stop = function() { return this; }; var D8 = { positions: void 0, // map of (node id) => (position obj); or function(node){ return somPos; } zoom: void 0, // the zoom level to set (prob want fit = false if set) pan: void 0, // the pan level to set (prob want fit = false if set) fit: true, // whether to fit to viewport padding: 30, // padding on fit spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function sk(t13) { this.options = ze({}, D8, t13); } sk.prototype.run = function() { var t13 = this.options, e = t13.eles, r = e.nodes(), n = yt(t13.positions); function a(i) { if (t13.positions == null) return M$(i.position()); if (n) return t13.positions(i); var o = t13.positions[i._private.data.id]; return o ?? null; } return r.layoutPositions(this, t13, function(i, o) { var s = a(i); return i.locked() || s == null ? false : s; }), this; }; var R8 = { fit: true, // whether to fit to viewport padding: 30, // fit padding boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } animate: false, // whether to transition the node positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled animateFilter: function(e, r) { return true; }, // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts ready: void 0, // callback on layoutready stop: void 0, // callback on layoutstop transform: function(e, r) { return r; } // transform a given node position. Useful for changing flow direction in discrete layouts }; function lk(t13) { this.options = ze({}, R8, t13); } lk.prototype.run = function() { var t13 = this.options, e = t13.cy, r = t13.eles, n = br(t13.boundingBox ? t13.boundingBox : { x1: 0, y1: 0, w: e.width(), h: e.height() }), a = function(o, s) { return { x: n.x1 + Math.round(Math.random() * n.w), y: n.y1 + Math.round(Math.random() * n.h) }; }; return r.nodes().layoutPositions(this, t13, a), this; }; var L8 = [{ name: "breadthfirst", impl: rk }, { name: "circle", impl: nk }, { name: "concentric", impl: ak }, { name: "cose", impl: jl }, { name: "grid", impl: ok }, { name: "null", impl: Kg }, { name: "preset", impl: sk }, { name: "random", impl: lk }]; function uk(t13) { this.options = t13, this.notifications = 0; } var M0 = function() { }; var N0 = function() { throw new Error("A headless instance can not render images"); }; uk.prototype = { recalculateRenderedStyle: M0, notify: function() { this.notifications++; }, init: M0, isHeadless: function() { return true; }, png: N0, jpg: N0 }; var Gg = {}; Gg.arrowShapeWidth = 0.3; Gg.registerArrowShapes = function() { var t13 = this.arrowShapes = {}, e = this, r = function(l, c, d, f, h10, v, p) { var g = h10.x - d / 2 - p, y = h10.x + d / 2 + p, m = h10.y - d / 2 - p, b = h10.y + d / 2 + p, w = g <= l && l <= y && m <= c && c <= b; return w; }, n = function(l, c, d, f, h10) { var v = l * Math.cos(f) - c * Math.sin(f), p = l * Math.sin(f) + c * Math.cos(f), g = v * d, y = p * d, m = g + h10.x, b = y + h10.y; return { x: m, y: b }; }, a = function(l, c, d, f) { for (var h10 = [], v = 0; v < l.length; v += 2) { var p = l[v], g = l[v + 1]; h10.push(n(p, g, c, d, f)); } return h10; }, i = function(l) { for (var c = [], d = 0; d < l.length; d++) { var f = l[d]; c.push(f.x, f.y); } return c; }, o = function(l) { return l.pstyle("width").pfValue * l.pstyle("arrow-scale").pfValue * 2; }, s = function(l, c) { Me(c) && (c = t13[c]), t13[l] = ze({ name: l, points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3], collide: function(f, h10, v, p, g, y) { var m = i(a(this.points, v + 2 * y, p, g)), b = vr(f, h10, m); return b; }, roughCollide: r, draw: function(f, h10, v, p) { var g = a(this.points, h10, v, p); e.arrowShapeImpl("polygon")(f, g); }, spacing: function(f) { return 0; }, gap: o }, c); }; s("none", { collide: ul, roughCollide: ul, draw: Ag, spacing: Wm, gap: Wm }), s("triangle", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3] }), s("arrow", "triangle"), s("triangle-backcurve", { points: t13.triangle.points, controlPoint: [0, -0.15], roughCollide: r, draw: function(l, c, d, f, h10) { var v = a(this.points, c, d, f), p = this.controlPoint, g = n(p[0], p[1], c, d, f); e.arrowShapeImpl(this.name)(l, v, g); }, gap: function(l) { return o(l) * 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(l, c, d, f, h10, v, p) { var g = i(a(this.points, d + 2 * p, f, h10)), y = i(a(this.pointsTee, d + 2 * p, f, h10)), m = vr(l, c, g) || vr(l, c, y); return m; }, draw: function(l, c, d, f, h10) { var v = a(this.points, c, d, f), p = a(this.pointsTee, c, d, f); e.arrowShapeImpl(this.name)(l, v, p); } }), s("circle-triangle", { radius: 0.15, pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15], collide: function(l, c, d, f, h10, v, p) { var g = h10, y = Math.pow(g.x - l, 2) + Math.pow(g.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2), m = i(a(this.points, d + 2 * p, f, h10)); return vr(l, c, m) || y; }, draw: function(l, c, d, f, h10) { var v = a(this.pointsTr, c, d, f); e.arrowShapeImpl(this.name)(l, v, f.x, f.y, this.radius * c); }, spacing: function(l) { return e.getArrowWidth(l.pstyle("width").pfValue, l.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(l, c) { var d = this.baseCrossLinePts.slice(), f = c / l, h10 = 3, v = 5; return d[h10] = d[h10] - f, d[v] = d[v] - f, d; }, collide: function(l, c, d, f, h10, v, p) { var g = i(a(this.points, d + 2 * p, f, h10)), y = i(a(this.crossLinePts(d, v), d + 2 * p, f, h10)), m = vr(l, c, g) || vr(l, c, y); return m; }, draw: function(l, c, d, f, h10) { var v = a(this.points, c, d, f), p = a(this.crossLinePts(c, h10), c, d, f); e.arrowShapeImpl(this.name)(l, v, p); } }), s("vee", { points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15], gap: function(l) { return o(l) * 0.525; } }), s("circle", { radius: 0.15, collide: function(l, c, d, f, h10, v, p) { var g = h10, y = Math.pow(g.x - l, 2) + Math.pow(g.y - c, 2) <= Math.pow((d + 2 * p) * this.radius, 2); return y; }, draw: function(l, c, d, f, h10) { e.arrowShapeImpl(this.name)(l, f.x, f.y, this.radius * c); }, spacing: function(l) { return e.getArrowWidth(l.pstyle("width").pfValue, l.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(l) { return 1; }, gap: function(l) { 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(l) { return l.pstyle("width").pfValue * l.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(l) { return 0.95 * l.pstyle("width").pfValue * l.pstyle("arrow-scale").value; } }); }; var Ka = {}; Ka.projectIntoViewport = function(t13, e) { var r = this.cy, n = this.findContainerClientCoords(), a = n[0], i = n[1], o = n[4], s = r.pan(), u = r.zoom(), l = ((t13 - a) / o - s.x) / u, c = ((e - i) / o - s.y) / u; return [l, c]; }; Ka.findContainerClientCoords = function() { if (this.containerBB) return this.containerBB; var t13 = this.container, e = t13.getBoundingClientRect(), r = this.cy.window().getComputedStyle(t13), n = function(y) { return parseFloat(r.getPropertyValue(y)); }, a = { left: n("padding-left"), right: n("padding-right"), top: n("padding-top"), bottom: n("padding-bottom") }, i = { left: n("border-left-width"), right: n("border-right-width"), top: n("border-top-width"), bottom: n("border-bottom-width") }, o = t13.clientWidth, s = t13.clientHeight, u = a.left + a.right, l = a.top + a.bottom, c = i.left + i.right, d = e.width / (o + c), f = o - u, h10 = s - l, v = e.left + a.left + i.left, p = e.top + a.top + i.top; return this.containerBB = [v, p, f, h10, d]; }; Ka.invalidateContainerClientCoordsCache = function() { this.containerBB = null; }; Ka.findNearestElement = function(t13, e, r, n) { return this.findNearestElements(t13, e, r, n)[0]; }; Ka.findNearestElements = function(t13, e, r, n) { var a = this, i = this, o = i.getCachedZSortedEles(), s = [], u = i.cy.zoom(), l = i.cy.hasCompoundNodes(), c = (n ? 24 : 8) / u, d = (n ? 8 : 2) / u, f = (n ? 8 : 2) / u, h10 = 1 / 0, v, p; r && (o = o.interactive); function g(C, k) { if (C.isNode()) { if (p) return; p = C, s.push(C); } if (C.isEdge() && (k == null || k < h10)) if (v) { if (v.pstyle("z-compound-depth").value === C.pstyle("z-compound-depth").value && v.pstyle("z-compound-depth").value === C.pstyle("z-compound-depth").value) { for (var S = 0; S < s.length; S++) if (s[S].isEdge()) { s[S] = C, v = C, h10 = k ?? h10; break; } } } else s.push(C), v = C, h10 = k ?? h10; } function y(C) { var k = C.outerWidth() + 2 * d, S = C.outerHeight() + 2 * d, _ = k / 2, T = S / 2, O = C.position(), D = C.pstyle("corner-radius").value === "auto" ? "auto" : C.pstyle("corner-radius").pfValue, A = C._private.rscratch; if (O.x - _ <= t13 && t13 <= O.x + _ && O.y - T <= e && e <= O.y + T) { var F = i.nodeShapes[a.getNodeShape(C)]; if (F.checkPoint(t13, e, 0, k, S, O.x, O.y, D, A)) return g(C, 0), true; } } function m(C) { var k = C._private, S = k.rscratch, _ = C.pstyle("width").pfValue, T = C.pstyle("arrow-scale").value, O = _ / 2 + c, D = O * O, A = O * 2, L = k.source, V = k.target, F; if (S.edgeType === "segments" || S.edgeType === "straight" || S.edgeType === "haystack") { for (var R = S.allpts, M = 0; M + 3 < R.length; M += 2) if (Y$(t13, e, R[M], R[M + 1], R[M + 2], R[M + 3], A) && D > (F = eq(t13, e, R[M], R[M + 1], R[M + 2], R[M + 3]))) return g(C, F), true; } else if (S.edgeType === "bezier" || S.edgeType === "multibezier" || S.edgeType === "self" || S.edgeType === "compound") { for (var R = S.allpts, M = 0; M + 5 < S.allpts.length; M += 4) if (Z$(t13, e, R[M], R[M + 1], R[M + 2], R[M + 3], R[M + 4], R[M + 5], A) && D > (F = Q$(t13, e, R[M], R[M + 1], R[M + 2], R[M + 3], R[M + 4], R[M + 5]))) return g(C, F), true; } for (var L = L || k.source, V = V || k.target, Y = a.getArrowWidth(_, T), H = [{ name: "source", x: S.arrowStartX, y: S.arrowStartY, angle: S.srcArrowAngle }, { name: "target", x: S.arrowEndX, y: S.arrowEndY, angle: S.tgtArrowAngle }, { name: "mid-source", x: S.midX, y: S.midY, angle: S.midsrcArrowAngle }, { name: "mid-target", x: S.midX, y: S.midY, angle: S.midtgtArrowAngle }], M = 0; M < H.length; M++) { var K = H[M], ne = i.arrowShapes[C.pstyle(K.name + "-arrow-shape").value], B = C.pstyle("width").pfValue; if (ne.roughCollide(t13, e, Y, K.angle, { x: K.x, y: K.y }, B, c) && ne.collide(t13, e, Y, K.angle, { x: K.x, y: K.y }, B, c)) return g(C), true; } l && s.length > 0 && (y(L), y(V)); } function b(C, k, S) { return Kr(C, k, S); } function w(C, k) { var S = C._private, _ = f, T; k ? T = k + "-" : T = "", C.boundingBox(); var O = S.labelBounds[k || "main"], D = C.pstyle(T + "label").value, A = C.pstyle("text-events").strValue === "yes"; if (!(!A || !D)) { var F = b(S.rscratch, "labelX", k), R = b(S.rscratch, "labelY", k), M = b(S.rscratch, "labelAngle", k), L = C.pstyle(T + "text-margin-x").pfValue, V = C.pstyle(T + "text-margin-y").pfValue, Y = O.x1 - _ - L, H = O.x2 + _ - L, K = O.y1 - _ - V, ne = O.y2 + _ - V; if (M) { var B = Math.cos(M), $ = Math.sin(M), z = function(we, fe) { return we = we - F, fe = fe - R, { x: we * B - fe * $ + F, y: we * $ + fe * B + R }; }, W = z(Y, K), Z = z(Y, ne), N = z(H, K), X = z(H, ne), Q = [ // with the margin added after the rotation is applied W.x + L, W.y + V, N.x + L, N.y + V, X.x + L, X.y + V, Z.x + L, Z.y + V ]; if (vr(t13, e, Q)) return g(C), true; } else if (Ti(O, t13, e)) return g(C), true; } } for (var x = o.length - 1; x >= 0; x--) { var E = o[x]; E.isNode() ? y(E) || w(E) : m(E) || w(E) || w(E, "source") || w(E, "target"); } return s; }; Ka.getAllInBox = function(t13, e, r, n) { var a = this.getCachedZSortedEles().interactive, i = [], o = Math.min(t13, r), s = Math.max(t13, r), u = Math.min(e, n), l = Math.max(e, n); t13 = o, r = s, e = u, n = l; for (var c = br({ x1: t13, y1: e, x2: r, y2: n }), d = 0; d < a.length; d++) { var f = a[d]; if (f.isNode()) { var h10 = f, v = h10.boundingBox({ includeNodes: true, includeEdges: false, includeLabels: false }); Rg(c, v) && !mS(v, c) && i.push(h10); } else { var p = f, g = p._private, y = g.rscratch; if (y.startX != null && y.startY != null && !Ti(c, y.startX, y.startY) || y.endX != null && y.endY != null && !Ti(c, y.endX, y.endY)) continue; if (y.edgeType === "bezier" || y.edgeType === "multibezier" || y.edgeType === "self" || y.edgeType === "compound" || y.edgeType === "segments" || y.edgeType === "haystack") { for (var m = g.rstyle.bezierPts || g.rstyle.linePts || g.rstyle.haystackPts, b = true, w = 0; w < m.length; w++) if (!j$(c, m[w])) { b = false; break; } b && i.push(p); } else (y.edgeType === "haystack" || y.edgeType === "straight") && i.push(p); } } return i; }; var gl = {}; gl.calculateArrowAngles = function(t13) { var e = t13._private.rscratch, r = e.edgeType === "haystack", n = e.edgeType === "bezier", a = e.edgeType === "multibezier", i = e.edgeType === "segments", o = e.edgeType === "compound", s = e.edgeType === "self", u, l, c, d, f, h10, y, m; if (r ? (c = e.haystackPts[0], d = e.haystackPts[1], f = e.haystackPts[2], h10 = e.haystackPts[3]) : (c = e.arrowStartX, d = e.arrowStartY, f = e.arrowEndX, h10 = e.arrowEndY), y = e.midX, m = e.midY, i) u = c - e.segpts[0], l = d - e.segpts[1]; else if (a || o || s || n) { var v = e.allpts, p = zt(v[0], v[2], v[4], 0.1), g = zt(v[1], v[3], v[5], 0.1); u = c - p, l = d - g; } else u = c - y, l = d - m; e.srcArrowAngle = _s(u, l); var y = e.midX, m = e.midY; if (r && (y = (c + f) / 2, m = (d + h10) / 2), u = f - c, l = h10 - d, i) { var v = e.allpts; if (v.length / 2 % 2 === 0) { var b = v.length / 2, w = b - 2; u = v[b] - v[w], l = v[b + 1] - v[w + 1]; } else if (e.isRound) u = e.midVector[1], l = -e.midVector[0]; else { var b = v.length / 2 - 1, w = b - 2; u = v[b] - v[w], l = v[b + 1] - v[w + 1]; } } else if (a || o || s) { var v = e.allpts, x = e.ctrlpts, E, C, k, S; if (x.length / 2 % 2 === 0) { var _ = v.length / 2 - 1, T = _ + 2, O = T + 2; E = zt(v[_], v[T], v[O], 0), C = zt(v[_ + 1], v[T + 1], v[O + 1], 0), k = zt(v[_], v[T], v[O], 1e-4), S = zt(v[_ + 1], v[T + 1], v[O + 1], 1e-4); } else { var T = v.length / 2 - 1, _ = T - 2, O = T + 2; E = zt(v[_], v[T], v[O], 0.4999), C = zt(v[_ + 1], v[T + 1], v[O + 1], 0.4999), k = zt(v[_], v[T], v[O], 0.5), S = zt(v[_ + 1], v[T + 1], v[O + 1], 0.5); } u = k - E, l = S - C; } if (e.midtgtArrowAngle = _s(u, l), e.midDispX = u, e.midDispY = l, u *= -1, l *= -1, i) { var v = e.allpts; if (v.length / 2 % 2 !== 0) { if (!e.isRound) { var b = v.length / 2 - 1, D = b + 2; u = -(v[D] - v[b]), l = -(v[D + 1] - v[b + 1]); } } } if (e.midsrcArrowAngle = _s(u, l), i) u = f - e.segpts[e.segpts.length - 2], l = h10 - e.segpts[e.segpts.length - 1]; else if (a || o || s || n) { var v = e.allpts, A = v.length, p = zt(v[A - 6], v[A - 4], v[A - 2], 0.9), g = zt(v[A - 5], v[A - 3], v[A - 1], 0.9); u = f - p, l = h10 - g; } else u = f - y, l = h10 - m; e.tgtArrowAngle = _s(u, l); }; gl.getArrowWidth = gl.getArrowHeight = function(t13, e) { var r = this.arrowWidthCache = this.arrowWidthCache || {}, n = r[t13 + ", " + e]; return n || (n = Math.max(Math.pow(t13 * 13.37, 0.9), 29) * e, r[t13 + ", " + e] = n, n); }; var Rp; var Lp; var tn = {}; var Ir = {}; var B0; var $0; var wa; var Ys; var yn; var ha; var ya; var en; var ai; var Fs; var ck; var dk; var Fp; var Mp; var q0; var z0 = function(e, r, n) { n.x = r.x - e.x, n.y = r.y - e.y, n.len = Math.sqrt(n.x * n.x + n.y * n.y), n.nx = n.x / n.len, n.ny = n.y / n.len, n.ang = Math.atan2(n.ny, n.nx); }; var F8 = function(e, r) { r.x = e.x * -1, r.y = e.y * -1, r.nx = e.nx * -1, r.ny = e.ny * -1, r.ang = e.ang > 0 ? -(Math.PI - e.ang) : Math.PI + e.ang; }; var M8 = function(e, r, n, a, i) { if (e !== q0 ? z0(r, e, tn) : F8(Ir, tn), z0(r, n, Ir), B0 = tn.nx * Ir.ny - tn.ny * Ir.nx, $0 = tn.nx * Ir.nx - tn.ny * -Ir.ny, yn = Math.asin(Math.max(-1, Math.min(1, B0))), Math.abs(yn) < 1e-6) { Rp = r.x, Lp = r.y, ya = ai = 0; return; } wa = 1, Ys = false, $0 < 0 ? yn < 0 ? yn = Math.PI + yn : (yn = Math.PI - yn, wa = -1, Ys = true) : yn > 0 && (wa = -1, Ys = true), r.radius !== void 0 ? ai = r.radius : ai = a, ha = yn / 2, Fs = Math.min(tn.len / 2, Ir.len / 2), i ? (en = Math.abs(Math.cos(ha) * ai / Math.sin(ha)), en > Fs ? (en = Fs, ya = Math.abs(en * Math.sin(ha) / Math.cos(ha))) : ya = ai) : (en = Math.min(Fs, ai), ya = Math.abs(en * Math.sin(ha) / Math.cos(ha))), Fp = r.x + Ir.nx * en, Mp = r.y + Ir.ny * en, Rp = Fp - Ir.ny * ya * wa, Lp = Mp + Ir.nx * ya * wa, ck = r.x + tn.nx * en, dk = r.y + tn.ny * en, q0 = r; }; function fk(t13, e) { e.radius === 0 ? t13.lineTo(e.cx, e.cy) : t13.arc(e.cx, e.cy, e.radius, e.startAngle, e.endAngle, e.counterClockwise); } function Ug(t13, e, r, n) { var a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true; return n === 0 || e.radius === 0 ? { cx: e.x, cy: e.y, radius: 0, startX: e.x, startY: e.y, stopX: e.x, stopY: e.y, startAngle: void 0, endAngle: void 0, counterClockwise: void 0 } : (M8(t13, e, r, n, a), { cx: Rp, cy: Lp, radius: ya, startX: ck, startY: dk, stopX: Fp, stopY: Mp, startAngle: tn.ang + Math.PI / 2 * wa, endAngle: Ir.ang - Math.PI / 2 * wa, counterClockwise: Ys }); } var lr = {}; lr.findMidptPtsEtc = function(t13, e) { var r = e.posPts, n = e.intersectionPts, a = e.vectorNormInverse, i, o = t13.pstyle("source-endpoint"), s = t13.pstyle("target-endpoint"), u = o.units != null && s.units != null, l = function(x, E, C, k) { var S = k - E, _ = C - x, T = Math.sqrt(_ * _ + S * S); return { x: -S / T, y: _ / T }; }, c = t13.pstyle("edge-distances").value; switch (c) { case "node-position": i = r; break; case "intersection": i = n; break; case "endpoints": { if (u) { var d = this.manualEndptToPx(t13.source()[0], o), f = Vr(d, 2), h10 = f[0], v = f[1], p = this.manualEndptToPx(t13.target()[0], s), g = Vr(p, 2), y = g[0], m = g[1], b = { x1: h10, y1: v, x2: y, y2: m }; a = l(h10, v, y, m), i = b; } else tt("Edge ".concat(t13.id(), " has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")), i = n; break; } } return { midptPts: i, vectorNormInverse: a }; }; lr.findHaystackPoints = function(t13) { for (var e = 0; e < t13.length; e++) { var r = t13[e], n = r._private, a = n.rscratch; if (!a.haystack) { var i = Math.random() * 2 * Math.PI; a.source = { x: Math.cos(i), y: Math.sin(i) }, i = Math.random() * 2 * Math.PI, a.target = { x: Math.cos(i), y: Math.sin(i) }; } var o = n.source, s = n.target, u = o.position(), l = s.position(), c = o.width(), d = s.width(), f = o.height(), h10 = s.height(), v = r.pstyle("haystack-radius").value, p = v / 2; a.haystackPts = a.allpts = [a.source.x * c * p + u.x, a.source.y * f * p + u.y, a.target.x * d * p + l.x, a.target.y * h10 * p + l.y], a.midX = (a.allpts[0] + a.allpts[2]) / 2, a.midY = (a.allpts[1] + a.allpts[3]) / 2, a.edgeType = "haystack", a.haystack = true, this.storeEdgeProjections(r), this.calculateArrowAngles(r), this.recalculateEdgeLabelProjections(r), this.calculateLabelAngles(r); } }; lr.findSegmentsPoints = function(t13, e) { var r = t13._private.rscratch, n = t13.pstyle("segment-weights"), a = t13.pstyle("segment-distances"), i = t13.pstyle("segment-radii"), o = t13.pstyle("radius-type"), s = Math.min(n.pfValue.length, a.pfValue.length), u = i.pfValue[i.pfValue.length - 1], l = o.pfValue[o.pfValue.length - 1]; r.edgeType = "segments", r.segpts = [], r.radii = [], r.isArcRadius = []; for (var c = 0; c < s; c++) { var d = n.pfValue[c], f = a.pfValue[c], h10 = 1 - d, v = d, p = this.findMidptPtsEtc(t13, e), g = p.midptPts, y = p.vectorNormInverse, m = { x: g.x1 * h10 + g.x2 * v, y: g.y1 * h10 + g.y2 * v }; r.segpts.push(m.x + y.x * f, m.y + y.y * f), r.radii.push(i.pfValue[c] !== void 0 ? i.pfValue[c] : u), r.isArcRadius.push((o.pfValue[c] !== void 0 ? o.pfValue[c] : l) === "arc-radius"); } }; lr.findLoopPoints = function(t13, e, r, n) { var a = t13._private.rscratch, i = e.dirCounts, o = e.srcPos, s = t13.pstyle("control-point-distances"), u = s ? s.pfValue[0] : void 0, l = t13.pstyle("loop-direction").pfValue, c = t13.pstyle("loop-sweep").pfValue, d = t13.pstyle("control-point-step-size").pfValue; a.edgeType = "self"; var f = r, h10 = d; n && (f = 0, h10 = u); var v = l - Math.PI / 2, p = v - c / 2, g = v + c / 2, y = l + "_" + c; f = i[y] === void 0 ? i[y] = 0 : ++i[y], a.ctrlpts = [o.x + Math.cos(p) * 1.4 * h10 * (f / 3 + 1), o.y + Math.sin(p) * 1.4 * h10 * (f / 3 + 1), o.x + Math.cos(g) * 1.4 * h10 * (f / 3 + 1), o.y + Math.sin(g) * 1.4 * h10 * (f / 3 + 1)]; }; lr.findCompoundLoopPoints = function(t13, e, r, n) { var a = t13._private.rscratch; a.edgeType = "compound"; var i = e.srcPos, o = e.tgtPos, s = e.srcW, u = e.srcH, l = e.tgtW, c = e.tgtH, d = t13.pstyle("control-point-step-size").pfValue, f = t13.pstyle("control-point-distances"), h10 = f ? f.pfValue[0] : void 0, v = r, p = d; n && (v = 0, p = h10); var g = 50, y = { x: i.x - s / 2, y: i.y - u / 2 }, m = { x: o.x - l / 2, y: o.y - c / 2 }, b = { x: Math.min(y.x, m.x), y: Math.min(y.y, m.y) }, w = 0.5, x = Math.max(w, Math.log(s * 0.01)), E = Math.max(w, Math.log(l * 0.01)); a.ctrlpts = [b.x, b.y - (1 + Math.pow(g, 1.12) / 100) * p * (v / 3 + 1) * x, b.x - (1 + Math.pow(g, 1.12) / 100) * p * (v / 3 + 1) * E, b.y]; }; lr.findStraightEdgePoints = function(t13) { t13._private.rscratch.edgeType = "straight"; }; lr.findBezierPoints = function(t13, e, r, n, a) { var i = t13._private.rscratch, o = t13.pstyle("control-point-step-size").pfValue, s = t13.pstyle("control-point-distances"), u = t13.pstyle("control-point-weights"), l = s && u ? Math.min(s.value.length, u.value.length) : 1, c = s ? s.pfValue[0] : void 0, d = u.value[0], f = n; i.edgeType = f ? "multibezier" : "bezier", i.ctrlpts = []; for (var h10 = 0; h10 < l; h10++) { var v = (0.5 - e.eles.length / 2 + r) * o * (a ? -1 : 1), p = void 0, g = gS(v); f && (c = s ? s.pfValue[h10] : o, d = u.value[h10]), n ? p = c : p = c !== void 0 ? g * c : void 0; var y = p !== void 0 ? p : v, m = 1 - d, b = d, w = this.findMidptPtsEtc(t13, e), x = w.midptPts, E = w.vectorNormInverse, C = { x: x.x1 * m + x.x2 * b, y: x.y1 * m + x.y2 * b }; i.ctrlpts.push(C.x + E.x * y, C.y + E.y * y); } }; lr.findTaxiPoints = function(t13, e) { var r = t13._private.rscratch; r.edgeType = "segments"; var n = "vertical", a = "horizontal", i = "leftward", o = "rightward", s = "downward", u = "upward", l = "auto", c = e.posPts, d = e.srcW, f = e.srcH, h10 = e.tgtW, v = e.tgtH, p = t13.pstyle("edge-distances").value, g = p !== "node-position", y = t13.pstyle("taxi-direction").value, m = y, b = t13.pstyle("taxi-turn"), w = b.units === "%", x = b.pfValue, E = x < 0, C = t13.pstyle("taxi-turn-min-distance").pfValue, k = g ? (d + h10) / 2 : 0, S = g ? (f + v) / 2 : 0, _ = c.x2 - c.x1, T = c.y2 - c.y1, O = function(Oe, Pe) { return Oe > 0 ? Math.max(Oe - Pe, 0) : Math.min(Oe + Pe, 0); }, D = O(_, k), A = O(T, S), F = false; m === l ? y = Math.abs(D) > Math.abs(A) ? a : n : m === u || m === s ? (y = n, F = true) : (m === i || m === o) && (y = a, F = true); var R = y === n, M = R ? A : D, L = R ? T : _, V = gS(L), Y = false; !(F && (w || E)) && (m === s && L < 0 || m === u && L > 0 || m === i && L > 0 || m === o && L < 0) && (V *= -1, M = V * Math.abs(M), Y = true); var H; if (w) { var K = x < 0 ? 1 + x : x; H = K * M; } else { var ne = x < 0 ? M : 0; H = ne + x * V; } var B = function(Oe) { return Math.abs(Oe) < C || Math.abs(Oe) >= Math.abs(M); }, $ = B(H), z = B(Math.abs(M) - Math.abs(H)), W = $ || z; if (W && !Y) if (R) { var Z = Math.abs(L) <= f / 2, N = Math.abs(_) <= h10 / 2; if (Z) { var X = (c.x1 + c.x2) / 2, Q = c.y1, ge = c.y2; r.segpts = [X, Q, X, ge]; } else if (N) { var we = (c.y1 + c.y2) / 2, fe = c.x1, ce = c.x2; r.segpts = [fe, we, ce, we]; } else r.segpts = [c.x1, c.y2]; } else { var be = Math.abs(L) <= d / 2, ve = Math.abs(T) <= v / 2; if (be) { var xe = (c.y1 + c.y2) / 2, _e = c.x1, He = c.x2; r.segpts = [_e, xe, He, xe]; } else if (ve) { var Ve = (c.x1 + c.x2) / 2, De = c.y1, Ne = c.y2; r.segpts = [Ve, De, Ve, Ne]; } else r.segpts = [c.x2, c.y1]; } else if (R) { var ue = c.y1 + H + (g ? f / 2 * V : 0), I = c.x1, G = c.x2; r.segpts = [I, ue, G, ue]; } else { var se = c.x1 + H + (g ? d / 2 * V : 0), ee = c.y1, te = c.y2; r.segpts = [se, ee, se, te]; } if (r.isRound) { var ye = t13.pstyle("taxi-radius").value, oe = t13.pstyle("radius-type").value[0] === "arc-radius"; r.radii = new Array(r.segpts.length / 2).fill(ye), r.isArcRadius = new Array(r.segpts.length / 2).fill(oe); } }; lr.tryToCorrectInvalidPoints = function(t13, e) { var r = t13._private.rscratch; if (r.edgeType === "bezier") { var n = e.srcPos, a = e.tgtPos, i = e.srcW, o = e.srcH, s = e.tgtW, u = e.tgtH, l = e.srcShape, c = e.tgtShape, d = e.srcCornerRadius, f = e.tgtCornerRadius, h10 = e.srcRs, v = e.tgtRs, p = !Ce(r.startX) || !Ce(r.startY), g = !Ce(r.arrowStartX) || !Ce(r.arrowStartY), y = !Ce(r.endX) || !Ce(r.endY), m = !Ce(r.arrowEndX) || !Ce(r.arrowEndY), b = 3, w = this.getArrowWidth(t13.pstyle("width").pfValue, t13.pstyle("arrow-scale").value) * this.arrowShapeWidth, x = b * w, E = Da({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.startX, y: r.startY }), C = E < x, k = Da({ x: r.ctrlpts[0], y: r.ctrlpts[1] }, { x: r.endX, y: r.endY }), S = k < x, _ = false; if (p || g || C) { _ = true; var T = { // delta x: r.ctrlpts[0] - n.x, y: r.ctrlpts[1] - n.y }, O = Math.sqrt(T.x * T.x + T.y * T.y), D = { // normalised delta x: T.x / O, y: T.y / O }, A = Math.max(i, o), F = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + D.x * 2 * A, y: r.ctrlpts[1] + D.y * 2 * A }, R = l.intersectLine(n.x, n.y, i, o, F.x, F.y, 0, d, h10); C ? (r.ctrlpts[0] = r.ctrlpts[0] + D.x * (x - E), r.ctrlpts[1] = r.ctrlpts[1] + D.y * (x - E)) : (r.ctrlpts[0] = R[0] + D.x * x, r.ctrlpts[1] = R[1] + D.y * x); } if (y || m || S) { _ = true; var M = { // delta x: r.ctrlpts[0] - a.x, y: r.ctrlpts[1] - a.y }, L = Math.sqrt(M.x * M.x + M.y * M.y), V = { // normalised delta x: M.x / L, y: M.y / L }, Y = Math.max(i, o), H = { // *2 radius guarantees outside shape x: r.ctrlpts[0] + V.x * 2 * Y, y: r.ctrlpts[1] + V.y * 2 * Y }, K = c.intersectLine(a.x, a.y, s, u, H.x, H.y, 0, f, v); S ? (r.ctrlpts[0] = r.ctrlpts[0] + V.x * (x - k), r.ctrlpts[1] = r.ctrlpts[1] + V.y * (x - k)) : (r.ctrlpts[0] = K[0] + V.x * x, r.ctrlpts[1] = K[1] + V.y * x); } _ && this.findEndpoints(t13); } }; lr.storeAllpts = function(t13) { var e = t13._private.rscratch; if (e.edgeType === "multibezier" || e.edgeType === "bezier" || e.edgeType === "self" || e.edgeType === "compound") { e.allpts = [], e.allpts.push(e.startX, e.startY); for (var r = 0; r + 1 < e.ctrlpts.length; r += 2) e.allpts.push(e.ctrlpts[r], e.ctrlpts[r + 1]), r + 3 < e.ctrlpts.length && e.allpts.push((e.ctrlpts[r] + e.ctrlpts[r + 2]) / 2, (e.ctrlpts[r + 1] + e.ctrlpts[r + 3]) / 2); e.allpts.push(e.endX, e.endY); var n, a; e.ctrlpts.length / 2 % 2 === 0 ? (n = e.allpts.length / 2 - 1, e.midX = e.allpts[n], e.midY = e.allpts[n + 1]) : (n = e.allpts.length / 2 - 3, a = 0.5, e.midX = zt(e.allpts[n], e.allpts[n + 2], e.allpts[n + 4], a), e.midY = zt(e.allpts[n + 1], e.allpts[n + 3], e.allpts[n + 5], a)); } else if (e.edgeType === "straight") e.allpts = [e.startX, e.startY, e.endX, e.endY], e.midX = (e.startX + e.endX + e.arrowStartX + e.arrowEndX) / 4, e.midY = (e.startY + e.endY + e.arrowStartY + e.arrowEndY) / 4; else if (e.edgeType === "segments") { if (e.allpts = [], e.allpts.push(e.startX, e.startY), e.allpts.push.apply(e.allpts, e.segpts), e.allpts.push(e.endX, e.endY), e.isRound) { e.roundCorners = []; for (var i = 2; i + 3 < e.allpts.length; i += 2) { var o = e.radii[i / 2 - 1], s = e.isArcRadius[i / 2 - 1]; e.roundCorners.push(Ug({ x: e.allpts[i - 2], y: e.allpts[i - 1] }, { x: e.allpts[i], y: e.allpts[i + 1], radius: o }, { x: e.allpts[i + 2], y: e.allpts[i + 3] }, o, s)); } } if (e.segpts.length % 4 === 0) { var u = e.segpts.length / 2, l = u - 2; e.midX = (e.segpts[l] + e.segpts[u]) / 2, e.midY = (e.segpts[l + 1] + e.segpts[u + 1]) / 2; } else { var c = e.segpts.length / 2 - 1; if (!e.isRound) e.midX = e.segpts[c], e.midY = e.segpts[c + 1]; else { var d = { x: e.segpts[c], y: e.segpts[c + 1] }, f = e.roundCorners[c / 2], h10 = [d.x - f.cx, d.y - f.cy], v = f.radius / Math.sqrt(Math.pow(h10[0], 2) + Math.pow(h10[1], 2)); h10 = h10.map(function(p) { return p * v; }), e.midX = f.cx + h10[0], e.midY = f.cy + h10[1], e.midVector = h10; } } } }; lr.checkForInvalidEdgeWarning = function(t13) { var e = t13[0]._private.rscratch; e.nodesOverlap || Ce(e.startX) && Ce(e.startY) && Ce(e.endX) && Ce(e.endY) ? e.loggedErr = false : e.loggedErr || (e.loggedErr = true, tt("Edge `" + t13.id() + "` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap.")); }; lr.findEdgeControlPoints = function(t13) { var e = this; if (!(!t13 || t13.length === 0)) { for (var r = this, n = r.cy, a = n.hasCompoundNodes(), i = { map: new nn(), get: function(C) { var k = this.map.get(C[0]); return k != null ? k.get(C[1]) : null; }, set: function(C, k) { var S = this.map.get(C[0]); S == null && (S = new nn(), this.map.set(C[0], S)), S.set(C[1], k); } }, o = [], s = [], u = 0; u < t13.length; u++) { var l = t13[u], c = l._private, d = l.pstyle("curve-style").value; if (!(l.removed() || !l.takesUpSpace())) { if (d === "haystack") { s.push(l); continue; } var f = d === "unbundled-bezier" || d.endsWith("segments") || d === "straight" || d === "straight-triangle" || d.endsWith("taxi"), h10 = d === "unbundled-bezier" || d === "bezier", v = c.source, p = c.target, g = v.poolIndex(), y = p.poolIndex(), m = [g, y].sort(), b = i.get(m); b == null && (b = { eles: [] }, i.set(m, b), o.push(m)), b.eles.push(l), f && (b.hasUnbundled = true), h10 && (b.hasBezier = true); } } for (var w = function(C) { var k = o[C], S = i.get(k), _ = void 0; if (!S.hasUnbundled) { var T = S.eles[0].parallelEdges().filter(function(se) { return se.isBundledBezier(); }); Pg(S.eles), T.forEach(function(se) { return S.eles.push(se); }), S.eles.sort(function(se, ee) { return se.poolIndex() - ee.poolIndex(); }); } var O = S.eles[0], D = O.source(), A = O.target(); if (D.poolIndex() > A.poolIndex()) { var F = D; D = A, A = F; } var R = S.srcPos = D.position(), M = S.tgtPos = A.position(), L = S.srcW = D.outerWidth(), V = S.srcH = D.outerHeight(), Y = S.tgtW = A.outerWidth(), H = S.tgtH = A.outerHeight(), K = S.srcShape = r.nodeShapes[e.getNodeShape(D)], ne = S.tgtShape = r.nodeShapes[e.getNodeShape(A)], B = S.srcCornerRadius = D.pstyle("corner-radius").value === "auto" ? "auto" : D.pstyle("corner-radius").pfValue, $ = S.tgtCornerRadius = A.pstyle("corner-radius").value === "auto" ? "auto" : A.pstyle("corner-radius").pfValue, z = S.tgtRs = A._private.rscratch, W = S.srcRs = D._private.rscratch; S.dirCounts = { north: 0, west: 0, south: 0, east: 0, northwest: 0, southwest: 0, northeast: 0, southeast: 0 }; for (var Z = 0; Z < S.eles.length; Z++) { var N = S.eles[Z], X = N[0]._private.rscratch, Q = N.pstyle("curve-style").value, ge = Q === "unbundled-bezier" || Q.endsWith("segments") || Q.endsWith("taxi"), we = !D.same(N.source()); if (!S.calculatedIntersection && D !== A && (S.hasBezier || S.hasUnbundled)) { S.calculatedIntersection = true; var fe = K.intersectLine(R.x, R.y, L, V, M.x, M.y, 0, B, W), ce = S.srcIntn = fe, be = ne.intersectLine(M.x, M.y, Y, H, R.x, R.y, 0, $, z), ve = S.tgtIntn = be, xe = S.intersectionPts = { x1: fe[0], x2: be[0], y1: fe[1], y2: be[1] }, _e = S.posPts = { x1: R.x, x2: M.x, y1: R.y, y2: M.y }, He = be[1] - fe[1], Ve = be[0] - fe[0], De = Math.sqrt(Ve * Ve + He * He), Ne = S.vector = { x: Ve, y: He }, ue = S.vectorNorm = { x: Ne.x / De, y: Ne.y / De }, I = { x: -ue.y, y: ue.x }; S.nodesOverlap = !Ce(De) || ne.checkPoint(fe[0], fe[1], 0, Y, H, M.x, M.y, $, z) || K.checkPoint(be[0], be[1], 0, L, V, R.x, R.y, B, W), S.vectorNormInverse = I, _ = { nodesOverlap: S.nodesOverlap, dirCounts: S.dirCounts, calculatedIntersection: true, hasBezier: S.hasBezier, hasUnbundled: S.hasUnbundled, eles: S.eles, srcPos: M, tgtPos: R, srcW: Y, srcH: H, tgtW: L, tgtH: V, srcIntn: ve, tgtIntn: ce, srcShape: ne, tgtShape: K, posPts: { x1: _e.x2, y1: _e.y2, x2: _e.x1, y2: _e.y1 }, intersectionPts: { x1: xe.x2, y1: xe.y2, x2: xe.x1, y2: xe.y1 }, vector: { x: -Ne.x, y: -Ne.y }, vectorNorm: { x: -ue.x, y: -ue.y }, vectorNormInverse: { x: -I.x, y: -I.y } }; } var G = we ? _ : S; X.nodesOverlap = G.nodesOverlap, X.srcIntn = G.srcIntn, X.tgtIntn = G.tgtIntn, X.isRound = Q.startsWith("round"), a && (D.isParent() || D.isChild() || A.isParent() || A.isChild()) && (D.parents().anySame(A) || A.parents().anySame(D) || D.same(A) && D.isParent()) ? e.findCompoundLoopPoints(N, G, Z, ge) : D === A ? e.findLoopPoints(N, G, Z, ge) : Q.endsWith("segments") ? e.findSegmentsPoints(N, G) : Q.endsWith("taxi") ? e.findTaxiPoints(N, G) : Q === "straight" || !ge && S.eles.length % 2 === 1 && Z === Math.floor(S.eles.length / 2) ? e.findStraightEdgePoints(N) : e.findBezierPoints(N, G, Z, ge, we), e.findEndpoints(N), e.tryToCorrectInvalidPoints(N, G), e.checkForInvalidEdgeWarning(N), e.storeAllpts(N), e.storeEdgeProjections(N), e.calculateArrowAngles(N), e.recalculateEdgeLabelProjections(N), e.calculateLabelAngles(N); } }, x = 0; x < o.length; x++) w(x); this.findHaystackPoints(s); } }; function vk(t13) { var e = []; if (t13 != null) { for (var r = 0; r < t13.length; r += 2) { var n = t13[r], a = t13[r + 1]; e.push({ x: n, y: a }); } return e; } } lr.getSegmentPoints = function(t13) { var e = t13[0]._private.rscratch, r = e.edgeType; if (r === "segments") return this.recalculateRenderedStyle(t13), vk(e.segpts); }; lr.getControlPoints = function(t13) { var e = t13[0]._private.rscratch, r = e.edgeType; if (r === "bezier" || r === "multibezier" || r === "self" || r === "compound") return this.recalculateRenderedStyle(t13), vk(e.ctrlpts); }; lr.getEdgeMidpoint = function(t13) { var e = t13[0]._private.rscratch; return this.recalculateRenderedStyle(t13), { x: e.midX, y: e.midY }; }; var ss = {}; ss.manualEndptToPx = function(t13, e) { var r = this, n = t13.position(), a = t13.outerWidth(), i = t13.outerHeight(), o = t13._private.rscratch; if (e.value.length === 2) { var s = [e.pfValue[0], e.pfValue[1]]; return e.units[0] === "%" && (s[0] = s[0] * a), e.units[1] === "%" && (s[1] = s[1] * i), s[0] += n.x, s[1] += n.y, s; } else { var u = e.pfValue[0]; u = -Math.PI / 2 + u; var l = 2 * Math.max(a, i), c = [n.x + Math.cos(u) * l, n.y + Math.sin(u) * l]; return r.nodeShapes[this.getNodeShape(t13)].intersectLine(n.x, n.y, a, i, c[0], c[1], 0, t13.pstyle("corner-radius").value === "auto" ? "auto" : t13.pstyle("corner-radius").pfValue, o); } }; ss.findEndpoints = function(t13) { var e = this, r, n = t13.source()[0], a = t13.target()[0], i = n.position(), o = a.position(), s = t13.pstyle("target-arrow-shape").value, u = t13.pstyle("source-arrow-shape").value, l = t13.pstyle("target-distance-from-node").pfValue, c = t13.pstyle("source-distance-from-node").pfValue, d = n._private.rscratch, f = a._private.rscratch, h10 = t13.pstyle("curve-style").value, v = t13._private.rscratch, p = v.edgeType, g = h10 === "taxi", y = p === "self" || p === "compound", m = p === "bezier" || p === "multibezier" || y, b = p !== "bezier", w = p === "straight" || p === "segments", x = p === "segments", E = m || b || w, C = y || g, k = t13.pstyle("source-endpoint"), S = C ? "outside-to-node" : k.value, _ = n.pstyle("corner-radius").value === "auto" ? "auto" : n.pstyle("corner-radius").pfValue, T = t13.pstyle("target-endpoint"), O = C ? "outside-to-node" : T.value, D = a.pstyle("corner-radius").value === "auto" ? "auto" : a.pstyle("corner-radius").pfValue; v.srcManEndpt = k, v.tgtManEndpt = T; var A, F, R, M; if (m) { var L = [v.ctrlpts[0], v.ctrlpts[1]], V = b ? [v.ctrlpts[v.ctrlpts.length - 2], v.ctrlpts[v.ctrlpts.length - 1]] : L; A = V, F = L; } else if (w) { var Y = x ? v.segpts.slice(0, 2) : [o.x, o.y], H = x ? v.segpts.slice(v.segpts.length - 2) : [i.x, i.y]; A = H, F = Y; } if (O === "inside-to-node") r = [o.x, o.y]; else if (T.units) r = this.manualEndptToPx(a, T); else if (O === "outside-to-line") r = v.tgtIntn; else if (O === "outside-to-node" || O === "outside-to-node-or-label" ? R = A : (O === "outside-to-line" || O === "outside-to-line-or-label") && (R = [i.x, i.y]), r = e.nodeShapes[this.getNodeShape(a)].intersectLine(o.x, o.y, a.outerWidth(), a.outerHeight(), R[0], R[1], 0, D, f), O === "outside-to-node-or-label" || O === "outside-to-line-or-label") { var K = a._private.rscratch, ne = K.labelWidth, B = K.labelHeight, $ = K.labelX, z = K.labelY, W = ne / 2, Z = B / 2, N = a.pstyle("text-valign").value; N === "top" ? z -= Z : N === "bottom" && (z += Z); var X = a.pstyle("text-halign").value; X === "left" ? $ -= W : X === "right" && ($ += W); var Q = Mo(R[0], R[1], [$ - W, z - Z, $ + W, z - Z, $ + W, z + Z, $ - W, z + Z], o.x, o.y); if (Q.length > 0) { var ge = i, we = pa(ge, ui(r)), fe = pa(ge, ui(Q)), ce = we; if (fe < we && (r = Q, ce = fe), Q.length > 2) { var be = pa(ge, { x: Q[2], y: Q[3] }); be < ce && (r = [Q[2], Q[3]]); } } } var ve = Ts(r, A, e.arrowShapes[s].spacing(t13) + l), xe = Ts(r, A, e.arrowShapes[s].gap(t13) + l); if (v.endX = xe[0], v.endY = xe[1], v.arrowEndX = ve[0], v.arrowEndY = ve[1], S === "inside-to-node") r = [i.x, i.y]; else if (k.units) r = this.manualEndptToPx(n, k); else if (S === "outside-to-line") r = v.srcIntn; else if (S === "outside-to-node" || S === "outside-to-node-or-label" ? M = F : (S === "outside-to-line" || S === "outside-to-line-or-label") && (M = [o.x, o.y]), r = e.nodeShapes[this.getNodeShape(n)].intersectLine(i.x, i.y, n.outerWidth(), n.outerHeight(), M[0], M[1], 0, _, d), S === "outside-to-node-or-label" || S === "outside-to-line-or-label") { var _e = n._private.rscratch, He = _e.labelWidth, Ve = _e.labelHeight, De = _e.labelX, Ne = _e.labelY, ue = He / 2, I = Ve / 2, G = n.pstyle("text-valign").value; G === "top" ? Ne -= I : G === "bottom" && (Ne += I); var se = n.pstyle("text-halign").value; se === "left" ? De -= ue : se === "right" && (De += ue); var ee = Mo(M[0], M[1], [De - ue, Ne - I, De + ue, Ne - I, De + ue, Ne + I, De - ue, Ne + I], i.x, i.y); if (ee.length > 0) { var te = o, ye = pa(te, ui(r)), oe = pa(te, ui(ee)), he = ye; if (oe < ye && (r = [ee[0], ee[1]], he = oe), ee.length > 2) { var Oe = pa(te, { x: ee[2], y: ee[3] }); Oe < he && (r = [ee[2], ee[3]]); } } } var Pe = Ts(r, F, e.arrowShapes[u].spacing(t13) + c), Ae = Ts(r, F, e.arrowShapes[u].gap(t13) + c); v.startX = Ae[0], v.startY = Ae[1], v.arrowStartX = Pe[0], v.arrowStartY = Pe[1], E && (!Ce(v.startX) || !Ce(v.startY) || !Ce(v.endX) || !Ce(v.endY) ? v.badLine = true : v.badLine = false); }; ss.getSourceEndpoint = function(t13) { var e = t13[0]._private.rscratch; switch (this.recalculateRenderedStyle(t13), e.edgeType) { case "haystack": return { x: e.haystackPts[0], y: e.haystackPts[1] }; default: return { x: e.arrowStartX, y: e.arrowStartY }; } }; ss.getTargetEndpoint = function(t13) { var e = t13[0]._private.rscratch; switch (this.recalculateRenderedStyle(t13), e.edgeType) { case "haystack": return { x: e.haystackPts[2], y: e.haystackPts[3] }; default: return { x: e.arrowEndX, y: e.arrowEndY }; } }; var Wg = {}; function N8(t13, e, r) { for (var n = function(l, c, d, f) { return zt(l, c, d, f); }, a = e._private, i = a.rstyle.bezierPts, o = 0; o < t13.bezierProjPcts.length; o++) { var s = t13.bezierProjPcts[o]; i.push({ x: n(r[0], r[2], r[4], s), y: n(r[1], r[3], r[5], s) }); } } Wg.storeEdgeProjections = function(t13) { var e = t13._private, r = e.rscratch, n = r.edgeType; if (e.rstyle.bezierPts = null, e.rstyle.linePts = null, e.rstyle.haystackPts = null, n === "multibezier" || n === "bezier" || n === "self" || n === "compound") { e.rstyle.bezierPts = []; for (var a = 0; a + 5 < r.allpts.length; a += 4) N8(this, t13, r.allpts.slice(a, a + 6)); } else if (n === "segments") for (var i = e.rstyle.linePts = [], a = 0; a + 1 < r.allpts.length; a += 2) i.push({ x: r.allpts[a], y: r.allpts[a + 1] }); else if (n === "haystack") { var o = r.haystackPts; e.rstyle.haystackPts = [{ x: o[0], y: o[1] }, { x: o[2], y: o[3] }]; } e.rstyle.arrowWidth = this.getArrowWidth(t13.pstyle("width").pfValue, t13.pstyle("arrow-scale").value) * this.arrowShapeWidth; }; Wg.recalculateEdgeProjections = function(t13) { this.findEdgeControlPoints(t13); }; var fn = {}; fn.recalculateNodeLabelProjection = function(t13) { var e = t13.pstyle("label").strValue; if (!ea(e)) { var r, n, a = t13._private, i = t13.width(), o = t13.height(), s = t13.padding(), u = t13.position(), l = t13.pstyle("text-halign").strValue, c = t13.pstyle("text-valign").strValue, d = a.rscratch, f = a.rstyle; switch (l) { case "left": r = u.x - i / 2 - s; break; case "right": r = u.x + i / 2 + s; break; default: r = u.x; } switch (c) { case "top": n = u.y - o / 2 - s; break; case "bottom": n = u.y + o / 2 + s; break; default: n = u.y; } d.labelX = r, d.labelY = n, f.labelX = r, f.labelY = n, this.calculateLabelAngles(t13), this.applyLabelDimensions(t13); } }; var hk = function(e, r) { var n = Math.atan(r / e); return e === 0 && n < 0 && (n = n * -1), n; }; var pk = function(e, r) { var n = r.x - e.x, a = r.y - e.y; return hk(n, a); }; var B8 = function(e, r, n, a) { var i = Fo(0, a - 1e-3, 1), o = Fo(0, a + 1e-3, 1), s = vi(e, r, n, i), u = vi(e, r, n, o); return pk(s, u); }; fn.recalculateEdgeLabelProjections = function(t13) { var e, r = t13._private, n = r.rscratch, a = this, i = { mid: t13.pstyle("label").strValue, source: t13.pstyle("source-label").strValue, target: t13.pstyle("target-label").strValue }; if (i.mid || i.source || i.target) { e = { x: n.midX, y: n.midY }; var o = function(d, f, h10) { Gn(r.rscratch, d, f, h10), Gn(r.rstyle, d, f, h10); }; o("labelX", null, e.x), o("labelY", null, e.y); var s = hk(n.midDispX, n.midDispY); o("labelAutoAngle", null, s); var u = function c() { if (c.cache) return c.cache; for (var d = [], f = 0; f + 5 < n.allpts.length; f += 4) { var h10 = { x: n.allpts[f], y: n.allpts[f + 1] }, v = { x: n.allpts[f + 2], y: n.allpts[f + 3] }, p = { x: n.allpts[f + 4], y: n.allpts[f + 5] }; d.push({ p0: h10, p1: v, p2: p, startDist: 0, length: 0, segments: [] }); } var g = r.rstyle.bezierPts, y = a.bezierProjPcts.length; function m(C, k, S, _, T) { var O = Da(k, S), D = C.segments[C.segments.length - 1], A = { p0: k, p1: S, t0: _, t1: T, startDist: D ? D.startDist + D.length : 0, length: O }; C.segments.push(A), C.length += O; } for (var b = 0; b < d.length; b++) { var w = d[b], x = d[b - 1]; x && (w.startDist = x.startDist + x.length), m(w, w.p0, g[b * y], 0, a.bezierProjPcts[0]); for (var E = 0; E < y - 1; E++) m(w, g[b * y + E], g[b * y + E + 1], a.bezierProjPcts[E], a.bezierProjPcts[E + 1]); m(w, g[b * y + y - 1], w.p2, a.bezierProjPcts[y - 1], 1); } return c.cache = d; }, l = function(d) { var f, h10 = d === "source"; if (i[d]) { var v = t13.pstyle(d + "-text-offset").pfValue; switch (n.edgeType) { case "self": case "compound": case "bezier": case "multibezier": { for (var p = u(), g, y = 0, m = 0, b = 0; b < p.length; b++) { for (var w = p[h10 ? b : p.length - 1 - b], x = 0; x < w.segments.length; x++) { var E = w.segments[h10 ? x : w.segments.length - 1 - x], C = b === p.length - 1 && x === w.segments.length - 1; if (y = m, m += E.length, m >= v || C) { g = { cp: w, segment: E }; break; } } if (g) break; } var k = g.cp, S = g.segment, _ = (v - y) / S.length, T = S.t1 - S.t0, O = h10 ? S.t0 + T * _ : S.t1 - T * _; O = Fo(0, O, 1), e = vi(k.p0, k.p1, k.p2, O), f = B8(k.p0, k.p1, k.p2, O); break; } case "straight": case "segments": case "haystack": { for (var D = 0, A, F, R, M, L = n.allpts.length, V = 0; V + 3 < L && (h10 ? (R = { x: n.allpts[V], y: n.allpts[V + 1] }, M = { x: n.allpts[V + 2], y: n.allpts[V + 3] }) : (R = { x: n.allpts[L - 2 - V], y: n.allpts[L - 1 - V] }, M = { x: n.allpts[L - 4 - V], y: n.allpts[L - 3 - V] }), A = Da(R, M), F = D, D += A, !(D >= v)); V += 2) ; var Y = v - F, H = Y / A; H = Fo(0, H, 1), e = H$(R, M, H), f = pk(R, M); break; } } o("labelX", d, e.x), o("labelY", d, e.y), o("labelAutoAngle", d, f); } }; l("source"), l("target"), this.applyLabelDimensions(t13); } }; fn.applyLabelDimensions = function(t13) { this.applyPrefixedLabelDimensions(t13), t13.isEdge() && (this.applyPrefixedLabelDimensions(t13, "source"), this.applyPrefixedLabelDimensions(t13, "target")); }; fn.applyPrefixedLabelDimensions = function(t13, e) { var r = t13._private, n = this.getLabelText(t13, e), a = this.calculateLabelDimensions(t13, n), i = t13.pstyle("line-height").pfValue, o = t13.pstyle("text-wrap").strValue, s = Kr(r.rscratch, "labelWrapCachedLines", e) || [], u = o !== "wrap" ? 1 : Math.max(s.length, 1), l = a.height / u, c = l * i, d = a.width, f = a.height + (u - 1) * (i - 1) * l; Gn(r.rstyle, "labelWidth", e, d), Gn(r.rscratch, "labelWidth", e, d), Gn(r.rstyle, "labelHeight", e, f), Gn(r.rscratch, "labelHeight", e, f), Gn(r.rscratch, "labelLineHeight", e, c); }; fn.getLabelText = function(t13, e) { var r = t13._private, n = e ? e + "-" : "", a = t13.pstyle(n + "label").strValue, i = t13.pstyle("text-transform").value, o = function(ne, B) { return B ? (Gn(r.rscratch, ne, e, B), B) : Kr(r.rscratch, ne, e); }; if (!a) return ""; i == "none" || (i == "uppercase" ? a = a.toUpperCase() : i == "lowercase" && (a = a.toLowerCase())); var s = t13.pstyle("text-wrap").value; if (s === "wrap") { var u = o("labelKey"); if (u != null && o("labelWrapKey") === u) return o("labelWrapCachedText"); for (var l = "​", c = a.split(` `), d = t13.pstyle("text-max-width").pfValue, f = t13.pstyle("text-overflow-wrap").value, h10 = f === "anywhere", v = [], p = /[\s\u200b]+|$/g, g = 0; g < c.length; g++) { var y = c[g], m = this.calculateLabelDimensions(t13, y), b = m.width; if (h10) { var w = y.split("").join(l); y = w; } if (b > d) { var x = y.matchAll(p), E = "", C = 0, k = X2(x), S; try { for (k.s(); !(S = k.n()).done; ) { var _ = S.value, T = _[0], O = y.substring(C, _.index); C = _.index + T.length; var D = E.length === 0 ? O : E + O + T, A = this.calculateLabelDimensions(t13, D), F = A.width; F <= d ? E += O + T : (E && v.push(E), E = O + T); } } catch (K) { k.e(K); } finally { k.f(); } E.match(/^[\s\u200b]+$/) || v.push(E); } else v.push(y); } o("labelWrapCachedLines", v), a = o("labelWrapCachedText", v.join(` `)), o("labelWrapKey", u); } else if (s === "ellipsis") { var R = t13.pstyle("text-max-width").pfValue, M = "", L = "…", V = false; if (this.calculateLabelDimensions(t13, a).width < R) return a; for (var Y = 0; Y < a.length; Y++) { var H = this.calculateLabelDimensions(t13, M + a[Y] + L).width; if (H > R) break; M += a[Y], Y === a.length - 1 && (V = true); } return V || (M += L), M; } return a; }; fn.getLabelJustification = function(t13) { var e = t13.pstyle("text-justification").strValue, r = t13.pstyle("text-halign").strValue; if (e === "auto") if (t13.isNode()) switch (r) { case "left": return "right"; case "right": return "left"; default: return "center"; } else return "center"; else return e; }; fn.calculateLabelDimensions = function(t13, e) { var r = this, n = r.cy.window(), a = n.document, i = Pa(e, t13._private.labelDimsKey), o = r.labelDimCache || (r.labelDimCache = []), s = o[i]; if (s != null) return s; var u = 0, l = t13.pstyle("font-style").strValue, c = t13.pstyle("font-size").pfValue, d = t13.pstyle("font-family").strValue, f = t13.pstyle("font-weight").strValue, h10 = this.labelCalcCanvas, v = this.labelCalcCanvasContext; if (!h10) { h10 = this.labelCalcCanvas = a.createElement("canvas"), v = this.labelCalcCanvasContext = h10.getContext("2d"); var p = h10.style; p.position = "absolute", p.left = "-9999px", p.top = "-9999px", p.zIndex = "-1", p.visibility = "hidden", p.pointerEvents = "none"; } v.font = "".concat(l, " ").concat(f, " ").concat(c, "px ").concat(d); for (var g = 0, y = 0, m = e.split(` `), b = 0; b < m.length; b++) { var w = m[b], x = v.measureText(w), E = Math.ceil(x.width), C = c; g = Math.max(E, g), y += C; } return g += u, y += u, o[i] = { width: g, height: y }; }; fn.calculateLabelAngle = function(t13, e) { var r = t13._private, n = r.rscratch, a = t13.isEdge(), i = e ? e + "-" : "", o = t13.pstyle(i + "text-rotation"), s = o.strValue; return s === "none" ? 0 : a && s === "autorotate" ? n.labelAutoAngle : s === "autorotate" ? 0 : o.pfValue; }; fn.calculateLabelAngles = function(t13) { var e = this, r = t13.isEdge(), n = t13._private, a = n.rscratch; a.labelAngle = e.calculateLabelAngle(t13), r && (a.sourceLabelAngle = e.calculateLabelAngle(t13, "source"), a.targetLabelAngle = e.calculateLabelAngle(t13, "target")); }; var gk = {}; var V0 = 28; var H0 = false; gk.getNodeShape = function(t13) { var e = this, r = t13.pstyle("shape").value; if (r === "cutrectangle" && (t13.width() < V0 || t13.height() < V0)) return H0 || (tt("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"), H0 = true), "rectangle"; if (t13.isParent()) return r === "rectangle" || r === "roundrectangle" || r === "round-rectangle" || r === "cutrectangle" || r === "cut-rectangle" || r === "barrel" ? r : "rectangle"; if (r === "polygon") { var n = t13.pstyle("shape-polygon-points").value; return e.nodeShapes.makePolygon(n).name; } return r; }; var Yl = {}; Yl.registerCalculationListeners = function() { var t13 = this.cy, e = t13.collection(), r = this, n = function(o) { var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; if (e.merge(o), s) for (var u = 0; u < o.length; u++) { var l = o[u], c = l._private, d = c.rstyle; d.clean = false, d.cleanConnected = false; } }; r.binder(t13).on("bounds.* dirty.*", function(o) { var s = o.target; n(s); }).on("style.* background.*", function(o) { var s = o.target; n(s, false); }); var a = function(o) { if (o) { var s = r.onUpdateEleCalcsFns; e.cleanStyle(); for (var u = 0; u < e.length; u++) { var l = e[u], c = l._private.rstyle; l.isNode() && !c.cleanConnected && (n(l.connectedEdges()), c.cleanConnected = true); } if (s) for (var d = 0; d < s.length; d++) { var f = s[d]; f(o, e); } r.recalculateRenderedStyle(e), e = t13.collection(); } }; r.flushRenderedStyleQueue = function() { a(true); }, r.beforeRender(a, r.beforeRenderPriorities.eleCalcs); }; Yl.onUpdateEleCalcs = function(t13) { var e = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || []; e.push(t13); }; Yl.recalculateRenderedStyle = function(t13, e) { var r = function(w) { return w._private.rstyle.cleanConnected; }, n = [], a = []; if (!this.destroyed) { e === void 0 && (e = true); for (var i = 0; i < t13.length; i++) { var o = t13[i], s = o._private, u = s.rstyle; o.isEdge() && (!r(o.source()) || !r(o.target())) && (u.clean = false), !(e && u.clean || o.removed()) && o.pstyle("display").value !== "none" && (s.group === "nodes" ? a.push(o) : n.push(o), u.clean = true); } for (var l = 0; l < a.length; l++) { var c = a[l], d = c._private, f = d.rstyle, h10 = c.position(); this.recalculateNodeLabelProjection(c), f.nodeX = h10.x, f.nodeY = h10.y, f.nodeW = c.pstyle("width").pfValue, f.nodeH = c.pstyle("height").pfValue; } this.recalculateEdgeProjections(n); for (var v = 0; v < n.length; v++) { var p = n[v], g = p._private, y = g.rstyle, m = g.rscratch; y.srcX = m.arrowStartX, y.srcY = m.arrowStartY, y.tgtX = m.arrowEndX, y.tgtY = m.arrowEndY, y.midX = m.midX, y.midY = m.midY, y.labelAngle = m.labelAngle, y.sourceLabelAngle = m.sourceLabelAngle, y.targetLabelAngle = m.targetLabelAngle; } } }; var Zl = {}; Zl.updateCachedGrabbedEles = function() { var t13 = this.cachedZSortedEles; if (t13) { t13.drag = [], t13.nondrag = []; for (var e = [], r = 0; r < t13.length; r++) { var n = t13[r], a = n._private.rscratch; n.grabbed() && !n.isParent() ? e.push(n) : a.inDragLayer ? t13.drag.push(n) : t13.nondrag.push(n); } for (var r = 0; r < e.length; r++) { var n = e[r]; t13.drag.push(n); } } }; Zl.invalidateCachedZSortedEles = function() { this.cachedZSortedEles = null; }; Zl.getCachedZSortedEles = function(t13) { if (t13 || !this.cachedZSortedEles) { var e = this.cy.mutableElements().toArray(); e.sort(QS), e.interactive = e.filter(function(r) { return r.interactive(); }), this.cachedZSortedEles = e, this.updateCachedGrabbedEles(); } else e = this.cachedZSortedEles; return e; }; var yk = {}; [Ka, gl, lr, ss, Wg, fn, gk, Yl, Zl].forEach(function(t13) { ze(yk, t13); }); var mk = {}; mk.getCachedImage = function(t13, e, r) { var n = this, a = n.imageCache = n.imageCache || {}, i = a[t13]; if (i) return i.image.complete || i.image.addEventListener("load", r), i.image; i = a[t13] = a[t13] || {}; var o = i.image = new Image(); o.addEventListener("load", r), o.addEventListener("error", function() { o.error = true; }); var s = "data:", u = t13.substring(0, s.length).toLowerCase() === s; return u || (e = e === "null" ? null : e, o.crossOrigin = e), o.src = t13, o; }; var Vi = {}; Vi.registerBinding = function(t13, e, r, n) { var a = Array.prototype.slice.apply(arguments, [1]), i = this.binder(t13); return i.on.apply(i, a); }; Vi.binder = function(t13) { var e = this, r = e.cy.window(), n = t13 === r || t13 === r.document || t13 === r.document.body || uB(t13); if (e.supportsPassiveEvents == null) { var a = false; try { var i = Object.defineProperty({}, "passive", { get: function() { return a = true, true; } }); r.addEventListener("test", null, i); } catch { } e.supportsPassiveEvents = a; } var o = function(u, l, c) { var d = Array.prototype.slice.call(arguments); return n && e.supportsPassiveEvents && (d[2] = { capture: c ?? false, passive: false, once: false }), e.bindings.push({ target: t13, args: d }), (t13.addEventListener || t13.on).apply(t13, d), this; }; return { on: o, addEventListener: o, addListener: o, bind: o }; }; Vi.nodeIsDraggable = function(t13) { return t13 && t13.isNode() && !t13.locked() && t13.grabbable(); }; Vi.nodeIsGrabbable = function(t13) { return this.nodeIsDraggable(t13) && t13.interactive(); }; Vi.load = function() { var t13 = this, e = t13.cy.window(), r = function(I) { return I.selected(); }, n = function(I, G, se, ee) { I == null && (I = t13.cy); for (var te = 0; te < G.length; te++) { var ye = G[te]; I.emit({ originalEvent: se, type: ye, position: ee }); } }, a = function(I) { return I.shiftKey || I.metaKey || I.ctrlKey; }, i = function(I, G) { var se = true; if (t13.cy.hasCompoundNodes() && I && I.pannable()) for (var ee = 0; G && ee < G.length; ee++) { var I = G[ee]; if (I.isNode() && I.isParent() && !I.pannable()) { se = false; break; } } else se = true; return se; }, o = function(I) { I[0]._private.grabbed = true; }, s = function(I) { I[0]._private.grabbed = false; }, u = function(I) { I[0]._private.rscratch.inDragLayer = true; }, l = function(I) { I[0]._private.rscratch.inDragLayer = false; }, c = function(I) { I[0]._private.rscratch.isGrabTarget = true; }, d = function(I) { I[0]._private.rscratch.isGrabTarget = false; }, f = function(I, G) { var se = G.addToList, ee = se.has(I); !ee && I.grabbable() && !I.locked() && (se.merge(I), o(I)); }, h10 = function(I, G) { if (I.cy().hasCompoundNodes() && !(G.inDragLayer == null && G.addToList == null)) { var se = I.descendants(); G.inDragLayer && (se.forEach(u), se.connectedEdges().forEach(u)), G.addToList && f(se, G); } }, v = function(I, G) { G = G || {}; var se = I.cy().hasCompoundNodes(); G.inDragLayer && (I.forEach(u), I.neighborhood().stdFilter(function(ee) { return !se || ee.isEdge(); }).forEach(u)), G.addToList && I.forEach(function(ee) { f(ee, G); }), h10(I, G), y(I, { inDragLayer: G.inDragLayer }), t13.updateCachedGrabbedEles(); }, p = v, g = function(I) { I && (t13.getCachedZSortedEles().forEach(function(G) { s(G), l(G), d(G); }), t13.updateCachedGrabbedEles()); }, y = function(I, G) { if (!(G.inDragLayer == null && G.addToList == null) && I.cy().hasCompoundNodes()) { var se = I.ancestors().orphans(); if (!se.same(I)) { var ee = se.descendants().spawnSelf().merge(se).unmerge(I).unmerge(I.descendants()), te = ee.connectedEdges(); G.inDragLayer && (te.forEach(u), ee.forEach(u)), G.addToList && ee.forEach(function(ye) { f(ye, G); }); } } }, m = function() { document.activeElement != null && document.activeElement.blur != null && document.activeElement.blur(); }, b = typeof MutationObserver < "u", w = typeof ResizeObserver < "u"; b ? (t13.removeObserver = new MutationObserver(function(ue) { for (var I = 0; I < ue.length; I++) { var G = ue[I], se = G.removedNodes; if (se) for (var ee = 0; ee < se.length; ee++) { var te = se[ee]; if (te === t13.container) { t13.destroy(); break; } } } }), t13.container.parentNode && t13.removeObserver.observe(t13.container.parentNode, { childList: true })) : t13.registerBinding(t13.container, "DOMNodeRemoved", function(ue) { t13.destroy(); }); var x = Fl(function() { t13.cy.resize(); }, 100); b && (t13.styleObserver = new MutationObserver(x), t13.styleObserver.observe(t13.container, { attributes: true })), t13.registerBinding(e, "resize", x), w && (t13.resizeObserver = new ResizeObserver(x), t13.resizeObserver.observe(t13.container)); var E = function(I, G) { for (; I != null; ) G(I), I = I.parentNode; }, C = function() { t13.invalidateContainerClientCoordsCache(); }; E(t13.container, function(ue) { t13.registerBinding(ue, "transitionend", C), t13.registerBinding(ue, "animationend", C), t13.registerBinding(ue, "scroll", C); }), t13.registerBinding(t13.container, "contextmenu", function(ue) { ue.preventDefault(); }); var k = function() { return t13.selection[4] !== 0; }, S = function(I) { for (var G = t13.findContainerClientCoords(), se = G[0], ee = G[1], te = G[2], ye = G[3], oe = I.touches ? I.touches : [I], he = false, Oe = 0; Oe < oe.length; Oe++) { var Pe = oe[Oe]; if (se <= Pe.clientX && Pe.clientX <= se + te && ee <= Pe.clientY && Pe.clientY <= ee + ye) { he = true; break; } } if (!he) return false; for (var Ae = t13.container, $e = I.target, Ie = $e.parentNode, Le = false; Ie; ) { if (Ie === Ae) { Le = true; break; } Ie = Ie.parentNode; } return !!Le; }; t13.registerBinding(t13.container, "mousedown", function(I) { if (S(I) && !(t13.hoverData.which === 1 && I.which !== 1)) { I.preventDefault(), m(), t13.hoverData.capture = true, t13.hoverData.which = I.which; var G = t13.cy, se = [I.clientX, I.clientY], ee = t13.projectIntoViewport(se[0], se[1]), te = t13.selection, ye = t13.findNearestElements(ee[0], ee[1], true, false), oe = ye[0], he = t13.dragData.possibleDragElements; t13.hoverData.mdownPos = ee, t13.hoverData.mdownGPos = se; var Oe = function() { t13.hoverData.tapholdCancelled = false, clearTimeout(t13.hoverData.tapholdTimeout), t13.hoverData.tapholdTimeout = setTimeout(function() { if (!t13.hoverData.tapholdCancelled) { var ut = t13.hoverData.down; ut ? ut.emit({ originalEvent: I, type: "taphold", position: { x: ee[0], y: ee[1] } }) : G.emit({ originalEvent: I, type: "taphold", position: { x: ee[0], y: ee[1] } }); } }, t13.tapholdDuration); }; if (I.which == 3) { t13.hoverData.cxtStarted = true; var Pe = { originalEvent: I, type: "cxttapstart", position: { x: ee[0], y: ee[1] } }; oe ? (oe.activate(), oe.emit(Pe), t13.hoverData.down = oe) : G.emit(Pe), t13.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(), t13.hoverData.cxtDragged = false; } else if (I.which == 1) { oe && oe.activate(); { if (oe != null && t13.nodeIsGrabbable(oe)) { var Ae = function(ut) { return { originalEvent: I, type: ut, position: { x: ee[0], y: ee[1] } }; }, $e = function(ut) { ut.emit(Ae("grab")); }; if (c(oe), !oe.selected()) he = t13.dragData.possibleDragElements = G.collection(), p(oe, { addToList: he }), oe.emit(Ae("grabon")).emit(Ae("grab")); else { he = t13.dragData.possibleDragElements = G.collection(); var Ie = G.$(function(Le) { return Le.isNode() && Le.selected() && t13.nodeIsGrabbable(Le); }); v(Ie, { addToList: he }), oe.emit(Ae("grabon")), Ie.forEach($e); } t13.redrawHint("eles", true), t13.redrawHint("drag", true); } t13.hoverData.down = oe, t13.hoverData.downs = ye, t13.hoverData.downTime = (/* @__PURE__ */ new Date()).getTime(); } n(oe, ["mousedown", "tapstart", "vmousedown"], I, { x: ee[0], y: ee[1] }), oe == null ? (te[4] = 1, t13.data.bgActivePosistion = { x: ee[0], y: ee[1] }, t13.redrawHint("select", true), t13.redraw()) : oe.pannable() && (te[4] = 1), Oe(); } te[0] = te[2] = ee[0], te[1] = te[3] = ee[1]; } }, false), t13.registerBinding(e, "mousemove", function(I) { var G = t13.hoverData.capture; if (!(!G && !S(I))) { var se = false, ee = t13.cy, te = ee.zoom(), ye = [I.clientX, I.clientY], oe = t13.projectIntoViewport(ye[0], ye[1]), he = t13.hoverData.mdownPos, Oe = t13.hoverData.mdownGPos, Pe = t13.selection, Ae = null; !t13.hoverData.draggingEles && !t13.hoverData.dragging && !t13.hoverData.selecting && (Ae = t13.findNearestElement(oe[0], oe[1], true, false)); var $e = t13.hoverData.last, Ie = t13.hoverData.down, Le = [oe[0] - Pe[2], oe[1] - Pe[3]], ut = t13.dragData.possibleDragElements, nt; if (Oe) { var kt = ye[0] - Oe[0], _t = kt * kt, Ct = ye[1] - Oe[1], Jt = Ct * Ct, Pt = _t + Jt; t13.hoverData.isOverThresholdDrag = nt = Pt >= t13.desktopTapThreshold2; } var $t = a(I); nt && (t13.hoverData.tapholdCancelled = true); var wr = function() { var re = t13.hoverData.dragDelta = t13.hoverData.dragDelta || []; re.length === 0 ? (re.push(Le[0]), re.push(Le[1])) : (re[0] += Le[0], re[1] += Le[1]); }; se = true, n(Ae, ["mousemove", "vmousemove", "tapdrag"], I, { x: oe[0], y: oe[1] }); var Qt = function() { t13.data.bgActivePosistion = void 0, t13.hoverData.selecting || ee.emit({ originalEvent: I, type: "boxstart", position: { x: oe[0], y: oe[1] } }), Pe[4] = 1, t13.hoverData.selecting = true, t13.redrawHint("select", true), t13.redraw(); }; if (t13.hoverData.which === 3) { if (nt) { var er = { originalEvent: I, type: "cxtdrag", position: { x: oe[0], y: oe[1] } }; Ie ? Ie.emit(er) : ee.emit(er), t13.hoverData.cxtDragged = true, (!t13.hoverData.cxtOver || Ae !== t13.hoverData.cxtOver) && (t13.hoverData.cxtOver && t13.hoverData.cxtOver.emit({ originalEvent: I, type: "cxtdragout", position: { x: oe[0], y: oe[1] } }), t13.hoverData.cxtOver = Ae, Ae && Ae.emit({ originalEvent: I, type: "cxtdragover", position: { x: oe[0], y: oe[1] } })); } } else if (t13.hoverData.dragging) { if (se = true, ee.panningEnabled() && ee.userPanningEnabled()) { var kr; if (t13.hoverData.justStartedPan) { var Nr = t13.hoverData.mdownPos; kr = { x: (oe[0] - Nr[0]) * te, y: (oe[1] - Nr[1]) * te }, t13.hoverData.justStartedPan = false; } else kr = { x: Le[0] * te, y: Le[1] * te }; ee.panBy(kr), ee.emit("dragpan"), t13.hoverData.dragged = true; } oe = t13.projectIntoViewport(I.clientX, I.clientY); } else if (Pe[4] == 1 && (Ie == null || Ie.pannable())) { if (nt) { if (!t13.hoverData.dragging && ee.boxSelectionEnabled() && ($t || !ee.panningEnabled() || !ee.userPanningEnabled())) Qt(); else if (!t13.hoverData.selecting && ee.panningEnabled() && ee.userPanningEnabled()) { var dr = i(Ie, t13.hoverData.downs); dr && (t13.hoverData.dragging = true, t13.hoverData.justStartedPan = true, Pe[4] = 0, t13.data.bgActivePosistion = ui(he), t13.redrawHint("select", true), t13.redraw()); } Ie && Ie.pannable() && Ie.active() && Ie.unactivate(); } } else { if (Ie && Ie.pannable() && Ie.active() && Ie.unactivate(), (!Ie || !Ie.grabbed()) && Ae != $e && ($e && n($e, ["mouseout", "tapdragout"], I, { x: oe[0], y: oe[1] }), Ae && n(Ae, ["mouseover", "tapdragover"], I, { x: oe[0], y: oe[1] }), t13.hoverData.last = Ae), Ie) if (nt) { if (ee.boxSelectionEnabled() && $t) Ie && Ie.grabbed() && (g(ut), Ie.emit("freeon"), ut.emit("free"), t13.dragData.didDrag && (Ie.emit("dragfreeon"), ut.emit("dragfree"))), Qt(); else if (Ie && Ie.grabbed() && t13.nodeIsDraggable(Ie)) { var xt = !t13.dragData.didDrag; xt && t13.redrawHint("eles", true), t13.dragData.didDrag = true, t13.hoverData.draggingEles || v(ut, { inDragLayer: true }); var Tt = { x: 0, y: 0 }; if (Ce(Le[0]) && Ce(Le[1]) && (Tt.x += Le[0], Tt.y += Le[1], xt)) { var qt = t13.hoverData.dragDelta; qt && Ce(qt[0]) && Ce(qt[1]) && (Tt.x += qt[0], Tt.y += qt[1]); } t13.hoverData.draggingEles = true, ut.silentShift(Tt).emit("position drag"), t13.redrawHint("drag", true), t13.redraw(); } } else wr(); se = true; } if (Pe[2] = oe[0], Pe[3] = oe[1], se) return I.stopPropagation && I.stopPropagation(), I.preventDefault && I.preventDefault(), false; } }, false); var _, T, O; t13.registerBinding(e, "mouseup", function(I) { if (!(t13.hoverData.which === 1 && I.which !== 1 && t13.hoverData.capture)) { var G = t13.hoverData.capture; if (G) { t13.hoverData.capture = false; var se = t13.cy, ee = t13.projectIntoViewport(I.clientX, I.clientY), te = t13.selection, ye = t13.findNearestElement(ee[0], ee[1], true, false), oe = t13.dragData.possibleDragElements, he = t13.hoverData.down, Oe = a(I); if (t13.data.bgActivePosistion && (t13.redrawHint("select", true), t13.redraw()), t13.hoverData.tapholdCancelled = true, t13.data.bgActivePosistion = void 0, he && he.unactivate(), t13.hoverData.which === 3) { var Pe = { originalEvent: I, type: "cxttapend", position: { x: ee[0], y: ee[1] } }; if (he ? he.emit(Pe) : se.emit(Pe), !t13.hoverData.cxtDragged) { var Ae = { originalEvent: I, type: "cxttap", position: { x: ee[0], y: ee[1] } }; he ? he.emit(Ae) : se.emit(Ae); } t13.hoverData.cxtDragged = false, t13.hoverData.which = null; } else if (t13.hoverData.which === 1) { if (n(ye, ["mouseup", "tapend", "vmouseup"], I, { x: ee[0], y: ee[1] }), !t13.dragData.didDrag && // didn't move a node around !t13.hoverData.dragged && // didn't pan !t13.hoverData.selecting && // not box selection !t13.hoverData.isOverThresholdDrag && (n(he, ["click", "tap", "vclick"], I, { x: ee[0], y: ee[1] }), T = false, I.timeStamp - O <= se.multiClickDebounceTime() ? (_ && clearTimeout(_), T = true, O = null, n(he, ["dblclick", "dbltap", "vdblclick"], I, { x: ee[0], y: ee[1] })) : (_ = setTimeout(function() { T || n(he, ["oneclick", "onetap", "voneclick"], I, { x: ee[0], y: ee[1] }); }, se.multiClickDebounceTime()), O = I.timeStamp)), he == null && !t13.dragData.didDrag && !t13.hoverData.selecting && !t13.hoverData.dragged && !a(I) && (se.$(r).unselect(["tapunselect"]), oe.length > 0 && t13.redrawHint("eles", true), t13.dragData.possibleDragElements = oe = se.collection()), ye == he && !t13.dragData.didDrag && !t13.hoverData.selecting && ye != null && ye._private.selectable && (t13.hoverData.dragging || (se.selectionType() === "additive" || Oe ? ye.selected() ? ye.unselect(["tapunselect"]) : ye.select(["tapselect"]) : Oe || (se.$(r).unmerge(ye).unselect(["tapunselect"]), ye.select(["tapselect"]))), t13.redrawHint("eles", true)), t13.hoverData.selecting) { var $e = se.collection(t13.getAllInBox(te[0], te[1], te[2], te[3])); t13.redrawHint("select", true), $e.length > 0 && t13.redrawHint("eles", true), se.emit({ type: "boxend", originalEvent: I, position: { x: ee[0], y: ee[1] } }); var Ie = function(nt) { return nt.selectable() && !nt.selected(); }; se.selectionType() === "additive" || Oe || se.$(r).unmerge($e).unselect(), $e.emit("box").stdFilter(Ie).select().emit("boxselect"), t13.redraw(); } if (t13.hoverData.dragging && (t13.hoverData.dragging = false, t13.redrawHint("select", true), t13.redrawHint("eles", true), t13.redraw()), !te[4]) { t13.redrawHint("drag", true), t13.redrawHint("eles", true); var Le = he && he.grabbed(); g(oe), Le && (he.emit("freeon"), oe.emit("free"), t13.dragData.didDrag && (he.emit("dragfreeon"), oe.emit("dragfree"))); } } te[4] = 0, t13.hoverData.down = null, t13.hoverData.cxtStarted = false, t13.hoverData.draggingEles = false, t13.hoverData.selecting = false, t13.hoverData.isOverThresholdDrag = false, t13.dragData.didDrag = false, t13.hoverData.dragged = false, t13.hoverData.dragDelta = [], t13.hoverData.mdownPos = null, t13.hoverData.mdownGPos = null, t13.hoverData.which = null; } } }, false); var D = function(I) { if (!t13.scrollingPage) { var G = t13.cy, se = G.zoom(), ee = G.pan(), te = t13.projectIntoViewport(I.clientX, I.clientY), ye = [te[0] * se + ee.x, te[1] * se + ee.y]; if (t13.hoverData.draggingEles || t13.hoverData.dragging || t13.hoverData.cxtStarted || k()) { I.preventDefault(); return; } if (G.panningEnabled() && G.userPanningEnabled() && G.zoomingEnabled() && G.userZoomingEnabled()) { I.preventDefault(), t13.data.wheelZooming = true, clearTimeout(t13.data.wheelTimeout), t13.data.wheelTimeout = setTimeout(function() { t13.data.wheelZooming = false, t13.redrawHint("eles", true), t13.redraw(); }, 150); var oe; I.deltaY != null ? oe = I.deltaY / -250 : I.wheelDeltaY != null ? oe = I.wheelDeltaY / 1e3 : oe = I.wheelDelta / 1e3, oe = oe * t13.wheelSensitivity; var he = I.deltaMode === 1; he && (oe *= 33); var Oe = G.zoom() * Math.pow(10, oe); I.type === "gesturechange" && (Oe = t13.gestureStartZoom * I.scale), G.zoom({ level: Oe, renderedPosition: { x: ye[0], y: ye[1] } }), G.emit(I.type === "gesturechange" ? "pinchzoom" : "scrollzoom"); } } }; t13.registerBinding(t13.container, "wheel", D, true), t13.registerBinding(e, "scroll", function(I) { t13.scrollingPage = true, clearTimeout(t13.scrollingPageTimeout), t13.scrollingPageTimeout = setTimeout(function() { t13.scrollingPage = false; }, 250); }, true), t13.registerBinding(t13.container, "gesturestart", function(I) { t13.gestureStartZoom = t13.cy.zoom(), t13.hasTouchStarted || I.preventDefault(); }, true), t13.registerBinding(t13.container, "gesturechange", function(ue) { t13.hasTouchStarted || D(ue); }, true), t13.registerBinding(t13.container, "mouseout", function(I) { var G = t13.projectIntoViewport(I.clientX, I.clientY); t13.cy.emit({ originalEvent: I, type: "mouseout", position: { x: G[0], y: G[1] } }); }, false), t13.registerBinding(t13.container, "mouseover", function(I) { var G = t13.projectIntoViewport(I.clientX, I.clientY); t13.cy.emit({ originalEvent: I, type: "mouseover", position: { x: G[0], y: G[1] } }); }, false); var A, F, R, M, L, V, Y, H, K, ne, B, $, z, W = function(I, G, se, ee) { return Math.sqrt((se - I) * (se - I) + (ee - G) * (ee - G)); }, Z = function(I, G, se, ee) { return (se - I) * (se - I) + (ee - G) * (ee - G); }, N; t13.registerBinding(t13.container, "touchstart", N = function(I) { if (t13.hasTouchStarted = true, !!S(I)) { m(), t13.touchData.capture = true, t13.data.bgActivePosistion = void 0; var G = t13.cy, se = t13.touchData.now, ee = t13.touchData.earlier; if (I.touches[0]) { var te = t13.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY); se[0] = te[0], se[1] = te[1]; } if (I.touches[1]) { var te = t13.projectIntoViewport(I.touches[1].clientX, I.touches[1].clientY); se[2] = te[0], se[3] = te[1]; } if (I.touches[2]) { var te = t13.projectIntoViewport(I.touches[2].clientX, I.touches[2].clientY); se[4] = te[0], se[5] = te[1]; } if (I.touches[1]) { t13.touchData.singleTouchMoved = true, g(t13.dragData.touchDragEles); var ye = t13.findContainerClientCoords(); K = ye[0], ne = ye[1], B = ye[2], $ = ye[3], A = I.touches[0].clientX - K, F = I.touches[0].clientY - ne, R = I.touches[1].clientX - K, M = I.touches[1].clientY - ne, z = 0 <= A && A <= B && 0 <= R && R <= B && 0 <= F && F <= $ && 0 <= M && M <= $; var oe = G.pan(), he = G.zoom(); L = W(A, F, R, M), V = Z(A, F, R, M), Y = [(A + R) / 2, (F + M) / 2], H = [(Y[0] - oe.x) / he, (Y[1] - oe.y) / he]; var Oe = 200, Pe = Oe * Oe; if (V < Pe && !I.touches[2]) { var Ae = t13.findNearestElement(se[0], se[1], true, true), $e = t13.findNearestElement(se[2], se[3], true, true); Ae && Ae.isNode() ? (Ae.activate().emit({ originalEvent: I, type: "cxttapstart", position: { x: se[0], y: se[1] } }), t13.touchData.start = Ae) : $e && $e.isNode() ? ($e.activate().emit({ originalEvent: I, type: "cxttapstart", position: { x: se[0], y: se[1] } }), t13.touchData.start = $e) : G.emit({ originalEvent: I, type: "cxttapstart", position: { x: se[0], y: se[1] } }), t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxt = true, t13.touchData.cxtDragged = false, t13.data.bgActivePosistion = void 0, t13.redraw(); return; } } if (I.touches[2]) G.boxSelectionEnabled() && I.preventDefault(); else if (!I.touches[1]) { if (I.touches[0]) { var Ie = t13.findNearestElements(se[0], se[1], true, true), Le = Ie[0]; if (Le != null && (Le.activate(), t13.touchData.start = Le, t13.touchData.starts = Ie, t13.nodeIsGrabbable(Le))) { var ut = t13.dragData.touchDragEles = G.collection(), nt = null; t13.redrawHint("eles", true), t13.redrawHint("drag", true), Le.selected() ? (nt = G.$(function(Pt) { return Pt.selected() && t13.nodeIsGrabbable(Pt); }), v(nt, { addToList: ut })) : p(Le, { addToList: ut }), c(Le); var kt = function($t) { return { originalEvent: I, type: $t, position: { x: se[0], y: se[1] } }; }; Le.emit(kt("grabon")), nt ? nt.forEach(function(Pt) { Pt.emit(kt("grab")); }) : Le.emit(kt("grab")); } n(Le, ["touchstart", "tapstart", "vmousedown"], I, { x: se[0], y: se[1] }), Le == null && (t13.data.bgActivePosistion = { x: te[0], y: te[1] }, t13.redrawHint("select", true), t13.redraw()), t13.touchData.singleTouchMoved = false, t13.touchData.singleTouchStartTime = +/* @__PURE__ */ new Date(), clearTimeout(t13.touchData.tapholdTimeout), t13.touchData.tapholdTimeout = setTimeout(function() { t13.touchData.singleTouchMoved === false && !t13.pinching && !t13.touchData.selecting && n(t13.touchData.start, ["taphold"], I, { x: se[0], y: se[1] }); }, t13.tapholdDuration); } } if (I.touches.length >= 1) { for (var _t = t13.touchData.startPosition = [null, null, null, null, null, null], Ct = 0; Ct < se.length; Ct++) _t[Ct] = ee[Ct] = se[Ct]; var Jt = I.touches[0]; t13.touchData.startGPosition = [Jt.clientX, Jt.clientY]; } } }, false); var X; t13.registerBinding(e, "touchmove", X = function(I) { var G = t13.touchData.capture; if (!(!G && !S(I))) { var se = t13.selection, ee = t13.cy, te = t13.touchData.now, ye = t13.touchData.earlier, oe = ee.zoom(); if (I.touches[0]) { var he = t13.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY); te[0] = he[0], te[1] = he[1]; } if (I.touches[1]) { var he = t13.projectIntoViewport(I.touches[1].clientX, I.touches[1].clientY); te[2] = he[0], te[3] = he[1]; } if (I.touches[2]) { var he = t13.projectIntoViewport(I.touches[2].clientX, I.touches[2].clientY); te[4] = he[0], te[5] = he[1]; } var Oe = t13.touchData.startGPosition, Pe; if (G && I.touches[0] && Oe) { for (var Ae = [], $e = 0; $e < te.length; $e++) Ae[$e] = te[$e] - ye[$e]; var Ie = I.touches[0].clientX - Oe[0], Le = Ie * Ie, ut = I.touches[0].clientY - Oe[1], nt = ut * ut, kt = Le + nt; Pe = kt >= t13.touchTapThreshold2; } if (G && t13.touchData.cxt) { I.preventDefault(); var _t = I.touches[0].clientX - K, Ct = I.touches[0].clientY - ne, Jt = I.touches[1].clientX - K, Pt = I.touches[1].clientY - ne, $t = Z(_t, Ct, Jt, Pt), wr = $t / V, Qt = 150, er = Qt * Qt, kr = 1.5, Nr = kr * kr; if (wr >= Nr || $t >= er) { t13.touchData.cxt = false, t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var dr = { originalEvent: I, type: "cxttapend", position: { x: te[0], y: te[1] } }; t13.touchData.start ? (t13.touchData.start.unactivate().emit(dr), t13.touchData.start = null) : ee.emit(dr); } } if (G && t13.touchData.cxt) { var dr = { originalEvent: I, type: "cxtdrag", position: { x: te[0], y: te[1] } }; t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true), t13.touchData.start ? t13.touchData.start.emit(dr) : ee.emit(dr), t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxtDragged = true; var xt = t13.findNearestElement(te[0], te[1], true, true); (!t13.touchData.cxtOver || xt !== t13.touchData.cxtOver) && (t13.touchData.cxtOver && t13.touchData.cxtOver.emit({ originalEvent: I, type: "cxtdragout", position: { x: te[0], y: te[1] } }), t13.touchData.cxtOver = xt, xt && xt.emit({ originalEvent: I, type: "cxtdragover", position: { x: te[0], y: te[1] } })); } else if (G && I.touches[2] && ee.boxSelectionEnabled()) I.preventDefault(), t13.data.bgActivePosistion = void 0, this.lastThreeTouch = +/* @__PURE__ */ new Date(), t13.touchData.selecting || ee.emit({ originalEvent: I, type: "boxstart", position: { x: te[0], y: te[1] } }), t13.touchData.selecting = true, t13.touchData.didSelect = true, se[4] = 1, !se || se.length === 0 || se[0] === void 0 ? (se[0] = (te[0] + te[2] + te[4]) / 3, se[1] = (te[1] + te[3] + te[5]) / 3, se[2] = (te[0] + te[2] + te[4]) / 3 + 1, se[3] = (te[1] + te[3] + te[5]) / 3 + 1) : (se[2] = (te[0] + te[2] + te[4]) / 3, se[3] = (te[1] + te[3] + te[5]) / 3), t13.redrawHint("select", true), t13.redraw(); else if (G && I.touches[1] && !t13.touchData.didSelect && ee.zoomingEnabled() && ee.panningEnabled() && ee.userZoomingEnabled() && ee.userPanningEnabled()) { I.preventDefault(), t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var Tt = t13.dragData.touchDragEles; if (Tt) { t13.redrawHint("drag", true); for (var qt = 0; qt < Tt.length; qt++) { var Fn = Tt[qt]._private; Fn.grabbed = false, Fn.rscratch.inDragLayer = false; } } var re = t13.touchData.start, _t = I.touches[0].clientX - K, Ct = I.touches[0].clientY - ne, Jt = I.touches[1].clientX - K, Pt = I.touches[1].clientY - ne, Ee = W(_t, Ct, Jt, Pt), We = Ee / L; if (z) { var at = _t - A, Qr = Ct - F, Mn = Jt - R, Xa = Pt - M, pn = (at + Mn) / 2, _r = (Qr + Xa) / 2, Nn = ee.zoom(), hu = Nn * We, ps = ee.pan(), yy = H[0] * Nn + ps.x, my = H[1] * Nn + ps.y, ET = { x: -hu / Nn * (yy - ps.x - pn) + yy, y: -hu / Nn * (my - ps.y - _r) + my }; if (re && re.active()) { var Tt = t13.dragData.touchDragEles; g(Tt), t13.redrawHint("drag", true), t13.redrawHint("eles", true), re.unactivate().emit("freeon"), Tt.emit("free"), t13.dragData.didDrag && (re.emit("dragfreeon"), Tt.emit("dragfree")); } ee.viewport({ zoom: hu, pan: ET, cancelOnFailedZoom: true }), ee.emit("pinchzoom"), L = Ee, A = _t, F = Ct, R = Jt, M = Pt, t13.pinching = true; } if (I.touches[0]) { var he = t13.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY); te[0] = he[0], te[1] = he[1]; } if (I.touches[1]) { var he = t13.projectIntoViewport(I.touches[1].clientX, I.touches[1].clientY); te[2] = he[0], te[3] = he[1]; } if (I.touches[2]) { var he = t13.projectIntoViewport(I.touches[2].clientX, I.touches[2].clientY); te[4] = he[0], te[5] = he[1]; } } else if (I.touches[0] && !t13.touchData.didSelect) { var Br = t13.touchData.start, pu = t13.touchData.last, xt; if (!t13.hoverData.draggingEles && !t13.swipePanning && (xt = t13.findNearestElement(te[0], te[1], true, true)), G && Br != null && I.preventDefault(), G && Br != null && t13.nodeIsDraggable(Br)) if (Pe) { var Tt = t13.dragData.touchDragEles, by = !t13.dragData.didDrag; by && v(Tt, { inDragLayer: true }), t13.dragData.didDrag = true; var Zi = { x: 0, y: 0 }; if (Ce(Ae[0]) && Ce(Ae[1]) && (Zi.x += Ae[0], Zi.y += Ae[1], by)) { t13.redrawHint("eles", true); var $r = t13.touchData.dragDelta; $r && Ce($r[0]) && Ce($r[1]) && (Zi.x += $r[0], Zi.y += $r[1]); } t13.hoverData.draggingEles = true, Tt.silentShift(Zi).emit("position drag"), t13.redrawHint("drag", true), t13.touchData.startPosition[0] == ye[0] && t13.touchData.startPosition[1] == ye[1] && t13.redrawHint("eles", true), t13.redraw(); } else { var $r = t13.touchData.dragDelta = t13.touchData.dragDelta || []; $r.length === 0 ? ($r.push(Ae[0]), $r.push(Ae[1])) : ($r[0] += Ae[0], $r[1] += Ae[1]); } if (n(Br || xt, ["touchmove", "tapdrag", "vmousemove"], I, { x: te[0], y: te[1] }), (!Br || !Br.grabbed()) && xt != pu && (pu && pu.emit({ originalEvent: I, type: "tapdragout", position: { x: te[0], y: te[1] } }), xt && xt.emit({ originalEvent: I, type: "tapdragover", position: { x: te[0], y: te[1] } })), t13.touchData.last = xt, G) for (var qt = 0; qt < te.length; qt++) te[qt] && t13.touchData.startPosition[qt] && Pe && (t13.touchData.singleTouchMoved = true); if (G && (Br == null || Br.pannable()) && ee.panningEnabled() && ee.userPanningEnabled()) { var ST = i(Br, t13.touchData.starts); ST && (I.preventDefault(), t13.data.bgActivePosistion || (t13.data.bgActivePosistion = ui(t13.touchData.startPosition)), t13.swipePanning ? (ee.panBy({ x: Ae[0] * oe, y: Ae[1] * oe }), ee.emit("dragpan")) : Pe && (t13.swipePanning = true, ee.panBy({ x: Ie * oe, y: ut * oe }), ee.emit("dragpan"), Br && (Br.unactivate(), t13.redrawHint("select", true), t13.touchData.start = null))); var he = t13.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY); te[0] = he[0], te[1] = he[1]; } } for (var $e = 0; $e < te.length; $e++) ye[$e] = te[$e]; G && I.touches.length > 0 && !t13.hoverData.draggingEles && !t13.swipePanning && t13.data.bgActivePosistion != null && (t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true), t13.redraw()); } }, false); var Q; t13.registerBinding(e, "touchcancel", Q = function(I) { var G = t13.touchData.start; t13.touchData.capture = false, G && G.unactivate(); }); var ge, we, fe, ce; if (t13.registerBinding(e, "touchend", ge = function(I) { var G = t13.touchData.start, se = t13.touchData.capture; if (se) I.touches.length === 0 && (t13.touchData.capture = false), I.preventDefault(); else return; var ee = t13.selection; t13.swipePanning = false, t13.hoverData.draggingEles = false; var te = t13.cy, ye = te.zoom(), oe = t13.touchData.now, he = t13.touchData.earlier; if (I.touches[0]) { var Oe = t13.projectIntoViewport(I.touches[0].clientX, I.touches[0].clientY); oe[0] = Oe[0], oe[1] = Oe[1]; } if (I.touches[1]) { var Oe = t13.projectIntoViewport(I.touches[1].clientX, I.touches[1].clientY); oe[2] = Oe[0], oe[3] = Oe[1]; } if (I.touches[2]) { var Oe = t13.projectIntoViewport(I.touches[2].clientX, I.touches[2].clientY); oe[4] = Oe[0], oe[5] = Oe[1]; } G && G.unactivate(); var Pe; if (t13.touchData.cxt) { if (Pe = { originalEvent: I, type: "cxttapend", position: { x: oe[0], y: oe[1] } }, G ? G.emit(Pe) : te.emit(Pe), !t13.touchData.cxtDragged) { var Ae = { originalEvent: I, type: "cxttap", position: { x: oe[0], y: oe[1] } }; G ? G.emit(Ae) : te.emit(Ae); } t13.touchData.start && (t13.touchData.start._private.grabbed = false), t13.touchData.cxt = false, t13.touchData.start = null, t13.redraw(); return; } if (!I.touches[2] && te.boxSelectionEnabled() && t13.touchData.selecting) { t13.touchData.selecting = false; var $e = te.collection(t13.getAllInBox(ee[0], ee[1], ee[2], ee[3])); ee[0] = void 0, ee[1] = void 0, ee[2] = void 0, ee[3] = void 0, ee[4] = 0, t13.redrawHint("select", true), te.emit({ type: "boxend", originalEvent: I, position: { x: oe[0], y: oe[1] } }); var Ie = function(er) { return er.selectable() && !er.selected(); }; $e.emit("box").stdFilter(Ie).select().emit("boxselect"), $e.nonempty() && t13.redrawHint("eles", true), t13.redraw(); } if (G != null && G.unactivate(), I.touches[2]) t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); else if (!I.touches[1]) { if (!I.touches[0]) { if (!I.touches[0]) { t13.data.bgActivePosistion = void 0, t13.redrawHint("select", true); var Le = t13.dragData.touchDragEles; if (G != null) { var ut = G._private.grabbed; g(Le), t13.redrawHint("drag", true), t13.redrawHint("eles", true), ut && (G.emit("freeon"), Le.emit("free"), t13.dragData.didDrag && (G.emit("dragfreeon"), Le.emit("dragfree"))), n(G, ["touchend", "tapend", "vmouseup", "tapdragout"], I, { x: oe[0], y: oe[1] }), G.unactivate(), t13.touchData.start = null; } else { var nt = t13.findNearestElement(oe[0], oe[1], true, true); n(nt, ["touchend", "tapend", "vmouseup", "tapdragout"], I, { x: oe[0], y: oe[1] }); } var kt = t13.touchData.startPosition[0] - oe[0], _t = kt * kt, Ct = t13.touchData.startPosition[1] - oe[1], Jt = Ct * Ct, Pt = _t + Jt, $t = Pt * ye * ye; t13.touchData.singleTouchMoved || (G || te.$(":selected").unselect(["tapunselect"]), n(G, ["tap", "vclick"], I, { x: oe[0], y: oe[1] }), we = false, I.timeStamp - ce <= te.multiClickDebounceTime() ? (fe && clearTimeout(fe), we = true, ce = null, n(G, ["dbltap", "vdblclick"], I, { x: oe[0], y: oe[1] })) : (fe = setTimeout(function() { we || n(G, ["onetap", "voneclick"], I, { x: oe[0], y: oe[1] }); }, te.multiClickDebounceTime()), ce = I.timeStamp)), G != null && !t13.dragData.didDrag && G._private.selectable && $t < t13.touchTapThreshold2 && !t13.pinching && (te.selectionType() === "single" ? (te.$(r).unmerge(G).unselect(["tapunselect"]), G.select(["tapselect"])) : G.selected() ? G.unselect(["tapunselect"]) : G.select(["tapselect"]), t13.redrawHint("eles", true)), t13.touchData.singleTouchMoved = true; } } } for (var wr = 0; wr < oe.length; wr++) he[wr] = oe[wr]; t13.dragData.didDrag = false, I.touches.length === 0 && (t13.touchData.dragDelta = [], t13.touchData.startPosition = [null, null, null, null, null, null], t13.touchData.startGPosition = null, t13.touchData.didSelect = false), I.touches.length < 2 && (I.touches.length === 1 && (t13.touchData.startGPosition = [I.touches[0].clientX, I.touches[0].clientY]), t13.pinching = false, t13.redrawHint("eles", true), t13.redraw()); }, false), typeof TouchEvent > "u") { var be = [], ve = function(I) { return { clientX: I.clientX, clientY: I.clientY, force: 1, identifier: I.pointerId, pageX: I.pageX, pageY: I.pageY, radiusX: I.width / 2, radiusY: I.height / 2, screenX: I.screenX, screenY: I.screenY, target: I.target }; }, xe = function(I) { return { event: I, touch: ve(I) }; }, _e = function(I) { be.push(xe(I)); }, He = function(I) { for (var G = 0; G < be.length; G++) { var se = be[G]; if (se.event.pointerId === I.pointerId) { be.splice(G, 1); return; } } }, Ve = function(I) { var G = be.filter(function(se) { return se.event.pointerId === I.pointerId; })[0]; G.event = I, G.touch = ve(I); }, De = function(I) { I.touches = be.map(function(G) { return G.touch; }); }, Ne = function(I) { return I.pointerType === "mouse" || I.pointerType === 4; }; t13.registerBinding(t13.container, "pointerdown", function(ue) { Ne(ue) || (ue.preventDefault(), _e(ue), De(ue), N(ue)); }), t13.registerBinding(t13.container, "pointerup", function(ue) { Ne(ue) || (He(ue), De(ue), ge(ue)); }), t13.registerBinding(t13.container, "pointercancel", function(ue) { Ne(ue) || (He(ue), De(ue), Q(ue)); }), t13.registerBinding(t13.container, "pointermove", function(ue) { Ne(ue) || (ue.preventDefault(), Ve(ue), De(ue), X(ue)); }); } }; var Pn = {}; Pn.generatePolygon = function(t13, e) { return this.nodeShapes[t13] = { renderer: this, name: t13, points: e, draw: function(n, a, i, o, s, u) { this.renderer.nodeShapeImpl("polygon", n, a, i, o, s, this.points); }, intersectLine: function(n, a, i, o, s, u, l, c) { return Mo(s, u, this.points, n, a, i / 2, o / 2, l); }, checkPoint: function(n, a, i, o, s, u, l, c) { return _n(n, a, this.points, u, l, o, s, [0, -1], i); } }; }; Pn.generateEllipse = function() { return this.nodeShapes.ellipse = { renderer: this, name: "ellipse", draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i); }, intersectLine: function(e, r, n, a, i, o, s, u) { return rq(i, o, e, r, n / 2 + s, a / 2 + s); }, checkPoint: function(e, r, n, a, i, o, s, u) { return xa(e, r, a, i, o, s, n); } }; }; Pn.generateRoundPolygon = function(t13, e) { return this.nodeShapes[t13] = { renderer: this, name: t13, points: e, getOrCreateCorners: function(n, a, i, o, s, u, l) { if (u[l] !== void 0 && u[l + "-cx"] === n && u[l + "-cy"] === a) return u[l]; u[l] = new Array(e.length / 2), u[l + "-cx"] = n, u[l + "-cy"] = a; var c = i / 2, d = o / 2; s = s === "auto" ? CS(i, o) : s; for (var f = new Array(e.length / 2), h10 = 0; h10 < e.length / 2; h10++) f[h10] = { x: n + c * e[h10 * 2], y: a + d * e[h10 * 2 + 1] }; var v, p, g, y, m = f.length; for (p = f[m - 1], v = 0; v < m; v++) g = f[v % m], y = f[(v + 1) % m], u[l][v] = Ug(p, g, y, s), p = g, g = y; return u[l]; }, draw: function(n, a, i, o, s, u, l) { this.renderer.nodeShapeImpl("round-polygon", n, a, i, o, s, this.points, this.getOrCreateCorners(a, i, o, s, u, l, "drawCorners")); }, intersectLine: function(n, a, i, o, s, u, l, c, d) { return nq(s, u, this.points, n, a, i, o, l, this.getOrCreateCorners(n, a, i, o, c, d, "corners")); }, checkPoint: function(n, a, i, o, s, u, l, c, d) { return tq(n, a, this.points, u, l, o, s, this.getOrCreateCorners(u, l, o, s, c, d, "corners")); } }; }; Pn.generateRoundRectangle = function() { return this.nodeShapes["round-rectangle"] = this.nodeShapes.roundrectangle = { renderer: this, name: "round-rectangle", points: ur(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o); }, intersectLine: function(e, r, n, a, i, o, s, u) { return bS(i, o, e, r, n, a, s, u); }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = a / 2, c = i / 2; u = u === "auto" ? Ra(a, i) : u, u = Math.min(l, c, u); var d = u * 2; return !!(_n(e, r, this.points, o, s, a, i - d, [0, -1], n) || _n(e, r, this.points, o, s, a - d, i, [0, -1], n) || xa(e, r, d, d, o - l + u, s - c + u, n) || xa(e, r, d, d, o + l - u, s - c + u, n) || xa(e, r, d, d, o + l - u, s + c - u, n) || xa(e, r, d, d, o - l + u, s + c - u, n)); } }; }; Pn.generateCutRectangle = function() { return this.nodeShapes["cut-rectangle"] = this.nodeShapes.cutrectangle = { renderer: this, name: "cut-rectangle", cornerLength: Lg(), points: ur(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, null, o); }, generateCutTrianglePts: function(e, r, n, a, i) { var o = i === "auto" ? this.cornerLength : i, s = r / 2, u = e / 2, l = n - u, c = n + u, d = a - s, f = a + s; return { topLeft: [l, d + o, l + o, d, l + o, d + o], topRight: [c - o, d, c, d + o, c - o, d + o], bottomRight: [c, f - o, c - o, f, c - o, f - o], bottomLeft: [l + o, f, l, f - o, l + o, f - o] }; }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = this.generateCutTrianglePts(n + 2 * s, a + 2 * s, e, r, u), c = [].concat.apply([], [l.topLeft.splice(0, 4), l.topRight.splice(0, 4), l.bottomRight.splice(0, 4), l.bottomLeft.splice(0, 4)]); return Mo(i, o, c, e, r); }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = u === "auto" ? this.cornerLength : u; if (_n(e, r, this.points, o, s, a, i - 2 * l, [0, -1], n) || _n(e, r, this.points, o, s, a - 2 * l, i, [0, -1], n)) return true; var c = this.generateCutTrianglePts(a, i, o, s); return vr(e, r, c.topLeft) || vr(e, r, c.topRight) || vr(e, r, c.bottomRight) || vr(e, r, c.bottomLeft); } }; }; Pn.generateBarrel = function() { return this.nodeShapes.barrel = { renderer: this, name: "barrel", points: ur(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i); }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = 0.15, c = 0.5, d = 0.85, f = this.generateBarrelBezierPts(n + 2 * s, a + 2 * s, e, r), h10 = function(g) { var y = vi({ x: g[0], y: g[1] }, { x: g[2], y: g[3] }, { x: g[4], y: g[5] }, l), m = vi({ x: g[0], y: g[1] }, { x: g[2], y: g[3] }, { x: g[4], y: g[5] }, c), b = vi({ x: g[0], y: g[1] }, { x: g[2], y: g[3] }, { x: g[4], y: g[5] }, d); return [g[0], g[1], y.x, y.y, m.x, m.y, b.x, b.y, g[4], g[5]]; }, v = [].concat(h10(f.topLeft), h10(f.topRight), h10(f.bottomRight), h10(f.bottomLeft)); return Mo(i, o, v, e, r); }, generateBarrelBezierPts: function(e, r, n, a) { var i = r / 2, o = e / 2, s = n - o, u = n + o, l = a - i, c = a + i, d = _p(e, r), f = d.heightOffset, h10 = d.widthOffset, v = d.ctrlPtOffsetPct * e, p = { topLeft: [s, l + f, s + v, l, s + h10, l], topRight: [u - h10, l, u - v, l, u, l + f], bottomRight: [u, c - f, u - v, c, u - h10, c], bottomLeft: [s + h10, c, s + v, c, s, c - f] }; return p.topLeft.isTop = true, p.topRight.isTop = true, p.bottomLeft.isBottom = true, p.bottomRight.isBottom = true, p; }, checkPoint: function(e, r, n, a, i, o, s, u) { var l = _p(a, i), c = l.heightOffset, d = l.widthOffset; if (_n(e, r, this.points, o, s, a, i - 2 * c, [0, -1], n) || _n(e, r, this.points, o, s, a - 2 * d, i, [0, -1], n)) return true; for (var f = this.generateBarrelBezierPts(a, i, o, s), h10 = function(k, S, _) { var T = _[4], O = _[2], D = _[0], A = _[5], F = _[1], R = Math.min(T, D), M = Math.max(T, D), L = Math.min(A, F), V = Math.max(A, F); if (R <= k && k <= M && L <= S && S <= V) { var Y = aq(T, O, D), H = X$(Y[0], Y[1], Y[2], k), K = H.filter(function(ne) { return 0 <= ne && ne <= 1; }); if (K.length > 0) return K[0]; } return null; }, v = Object.keys(f), p = 0; p < v.length; p++) { var g = v[p], y = f[g], m = h10(e, r, y); if (m != null) { var b = y[5], w = y[3], x = y[1], E = zt(b, w, x, m); if (y.isTop && E <= r || y.isBottom && r <= E) return true; } } return false; } }; }; Pn.generateBottomRoundrectangle = function() { return this.nodeShapes["bottom-round-rectangle"] = this.nodeShapes.bottomroundrectangle = { renderer: this, name: "bottom-round-rectangle", points: ur(4, 0), draw: function(e, r, n, a, i, o) { this.renderer.nodeShapeImpl(this.name, e, r, n, a, i, this.points, o); }, intersectLine: function(e, r, n, a, i, o, s, u) { var l = e - (n / 2 + s), c = r - (a / 2 + s), d = c, f = e + (n / 2 + s), h10 = jn(i, o, e, r, l, c, f, d, false); return h10.length > 0 ? h10 : bS(i, o, e, r, n, a, s, u); }, checkPoint: function(e, r, n, a, i, o, s, u) { u = u === "auto" ? Ra(a, i) : u; var l = 2 * u; if (_n(e, r, this.points, o, s, a, i - l, [0, -1], n) || _n(e, r, this.points, o, s, a - l, i, [0, -1], n)) return true; var c = a / 2 + 2 * n, d = i / 2 + 2 * n, f = [o - c, s - d, o - c, s, o + c, s, o + c, s - d]; return !!(vr(e, r, f) || xa(e, r, l, l, o + a / 2 - u, s + i / 2 - u, n) || xa(e, r, l, l, o - a / 2 + u, s + i / 2 - u, n)); } }; }; Pn.registerNodeShapes = function() { var t13 = this.nodeShapes = {}, e = this; this.generateEllipse(), this.generatePolygon("triangle", ur(3, 0)), this.generateRoundPolygon("round-triangle", ur(3, 0)), this.generatePolygon("rectangle", ur(4, 0)), t13.square = t13.rectangle, this.generateRoundRectangle(), this.generateCutRectangle(), this.generateBarrel(), this.generateBottomRoundrectangle(); { var r = [0, 1, 1, 0, 0, -1, -1, 0]; this.generatePolygon("diamond", r), this.generateRoundPolygon("round-diamond", r); } this.generatePolygon("pentagon", ur(5, 0)), this.generateRoundPolygon("round-pentagon", ur(5, 0)), this.generatePolygon("hexagon", ur(6, 0)), this.generateRoundPolygon("round-hexagon", ur(6, 0)), this.generatePolygon("heptagon", ur(7, 0)), this.generateRoundPolygon("round-heptagon", ur(7, 0)), this.generatePolygon("octagon", ur(8, 0)), this.generateRoundPolygon("round-octagon", ur(8, 0)); var n = new Array(20); { var a = kp(5, 0), i = kp(5, Math.PI / 5), o = 0.5 * (3 - Math.sqrt(5)); o *= 1.57; for (var s = 0; s < i.length / 2; s++) i[s * 2] *= o, i[s * 2 + 1] *= o; for (var s = 0; s < 20 / 4; s++) n[s * 4] = a[s * 2], n[s * 4 + 1] = a[s * 2 + 1], n[s * 4 + 2] = i[s * 2], n[s * 4 + 3] = i[s * 2 + 1]; } n = wS(n), this.generatePolygon("star", n), this.generatePolygon("vee", [-1, -1, 0, -0.333, 1, -1, 0, 1]), this.generatePolygon("rhomboid", [-1, -1, 0.333, -1, 1, 1, -0.333, 1]), this.generatePolygon("right-rhomboid", [-0.333, -1, 1, -1, 0.333, 1, -1, 1]), this.nodeShapes.concavehexagon = this.generatePolygon("concave-hexagon", [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]); { var u = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1]; this.generatePolygon("tag", u), this.generateRoundPolygon("round-tag", u); } t13.makePolygon = function(l) { var c = l.join("$"), d = "polygon-" + c, f; return (f = this[d]) ? f : e.generatePolygon(d, l); }; }; var ls = {}; ls.timeToRender = function() { return this.redrawTotalTime / this.redrawCount; }; ls.redraw = function(t13) { t13 = t13 || hS(); var e = this; e.averageRedrawTime === void 0 && (e.averageRedrawTime = 0), e.lastRedrawTime === void 0 && (e.lastRedrawTime = 0), e.lastDrawTime === void 0 && (e.lastDrawTime = 0), e.requestedFrame = true, e.renderOptions = t13; }; ls.beforeRender = function(t13, e) { if (!this.destroyed) { e == null && bt("Priority is not optional for beforeRender"); var r = this.beforeRenderCallbacks; r.push({ fn: t13, priority: e }), r.sort(function(n, a) { return a.priority - n.priority; }); } }; var K0 = function(e, r, n) { for (var a = e.beforeRenderCallbacks, i = 0; i < a.length; i++) a[i].fn(r, n); }; ls.startRenderLoop = function() { var t13 = this, e = t13.cy; if (!t13.renderLoopStarted) { t13.renderLoopStarted = true; var r = function n(a) { if (!t13.destroyed) { if (!e.batching()) if (t13.requestedFrame && !t13.skipFrame) { K0(t13, true, a); var i = kn(); t13.render(t13.renderOptions); var o = t13.lastDrawTime = kn(); t13.averageRedrawTime === void 0 && (t13.averageRedrawTime = o - i), t13.redrawCount === void 0 && (t13.redrawCount = 0), t13.redrawCount++, t13.redrawTotalTime === void 0 && (t13.redrawTotalTime = 0); var s = o - i; t13.redrawTotalTime += s, t13.lastRedrawTime = s, t13.averageRedrawTime = t13.averageRedrawTime / 2 + s / 2, t13.requestedFrame = false; } else K0(t13, false, a); t13.skipFrame = false, ll(n); } }; ll(r); } }; var $8 = function(e) { this.init(e); }; var bk = $8; var Hi = bk.prototype; Hi.clientFunctions = ["redrawHint", "render", "renderTo", "matchCanvasSize", "nodeShapeImpl", "arrowShapeImpl"]; Hi.init = function(t13) { var e = this; e.options = t13, e.cy = t13.cy; var r = e.container = t13.cy.container(), n = e.cy.window(); if (n) { var a = n.document, i = a.head, o = "__________cytoscape_stylesheet", s = "__________cytoscape_container", u = a.getElementById(o) != null; if (r.className.indexOf(s) < 0 && (r.className = (r.className || "") + " " + s), !u) { var l = a.createElement("style"); l.id = o, l.textContent = "." + s + " { position: relative; }", i.insertBefore(l, i.children[0]); } var c = n.getComputedStyle(r), d = c.getPropertyValue("position"); d === "static" && tt("A Cytoscape container has style position:static and so can not use UI extensions properly"); } e.selection = [void 0, void 0, void 0, void 0, 0], e.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95], e.hoverData = { down: null, last: null, downTime: null, triggerMode: null, dragging: false, initialPan: [null, null], capture: false }, e.dragData = { possibleDragElements: [] }, e.touchData = { start: null, capture: false, // These 3 fields related to tap, taphold events startPosition: [null, null, null, null, null, null], singleTouchStartTime: null, singleTouchMoved: true, now: [null, null, null, null, null, null], earlier: [null, null, null, null, null, null] }, e.redraws = 0, e.showFps = t13.showFps, e.debug = t13.debug, e.hideEdgesOnViewport = t13.hideEdgesOnViewport, e.textureOnViewport = t13.textureOnViewport, e.wheelSensitivity = t13.wheelSensitivity, e.motionBlurEnabled = t13.motionBlur, e.forcedPixelRatio = Ce(t13.pixelRatio) ? t13.pixelRatio : null, e.motionBlur = t13.motionBlur, e.motionBlurOpacity = t13.motionBlurOpacity, e.motionBlurTransparency = 1 - e.motionBlurOpacity, e.motionBlurPxRatio = 1, e.mbPxRBlurry = 1, e.minMbLowQualFrames = 4, e.fullQualityMb = false, e.clearedForMotionBlur = [], e.desktopTapThreshold = t13.desktopTapThreshold, e.desktopTapThreshold2 = t13.desktopTapThreshold * t13.desktopTapThreshold, e.touchTapThreshold = t13.touchTapThreshold, e.touchTapThreshold2 = t13.touchTapThreshold * t13.touchTapThreshold, e.tapholdDuration = 500, e.bindings = [], e.beforeRenderCallbacks = [], e.beforeRenderPriorities = { // higher priority execs before lower one animations: 400, eleCalcs: 300, eleTxrDeq: 200, lyrTxrDeq: 150, lyrTxrSkip: 100 }, e.registerNodeShapes(), e.registerArrowShapes(), e.registerCalculationListeners(); }; Hi.notify = function(t13, e) { var r = this, n = r.cy; if (!this.destroyed) { if (t13 === "init") { r.load(); return; } if (t13 === "destroy") { r.destroy(); return; } (t13 === "add" || t13 === "remove" || t13 === "move" && n.hasCompoundNodes() || t13 === "load" || t13 === "zorder" || t13 === "mount") && r.invalidateCachedZSortedEles(), t13 === "viewport" && r.redrawHint("select", true), (t13 === "load" || t13 === "resize" || t13 === "mount") && (r.invalidateContainerClientCoordsCache(), r.matchCanvasSize(r.container)), r.redrawHint("eles", true), r.redrawHint("drag", true), this.startRenderLoop(), this.redraw(); } }; Hi.destroy = function() { var t13 = this; t13.destroyed = true, t13.cy.stopAnimationLoop(); for (var e = 0; e < t13.bindings.length; e++) { var r = t13.bindings[e], n = r, a = n.target; (a.off || a.removeEventListener).apply(a, n.args); } if (t13.bindings = [], t13.beforeRenderCallbacks = [], t13.onUpdateEleCalcsFns = [], t13.removeObserver && t13.removeObserver.disconnect(), t13.styleObserver && t13.styleObserver.disconnect(), t13.resizeObserver && t13.resizeObserver.disconnect(), t13.labelCalcDiv) try { document.body.removeChild(t13.labelCalcDiv); } catch { } }; Hi.isHeadless = function() { return false; }; [Gg, yk, mk, Vi, Pn, ls].forEach(function(t13) { ze(Hi, t13); }); var qu = 1e3 / 60; var wk = { setupDequeueing: function(e) { return function() { var n = this, a = this.renderer; if (!n.dequeueingSetup) { n.dequeueingSetup = true; var i = Fl(function() { a.redrawHint("eles", true), a.redrawHint("drag", true), a.redraw(); }, e.deqRedrawThreshold), o = function(l, c) { var d = kn(), f = a.averageRedrawTime, h10 = a.lastRedrawTime, v = [], p = a.cy.extent(), g = a.getPixelRatio(); for (l || a.flushRenderedStyleQueue(); ; ) { var y = kn(), m = y - d, b = y - c; if (h10 < qu) { var w = qu - (l ? f : 0); if (b >= e.deqFastCost * w) break; } else if (l) { if (m >= e.deqCost * h10 || m >= e.deqAvgCost * f) break; } else if (b >= e.deqNoDrawCost * qu) break; var x = e.deq(n, g, p); if (x.length > 0) for (var E = 0; E < x.length; E++) v.push(x[E]); else break; } v.length > 0 && (e.onDeqd(n, v), !l && e.shouldRedraw(n, v, g, p) && i()); }, s = e.priority || Ag; a.beforeRender(o, s(n)); } }; } }; var q8 = function() { function t13(e) { var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ul; kg(this, t13), this.idsByKey = new nn(), this.keyForId = new nn(), this.cachesByLvl = new nn(), this.lvls = [], this.getKey = e, this.doesEleInvalidateKey = r; } return _g(t13, [{ key: "getIdsFor", value: function(r) { r == null && bt("Can not get id list for null key"); var n = this.idsByKey, a = this.idsByKey.get(r); return a || (a = new Fi(), n.set(r, a)), a; } }, { key: "addIdForKey", value: function(r, n) { r != null && this.getIdsFor(r).add(n); } }, { key: "deleteIdForKey", value: function(r, n) { r != null && this.getIdsFor(r).delete(n); } }, { key: "getNumberOfIdsForKey", value: function(r) { return r == null ? 0 : this.getIdsFor(r).size; } }, { key: "updateKeyMappingFor", value: function(r) { var n = r.id(), a = this.keyForId.get(n), i = this.getKey(r); this.deleteIdForKey(a, n), this.addIdForKey(i, n), this.keyForId.set(n, i); } }, { key: "deleteKeyMappingFor", value: function(r) { var n = r.id(), a = this.keyForId.get(n); this.deleteIdForKey(a, n), this.keyForId.delete(n); } }, { key: "keyHasChangedFor", value: function(r) { var n = r.id(), a = this.keyForId.get(n), i = this.getKey(r); return a !== i; } }, { key: "isInvalid", value: function(r) { return this.keyHasChangedFor(r) || this.doesEleInvalidateKey(r); } }, { key: "getCachesAt", value: function(r) { var n = this.cachesByLvl, a = this.lvls, i = n.get(r); return i || (i = new nn(), n.set(r, i), a.push(r)), i; } }, { key: "getCache", value: function(r, n) { return this.getCachesAt(n).get(r); } }, { key: "get", value: function(r, n) { var a = this.getKey(r), i = this.getCache(a, n); return i != null && this.updateKeyMappingFor(r), i; } }, { key: "getForCachedKey", value: function(r, n) { var a = this.keyForId.get(r.id()), i = this.getCache(a, n); return i; } }, { key: "hasCache", value: function(r, n) { return this.getCachesAt(n).has(r); } }, { key: "has", value: function(r, n) { var a = this.getKey(r); return this.hasCache(a, n); } }, { key: "setCache", value: function(r, n, a) { a.key = r, this.getCachesAt(n).set(r, a); } }, { key: "set", value: function(r, n, a) { var i = this.getKey(r); this.setCache(i, n, a), this.updateKeyMappingFor(r); } }, { key: "deleteCache", value: function(r, n) { this.getCachesAt(n).delete(r); } }, { key: "delete", value: function(r, n) { var a = this.getKey(r); this.deleteCache(a, n); } }, { key: "invalidateKey", value: function(r) { var n = this; this.lvls.forEach(function(a) { return n.deleteCache(r, a); }); } // returns true if no other eles reference the invalidated cache (n.b. other eles may need the cache with the same key) }, { key: "invalidate", value: function(r) { var n = r.id(), a = this.keyForId.get(n); this.deleteKeyMappingFor(r); var i = this.doesEleInvalidateKey(r); return i && this.invalidateKey(a), i || this.getNumberOfIdsForKey(a) === 0; } }]), t13; }(); var G0 = 25; var Ms = 50; var Zs = -4; var Np = 3; var z8 = 7.99; var V8 = 8; var H8 = 1024; var K8 = 1024; var G8 = 1024; var U8 = 0.2; var W8 = 0.8; var j8 = 10; var Y8 = 0.15; var Z8 = 0.1; var X8 = 0.9; var J8 = 0.9; var Q8 = 100; var eV = 1; var ci = { dequeue: "dequeue", downscale: "downscale", highQuality: "highQuality" }; var tV = Zt({ getKey: null, doesEleInvalidateKey: ul, drawElement: null, getBoundingBox: null, getRotationPoint: null, getRotationOffset: null, isVisible: dS, allowEdgeTxrCaching: true, allowParentTxrCaching: true }); var vo = function(e, r) { var n = this; n.renderer = e, n.onDequeues = []; var a = tV(r); ze(n, a), n.lookup = new q8(a.getKey, a.doesEleInvalidateKey), n.setupDequeueing(); }; var Bt = vo.prototype; Bt.reasons = ci; Bt.getTextureQueue = function(t13) { var e = this; return e.eleImgCaches = e.eleImgCaches || {}, e.eleImgCaches[t13] = e.eleImgCaches[t13] || []; }; Bt.getRetiredTextureQueue = function(t13) { var e = this, r = e.eleImgCaches.retired = e.eleImgCaches.retired || {}, n = r[t13] = r[t13] || []; return n; }; Bt.getElementQueue = function() { var t13 = this, e = t13.eleCacheQueue = t13.eleCacheQueue || new as(function(r, n) { return n.reqs - r.reqs; }); return e; }; Bt.getElementKeyToQueue = function() { var t13 = this, e = t13.eleKeyToCacheQueue = t13.eleKeyToCacheQueue || {}; return e; }; Bt.getElement = function(t13, e, r, n, a) { var i = this, o = this.renderer, s = o.cy.zoom(), u = this.lookup; if (!e || e.w === 0 || e.h === 0 || isNaN(e.w) || isNaN(e.h) || !t13.visible() || t13.removed() || !i.allowEdgeTxrCaching && t13.isEdge() || !i.allowParentTxrCaching && t13.isParent()) return null; if (n == null && (n = Math.ceil(Dg(s * r))), n < Zs) n = Zs; else if (s >= z8 || n > Np) return null; var l = Math.pow(2, n), c = e.h * l, d = e.w * l, f = o.eleTextBiggerThanMin(t13, l); if (!this.isVisible(t13, f)) return null; var h10 = u.get(t13, n); if (h10 && h10.invalidated && (h10.invalidated = false, h10.texture.invalidatedWidth -= h10.width), h10) return h10; var v; if (c <= G0 ? v = G0 : c <= Ms ? v = Ms : v = Math.ceil(c / Ms) * Ms, c > G8 || d > K8) return null; var p = i.getTextureQueue(v), g = p[p.length - 2], y = function() { return i.recycleTexture(v, d) || i.addTexture(v, d); }; g || (g = p[p.length - 1]), g || (g = y()), g.width - g.usedWidth < d && (g = y()); for (var m = function(R) { return R && R.scaledLabelShown === f; }, b = a && a === ci.dequeue, w = a && a === ci.highQuality, x = a && a === ci.downscale, E, C = n + 1; C <= Np; C++) { var k = u.get(t13, C); if (k) { E = k; break; } } var S = E && E.level === n + 1 ? E : null, _ = function() { g.context.drawImage(S.texture.canvas, S.x, 0, S.width, S.height, g.usedWidth, 0, d, c); }; if (g.context.setTransform(1, 0, 0, 1, 0, 0), g.context.clearRect(g.usedWidth, 0, d, v), m(S)) _(); else if (m(E)) if (w) { for (var T = E.level; T > n; T--) S = i.getElement(t13, e, r, T, ci.downscale); _(); } else return i.queueElement(t13, E.level - 1), E; else { var O; if (!b && !w && !x) for (var D = n - 1; D >= Zs; D--) { var A = u.get(t13, D); if (A) { O = A; break; } } if (m(O)) return i.queueElement(t13, n), O; g.context.translate(g.usedWidth, 0), g.context.scale(l, l), this.drawElement(g.context, t13, e, f, false), g.context.scale(1 / l, 1 / l), g.context.translate(-g.usedWidth, 0); } return h10 = { x: g.usedWidth, texture: g, level: n, scale: l, width: d, height: c, scaledLabelShown: f }, g.usedWidth += Math.ceil(d + V8), g.eleCaches.push(h10), u.set(t13, n, h10), i.checkTextureFullness(g), h10; }; Bt.invalidateElements = function(t13) { for (var e = 0; e < t13.length; e++) this.invalidateElement(t13[e]); }; Bt.invalidateElement = function(t13) { var e = this, r = e.lookup, n = [], a = r.isInvalid(t13); if (a) { for (var i = Zs; i <= Np; i++) { var o = r.getForCachedKey(t13, i); o && n.push(o); } var s = r.invalidate(t13); if (s) for (var u = 0; u < n.length; u++) { var l = n[u], c = l.texture; c.invalidatedWidth += l.width, l.invalidated = true, e.checkTextureUtility(c); } e.removeFromQueue(t13); } }; Bt.checkTextureUtility = function(t13) { t13.invalidatedWidth >= U8 * t13.width && this.retireTexture(t13); }; Bt.checkTextureFullness = function(t13) { var e = this, r = e.getTextureQueue(t13.height); t13.usedWidth / t13.width > W8 && t13.fullnessChecks >= j8 ? ta(r, t13) : t13.fullnessChecks++; }; Bt.retireTexture = function(t13) { var e = this, r = t13.height, n = e.getTextureQueue(r), a = this.lookup; ta(n, t13), t13.retired = true; for (var i = t13.eleCaches, o = 0; o < i.length; o++) { var s = i[o]; a.deleteCache(s.key, s.level); } Pg(i); var u = e.getRetiredTextureQueue(r); u.push(t13); }; Bt.addTexture = function(t13, e) { var r = this, n = r.getTextureQueue(t13), a = {}; return n.push(a), a.eleCaches = [], a.height = t13, a.width = Math.max(H8, e), a.usedWidth = 0, a.invalidatedWidth = 0, a.fullnessChecks = 0, a.canvas = r.renderer.makeOffscreenCanvas(a.width, a.height), a.context = a.canvas.getContext("2d"), a; }; Bt.recycleTexture = function(t13, e) { for (var r = this, n = r.getTextureQueue(t13), a = r.getRetiredTextureQueue(t13), i = 0; i < a.length; i++) { var o = a[i]; if (o.width >= e) return o.retired = false, o.usedWidth = 0, o.invalidatedWidth = 0, o.fullnessChecks = 0, Pg(o.eleCaches), o.context.setTransform(1, 0, 0, 1, 0, 0), o.context.clearRect(0, 0, o.width, o.height), ta(a, o), n.push(o), o; } }; Bt.queueElement = function(t13, e) { var r = this, n = r.getElementQueue(), a = r.getElementKeyToQueue(), i = this.getKey(t13), o = a[i]; if (o) o.level = Math.max(o.level, e), o.eles.merge(t13), o.reqs++, n.updateItem(o); else { var s = { eles: t13.spawn().merge(t13), level: e, reqs: 1, key: i }; n.push(s), a[i] = s; } }; Bt.dequeue = function(t13) { for (var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = [], i = e.lookup, o = 0; o < eV && r.size() > 0; o++) { var s = r.pop(), u = s.key, l = s.eles[0], c = i.hasCache(l, s.level); if (n[u] = null, c) continue; a.push(s); var d = e.getBoundingBox(l); e.getElement(l, d, t13, s.level, ci.dequeue); } return a; }; Bt.removeFromQueue = function(t13) { var e = this, r = e.getElementQueue(), n = e.getElementKeyToQueue(), a = this.getKey(t13), i = n[a]; i != null && (i.eles.length === 1 ? (i.reqs = Og, r.updateItem(i), r.pop(), n[a] = null) : i.eles.unmerge(t13)); }; Bt.onDequeue = function(t13) { this.onDequeues.push(t13); }; Bt.offDequeue = function(t13) { ta(this.onDequeues, t13); }; Bt.setupDequeueing = wk.setupDequeueing({ deqRedrawThreshold: Q8, deqCost: Y8, deqAvgCost: Z8, deqNoDrawCost: X8, deqFastCost: J8, deq: function(e, r, n) { return e.dequeue(r, n); }, onDeqd: function(e, r) { for (var n = 0; n < e.onDequeues.length; n++) { var a = e.onDequeues[n]; a(r); } }, shouldRedraw: function(e, r, n, a) { for (var i = 0; i < r.length; i++) for (var o = r[i].eles, s = 0; s < o.length; s++) { var u = o[s].boundingBox(); if (Rg(u, a)) return true; } return false; }, priority: function(e) { return e.renderer.beforeRenderPriorities.eleTxrDeq; } }); var rV = 1; var xo = -4; var yl = 2; var nV = 3.99; var aV = 50; var iV = 50; var oV = 0.15; var sV = 0.1; var lV = 0.9; var uV = 0.9; var cV = 1; var U0 = 250; var dV = 4e3 * 4e3; var fV = true; var Ck = function(e) { var r = this, n = r.renderer = e, a = n.cy; r.layersByLevel = {}, r.firstGet = true, r.lastInvalidationTime = kn() - 2 * U0, r.skipping = false, r.eleTxrDeqs = a.collection(), r.scheduleElementRefinement = Fl(function() { r.refineElementTextures(r.eleTxrDeqs), r.eleTxrDeqs.unmerge(r.eleTxrDeqs); }, iV), n.beforeRender(function(o, s) { s - r.lastInvalidationTime <= U0 ? r.skipping = true : r.skipping = false; }, n.beforeRenderPriorities.lyrTxrSkip); var i = function(s, u) { return u.reqs - s.reqs; }; r.layersQueue = new as(i), r.setupDequeueing(); }; var Xt = Ck.prototype; var W0 = 0; var vV = Math.pow(2, 53) - 1; Xt.makeLayer = function(t13, e) { var r = Math.pow(2, e), n = Math.ceil(t13.w * r), a = Math.ceil(t13.h * r), i = this.renderer.makeOffscreenCanvas(n, a), o = { id: W0 = ++W0 % vV, bb: t13, level: e, width: n, height: a, canvas: i, context: i.getContext("2d"), eles: [], elesQueue: [], reqs: 0 }, s = o.context, u = -o.bb.x1, l = -o.bb.y1; return s.scale(r, r), s.translate(u, l), o; }; Xt.getLayers = function(t13, e, r) { var n = this, a = n.renderer, i = a.cy, o = i.zoom(), s = n.firstGet; if (n.firstGet = false, r == null) { if (r = Math.ceil(Dg(o * e)), r < xo) r = xo; else if (o >= nV || r > yl) return null; } n.validateLayersElesOrdering(r, t13); var u = n.layersByLevel, l = Math.pow(2, r), c = u[r] = u[r] || [], d, f = n.levelIsComplete(r, t13), h10, v = function() { var _ = function(F) { if (n.validateLayersElesOrdering(F, t13), n.levelIsComplete(F, t13)) return h10 = u[F], true; }, T = function(F) { if (!h10) for (var R = r + F; xo <= R && R <= yl && !_(R); R += F) ; }; T(1), T(-1); for (var O = c.length - 1; O >= 0; O--) { var D = c[O]; D.invalid && ta(c, D); } }; if (!f) v(); else return c; var p = function() { if (!d) { d = br(); for (var _ = 0; _ < t13.length; _++) yS(d, t13[_].boundingBox()); } return d; }, g = function(_) { _ = _ || {}; var T = _.after; p(); var O = d.w * l * (d.h * l); if (O > dV) return null; var D = n.makeLayer(d, r); if (T != null) { var A = c.indexOf(T) + 1; c.splice(A, 0, D); } else (_.insert === void 0 || _.insert) && c.unshift(D); return D; }; if (n.skipping && !s) return null; for (var y = null, m = t13.length / rV, b = !s, w = 0; w < t13.length; w++) { var x = t13[w], E = x._private.rscratch, C = E.imgLayerCaches = E.imgLayerCaches || {}, k = C[r]; if (k) { y = k; continue; } if ((!y || y.eles.length >= m || !mS(y.bb, x.boundingBox())) && (y = g({ insert: true, after: y }), !y)) return null; h10 || b ? n.queueLayer(y, x) : n.drawEleInLayer(y, x, r, e), y.eles.push(x), C[r] = y; } return h10 || (b ? null : c); }; Xt.getEleLevelForLayerLevel = function(t13, e) { return t13; }; Xt.drawEleInLayer = function(t13, e, r, n) { var a = this, i = this.renderer, o = t13.context, s = e.boundingBox(); s.w === 0 || s.h === 0 || !e.visible() || (r = a.getEleLevelForLayerLevel(r, n), i.setImgSmoothing(o, false), i.drawCachedElement(o, e, null, null, r, fV), i.setImgSmoothing(o, true)); }; Xt.levelIsComplete = function(t13, e) { var r = this, n = r.layersByLevel[t13]; if (!n || n.length === 0) return false; for (var a = 0, i = 0; i < n.length; i++) { var o = n[i]; if (o.reqs > 0 || o.invalid) return false; a += o.eles.length; } return a === e.length; }; Xt.validateLayersElesOrdering = function(t13, e) { var r = this.layersByLevel[t13]; if (r) for (var n = 0; n < r.length; n++) { for (var a = r[n], i = -1, o = 0; o < e.length; o++) if (a.eles[0] === e[o]) { i = o; break; } if (i < 0) { this.invalidateLayer(a); continue; } for (var s = i, o = 0; o < a.eles.length; o++) if (a.eles[o] !== e[s + o]) { this.invalidateLayer(a); break; } } }; Xt.updateElementsInLayers = function(t13, e) { for (var r = this, n = rs(t13[0]), a = 0; a < t13.length; a++) for (var i = n ? null : t13[a], o = n ? t13[a] : t13[a].ele, s = o._private.rscratch, u = s.imgLayerCaches = s.imgLayerCaches || {}, l = xo; l <= yl; l++) { var c = u[l]; c && (i && r.getEleLevelForLayerLevel(c.level) !== i.level || e(c, o, i)); } }; Xt.haveLayers = function() { for (var t13 = this, e = false, r = xo; r <= yl; r++) { var n = t13.layersByLevel[r]; if (n && n.length > 0) { e = true; break; } } return e; }; Xt.invalidateElements = function(t13) { var e = this; t13.length !== 0 && (e.lastInvalidationTime = kn(), !(t13.length === 0 || !e.haveLayers()) && e.updateElementsInLayers(t13, function(n, a, i) { e.invalidateLayer(n); })); }; Xt.invalidateLayer = function(t13) { if (this.lastInvalidationTime = kn(), !t13.invalid) { var e = t13.level, r = t13.eles, n = this.layersByLevel[e]; ta(n, t13), t13.elesQueue = [], t13.invalid = true, t13.replacement && (t13.replacement.invalid = true); for (var a = 0; a < r.length; a++) { var i = r[a]._private.rscratch.imgLayerCaches; i && (i[e] = null); } } }; Xt.refineElementTextures = function(t13) { var e = this; e.updateElementsInLayers(t13, function(n, a, i) { var o = n.replacement; if (o || (o = n.replacement = e.makeLayer(n.bb, n.level), o.replaces = n, o.eles = n.eles), !o.reqs) for (var s = 0; s < o.eles.length; s++) e.queueLayer(o, o.eles[s]); }); }; Xt.enqueueElementRefinement = function(t13) { this.eleTxrDeqs.merge(t13), this.scheduleElementRefinement(); }; Xt.queueLayer = function(t13, e) { var r = this, n = r.layersQueue, a = t13.elesQueue, i = a.hasId = a.hasId || {}; if (!t13.replacement) { if (e) { if (i[e.id()]) return; a.push(e), i[e.id()] = true; } t13.reqs ? (t13.reqs++, n.updateItem(t13)) : (t13.reqs = 1, n.push(t13)); } }; Xt.dequeue = function(t13) { for (var e = this, r = e.layersQueue, n = [], a = 0; a < cV && r.size() !== 0; ) { var i = r.peek(); if (i.replacement) { r.pop(); continue; } if (i.replaces && i !== i.replaces.replacement) { r.pop(); continue; } if (i.invalid) { r.pop(); continue; } var o = i.elesQueue.shift(); o && (e.drawEleInLayer(i, o, i.level, t13), a++), n.length === 0 && n.push(true), i.elesQueue.length === 0 && (r.pop(), i.reqs = 0, i.replaces && e.applyLayerReplacement(i), e.requestRedraw()); } return n; }; Xt.applyLayerReplacement = function(t13) { var e = this, r = e.layersByLevel[t13.level], n = t13.replaces, a = r.indexOf(n); if (!(a < 0 || n.invalid)) { r[a] = t13; for (var i = 0; i < t13.eles.length; i++) { var o = t13.eles[i]._private, s = o.imgLayerCaches = o.imgLayerCaches || {}; s && (s[t13.level] = t13); } e.requestRedraw(); } }; Xt.requestRedraw = Fl(function() { var t13 = this.renderer; t13.redrawHint("eles", true), t13.redrawHint("drag", true), t13.redraw(); }, 100); Xt.setupDequeueing = wk.setupDequeueing({ deqRedrawThreshold: aV, deqCost: oV, deqAvgCost: sV, deqNoDrawCost: lV, deqFastCost: uV, deq: function(e, r) { return e.dequeue(r); }, onDeqd: Ag, shouldRedraw: dS, priority: function(e) { return e.renderer.beforeRenderPriorities.lyrTxrDeq; } }); var xk = {}; var j0; function hV(t13, e) { for (var r = 0; r < e.length; r++) { var n = e[r]; t13.lineTo(n.x, n.y); } } function pV(t13, e, r) { for (var n, a = 0; a < e.length; a++) { var i = e[a]; a === 0 && (n = i), t13.lineTo(i.x, i.y); } t13.quadraticCurveTo(r.x, r.y, n.x, n.y); } function Y0(t13, e, r) { t13.beginPath && t13.beginPath(); for (var n = e, a = 0; a < n.length; a++) { var i = n[a]; t13.lineTo(i.x, i.y); } var o = r, s = r[0]; t13.moveTo(s.x, s.y); for (var a = 1; a < o.length; a++) { var i = o[a]; t13.lineTo(i.x, i.y); } t13.closePath && t13.closePath(); } function gV(t13, e, r, n, a) { t13.beginPath && t13.beginPath(), t13.arc(r, n, a, 0, Math.PI * 2, false); var i = e, o = i[0]; t13.moveTo(o.x, o.y); for (var s = 0; s < i.length; s++) { var u = i[s]; t13.lineTo(u.x, u.y); } t13.closePath && t13.closePath(); } function yV(t13, e, r, n) { t13.arc(e, r, n, 0, Math.PI * 2, false); } xk.arrowShapeImpl = function(t13) { return (j0 || (j0 = { polygon: hV, "triangle-backcurve": pV, "triangle-tee": Y0, "circle-triangle": gV, "triangle-cross": Y0, circle: yV }))[t13]; }; var vn = {}; vn.drawElement = function(t13, e, r, n, a, i) { var o = this; e.isNode() ? o.drawNode(t13, e, r, n, a, i) : o.drawEdge(t13, e, r, n, a, i); }; vn.drawElementOverlay = function(t13, e) { var r = this; e.isNode() ? r.drawNodeOverlay(t13, e) : r.drawEdgeOverlay(t13, e); }; vn.drawElementUnderlay = function(t13, e) { var r = this; e.isNode() ? r.drawNodeUnderlay(t13, e) : r.drawEdgeUnderlay(t13, e); }; vn.drawCachedElementPortion = function(t13, e, r, n, a, i, o, s) { var u = this, l = r.getBoundingBox(e); if (!(l.w === 0 || l.h === 0)) { var c = r.getElement(e, l, n, a, i); if (c != null) { var d = s(u, e); if (d === 0) return; var f = o(u, e), h10 = l.x1, v = l.y1, p = l.w, g = l.h, y, m, b, w, x; if (f !== 0) { var E = r.getRotationPoint(e); b = E.x, w = E.y, t13.translate(b, w), t13.rotate(f), x = u.getImgSmoothing(t13), x || u.setImgSmoothing(t13, true); var C = r.getRotationOffset(e); y = C.x, m = C.y; } else y = h10, m = v; var k; d !== 1 && (k = t13.globalAlpha, t13.globalAlpha = k * d), t13.drawImage(c.texture.canvas, c.x, 0, c.width, c.height, y, m, p, g), d !== 1 && (t13.globalAlpha = k), f !== 0 && (t13.rotate(-f), t13.translate(-b, -w), x || u.setImgSmoothing(t13, false)); } else r.drawElement(t13, e); } }; var mV = function() { return 0; }; var bV = function(e, r) { return e.getTextAngle(r, null); }; var wV = function(e, r) { return e.getTextAngle(r, "source"); }; var CV = function(e, r) { return e.getTextAngle(r, "target"); }; var xV = function(e, r) { return r.effectiveOpacity(); }; var zu = function(e, r) { return r.pstyle("text-opacity").pfValue * r.effectiveOpacity(); }; vn.drawCachedElement = function(t13, e, r, n, a, i) { var o = this, s = o.data, u = s.eleTxrCache, l = s.lblTxrCache, c = s.slbTxrCache, d = s.tlbTxrCache, f = e.boundingBox(), h10 = i === true ? u.reasons.highQuality : null; if (!(f.w === 0 || f.h === 0 || !e.visible()) && (!n || Rg(f, n))) { var v = e.isEdge(), p = e.element()._private.rscratch.badLine; o.drawElementUnderlay(t13, e), o.drawCachedElementPortion(t13, e, u, r, a, h10, mV, xV), (!v || !p) && o.drawCachedElementPortion(t13, e, l, r, a, h10, bV, zu), v && !p && (o.drawCachedElementPortion(t13, e, c, r, a, h10, wV, zu), o.drawCachedElementPortion(t13, e, d, r, a, h10, CV, zu)), o.drawElementOverlay(t13, e); } }; vn.drawElements = function(t13, e) { for (var r = this, n = 0; n < e.length; n++) { var a = e[n]; r.drawElement(t13, a); } }; vn.drawCachedElements = function(t13, e, r, n) { for (var a = this, i = 0; i < e.length; i++) { var o = e[i]; a.drawCachedElement(t13, o, r, n); } }; vn.drawCachedNodes = function(t13, e, r, n) { for (var a = this, i = 0; i < e.length; i++) { var o = e[i]; o.isNode() && a.drawCachedElement(t13, o, r, n); } }; vn.drawLayeredElements = function(t13, e, r, n) { var a = this, i = a.data.lyrTxrCache.getLayers(e, r); if (i) for (var o = 0; o < i.length; o++) { var s = i[o], u = s.bb; u.w === 0 || u.h === 0 || t13.drawImage(s.canvas, u.x1, u.y1, u.w, u.h); } else a.drawCachedElements(t13, e, r, n); }; var Dn = {}; Dn.drawEdge = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this, s = e._private.rscratch; if (!(i && !e.visible()) && !(s.badLine || s.allpts == null || isNaN(s.allpts[0]))) { var u; r && (u = r, t13.translate(-u.x1, -u.y1)); var l = i ? e.pstyle("opacity").value : 1, c = i ? e.pstyle("line-opacity").value : 1, d = e.pstyle("curve-style").value, f = e.pstyle("line-style").value, h10 = e.pstyle("width").pfValue, v = e.pstyle("line-cap").value, p = e.pstyle("line-outline-width").value, g = e.pstyle("line-outline-color").value, y = l * c, m = l * c, b = function() { var F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : y; d === "straight-triangle" ? (o.eleStrokeStyle(t13, e, F), o.drawEdgeTrianglePath(e, t13, s.allpts)) : (t13.lineWidth = h10, t13.lineCap = v, o.eleStrokeStyle(t13, e, F), o.drawEdgePath(e, t13, s.allpts, f), t13.lineCap = "butt"); }, w = function() { var F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : y; if (t13.lineWidth = h10 + p, t13.lineCap = v, p > 0) o.colorStrokeStyle(t13, g[0], g[1], g[2], F); else { t13.lineCap = "butt"; return; } d === "straight-triangle" ? o.drawEdgeTrianglePath(e, t13, s.allpts) : (o.drawEdgePath(e, t13, s.allpts, f), t13.lineCap = "butt"); }, x = function() { a && o.drawEdgeOverlay(t13, e); }, E = function() { a && o.drawEdgeUnderlay(t13, e); }, C = function() { var F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : m; o.drawArrowheads(t13, e, F); }, k = function() { o.drawElementText(t13, e, null, n); }; t13.lineJoin = "round"; var S = e.pstyle("ghost").value === "yes"; if (S) { var _ = e.pstyle("ghost-offset-x").pfValue, T = e.pstyle("ghost-offset-y").pfValue, O = e.pstyle("ghost-opacity").value, D = y * O; t13.translate(_, T), b(D), C(D), t13.translate(-_, -T); } else w(); E(), b(), C(), x(), k(), r && t13.translate(u.x1, u.y1); } }; var Ek = function(e) { if (!["overlay", "underlay"].includes(e)) throw new Error("Invalid state"); return function(r, n) { if (n.visible()) { var a = n.pstyle("".concat(e, "-opacity")).value; if (a !== 0) { var i = this, o = i.usePaths(), s = n._private.rscratch, u = n.pstyle("".concat(e, "-padding")).pfValue, l = 2 * u, c = n.pstyle("".concat(e, "-color")).value; r.lineWidth = l, s.edgeType === "self" && !o ? r.lineCap = "butt" : r.lineCap = "round", i.colorStrokeStyle(r, c[0], c[1], c[2], a), i.drawEdgePath(n, r, s.allpts, "solid"); } } }; }; Dn.drawEdgeOverlay = Ek("overlay"); Dn.drawEdgeUnderlay = Ek("underlay"); Dn.drawEdgePath = function(t13, e, r, n) { var a = t13._private.rscratch, i = e, o, s = false, u = this.usePaths(), l = t13.pstyle("line-dash-pattern").pfValue, c = t13.pstyle("line-dash-offset").pfValue; if (u) { var d = r.join("$"), f = a.pathCacheKey && a.pathCacheKey === d; f ? (o = e = a.pathCache, s = true) : (o = e = new Path2D(), a.pathCacheKey = d, a.pathCache = o); } if (i.setLineDash) switch (n) { case "dotted": i.setLineDash([1, 1]); break; case "dashed": i.setLineDash(l), i.lineDashOffset = c; break; case "solid": i.setLineDash([]); break; } if (!s && !a.badLine) switch (e.beginPath && e.beginPath(), e.moveTo(r[0], r[1]), a.edgeType) { case "bezier": case "self": case "compound": case "multibezier": for (var h10 = 2; h10 + 3 < r.length; h10 += 4) e.quadraticCurveTo(r[h10], r[h10 + 1], r[h10 + 2], r[h10 + 3]); break; case "straight": case "haystack": for (var v = 2; v + 1 < r.length; v += 2) e.lineTo(r[v], r[v + 1]); break; case "segments": if (a.isRound) { var p = X2(a.roundCorners), g; try { for (p.s(); !(g = p.n()).done; ) { var y = g.value; fk(e, y); } } catch (b) { p.e(b); } finally { p.f(); } e.lineTo(r[r.length - 2], r[r.length - 1]); } else for (var m = 2; m + 1 < r.length; m += 2) e.lineTo(r[m], r[m + 1]); break; } e = i, u ? e.stroke(o) : e.stroke(), e.setLineDash && e.setLineDash([]); }; Dn.drawEdgeTrianglePath = function(t13, e, r) { e.fillStyle = e.strokeStyle; for (var n = t13.pstyle("width").pfValue, a = 0; a + 1 < r.length; a += 2) { var i = [r[a + 2] - r[a], r[a + 3] - r[a + 1]], o = Math.sqrt(i[0] * i[0] + i[1] * i[1]), s = [i[1] / o, -i[0] / o], u = [s[0] * n / 2, s[1] * n / 2]; e.beginPath(), e.moveTo(r[a] - u[0], r[a + 1] - u[1]), e.lineTo(r[a] + u[0], r[a + 1] + u[1]), e.lineTo(r[a + 2], r[a + 3]), e.closePath(), e.fill(); } }; Dn.drawArrowheads = function(t13, e, r) { var n = e._private.rscratch, a = n.edgeType === "haystack"; a || this.drawArrowhead(t13, e, "source", n.arrowStartX, n.arrowStartY, n.srcArrowAngle, r), this.drawArrowhead(t13, e, "mid-target", n.midX, n.midY, n.midtgtArrowAngle, r), this.drawArrowhead(t13, e, "mid-source", n.midX, n.midY, n.midsrcArrowAngle, r), a || this.drawArrowhead(t13, e, "target", n.arrowEndX, n.arrowEndY, n.tgtArrowAngle, r); }; Dn.drawArrowhead = function(t13, e, r, n, a, i, o) { if (!(isNaN(n) || n == null || isNaN(a) || a == null || isNaN(i) || i == null)) { var s = this, u = e.pstyle(r + "-arrow-shape").value; if (u !== "none") { var l = e.pstyle(r + "-arrow-fill").value === "hollow" ? "both" : "filled", c = e.pstyle(r + "-arrow-fill").value, d = e.pstyle("width").pfValue, f = e.pstyle(r + "-arrow-width"), h10 = f.value === "match-line" ? d : f.pfValue; f.units === "%" && (h10 *= d); var v = e.pstyle("opacity").value; o === void 0 && (o = v); var p = t13.globalCompositeOperation; (o !== 1 || c === "hollow") && (t13.globalCompositeOperation = "destination-out", s.colorFillStyle(t13, 255, 255, 255, 1), s.colorStrokeStyle(t13, 255, 255, 255, 1), s.drawArrowShape(e, t13, l, d, u, h10, n, a, i), t13.globalCompositeOperation = p); var g = e.pstyle(r + "-arrow-color").value; s.colorFillStyle(t13, g[0], g[1], g[2], o), s.colorStrokeStyle(t13, g[0], g[1], g[2], o), s.drawArrowShape(e, t13, c, d, u, h10, n, a, i); } } }; Dn.drawArrowShape = function(t13, e, r, n, a, i, o, s, u) { var l = this, c = this.usePaths() && a !== "triangle-cross", d = false, f, h10 = e, v = { x: o, y: s }, p = t13.pstyle("arrow-scale").value, g = this.getArrowWidth(n, p), y = l.arrowShapes[a]; if (c) { var m = l.arrowPathCache = l.arrowPathCache || [], b = Pa(a), w = m[b]; w != null ? (f = e = w, d = true) : (f = e = new Path2D(), m[b] = f); } d || (e.beginPath && e.beginPath(), c ? y.draw(e, 1, 0, { x: 0, y: 0 }, 1) : y.draw(e, g, u, v, n), e.closePath && e.closePath()), e = h10, c && (e.translate(o, s), e.rotate(u), e.scale(g, g)), (r === "filled" || r === "both") && (c ? e.fill(f) : e.fill()), (r === "hollow" || r === "both") && (e.lineWidth = i / (c ? g : 1), e.lineJoin = "miter", c ? e.stroke(f) : e.stroke()), c && (e.scale(1 / g, 1 / g), e.rotate(-u), e.translate(-o, -s)); }; var jg = {}; jg.safeDrawImage = function(t13, e, r, n, a, i, o, s, u, l) { if (!(a <= 0 || i <= 0 || u <= 0 || l <= 0)) try { t13.drawImage(e, r, n, a, i, o, s, u, l); } catch (c) { tt(c); } }; jg.drawInscribedImage = function(t13, e, r, n, a) { var i = this, o = r.position(), s = o.x, u = o.y, l = r.cy().style(), c = l.getIndexedStyle.bind(l), d = c(r, "background-fit", "value", n), f = c(r, "background-repeat", "value", n), h10 = r.width(), v = r.height(), p = r.padding() * 2, g = h10 + (c(r, "background-width-relative-to", "value", n) === "inner" ? 0 : p), y = v + (c(r, "background-height-relative-to", "value", n) === "inner" ? 0 : p), m = r._private.rscratch, b = c(r, "background-clip", "value", n), w = b === "node", x = c(r, "background-image-opacity", "value", n) * a, E = c(r, "background-image-smoothing", "value", n), C = r.pstyle("corner-radius").value; C !== "auto" && (C = r.pstyle("corner-radius").pfValue); var k = e.width || e.cachedW, S = e.height || e.cachedH; (k == null || S == null) && (document.body.appendChild(e), k = e.cachedW = e.width || e.offsetWidth, S = e.cachedH = e.height || e.offsetHeight, document.body.removeChild(e)); var _ = k, T = S; if (c(r, "background-width", "value", n) !== "auto" && (c(r, "background-width", "units", n) === "%" ? _ = c(r, "background-width", "pfValue", n) * g : _ = c(r, "background-width", "pfValue", n)), c(r, "background-height", "value", n) !== "auto" && (c(r, "background-height", "units", n) === "%" ? T = c(r, "background-height", "pfValue", n) * y : T = c(r, "background-height", "pfValue", n)), !(_ === 0 || T === 0)) { if (d === "contain") { var O = Math.min(g / _, y / T); _ *= O, T *= O; } else if (d === "cover") { var O = Math.max(g / _, y / T); _ *= O, T *= O; } var D = s - g / 2, A = c(r, "background-position-x", "units", n), F = c(r, "background-position-x", "pfValue", n); A === "%" ? D += (g - _) * F : D += F; var R = c(r, "background-offset-x", "units", n), M = c(r, "background-offset-x", "pfValue", n); R === "%" ? D += (g - _) * M : D += M; var L = u - y / 2, V = c(r, "background-position-y", "units", n), Y = c(r, "background-position-y", "pfValue", n); V === "%" ? L += (y - T) * Y : L += Y; var H = c(r, "background-offset-y", "units", n), K = c(r, "background-offset-y", "pfValue", n); H === "%" ? L += (y - T) * K : L += K, m.pathCache && (D -= s, L -= u, s = 0, u = 0); var ne = t13.globalAlpha; t13.globalAlpha = x; var B = i.getImgSmoothing(t13), $ = false; if (E === "no" && B ? (i.setImgSmoothing(t13, false), $ = true) : E === "yes" && !B && (i.setImgSmoothing(t13, true), $ = true), f === "no-repeat") w && (t13.save(), m.pathCache ? t13.clip(m.pathCache) : (i.nodeShapes[i.getNodeShape(r)].draw(t13, s, u, g, y, C, m), t13.clip())), i.safeDrawImage(t13, e, 0, 0, k, S, D, L, _, T), w && t13.restore(); else { var z = t13.createPattern(e, f); t13.fillStyle = z, i.nodeShapes[i.getNodeShape(r)].draw(t13, s, u, g, y, C, m), t13.translate(D, L), t13.fill(), t13.translate(-D, -L); } t13.globalAlpha = ne, $ && i.setImgSmoothing(t13, B); } }; var Ga = {}; Ga.eleTextBiggerThanMin = function(t13, e) { if (!e) { var r = t13.cy().zoom(), n = this.getPixelRatio(), a = Math.ceil(Dg(r * n)); e = Math.pow(2, a); } var i = t13.pstyle("font-size").pfValue * e, o = t13.pstyle("min-zoomed-font-size").pfValue; return !(i < o); }; Ga.drawElementText = function(t13, e, r, n, a) { var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this; if (n == null) { if (i && !o.eleTextBiggerThanMin(e)) return; } else if (n === false) return; if (e.isNode()) { var s = e.pstyle("label"); if (!s || !s.value) return; var u = o.getLabelJustification(e); t13.textAlign = u, t13.textBaseline = "bottom"; } else { var l = e.element()._private.rscratch.badLine, c = e.pstyle("label"), d = e.pstyle("source-label"), f = e.pstyle("target-label"); if (l || (!c || !c.value) && (!d || !d.value) && (!f || !f.value)) return; t13.textAlign = "center", t13.textBaseline = "bottom"; } var h10 = !r, v; r && (v = r, t13.translate(-v.x1, -v.y1)), a == null ? (o.drawText(t13, e, null, h10, i), e.isEdge() && (o.drawText(t13, e, "source", h10, i), o.drawText(t13, e, "target", h10, i))) : o.drawText(t13, e, a, h10, i), r && t13.translate(v.x1, v.y1); }; Ga.getFontCache = function(t13) { var e; this.fontCaches = this.fontCaches || []; for (var r = 0; r < this.fontCaches.length; r++) if (e = this.fontCaches[r], e.context === t13) return e; return e = { context: t13 }, this.fontCaches.push(e), e; }; Ga.setupTextStyle = function(t13, e) { var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true, n = e.pstyle("font-style").strValue, a = e.pstyle("font-size").pfValue + "px", i = e.pstyle("font-family").strValue, o = e.pstyle("font-weight").strValue, s = r ? e.effectiveOpacity() * e.pstyle("text-opacity").value : 1, u = e.pstyle("text-outline-opacity").value * s, l = e.pstyle("color").value, c = e.pstyle("text-outline-color").value; t13.font = n + " " + o + " " + a + " " + i, t13.lineJoin = "round", this.colorFillStyle(t13, l[0], l[1], l[2], s), this.colorStrokeStyle(t13, c[0], c[1], c[2], u); }; function Vu(t13, e, r, n, a) { var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 5, o = arguments.length > 6 ? arguments[6] : void 0; t13.beginPath(), t13.moveTo(e + i, r), t13.lineTo(e + n - i, r), t13.quadraticCurveTo(e + n, r, e + n, r + i), t13.lineTo(e + n, r + a - i), t13.quadraticCurveTo(e + n, r + a, e + n - i, r + a), t13.lineTo(e + i, r + a), t13.quadraticCurveTo(e, r + a, e, r + a - i), t13.lineTo(e, r + i), t13.quadraticCurveTo(e, r, e + i, r), t13.closePath(), o ? t13.stroke() : t13.fill(); } Ga.getTextAngle = function(t13, e) { var r, n = t13._private, a = n.rscratch, i = e ? e + "-" : "", o = t13.pstyle(i + "text-rotation"), s = Kr(a, "labelAngle", e); return o.strValue === "autorotate" ? r = t13.isEdge() ? s : 0 : o.strValue === "none" ? r = 0 : r = o.pfValue, r; }; Ga.drawText = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = e._private, o = i.rscratch, s = a ? e.effectiveOpacity() : 1; if (!(a && (s === 0 || e.pstyle("text-opacity").value === 0))) { r === "main" && (r = null); var u = Kr(o, "labelX", r), l = Kr(o, "labelY", r), c, d, f = this.getLabelText(e, r); if (f != null && f !== "" && !isNaN(u) && !isNaN(l)) { this.setupTextStyle(t13, e, a); var h10 = r ? r + "-" : "", v = Kr(o, "labelWidth", r), p = Kr(o, "labelHeight", r), g = e.pstyle(h10 + "text-margin-x").pfValue, y = e.pstyle(h10 + "text-margin-y").pfValue, m = e.isEdge(), b = e.pstyle("text-halign").value, w = e.pstyle("text-valign").value; m && (b = "center", w = "center"), u += g, l += y; var x; switch (n ? x = this.getTextAngle(e, r) : x = 0, x !== 0 && (c = u, d = l, t13.translate(c, d), t13.rotate(x), u = 0, l = 0), w) { case "top": break; case "center": l += p / 2; break; case "bottom": l += p; break; } var E = e.pstyle("text-background-opacity").value, C = e.pstyle("text-border-opacity").value, k = e.pstyle("text-border-width").pfValue, S = e.pstyle("text-background-padding").pfValue, _ = e.pstyle("text-background-shape").strValue, T = _.indexOf("round") === 0, O = 2; if (E > 0 || k > 0 && C > 0) { var D = u - S; switch (b) { case "left": D -= v; break; case "center": D -= v / 2; break; } var A = l - p - S, F = v + 2 * S, R = p + 2 * S; if (E > 0) { var M = t13.fillStyle, L = e.pstyle("text-background-color").value; t13.fillStyle = "rgba(" + L[0] + "," + L[1] + "," + L[2] + "," + E * s + ")", T ? Vu(t13, D, A, F, R, O) : t13.fillRect(D, A, F, R), t13.fillStyle = M; } if (k > 0 && C > 0) { var V = t13.strokeStyle, Y = t13.lineWidth, H = e.pstyle("text-border-color").value, K = e.pstyle("text-border-style").value; if (t13.strokeStyle = "rgba(" + H[0] + "," + H[1] + "," + H[2] + "," + C * s + ")", t13.lineWidth = k, t13.setLineDash) switch (K) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash([4, 2]); break; case "double": t13.lineWidth = k / 4, t13.setLineDash([]); break; case "solid": t13.setLineDash([]); break; } if (T ? Vu(t13, D, A, F, R, O, "stroke") : t13.strokeRect(D, A, F, R), K === "double") { var ne = k / 2; T ? Vu(t13, D + ne, A + ne, F - ne * 2, R - ne * 2, O, "stroke") : t13.strokeRect(D + ne, A + ne, F - ne * 2, R - ne * 2); } t13.setLineDash && t13.setLineDash([]), t13.lineWidth = Y, t13.strokeStyle = V; } } var B = 2 * e.pstyle("text-outline-width").pfValue; if (B > 0 && (t13.lineWidth = B), e.pstyle("text-wrap").value === "wrap") { var $ = Kr(o, "labelWrapCachedLines", r), z = Kr(o, "labelLineHeight", r), W = v / 2, Z = this.getLabelJustification(e); switch (Z === "auto" || (b === "left" ? Z === "left" ? u += -v : Z === "center" && (u += -W) : b === "center" ? Z === "left" ? u += -W : Z === "right" && (u += W) : b === "right" && (Z === "center" ? u += W : Z === "right" && (u += v))), w) { case "top": l -= ($.length - 1) * z; break; case "center": case "bottom": l -= ($.length - 1) * z; break; } for (var N = 0; N < $.length; N++) B > 0 && t13.strokeText($[N], u, l), t13.fillText($[N], u, l), l += z; } else B > 0 && t13.strokeText(f, u, l), t13.fillText(f, u, l); x !== 0 && (t13.rotate(-x), t13.translate(-c, -d)); } } }; var Ki = {}; Ki.drawNode = function(t13, e, r) { var n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true, i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : true, o = this, s, u, l = e._private, c = l.rscratch, d = e.position(); if (!(!Ce(d.x) || !Ce(d.y)) && !(i && !e.visible())) { var f = i ? e.effectiveOpacity() : 1, h10 = o.usePaths(), v, p = false, g = e.padding(); s = e.width() + 2 * g, u = e.height() + 2 * g; var y; r && (y = r, t13.translate(-y.x1, -y.y1)); for (var m = e.pstyle("background-image"), b = m.value, w = new Array(b.length), x = new Array(b.length), E = 0, C = 0; C < b.length; C++) { var k = b[C], S = w[C] = k != null && k !== "none"; if (S) { var _ = e.cy().style().getIndexedStyle(e, "background-image-crossorigin", "value", C); E++, x[C] = o.getCachedImage(k, _, function() { l.backgroundTimestamp = Date.now(), e.emitAndNotify("background"); }); } } var T = e.pstyle("background-blacken").value, O = e.pstyle("border-width").pfValue, D = e.pstyle("background-opacity").value * f, A = e.pstyle("border-color").value, F = e.pstyle("border-style").value, R = e.pstyle("border-join").value, M = e.pstyle("border-cap").value, L = e.pstyle("border-position").value, V = e.pstyle("border-dash-pattern").pfValue, Y = e.pstyle("border-dash-offset").pfValue, H = e.pstyle("border-opacity").value * f, K = e.pstyle("outline-width").pfValue, ne = e.pstyle("outline-color").value, B = e.pstyle("outline-style").value, $ = e.pstyle("outline-opacity").value * f, z = e.pstyle("outline-offset").value, W = e.pstyle("corner-radius").value; W !== "auto" && (W = e.pstyle("corner-radius").pfValue); var Z = function() { var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : D; o.eleFillStyle(t13, e, ye); }, N = function() { var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : H; o.colorStrokeStyle(t13, A[0], A[1], A[2], ye); }, X = function() { var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : $; o.colorStrokeStyle(t13, ne[0], ne[1], ne[2], ye); }, Q = function(ye, oe, he, Oe) { var Pe = o.nodePathCache = o.nodePathCache || [], Ae = cS(he === "polygon" ? he + "," + Oe.join(",") : he, "" + oe, "" + ye, "" + W), $e = Pe[Ae], Ie, Le = false; return $e != null ? (Ie = $e, Le = true, c.pathCache = Ie) : (Ie = new Path2D(), Pe[Ae] = c.pathCache = Ie), { path: Ie, cacheHit: Le }; }, ge = e.pstyle("shape").strValue, we = e.pstyle("shape-polygon-points").pfValue; if (h10) { t13.translate(d.x, d.y); var fe = Q(s, u, ge, we); v = fe.path, p = fe.cacheHit; } var ce = function() { if (!p) { var ye = d; h10 && (ye = { x: 0, y: 0 }), o.nodeShapes[o.getNodeShape(e)].draw(v || t13, ye.x, ye.y, s, u, W, c); } h10 ? t13.fill(v) : t13.fill(); }, be = function() { for (var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f, oe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, he = l.backgrounding, Oe = 0, Pe = 0; Pe < x.length; Pe++) { var Ae = e.cy().style().getIndexedStyle(e, "background-image-containment", "value", Pe); if (oe && Ae === "over" || !oe && Ae === "inside") { Oe++; continue; } w[Pe] && x[Pe].complete && !x[Pe].error && (Oe++, o.drawInscribedImage(t13, x[Pe], e, Pe, ye)); } l.backgrounding = Oe !== E, he !== l.backgrounding && e.updateStyle(false); }, ve = function() { var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, oe = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : f; o.hasPie(e) && (o.drawPie(t13, e, oe), ye && (h10 || o.nodeShapes[o.getNodeShape(e)].draw(t13, d.x, d.y, s, u, W, c))); }, xe = function() { var ye = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : f, oe = (T > 0 ? T : -T) * ye, he = T > 0 ? 0 : 255; T !== 0 && (o.colorFillStyle(t13, he, he, he, oe), h10 ? t13.fill(v) : t13.fill()); }, _e = function() { if (O > 0) { if (t13.lineWidth = O, t13.lineCap = M, t13.lineJoin = R, t13.setLineDash) switch (F) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash(V), t13.lineDashOffset = Y; break; case "solid": case "double": t13.setLineDash([]); break; } if (L !== "center") { if (t13.save(), t13.lineWidth *= 2, L === "inside") h10 ? t13.clip(v) : t13.clip(); else { var ye = new Path2D(); ye.rect(-s / 2 - O, -u / 2 - O, s + 2 * O, u + 2 * O), ye.addPath(v), t13.clip(ye, "evenodd"); } h10 ? t13.stroke(v) : t13.stroke(), t13.restore(); } else h10 ? t13.stroke(v) : t13.stroke(); if (F === "double") { t13.lineWidth = O / 3; var oe = t13.globalCompositeOperation; t13.globalCompositeOperation = "destination-out", h10 ? t13.stroke(v) : t13.stroke(), t13.globalCompositeOperation = oe; } t13.setLineDash && t13.setLineDash([]); } }, He = function() { if (K > 0) { if (t13.lineWidth = K, t13.lineCap = "butt", t13.setLineDash) switch (B) { case "dotted": t13.setLineDash([1, 1]); break; case "dashed": t13.setLineDash([4, 2]); break; case "solid": case "double": t13.setLineDash([]); break; } var ye = d; h10 && (ye = { x: 0, y: 0 }); var oe = o.getNodeShape(e), he = O; L === "inside" && (he = 0), L === "outside" && (he *= 2); var Oe = (s + he + (K + z)) / s, Pe = (u + he + (K + z)) / u, Ae = s * Oe, $e = u * Pe, Ie = o.nodeShapes[oe].points, Le; if (h10) { var ut = Q(Ae, $e, oe, Ie); Le = ut.path; } if (oe === "ellipse") o.drawEllipsePath(Le || t13, ye.x, ye.y, Ae, $e); else if (["round-diamond", "round-heptagon", "round-hexagon", "round-octagon", "round-pentagon", "round-polygon", "round-triangle", "round-tag"].includes(oe)) { var nt = 0, kt = 0, _t = 0; oe === "round-diamond" ? nt = (he + z + K) * 1.4 : oe === "round-heptagon" ? (nt = (he + z + K) * 1.075, _t = -(he / 2 + z + K) / 35) : oe === "round-hexagon" ? nt = (he + z + K) * 1.12 : oe === "round-pentagon" ? (nt = (he + z + K) * 1.13, _t = -(he / 2 + z + K) / 15) : oe === "round-tag" ? (nt = (he + z + K) * 1.12, kt = (he / 2 + K + z) * 0.07) : oe === "round-triangle" && (nt = (he + z + K) * (Math.PI / 2), _t = -(he + z / 2 + K) / Math.PI), nt !== 0 && (Oe = (s + nt) / s, Ae = s * Oe, ["round-hexagon", "round-tag"].includes(oe) || (Pe = (u + nt) / u, $e = u * Pe)), W = W === "auto" ? CS(Ae, $e) : W; for (var Ct = Ae / 2, Jt = $e / 2, Pt = W + (he + K + z) / 2, $t = new Array(Ie.length / 2), wr = new Array(Ie.length / 2), Qt = 0; Qt < Ie.length / 2; Qt++) $t[Qt] = { x: ye.x + kt + Ct * Ie[Qt * 2], y: ye.y + _t + Jt * Ie[Qt * 2 + 1] }; var er, kr, Nr, dr, xt = $t.length; for (kr = $t[xt - 1], er = 0; er < xt; er++) Nr = $t[er % xt], dr = $t[(er + 1) % xt], wr[er] = Ug(kr, Nr, dr, Pt), kr = Nr, Nr = dr; o.drawRoundPolygonPath(Le || t13, ye.x + kt, ye.y + _t, s * Oe, u * Pe, Ie, wr); } else if (["roundrectangle", "round-rectangle"].includes(oe)) W = W === "auto" ? Ra(Ae, $e) : W, o.drawRoundRectanglePath(Le || t13, ye.x, ye.y, Ae, $e, W + (he + K + z) / 2); else if (["cutrectangle", "cut-rectangle"].includes(oe)) W = W === "auto" ? Lg() : W, o.drawCutRectanglePath(Le || t13, ye.x, ye.y, Ae, $e, null, W + (he + K + z) / 4); else if (["bottomroundrectangle", "bottom-round-rectangle"].includes(oe)) W = W === "auto" ? Ra(Ae, $e) : W, o.drawBottomRoundRectanglePath(Le || t13, ye.x, ye.y, Ae, $e, W + (he + K + z) / 2); else if (oe === "barrel") o.drawBarrelPath(Le || t13, ye.x, ye.y, Ae, $e); else if (oe.startsWith("polygon") || ["rhomboid", "right-rhomboid", "round-tag", "tag", "vee"].includes(oe)) { var Tt = (he + K + z) / s; Ie = cl(dl(Ie, Tt)), o.drawPolygonPath(Le || t13, ye.x, ye.y, s, u, Ie); } else { var qt = (he + K + z) / s; Ie = cl(dl(Ie, -qt)), o.drawPolygonPath(Le || t13, ye.x, ye.y, s, u, Ie); } if (h10 ? t13.stroke(Le) : t13.stroke(), B === "double") { t13.lineWidth = he / 3; var Fn = t13.globalCompositeOperation; t13.globalCompositeOperation = "destination-out", h10 ? t13.stroke(Le) : t13.stroke(), t13.globalCompositeOperation = Fn; } t13.setLineDash && t13.setLineDash([]); } }, Ve = function() { a && o.drawNodeOverlay(t13, e, d, s, u); }, De = function() { a && o.drawNodeUnderlay(t13, e, d, s, u); }, Ne = function() { o.drawElementText(t13, e, null, n); }, ue = e.pstyle("ghost").value === "yes"; if (ue) { var I = e.pstyle("ghost-offset-x").pfValue, G = e.pstyle("ghost-offset-y").pfValue, se = e.pstyle("ghost-opacity").value, ee = se * f; t13.translate(I, G), X(), He(), Z(se * D), ce(), be(ee, true), N(se * H), _e(), ve(T !== 0 || O !== 0), be(ee, false), xe(ee), t13.translate(-I, -G); } h10 && t13.translate(-d.x, -d.y), De(), h10 && t13.translate(d.x, d.y), X(), He(), Z(), ce(), be(f, true), N(), _e(), ve(T !== 0 || O !== 0), be(f, false), xe(), h10 && t13.translate(-d.x, -d.y), Ne(), Ve(), r && t13.translate(y.x1, y.y1); } }; var Sk = function(e) { if (!["overlay", "underlay"].includes(e)) throw new Error("Invalid state"); return function(r, n, a, i, o) { var s = this; if (n.visible()) { var u = n.pstyle("".concat(e, "-padding")).pfValue, l = n.pstyle("".concat(e, "-opacity")).value, c = n.pstyle("".concat(e, "-color")).value, d = n.pstyle("".concat(e, "-shape")).value, f = n.pstyle("".concat(e, "-corner-radius")).value; if (l > 0) { if (a = a || n.position(), i == null || o == null) { var h10 = n.padding(); i = n.width() + 2 * h10, o = n.height() + 2 * h10; } s.colorFillStyle(r, c[0], c[1], c[2], l), s.nodeShapes[d].draw(r, a.x, a.y, i + u * 2, o + u * 2, f), r.fill(); } } }; }; Ki.drawNodeOverlay = Sk("overlay"); Ki.drawNodeUnderlay = Sk("underlay"); Ki.hasPie = function(t13) { return t13 = t13[0], t13._private.hasPie; }; Ki.drawPie = function(t13, e, r, n) { e = e[0], n = n || e.position(); var a = e.cy().style(), i = e.pstyle("pie-size"), o = n.x, s = n.y, u = e.width(), l = e.height(), c = Math.min(u, l) / 2, d = 0, f = this.usePaths(); f && (o = 0, s = 0), i.units === "%" ? c = c * i.pfValue : i.pfValue !== void 0 && (c = i.pfValue / 2); for (var h10 = 1; h10 <= a.pieBackgroundN; h10++) { var v = e.pstyle("pie-" + h10 + "-background-size").value, p = e.pstyle("pie-" + h10 + "-background-color").value, g = e.pstyle("pie-" + h10 + "-background-opacity").value * r, y = v / 100; y + d > 1 && (y = 1 - d); var m = 1.5 * Math.PI + 2 * Math.PI * d, b = 2 * Math.PI * y, w = m + b; v === 0 || d >= 1 || d + y > 1 || (t13.beginPath(), t13.moveTo(o, s), t13.arc(o, s, c, m, w), t13.closePath(), this.colorFillStyle(t13, p[0], p[1], p[2], g), t13.fill(), d += y); } }; var Sr = {}; var EV = 100; Sr.getPixelRatio = function() { var t13 = this.data.contexts[0]; if (this.forcedPixelRatio != null) return this.forcedPixelRatio; var e = this.cy.window(), r = t13.backingStorePixelRatio || t13.webkitBackingStorePixelRatio || t13.mozBackingStorePixelRatio || t13.msBackingStorePixelRatio || t13.oBackingStorePixelRatio || t13.backingStorePixelRatio || 1; return (e.devicePixelRatio || 1) / r; }; Sr.paintCache = function(t13) { for (var e = this.paintCaches = this.paintCaches || [], r = true, n, a = 0; a < e.length; a++) if (n = e[a], n.context === t13) { r = false; break; } return r && (n = { context: t13 }, e.push(n)), n; }; Sr.createGradientStyleFor = function(t13, e, r, n, a) { var i, o = this.usePaths(), s = r.pstyle(e + "-gradient-stop-colors").value, u = r.pstyle(e + "-gradient-stop-positions").pfValue; if (n === "radial-gradient") if (r.isEdge()) { var l = r.sourceEndpoint(), c = r.targetEndpoint(), d = r.midpoint(), f = Da(l, d), h10 = Da(c, d); i = t13.createRadialGradient(d.x, d.y, 0, d.x, d.y, Math.max(f, h10)); } else { var v = o ? { x: 0, y: 0 } : r.position(), p = r.paddedWidth(), g = r.paddedHeight(); i = t13.createRadialGradient(v.x, v.y, 0, v.x, v.y, Math.max(p, g)); } else if (r.isEdge()) { var y = r.sourceEndpoint(), m = r.targetEndpoint(); i = t13.createLinearGradient(y.x, y.y, m.x, m.y); } else { var b = o ? { x: 0, y: 0 } : r.position(), w = r.paddedWidth(), x = r.paddedHeight(), E = w / 2, C = x / 2, k = r.pstyle("background-gradient-direction").value; switch (k) { case "to-bottom": i = t13.createLinearGradient(b.x, b.y - C, b.x, b.y + C); break; case "to-top": i = t13.createLinearGradient(b.x, b.y + C, b.x, b.y - C); break; case "to-left": i = t13.createLinearGradient(b.x + E, b.y, b.x - E, b.y); break; case "to-right": i = t13.createLinearGradient(b.x - E, b.y, b.x + E, b.y); break; case "to-bottom-right": case "to-right-bottom": i = t13.createLinearGradient(b.x - E, b.y - C, b.x + E, b.y + C); break; case "to-top-right": case "to-right-top": i = t13.createLinearGradient(b.x - E, b.y + C, b.x + E, b.y - C); break; case "to-bottom-left": case "to-left-bottom": i = t13.createLinearGradient(b.x + E, b.y - C, b.x - E, b.y + C); break; case "to-top-left": case "to-left-top": i = t13.createLinearGradient(b.x + E, b.y + C, b.x - E, b.y - C); break; } } if (!i) return null; for (var S = u.length === s.length, _ = s.length, T = 0; T < _; T++) i.addColorStop(S ? u[T] : T / (_ - 1), "rgba(" + s[T][0] + "," + s[T][1] + "," + s[T][2] + "," + a + ")"); return i; }; Sr.gradientFillStyle = function(t13, e, r, n) { var a = this.createGradientStyleFor(t13, "background", e, r, n); if (!a) return null; t13.fillStyle = a; }; Sr.colorFillStyle = function(t13, e, r, n, a) { t13.fillStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")"; }; Sr.eleFillStyle = function(t13, e, r) { var n = e.pstyle("background-fill").value; if (n === "linear-gradient" || n === "radial-gradient") this.gradientFillStyle(t13, e, n, r); else { var a = e.pstyle("background-color").value; this.colorFillStyle(t13, a[0], a[1], a[2], r); } }; Sr.gradientStrokeStyle = function(t13, e, r, n) { var a = this.createGradientStyleFor(t13, "line", e, r, n); if (!a) return null; t13.strokeStyle = a; }; Sr.colorStrokeStyle = function(t13, e, r, n, a) { t13.strokeStyle = "rgba(" + e + "," + r + "," + n + "," + a + ")"; }; Sr.eleStrokeStyle = function(t13, e, r) { var n = e.pstyle("line-fill").value; if (n === "linear-gradient" || n === "radial-gradient") this.gradientStrokeStyle(t13, e, n, r); else { var a = e.pstyle("line-color").value; this.colorStrokeStyle(t13, a[0], a[1], a[2], r); } }; Sr.matchCanvasSize = function(t13) { var e = this, r = e.data, n = e.findContainerClientCoords(), a = n[2], i = n[3], o = e.getPixelRatio(), s = e.motionBlurPxRatio; (t13 === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE] || t13 === e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG]) && (o = s); var u = a * o, l = i * o, c; if (!(u === e.canvasWidth && l === e.canvasHeight)) { e.fontCaches = null; var d = r.canvasContainer; d.style.width = a + "px", d.style.height = i + "px"; for (var f = 0; f < e.CANVAS_LAYERS; f++) c = r.canvases[f], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px"; for (var f = 0; f < e.BUFFER_COUNT; f++) c = r.bufferCanvases[f], c.width = u, c.height = l, c.style.width = a + "px", c.style.height = i + "px"; e.textureMult = 1, o <= 1 && (c = r.bufferCanvases[e.TEXTURE_BUFFER], e.textureMult = 2, c.width = u * e.textureMult, c.height = l * e.textureMult), e.canvasWidth = u, e.canvasHeight = l; } }; Sr.renderTo = function(t13, e, r, n) { this.render({ forcedContext: t13, forcedZoom: e, forcedPan: r, drawAllLayers: true, forcedPxRatio: n }); }; Sr.render = function(t13) { t13 = t13 || hS(); var e = t13.forcedContext, r = t13.drawAllLayers, n = t13.drawOnlyNodeLayer, a = t13.forcedZoom, i = t13.forcedPan, o = this, s = t13.forcedPxRatio === void 0 ? this.getPixelRatio() : t13.forcedPxRatio, u = o.cy, l = o.data, c = l.canvasNeedsRedraw, d = o.textureOnViewport && !e && (o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming), f = t13.motionBlur !== void 0 ? t13.motionBlur : o.motionBlur, h10 = o.motionBlurPxRatio, v = u.hasCompoundNodes(), p = o.hoverData.draggingEles, g = !!(o.hoverData.selecting || o.touchData.selecting); f = f && !e && o.motionBlurEnabled && !g; var y = f; e || (o.prevPxRatio !== s && (o.invalidateContainerClientCoordsCache(), o.matchCanvasSize(o.container), o.redrawHint("eles", true), o.redrawHint("drag", true)), o.prevPxRatio = s), !e && o.motionBlurTimeout && clearTimeout(o.motionBlurTimeout), f && (o.mbFrames == null && (o.mbFrames = 0), o.mbFrames++, o.mbFrames < 3 && (y = false), o.mbFrames > o.minMbLowQualFrames && (o.motionBlurPxRatio = o.mbPxRBlurry)), o.clearingMotionBlur && (o.motionBlurPxRatio = 1), o.textureDrawLastFrame && !d && (c[o.NODE] = true, c[o.SELECT_BOX] = true); var m = u.style(), b = u.zoom(), w = a !== void 0 ? a : b, x = u.pan(), E = { x: x.x, y: x.y }, C = { zoom: b, pan: { x: x.x, y: x.y } }, k = o.prevViewport, S = k === void 0 || C.zoom !== k.zoom || C.pan.x !== k.pan.x || C.pan.y !== k.pan.y; !S && !(p && !v) && (o.motionBlurPxRatio = 1), i && (E = i), w *= s, E.x *= s, E.y *= s; var _ = o.getCachedZSortedEles(); function T(fe, ce, be, ve, xe) { var _e = fe.globalCompositeOperation; fe.globalCompositeOperation = "destination-out", o.colorFillStyle(fe, 255, 255, 255, o.motionBlurTransparency), fe.fillRect(ce, be, ve, xe), fe.globalCompositeOperation = _e; } function O(fe, ce) { var be, ve, xe, _e; !o.clearingMotionBlur && (fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] || fe === l.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG]) ? (be = { x: x.x * h10, y: x.y * h10 }, ve = b * h10, xe = o.canvasWidth * h10, _e = o.canvasHeight * h10) : (be = E, ve = w, xe = o.canvasWidth, _e = o.canvasHeight), fe.setTransform(1, 0, 0, 1, 0, 0), ce === "motionBlur" ? T(fe, 0, 0, xe, _e) : !e && (ce === void 0 || ce) && fe.clearRect(0, 0, xe, _e), r || (fe.translate(be.x, be.y), fe.scale(ve, ve)), i && fe.translate(i.x, i.y), a && fe.scale(a, a); } if (d || (o.textureDrawLastFrame = false), d) { if (o.textureDrawLastFrame = true, !o.textureCache) { o.textureCache = {}, o.textureCache.bb = u.mutableElements().boundingBox(), o.textureCache.texture = o.data.bufferCanvases[o.TEXTURE_BUFFER]; var D = o.data.bufferContexts[o.TEXTURE_BUFFER]; D.setTransform(1, 0, 0, 1, 0, 0), D.clearRect(0, 0, o.canvasWidth * o.textureMult, o.canvasHeight * o.textureMult), o.render({ forcedContext: D, drawOnlyNodeLayer: true, forcedPxRatio: s * o.textureMult }); var C = o.textureCache.viewport = { zoom: u.zoom(), pan: u.pan(), width: o.canvasWidth, height: o.canvasHeight }; C.mpan = { x: (0 - C.pan.x) / C.zoom, y: (0 - C.pan.y) / C.zoom }; } c[o.DRAG] = false, c[o.NODE] = false; var A = l.contexts[o.NODE], F = o.textureCache.texture, C = o.textureCache.viewport; A.setTransform(1, 0, 0, 1, 0, 0), f ? T(A, 0, 0, C.width, C.height) : A.clearRect(0, 0, C.width, C.height); var R = m.core("outside-texture-bg-color").value, M = m.core("outside-texture-bg-opacity").value; o.colorFillStyle(A, R[0], R[1], R[2], M), A.fillRect(0, 0, C.width, C.height); var b = u.zoom(); O(A, false), A.clearRect(C.mpan.x, C.mpan.y, C.width / C.zoom / s, C.height / C.zoom / s), A.drawImage(F, C.mpan.x, C.mpan.y, C.width / C.zoom / s, C.height / C.zoom / s); } else o.textureOnViewport && !e && (o.textureCache = null); var L = u.extent(), V = o.pinching || o.hoverData.dragging || o.swipePanning || o.data.wheelZooming || o.hoverData.draggingEles || o.cy.animated(), Y = o.hideEdgesOnViewport && V, H = []; if (H[o.NODE] = !c[o.NODE] && f && !o.clearedForMotionBlur[o.NODE] || o.clearingMotionBlur, H[o.NODE] && (o.clearedForMotionBlur[o.NODE] = true), H[o.DRAG] = !c[o.DRAG] && f && !o.clearedForMotionBlur[o.DRAG] || o.clearingMotionBlur, H[o.DRAG] && (o.clearedForMotionBlur[o.DRAG] = true), c[o.NODE] || r || n || H[o.NODE]) { var K = f && !H[o.NODE] && h10 !== 1, A = e || (K ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_NODE] : l.contexts[o.NODE]), ne = f && !K ? "motionBlur" : void 0; O(A, ne), Y ? o.drawCachedNodes(A, _.nondrag, s, L) : o.drawLayeredElements(A, _.nondrag, s, L), o.debug && o.drawDebugPoints(A, _.nondrag), !r && !f && (c[o.NODE] = false); } if (!n && (c[o.DRAG] || r || H[o.DRAG])) { var K = f && !H[o.DRAG] && h10 !== 1, A = e || (K ? o.data.bufferContexts[o.MOTIONBLUR_BUFFER_DRAG] : l.contexts[o.DRAG]); O(A, f && !K ? "motionBlur" : void 0), Y ? o.drawCachedNodes(A, _.drag, s, L) : o.drawCachedElements(A, _.drag, s, L), o.debug && o.drawDebugPoints(A, _.drag), !r && !f && (c[o.DRAG] = false); } if (o.showFps || !n && c[o.SELECT_BOX] && !r) { var A = e || l.contexts[o.SELECT_BOX]; if (O(A), o.selection[4] == 1 && (o.hoverData.selecting || o.touchData.selecting)) { var b = o.cy.zoom(), B = m.core("selection-box-border-width").value / b; A.lineWidth = B, A.fillStyle = "rgba(" + m.core("selection-box-color").value[0] + "," + m.core("selection-box-color").value[1] + "," + m.core("selection-box-color").value[2] + "," + m.core("selection-box-opacity").value + ")", A.fillRect(o.selection[0], o.selection[1], o.selection[2] - o.selection[0], o.selection[3] - o.selection[1]), B > 0 && (A.strokeStyle = "rgba(" + m.core("selection-box-border-color").value[0] + "," + m.core("selection-box-border-color").value[1] + "," + m.core("selection-box-border-color").value[2] + "," + m.core("selection-box-opacity").value + ")", A.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 b = o.cy.zoom(), $ = l.bgActivePosistion; A.fillStyle = "rgba(" + m.core("active-bg-color").value[0] + "," + m.core("active-bg-color").value[1] + "," + m.core("active-bg-color").value[2] + "," + m.core("active-bg-opacity").value + ")", A.beginPath(), A.arc($.x, $.y, m.core("active-bg-size").pfValue / b, 0, 2 * Math.PI), A.fill(); } var z = o.lastRedrawTime; if (o.showFps && z) { z = Math.round(z); var W = Math.round(1e3 / z); A.setTransform(1, 0, 0, 1, 0, 0), A.fillStyle = "rgba(255, 0, 0, 0.75)", A.strokeStyle = "rgba(255, 0, 0, 0.75)", A.lineWidth = 1, A.fillText("1 frame = " + z + " ms = " + W + " fps", 0, 20); var Z = 60; A.strokeRect(0, 30, 250, 20), A.fillRect(0, 30, 250 * Math.min(W / Z, 1), 20); } r || (c[o.SELECT_BOX] = false); } if (f && h10 !== 1) { var N = l.contexts[o.NODE], X = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_NODE], Q = l.contexts[o.DRAG], ge = o.data.bufferCanvases[o.MOTIONBLUR_BUFFER_DRAG], we = function(ce, be, ve) { ce.setTransform(1, 0, 0, 1, 0, 0), ve || !y ? ce.clearRect(0, 0, o.canvasWidth, o.canvasHeight) : T(ce, 0, 0, o.canvasWidth, o.canvasHeight); var xe = h10; ce.drawImage( be, // img 0, 0, // sx, sy o.canvasWidth * xe, o.canvasHeight * xe, // sw, sh 0, 0, // x, y o.canvasWidth, o.canvasHeight // w, h ); }; (c[o.NODE] || H[o.NODE]) && (we(N, X, H[o.NODE]), c[o.NODE] = false), (c[o.DRAG] || H[o.DRAG]) && (we(Q, ge, H[o.DRAG]), c[o.DRAG] = false); } o.prevViewport = C, o.clearingMotionBlur && (o.clearingMotionBlur = false, o.motionBlurCleared = true, o.motionBlur = true), f && (o.motionBlurTimeout = setTimeout(function() { o.motionBlurTimeout = null, o.clearedForMotionBlur[o.NODE] = false, o.clearedForMotionBlur[o.DRAG] = false, o.motionBlur = false, o.clearingMotionBlur = !d, o.mbFrames = 0, c[o.NODE] = true, c[o.DRAG] = true, o.redraw(); }, EV)), e || u.emit("render"); }; var ua = {}; ua.drawPolygonPath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2; t13.beginPath && t13.beginPath(), t13.moveTo(e + o * i[0], r + s * i[1]); for (var u = 1; u < i.length / 2; u++) t13.lineTo(e + o * i[u * 2], r + s * i[u * 2 + 1]); t13.closePath(); }; ua.drawRoundPolygonPath = function(t13, e, r, n, a, i, o) { o.forEach(function(s) { return fk(t13, s); }), t13.closePath(); }; ua.drawRoundRectanglePath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2, u = i === "auto" ? Ra(n, a) : Math.min(i, s, o); t13.beginPath && t13.beginPath(), t13.moveTo(e, r - s), t13.arcTo(e + o, r - s, e + o, r, u), t13.arcTo(e + o, r + s, e, r + s, u), t13.arcTo(e - o, r + s, e - o, r, u), t13.arcTo(e - o, r - s, e, r - s, u), t13.lineTo(e, r - s), t13.closePath(); }; ua.drawBottomRoundRectanglePath = function(t13, e, r, n, a, i) { var o = n / 2, s = a / 2, u = i === "auto" ? Ra(n, a) : i; t13.beginPath && t13.beginPath(), t13.moveTo(e, r - s), t13.lineTo(e + o, r - s), t13.lineTo(e + o, r), t13.arcTo(e + o, r + s, e, r + s, u), t13.arcTo(e - o, r + s, e - o, r, u), t13.lineTo(e - o, r - s), t13.lineTo(e, r - s), t13.closePath(); }; ua.drawCutRectanglePath = function(t13, e, r, n, a, i, o) { var s = n / 2, u = a / 2, l = o === "auto" ? Lg() : o; t13.beginPath && t13.beginPath(), t13.moveTo(e - s + l, r - u), t13.lineTo(e + s - l, r - u), t13.lineTo(e + s, r - u + l), t13.lineTo(e + s, r + u - l), t13.lineTo(e + s - l, r + u), t13.lineTo(e - s + l, r + u), t13.lineTo(e - s, r + u - l), t13.lineTo(e - s, r - u + l), t13.closePath(); }; ua.drawBarrelPath = function(t13, e, r, n, a) { var i = n / 2, o = a / 2, s = e - i, u = e + i, l = r - o, c = r + o, d = _p(n, a), f = d.widthOffset, h10 = d.heightOffset, v = d.ctrlPtOffsetPct * f; t13.beginPath && t13.beginPath(), t13.moveTo(s, l + h10), t13.lineTo(s, c - h10), t13.quadraticCurveTo(s + v, c, s + f, c), t13.lineTo(u - f, c), t13.quadraticCurveTo(u - v, c, u, c - h10), t13.lineTo(u, l + h10), t13.quadraticCurveTo(u - v, l, u - f, l), t13.lineTo(s + f, l), t13.quadraticCurveTo(s + v, l, s, l + h10), t13.closePath(); }; var Z0 = Math.sin(0); var X0 = Math.cos(0); var Bp = {}; var $p = {}; var kk = Math.PI / 40; for (ii = 0 * Math.PI; ii < 2 * Math.PI; ii += kk) Bp[ii] = Math.sin(ii), $p[ii] = Math.cos(ii); var ii; ua.drawEllipsePath = function(t13, e, r, n, a) { if (t13.beginPath && t13.beginPath(), t13.ellipse) t13.ellipse(e, r, n / 2, a / 2, 0, 0, 2 * Math.PI); else for (var i, o, s = n / 2, u = a / 2, l = 0 * Math.PI; l < 2 * Math.PI; l += kk) i = e - s * Bp[l] * Z0 + s * $p[l] * X0, o = r + u * $p[l] * Z0 + u * Bp[l] * X0, l === 0 ? t13.moveTo(i, o) : t13.lineTo(i, o); t13.closePath(); }; var us = {}; us.createBuffer = function(t13, e) { var r = document.createElement("canvas"); return r.width = t13, r.height = e, [r, r.getContext("2d")]; }; us.bufferCanvasImage = function(t13) { var e = this.cy, r = e.mutableElements(), n = r.boundingBox(), a = this.findContainerClientCoords(), i = t13.full ? Math.ceil(n.w) : a[2], o = t13.full ? Math.ceil(n.h) : a[3], s = Ce(t13.maxWidth) || Ce(t13.maxHeight), u = this.getPixelRatio(), l = 1; if (t13.scale !== void 0) i *= t13.scale, o *= t13.scale, l = t13.scale; else if (s) { var c = 1 / 0, d = 1 / 0; Ce(t13.maxWidth) && (c = l * t13.maxWidth / i), Ce(t13.maxHeight) && (d = l * t13.maxHeight / o), l = Math.min(c, d), i *= l, o *= l; } s || (i *= u, o *= u, l *= u); var f = document.createElement("canvas"); f.width = i, f.height = o, f.style.width = i + "px", f.style.height = o + "px"; var h10 = f.getContext("2d"); if (i > 0 && o > 0) { h10.clearRect(0, 0, i, o), h10.globalCompositeOperation = "source-over"; var v = this.getCachedZSortedEles(); if (t13.full) h10.translate(-n.x1 * l, -n.y1 * l), h10.scale(l, l), this.drawElements(h10, v), h10.scale(1 / l, 1 / l), h10.translate(n.x1 * l, n.y1 * l); else { var p = e.pan(), g = { x: p.x * l, y: p.y * l }; l *= e.zoom(), h10.translate(g.x, g.y), h10.scale(l, l), this.drawElements(h10, v), h10.scale(1 / l, 1 / l), h10.translate(-g.x, -g.y); } t13.bg && (h10.globalCompositeOperation = "destination-over", h10.fillStyle = t13.bg, h10.rect(0, 0, i, o), h10.fill()); } return f; }; function SV(t13, e) { for (var r = atob(t13), n = new ArrayBuffer(r.length), a = new Uint8Array(n), i = 0; i < r.length; i++) a[i] = r.charCodeAt(i); return new Blob([n], { type: e }); } function J0(t13) { var e = t13.indexOf(","); return t13.substr(e + 1); } function _k(t13, e, r) { var n = function() { return e.toDataURL(r, t13.quality); }; switch (t13.output) { case "blob-promise": return new Mi(function(a, i) { try { e.toBlob(function(o) { o != null ? a(o) : i(new Error("`canvas.toBlob()` sent a null value in its callback")); }, r, t13.quality); } catch (o) { i(o); } }); case "blob": return SV(J0(n()), r); case "base64": return J0(n()); case "base64uri": default: return n(); } } us.png = function(t13) { return _k(t13, this.bufferCanvasImage(t13), "image/png"); }; us.jpg = function(t13) { return _k(t13, this.bufferCanvasImage(t13), "image/jpeg"); }; var Tk = {}; Tk.nodeShapeImpl = function(t13, e, r, n, a, i, o, s) { switch (t13) { case "ellipse": return this.drawEllipsePath(e, r, n, a, i); case "polygon": return this.drawPolygonPath(e, r, n, a, i, o); case "round-polygon": return this.drawRoundPolygonPath(e, r, n, a, i, o, s); case "roundrectangle": case "round-rectangle": return this.drawRoundRectanglePath(e, r, n, a, i, s); case "cutrectangle": case "cut-rectangle": return this.drawCutRectanglePath(e, r, n, a, i, o, s); case "bottomroundrectangle": case "bottom-round-rectangle": return this.drawBottomRoundRectanglePath(e, r, n, a, i, s); case "barrel": return this.drawBarrelPath(e, r, n, a, i); } }; var kV = Ik; var Je = Ik.prototype; Je.CANVAS_LAYERS = 3; Je.SELECT_BOX = 0; Je.DRAG = 1; Je.NODE = 2; Je.BUFFER_COUNT = 3; Je.TEXTURE_BUFFER = 0; Je.MOTIONBLUR_BUFFER_NODE = 1; Je.MOTIONBLUR_BUFFER_DRAG = 2; function Ik(t13) { var e = this, r = e.cy.window(), n = r.document; e.data = { canvases: new Array(Je.CANVAS_LAYERS), contexts: new Array(Je.CANVAS_LAYERS), canvasNeedsRedraw: new Array(Je.CANVAS_LAYERS), bufferCanvases: new Array(Je.BUFFER_COUNT), bufferContexts: new Array(Je.CANVAS_LAYERS) }; var a = "-webkit-tap-highlight-color", i = "rgba(0,0,0,0)"; e.data.canvasContainer = n.createElement("div"); var o = e.data.canvasContainer.style; e.data.canvasContainer.style[a] = i, o.position = "relative", o.zIndex = "0", o.overflow = "hidden"; var s = t13.cy.container(); s.appendChild(e.data.canvasContainer), s.style[a] = i; var u = { "-webkit-user-select": "none", "-moz-user-select": "-moz-none", "user-select": "none", "-webkit-tap-highlight-color": "rgba(0,0,0,0)", "outline-style": "none" }; fB() && (u["-ms-touch-action"] = "none", u["touch-action"] = "none"); for (var l = 0; l < Je.CANVAS_LAYERS; l++) { var c = e.data.canvases[l] = n.createElement("canvas"); e.data.contexts[l] = c.getContext("2d"), Object.keys(u).forEach(function(Z) { c.style[Z] = u[Z]; }), c.style.position = "absolute", c.setAttribute("data-id", "layer" + l), c.style.zIndex = String(Je.CANVAS_LAYERS - l), e.data.canvasContainer.appendChild(c), e.data.canvasNeedsRedraw[l] = false; } e.data.topCanvas = e.data.canvases[0], e.data.canvases[Je.NODE].setAttribute("data-id", "layer" + Je.NODE + "-node"), e.data.canvases[Je.SELECT_BOX].setAttribute("data-id", "layer" + Je.SELECT_BOX + "-selectbox"), e.data.canvases[Je.DRAG].setAttribute("data-id", "layer" + Je.DRAG + "-drag"); for (var l = 0; l < Je.BUFFER_COUNT; l++) e.data.bufferCanvases[l] = n.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 = true; var d = br(), f = function(N) { return { x: (N.x1 + N.x2) / 2, y: (N.y1 + N.y2) / 2 }; }, h10 = function(N) { return { x: -N.w / 2, y: -N.h / 2 }; }, v = function(N) { var X = N[0]._private, Q = X.oldBackgroundTimestamp === X.backgroundTimestamp; return !Q; }, p = function(N) { return N[0]._private.nodeKey; }, g = function(N) { return N[0]._private.labelStyleKey; }, y = function(N) { return N[0]._private.sourceLabelStyleKey; }, m = function(N) { return N[0]._private.targetLabelStyleKey; }, b = function(N, X, Q, ge, we) { return e.drawElement(N, X, Q, false, false, we); }, w = function(N, X, Q, ge, we) { return e.drawElementText(N, X, Q, ge, "main", we); }, x = function(N, X, Q, ge, we) { return e.drawElementText(N, X, Q, ge, "source", we); }, E = function(N, X, Q, ge, we) { return e.drawElementText(N, X, Q, ge, "target", we); }, C = function(N) { return N.boundingBox(), N[0]._private.bodyBounds; }, k = function(N) { return N.boundingBox(), N[0]._private.labelBounds.main || d; }, S = function(N) { return N.boundingBox(), N[0]._private.labelBounds.source || d; }, _ = function(N) { return N.boundingBox(), N[0]._private.labelBounds.target || d; }, T = function(N, X) { return X; }, O = function(N) { return f(C(N)); }, D = function(N, X, Q) { var ge = N ? N + "-" : ""; return { x: X.x + Q.pstyle(ge + "text-margin-x").pfValue, y: X.y + Q.pstyle(ge + "text-margin-y").pfValue }; }, A = function(N, X, Q) { var ge = N[0]._private.rscratch; return { x: ge[X], y: ge[Q] }; }, F = function(N) { return D("", A(N, "labelX", "labelY"), N); }, R = function(N) { return D("source", A(N, "sourceLabelX", "sourceLabelY"), N); }, M = function(N) { return D("target", A(N, "targetLabelX", "targetLabelY"), N); }, L = function(N) { return h10(C(N)); }, V = function(N) { return h10(S(N)); }, Y = function(N) { return h10(_(N)); }, H = function(N) { var X = k(N), Q = h10(k(N)); if (N.isNode()) { switch (N.pstyle("text-halign").value) { case "left": Q.x = -X.w; break; case "right": Q.x = 0; break; } switch (N.pstyle("text-valign").value) { case "top": Q.y = -X.h; break; case "bottom": Q.y = 0; break; } } return Q; }, K = e.data.eleTxrCache = new vo(e, { getKey: p, doesEleInvalidateKey: v, drawElement: b, getBoundingBox: C, getRotationPoint: O, getRotationOffset: L, allowEdgeTxrCaching: false, allowParentTxrCaching: false }), ne = e.data.lblTxrCache = new vo(e, { getKey: g, drawElement: w, getBoundingBox: k, getRotationPoint: F, getRotationOffset: H, isVisible: T }), B = e.data.slbTxrCache = new vo(e, { getKey: y, drawElement: x, getBoundingBox: S, getRotationPoint: R, getRotationOffset: V, isVisible: T }), $ = e.data.tlbTxrCache = new vo(e, { getKey: m, drawElement: E, getBoundingBox: _, getRotationPoint: M, getRotationOffset: Y, isVisible: T }), z = e.data.lyrTxrCache = new Ck(e); e.onUpdateEleCalcs(function(N, X) { K.invalidateElements(X), ne.invalidateElements(X), B.invalidateElements(X), $.invalidateElements(X), z.invalidateElements(X); for (var Q = 0; Q < X.length; Q++) { var ge = X[Q]._private; ge.oldBackgroundTimestamp = ge.backgroundTimestamp; } }); var W = function(N) { for (var X = 0; X < N.length; X++) z.enqueueElementRefinement(N[X].ele); }; K.onDequeue(W), ne.onDequeue(W), B.onDequeue(W), $.onDequeue(W); } Je.redrawHint = function(t13, e) { var r = this; switch (t13) { case "eles": r.data.canvasNeedsRedraw[Je.NODE] = e; break; case "drag": r.data.canvasNeedsRedraw[Je.DRAG] = e; break; case "select": r.data.canvasNeedsRedraw[Je.SELECT_BOX] = e; break; } }; var _V = typeof Path2D < "u"; Je.path2dEnabled = function(t13) { if (t13 === void 0) return this.pathsEnabled; this.pathsEnabled = !!t13; }; Je.usePaths = function() { return _V && this.pathsEnabled; }; Je.setImgSmoothing = function(t13, e) { t13.imageSmoothingEnabled != null ? t13.imageSmoothingEnabled = e : (t13.webkitImageSmoothingEnabled = e, t13.mozImageSmoothingEnabled = e, t13.msImageSmoothingEnabled = e); }; Je.getImgSmoothing = function(t13) { return t13.imageSmoothingEnabled != null ? t13.imageSmoothingEnabled : t13.webkitImageSmoothingEnabled || t13.mozImageSmoothingEnabled || t13.msImageSmoothingEnabled; }; Je.makeOffscreenCanvas = function(t13, e) { var r; if ((typeof OffscreenCanvas > "u" ? "undefined" : Nt(OffscreenCanvas)) !== "undefined") r = new OffscreenCanvas(t13, e); else { var n = this.cy.window(), a = n.document; r = a.createElement("canvas"), r.width = t13, r.height = e; } return r; }; [xk, vn, Dn, jg, Ga, Ki, Sr, ua, us, Tk].forEach(function(t13) { ze(Je, t13); }); var TV = [{ name: "null", impl: uk }, { name: "base", impl: bk }, { name: "canvas", impl: kV }]; var IV = [{ type: "layout", extensions: L8 }, { type: "renderer", extensions: TV }]; var Ok = {}; var Ak = {}; function Pk(t13, e, r) { var n = r, a = function(k) { tt("Can not register `" + e + "` for `" + t13 + "` since `" + k + "` already exists in the prototype and can not be overridden"); }; if (t13 === "core") { if (zo.prototype[e]) return a(e); zo.prototype[e] = r; } else if (t13 === "collection") { if (Yt.prototype[e]) return a(e); Yt.prototype[e] = r; } else if (t13 === "layout") { for (var i = function(k) { this.options = k, r.call(this, k), Xe(this._private) || (this._private = {}), this._private.cy = k.cy, this._private.listeners = [], this.createEmitter(); }, o = i.prototype = Object.create(r.prototype), s = [], u = 0; u < s.length; u++) { var l = s[u]; 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 c = r.prototype.stop; o.stop = function() { var C = this.options; if (C && C.animate) { var k = this.animations; if (k) for (var S = 0; S < k.length; S++) k[S].stop(); } return c ? c.call(this) : this.emit("layoutstop"), this; }, o.destroy || (o.destroy = function() { return this; }), o.cy = function() { return this._private.cy; }; var d = function(k) { return k._private.cy; }, f = { addEventFields: function(k, S) { S.layout = k, S.cy = d(k), S.target = k; }, bubble: function() { return true; }, parent: function(k) { return d(k); } }; ze(o, { createEmitter: function() { return this._private.emitter = new Hl(f, this), this; }, emitter: function() { return this._private.emitter; }, on: function(k, S) { return this.emitter().on(k, S), this; }, one: function(k, S) { return this.emitter().one(k, S), this; }, once: function(k, S) { return this.emitter().one(k, S), this; }, removeListener: function(k, S) { return this.emitter().removeListener(k, S), this; }, removeAllListeners: function() { return this.emitter().removeAllListeners(), this; }, emit: function(k, S) { return this.emitter().emit(k, S), this; } }), et.eventAliasesOn(o), n = i; } else if (t13 === "renderer" && e !== "null" && e !== "base") { var h10 = Dk("renderer", "base"), v = h10.prototype, p = r, g = r.prototype, y = function() { h10.apply(this, arguments), p.apply(this, arguments); }, m = y.prototype; for (var b in v) { var w = v[b], x = g[b] != null; if (x) return a(b); m[b] = w; } for (var E in g) m[E] = g[E]; v.clientFunctions.forEach(function(C) { m[C] = m[C] || function() { bt("Renderer does not implement `renderer." + C + "()` on its prototype"); }; }), n = y; } else if (t13 === "__proto__" || t13 === "constructor" || t13 === "prototype") return bt(t13 + " is an illegal type to be registered, possibly lead to prototype pollutions"); return nS({ map: Ok, keys: [t13, e], value: n }); } function Dk(t13, e) { return aS({ map: Ok, keys: [t13, e] }); } function OV(t13, e, r, n, a) { return nS({ map: Ak, keys: [t13, e, r, n], value: a }); } function AV(t13, e, r, n) { return aS({ map: Ak, keys: [t13, e, r, n] }); } var qp = function() { if (arguments.length === 2) return Dk.apply(null, arguments); if (arguments.length === 3) return Pk.apply(null, arguments); if (arguments.length === 4) return AV.apply(null, arguments); if (arguments.length === 5) return OV.apply(null, arguments); bt("Invalid extension access syntax"); }; zo.prototype.extension = qp; IV.forEach(function(t13) { t13.extensions.forEach(function(e) { Pk(t13.type, e.name, e.impl); }); }); var Rk = function t12() { if (!(this instanceof t12)) return new t12(); this.length = 0; }; var Ma = Rk.prototype; Ma.instanceString = function() { return "stylesheet"; }; Ma.selector = function(t13) { var e = this.length++; return this[e] = { selector: t13, properties: [] }, this; }; Ma.css = function(t13, e) { var r = this.length - 1; if (Me(t13)) this[r].properties.push({ name: t13, value: e }); else if (Xe(t13)) for (var n = t13, a = Object.keys(n), i = 0; i < a.length; i++) { var o = a[i], s = n[o]; if (s != null) { var u = ar.properties[o] || ar.properties[Rl(o)]; if (u != null) { var l = u.name, c = s; this[r].properties.push({ name: l, value: c }); } } } return this; }; Ma.style = Ma.css; Ma.generateStyle = function(t13) { var e = new ar(t13); return this.appendToStyle(e); }; Ma.appendToStyle = function(t13) { for (var e = 0; e < this.length; e++) { var r = this[e], n = r.selector, a = r.properties; t13.selector(n); for (var i = 0; i < a.length; i++) { var o = a[i]; t13.css(o.name, o.value); } } return t13; }; var PV = "3.30.2"; var ia = function(e) { if (e === void 0 && (e = {}), Xe(e)) return new zo(e); if (Me(e)) return qp.apply(qp, arguments); }; ia.use = function(t13) { var e = Array.prototype.slice.call(arguments, 1); return e.unshift(ia), t13.apply(null, e), this; }; ia.warnings = function(t13) { return fS(t13); }; ia.version = PV; ia.stylesheet = ia.Stylesheet = Rk; var Lk = { exports: {} }; function Yg(t13) { throw new Error('Could not dynamically require "' + t13 + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); } var Hu; var Q0; function DV() { if (Q0) return Hu; Q0 = 1; function t13() { this.__data__ = [], this.size = 0; } return Hu = t13, Hu; } var Ku; var eb; function Gi() { if (eb) return Ku; eb = 1; function t13(e, r) { return e === r || e !== e && r !== r; } return Ku = t13, Ku; } var Gu; var tb; function Xl() { if (tb) return Gu; tb = 1; var t13 = Gi(); function e(r, n) { for (var a = r.length; a--; ) if (t13(r[a][0], n)) return a; return -1; } return Gu = e, Gu; } var Uu; var rb; function RV() { if (rb) return Uu; rb = 1; var t13 = Xl(), e = Array.prototype, r = e.splice; function n(a) { var i = this.__data__, o = t13(i, a); if (o < 0) return false; var s = i.length - 1; return o == s ? i.pop() : r.call(i, o, 1), --this.size, true; } return Uu = n, Uu; } var Wu; var nb; function LV() { if (nb) return Wu; nb = 1; var t13 = Xl(); function e(r) { var n = this.__data__, a = t13(n, r); return a < 0 ? void 0 : n[a][1]; } return Wu = e, Wu; } var ju; var ab; function FV() { if (ab) return ju; ab = 1; var t13 = Xl(); function e(r) { return t13(this.__data__, r) > -1; } return ju = e, ju; } var Yu; var ib; function MV() { if (ib) return Yu; ib = 1; var t13 = Xl(); function e(r, n) { var a = this.__data__, i = t13(a, r); return i < 0 ? (++this.size, a.push([r, n])) : a[i][1] = n, this; } return Yu = e, Yu; } var Zu; var ob; function Jl() { if (ob) return Zu; ob = 1; var t13 = DV(), e = RV(), r = LV(), n = FV(), a = MV(); function i(o) { var s = -1, u = o == null ? 0 : o.length; for (this.clear(); ++s < u; ) { var l = o[s]; this.set(l[0], l[1]); } } return i.prototype.clear = t13, i.prototype.delete = e, i.prototype.get = r, i.prototype.has = n, i.prototype.set = a, Zu = i, Zu; } var Xu; var sb; function NV() { if (sb) return Xu; sb = 1; var t13 = Jl(); function e() { this.__data__ = new t13(), this.size = 0; } return Xu = e, Xu; } var Ju; var lb; function BV() { if (lb) return Ju; lb = 1; function t13(e) { var r = this.__data__, n = r.delete(e); return this.size = r.size, n; } return Ju = t13, Ju; } var Qu; var ub; function $V() { if (ub) return Qu; ub = 1; function t13(e) { return this.__data__.get(e); } return Qu = t13, Qu; } var ec; var cb; function qV() { if (cb) return ec; cb = 1; function t13(e) { return this.__data__.has(e); } return ec = t13, ec; } var tc; var db; function Fk() { if (db) return tc; db = 1; var t13 = typeof oo == "object" && oo && oo.Object === Object && oo; return tc = t13, tc; } var rc; var fb; function Jr() { if (fb) return rc; fb = 1; var t13 = Fk(), e = typeof self == "object" && self && self.Object === Object && self, r = t13 || e || Function("return this")(); return rc = r, rc; } var nc; var vb; function Ui() { if (vb) return nc; vb = 1; var t13 = Jr(), e = t13.Symbol; return nc = e, nc; } var ac; var hb; function zV() { if (hb) return ac; hb = 1; var t13 = Ui(), e = Object.prototype, r = e.hasOwnProperty, n = e.toString, a = t13 ? t13.toStringTag : void 0; function i(o) { var s = r.call(o, a), u = o[a]; try { o[a] = void 0; var l = true; } catch { } var c = n.call(o); return l && (s ? o[a] = u : delete o[a]), c; } return ac = i, ac; } var ic; var pb; function VV() { if (pb) return ic; pb = 1; var t13 = Object.prototype, e = t13.toString; function r(n) { return e.call(n); } return ic = r, ic; } var oc; var gb; function Ua() { if (gb) return oc; gb = 1; var t13 = Ui(), e = zV(), r = VV(), n = "[object Null]", a = "[object Undefined]", i = t13 ? t13.toStringTag : void 0; function o(s) { return s == null ? s === void 0 ? a : n : i && i in Object(s) ? e(s) : r(s); } return oc = o, oc; } var sc; var yb; function Fr() { if (yb) return sc; yb = 1; function t13(e) { var r = typeof e; return e != null && (r == "object" || r == "function"); } return sc = t13, sc; } var lc; var mb; function cs() { if (mb) return lc; mb = 1; var t13 = Ua(), e = Fr(), r = "[object AsyncFunction]", n = "[object Function]", a = "[object GeneratorFunction]", i = "[object Proxy]"; function o(s) { if (!e(s)) return false; var u = t13(s); return u == n || u == a || u == r || u == i; } return lc = o, lc; } var uc; var bb; function HV() { if (bb) return uc; bb = 1; var t13 = Jr(), e = t13["__core-js_shared__"]; return uc = e, uc; } var cc; var wb; function KV() { if (wb) return cc; wb = 1; var t13 = HV(), e = function() { var n = /[^.]+$/.exec(t13 && t13.keys && t13.keys.IE_PROTO || ""); return n ? "Symbol(src)_1." + n : ""; }(); function r(n) { return !!e && e in n; } return cc = r, cc; } var dc; var Cb; function Mk() { if (Cb) return dc; Cb = 1; var t13 = Function.prototype, e = t13.toString; function r(n) { if (n != null) { try { return e.call(n); } catch { } try { return n + ""; } catch { } } return ""; } return dc = r, dc; } var fc; var xb; function GV() { if (xb) return fc; xb = 1; var t13 = cs(), e = KV(), r = Fr(), n = Mk(), a = /[\\^$.*+?()[\]{}|]/g, i = /^\[object .+?Constructor\]$/, o = Function.prototype, s = Object.prototype, u = o.toString, l = s.hasOwnProperty, c = RegExp( "^" + u.call(l).replace(a, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" ); function d(f) { if (!r(f) || e(f)) return false; var h10 = t13(f) ? c : i; return h10.test(n(f)); } return fc = d, fc; } var vc; var Eb; function UV() { if (Eb) return vc; Eb = 1; function t13(e, r) { return e == null ? void 0 : e[r]; } return vc = t13, vc; } var hc; var Sb; function Wa() { if (Sb) return hc; Sb = 1; var t13 = GV(), e = UV(); function r(n, a) { var i = e(n, a); return t13(i) ? i : void 0; } return hc = r, hc; } var pc; var kb; function Zg() { if (kb) return pc; kb = 1; var t13 = Wa(), e = Jr(), r = t13(e, "Map"); return pc = r, pc; } var gc; var _b; function Ql() { if (_b) return gc; _b = 1; var t13 = Wa(), e = t13(Object, "create"); return gc = e, gc; } var yc; var Tb; function WV() { if (Tb) return yc; Tb = 1; var t13 = Ql(); function e() { this.__data__ = t13 ? t13(null) : {}, this.size = 0; } return yc = e, yc; } var mc; var Ib; function jV() { if (Ib) return mc; Ib = 1; function t13(e) { var r = this.has(e) && delete this.__data__[e]; return this.size -= r ? 1 : 0, r; } return mc = t13, mc; } var bc; var Ob; function YV() { if (Ob) return bc; Ob = 1; var t13 = Ql(), e = "__lodash_hash_undefined__", r = Object.prototype, n = r.hasOwnProperty; function a(i) { var o = this.__data__; if (t13) { var s = o[i]; return s === e ? void 0 : s; } return n.call(o, i) ? o[i] : void 0; } return bc = a, bc; } var wc; var Ab; function ZV() { if (Ab) return wc; Ab = 1; var t13 = Ql(), e = Object.prototype, r = e.hasOwnProperty; function n(a) { var i = this.__data__; return t13 ? i[a] !== void 0 : r.call(i, a); } return wc = n, wc; } var Cc; var Pb; function XV() { if (Pb) return Cc; Pb = 1; var t13 = Ql(), e = "__lodash_hash_undefined__"; function r(n, a) { var i = this.__data__; return this.size += this.has(n) ? 0 : 1, i[n] = t13 && a === void 0 ? e : a, this; } return Cc = r, Cc; } var xc; var Db; function JV() { if (Db) return xc; Db = 1; var t13 = WV(), e = jV(), r = YV(), n = ZV(), a = XV(); function i(o) { var s = -1, u = o == null ? 0 : o.length; for (this.clear(); ++s < u; ) { var l = o[s]; this.set(l[0], l[1]); } } return i.prototype.clear = t13, i.prototype.delete = e, i.prototype.get = r, i.prototype.has = n, i.prototype.set = a, xc = i, xc; } var Ec; var Rb; function QV() { if (Rb) return Ec; Rb = 1; var t13 = JV(), e = Jl(), r = Zg(); function n() { this.size = 0, this.__data__ = { hash: new t13(), map: new (r || e)(), string: new t13() }; } return Ec = n, Ec; } var Sc; var Lb; function e6() { if (Lb) return Sc; Lb = 1; function t13(e) { var r = typeof e; return r == "string" || r == "number" || r == "symbol" || r == "boolean" ? e !== "__proto__" : e === null; } return Sc = t13, Sc; } var kc; var Fb; function eu() { if (Fb) return kc; Fb = 1; var t13 = e6(); function e(r, n) { var a = r.__data__; return t13(n) ? a[typeof n == "string" ? "string" : "hash"] : a.map; } return kc = e, kc; } var _c; var Mb; function t62() { if (Mb) return _c; Mb = 1; var t13 = eu(); function e(r) { var n = t13(this, r).delete(r); return this.size -= n ? 1 : 0, n; } return _c = e, _c; } var Tc; var Nb; function r6() { if (Nb) return Tc; Nb = 1; var t13 = eu(); function e(r) { return t13(this, r).get(r); } return Tc = e, Tc; } var Ic; var Bb; function n6() { if (Bb) return Ic; Bb = 1; var t13 = eu(); function e(r) { return t13(this, r).has(r); } return Ic = e, Ic; } var Oc; var $b; function a6() { if ($b) return Oc; $b = 1; var t13 = eu(); function e(r, n) { var a = t13(this, r), i = a.size; return a.set(r, n), this.size += a.size == i ? 0 : 1, this; } return Oc = e, Oc; } var Ac; var qb; function Xg() { if (qb) return Ac; qb = 1; var t13 = QV(), e = t62(), r = r6(), n = n6(), a = a6(); function i(o) { var s = -1, u = o == null ? 0 : o.length; for (this.clear(); ++s < u; ) { var l = o[s]; this.set(l[0], l[1]); } } return i.prototype.clear = t13, i.prototype.delete = e, i.prototype.get = r, i.prototype.has = n, i.prototype.set = a, Ac = i, Ac; } var Pc; var zb; function i6() { if (zb) return Pc; zb = 1; var t13 = Jl(), e = Zg(), r = Xg(), n = 200; function a(i, o) { var s = this.__data__; if (s instanceof t13) { var u = s.__data__; if (!e || u.length < n - 1) return u.push([i, o]), this.size = ++s.size, this; s = this.__data__ = new r(u); } return s.set(i, o), this.size = s.size, this; } return Pc = a, Pc; } var Dc; var Vb; function tu() { if (Vb) return Dc; Vb = 1; var t13 = Jl(), e = NV(), r = BV(), n = $V(), a = qV(), i = i6(); function o(s) { var u = this.__data__ = new t13(s); this.size = u.size; } return o.prototype.clear = e, o.prototype.delete = r, o.prototype.get = n, o.prototype.has = a, o.prototype.set = i, Dc = o, Dc; } var Rc; var Hb; function Jg() { if (Hb) return Rc; Hb = 1; function t13(e, r) { for (var n = -1, a = e == null ? 0 : e.length; ++n < a && r(e[n], n, e) !== false; ) ; return e; } return Rc = t13, Rc; } var Lc; var Kb; function Nk() { if (Kb) return Lc; Kb = 1; var t13 = Wa(), e = function() { try { var r = t13(Object, "defineProperty"); return r({}, "", {}), r; } catch { } }(); return Lc = e, Lc; } var Fc; var Gb; function ru() { if (Gb) return Fc; Gb = 1; var t13 = Nk(); function e(r, n, a) { n == "__proto__" && t13 ? t13(r, n, { configurable: true, enumerable: true, value: a, writable: true }) : r[n] = a; } return Fc = e, Fc; } var Mc; var Ub; function nu() { if (Ub) return Mc; Ub = 1; var t13 = ru(), e = Gi(), r = Object.prototype, n = r.hasOwnProperty; function a(i, o, s) { var u = i[o]; (!(n.call(i, o) && e(u, s)) || s === void 0 && !(o in i)) && t13(i, o, s); } return Mc = a, Mc; } var Nc; var Wb; function ds() { if (Wb) return Nc; Wb = 1; var t13 = nu(), e = ru(); function r(n, a, i, o) { var s = !i; i || (i = {}); for (var u = -1, l = a.length; ++u < l; ) { var c = a[u], d = o ? o(i[c], n[c], c, i, n) : void 0; d === void 0 && (d = n[c]), s ? e(i, c, d) : t13(i, c, d); } return i; } return Nc = r, Nc; } var Bc; var jb; function o6() { if (jb) return Bc; jb = 1; function t13(e, r) { for (var n = -1, a = Array(e); ++n < e; ) a[n] = r(n); return a; } return Bc = t13, Bc; } var $c; var Yb; function hn() { if (Yb) return $c; Yb = 1; function t13(e) { return e != null && typeof e == "object"; } return $c = t13, $c; } var qc; var Zb; function s6() { if (Zb) return qc; Zb = 1; var t13 = Ua(), e = hn(), r = "[object Arguments]"; function n(a) { return e(a) && t13(a) == r; } return qc = n, qc; } var zc; var Xb; function fs() { if (Xb) return zc; Xb = 1; var t13 = s6(), e = hn(), r = Object.prototype, n = r.hasOwnProperty, a = r.propertyIsEnumerable, i = t13(/* @__PURE__ */ function() { return arguments; }()) ? t13 : function(o) { return e(o) && n.call(o, "callee") && !a.call(o, "callee"); }; return zc = i, zc; } var Vc; var Jb; function At() { if (Jb) return Vc; Jb = 1; var t13 = Array.isArray; return Vc = t13, Vc; } var ho = { exports: {} }; var Hc; var Qb; function l6() { if (Qb) return Hc; Qb = 1; function t13() { return false; } return Hc = t13, Hc; } ho.exports; var e1; function Wi() { return e1 || (e1 = 1, function(t13, e) { var r = Jr(), n = l6(), a = e && !e.nodeType && e, i = a && true && t13 && !t13.nodeType && t13, o = i && i.exports === a, s = o ? r.Buffer : void 0, u = s ? s.isBuffer : void 0, l = u || n; t13.exports = l; }(ho, ho.exports)), ho.exports; } var Kc; var t1; function au() { if (t1) return Kc; t1 = 1; var t13 = 9007199254740991, e = /^(?:0|[1-9]\d*)$/; function r(n, a) { var i = typeof n; return a = a ?? t13, !!a && (i == "number" || i != "symbol" && e.test(n)) && n > -1 && n % 1 == 0 && n < a; } return Kc = r, Kc; } var Gc; var r1; function Qg() { if (r1) return Gc; r1 = 1; var t13 = 9007199254740991; function e(r) { return typeof r == "number" && r > -1 && r % 1 == 0 && r <= t13; } return Gc = e, Gc; } var Uc; var n1; function u6() { if (n1) return Uc; n1 = 1; var t13 = Ua(), e = Qg(), r = hn(), n = "[object Arguments]", a = "[object Array]", i = "[object Boolean]", o = "[object Date]", s = "[object Error]", u = "[object Function]", l = "[object Map]", c = "[object Number]", d = "[object Object]", f = "[object RegExp]", h10 = "[object Set]", v = "[object String]", p = "[object WeakMap]", g = "[object ArrayBuffer]", y = "[object DataView]", m = "[object Float32Array]", b = "[object Float64Array]", w = "[object Int8Array]", x = "[object Int16Array]", E = "[object Int32Array]", C = "[object Uint8Array]", k = "[object Uint8ClampedArray]", S = "[object Uint16Array]", _ = "[object Uint32Array]", T = {}; T[m] = T[b] = T[w] = T[x] = T[E] = T[C] = T[k] = T[S] = T[_] = true, T[n] = T[a] = T[g] = T[i] = T[y] = T[o] = T[s] = T[u] = T[l] = T[c] = T[d] = T[f] = T[h10] = T[v] = T[p] = false; function O(D) { return r(D) && e(D.length) && !!T[t13(D)]; } return Uc = O, Uc; } var Wc; var a1; function iu() { if (a1) return Wc; a1 = 1; function t13(e) { return function(r) { return e(r); }; } return Wc = t13, Wc; } var po = { exports: {} }; po.exports; var i1; function ey() { return i1 || (i1 = 1, function(t13, e) { var r = Fk(), n = e && !e.nodeType && e, a = n && true && t13 && !t13.nodeType && t13, i = a && a.exports === n, o = i && r.process, s = function() { try { var u = a && a.require && a.require("util").types; return u || o && o.binding && o.binding("util"); } catch { } }(); t13.exports = s; }(po, po.exports)), po.exports; } var jc; var o1; function vs() { if (o1) return jc; o1 = 1; var t13 = u6(), e = iu(), r = ey(), n = r && r.isTypedArray, a = n ? e(n) : t13; return jc = a, jc; } var Yc; var s1; function Bk() { if (s1) return Yc; s1 = 1; var t13 = o6(), e = fs(), r = At(), n = Wi(), a = au(), i = vs(), o = Object.prototype, s = o.hasOwnProperty; function u(l, c) { var d = r(l), f = !d && e(l), h10 = !d && !f && n(l), v = !d && !f && !h10 && i(l), p = d || f || h10 || v, g = p ? t13(l.length, String) : [], y = g.length; for (var m in l) (c || s.call(l, m)) && !(p && // Safari 9 has enumerable `arguments.length` in strict mode. (m == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. h10 && (m == "offset" || m == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. v && (m == "buffer" || m == "byteLength" || m == "byteOffset") || // Skip index properties. a(m, y))) && g.push(m); return g; } return Yc = u, Yc; } var Zc; var l1; function ou() { if (l1) return Zc; l1 = 1; var t13 = Object.prototype; function e(r) { var n = r && r.constructor, a = typeof n == "function" && n.prototype || t13; return r === a; } return Zc = e, Zc; } var Xc; var u1; function $k() { if (u1) return Xc; u1 = 1; function t13(e, r) { return function(n) { return e(r(n)); }; } return Xc = t13, Xc; } var Jc; var c1; function c6() { if (c1) return Jc; c1 = 1; var t13 = $k(), e = t13(Object.keys, Object); return Jc = e, Jc; } var Qc; var d1; function ty() { if (d1) return Qc; d1 = 1; var t13 = ou(), e = c6(), r = Object.prototype, n = r.hasOwnProperty; function a(i) { if (!t13(i)) return e(i); var o = []; for (var s in Object(i)) n.call(i, s) && s != "constructor" && o.push(s); return o; } return Qc = a, Qc; } var ed; var f1; function Rn() { if (f1) return ed; f1 = 1; var t13 = cs(), e = Qg(); function r(n) { return n != null && e(n.length) && !t13(n); } return ed = r, ed; } var td; var v1; function ca() { if (v1) return td; v1 = 1; var t13 = Bk(), e = ty(), r = Rn(); function n(a) { return r(a) ? t13(a) : e(a); } return td = n, td; } var rd; var h1; function d6() { if (h1) return rd; h1 = 1; var t13 = ds(), e = ca(); function r(n, a) { return n && t13(a, e(a), n); } return rd = r, rd; } var nd; var p1; function f6() { if (p1) return nd; p1 = 1; function t13(e) { var r = []; if (e != null) for (var n in Object(e)) r.push(n); return r; } return nd = t13, nd; } var ad; var g1; function v6() { if (g1) return ad; g1 = 1; var t13 = Fr(), e = ou(), r = f6(), n = Object.prototype, a = n.hasOwnProperty; function i(o) { if (!t13(o)) return r(o); var s = e(o), u = []; for (var l in o) l == "constructor" && (s || !a.call(o, l)) || u.push(l); return u; } return ad = i, ad; } var id; var y1; function ja() { if (y1) return id; y1 = 1; var t13 = Bk(), e = v6(), r = Rn(); function n(a) { return r(a) ? t13(a, true) : e(a); } return id = n, id; } var od; var m1; function h6() { if (m1) return od; m1 = 1; var t13 = ds(), e = ja(); function r(n, a) { return n && t13(a, e(a), n); } return od = r, od; } var go = { exports: {} }; go.exports; var b1; function qk() { return b1 || (b1 = 1, function(t13, e) { var r = Jr(), n = e && !e.nodeType && e, a = n && true && t13 && !t13.nodeType && t13, i = a && a.exports === n, o = i ? r.Buffer : void 0, s = o ? o.allocUnsafe : void 0; function u(l, c) { if (c) return l.slice(); var d = l.length, f = s ? s(d) : new l.constructor(d); return l.copy(f), f; } t13.exports = u; }(go, go.exports)), go.exports; } var sd; var w1; function zk() { if (w1) return sd; w1 = 1; function t13(e, r) { var n = -1, a = e.length; for (r || (r = Array(a)); ++n < a; ) r[n] = e[n]; return r; } return sd = t13, sd; } var ld; var C1; function Vk() { if (C1) return ld; C1 = 1; function t13(e, r) { for (var n = -1, a = e == null ? 0 : e.length, i = 0, o = []; ++n < a; ) { var s = e[n]; r(s, n, e) && (o[i++] = s); } return o; } return ld = t13, ld; } var ud; var x1; function Hk() { if (x1) return ud; x1 = 1; function t13() { return []; } return ud = t13, ud; } var cd; var E1; function ry() { if (E1) return cd; E1 = 1; var t13 = Vk(), e = Hk(), r = Object.prototype, n = r.propertyIsEnumerable, a = Object.getOwnPropertySymbols, i = a ? function(o) { return o == null ? [] : (o = Object(o), t13(a(o), function(s) { return n.call(o, s); })); } : e; return cd = i, cd; } var dd; var S1; function p6() { if (S1) return dd; S1 = 1; var t13 = ds(), e = ry(); function r(n, a) { return t13(n, e(n), a); } return dd = r, dd; } var fd; var k1; function ny() { if (k1) return fd; k1 = 1; function t13(e, r) { for (var n = -1, a = r.length, i = e.length; ++n < a; ) e[i + n] = r[n]; return e; } return fd = t13, fd; } var vd; var _1; function su() { if (_1) return vd; _1 = 1; var t13 = $k(), e = t13(Object.getPrototypeOf, Object); return vd = e, vd; } var hd; var T1; function Kk() { if (T1) return hd; T1 = 1; var t13 = ny(), e = su(), r = ry(), n = Hk(), a = Object.getOwnPropertySymbols, i = a ? function(o) { for (var s = []; o; ) t13(s, r(o)), o = e(o); return s; } : n; return hd = i, hd; } var pd; var I1; function g6() { if (I1) return pd; I1 = 1; var t13 = ds(), e = Kk(); function r(n, a) { return t13(n, e(n), a); } return pd = r, pd; } var gd; var O1; function Gk() { if (O1) return gd; O1 = 1; var t13 = ny(), e = At(); function r(n, a, i) { var o = a(n); return e(n) ? o : t13(o, i(n)); } return gd = r, gd; } var yd; var A1; function Uk() { if (A1) return yd; A1 = 1; var t13 = Gk(), e = ry(), r = ca(); function n(a) { return t13(a, r, e); } return yd = n, yd; } var md; var P1; function y6() { if (P1) return md; P1 = 1; var t13 = Gk(), e = Kk(), r = ja(); function n(a) { return t13(a, r, e); } return md = n, md; } var bd; var D1; function m6() { if (D1) return bd; D1 = 1; var t13 = Wa(), e = Jr(), r = t13(e, "DataView"); return bd = r, bd; } var wd; var R1; function b6() { if (R1) return wd; R1 = 1; var t13 = Wa(), e = Jr(), r = t13(e, "Promise"); return wd = r, wd; } var Cd; var L1; function Wk() { if (L1) return Cd; L1 = 1; var t13 = Wa(), e = Jr(), r = t13(e, "Set"); return Cd = r, Cd; } var xd; var F1; function w6() { if (F1) return xd; F1 = 1; var t13 = Wa(), e = Jr(), r = t13(e, "WeakMap"); return xd = r, xd; } var Ed; var M1; function ji() { if (M1) return Ed; M1 = 1; var t13 = m6(), e = Zg(), r = b6(), n = Wk(), a = w6(), i = Ua(), o = Mk(), s = "[object Map]", u = "[object Object]", l = "[object Promise]", c = "[object Set]", d = "[object WeakMap]", f = "[object DataView]", h10 = o(t13), v = o(e), p = o(r), g = o(n), y = o(a), m = i; return (t13 && m(new t13(new ArrayBuffer(1))) != f || e && m(new e()) != s || r && m(r.resolve()) != l || n && m(new n()) != c || a && m(new a()) != d) && (m = function(b) { var w = i(b), x = w == u ? b.constructor : void 0, E = x ? o(x) : ""; if (E) switch (E) { case h10: return f; case v: return s; case p: return l; case g: return c; case y: return d; } return w; }), Ed = m, Ed; } var Sd; var N1; function C6() { if (N1) return Sd; N1 = 1; var t13 = Object.prototype, e = t13.hasOwnProperty; function r(n) { var a = n.length, i = new n.constructor(a); return a && typeof n[0] == "string" && e.call(n, "index") && (i.index = n.index, i.input = n.input), i; } return Sd = r, Sd; } var kd; var B1; function jk() { if (B1) return kd; B1 = 1; var t13 = Jr(), e = t13.Uint8Array; return kd = e, kd; } var _d; var $1; function ay() { if ($1) return _d; $1 = 1; var t13 = jk(); function e(r) { var n = new r.constructor(r.byteLength); return new t13(n).set(new t13(r)), n; } return _d = e, _d; } var Td; var q1; function x6() { if (q1) return Td; q1 = 1; var t13 = ay(); function e(r, n) { var a = n ? t13(r.buffer) : r.buffer; return new r.constructor(a, r.byteOffset, r.byteLength); } return Td = e, Td; } var Id; var z1; function E6() { if (z1) return Id; z1 = 1; var t13 = /\w*$/; function e(r) { var n = new r.constructor(r.source, t13.exec(r)); return n.lastIndex = r.lastIndex, n; } return Id = e, Id; } var Od; var V1; function S6() { if (V1) return Od; V1 = 1; var t13 = Ui(), e = t13 ? t13.prototype : void 0, r = e ? e.valueOf : void 0; function n(a) { return r ? Object(r.call(a)) : {}; } return Od = n, Od; } var Ad; var H1; function Yk() { if (H1) return Ad; H1 = 1; var t13 = ay(); function e(r, n) { var a = n ? t13(r.buffer) : r.buffer; return new r.constructor(a, r.byteOffset, r.length); } return Ad = e, Ad; } var Pd; var K1; function k6() { if (K1) return Pd; K1 = 1; var t13 = ay(), e = x6(), r = E6(), n = S6(), a = Yk(), i = "[object Boolean]", o = "[object Date]", s = "[object Map]", u = "[object Number]", l = "[object RegExp]", c = "[object Set]", d = "[object String]", f = "[object Symbol]", h10 = "[object ArrayBuffer]", v = "[object DataView]", p = "[object Float32Array]", g = "[object Float64Array]", y = "[object Int8Array]", m = "[object Int16Array]", b = "[object Int32Array]", w = "[object Uint8Array]", x = "[object Uint8ClampedArray]", E = "[object Uint16Array]", C = "[object Uint32Array]"; function k(S, _, T) { var O = S.constructor; switch (_) { case h10: return t13(S); case i: case o: return new O(+S); case v: return e(S, T); case p: case g: case y: case m: case b: case w: case x: case E: case C: return a(S, T); case s: return new O(); case u: case d: return new O(S); case l: return r(S); case c: return new O(); case f: return n(S); } } return Pd = k, Pd; } var Dd; var G1; function Zk() { if (G1) return Dd; G1 = 1; var t13 = Fr(), e = Object.create, r = /* @__PURE__ */ function() { function n() { } return function(a) { if (!t13(a)) return {}; if (e) return e(a); n.prototype = a; var i = new n(); return n.prototype = void 0, i; }; }(); return Dd = r, Dd; } var Rd; var U1; function Xk() { if (U1) return Rd; U1 = 1; var t13 = Zk(), e = su(), r = ou(); function n(a) { return typeof a.constructor == "function" && !r(a) ? t13(e(a)) : {}; } return Rd = n, Rd; } var Ld; var W1; function _6() { if (W1) return Ld; W1 = 1; var t13 = ji(), e = hn(), r = "[object Map]"; function n(a) { return e(a) && t13(a) == r; } return Ld = n, Ld; } var Fd; var j1; function T6() { if (j1) return Fd; j1 = 1; var t13 = _6(), e = iu(), r = ey(), n = r && r.isMap, a = n ? e(n) : t13; return Fd = a, Fd; } var Md; var Y1; function I6() { if (Y1) return Md; Y1 = 1; var t13 = ji(), e = hn(), r = "[object Set]"; function n(a) { return e(a) && t13(a) == r; } return Md = n, Md; } var Nd; var Z1; function O6() { if (Z1) return Nd; Z1 = 1; var t13 = I6(), e = iu(), r = ey(), n = r && r.isSet, a = n ? e(n) : t13; return Nd = a, Nd; } var Bd; var X1; function Jk() { if (X1) return Bd; X1 = 1; var t13 = tu(), e = Jg(), r = nu(), n = d6(), a = h6(), i = qk(), o = zk(), s = p6(), u = g6(), l = Uk(), c = y6(), d = ji(), f = C6(), h10 = k6(), v = Xk(), p = At(), g = Wi(), y = T6(), m = Fr(), b = O6(), w = ca(), x = ja(), E = 1, C = 2, k = 4, S = "[object Arguments]", _ = "[object Array]", T = "[object Boolean]", O = "[object Date]", D = "[object Error]", A = "[object Function]", F = "[object GeneratorFunction]", R = "[object Map]", M = "[object Number]", L = "[object Object]", V = "[object RegExp]", Y = "[object Set]", H = "[object String]", K = "[object Symbol]", ne = "[object WeakMap]", B = "[object ArrayBuffer]", $ = "[object DataView]", z = "[object Float32Array]", W = "[object Float64Array]", Z = "[object Int8Array]", N = "[object Int16Array]", X = "[object Int32Array]", Q = "[object Uint8Array]", ge = "[object Uint8ClampedArray]", we = "[object Uint16Array]", fe = "[object Uint32Array]", ce = {}; ce[S] = ce[_] = ce[B] = ce[$] = ce[T] = ce[O] = ce[z] = ce[W] = ce[Z] = ce[N] = ce[X] = ce[R] = ce[M] = ce[L] = ce[V] = ce[Y] = ce[H] = ce[K] = ce[Q] = ce[ge] = ce[we] = ce[fe] = true, ce[D] = ce[A] = ce[ne] = false; function be(ve, xe, _e, He, Ve, De) { var Ne, ue = xe & E, I = xe & C, G = xe & k; if (_e && (Ne = Ve ? _e(ve, He, Ve, De) : _e(ve)), Ne !== void 0) return Ne; if (!m(ve)) return ve; var se = p(ve); if (se) { if (Ne = f(ve), !ue) return o(ve, Ne); } else { var ee = d(ve), te = ee == A || ee == F; if (g(ve)) return i(ve, ue); if (ee == L || ee == S || te && !Ve) { if (Ne = I || te ? {} : v(ve), !ue) return I ? u(ve, a(Ne, ve)) : s(ve, n(Ne, ve)); } else { if (!ce[ee]) return Ve ? ve : {}; Ne = h10(ve, ee, ue); } } De || (De = new t13()); var ye = De.get(ve); if (ye) return ye; De.set(ve, Ne), b(ve) ? ve.forEach(function(Oe) { Ne.add(be(Oe, xe, _e, Oe, ve, De)); }) : y(ve) && ve.forEach(function(Oe, Pe) { Ne.set(Pe, be(Oe, xe, _e, Pe, ve, De)); }); var oe = G ? I ? c : l : I ? x : w, he = se ? void 0 : oe(ve); return e(he || ve, function(Oe, Pe) { he && (Pe = Oe, Oe = ve[Pe]), r(Ne, Pe, be(Oe, xe, _e, Pe, ve, De)); }), Ne; } return Bd = be, Bd; } var $d; var J1; function A6() { if (J1) return $d; J1 = 1; var t13 = Jk(), e = 4; function r(n) { return t13(n, e); } return $d = r, $d; } var qd; var Q1; function iy() { if (Q1) return qd; Q1 = 1; function t13(e) { return function() { return e; }; } return qd = t13, qd; } var zd; var ew; function P6() { if (ew) return zd; ew = 1; function t13(e) { return function(r, n, a) { for (var i = -1, o = Object(r), s = a(r), u = s.length; u--; ) { var l = s[e ? u : ++i]; if (n(o[l], l, o) === false) break; } return r; }; } return zd = t13, zd; } var Vd; var tw; function oy() { if (tw) return Vd; tw = 1; var t13 = P6(), e = t13(); return Vd = e, Vd; } var Hd; var rw; function sy() { if (rw) return Hd; rw = 1; var t13 = oy(), e = ca(); function r(n, a) { return n && t13(n, a, e); } return Hd = r, Hd; } var Kd; var nw; function D6() { if (nw) return Kd; nw = 1; var t13 = Rn(); function e(r, n) { return function(a, i) { if (a == null) return a; if (!t13(a)) return r(a, i); for (var o = a.length, s = n ? o : -1, u = Object(a); (n ? s-- : ++s < o) && i(u[s], s, u) !== false; ) ; return a; }; } return Kd = e, Kd; } var Gd; var aw; function lu() { if (aw) return Gd; aw = 1; var t13 = sy(), e = D6(), r = e(t13); return Gd = r, Gd; } var Ud; var iw; function Ya() { if (iw) return Ud; iw = 1; function t13(e) { return e; } return Ud = t13, Ud; } var Wd; var ow; function Qk() { if (ow) return Wd; ow = 1; var t13 = Ya(); function e(r) { return typeof r == "function" ? r : t13; } return Wd = e, Wd; } var jd; var sw; function e_() { if (sw) return jd; sw = 1; var t13 = Jg(), e = lu(), r = Qk(), n = At(); function a(i, o) { var s = n(i) ? t13 : e; return s(i, r(o)); } return jd = a, jd; } var Yd; var lw; function t_() { return lw || (lw = 1, Yd = e_()), Yd; } var Zd; var uw; function R6() { if (uw) return Zd; uw = 1; var t13 = lu(); function e(r, n) { var a = []; return t13(r, function(i, o, s) { n(i, o, s) && a.push(i); }), a; } return Zd = e, Zd; } var Xd; var cw; function L6() { if (cw) return Xd; cw = 1; var t13 = "__lodash_hash_undefined__"; function e(r) { return this.__data__.set(r, t13), this; } return Xd = e, Xd; } var Jd; var dw; function F6() { if (dw) return Jd; dw = 1; function t13(e) { return this.__data__.has(e); } return Jd = t13, Jd; } var Qd; var fw; function r_() { if (fw) return Qd; fw = 1; var t13 = Xg(), e = L6(), r = F6(); function n(a) { var i = -1, o = a == null ? 0 : a.length; for (this.__data__ = new t13(); ++i < o; ) this.add(a[i]); } return n.prototype.add = n.prototype.push = e, n.prototype.has = r, Qd = n, Qd; } var ef; var vw; function M6() { if (vw) return ef; vw = 1; function t13(e, r) { for (var n = -1, a = e == null ? 0 : e.length; ++n < a; ) if (r(e[n], n, e)) return true; return false; } return ef = t13, ef; } var tf; var hw; function n_() { if (hw) return tf; hw = 1; function t13(e, r) { return e.has(r); } return tf = t13, tf; } var rf; var pw; function a_() { if (pw) return rf; pw = 1; var t13 = r_(), e = M6(), r = n_(), n = 1, a = 2; function i(o, s, u, l, c, d) { var f = u & n, h10 = o.length, v = s.length; if (h10 != v && !(f && v > h10)) return false; var p = d.get(o), g = d.get(s); if (p && g) return p == s && g == o; var y = -1, m = true, b = u & a ? new t13() : void 0; for (d.set(o, s), d.set(s, o); ++y < h10; ) { var w = o[y], x = s[y]; if (l) var E = f ? l(x, w, y, s, o, d) : l(w, x, y, o, s, d); if (E !== void 0) { if (E) continue; m = false; break; } if (b) { if (!e(s, function(C, k) { if (!r(b, k) && (w === C || c(w, C, u, l, d))) return b.push(k); })) { m = false; break; } } else if (!(w === x || c(w, x, u, l, d))) { m = false; break; } } return d.delete(o), d.delete(s), m; } return rf = i, rf; } var nf; var gw; function N6() { if (gw) return nf; gw = 1; function t13(e) { var r = -1, n = Array(e.size); return e.forEach(function(a, i) { n[++r] = [i, a]; }), n; } return nf = t13, nf; } var af; var yw; function ly() { if (yw) return af; yw = 1; function t13(e) { var r = -1, n = Array(e.size); return e.forEach(function(a) { n[++r] = a; }), n; } return af = t13, af; } var of; var mw; function B6() { if (mw) return of; mw = 1; var t13 = Ui(), e = jk(), r = Gi(), n = a_(), a = N6(), i = ly(), o = 1, s = 2, u = "[object Boolean]", l = "[object Date]", c = "[object Error]", d = "[object Map]", f = "[object Number]", h10 = "[object RegExp]", v = "[object Set]", p = "[object String]", g = "[object Symbol]", y = "[object ArrayBuffer]", m = "[object DataView]", b = t13 ? t13.prototype : void 0, w = b ? b.valueOf : void 0; function x(E, C, k, S, _, T, O) { switch (k) { case m: if (E.byteLength != C.byteLength || E.byteOffset != C.byteOffset) return false; E = E.buffer, C = C.buffer; case y: return !(E.byteLength != C.byteLength || !T(new e(E), new e(C))); case u: case l: case f: return r(+E, +C); case c: return E.name == C.name && E.message == C.message; case h10: case p: return E == C + ""; case d: var D = a; case v: var A = S & o; if (D || (D = i), E.size != C.size && !A) return false; var F = O.get(E); if (F) return F == C; S |= s, O.set(E, C); var R = n(D(E), D(C), S, _, T, O); return O.delete(E), R; case g: if (w) return w.call(E) == w.call(C); } return false; } return of = x, of; } var sf; var bw; function $6() { if (bw) return sf; bw = 1; var t13 = Uk(), e = 1, r = Object.prototype, n = r.hasOwnProperty; function a(i, o, s, u, l, c) { var d = s & e, f = t13(i), h10 = f.length, v = t13(o), p = v.length; if (h10 != p && !d) return false; for (var g = h10; g--; ) { var y = f[g]; if (!(d ? y in o : n.call(o, y))) return false; } var m = c.get(i), b = c.get(o); if (m && b) return m == o && b == i; var w = true; c.set(i, o), c.set(o, i); for (var x = d; ++g < h10; ) { y = f[g]; var E = i[y], C = o[y]; if (u) var k = d ? u(C, E, y, o, i, c) : u(E, C, y, i, o, c); if (!(k === void 0 ? E === C || l(E, C, s, u, c) : k)) { w = false; break; } x || (x = y == "constructor"); } if (w && !x) { var S = i.constructor, _ = o.constructor; S != _ && "constructor" in i && "constructor" in o && !(typeof S == "function" && S instanceof S && typeof _ == "function" && _ instanceof _) && (w = false); } return c.delete(i), c.delete(o), w; } return sf = a, sf; } var lf; var ww; function q6() { if (ww) return lf; ww = 1; var t13 = tu(), e = a_(), r = B6(), n = $6(), a = ji(), i = At(), o = Wi(), s = vs(), u = 1, l = "[object Arguments]", c = "[object Array]", d = "[object Object]", f = Object.prototype, h10 = f.hasOwnProperty; function v(p, g, y, m, b, w) { var x = i(p), E = i(g), C = x ? c : a(p), k = E ? c : a(g); C = C == l ? d : C, k = k == l ? d : k; var S = C == d, _ = k == d, T = C == k; if (T && o(p)) { if (!o(g)) return false; x = true, S = false; } if (T && !S) return w || (w = new t13()), x || s(p) ? e(p, g, y, m, b, w) : r(p, g, C, y, m, b, w); if (!(y & u)) { var O = S && h10.call(p, "__wrapped__"), D = _ && h10.call(g, "__wrapped__"); if (O || D) { var A = O ? p.value() : p, F = D ? g.value() : g; return w || (w = new t13()), b(A, F, y, m, w); } } return T ? (w || (w = new t13()), n(p, g, y, m, b, w)) : false; } return lf = v, lf; } var uf; var Cw; function i_() { if (Cw) return uf; Cw = 1; var t13 = q6(), e = hn(); function r(n, a, i, o, s) { return n === a ? true : n == null || a == null || !e(n) && !e(a) ? n !== n && a !== a : t13(n, a, i, o, r, s); } return uf = r, uf; } var cf; var xw; function z6() { if (xw) return cf; xw = 1; var t13 = tu(), e = i_(), r = 1, n = 2; function a(i, o, s, u) { var l = s.length, c = l, d = !u; if (i == null) return !c; for (i = Object(i); l--; ) { var f = s[l]; if (d && f[2] ? f[1] !== i[f[0]] : !(f[0] in i)) return false; } for (; ++l < c; ) { f = s[l]; var h10 = f[0], v = i[h10], p = f[1]; if (d && f[2]) { if (v === void 0 && !(h10 in i)) return false; } else { var g = new t13(); if (u) var y = u(v, p, h10, i, o, g); if (!(y === void 0 ? e(p, v, r | n, u, g) : y)) return false; } } return true; } return cf = a, cf; } var df; var Ew; function o_() { if (Ew) return df; Ew = 1; var t13 = Fr(); function e(r) { return r === r && !t13(r); } return df = e, df; } var ff; var Sw; function V6() { if (Sw) return ff; Sw = 1; var t13 = o_(), e = ca(); function r(n) { for (var a = e(n), i = a.length; i--; ) { var o = a[i], s = n[o]; a[i] = [o, s, t13(s)]; } return a; } return ff = r, ff; } var vf; var kw; function s_() { if (kw) return vf; kw = 1; function t13(e, r) { return function(n) { return n == null ? false : n[e] === r && (r !== void 0 || e in Object(n)); }; } return vf = t13, vf; } var hf; var _w; function H6() { if (_w) return hf; _w = 1; var t13 = z6(), e = V6(), r = s_(); function n(a) { var i = e(a); return i.length == 1 && i[0][2] ? r(i[0][0], i[0][1]) : function(o) { return o === a || t13(o, a, i); }; } return hf = n, hf; } var pf; var Tw; function Yi() { if (Tw) return pf; Tw = 1; var t13 = Ua(), e = hn(), r = "[object Symbol]"; function n(a) { return typeof a == "symbol" || e(a) && t13(a) == r; } return pf = n, pf; } var gf; var Iw; function uy() { if (Iw) return gf; Iw = 1; var t13 = At(), e = Yi(), r = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, n = /^\w*$/; function a(i, o) { if (t13(i)) return false; var s = typeof i; return s == "number" || s == "symbol" || s == "boolean" || i == null || e(i) ? true : n.test(i) || !r.test(i) || o != null && i in Object(o); } return gf = a, gf; } var yf; var Ow; function K6() { if (Ow) return yf; Ow = 1; var t13 = Xg(), e = "Expected a function"; function r(n, a) { if (typeof n != "function" || a != null && typeof a != "function") throw new TypeError(e); var i = function() { var o = arguments, s = a ? a.apply(this, o) : o[0], u = i.cache; if (u.has(s)) return u.get(s); var l = n.apply(this, o); return i.cache = u.set(s, l) || u, l; }; return i.cache = new (r.Cache || t13)(), i; } return r.Cache = t13, yf = r, yf; } var mf; var Aw; function G6() { if (Aw) return mf; Aw = 1; var t13 = K6(), e = 500; function r(n) { var a = t13(n, function(o) { return i.size === e && i.clear(), o; }), i = a.cache; return a; } return mf = r, mf; } var bf; var Pw; function U6() { if (Pw) return bf; Pw = 1; var t13 = G6(), e = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, r = /\\(\\)?/g, n = t13(function(a) { var i = []; return a.charCodeAt(0) === 46 && i.push(""), a.replace(e, function(o, s, u, l) { i.push(u ? l.replace(r, "$1") : s || o); }), i; }); return bf = n, bf; } var wf; var Dw; function uu() { if (Dw) return wf; Dw = 1; function t13(e, r) { for (var n = -1, a = e == null ? 0 : e.length, i = Array(a); ++n < a; ) i[n] = r(e[n], n, e); return i; } return wf = t13, wf; } var Cf; var Rw; function W6() { if (Rw) return Cf; Rw = 1; var t13 = Ui(), e = uu(), r = At(), n = Yi(), a = 1 / 0, i = t13 ? t13.prototype : void 0, o = i ? i.toString : void 0; function s(u) { if (typeof u == "string") return u; if (r(u)) return e(u, s) + ""; if (n(u)) return o ? o.call(u) : ""; var l = u + ""; return l == "0" && 1 / u == -a ? "-0" : l; } return Cf = s, Cf; } var xf; var Lw; function l_() { if (Lw) return xf; Lw = 1; var t13 = W6(); function e(r) { return r == null ? "" : t13(r); } return xf = e, xf; } var Ef; var Fw; function cu() { if (Fw) return Ef; Fw = 1; var t13 = At(), e = uy(), r = U6(), n = l_(); function a(i, o) { return t13(i) ? i : e(i, o) ? [i] : r(n(i)); } return Ef = a, Ef; } var Sf; var Mw; function hs() { if (Mw) return Sf; Mw = 1; var t13 = Yi(), e = 1 / 0; function r(n) { if (typeof n == "string" || t13(n)) return n; var a = n + ""; return a == "0" && 1 / n == -e ? "-0" : a; } return Sf = r, Sf; } var kf; var Nw; function du() { if (Nw) return kf; Nw = 1; var t13 = cu(), e = hs(); function r(n, a) { a = t13(a, n); for (var i = 0, o = a.length; n != null && i < o; ) n = n[e(a[i++])]; return i && i == o ? n : void 0; } return kf = r, kf; } var _f; var Bw; function j6() { if (Bw) return _f; Bw = 1; var t13 = du(); function e(r, n, a) { var i = r == null ? void 0 : t13(r, n); return i === void 0 ? a : i; } return _f = e, _f; } var Tf; var $w; function Y6() { if ($w) return Tf; $w = 1; function t13(e, r) { return e != null && r in Object(e); } return Tf = t13, Tf; } var If; var qw; function u_() { if (qw) return If; qw = 1; var t13 = cu(), e = fs(), r = At(), n = au(), a = Qg(), i = hs(); function o(s, u, l) { u = t13(u, s); for (var c = -1, d = u.length, f = false; ++c < d; ) { var h10 = i(u[c]); if (!(f = s != null && l(s, h10))) break; s = s[h10]; } return f || ++c != d ? f : (d = s == null ? 0 : s.length, !!d && a(d) && n(h10, d) && (r(s) || e(s))); } return If = o, If; } var Of; var zw; function c_() { if (zw) return Of; zw = 1; var t13 = Y6(), e = u_(); function r(n, a) { return n != null && e(n, a, t13); } return Of = r, Of; } var Af; var Vw; function Z6() { if (Vw) return Af; Vw = 1; var t13 = i_(), e = j6(), r = c_(), n = uy(), a = o_(), i = s_(), o = hs(), s = 1, u = 2; function l(c, d) { return n(c) && a(d) ? i(o(c), d) : function(f) { var h10 = e(f, c); return h10 === void 0 && h10 === d ? r(f, c) : t13(d, h10, s | u); }; } return Af = l, Af; } var Pf; var Hw; function d_() { if (Hw) return Pf; Hw = 1; function t13(e) { return function(r) { return r == null ? void 0 : r[e]; }; } return Pf = t13, Pf; } var Df; var Kw; function X6() { if (Kw) return Df; Kw = 1; var t13 = du(); function e(r) { return function(n) { return t13(n, r); }; } return Df = e, Df; } var Rf; var Gw; function J6() { if (Gw) return Rf; Gw = 1; var t13 = d_(), e = X6(), r = uy(), n = hs(); function a(i) { return r(i) ? t13(n(i)) : e(i); } return Rf = a, Rf; } var Lf; var Uw; function Ln() { if (Uw) return Lf; Uw = 1; var t13 = H6(), e = Z6(), r = Ya(), n = At(), a = J6(); function i(o) { return typeof o == "function" ? o : o == null ? r : typeof o == "object" ? n(o) ? e(o[0], o[1]) : t13(o) : a(o); } return Lf = i, Lf; } var Ff; var Ww; function f_() { if (Ww) return Ff; Ww = 1; var t13 = Vk(), e = R6(), r = Ln(), n = At(); function a(i, o) { var s = n(i) ? t13 : e; return s(i, r(o, 3)); } return Ff = a, Ff; } var Mf; var jw; function Q6() { if (jw) return Mf; jw = 1; var t13 = Object.prototype, e = t13.hasOwnProperty; function r(n, a) { return n != null && e.call(n, a); } return Mf = r, Mf; } var Nf; var Yw; function v_() { if (Yw) return Nf; Yw = 1; var t13 = Q6(), e = u_(); function r(n, a) { return n != null && e(n, a, t13); } return Nf = r, Nf; } var Bf; var Zw; function e9() { if (Zw) return Bf; Zw = 1; var t13 = ty(), e = ji(), r = fs(), n = At(), a = Rn(), i = Wi(), o = ou(), s = vs(), u = "[object Map]", l = "[object Set]", c = Object.prototype, d = c.hasOwnProperty; function f(h10) { if (h10 == null) return true; if (a(h10) && (n(h10) || typeof h10 == "string" || typeof h10.splice == "function" || i(h10) || s(h10) || r(h10))) return !h10.length; var v = e(h10); if (v == u || v == l) return !h10.size; if (o(h10)) return !t13(h10).length; for (var p in h10) if (d.call(h10, p)) return false; return true; } return Bf = f, Bf; } var $f; var Xw; function h_() { if (Xw) return $f; Xw = 1; function t13(e) { return e === void 0; } return $f = t13, $f; } var qf; var Jw; function p_() { if (Jw) return qf; Jw = 1; var t13 = lu(), e = Rn(); function r(n, a) { var i = -1, o = e(n) ? Array(n.length) : []; return t13(n, function(s, u, l) { o[++i] = a(s, u, l); }), o; } return qf = r, qf; } var zf; var Qw; function g_() { if (Qw) return zf; Qw = 1; var t13 = uu(), e = Ln(), r = p_(), n = At(); function a(i, o) { var s = n(i) ? t13 : r; return s(i, e(o, 3)); } return zf = a, zf; } var Vf; var eC; function t92() { if (eC) return Vf; eC = 1; function t13(e, r, n, a) { var i = -1, o = e == null ? 0 : e.length; for (a && o && (n = e[++i]); ++i < o; ) n = r(n, e[i], i, e); return n; } return Vf = t13, Vf; } var Hf; var tC; function r9() { if (tC) return Hf; tC = 1; function t13(e, r, n, a, i) { return i(e, function(o, s, u) { n = a ? (a = false, o) : r(n, o, s, u); }), n; } return Hf = t13, Hf; } var Kf; var rC; function y_() { if (rC) return Kf; rC = 1; var t13 = t92(), e = lu(), r = Ln(), n = r9(), a = At(); function i(o, s, u) { var l = a(o) ? t13 : n, c = arguments.length < 3; return l(o, r(s, 4), u, c, e); } return Kf = i, Kf; } var Gf; var nC; function n9() { if (nC) return Gf; nC = 1; var t13 = Ua(), e = At(), r = hn(), n = "[object String]"; function a(i) { return typeof i == "string" || !e(i) && r(i) && t13(i) == n; } return Gf = a, Gf; } var Uf; var aC; function a9() { if (aC) return Uf; aC = 1; var t13 = d_(), e = t13("length"); return Uf = e, Uf; } var Wf; var iC; function i9() { if (iC) return Wf; iC = 1; var t13 = "\\ud800-\\udfff", e = "\\u0300-\\u036f", r = "\\ufe20-\\ufe2f", n = "\\u20d0-\\u20ff", a = e + r + n, i = "\\ufe0e\\ufe0f", o = "\\u200d", s = RegExp("[" + o + t13 + a + i + "]"); function u(l) { return s.test(l); } return Wf = u, Wf; } var jf; var oC; function o9() { if (oC) return jf; oC = 1; var t13 = "\\ud800-\\udfff", e = "\\u0300-\\u036f", r = "\\ufe20-\\ufe2f", n = "\\u20d0-\\u20ff", a = e + r + n, i = "\\ufe0e\\ufe0f", o = "[" + t13 + "]", s = "[" + a + "]", u = "\\ud83c[\\udffb-\\udfff]", l = "(?:" + s + "|" + u + ")", c = "[^" + t13 + "]", d = "(?:\\ud83c[\\udde6-\\uddff]){2}", f = "[\\ud800-\\udbff][\\udc00-\\udfff]", h10 = "\\u200d", v = l + "?", p = "[" + i + "]?", g = "(?:" + h10 + "(?:" + [c, d, f].join("|") + ")" + p + v + ")*", y = p + v + g, m = "(?:" + [c + s + "?", s, d, f, o].join("|") + ")", b = RegExp(u + "(?=" + u + ")|" + m + y, "g"); function w(x) { for (var E = b.lastIndex = 0; b.test(x); ) ++E; return E; } return jf = w, jf; } var Yf; var sC; function s9() { if (sC) return Yf; sC = 1; var t13 = a9(), e = i9(), r = o9(); function n(a) { return e(a) ? r(a) : t13(a); } return Yf = n, Yf; } var Zf; var lC; function l9() { if (lC) return Zf; lC = 1; var t13 = ty(), e = ji(), r = Rn(), n = n9(), a = s9(), i = "[object Map]", o = "[object Set]"; function s(u) { if (u == null) return 0; if (r(u)) return n(u) ? a(u) : u.length; var l = e(u); return l == i || l == o ? u.size : t13(u).length; } return Zf = s, Zf; } var Xf; var uC; function u9() { if (uC) return Xf; uC = 1; var t13 = Jg(), e = Zk(), r = sy(), n = Ln(), a = su(), i = At(), o = Wi(), s = cs(), u = Fr(), l = vs(); function c(d, f, h10) { var v = i(d), p = v || o(d) || l(d); if (f = n(f, 4), h10 == null) { var g = d && d.constructor; p ? h10 = v ? new g() : [] : u(d) ? h10 = s(g) ? e(a(d)) : {} : h10 = {}; } return (p ? t13 : r)(d, function(y, m, b) { return f(h10, y, m, b); }), h10; } return Xf = c, Xf; } var Jf; var cC; function c9() { if (cC) return Jf; cC = 1; var t13 = Ui(), e = fs(), r = At(), n = t13 ? t13.isConcatSpreadable : void 0; function a(i) { return r(i) || e(i) || !!(n && i && i[n]); } return Jf = a, Jf; } var Qf; var dC; function cy() { if (dC) return Qf; dC = 1; var t13 = ny(), e = c9(); function r(n, a, i, o, s) { var u = -1, l = n.length; for (i || (i = e), s || (s = []); ++u < l; ) { var c = n[u]; a > 0 && i(c) ? a > 1 ? r(c, a - 1, i, o, s) : t13(s, c) : o || (s[s.length] = c); } return s; } return Qf = r, Qf; } var ev; var fC; function d9() { if (fC) return ev; fC = 1; function t13(e, r, n) { switch (n.length) { case 0: return e.call(r); case 1: return e.call(r, n[0]); case 2: return e.call(r, n[0], n[1]); case 3: return e.call(r, n[0], n[1], n[2]); } return e.apply(r, n); } return ev = t13, ev; } var tv; var vC; function m_() { if (vC) return tv; vC = 1; var t13 = d9(), e = Math.max; function r(n, a, i) { return a = e(a === void 0 ? n.length - 1 : a, 0), function() { for (var o = arguments, s = -1, u = e(o.length - a, 0), l = Array(u); ++s < u; ) l[s] = o[a + s]; s = -1; for (var c = Array(a + 1); ++s < a; ) c[s] = o[s]; return c[a] = i(l), t13(n, this, c); }; } return tv = r, tv; } var rv; var hC; function f9() { if (hC) return rv; hC = 1; var t13 = iy(), e = Nk(), r = Ya(), n = e ? function(a, i) { return e(a, "toString", { configurable: true, enumerable: false, value: t13(i), writable: true }); } : r; return rv = n, rv; } var nv; var pC; function v9() { if (pC) return nv; pC = 1; var t13 = 800, e = 16, r = Date.now; function n(a) { var i = 0, o = 0; return function() { var s = r(), u = e - (s - o); if (o = s, u > 0) { if (++i >= t13) return arguments[0]; } else i = 0; return a.apply(void 0, arguments); }; } return nv = n, nv; } var av; var gC; function b_() { if (gC) return av; gC = 1; var t13 = f9(), e = v9(), r = e(t13); return av = r, av; } var iv; var yC; function fu() { if (yC) return iv; yC = 1; var t13 = Ya(), e = m_(), r = b_(); function n(a, i) { return r(e(a, i, t13), a + ""); } return iv = n, iv; } var ov; var mC; function w_() { if (mC) return ov; mC = 1; function t13(e, r, n, a) { for (var i = e.length, o = n + (a ? 1 : -1); a ? o-- : ++o < i; ) if (r(e[o], o, e)) return o; return -1; } return ov = t13, ov; } var sv; var bC; function h9() { if (bC) return sv; bC = 1; function t13(e) { return e !== e; } return sv = t13, sv; } var lv; var wC; function p9() { if (wC) return lv; wC = 1; function t13(e, r, n) { for (var a = n - 1, i = e.length; ++a < i; ) if (e[a] === r) return a; return -1; } return lv = t13, lv; } var uv; var CC; function g9() { if (CC) return uv; CC = 1; var t13 = w_(), e = h9(), r = p9(); function n(a, i, o) { return i === i ? r(a, i, o) : t13(a, e, o); } return uv = n, uv; } var cv; var xC; function y9() { if (xC) return cv; xC = 1; var t13 = g9(); function e(r, n) { var a = r == null ? 0 : r.length; return !!a && t13(r, n, 0) > -1; } return cv = e, cv; } var dv; var EC; function m9() { if (EC) return dv; EC = 1; function t13(e, r, n) { for (var a = -1, i = e == null ? 0 : e.length; ++a < i; ) if (n(r, e[a])) return true; return false; } return dv = t13, dv; } var fv; var SC; function b9() { if (SC) return fv; SC = 1; function t13() { } return fv = t13, fv; } var vv; var kC; function w9() { if (kC) return vv; kC = 1; var t13 = Wk(), e = b9(), r = ly(), n = 1 / 0, a = t13 && 1 / r(new t13([, -0]))[1] == n ? function(i) { return new t13(i); } : e; return vv = a, vv; } var hv; var _C; function C9() { if (_C) return hv; _C = 1; var t13 = r_(), e = y9(), r = m9(), n = n_(), a = w9(), i = ly(), o = 200; function s(u, l, c) { var d = -1, f = e, h10 = u.length, v = true, p = [], g = p; if (c) v = false, f = r; else if (h10 >= o) { var y = l ? null : a(u); if (y) return i(y); v = false, f = n, g = new t13(); } else g = l ? [] : p; e: for (; ++d < h10; ) { var m = u[d], b = l ? l(m) : m; if (m = c || m !== 0 ? m : 0, v && b === b) { for (var w = g.length; w--; ) if (g[w] === b) continue e; l && g.push(b), p.push(m); } else f(g, b, c) || (g !== p && g.push(b), p.push(m)); } return p; } return hv = s, hv; } var pv; var TC; function C_() { if (TC) return pv; TC = 1; var t13 = Rn(), e = hn(); function r(n) { return e(n) && t13(n); } return pv = r, pv; } var gv; var IC; function x9() { if (IC) return gv; IC = 1; var t13 = cy(), e = fu(), r = C9(), n = C_(), a = e(function(i) { return r(t13(i, 1, n, true)); }); return gv = a, gv; } var yv; var OC; function E9() { if (OC) return yv; OC = 1; var t13 = uu(); function e(r, n) { return t13(n, function(a) { return r[a]; }); } return yv = e, yv; } var mv; var AC; function x_() { if (AC) return mv; AC = 1; var t13 = E9(), e = ca(); function r(n) { return n == null ? [] : t13(n, e(n)); } return mv = r, mv; } var bv; var PC; function Mr() { if (PC) return bv; PC = 1; var t13; if (typeof Yg == "function") try { t13 = { clone: A6(), constant: iy(), each: t_(), filter: f_(), has: v_(), isArray: At(), isEmpty: e9(), isFunction: cs(), isUndefined: h_(), keys: ca(), map: g_(), reduce: y_(), size: l9(), transform: u9(), union: x9(), values: x_() }; } catch { } return t13 || (t13 = window._), bv = t13, bv; } var wv; var DC; function dy() { if (DC) return wv; DC = 1; var t13 = Mr(); wv = a; var e = "\0", r = "\0", n = ""; function a(c) { this._isDirected = t13.has(c, "directed") ? c.directed : true, this._isMultigraph = t13.has(c, "multigraph") ? c.multigraph : false, this._isCompound = t13.has(c, "compound") ? c.compound : false, this._label = void 0, this._defaultNodeLabelFn = t13.constant(void 0), this._defaultEdgeLabelFn = t13.constant(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[r] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {}; } a.prototype._nodeCount = 0, a.prototype._edgeCount = 0, a.prototype.isDirected = function() { return this._isDirected; }, a.prototype.isMultigraph = function() { return this._isMultigraph; }, a.prototype.isCompound = function() { return this._isCompound; }, a.prototype.setGraph = function(c) { return this._label = c, this; }, a.prototype.graph = function() { return this._label; }, a.prototype.setDefaultNodeLabel = function(c) { return t13.isFunction(c) || (c = t13.constant(c)), this._defaultNodeLabelFn = c, this; }, a.prototype.nodeCount = function() { return this._nodeCount; }, a.prototype.nodes = function() { return t13.keys(this._nodes); }, a.prototype.sources = function() { var c = this; return t13.filter(this.nodes(), function(d) { return t13.isEmpty(c._in[d]); }); }, a.prototype.sinks = function() { var c = this; return t13.filter(this.nodes(), function(d) { return t13.isEmpty(c._out[d]); }); }, a.prototype.setNodes = function(c, d) { var f = arguments, h10 = this; return t13.each(c, function(v) { f.length > 1 ? h10.setNode(v, d) : h10.setNode(v); }), this; }, a.prototype.setNode = function(c, d) { return t13.has(this._nodes, c) ? (arguments.length > 1 && (this._nodes[c] = d), this) : (this._nodes[c] = arguments.length > 1 ? d : this._defaultNodeLabelFn(c), this._isCompound && (this._parent[c] = r, this._children[c] = {}, this._children[r][c] = true), this._in[c] = {}, this._preds[c] = {}, this._out[c] = {}, this._sucs[c] = {}, ++this._nodeCount, this); }, a.prototype.node = function(c) { return this._nodes[c]; }, a.prototype.hasNode = function(c) { return t13.has(this._nodes, c); }, a.prototype.removeNode = function(c) { var d = this; if (t13.has(this._nodes, c)) { var f = function(h10) { d.removeEdge(d._edgeObjs[h10]); }; delete this._nodes[c], this._isCompound && (this._removeFromParentsChildList(c), delete this._parent[c], t13.each(this.children(c), function(h10) { d.setParent(h10); }), delete this._children[c]), t13.each(t13.keys(this._in[c]), f), delete this._in[c], delete this._preds[c], t13.each(t13.keys(this._out[c]), f), delete this._out[c], delete this._sucs[c], --this._nodeCount; } return this; }, a.prototype.setParent = function(c, d) { if (!this._isCompound) throw new Error("Cannot set parent in a non-compound graph"); if (t13.isUndefined(d)) d = r; else { d += ""; for (var f = d; !t13.isUndefined(f); f = this.parent(f)) if (f === c) throw new Error("Setting " + d + " as parent of " + c + " would create a cycle"); this.setNode(d); } return this.setNode(c), this._removeFromParentsChildList(c), this._parent[c] = d, this._children[d][c] = true, this; }, a.prototype._removeFromParentsChildList = function(c) { delete this._children[this._parent[c]][c]; }, a.prototype.parent = function(c) { if (this._isCompound) { var d = this._parent[c]; if (d !== r) return d; } }, a.prototype.children = function(c) { if (t13.isUndefined(c) && (c = r), this._isCompound) { var d = this._children[c]; if (d) return t13.keys(d); } else { if (c === r) return this.nodes(); if (this.hasNode(c)) return []; } }, a.prototype.predecessors = function(c) { var d = this._preds[c]; if (d) return t13.keys(d); }, a.prototype.successors = function(c) { var d = this._sucs[c]; if (d) return t13.keys(d); }, a.prototype.neighbors = function(c) { var d = this.predecessors(c); if (d) return t13.union(d, this.successors(c)); }, a.prototype.isLeaf = function(c) { var d; return this.isDirected() ? d = this.successors(c) : d = this.neighbors(c), d.length === 0; }, a.prototype.filterNodes = function(c) { var d = new this.constructor({ directed: this._isDirected, multigraph: this._isMultigraph, compound: this._isCompound }); d.setGraph(this.graph()); var f = this; t13.each(this._nodes, function(p, g) { c(g) && d.setNode(g, p); }), t13.each(this._edgeObjs, function(p) { d.hasNode(p.v) && d.hasNode(p.w) && d.setEdge(p, f.edge(p)); }); var h10 = {}; function v(p) { var g = f.parent(p); return g === void 0 || d.hasNode(g) ? (h10[p] = g, g) : g in h10 ? h10[g] : v(g); } return this._isCompound && t13.each(d.nodes(), function(p) { d.setParent(p, v(p)); }), d; }, a.prototype.setDefaultEdgeLabel = function(c) { return t13.isFunction(c) || (c = t13.constant(c)), this._defaultEdgeLabelFn = c, this; }, a.prototype.edgeCount = function() { return this._edgeCount; }, a.prototype.edges = function() { return t13.values(this._edgeObjs); }, a.prototype.setPath = function(c, d) { var f = this, h10 = arguments; return t13.reduce(c, function(v, p) { return h10.length > 1 ? f.setEdge(v, p, d) : f.setEdge(v, p), p; }), this; }, a.prototype.setEdge = function() { var c, d, f, h10, v = false, p = arguments[0]; typeof p == "object" && p !== null && "v" in p ? (c = p.v, d = p.w, f = p.name, arguments.length === 2 && (h10 = arguments[1], v = true)) : (c = p, d = arguments[1], f = arguments[3], arguments.length > 2 && (h10 = arguments[2], v = true)), c = "" + c, d = "" + d, t13.isUndefined(f) || (f = "" + f); var g = s(this._isDirected, c, d, f); if (t13.has(this._edgeLabels, g)) return v && (this._edgeLabels[g] = h10), this; if (!t13.isUndefined(f) && !this._isMultigraph) throw new Error("Cannot set a named edge when isMultigraph = false"); this.setNode(c), this.setNode(d), this._edgeLabels[g] = v ? h10 : this._defaultEdgeLabelFn(c, d, f); var y = u(this._isDirected, c, d, f); return c = y.v, d = y.w, Object.freeze(y), this._edgeObjs[g] = y, i(this._preds[d], c), i(this._sucs[c], d), this._in[d][g] = y, this._out[c][g] = y, this._edgeCount++, this; }, a.prototype.edge = function(c, d, f) { var h10 = arguments.length === 1 ? l(this._isDirected, arguments[0]) : s(this._isDirected, c, d, f); return this._edgeLabels[h10]; }, a.prototype.hasEdge = function(c, d, f) { var h10 = arguments.length === 1 ? l(this._isDirected, arguments[0]) : s(this._isDirected, c, d, f); return t13.has(this._edgeLabels, h10); }, a.prototype.removeEdge = function(c, d, f) { var h10 = arguments.length === 1 ? l(this._isDirected, arguments[0]) : s(this._isDirected, c, d, f), v = this._edgeObjs[h10]; return v && (c = v.v, d = v.w, delete this._edgeLabels[h10], delete this._edgeObjs[h10], o(this._preds[d], c), o(this._sucs[c], d), delete this._in[d][h10], delete this._out[c][h10], this._edgeCount--), this; }, a.prototype.inEdges = function(c, d) { var f = this._in[c]; if (f) { var h10 = t13.values(f); return d ? t13.filter(h10, function(v) { return v.v === d; }) : h10; } }, a.prototype.outEdges = function(c, d) { var f = this._out[c]; if (f) { var h10 = t13.values(f); return d ? t13.filter(h10, function(v) { return v.w === d; }) : h10; } }, a.prototype.nodeEdges = function(c, d) { var f = this.inEdges(c, d); if (f) return f.concat(this.outEdges(c, d)); }; function i(c, d) { c[d] ? c[d]++ : c[d] = 1; } function o(c, d) { --c[d] || delete c[d]; } function s(c, d, f, h10) { var v = "" + d, p = "" + f; if (!c && v > p) { var g = v; v = p, p = g; } return v + n + p + n + (t13.isUndefined(h10) ? e : h10); } function u(c, d, f, h10) { var v = "" + d, p = "" + f; if (!c && v > p) { var g = v; v = p, p = g; } var y = { v, w: p }; return h10 && (y.name = h10), y; } function l(c, d) { return s(c, d.v, d.w, d.name); } return wv; } var Cv; var RC; function S9() { return RC || (RC = 1, Cv = "2.1.8"), Cv; } var xv; var LC; function k9() { return LC || (LC = 1, xv = { Graph: dy(), version: S9() }), xv; } var Ev; var FC; function _9() { if (FC) return Ev; FC = 1; var t13 = Mr(), e = dy(); Ev = { write: r, read: i }; function r(o) { var s = { options: { directed: o.isDirected(), multigraph: o.isMultigraph(), compound: o.isCompound() }, nodes: n(o), edges: a(o) }; return t13.isUndefined(o.graph()) || (s.value = t13.clone(o.graph())), s; } function n(o) { return t13.map(o.nodes(), function(s) { var u = o.node(s), l = o.parent(s), c = { v: s }; return t13.isUndefined(u) || (c.value = u), t13.isUndefined(l) || (c.parent = l), c; }); } function a(o) { return t13.map(o.edges(), function(s) { var u = o.edge(s), l = { v: s.v, w: s.w }; return t13.isUndefined(s.name) || (l.name = s.name), t13.isUndefined(u) || (l.value = u), l; }); } function i(o) { var s = new e(o.options).setGraph(o.value); return t13.each(o.nodes, function(u) { s.setNode(u.v, u.value), u.parent && s.setParent(u.v, u.parent); }), t13.each(o.edges, function(u) { s.setEdge({ v: u.v, w: u.w, name: u.name }, u.value); }), s; } return Ev; } var Sv; var MC; function T9() { if (MC) return Sv; MC = 1; var t13 = Mr(); Sv = e; function e(r) { var n = {}, a = [], i; function o(s) { t13.has(n, s) || (n[s] = true, i.push(s), t13.each(r.successors(s), o), t13.each(r.predecessors(s), o)); } return t13.each(r.nodes(), function(s) { i = [], o(s), i.length && a.push(i); }), a; } return Sv; } var kv; var NC; function E_() { if (NC) return kv; NC = 1; var t13 = Mr(); kv = e; function e() { this._arr = [], this._keyIndices = {}; } return e.prototype.size = function() { return this._arr.length; }, e.prototype.keys = function() { return this._arr.map(function(r) { return r.key; }); }, e.prototype.has = function(r) { return t13.has(this._keyIndices, r); }, e.prototype.priority = function(r) { var n = this._keyIndices[r]; if (n !== void 0) return this._arr[n].priority; }, e.prototype.min = function() { if (this.size() === 0) throw new Error("Queue underflow"); return this._arr[0].key; }, e.prototype.add = function(r, n) { var a = this._keyIndices; if (r = String(r), !t13.has(a, r)) { var i = this._arr, o = i.length; return a[r] = o, i.push({ key: r, priority: n }), this._decrease(o), true; } return false; }, e.prototype.removeMin = function() { this._swap(0, this._arr.length - 1); var r = this._arr.pop(); return delete this._keyIndices[r.key], this._heapify(0), r.key; }, e.prototype.decrease = function(r, n) { var a = this._keyIndices[r]; if (n > this._arr[a].priority) throw new Error("New priority is greater than current priority. Key: " + r + " Old: " + this._arr[a].priority + " New: " + n); this._arr[a].priority = n, this._decrease(a); }, e.prototype._heapify = function(r) { var n = this._arr, a = 2 * r, i = a + 1, o = r; a < n.length && (o = n[a].priority < n[o].priority ? a : o, i < n.length && (o = n[i].priority < n[o].priority ? i : o), o !== r && (this._swap(r, o), this._heapify(o))); }, e.prototype._decrease = function(r) { for (var n = this._arr, a = n[r].priority, i; r !== 0 && (i = r >> 1, !(n[i].priority < a)); ) this._swap(r, i), r = i; }, e.prototype._swap = function(r, n) { var a = this._arr, i = this._keyIndices, o = a[r], s = a[n]; a[r] = s, a[n] = o, i[s.key] = r, i[o.key] = n; }, kv; } var _v; var BC; function S_() { if (BC) return _v; BC = 1; var t13 = Mr(), e = E_(); _v = n; var r = t13.constant(1); function n(i, o, s, u) { return a( i, String(o), s || r, u || function(l) { return i.outEdges(l); } ); } function a(i, o, s, u) { var l = {}, c = new e(), d, f, h10 = function(v) { var p = v.v !== d ? v.v : v.w, g = l[p], y = s(v), m = f.distance + y; if (y < 0) throw new Error("dijkstra does not allow negative edge weights. Bad edge: " + v + " Weight: " + y); m < g.distance && (g.distance = m, g.predecessor = d, c.decrease(p, m)); }; for (i.nodes().forEach(function(v) { var p = v === o ? 0 : Number.POSITIVE_INFINITY; l[v] = { distance: p }, c.add(v, p); }); c.size() > 0 && (d = c.removeMin(), f = l[d], f.distance !== Number.POSITIVE_INFINITY); ) u(d).forEach(h10); return l; } return _v; } var Tv; var $C; function I9() { if ($C) return Tv; $C = 1; var t13 = S_(), e = Mr(); Tv = r; function r(n, a, i) { return e.transform(n.nodes(), function(o, s) { o[s] = t13(n, s, a, i); }, {}); } return Tv; } var Iv; var qC; function k_() { if (qC) return Iv; qC = 1; var t13 = Mr(); Iv = e; function e(r) { var n = 0, a = [], i = {}, o = []; function s(u) { var l = i[u] = { onStack: true, lowlink: n, index: n++ }; if (a.push(u), r.successors(u).forEach(function(f) { t13.has(i, f) ? i[f].onStack && (l.lowlink = Math.min(l.lowlink, i[f].index)) : (s(f), l.lowlink = Math.min(l.lowlink, i[f].lowlink)); }), l.lowlink === l.index) { var c = [], d; do d = a.pop(), i[d].onStack = false, c.push(d); while (u !== d); o.push(c); } } return r.nodes().forEach(function(u) { t13.has(i, u) || s(u); }), o; } return Iv; } var Ov; var zC; function O9() { if (zC) return Ov; zC = 1; var t13 = Mr(), e = k_(); Ov = r; function r(n) { return t13.filter(e(n), function(a) { return a.length > 1 || a.length === 1 && n.hasEdge(a[0], a[0]); }); } return Ov; } var Av; var VC; function A9() { if (VC) return Av; VC = 1; var t13 = Mr(); Av = r; var e = t13.constant(1); function r(a, i, o) { return n( a, i || e, o || function(s) { return a.outEdges(s); } ); } function n(a, i, o) { var s = {}, u = a.nodes(); return u.forEach(function(l) { s[l] = {}, s[l][l] = { distance: 0 }, u.forEach(function(c) { l !== c && (s[l][c] = { distance: Number.POSITIVE_INFINITY }); }), o(l).forEach(function(c) { var d = c.v === l ? c.w : c.v, f = i(c); s[l][d] = { distance: f, predecessor: l }; }); }), u.forEach(function(l) { var c = s[l]; u.forEach(function(d) { var f = s[d]; u.forEach(function(h10) { var v = f[l], p = c[h10], g = f[h10], y = v.distance + p.distance; y < g.distance && (g.distance = y, g.predecessor = p.predecessor); }); }); }), s; } return Av; } var Pv; var HC; function __() { if (HC) return Pv; HC = 1; var t13 = Mr(); Pv = e, e.CycleException = r; function e(n) { var a = {}, i = {}, o = []; function s(u) { if (t13.has(i, u)) throw new r(); t13.has(a, u) || (i[u] = true, a[u] = true, t13.each(n.predecessors(u), s), delete i[u], o.push(u)); } if (t13.each(n.sinks(), s), t13.size(a) !== n.nodeCount()) throw new r(); return o; } function r() { } return r.prototype = new Error(), Pv; } var Dv; var KC; function P9() { if (KC) return Dv; KC = 1; var t13 = __(); Dv = e; function e(r) { try { t13(r); } catch (n) { if (n instanceof t13.CycleException) return false; throw n; } return true; } return Dv; } var Rv; var GC; function T_() { if (GC) return Rv; GC = 1; var t13 = Mr(); Rv = e; function e(n, a, i) { t13.isArray(a) || (a = [a]); var o = (n.isDirected() ? n.successors : n.neighbors).bind(n), s = [], u = {}; return t13.each(a, function(l) { if (!n.hasNode(l)) throw new Error("Graph does not have node: " + l); r(n, l, i === "post", u, o, s); }), s; } function r(n, a, i, o, s, u) { t13.has(o, a) || (o[a] = true, i || u.push(a), t13.each(s(a), function(l) { r(n, l, i, o, s, u); }), i && u.push(a)); } return Rv; } var Lv; var UC; function D9() { if (UC) return Lv; UC = 1; var t13 = T_(); Lv = e; function e(r, n) { return t13(r, n, "post"); } return Lv; } var Fv; var WC; function R9() { if (WC) return Fv; WC = 1; var t13 = T_(); Fv = e; function e(r, n) { return t13(r, n, "pre"); } return Fv; } var Mv; var jC; function L9() { if (jC) return Mv; jC = 1; var t13 = Mr(), e = dy(), r = E_(); Mv = n; function n(a, i) { var o = new e(), s = {}, u = new r(), l; function c(f) { var h10 = f.v === l ? f.w : f.v, v = u.priority(h10); if (v !== void 0) { var p = i(f); p < v && (s[h10] = l, u.decrease(h10, p)); } } if (a.nodeCount() === 0) return o; t13.each(a.nodes(), function(f) { u.add(f, Number.POSITIVE_INFINITY), o.setNode(f); }), u.decrease(a.nodes()[0], 0); for (var d = false; u.size() > 0; ) { if (l = u.removeMin(), t13.has(s, l)) o.setEdge(l, s[l]); else { if (d) throw new Error("Input graph is not connected: " + a); d = true; } a.nodeEdges(l).forEach(c); } return o; } return Mv; } var Nv; var YC; function F9() { return YC || (YC = 1, Nv = { components: T9(), dijkstra: S_(), dijkstraAll: I9(), findCycles: O9(), floydWarshall: A9(), isAcyclic: P9(), postorder: D9(), preorder: R9(), prim: L9(), tarjan: k_(), topsort: __() }), Nv; } var Bv; var ZC; function M9() { if (ZC) return Bv; ZC = 1; var t13 = k9(); return Bv = { Graph: t13.Graph, json: _9(), alg: F9(), version: t13.version }, Bv; } var $v; var XC; function Yr() { if (XC) return $v; XC = 1; var t13; if (typeof Yg == "function") try { t13 = M9(); } catch { } return t13 || (t13 = window.graphlib), $v = t13, $v; } var qv; var JC; function N9() { if (JC) return qv; JC = 1; var t13 = Jk(), e = 1, r = 4; function n(a) { return t13(a, e | r); } return qv = n, qv; } var zv; var QC; function vu() { if (QC) return zv; QC = 1; var t13 = Gi(), e = Rn(), r = au(), n = Fr(); function a(i, o, s) { if (!n(s)) return false; var u = typeof o; return (u == "number" ? e(s) && r(o, s.length) : u == "string" && o in s) ? t13(s[o], i) : false; } return zv = a, zv; } var Vv; var ex; function B9() { if (ex) return Vv; ex = 1; var t13 = fu(), e = Gi(), r = vu(), n = ja(), a = Object.prototype, i = a.hasOwnProperty, o = t13(function(s, u) { s = Object(s); var l = -1, c = u.length, d = c > 2 ? u[2] : void 0; for (d && r(u[0], u[1], d) && (c = 1); ++l < c; ) for (var f = u[l], h10 = n(f), v = -1, p = h10.length; ++v < p; ) { var g = h10[v], y = s[g]; (y === void 0 || e(y, a[g]) && !i.call(s, g)) && (s[g] = f[g]); } return s; }); return Vv = o, Vv; } var Hv; var tx; function $9() { if (tx) return Hv; tx = 1; var t13 = Ln(), e = Rn(), r = ca(); function n(a) { return function(i, o, s) { var u = Object(i); if (!e(i)) { var l = t13(o, 3); i = r(i), o = function(d) { return l(u[d], d, u); }; } var c = a(i, o, s); return c > -1 ? u[l ? i[c] : c] : void 0; }; } return Hv = n, Hv; } var Kv; var rx; function q9() { if (rx) return Kv; rx = 1; var t13 = /\s/; function e(r) { for (var n = r.length; n-- && t13.test(r.charAt(n)); ) ; return n; } return Kv = e, Kv; } var Gv; var nx; function z9() { if (nx) return Gv; nx = 1; var t13 = q9(), e = /^\s+/; function r(n) { return n && n.slice(0, t13(n) + 1).replace(e, ""); } return Gv = r, Gv; } var Uv; var ax; function V9() { if (ax) return Uv; ax = 1; var t13 = z9(), e = Fr(), r = Yi(), n = NaN, a = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, o = /^0o[0-7]+$/i, s = parseInt; function u(l) { if (typeof l == "number") return l; if (r(l)) return n; if (e(l)) { var c = typeof l.valueOf == "function" ? l.valueOf() : l; l = e(c) ? c + "" : c; } if (typeof l != "string") return l === 0 ? l : +l; l = t13(l); var d = i.test(l); return d || o.test(l) ? s(l.slice(2), d ? 2 : 8) : a.test(l) ? n : +l; } return Uv = u, Uv; } var Wv; var ix; function I_() { if (ix) return Wv; ix = 1; var t13 = V9(), e = 1 / 0, r = 17976931348623157e292; function n(a) { if (!a) return a === 0 ? a : 0; if (a = t13(a), a === e || a === -e) { var i = a < 0 ? -1 : 1; return i * r; } return a === a ? a : 0; } return Wv = n, Wv; } var jv; var ox; function H9() { if (ox) return jv; ox = 1; var t13 = I_(); function e(r) { var n = t13(r), a = n % 1; return n === n ? a ? n - a : n : 0; } return jv = e, jv; } var Yv; var sx; function K9() { if (sx) return Yv; sx = 1; var t13 = w_(), e = Ln(), r = H9(), n = Math.max; function a(i, o, s) { var u = i == null ? 0 : i.length; if (!u) return -1; var l = s == null ? 0 : r(s); return l < 0 && (l = n(u + l, 0)), t13(i, e(o, 3), l); } return Yv = a, Yv; } var Zv; var lx; function G9() { if (lx) return Zv; lx = 1; var t13 = $9(), e = K9(), r = t13(e); return Zv = r, Zv; } var Xv; var ux; function O_() { if (ux) return Xv; ux = 1; var t13 = cy(); function e(r) { var n = r == null ? 0 : r.length; return n ? t13(r, 1) : []; } return Xv = e, Xv; } var Jv; var cx; function U9() { if (cx) return Jv; cx = 1; var t13 = oy(), e = Qk(), r = ja(); function n(a, i) { return a == null ? a : t13(a, e(i), r); } return Jv = n, Jv; } var Qv; var dx; function W9() { if (dx) return Qv; dx = 1; function t13(e) { var r = e == null ? 0 : e.length; return r ? e[r - 1] : void 0; } return Qv = t13, Qv; } var eh; var fx; function j9() { if (fx) return eh; fx = 1; var t13 = ru(), e = sy(), r = Ln(); function n(a, i) { var o = {}; return i = r(i, 3), e(a, function(s, u, l) { t13(o, u, i(s, u, l)); }), o; } return eh = n, eh; } var th; var vx; function fy() { if (vx) return th; vx = 1; var t13 = Yi(); function e(r, n, a) { for (var i = -1, o = r.length; ++i < o; ) { var s = r[i], u = n(s); if (u != null && (l === void 0 ? u === u && !t13(u) : a(u, l))) var l = u, c = s; } return c; } return th = e, th; } var rh; var hx; function Y9() { if (hx) return rh; hx = 1; function t13(e, r) { return e > r; } return rh = t13, rh; } var nh; var px; function Z9() { if (px) return nh; px = 1; var t13 = fy(), e = Y9(), r = Ya(); function n(a) { return a && a.length ? t13(a, r, e) : void 0; } return nh = n, nh; } var ah; var gx; function A_() { if (gx) return ah; gx = 1; var t13 = ru(), e = Gi(); function r(n, a, i) { (i !== void 0 && !e(n[a], i) || i === void 0 && !(a in n)) && t13(n, a, i); } return ah = r, ah; } var ih; var yx; function X9() { if (yx) return ih; yx = 1; var t13 = Ua(), e = su(), r = hn(), n = "[object Object]", a = Function.prototype, i = Object.prototype, o = a.toString, s = i.hasOwnProperty, u = o.call(Object); function l(c) { if (!r(c) || t13(c) != n) return false; var d = e(c); if (d === null) return true; var f = s.call(d, "constructor") && d.constructor; return typeof f == "function" && f instanceof f && o.call(f) == u; } return ih = l, ih; } var oh; var mx; function P_() { if (mx) return oh; mx = 1; function t13(e, r) { if (!(r === "constructor" && typeof e[r] == "function") && r != "__proto__") return e[r]; } return oh = t13, oh; } var sh; var bx; function J9() { if (bx) return sh; bx = 1; var t13 = ds(), e = ja(); function r(n) { return t13(n, e(n)); } return sh = r, sh; } var lh; var wx; function Q9() { if (wx) return lh; wx = 1; var t13 = A_(), e = qk(), r = Yk(), n = zk(), a = Xk(), i = fs(), o = At(), s = C_(), u = Wi(), l = cs(), c = Fr(), d = X9(), f = vs(), h10 = P_(), v = J9(); function p(g, y, m, b, w, x, E) { var C = h10(g, m), k = h10(y, m), S = E.get(k); if (S) { t13(g, m, S); return; } var _ = x ? x(C, k, m + "", g, y, E) : void 0, T = _ === void 0; if (T) { var O = o(k), D = !O && u(k), A = !O && !D && f(k); _ = k, O || D || A ? o(C) ? _ = C : s(C) ? _ = n(C) : D ? (T = false, _ = e(k, true)) : A ? (T = false, _ = r(k, true)) : _ = [] : d(k) || i(k) ? (_ = C, i(C) ? _ = v(C) : (!c(C) || l(C)) && (_ = a(k))) : T = false; } T && (E.set(k, _), w(_, k, b, x, E), E.delete(k)), t13(g, m, _); } return lh = p, lh; } var uh; var Cx; function eH() { if (Cx) return uh; Cx = 1; var t13 = tu(), e = A_(), r = oy(), n = Q9(), a = Fr(), i = ja(), o = P_(); function s(u, l, c, d, f) { u !== l && r(l, function(h10, v) { if (f || (f = new t13()), a(h10)) n(u, l, v, c, s, d, f); else { var p = d ? d(o(u, v), h10, v + "", u, l, f) : void 0; p === void 0 && (p = h10), e(u, v, p); } }, i); } return uh = s, uh; } var ch; var xx; function tH() { if (xx) return ch; xx = 1; var t13 = fu(), e = vu(); function r(n) { return t13(function(a, i) { var o = -1, s = i.length, u = s > 1 ? i[s - 1] : void 0, l = s > 2 ? i[2] : void 0; for (u = n.length > 3 && typeof u == "function" ? (s--, u) : void 0, l && e(i[0], i[1], l) && (u = s < 3 ? void 0 : u, s = 1), a = Object(a); ++o < s; ) { var c = i[o]; c && n(a, c, o, u); } return a; }); } return ch = r, ch; } var dh; var Ex; function rH() { if (Ex) return dh; Ex = 1; var t13 = eH(), e = tH(), r = e(function(n, a, i) { t13(n, a, i); }); return dh = r, dh; } var fh; var Sx; function D_() { if (Sx) return fh; Sx = 1; function t13(e, r) { return e < r; } return fh = t13, fh; } var vh; var kx; function nH() { if (kx) return vh; kx = 1; var t13 = fy(), e = D_(), r = Ya(); function n(a) { return a && a.length ? t13(a, r, e) : void 0; } return vh = n, vh; } var hh; var _x; function aH() { if (_x) return hh; _x = 1; var t13 = fy(), e = Ln(), r = D_(); function n(a, i) { return a && a.length ? t13(a, e(i, 2), r) : void 0; } return hh = n, hh; } var ph; var Tx; function iH() { if (Tx) return ph; Tx = 1; var t13 = Jr(), e = function() { return t13.Date.now(); }; return ph = e, ph; } var gh; var Ix; function oH() { if (Ix) return gh; Ix = 1; var t13 = nu(), e = cu(), r = au(), n = Fr(), a = hs(); function i(o, s, u, l) { if (!n(o)) return o; s = e(s, o); for (var c = -1, d = s.length, f = d - 1, h10 = o; h10 != null && ++c < d; ) { var v = a(s[c]), p = u; if (v === "__proto__" || v === "constructor" || v === "prototype") return o; if (c != f) { var g = h10[v]; p = l ? l(g, v, h10) : void 0, p === void 0 && (p = n(g) ? g : r(s[c + 1]) ? [] : {}); } t13(h10, v, p), h10 = h10[v]; } return o; } return gh = i, gh; } var yh; var Ox; function sH() { if (Ox) return yh; Ox = 1; var t13 = du(), e = oH(), r = cu(); function n(a, i, o) { for (var s = -1, u = i.length, l = {}; ++s < u; ) { var c = i[s], d = t13(a, c); o(d, c) && e(l, r(c, a), d); } return l; } return yh = n, yh; } var mh; var Ax; function lH() { if (Ax) return mh; Ax = 1; var t13 = sH(), e = c_(); function r(n, a) { return t13(n, a, function(i, o) { return e(n, o); }); } return mh = r, mh; } var bh; var Px; function uH() { if (Px) return bh; Px = 1; var t13 = O_(), e = m_(), r = b_(); function n(a) { return r(e(a, void 0, t13), a + ""); } return bh = n, bh; } var wh; var Dx; function cH() { if (Dx) return wh; Dx = 1; var t13 = lH(), e = uH(), r = e(function(n, a) { return n == null ? {} : t13(n, a); }); return wh = r, wh; } var Ch; var Rx; function dH() { if (Rx) return Ch; Rx = 1; var t13 = Math.ceil, e = Math.max; function r(n, a, i, o) { for (var s = -1, u = e(t13((a - n) / (i || 1)), 0), l = Array(u); u--; ) l[o ? u : ++s] = n, n += i; return l; } return Ch = r, Ch; } var xh; var Lx; function fH() { if (Lx) return xh; Lx = 1; var t13 = dH(), e = vu(), r = I_(); function n(a) { return function(i, o, s) { return s && typeof s != "number" && e(i, o, s) && (o = s = void 0), i = r(i), o === void 0 ? (o = i, i = 0) : o = r(o), s = s === void 0 ? i < o ? 1 : -1 : r(s), t13(i, o, s, a); }; } return xh = n, xh; } var Eh; var Fx; function vH() { if (Fx) return Eh; Fx = 1; var t13 = fH(), e = t13(); return Eh = e, Eh; } var Sh; var Mx; function hH() { if (Mx) return Sh; Mx = 1; function t13(e, r) { var n = e.length; for (e.sort(r); n--; ) e[n] = e[n].value; return e; } return Sh = t13, Sh; } var kh; var Nx; function pH() { if (Nx) return kh; Nx = 1; var t13 = Yi(); function e(r, n) { if (r !== n) { var a = r !== void 0, i = r === null, o = r === r, s = t13(r), u = n !== void 0, l = n === null, c = n === n, d = t13(n); if (!l && !d && !s && r > n || s && u && c && !l && !d || i && u && c || !a && c || !o) return 1; if (!i && !s && !d && r < n || d && a && o && !i && !s || l && a && o || !u && o || !c) return -1; } return 0; } return kh = e, kh; } var _h; var Bx; function gH() { if (Bx) return _h; Bx = 1; var t13 = pH(); function e(r, n, a) { for (var i = -1, o = r.criteria, s = n.criteria, u = o.length, l = a.length; ++i < u; ) { var c = t13(o[i], s[i]); if (c) { if (i >= l) return c; var d = a[i]; return c * (d == "desc" ? -1 : 1); } } return r.index - n.index; } return _h = e, _h; } var Th; var $x; function yH() { if ($x) return Th; $x = 1; var t13 = uu(), e = du(), r = Ln(), n = p_(), a = hH(), i = iu(), o = gH(), s = Ya(), u = At(); function l(c, d, f) { d.length ? d = t13(d, function(p) { return u(p) ? function(g) { return e(g, p.length === 1 ? p[0] : p); } : p; }) : d = [s]; var h10 = -1; d = t13(d, i(r)); var v = n(c, function(p, g, y) { var m = t13(d, function(b) { return b(p); }); return { criteria: m, index: ++h10, value: p }; }); return a(v, function(p, g) { return o(p, g, f); }); } return Th = l, Th; } var Ih; var qx; function mH() { if (qx) return Ih; qx = 1; var t13 = cy(), e = yH(), r = fu(), n = vu(), a = r(function(i, o) { if (i == null) return []; var s = o.length; return s > 1 && n(i, o[0], o[1]) ? o = [] : s > 2 && n(o[0], o[1], o[2]) && (o = [o[0]]), e(i, t13(o, 1), []); }); return Ih = a, Ih; } var Oh; var zx; function bH() { if (zx) return Oh; zx = 1; var t13 = l_(), e = 0; function r(n) { var a = ++e; return t13(n) + a; } return Oh = r, Oh; } var Ah; var Vx; function wH() { if (Vx) return Ah; Vx = 1; function t13(e, r, n) { for (var a = -1, i = e.length, o = r.length, s = {}; ++a < i; ) { var u = a < o ? r[a] : void 0; n(s, e[a], u); } return s; } return Ah = t13, Ah; } var Ph; var Hx; function CH() { if (Hx) return Ph; Hx = 1; var t13 = nu(), e = wH(); function r(n, a) { return e(n || [], a || [], t13); } return Ph = r, Ph; } var Dh; var Kx; function gt() { if (Kx) return Dh; Kx = 1; var t13; if (typeof Yg == "function") try { t13 = { cloneDeep: N9(), constant: iy(), defaults: B9(), each: t_(), filter: f_(), find: G9(), flatten: O_(), forEach: e_(), forIn: U9(), has: v_(), isUndefined: h_(), last: W9(), map: g_(), mapValues: j9(), max: Z9(), merge: rH(), min: nH(), minBy: aH(), now: iH(), pick: cH(), range: vH(), reduce: y_(), sortBy: mH(), uniqueId: bH(), values: x_(), zipObject: CH() }; } catch { } return t13 || (t13 = window._), Dh = t13, Dh; } var Rh; var Gx; function xH() { if (Gx) return Rh; Gx = 1, Rh = t13; function t13() { var n = {}; n._next = n._prev = n, this._sentinel = n; } t13.prototype.dequeue = function() { var n = this._sentinel, a = n._prev; if (a !== n) return e(a), a; }, t13.prototype.enqueue = function(n) { var a = this._sentinel; n._prev && n._next && e(n), n._next = a._next, a._next._prev = n, a._next = n, n._prev = a; }, t13.prototype.toString = function() { for (var n = [], a = this._sentinel, i = a._prev; i !== a; ) n.push(JSON.stringify(i, r)), i = i._prev; return "[" + n.join(", ") + "]"; }; function e(n) { n._prev._next = n._next, n._next._prev = n._prev, delete n._next, delete n._prev; } function r(n, a) { if (n !== "_next" && n !== "_prev") return a; } return Rh; } var Lh; var Ux; function EH() { if (Ux) return Lh; Ux = 1; var t13 = gt(), e = Yr().Graph, r = xH(); Lh = a; var n = t13.constant(1); function a(l, c) { if (l.nodeCount() <= 1) return []; var d = s(l, c || n), f = i(d.graph, d.buckets, d.zeroIdx); return t13.flatten(t13.map(f, function(h10) { return l.outEdges(h10.v, h10.w); }), true); } function i(l, c, d) { for (var f = [], h10 = c[c.length - 1], v = c[0], p; l.nodeCount(); ) { for (; p = v.dequeue(); ) o(l, c, d, p); for (; p = h10.dequeue(); ) o(l, c, d, p); if (l.nodeCount()) { for (var g = c.length - 2; g > 0; --g) if (p = c[g].dequeue(), p) { f = f.concat(o(l, c, d, p, true)); break; } } } return f; } function o(l, c, d, f, h10) { var v = h10 ? [] : void 0; return t13.forEach(l.inEdges(f.v), function(p) { var g = l.edge(p), y = l.node(p.v); h10 && v.push({ v: p.v, w: p.w }), y.out -= g, u(c, d, y); }), t13.forEach(l.outEdges(f.v), function(p) { var g = l.edge(p), y = p.w, m = l.node(y); m.in -= g, u(c, d, m); }), l.removeNode(f.v), v; } function s(l, c) { var d = new e(), f = 0, h10 = 0; t13.forEach(l.nodes(), function(g) { d.setNode(g, { v: g, in: 0, out: 0 }); }), t13.forEach(l.edges(), function(g) { var y = d.edge(g.v, g.w) || 0, m = c(g), b = y + m; d.setEdge(g.v, g.w, b), h10 = Math.max(h10, d.node(g.v).out += m), f = Math.max(f, d.node(g.w).in += m); }); var v = t13.range(h10 + f + 3).map(function() { return new r(); }), p = f + 1; return t13.forEach(d.nodes(), function(g) { u(v, p, d.node(g)); }), { graph: d, buckets: v, zeroIdx: p }; } function u(l, c, d) { d.out ? d.in ? l[d.out - d.in + c].enqueue(d) : l[l.length - 1].enqueue(d) : l[0].enqueue(d); } return Lh; } var Fh; var Wx; function SH() { if (Wx) return Fh; Wx = 1; var t13 = gt(), e = EH(); Fh = { run: r, undo: a }; function r(i) { var o = i.graph().acyclicer === "greedy" ? e(i, s(i)) : n(i); t13.forEach(o, function(u) { var l = i.edge(u); i.removeEdge(u), l.forwardName = u.name, l.reversed = true, i.setEdge(u.w, u.v, l, t13.uniqueId("rev")); }); function s(u) { return function(l) { return u.edge(l).weight; }; } } function n(i) { var o = [], s = {}, u = {}; function l(c) { t13.has(u, c) || (u[c] = true, s[c] = true, t13.forEach(i.outEdges(c), function(d) { t13.has(s, d.w) ? o.push(d) : l(d.w); }), delete s[c]); } return t13.forEach(i.nodes(), l), o; } function a(i) { t13.forEach(i.edges(), function(o) { var s = i.edge(o); if (s.reversed) { i.removeEdge(o); var u = s.forwardName; delete s.reversed, delete s.forwardName, i.setEdge(o.w, o.v, s, u); } }); } return Fh; } var Mh; var jx; function yr() { if (jx) return Mh; jx = 1; var t13 = gt(), e = Yr().Graph; Mh = { addDummyNode: r, simplify: n, asNonCompoundGraph: a, successorWeights: i, predecessorWeights: o, intersectRect: s, buildLayerMatrix: u, normalizeRanks: l, removeEmptyRanks: c, addBorderNode: d, maxRank: f, partition: h10, time: v, notime: p }; function r(g, y, m, b) { var w; do w = t13.uniqueId(b); while (g.hasNode(w)); return m.dummy = y, g.setNode(w, m), w; } function n(g) { var y = new e().setGraph(g.graph()); return t13.forEach(g.nodes(), function(m) { y.setNode(m, g.node(m)); }), t13.forEach(g.edges(), function(m) { var b = y.edge(m.v, m.w) || { weight: 0, minlen: 1 }, w = g.edge(m); y.setEdge(m.v, m.w, { weight: b.weight + w.weight, minlen: Math.max(b.minlen, w.minlen) }); }), y; } function a(g) { var y = new e({ multigraph: g.isMultigraph() }).setGraph(g.graph()); return t13.forEach(g.nodes(), function(m) { g.children(m).length || y.setNode(m, g.node(m)); }), t13.forEach(g.edges(), function(m) { y.setEdge(m, g.edge(m)); }), y; } function i(g) { var y = t13.map(g.nodes(), function(m) { var b = {}; return t13.forEach(g.outEdges(m), function(w) { b[w.w] = (b[w.w] || 0) + g.edge(w).weight; }), b; }); return t13.zipObject(g.nodes(), y); } function o(g) { var y = t13.map(g.nodes(), function(m) { var b = {}; return t13.forEach(g.inEdges(m), function(w) { b[w.v] = (b[w.v] || 0) + g.edge(w).weight; }), b; }); return t13.zipObject(g.nodes(), y); } function s(g, y) { var m = g.x, b = g.y, w = y.x - m, x = y.y - b, E = g.width / 2, C = g.height / 2; if (!w && !x) throw new Error("Not possible to find intersection inside of the rectangle"); var k, S; return Math.abs(x) * E > Math.abs(w) * C ? (x < 0 && (C = -C), k = C * w / x, S = C) : (w < 0 && (E = -E), k = E, S = E * x / w), { x: m + k, y: b + S }; } function u(g) { var y = t13.map(t13.range(f(g) + 1), function() { return []; }); return t13.forEach(g.nodes(), function(m) { var b = g.node(m), w = b.rank; t13.isUndefined(w) || (y[w][b.order] = m); }), y; } function l(g) { var y = t13.min(t13.map(g.nodes(), function(m) { return g.node(m).rank; })); t13.forEach(g.nodes(), function(m) { var b = g.node(m); t13.has(b, "rank") && (b.rank -= y); }); } function c(g) { var y = t13.min(t13.map(g.nodes(), function(x) { return g.node(x).rank; })), m = []; t13.forEach(g.nodes(), function(x) { var E = g.node(x).rank - y; m[E] || (m[E] = []), m[E].push(x); }); var b = 0, w = g.graph().nodeRankFactor; t13.forEach(m, function(x, E) { t13.isUndefined(x) && E % w !== 0 ? --b : b && t13.forEach(x, function(C) { g.node(C).rank += b; }); }); } function d(g, y, m, b) { var w = { width: 0, height: 0 }; return arguments.length >= 4 && (w.rank = m, w.order = b), r(g, "border", w, y); } function f(g) { return t13.max(t13.map(g.nodes(), function(y) { var m = g.node(y).rank; if (!t13.isUndefined(m)) return m; })); } function h10(g, y) { var m = { lhs: [], rhs: [] }; return t13.forEach(g, function(b) { y(b) ? m.lhs.push(b) : m.rhs.push(b); }), m; } function v(g, y) { var m = t13.now(); try { return y(); } finally { console.log(g + " time: " + (t13.now() - m) + "ms"); } } function p(g, y) { return y(); } return Mh; } var Nh; var Yx; function kH() { if (Yx) return Nh; Yx = 1; var t13 = gt(), e = yr(); Nh = { run: r, undo: a }; function r(i) { i.graph().dummyChains = [], t13.forEach(i.edges(), function(o) { n(i, o); }); } function n(i, o) { var s = o.v, u = i.node(s).rank, l = o.w, c = i.node(l).rank, d = o.name, f = i.edge(o), h10 = f.labelRank; if (c !== u + 1) { i.removeEdge(o); var v, p, g; for (g = 0, ++u; u < c; ++g, ++u) f.points = [], p = { width: 0, height: 0, edgeLabel: f, edgeObj: o, rank: u }, v = e.addDummyNode(i, "edge", p, "_d"), u === h10 && (p.width = f.width, p.height = f.height, p.dummy = "edge-label", p.labelpos = f.labelpos), i.setEdge(s, v, { weight: f.weight }, d), g === 0 && i.graph().dummyChains.push(v), s = v; i.setEdge(s, l, { weight: f.weight }, d); } } function a(i) { t13.forEach(i.graph().dummyChains, function(o) { var s = i.node(o), u = s.edgeLabel, l; for (i.setEdge(s.edgeObj, u); s.dummy; ) l = i.successors(o)[0], i.removeNode(o), u.points.push({ x: s.x, y: s.y }), s.dummy === "edge-label" && (u.x = s.x, u.y = s.y, u.width = s.width, u.height = s.height), o = l, s = i.node(o); }); } return Nh; } var Bh; var Zx; function ml() { if (Zx) return Bh; Zx = 1; var t13 = gt(); Bh = { longestPath: e, slack: r }; function e(n) { var a = {}; function i(o) { var s = n.node(o); if (t13.has(a, o)) return s.rank; a[o] = true; var u = t13.min(t13.map(n.outEdges(o), function(l) { return i(l.w) - n.edge(l).minlen; })); return (u === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3 u === void 0 || // return value of _.map([]) for Lodash 4 u === null) && (u = 0), s.rank = u; } t13.forEach(n.sources(), i); } function r(n, a) { return n.node(a.w).rank - n.node(a.v).rank - n.edge(a).minlen; } return Bh; } var $h; var Xx; function R_() { if (Xx) return $h; Xx = 1; var t13 = gt(), e = Yr().Graph, r = ml().slack; $h = n; function n(s) { var u = new e({ directed: false }), l = s.nodes()[0], c = s.nodeCount(); u.setNode(l, {}); for (var d, f; a(u, s) < c; ) d = i(u, s), f = u.hasNode(d.v) ? r(s, d) : -r(s, d), o(u, s, f); return u; } function a(s, u) { function l(c) { t13.forEach(u.nodeEdges(c), function(d) { var f = d.v, h10 = c === f ? d.w : f; !s.hasNode(h10) && !r(u, d) && (s.setNode(h10, {}), s.setEdge(c, h10, {}), l(h10)); }); } return t13.forEach(s.nodes(), l), s.nodeCount(); } function i(s, u) { return t13.minBy(u.edges(), function(l) { if (s.hasNode(l.v) !== s.hasNode(l.w)) return r(u, l); }); } function o(s, u, l) { t13.forEach(s.nodes(), function(c) { u.node(c).rank += l; }); } return $h; } var qh; var Jx; function _H() { if (Jx) return qh; Jx = 1; var t13 = gt(), e = R_(), r = ml().slack, n = ml().longestPath, a = Yr().alg.preorder, i = Yr().alg.postorder, o = yr().simplify; qh = s, s.initLowLimValues = d, s.initCutValues = u, s.calcCutValue = c, s.leaveEdge = h10, s.enterEdge = v, s.exchangeEdges = p; function s(b) { b = o(b), n(b); var w = e(b); d(w), u(w, b); for (var x, E; x = h10(w); ) E = v(w, b, x), p(w, b, x, E); } function u(b, w) { var x = i(b, b.nodes()); x = x.slice(0, x.length - 1), t13.forEach(x, function(E) { l(b, w, E); }); } function l(b, w, x) { var E = b.node(x), C = E.parent; b.edge(x, C).cutvalue = c(b, w, x); } function c(b, w, x) { var E = b.node(x), C = E.parent, k = true, S = w.edge(x, C), _ = 0; return S || (k = false, S = w.edge(C, x)), _ = S.weight, t13.forEach(w.nodeEdges(x), function(T) { var O = T.v === x, D = O ? T.w : T.v; if (D !== C) { var A = O === k, F = w.edge(T).weight; if (_ += A ? F : -F, y(b, x, D)) { var R = b.edge(x, D).cutvalue; _ += A ? -R : R; } } }), _; } function d(b, w) { arguments.length < 2 && (w = b.nodes()[0]), f(b, {}, 1, w); } function f(b, w, x, E, C) { var k = x, S = b.node(E); return w[E] = true, t13.forEach(b.neighbors(E), function(_) { t13.has(w, _) || (x = f(b, w, x, _, E)); }), S.low = k, S.lim = x++, C ? S.parent = C : delete S.parent, x; } function h10(b) { return t13.find(b.edges(), function(w) { return b.edge(w).cutvalue < 0; }); } function v(b, w, x) { var E = x.v, C = x.w; w.hasEdge(E, C) || (E = x.w, C = x.v); var k = b.node(E), S = b.node(C), _ = k, T = false; k.lim > S.lim && (_ = S, T = true); var O = t13.filter(w.edges(), function(D) { return T === m(b, b.node(D.v), _) && T !== m(b, b.node(D.w), _); }); return t13.minBy(O, function(D) { return r(w, D); }); } function p(b, w, x, E) { var C = x.v, k = x.w; b.removeEdge(C, k), b.setEdge(E.v, E.w, {}), d(b), u(b, w), g(b, w); } function g(b, w) { var x = t13.find(b.nodes(), function(C) { return !w.node(C).parent; }), E = a(b, x); E = E.slice(1), t13.forEach(E, function(C) { var k = b.node(C).parent, S = w.edge(C, k), _ = false; S || (S = w.edge(k, C), _ = true), w.node(C).rank = w.node(k).rank + (_ ? S.minlen : -S.minlen); }); } function y(b, w, x) { return b.hasEdge(w, x); } function m(b, w, x) { return x.low <= w.lim && w.lim <= x.lim; } return qh; } var zh; var Qx; function TH() { if (Qx) return zh; Qx = 1; var t13 = ml(), e = t13.longestPath, r = R_(), n = _H(); zh = a; function a(u) { switch (u.graph().ranker) { case "network-simplex": s(u); break; case "tight-tree": o(u); break; case "longest-path": i(u); break; default: s(u); } } var i = e; function o(u) { e(u), r(u); } function s(u) { n(u); } return zh; } var Vh; var eE; function IH() { if (eE) return Vh; eE = 1; var t13 = gt(); Vh = e; function e(a) { var i = n(a); t13.forEach(a.graph().dummyChains, function(o) { for (var s = a.node(o), u = s.edgeObj, l = r(a, i, u.v, u.w), c = l.path, d = l.lca, f = 0, h10 = c[f], v = true; o !== u.w; ) { if (s = a.node(o), v) { for (; (h10 = c[f]) !== d && a.node(h10).maxRank < s.rank; ) f++; h10 === d && (v = false); } if (!v) { for (; f < c.length - 1 && a.node(h10 = c[f + 1]).minRank <= s.rank; ) f++; h10 = c[f]; } a.setParent(o, h10), o = a.successors(o)[0]; } }); } function r(a, i, o, s) { var u = [], l = [], c = Math.min(i[o].low, i[s].low), d = Math.max(i[o].lim, i[s].lim), f, h10; f = o; do f = a.parent(f), u.push(f); while (f && (i[f].low > c || d > i[f].lim)); for (h10 = f, f = s; (f = a.parent(f)) !== h10; ) l.push(f); return { path: u.concat(l.reverse()), lca: h10 }; } function n(a) { var i = {}, o = 0; function s(u) { var l = o; t13.forEach(a.children(u), s), i[u] = { low: l, lim: o++ }; } return t13.forEach(a.children(), s), i; } return Vh; } var Hh; var tE; function OH() { if (tE) return Hh; tE = 1; var t13 = gt(), e = yr(); Hh = { run: r, cleanup: o }; function r(s) { var u = e.addDummyNode(s, "root", {}, "_root"), l = a(s), c = t13.max(t13.values(l)) - 1, d = 2 * c + 1; s.graph().nestingRoot = u, t13.forEach(s.edges(), function(h10) { s.edge(h10).minlen *= d; }); var f = i(s) + 1; t13.forEach(s.children(), function(h10) { n(s, u, d, f, c, l, h10); }), s.graph().nodeRankFactor = d; } function n(s, u, l, c, d, f, h10) { var v = s.children(h10); if (!v.length) { h10 !== u && s.setEdge(u, h10, { weight: 0, minlen: l }); return; } var p = e.addBorderNode(s, "_bt"), g = e.addBorderNode(s, "_bb"), y = s.node(h10); s.setParent(p, h10), y.borderTop = p, s.setParent(g, h10), y.borderBottom = g, t13.forEach(v, function(m) { n(s, u, l, c, d, f, m); var b = s.node(m), w = b.borderTop ? b.borderTop : m, x = b.borderBottom ? b.borderBottom : m, E = b.borderTop ? c : 2 * c, C = w !== x ? 1 : d - f[h10] + 1; s.setEdge(p, w, { weight: E, minlen: C, nestingEdge: true }), s.setEdge(x, g, { weight: E, minlen: C, nestingEdge: true }); }), s.parent(h10) || s.setEdge(u, p, { weight: 0, minlen: d + f[h10] }); } function a(s) { var u = {}; function l(c, d) { var f = s.children(c); f && f.length && t13.forEach(f, function(h10) { l(h10, d + 1); }), u[c] = d; } return t13.forEach(s.children(), function(c) { l(c, 1); }), u; } function i(s) { return t13.reduce(s.edges(), function(u, l) { return u + s.edge(l).weight; }, 0); } function o(s) { var u = s.graph(); s.removeNode(u.nestingRoot), delete u.nestingRoot, t13.forEach(s.edges(), function(l) { var c = s.edge(l); c.nestingEdge && s.removeEdge(l); }); } return Hh; } var Kh; var rE; function AH() { if (rE) return Kh; rE = 1; var t13 = gt(), e = yr(); Kh = r; function r(a) { function i(o) { var s = a.children(o), u = a.node(o); if (s.length && t13.forEach(s, i), t13.has(u, "minRank")) { u.borderLeft = [], u.borderRight = []; for (var l = u.minRank, c = u.maxRank + 1; l < c; ++l) n(a, "borderLeft", "_bl", o, u, l), n(a, "borderRight", "_br", o, u, l); } } t13.forEach(a.children(), i); } function n(a, i, o, s, u, l) { var c = { width: 0, height: 0, rank: l, borderType: i }, d = u[i][l - 1], f = e.addDummyNode(a, "border", c, o); u[i][l] = f, a.setParent(f, s), d && a.setEdge(d, f, { weight: 1 }); } return Kh; } var Gh; var nE; function PH() { if (nE) return Gh; nE = 1; var t13 = gt(); Gh = { adjust: e, undo: r }; function e(l) { var c = l.graph().rankdir.toLowerCase(); (c === "lr" || c === "rl") && n(l); } function r(l) { var c = l.graph().rankdir.toLowerCase(); (c === "bt" || c === "rl") && i(l), (c === "lr" || c === "rl") && (s(l), n(l)); } function n(l) { t13.forEach(l.nodes(), function(c) { a(l.node(c)); }), t13.forEach(l.edges(), function(c) { a(l.edge(c)); }); } function a(l) { var c = l.width; l.width = l.height, l.height = c; } function i(l) { t13.forEach(l.nodes(), function(c) { o(l.node(c)); }), t13.forEach(l.edges(), function(c) { var d = l.edge(c); t13.forEach(d.points, o), t13.has(d, "y") && o(d); }); } function o(l) { l.y = -l.y; } function s(l) { t13.forEach(l.nodes(), function(c) { u(l.node(c)); }), t13.forEach(l.edges(), function(c) { var d = l.edge(c); t13.forEach(d.points, u), t13.has(d, "x") && u(d); }); } function u(l) { var c = l.x; l.x = l.y, l.y = c; } return Gh; } var Uh; var aE; function DH() { if (aE) return Uh; aE = 1; var t13 = gt(); Uh = e; function e(r) { var n = {}, a = t13.filter(r.nodes(), function(l) { return !r.children(l).length; }), i = t13.max(t13.map(a, function(l) { return r.node(l).rank; })), o = t13.map(t13.range(i + 1), function() { return []; }); function s(l) { if (!t13.has(n, l)) { n[l] = true; var c = r.node(l); o[c.rank].push(l), t13.forEach(r.successors(l), s); } } var u = t13.sortBy(a, function(l) { return r.node(l).rank; }); return t13.forEach(u, s), o; } return Uh; } var Wh; var iE; function RH() { if (iE) return Wh; iE = 1; var t13 = gt(); Wh = e; function e(n, a) { for (var i = 0, o = 1; o < a.length; ++o) i += r(n, a[o - 1], a[o]); return i; } function r(n, a, i) { for (var o = t13.zipObject( i, t13.map(i, function(f, h10) { return h10; }) ), s = t13.flatten(t13.map(a, function(f) { return t13.sortBy(t13.map(n.outEdges(f), function(h10) { return { pos: o[h10.w], weight: n.edge(h10).weight }; }), "pos"); }), true), u = 1; u < i.length; ) u <<= 1; var l = 2 * u - 1; u -= 1; var c = t13.map(new Array(l), function() { return 0; }), d = 0; return t13.forEach(s.forEach(function(f) { var h10 = f.pos + u; c[h10] += f.weight; for (var v = 0; h10 > 0; ) h10 % 2 && (v += c[h10 + 1]), h10 = h10 - 1 >> 1, c[h10] += f.weight; d += f.weight * v; })), d; } return Wh; } var jh; var oE; function LH() { if (oE) return jh; oE = 1; var t13 = gt(); jh = e; function e(r, n) { return t13.map(n, function(a) { var i = r.inEdges(a); if (i.length) { var o = t13.reduce(i, function(s, u) { var l = r.edge(u), c = r.node(u.v); return { sum: s.sum + l.weight * c.order, weight: s.weight + l.weight }; }, { sum: 0, weight: 0 }); return { v: a, barycenter: o.sum / o.weight, weight: o.weight }; } else return { v: a }; }); } return jh; } var Yh; var sE; function FH() { if (sE) return Yh; sE = 1; var t13 = gt(); Yh = e; function e(a, i) { var o = {}; t13.forEach(a, function(u, l) { var c = o[u.v] = { indegree: 0, in: [], out: [], vs: [u.v], i: l }; t13.isUndefined(u.barycenter) || (c.barycenter = u.barycenter, c.weight = u.weight); }), t13.forEach(i.edges(), function(u) { var l = o[u.v], c = o[u.w]; !t13.isUndefined(l) && !t13.isUndefined(c) && (c.indegree++, l.out.push(o[u.w])); }); var s = t13.filter(o, function(u) { return !u.indegree; }); return r(s); } function r(a) { var i = []; function o(l) { return function(c) { c.merged || (t13.isUndefined(c.barycenter) || t13.isUndefined(l.barycenter) || c.barycenter >= l.barycenter) && n(l, c); }; } function s(l) { return function(c) { c.in.push(l), --c.indegree === 0 && a.push(c); }; } for (; a.length; ) { var u = a.pop(); i.push(u), t13.forEach(u.in.reverse(), o(u)), t13.forEach(u.out, s(u)); } return t13.map( t13.filter(i, function(l) { return !l.merged; }), function(l) { return t13.pick(l, ["vs", "i", "barycenter", "weight"]); } ); } function n(a, i) { var o = 0, s = 0; a.weight && (o += a.barycenter * a.weight, s += a.weight), i.weight && (o += i.barycenter * i.weight, s += i.weight), a.vs = i.vs.concat(a.vs), a.barycenter = o / s, a.weight = s, a.i = Math.min(i.i, a.i), i.merged = true; } return Yh; } var Zh; var lE; function MH() { if (lE) return Zh; lE = 1; var t13 = gt(), e = yr(); Zh = r; function r(i, o) { var s = e.partition(i, function(p) { return t13.has(p, "barycenter"); }), u = s.lhs, l = t13.sortBy(s.rhs, function(p) { return -p.i; }), c = [], d = 0, f = 0, h10 = 0; u.sort(a(!!o)), h10 = n(c, l, h10), t13.forEach(u, function(p) { h10 += p.vs.length, c.push(p.vs), d += p.barycenter * p.weight, f += p.weight, h10 = n(c, l, h10); }); var v = { vs: t13.flatten(c, true) }; return f && (v.barycenter = d / f, v.weight = f), v; } function n(i, o, s) { for (var u; o.length && (u = t13.last(o)).i <= s; ) o.pop(), i.push(u.vs), s++; return s; } function a(i) { return function(o, s) { return o.barycenter < s.barycenter ? -1 : o.barycenter > s.barycenter ? 1 : i ? s.i - o.i : o.i - s.i; }; } return Zh; } var Xh; var uE; function NH() { if (uE) return Xh; uE = 1; var t13 = gt(), e = LH(), r = FH(), n = MH(); Xh = a; function a(s, u, l, c) { var d = s.children(u), f = s.node(u), h10 = f ? f.borderLeft : void 0, v = f ? f.borderRight : void 0, p = {}; h10 && (d = t13.filter(d, function(x) { return x !== h10 && x !== v; })); var g = e(s, d); t13.forEach(g, function(x) { if (s.children(x.v).length) { var E = a(s, x.v, l, c); p[x.v] = E, t13.has(E, "barycenter") && o(x, E); } }); var y = r(g, l); i(y, p); var m = n(y, c); if (h10 && (m.vs = t13.flatten([h10, m.vs, v], true), s.predecessors(h10).length)) { var b = s.node(s.predecessors(h10)[0]), w = s.node(s.predecessors(v)[0]); t13.has(m, "barycenter") || (m.barycenter = 0, m.weight = 0), m.barycenter = (m.barycenter * m.weight + b.order + w.order) / (m.weight + 2), m.weight += 2; } return m; } function i(s, u) { t13.forEach(s, function(l) { l.vs = t13.flatten(l.vs.map(function(c) { return u[c] ? u[c].vs : c; }), true); }); } function o(s, u) { t13.isUndefined(s.barycenter) ? (s.barycenter = u.barycenter, s.weight = u.weight) : (s.barycenter = (s.barycenter * s.weight + u.barycenter * u.weight) / (s.weight + u.weight), s.weight += u.weight); } return Xh; } var Jh; var cE; function BH() { if (cE) return Jh; cE = 1; var t13 = gt(), e = Yr().Graph; Jh = r; function r(a, i, o) { var s = n(a), u = new e({ compound: true }).setGraph({ root: s }).setDefaultNodeLabel(function(l) { return a.node(l); }); return t13.forEach(a.nodes(), function(l) { var c = a.node(l), d = a.parent(l); (c.rank === i || c.minRank <= i && i <= c.maxRank) && (u.setNode(l), u.setParent(l, d || s), t13.forEach(a[o](l), function(f) { var h10 = f.v === l ? f.w : f.v, v = u.edge(h10, l), p = t13.isUndefined(v) ? 0 : v.weight; u.setEdge(h10, l, { weight: a.edge(f).weight + p }); }), t13.has(c, "minRank") && u.setNode(l, { borderLeft: c.borderLeft[i], borderRight: c.borderRight[i] })); }), u; } function n(a) { for (var i; a.hasNode(i = t13.uniqueId("_root")); ) ; return i; } return Jh; } var Qh; var dE; function $H() { if (dE) return Qh; dE = 1; var t13 = gt(); Qh = e; function e(r, n, a) { var i = {}, o; t13.forEach(a, function(s) { for (var u = r.parent(s), l, c; u; ) { if (l = r.parent(u), l ? (c = i[l], i[l] = u) : (c = o, o = u), c && c !== u) { n.setEdge(c, u); return; } u = l; } }); } return Qh; } var ep; var fE; function qH() { if (fE) return ep; fE = 1; var t13 = gt(), e = DH(), r = RH(), n = NH(), a = BH(), i = $H(), o = Yr().Graph, s = yr(); ep = u; function u(f) { var h10 = s.maxRank(f), v = l(f, t13.range(1, h10 + 1), "inEdges"), p = l(f, t13.range(h10 - 1, -1, -1), "outEdges"), g = e(f); d(f, g); for (var y = Number.POSITIVE_INFINITY, m, b = 0, w = 0; w < 4; ++b, ++w) { c(b % 2 ? v : p, b % 4 >= 2), g = s.buildLayerMatrix(f); var x = r(f, g); x < y && (w = 0, m = t13.cloneDeep(g), y = x); } d(f, m); } function l(f, h10, v) { return t13.map(h10, function(p) { return a(f, p, v); }); } function c(f, h10) { var v = new o(); t13.forEach(f, function(p) { var g = p.graph().root, y = n(p, g, v, h10); t13.forEach(y.vs, function(m, b) { p.node(m).order = b; }), i(p, v, y.vs); }); } function d(f, h10) { t13.forEach(h10, function(v) { t13.forEach(v, function(p, g) { f.node(p).order = g; }); }); } return ep; } var tp; var vE; function zH() { if (vE) return tp; vE = 1; var t13 = gt(), e = Yr().Graph, r = yr(); tp = { positionX: v, findType1Conflicts: n, findType2Conflicts: a, addConflict: o, hasConflict: s, verticalAlignment: u, horizontalCompaction: l, alignCoordinates: f, findSmallestWidthAlignment: d, balance: h10 }; function n(y, m) { var b = {}; function w(x, E) { var C = 0, k = 0, S = x.length, _ = t13.last(E); return t13.forEach(E, function(T, O) { var D = i(y, T), A = D ? y.node(D).order : S; (D || T === _) && (t13.forEach(E.slice(k, O + 1), function(F) { t13.forEach(y.predecessors(F), function(R) { var M = y.node(R), L = M.order; (L < C || A < L) && !(M.dummy && y.node(F).dummy) && o(b, R, F); }); }), k = O + 1, C = A); }), E; } return t13.reduce(m, w), b; } function a(y, m) { var b = {}; function w(E, C, k, S, _) { var T; t13.forEach(t13.range(C, k), function(O) { T = E[O], y.node(T).dummy && t13.forEach(y.predecessors(T), function(D) { var A = y.node(D); A.dummy && (A.order < S || A.order > _) && o(b, D, T); }); }); } function x(E, C) { var k = -1, S, _ = 0; return t13.forEach(C, function(T, O) { if (y.node(T).dummy === "border") { var D = y.predecessors(T); D.length && (S = y.node(D[0]).order, w(C, _, O, k, S), _ = O, k = S); } w(C, _, C.length, S, E.length); }), C; } return t13.reduce(m, x), b; } function i(y, m) { if (y.node(m).dummy) return t13.find(y.predecessors(m), function(b) { return y.node(b).dummy; }); } function o(y, m, b) { if (m > b) { var w = m; m = b, b = w; } var x = y[m]; x || (y[m] = x = {}), x[b] = true; } function s(y, m, b) { if (m > b) { var w = m; m = b, b = w; } return t13.has(y[m], b); } function u(y, m, b, w) { var x = {}, E = {}, C = {}; return t13.forEach(m, function(k) { t13.forEach(k, function(S, _) { x[S] = S, E[S] = S, C[S] = _; }); }), t13.forEach(m, function(k) { var S = -1; t13.forEach(k, function(_) { var T = w(_); if (T.length) { T = t13.sortBy(T, function(R) { return C[R]; }); for (var O = (T.length - 1) / 2, D = Math.floor(O), A = Math.ceil(O); D <= A; ++D) { var F = T[D]; E[_] === _ && S < C[F] && !s(b, _, F) && (E[F] = _, E[_] = x[_] = x[F], S = C[F]); } } }); }), { root: x, align: E }; } function l(y, m, b, w, x) { var E = {}, C = c(y, m, b, x), k = x ? "borderLeft" : "borderRight"; function S(O, D) { for (var A = C.nodes(), F = A.pop(), R = {}; F; ) R[F] ? O(F) : (R[F] = true, A.push(F), A = A.concat(D(F))), F = A.pop(); } function _(O) { E[O] = C.inEdges(O).reduce(function(D, A) { return Math.max(D, E[A.v] + C.edge(A)); }, 0); } function T(O) { var D = C.outEdges(O).reduce(function(F, R) { return Math.min(F, E[R.w] - C.edge(R)); }, Number.POSITIVE_INFINITY), A = y.node(O); D !== Number.POSITIVE_INFINITY && A.borderType !== k && (E[O] = Math.max(E[O], D)); } return S(_, C.predecessors.bind(C)), S(T, C.successors.bind(C)), t13.forEach(w, function(O) { E[O] = E[b[O]]; }), E; } function c(y, m, b, w) { var x = new e(), E = y.graph(), C = p(E.nodesep, E.edgesep, w); return t13.forEach(m, function(k) { var S; t13.forEach(k, function(_) { var T = b[_]; if (x.setNode(T), S) { var O = b[S], D = x.edge(O, T); x.setEdge(O, T, Math.max(C(y, _, S), D || 0)); } S = _; }); }), x; } function d(y, m) { return t13.minBy(t13.values(m), function(b) { var w = Number.NEGATIVE_INFINITY, x = Number.POSITIVE_INFINITY; return t13.forIn(b, function(E, C) { var k = g(y, C) / 2; w = Math.max(E + k, w), x = Math.min(E - k, x); }), w - x; }); } function f(y, m) { var b = t13.values(m), w = t13.min(b), x = t13.max(b); t13.forEach(["u", "d"], function(E) { t13.forEach(["l", "r"], function(C) { var k = E + C, S = y[k], _; if (S !== m) { var T = t13.values(S); _ = C === "l" ? w - t13.min(T) : x - t13.max(T), _ && (y[k] = t13.mapValues(S, function(O) { return O + _; })); } }); }); } function h10(y, m) { return t13.mapValues(y.ul, function(b, w) { if (m) return y[m.toLowerCase()][w]; var x = t13.sortBy(t13.map(y, w)); return (x[1] + x[2]) / 2; }); } function v(y) { var m = r.buildLayerMatrix(y), b = t13.merge( n(y, m), a(y, m) ), w = {}, x; t13.forEach(["u", "d"], function(C) { x = C === "u" ? m : t13.values(m).reverse(), t13.forEach(["l", "r"], function(k) { k === "r" && (x = t13.map(x, function(O) { return t13.values(O).reverse(); })); var S = (C === "u" ? y.predecessors : y.successors).bind(y), _ = u(y, x, b, S), T = l( y, x, _.root, _.align, k === "r" ); k === "r" && (T = t13.mapValues(T, function(O) { return -O; })), w[C + k] = T; }); }); var E = d(y, w); return f(w, E), h10(w, y.graph().align); } function p(y, m, b) { return function(w, x, E) { var C = w.node(x), k = w.node(E), S = 0, _; if (S += C.width / 2, t13.has(C, "labelpos")) switch (C.labelpos.toLowerCase()) { case "l": _ = -C.width / 2; break; case "r": _ = C.width / 2; break; } if (_ && (S += b ? _ : -_), _ = 0, S += (C.dummy ? m : y) / 2, S += (k.dummy ? m : y) / 2, S += k.width / 2, t13.has(k, "labelpos")) switch (k.labelpos.toLowerCase()) { case "l": _ = k.width / 2; break; case "r": _ = -k.width / 2; break; } return _ && (S += b ? _ : -_), _ = 0, S; }; } function g(y, m) { return y.node(m).width; } return tp; } var rp; var hE; function VH() { if (hE) return rp; hE = 1; var t13 = gt(), e = yr(), r = zH().positionX; rp = n; function n(i) { i = e.asNonCompoundGraph(i), a(i), t13.forEach(r(i), function(o, s) { i.node(s).x = o; }); } function a(i) { var o = e.buildLayerMatrix(i), s = i.graph().ranksep, u = 0; t13.forEach(o, function(l) { var c = t13.max(t13.map(l, function(d) { return i.node(d).height; })); t13.forEach(l, function(d) { i.node(d).y = u + c / 2; }), u += c + s; }); } return rp; } var np; var pE; function HH() { if (pE) return np; pE = 1; var t13 = gt(), e = SH(), r = kH(), n = TH(), a = yr().normalizeRanks, i = IH(), o = yr().removeEmptyRanks, s = OH(), u = AH(), l = PH(), c = qH(), d = VH(), f = yr(), h10 = Yr().Graph; np = v; function v(B, $) { var z = $ && $.debugTiming ? f.time : f.notime; z("layout", function() { var W = z(" buildLayoutGraph", function() { return S(B); }); z(" runLayout", function() { p(W, z); }), z(" updateInputGraph", function() { g(B, W); }); }); } function p(B, $) { $(" makeSpaceForEdgeLabels", function() { _(B); }), $(" removeSelfEdges", function() { V(B); }), $(" acyclic", function() { e.run(B); }), $(" nestingGraph.run", function() { s.run(B); }), $(" rank", function() { n(f.asNonCompoundGraph(B)); }), $(" injectEdgeLabelProxies", function() { T(B); }), $(" removeEmptyRanks", function() { o(B); }), $(" nestingGraph.cleanup", function() { s.cleanup(B); }), $(" normalizeRanks", function() { a(B); }), $(" assignRankMinMax", function() { O(B); }), $(" removeEdgeLabelProxies", function() { D(B); }), $(" normalize.run", function() { r.run(B); }), $(" parentDummyChains", function() { i(B); }), $(" addBorderSegments", function() { u(B); }), $(" order", function() { c(B); }), $(" insertSelfEdges", function() { Y(B); }), $(" adjustCoordinateSystem", function() { l.adjust(B); }), $(" position", function() { d(B); }), $(" positionSelfEdges", function() { H(B); }), $(" removeBorderNodes", function() { L(B); }), $(" normalize.undo", function() { r.undo(B); }), $(" fixupEdgeLabelCoords", function() { R(B); }), $(" undoCoordinateSystem", function() { l.undo(B); }), $(" translateGraph", function() { A(B); }), $(" assignNodeIntersects", function() { F(B); }), $(" reversePoints", function() { M(B); }), $(" acyclic.undo", function() { e.undo(B); }); } function g(B, $) { t13.forEach(B.nodes(), function(z) { var W = B.node(z), Z = $.node(z); W && (W.x = Z.x, W.y = Z.y, $.children(z).length && (W.width = Z.width, W.height = Z.height)); }), t13.forEach(B.edges(), function(z) { var W = B.edge(z), Z = $.edge(z); W.points = Z.points, t13.has(Z, "x") && (W.x = Z.x, W.y = Z.y); }), B.graph().width = $.graph().width, B.graph().height = $.graph().height; } var y = ["nodesep", "edgesep", "ranksep", "marginx", "marginy"], m = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: "tb" }, b = ["acyclicer", "ranker", "rankdir", "align"], w = ["width", "height"], x = { width: 0, height: 0 }, E = ["minlen", "weight", "width", "height", "labeloffset"], C = { minlen: 1, weight: 1, width: 0, height: 0, labeloffset: 10, labelpos: "r" }, k = ["labelpos"]; function S(B) { var $ = new h10({ multigraph: true, compound: true }), z = ne(B.graph()); return $.setGraph(t13.merge( {}, m, K(z, y), t13.pick(z, b) )), t13.forEach(B.nodes(), function(W) { var Z = ne(B.node(W)); $.setNode(W, t13.defaults(K(Z, w), x)), $.setParent(W, B.parent(W)); }), t13.forEach(B.edges(), function(W) { var Z = ne(B.edge(W)); $.setEdge(W, t13.merge( {}, C, K(Z, E), t13.pick(Z, k) )); }), $; } function _(B) { var $ = B.graph(); $.ranksep /= 2, t13.forEach(B.edges(), function(z) { var W = B.edge(z); W.minlen *= 2, W.labelpos.toLowerCase() !== "c" && ($.rankdir === "TB" || $.rankdir === "BT" ? W.width += W.labeloffset : W.height += W.labeloffset); }); } function T(B) { t13.forEach(B.edges(), function($) { var z = B.edge($); if (z.width && z.height) { var W = B.node($.v), Z = B.node($.w), N = { rank: (Z.rank - W.rank) / 2 + W.rank, e: $ }; f.addDummyNode(B, "edge-proxy", N, "_ep"); } }); } function O(B) { var $ = 0; t13.forEach(B.nodes(), function(z) { var W = B.node(z); W.borderTop && (W.minRank = B.node(W.borderTop).rank, W.maxRank = B.node(W.borderBottom).rank, $ = t13.max($, W.maxRank)); }), B.graph().maxRank = $; } function D(B) { t13.forEach(B.nodes(), function($) { var z = B.node($); z.dummy === "edge-proxy" && (B.edge(z.e).labelRank = z.rank, B.removeNode($)); }); } function A(B) { var $ = Number.POSITIVE_INFINITY, z = 0, W = Number.POSITIVE_INFINITY, Z = 0, N = B.graph(), X = N.marginx || 0, Q = N.marginy || 0; function ge(we) { var fe = we.x, ce = we.y, be = we.width, ve = we.height; $ = Math.min($, fe - be / 2), z = Math.max(z, fe + be / 2), W = Math.min(W, ce - ve / 2), Z = Math.max(Z, ce + ve / 2); } t13.forEach(B.nodes(), function(we) { ge(B.node(we)); }), t13.forEach(B.edges(), function(we) { var fe = B.edge(we); t13.has(fe, "x") && ge(fe); }), $ -= X, W -= Q, t13.forEach(B.nodes(), function(we) { var fe = B.node(we); fe.x -= $, fe.y -= W; }), t13.forEach(B.edges(), function(we) { var fe = B.edge(we); t13.forEach(fe.points, function(ce) { ce.x -= $, ce.y -= W; }), t13.has(fe, "x") && (fe.x -= $), t13.has(fe, "y") && (fe.y -= W); }), N.width = z - $ + X, N.height = Z - W + Q; } function F(B) { t13.forEach(B.edges(), function($) { var z = B.edge($), W = B.node($.v), Z = B.node($.w), N, X; z.points ? (N = z.points[0], X = z.points[z.points.length - 1]) : (z.points = [], N = Z, X = W), z.points.unshift(f.intersectRect(W, N)), z.points.push(f.intersectRect(Z, X)); }); } function R(B) { t13.forEach(B.edges(), function($) { var z = B.edge($); if (t13.has(z, "x")) switch ((z.labelpos === "l" || z.labelpos === "r") && (z.width -= z.labeloffset), z.labelpos) { case "l": z.x -= z.width / 2 + z.labeloffset; break; case "r": z.x += z.width / 2 + z.labeloffset; break; } }); } function M(B) { t13.forEach(B.edges(), function($) { var z = B.edge($); z.reversed && z.points.reverse(); }); } function L(B) { t13.forEach(B.nodes(), function($) { if (B.children($).length) { var z = B.node($), W = B.node(z.borderTop), Z = B.node(z.borderBottom), N = B.node(t13.last(z.borderLeft)), X = B.node(t13.last(z.borderRight)); z.width = Math.abs(X.x - N.x), z.height = Math.abs(Z.y - W.y), z.x = N.x + z.width / 2, z.y = W.y + z.height / 2; } }), t13.forEach(B.nodes(), function($) { B.node($).dummy === "border" && B.removeNode($); }); } function V(B) { t13.forEach(B.edges(), function($) { if ($.v === $.w) { var z = B.node($.v); z.selfEdges || (z.selfEdges = []), z.selfEdges.push({ e: $, label: B.edge($) }), B.removeEdge($); } }); } function Y(B) { var $ = f.buildLayerMatrix(B); t13.forEach($, function(z) { var W = 0; t13.forEach(z, function(Z, N) { var X = B.node(Z); X.order = N + W, t13.forEach(X.selfEdges, function(Q) { f.addDummyNode(B, "selfedge", { width: Q.label.width, height: Q.label.height, rank: X.rank, order: N + ++W, e: Q.e, label: Q.label }, "_se"); }), delete X.selfEdges; }); }); } function H(B) { t13.forEach(B.nodes(), function($) { var z = B.node($); if (z.dummy === "selfedge") { var W = B.node(z.e.v), Z = W.x + W.width / 2, N = W.y, X = z.x - Z, Q = W.height / 2; B.setEdge(z.e, z.label), B.removeNode($), z.label.points = [ { x: Z + 2 * X / 3, y: N - Q }, { x: Z + 5 * X / 6, y: N - Q }, { x: Z + X, y: N }, { x: Z + 5 * X / 6, y: N + Q }, { x: Z + 2 * X / 3, y: N + Q } ], z.label.x = z.x, z.label.y = z.y; } }); } function K(B, $) { return t13.mapValues(t13.pick(B, $), Number); } function ne(B) { var $ = {}; return t13.forEach(B, function(z, W) { $[W.toLowerCase()] = z; }), $; } return np; } var ap; var gE; function KH() { if (gE) return ap; gE = 1; var t13 = gt(), e = yr(), r = Yr().Graph; ap = { debugOrdering: n }; function n(a) { var i = e.buildLayerMatrix(a), o = new r({ compound: true, multigraph: true }).setGraph({}); return t13.forEach(a.nodes(), function(s) { o.setNode(s, { label: s }), o.setParent(s, "layer" + a.node(s).rank); }), t13.forEach(a.edges(), function(s) { o.setEdge(s.v, s.w, {}, s.name); }), t13.forEach(i, function(s, u) { var l = "layer" + u; o.setNode(l, { rank: "same" }), t13.reduce(s, function(c, d) { return o.setEdge(c, d, { style: "invis" }), d; }); }), o; } return ap; } var ip; var yE; function GH() { return yE || (yE = 1, ip = "0.8.5"), ip; } var op; var mE; function UH() { return mE || (mE = 1, op = { graphlib: Yr(), layout: HH(), debug: KH(), util: { time: yr().time, notime: yr().notime }, version: GH() }), op; } (function(t13, e) { (function(n, a) { t13.exports = a(UH()); })(oo, function(r) { return ( /******/ function(n) { var a = {}; function i(o) { if (a[o]) return a[o].exports; var s = a[o] = { /******/ i: o, /******/ l: false, /******/ exports: {} /******/ }; return n[o].call(s.exports, s, s.exports, i), s.l = true, s.exports; } return i.m = n, i.c = a, i.d = function(o, s, u) { i.o(o, s) || Object.defineProperty(o, s, { enumerable: true, get: u }); }, i.r = function(o) { typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(o, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(o, "__esModule", { value: true }); }, i.t = function(o, s) { if (s & 1 && (o = i(o)), s & 8 || s & 4 && typeof o == "object" && o && o.__esModule) return o; var u = /* @__PURE__ */ Object.create(null); if (i.r(u), Object.defineProperty(u, "default", { enumerable: true, value: o }), s & 2 && typeof o != "string") for (var l in o) i.d(u, l, (function(c) { return o[c]; }).bind(null, l)); return u; }, i.n = function(o) { var s = o && o.__esModule ? ( /******/ function() { return o.default; } ) : ( /******/ function() { return o; } ); return i.d(s, "a", s), s; }, i.o = function(o, s) { return Object.prototype.hasOwnProperty.call(o, s); }, i.p = "", i(i.s = 0); }([ /* 0 */ /***/ function(n, a, i) { var o = i(1), s = function(l) { l && l("layout", "dagre", o); }; typeof cytoscape < "u" && s(cytoscape), n.exports = s; }, /* 1 */ /***/ function(n, a, i) { function o(f) { "@babel/helpers - typeof"; return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? o = function(v) { return typeof v; } : o = function(v) { return v && typeof Symbol == "function" && v.constructor === Symbol && v !== Symbol.prototype ? "symbol" : typeof v; }, o(f); } var s = function(h10) { return typeof h10 == "function"; }, u = i(2), l = i(3), c = i(4); function d(f) { this.options = l({}, u, f); } d.prototype.run = function() { var f = this.options, h10 = this, v = f.cy, p = f.eles, g = function(H, K) { return s(K) ? K.apply(H, [H]) : K; }, y = f.boundingBox || { x1: 0, y1: 0, w: v.width(), h: v.height() }; y.x2 === void 0 && (y.x2 = y.x1 + y.w), y.w === void 0 && (y.w = y.x2 - y.x1), y.y2 === void 0 && (y.y2 = y.y1 + y.h), y.h === void 0 && (y.h = y.y2 - y.y1); var m = new c.graphlib.Graph({ multigraph: true, compound: true }), b = {}, w = function(H, K) { K != null && (b[H] = K); }; w("nodesep", f.nodeSep), w("edgesep", f.edgeSep), w("ranksep", f.rankSep), w("rankdir", f.rankDir), w("align", f.align), w("ranker", f.ranker), w("acyclicer", f.acyclicer), m.setGraph(b), m.setDefaultEdgeLabel(function() { return {}; }), m.setDefaultNodeLabel(function() { return {}; }); var x = p.nodes(); s(f.sort) && (x = x.sort(f.sort)); for (var E = 0; E < x.length; E++) { var C = x[E], k = C.layoutDimensions(f); m.setNode(C.id(), { width: k.w, height: k.h, name: C.id() }); } for (var S = 0; S < x.length; S++) { var _ = x[S]; _.isChild() && m.setParent(_.id(), _.parent().id()); } var T = p.edges().stdFilter(function(Y) { return !Y.source().isParent() && !Y.target().isParent(); }); s(f.sort) && (T = T.sort(f.sort)); for (var O = 0; O < T.length; O++) { var D = T[O]; m.setEdge(D.source().id(), D.target().id(), { minlen: g(D, f.minLen), weight: g(D, f.edgeWeight), name: D.id() }, D.id()); } c.layout(m); for (var A = m.nodes(), F = 0; F < A.length; F++) { var R = A[F], M = m.node(R); v.getElementById(R).scratch().dagre = M; } var L; f.boundingBox ? (L = { x1: 1 / 0, x2: -1 / 0, y1: 1 / 0, y2: -1 / 0 }, x.forEach(function(Y) { var H = Y.scratch().dagre; L.x1 = Math.min(L.x1, H.x), L.x2 = Math.max(L.x2, H.x), L.y1 = Math.min(L.y1, H.y), L.y2 = Math.max(L.y2, H.y); }), L.w = L.x2 - L.x1, L.h = L.y2 - L.y1) : L = y; var V = function(H) { if (f.boundingBox) { var K = L.w === 0 ? 0 : (H.x - L.x1) / L.w, ne = L.h === 0 ? 0 : (H.y - L.y1) / L.h; return { x: y.x1 + K * y.w, y: y.y1 + ne * y.h }; } else return H; }; return x.layoutPositions(h10, f, function(Y) { Y = o(Y) === "object" ? Y : this; var H = Y.scratch().dagre; return V({ x: H.x, y: H.y }); }), this; }, n.exports = d; }, /* 2 */ /***/ function(n, a) { var i = { // dagre algo options, uses default value on undefined nodeSep: void 0, // the separation between adjacent nodes in the same rank edgeSep: void 0, // the separation between adjacent edges in the same rank rankSep: void 0, // the separation between adjacent nodes in the same rank rankDir: void 0, // 'TB' for top to bottom flow, 'LR' for left to right, align: void 0, // alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right acyclicer: void 0, // If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph. // A feedback arc set is a set of edges that can be removed to make a graph acyclic. ranker: void 0, // Type of algorithm to assigns a rank to each node in the input graph. // Possible values: network-simplex, tight-tree or longest-path minLen: function(s) { return 1; }, // number of ranks to keep between the source and target of the edge edgeWeight: function(s) { return 1; }, // higher weight edges are generally made shorter and straighter than lower weight edges // general layout options fit: true, // whether to fit to viewport padding: 30, // fit padding spacingFactor: void 0, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up nodeDimensionsIncludeLabels: false, // whether labels should be included in determining the space used by a node animate: false, // whether to transition the node positions animateFilter: function(s, u) { return true; }, // whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions animationDuration: 500, // duration of animation in ms if enabled animationEasing: void 0, // easing of animation if enabled boundingBox: void 0, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h } transform: function(s, u) { return u; }, // a function that applies a transform to the final node position ready: function() { }, // on layoutready sort: void 0, // a sorting function to order the nodes and edges; e.g. function(a, b){ return a.data('weight') - b.data('weight') } // because cytoscape dagre creates a directed graph, and directed graphs use the node order as a tie breaker when // defining the topology of a graph, this sort function can help ensure the correct order of the nodes/edges. // this feature is most useful when adding and removing the same nodes and edges multiple times in a graph. stop: function() { } // on layoutstop }; n.exports = i; }, /* 3 */ /***/ function(n, a) { n.exports = Object.assign != null ? Object.assign.bind(Object) : function(i) { for (var o = arguments.length, s = new Array(o > 1 ? o - 1 : 0), u = 1; u < o; u++) s[u - 1] = arguments[u]; return s.forEach(function(l) { Object.keys(l).forEach(function(c) { return i[c] = l[c]; }); }), i; }; }, /* 4 */ /***/ function(n, a) { n.exports = r; } /******/ ]) ); }); })(Lk); var WH = Lk.exports; var jH = oM(WH); ia.use(jH); var bE = function(t13, e) { if (!t13 || !e) return false; let r = JSON.stringify(t13), n = JSON.stringify(e); return r.indexOf(n) !== -1; }; var YH = function(t13) { return t13 ? [...new Set(t13.map((e) => JSON.stringify(e)))].map( (e) => JSON.parse(e) ) : []; }; var ZH = function(t13, e, r) { let n = t13.connectivity.flat(), a = YH(n), i = [], o = false; return a.forEach((s) => { o = false, bE(e, s) && (o = true), bE(r, s) && (o = true), o || i.push(s); }), i; }; var XH = class extends EventTarget { constructor(r, n) { super(); Tr(this, "cyg", null); Tr(this, "nodes", []); Tr(this, "edges", []); Tr(this, "axons", []); Tr(this, "dendrites", []); Tr(this, "somas", []); Tr(this, "labelCache", /* @__PURE__ */ new Map()); Tr(this, "graphCanvas", null); Tr(this, "hasPhenotypes", false); this.labelCache = r, this.graphCanvas = n; } async addConnectivity(r) { var n; if (r && r["node-phenotypes"]) { const a = ["ilxtr:hasSomaLocatedIn"], i = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"], o = [], s = []; a.forEach((l) => { o.push(...r["node-phenotypes"][l]); }), i.forEach((l) => { s.push(...r["node-phenotypes"][l]); }); const u = ZH(r, o, s); this.dendrites = o.map((l) => JSON.stringify(l)), this.axons = s.map((l) => JSON.stringify(l)), u != null && u.length && (this.somas = u.map((l) => JSON.stringify(l))), this.hasPhenotypes = true; } else this.axons = r.axons.map((a) => JSON.stringify(a)), this.dendrites = r.dendrites.map((a) => JSON.stringify(a)), (n = r.somas) != null && n.length && (this.somas = r.somas.map((a) => JSON.stringify(a))), this.hasPhenotypes = false; if (r.connectivity.length) for (const a of r.connectivity) { const i = await this.graphNode(a[0]), o = await this.graphNode(a[1]); this.nodes.push(i), this.nodes.push(o), this.edges.push({ id: `${i.id}_${o.id}`, source: i.id, target: o.id }); } else this.nodes.push({ id: "MISSING", label: "NO PATHS" }); } showConnectivity(r) { this.cyg = new nK(this, r), this.cyg.on("tap-node", (n) => { const a = new CustomEvent("tap-node", { detail: n.detail }); this.dispatchEvent(a); }); } selectConnectivity(r) { var n; if ((n = this.cyg) != null && n.cy) { let a = ""; this.cyg.cy.elements().forEach((i) => { const o = i.data("label"), s = zp(o); rK(r, s) && (a = i.id()); }), a && this.cyg.cy.$id(a).select(); } } clearConnectivity() { var r; (r = this.cyg) != null && r.cy && (this.cyg.cy.remove(), this.cyg.cy = null); } reset() { var r; (r = this.cyg) != null && r.cy && this.cyg.cy.reset(); } zoom(r) { var n; if ((n = this.cyg) != null && n.cy) { const a = this.cyg.cy.zoom(), i = this.cyg.cy.width(), o = this.cyg.cy.height(), s = { x: i / 2, y: o / 2 }; this.cyg.cy.zoom({ level: a + r, renderedPosition: s }); } } enableZoom(r) { var n; (n = this.cyg) != null && n.cy && this.cyg.cy.userZoomingEnabled(r); } get elements() { return [ ...this.nodes.map((r) => ({ data: r })), ...this.edges.map((r) => ({ data: r })) ]; } get roots() { return this.hasPhenotypes ? [ ...this.dendrites ] : [ ...this.dendrites, ...this.somas ]; } async graphNode(r) { const n = JSON.stringify(r), a = [r[0], ...r[1]], i = []; for (const s of a) { const u = this.labelCache.has(s) ? this.labelCache.get(s) : ""; i.push(u); } a.push(...i); const o = { id: n, label: a.join(` `) }; return this.hasPhenotypes ? this.axons.includes(n) ? o.axon = true : this.dendrites.includes(n) ? o.dendrite = true : o.somas = true : this.axons.includes(n) ? this.dendrites.includes(n) || this.somas.includes(n) ? o.somas = true : o.axon = true : (this.dendrites.includes(n) || this.somas.includes(n)) && (o.dendrite = true), o; } on(r, n) { this.addEventListener(r, n); } }; var JH = "#8300bf"; var QH = "#f3ecf6"; var eK = [ { selector: "node", style: { label: function(t13) { return tK(t13.data("label")); }, // 'background-color': '#80F0F0', "background-color": "transparent", "background-opacity": "0", "text-valign": "center", "text-wrap": "wrap", width: "80px", height: "80px", "text-max-width": "80px", "font-size": "6px", shape: "round-rectangle", "border-width": 1, "border-style": "solid", "border-color": "gray" } }, { selector: "node[axon]", style: { // 'background-color': 'green', shape: "round-diamond", width: "100px", height: "100px" } }, { selector: "node[dendrite]", style: { // 'background-color': 'red', shape: "ellipse" } }, { selector: "node[somas]", style: { // 'background-color': 'gray', shape: "round-rectangle" } }, { selector: "edge", style: { width: 1, "line-color": "dimgray", "curve-style": "bezier" } }, { selector: "node.active", style: { "border-color": JH, "background-color": QH, "background-opacity": 0.75 } } ]; function tK(t13) { const e = t13.split(` `), r = e.length / 2, n = e.slice(r); return L_(n.join(` `)); } function L_(t13) { return t13.split(` `).map((e) => e && e[0] >= "a" && e[0] <= "z" ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(` `); } function zp(t13) { const e = t13 ? t13.split(` `) : [], r = []; for (let n = 0; n < e.length / 2; n++) r.push({ id: e[n], label: e[n + e.length / 2] }); return r; } function rK(t13, e) { t13.sort((r, n) => r.id < n.id ? -1 : r.id > n.id ? 1 : 0), e.sort((r, n) => r.id < n.id ? -1 : r.id > n.id ? 1 : 0); for (let r = 0; r < t13.length; r++) if (JSON.stringify(t13[r]) !== JSON.stringify(e[r])) return false; return true; } var nK = class extends EventTarget { constructor(r, n) { var a; super(); Tr(this, "cy"); Tr(this, "tooltip"); this.cy = ia({ container: n, elements: r.elements, layout: { name: "dagre", nodeSep: 150, edgeSep: 50, rankSep: 100, rankDir: "TB", roots: r.roots.length ? r.roots : void 0 }, style: eK, minZoom: 0.1, maxZoom: 10, wheelSensitivity: 0.4 }).on("mouseover", "node", this.overNode.bind(this)).on("mouseout", "node", this.exitNode.bind(this)).on("position", "node", this.moveNode.bind(this)), this.tooltip = document.createElement("div"), this.tooltip.className = "cy-graph-tooltip", this.tooltip.hidden = true, (a = n == null ? void 0 : n.lastChild) == null || a.appendChild(this.tooltip); } remove() { this.cy && this.cy.destroy(); } checkRightBoundary(r) { var n; r + this.tooltip.offsetWidth >= ((n = this.tooltip.parentElement) == null ? void 0 : n.offsetWidth) && (this.tooltip.style.left = `${r - this.tooltip.offsetWidth}px`); } overNode(r) { const a = r.target.data(), { label: i } = a, s = zp(i).map((u) => u.label + " (" + u.id + ")"); this.tooltip.innerText = L_(s.join(` `)), this.tooltip.style.left = `${r.renderedPosition.x}px`, this.tooltip.style.top = `${r.renderedPosition.y}px`, this.tooltip.style.maxWidth = "240px", this.tooltip.style.zIndex = 2, this.tooltip.hidden = false, this.checkRightBoundary(r.renderedPosition.x), this.tapNode(r, true); } moveNode(r) { const n = r.target; this.tooltip.style.left = `${n.renderedPosition().x}px`, this.tooltip.style.top = `${n.renderedPosition().y}px`, this.checkRightBoundary(n.renderedPosition().x); } exitNode(r) { this.tooltip.hidden = true, this.tapNode(r, false); } tapNode(r, n) { const a = r.target, i = a.data(); let { label: o } = i; n ? a.addClass("active") : (a.removeClass("active"), o = "", setTimeout(() => { a.unselect(); })); const s = zp(o), u = new CustomEvent("tap-node", { detail: s }); this.dispatchEvent(u); } on(r, n) { this.addEventListener(r, n); } }; var aK = 1.3; var iK = 24 * 60 * 60 * 1e3; var oK = "Reset position"; var wE = "Lock zoom"; var sK = "Unlock zoom"; var lK = "Zoom in"; var uK = "Zoom out"; var CE = 0.25; var cK = "#8300bf"; var dK = { name: "ConnectivityGraph", props: { /** * Entity to load its connectivity graph. */ entry: { type: String, default: "" }, mapServer: { type: String, default: "" }, sckanVersion: { type: String, default: "" }, selectedConnectivityData: { type: Array, default: [] }, connectivityFromMap: { type: Object, default: () => null }, connectivityError: { type: Object, default: () => { } } }, data: function() { return { loading: true, loadingError: "", connectivityGraph: null, selectedSource: "", availableSources: [], pathList: [], schemaVersion: "", knowledgeByPath: /* @__PURE__ */ new Map(), labelledTerms: /* @__PURE__ */ new Set(), labelCache: /* @__PURE__ */ new Map(), resetLabel: oK, zoomLockLabel: wE, zoomInLabel: lK, zoomOutLabel: uK, iconColor: cK, zoomEnabled: false, connectivityGraphContainer: null }; }, watch: { connectivityFromMap: function(t13, e) { t13 != e && (this.showSpinner(), this.start()); } }, mounted() { this.showSpinner(), this.updateTooltipContainer(), this.refreshCache(), this.loadCacheData(), this.start(); }, methods: { updateTooltipContainer: function() { this.connectivityGraphContainer = this.$refs.connectivityGraphRef; }, loadCacheData: function() { const t13 = sessionStorage.getItem("connectivity-graph-sources"), e = sessionStorage.getItem("connectivity-graph-labels"), r = sessionStorage.getItem("connectivity-graph-pathlist"), n = sessionStorage.getItem("connectivity-graph-schema-version"); if (this.sckanVersion && (this.selectedSource = this.sckanVersion), sessionStorage.setItem("connectivity-graph-selected-source", this.selectedSource), this.updateCacheExpiry(), t13 && (this.availableSources = JSON.parse(t13)), r && (this.pathList = JSON.parse(r)), e) { const a = JSON.parse(e); this.labelCache = new Map(Object.entries(a)); } n && (this.schemaVersion = n); }, isValidKnowledgeSource: function() { const t13 = sessionStorage.getItem("connectivity-graph-selected-source"); return !(this.sckanVersion && this.sckanVersion !== t13); }, removeAllCacheData: function() { [ "connectivity-graph-expiry", "connectivity-graph-selected-source", "connectivity-graph-source", // to clear old data "connectivity-graph-sources", "connectivity-graph-labels", "connectivity-graph-pathlist", "connectivity-graph-schema-version" ].forEach((e) => { sessionStorage.removeItem(e); }); }, refreshCache: function() { const t13 = sessionStorage.getItem("connectivity-graph-expiry"), e = /* @__PURE__ */ new Date(), r = this.isValidKnowledgeSource(); (e.getTime() > t13 || !r) && this.removeAllCacheData(); }, updateCacheExpiry: function() { const e = (/* @__PURE__ */ new Date()).getTime() + iK; sessionStorage.setItem("connectivity-graph-expiry", e); }, start: function() { this.run().then((t13) => { t13 != null && t13.success ? this.showGraph(this.entry) : t13 != null && t13.error ? this.loadingError = t13.error : this.loadingError = "Loading error!"; }).catch((t13) => { this.loadingError = "Loading error!", this.hideSpinner(); }); }, run: async function() { return this.schemaVersion || (this.schemaVersion = await this.getSchemaVersion(), sessionStorage.setItem("connectivity-graph-schema-version", this.schemaVersion), this.updateCacheExpiry()), this.schemaVersion < aK ? { error: `No server available for schema-version ${this.schemaVersion}.` } : (this.availableSources.length || (this.availableSources = await this.loadAvailableSources()), this.isSCKANVersionAvailable() ? (await this.setPathList(this.selectedSource), { success: true }) : { error: `No data available for SCKAN version ${this.selectedSource}.` }); }, showGraph: async function(t13) { const e = this.$refs.graphCanvas; this.connectivityFromMap && (this.cacheLabels(this.connectivityFromMap), await this.getCachedTermLabels()), this.connectivityGraph = new XH(this.labelCache, e); const r = this.knowledgeByPath.get(t13); this.connectivityFromMap && (r.axons = this.connectivityFromMap.axons, r.connectivity = this.connectivityFromMap.connectivity, r.dendrites = this.connectivityFromMap.dendrites, r.somas = this.connectivityFromMap.somas), await this.connectivityGraph.addConnectivity(r), this.connectivityGraph.showConnectivity(e), this.selectedConnectivityData.length && this.connectivityGraph.selectConnectivity(this.selectedConnectivityData), this.connectivityGraph.on("tap-node", (n) => { const a = n.detail; this.$emit("tap-node", a); }), this.hideSpinner(); }, query: async function(t13, e) { const r = `${this.mapServer}knowledge/query/`, n = { sql: t13, params: e }; try { const a = await fetch(r, { method: "POST", headers: { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store", "Content-Type": "application/json" }, body: JSON.stringify(n) }); if (!a.ok) throw new Error(`Cannot access ${r}`); return await a.json(); } catch { return { values: [] }; } }, isSCKANVersionAvailable: function() { return this.availableSources.includes(this.selectedSource); }, loadAvailableSources: async function() { const t13 = await this.getJsonData(`${this.mapServer}knowledge/sources`), r = (t13 ? t13.sources || [] : []).filter((n) => n); return sessionStorage.setItem("connectivity-graph-sources", JSON.stringify(r)), this.updateCacheExpiry(), r; }, loadPathData: async function(t13) { const e = await this.query( `select entity, knowledge from knowledge where entity like 'ilxtr:%' and source=? order by entity`, [t13] ); return e ? e.values : []; }, setPathList: async function(t13) { this.pathList.length || (this.pathList = await this.loadPathData(t13), sessionStorage.setItem("connectivity-graph-pathlist", JSON.stringify(this.pathList)), this.updateCacheExpiry()), this.knowledgeByPath.clear(), this.labelledTerms = /* @__PURE__ */ new Set(); for (const [e, r] of this.pathList) { const n = JSON.parse(r); "connectivity" in n && (this.knowledgeByPath.set(e, n), this.cacheLabels(n)); } return this.labelCache.size || await this.getCachedTermLabels(), ""; }, getSchemaVersion: async function() { const t13 = await this.getJsonData(`${this.mapServer}knowledge/schema-version`); return t13 && +t13.version || 0; }, getJsonData: async function(t13) { try { const e = await fetch(t13, { method: "GET", headers: { Accept: "application/json; charset=utf-8", "Cache-Control": "no-store", "Content-Type": "application/json" } }); return e.ok || console.error(`Cannot access ${t13}`), await e.json(); } catch { return null; } }, getCachedTermLabels: async function() { if (this.labelledTerms.size) { const t13 = await this.query( `select entity, knowledge from knowledge where entity in (?${", ?".repeat(this.labelledTerms.size - 1)}) order by source desc`, [...this.labelledTerms.values()] ); let e = null; for (const [n, a] of t13.values) if (n !== e) { const i = JSON.parse(a); this.labelCache.set(n, i.label || n), e = n; } const r = Object.fromEntries(this.labelCache); sessionStorage.setItem("connectivity-graph-labels", JSON.stringify(r)), this.updateCacheExpiry(); } }, cacheNodeLabels: function(t13) { for (const e of [t13[0], ...t13[1]]) this.labelledTerms.add(e); }, cacheLabels: async function(t13) { for (const e of t13.connectivity) this.cacheNodeLabels(e[0]), this.cacheNodeLabels(e[1]); }, showSpinner: function() { this.loading = true; }, hideSpinner: function() { this.loading = false; }, reset: function() { this.connectivityGraph.reset(); }, zoomIn: function() { this.connectivityGraph.zoom(CE); }, zoomOut: function() { this.connectivityGraph.zoom(-CE); }, /** * Enable/disable user zoom for scrolling */ toggleZoom: function() { this.zoomEnabled = !this.zoomEnabled, this.zoomLockLabel = this.zoomEnabled ? sK : wE, this.connectivityGraph.enableZoom(!this.zoomEnabled); } } }; var fK = { class: "connectivity-graph", ref: "connectivityGraphRef" }; var vK = { ref: "graphCanvas", class: "graph-canvas" }; var hK = { class: "control-panel control-panel-tools" }; var pK = { class: "visually-hidden" }; var gK = { class: "visually-hidden" }; var yK = { class: "visually-hidden" }; var mK = { class: "visually-hidden" }; var bK = createStaticVNode('
Origin
Components
Destination
', 1); var wK = { class: "connectivity-graph-error" }; var CK = { key: 0, class: "loading-error" }; function xK(t13, e, r, n, a, i) { const o = aim_default, s = Ft, u = mr, l = Jo, c = lock_default, d = unlock_default, f = zoom_in_default, h10 = zoom_out_default, v = Eg; return withDirectives((openBlock(), createElementBlock("div", fK, [ createBaseVNode("div", vK, null, 512), createBaseVNode("div", hK, [ createBaseVNode("div", { class: normalizeClass(["tools", { "zoom-locked": t13.zoomEnabled }]) }, [ createVNode(l, { content: t13.resetLabel, placement: "top", effect: "control-tooltip", teleported: true, "append-to": t13.connectivityGraphContainer }, { default: withCtx(() => [ createVNode(u, { class: "control-button", size: "small", onClick: i.reset }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(o) ]), _: 1 }), createBaseVNode("span", pK, toDisplayString(t13.resetLabel), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }, 8, ["content", "append-to"]), createVNode(l, { content: t13.zoomLockLabel, placement: "top", effect: "control-tooltip", teleported: true, "append-to": t13.connectivityGraphContainer }, { default: withCtx(() => [ createVNode(u, { class: "control-button", size: "small", onClick: i.toggleZoom }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ t13.zoomEnabled ? (openBlock(), createBlock(c, { key: 0 })) : (openBlock(), createBlock(d, { key: 1 })) ]), _: 1 }), createBaseVNode("span", gK, toDisplayString(t13.zoomLockLabel), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }, 8, ["content", "append-to"]), createVNode(l, { content: t13.zoomInLabel, placement: "left", effect: "control-tooltip", teleported: true, "append-to": t13.connectivityGraphContainer }, { default: withCtx(() => [ createVNode(u, { class: "control-button", size: "small", onClick: i.zoomIn }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(f) ]), _: 1 }), createBaseVNode("span", yK, toDisplayString(t13.zoomInLabel), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }, 8, ["content", "append-to"]), createVNode(l, { content: t13.zoomOutLabel, placement: "left", effect: "control-tooltip", teleported: true, "append-to": t13.connectivityGraphContainer }, { default: withCtx(() => [ createVNode(u, { class: "control-button", size: "small", onClick: i.zoomOut }, { default: withCtx(() => [ createVNode(s, { color: "white" }, { default: withCtx(() => [ createVNode(h10) ]), _: 1 }), createBaseVNode("span", mK, toDisplayString(t13.zoomOutLabel), 1) ]), _: 1 }, 8, ["onClick"]) ]), _: 1 }, 8, ["content", "append-to"]) ], 2) ]), bK, withDirectives(createBaseVNode("div", wK, [ createBaseVNode("strong", null, toDisplayString(r.connectivityError.errorConnectivities), 1), createTextVNode(" " + toDisplayString(r.connectivityError.errorMessage), 1) ], 512), [ [vShow, r.connectivityError.errorConnectivities] ]), t13.loadingError ? (openBlock(), createElementBlock("div", CK, toDisplayString(t13.loadingError), 1)) : createCommentVNode("", true) ])), [ [v, t13.loading] ]); } var B7 = Er(dK, [["render", xK], ["__scopeId", "data-v-1239b5ce"]]); var F_ = (t13) => t13 && t13.charAt(0).toUpperCase() + t13.slice(1); var EK = (t13) => t13.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase()); var SK = (t13) => new Promise((e) => setTimeout(e, t13)); var kK = { name: "ConnectivityList", components: { Button: mr, Container: bg, Icon: Ft, ElIconWarning: warning_default, ElIconSearch: search_default }, props: { entry: { type: Object, default: () => ({ destinations: [], origins: [], components: [], destinationsWithDatasets: [], originsWithDatasets: [], componentsWithDatasets: [], resource: void 0, featuresAlert: void 0 }) }, origins: { type: Array, default: () => [] }, components: { type: Array, default: () => [] }, destinations: { type: Array, default: () => [] }, originsWithDatasets: { type: Array, default: () => [] }, componentsWithDatasets: { type: Array, default: () => [] }, destinationsWithDatasets: { type: Array, default: () => [] }, availableAnatomyFacets: { type: Array, default: () => [] }, connectivityError: { type: Object, default: () => { } } }, data: function() { return { alertTop: 0, originDescriptions: { motor: "is the location of the initial cell body of the circuit", sensory: "is the location of the initial cell body in the PNS circuit" }, facetList: [] }; }, watch: { availableAnatomyFacets: { handler: function(t13) { this.convertFacetsToList(t13); }, immediate: true, deep: true } }, computed: { originDescription: function() { return this.entry && this.entry.title && this.entry.title.toLowerCase().includes("motor") ? this.originDescriptions.motor : this.originDescriptions.sensory; } }, methods: { capitalise: function(t13) { return F_(t13); }, onConnectivityHovered: function(t13, e) { this.$emit("connectivity-hovered", t13), e && (this.alertTop = e.srcElement.offsetParent.offsetTop + e.srcElement.offsetTop); }, onConnectivityClicked: function(t13) { const e = this.connectivityError.errorConnectivities, r = e ? t13.replace(new RegExp(`\\s*,?\\s*${e}\\s*,?\\s*`, "gi"), "").trim() : t13; this.$emit("connectivity-clicked", r); }, // shouldShowMagnifyGlass: Checks whether the hovered terms contain valid term or not shouldShowMagnifyGlass: function(t13) { const e = this.connectivityError.errorConnectivities; return (e == null ? void 0 : e.toLowerCase()) !== t13.toLowerCase(); }, // shouldShowExploreButton: Checks if the feature is in the list of available anatomy facets shouldShowExploreButton: function(t13) { if (!this.facetList.length) return true; for (let e = 0; e < t13.length; e++) if (this.facetList.includes(t13[e].name.toLowerCase())) return true; return false; }, // convertFacetsToList: Converts the available anatomy facets to a list for easy searching convertFacetsToList: function(t13) { t13.forEach((e) => { e.children ? this.convertFacetsToList(e.children) : this.facetList.push(e.label.toLowerCase()); }); }, openAll: function() { this.$emit("connectivity-action-click", { type: "Facets", labels: this.componentsWithDatasets.map((t13) => t13.name.toLowerCase()) }); }, openAxons: function() { this.$emit("connectivity-action-click", { type: "Facets", labels: this.destinationsWithDatasets.map((t13) => t13.name.toLowerCase()) }); }, openDendrites: function() { this.$emit("connectivity-action-click", { type: "Facets", labels: this.originsWithDatasets.map((t13) => t13.name.toLowerCase()) }); } } }; var da = (t13) => (pushScopeId("data-v-81bbd5ff"), t13 = t13(), popScopeId(), t13); var _K = { ref: "connectivityList", class: "connectivity-list" }; var TK = { key: 0, class: "block" }; var IK = { class: "attribute-title-container" }; var OK = da(() => createBaseVNode("span", { class: "attribute-title" }, "Origin", -1)); var AK = { style: { "word-break": "keep-all" } }; var PK = da(() => createBaseVNode("i", null, "Origin", -1)); var DK = ["origin-item-label", "onMouseenter"]; var RK = da(() => createBaseVNode("span", null, "Search connectivity", -1)); var LK = { key: 1, class: "block" }; var FK = da(() => createBaseVNode("div", { class: "attribute-title-container" }, [ createBaseVNode("span", { class: "attribute-title" }, "Components") ], -1)); var MK = ["component-item-label", "onMouseenter"]; var NK = da(() => createBaseVNode("span", null, "Search connectivity", -1)); var BK = { key: 2, class: "block" }; var $K = { class: "attribute-title-container" }; var qK = da(() => createBaseVNode("span", { class: "attribute-title" }, "Destination", -1)); var zK = da(() => createBaseVNode("span", { style: { "word-break": "keep-all" } }, [ createBaseVNode("i", null, "Destination"), createTextVNode(" is where the axons terminate ") ], -1)); var VK = ["destination-item-label", "onMouseenter"]; var HK = da(() => createBaseVNode("span", null, "Search connectivity", -1)); var KK = { class: "block" }; function GK(t13, e, r, n, a, i) { const o = Li, s = warning_default, u = Ft, l = search_default, c = mr; return openBlock(), createElementBlock("div", _K, [ createVNode(o, { width: "250", "show-arrow": false, trigger: "manual", teleported: false, placement: "left-start", visible: !!r.connectivityError.errorConnectivities, "popper-class": "connectivity-error-container" }, { reference: withCtx(() => [ createBaseVNode("div", { class: "connectivity-alert", style: normalizeStyle({ top: t13.alertTop + "px" }) }, null, 4) ]), default: withCtx(() => [ createBaseVNode("strong", null, toDisplayString(r.connectivityError.errorConnectivities), 1), createTextVNode(" " + toDisplayString(r.connectivityError.errorMessage), 1) ]), _: 1 }, 8, ["visible"]), createTextVNode(" " + toDisplayString(r.entry.paths) + " ", 1), r.origins && r.origins.length > 0 ? (openBlock(), createElementBlock("div", TK, [ createBaseVNode("div", IK, [ OK, createVNode(o, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(u, { class: "info" }, { default: withCtx(() => [ createVNode(s) ]), _: 1 }) ]), default: withCtx(() => [ createBaseVNode("span", AK, [ PK, createTextVNode(" " + toDisplayString(i.originDescription), 1) ]) ]), _: 1 }) ]), (openBlock(true), createElementBlock(Fragment, null, renderList(r.origins, (d, f) => (openBlock(), createElementBlock("div", { class: "attribute-content", "origin-item-label": d, key: d, onMouseenter: (h10) => i.onConnectivityHovered(d, h10), onMouseleave: e[0] || (e[0] = (h10) => i.onConnectivityHovered()) }, [ createVNode(o, { width: "150", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ withDirectives(createVNode(u, { class: "magnify-glass", onClick: (h10) => i.onConnectivityClicked(d) }, { default: withCtx(() => [ createVNode(l) ]), _: 2 }, 1032, ["onClick"]), [ [vShow, i.shouldShowMagnifyGlass(d)] ]) ]), default: withCtx(() => [ RK ]), _: 2 }, 1024), createBaseVNode("span", null, toDisplayString(i.capitalise(d)), 1) ], 40, DK))), 128)), withDirectives(createVNode(c, { class: "button", id: "open-dendrites-button", onClick: i.openDendrites }, { default: withCtx(() => [ createTextVNode(" Explore origin data ") ]), _: 1 }, 8, ["onClick"]), [ [ vShow, r.originsWithDatasets && r.originsWithDatasets.length > 0 && i.shouldShowExploreButton(r.originsWithDatasets) ] ]) ])) : createCommentVNode("", true), r.components && r.components.length > 0 ? (openBlock(), createElementBlock("div", LK, [ FK, (openBlock(true), createElementBlock(Fragment, null, renderList(r.components, (d, f) => (openBlock(), createElementBlock("div", { class: "attribute-content", "component-item-label": d, key: d, onMouseenter: (h10) => i.onConnectivityHovered(d, h10), onMouseleave: e[1] || (e[1] = (h10) => i.onConnectivityHovered()) }, [ createVNode(o, { width: "150", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ withDirectives(createVNode(u, { class: "magnify-glass", onClick: (h10) => i.onConnectivityClicked(d) }, { default: withCtx(() => [ createVNode(l) ]), _: 2 }, 1032, ["onClick"]), [ [vShow, i.shouldShowMagnifyGlass(d)] ]) ]), default: withCtx(() => [ NK ]), _: 2 }, 1024), createBaseVNode("span", null, toDisplayString(i.capitalise(d)), 1) ], 40, MK))), 128)) ])) : createCommentVNode("", true), r.destinations && r.destinations.length > 0 ? (openBlock(), createElementBlock("div", BK, [ createBaseVNode("div", $K, [ qK, createVNode(o, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(u, { class: "info" }, { default: withCtx(() => [ createVNode(s) ]), _: 1 }) ]), default: withCtx(() => [ zK ]), _: 1 }) ]), (openBlock(true), createElementBlock(Fragment, null, renderList(r.destinations, (d, f) => (openBlock(), createElementBlock("div", { class: "attribute-content", "destination-item-label": d, key: d, onMouseenter: (h10) => i.onConnectivityHovered(d, h10), onMouseleave: e[2] || (e[2] = (h10) => i.onConnectivityHovered()) }, [ createVNode(o, { width: "150", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ withDirectives(createVNode(u, { class: "magnify-glass", onClick: (h10) => i.onConnectivityClicked(d) }, { default: withCtx(() => [ createVNode(l) ]), _: 2 }, 1032, ["onClick"]), [ [vShow, i.shouldShowMagnifyGlass(d)] ]) ]), default: withCtx(() => [ HK ]), _: 2 }, 1024), createBaseVNode("span", null, toDisplayString(i.capitalise(d)), 1) ], 40, VK))), 128)), withDirectives(createVNode(c, { class: "button", onClick: i.openAxons }, { default: withCtx(() => [ createTextVNode(" Explore destination data ") ]), _: 1 }, 8, ["onClick"]), [ [ vShow, r.destinationsWithDatasets && r.destinationsWithDatasets.length > 0 && i.shouldShowExploreButton(r.destinationsWithDatasets) ] ]) ])) : createCommentVNode("", true), withDirectives(createBaseVNode("div", KK, [ createVNode(c, { class: "button", onClick: i.openAll }, { default: withCtx(() => [ createTextVNode(" Search for data on components ") ]), _: 1 }, 8, ["onClick"]) ], 512), [ [ vShow, r.componentsWithDatasets && r.componentsWithDatasets.length > 0 && i.shouldShowExploreButton(r.componentsWithDatasets) ] ]) ], 512); } var M_ = Er(kK, [["render", GK], ["__scopeId", "data-v-81bbd5ff"]]); var UK = function(t13) { return t13 ? t13.charAt(0).toUpperCase() + t13.slice(1) : ""; }; var WK = { name: "ConnectionDialog", props: { connectionEntry: { type: Object, default: {} }, inDrawing: { type: Boolean, default: false }, connectionExist: { type: Boolean, default: false } }, data: function() { return { tooltipId: void 0 }; }, methods: { shadowDisplay: function(t13) { return this.tooltipId === t13 ? "always" : "hover"; }, capitalize: function(t13) { return UK(t13); }, handleTooltip: function(t13) { this.tooltipId = this.tooltipId === t13 ? void 0 : t13, this.$emit("featureTooltip", this.tooltipId); } } }; var vy = (t13) => (pushScopeId("data-v-1ddab772"), t13 = t13(), popScopeId(), t13); var jK = { class: "dialog-container" }; var YK = vy(() => createBaseVNode("span", { class: "dialog-title" }, "Finalize drawing", -1)); var ZK = vy(() => createBaseVNode("span", { class: "dialog-title" }, "Visualize connection", -1)); var XK = vy(() => createBaseVNode("b", null, [ createBaseVNode("span", null, "Related Features") ], -1)); var JK = { class: "connection-label" }; function QK(t13, e, r, n, a, i) { const o = mr, s = Dl, u = Qo, l = Li, c = dM; return openBlock(), createElementBlock("div", jK, [ createVNode(s, null, { default: withCtx(() => [ createVNode(u, null, { default: withCtx(() => [ r.inDrawing ? (openBlock(), createBlock(s, { key: 0 }, { default: withCtx(() => [ YK, createVNode(o, { type: "primary", plain: "", onClick: e[0] || (e[0] = (d) => t13.$emit("confirmDrawn", true)) }, { default: withCtx(() => [ createTextVNode(" Confirm ") ]), _: 1 }), createVNode(o, { type: "primary", plain: "", onClick: e[1] || (e[1] = (d) => t13.$emit("cancelDrawn", true)) }, { default: withCtx(() => [ createTextVNode(" Cancel ") ]), _: 1 }) ]), _: 1 })) : (openBlock(), createBlock(s, { key: 1 }, { default: withCtx(() => [ ZK, createVNode(o, { type: "primary", plain: "", onClick: e[2] || (e[2] = (d) => t13.$emit("dialogDisplay", false)) }, { default: withCtx(() => [ createTextVNode(" Close ") ]), _: 1 }) ]), _: 1 })) ]), _: 1 }) ]), _: 1 }), r.connectionExist ? (openBlock(), createBlock(s, { key: 0 }, { default: withCtx(() => [ createVNode(u, null, { default: withCtx(() => [ XK, (openBlock(true), createElementBlock(Fragment, null, renderList(r.connectionEntry, (d, f) => (openBlock(), createBlock(s, { key: f }, { default: withCtx(() => [ createVNode(c, { shadow: i.shadowDisplay(f), onClick: (h10) => i.handleTooltip(f) }, { default: withCtx(() => [ createVNode(l, { trigger: "hover", disabled: d.label.length < 20, width: 200, content: i.capitalize(d.label) }, { reference: withCtx(() => [ createBaseVNode("span", JK, toDisplayString(i.capitalize(d.label)), 1) ]), _: 2 }, 1032, ["disabled", "content"]) ]), _: 2 }, 1032, ["shadow", "onClick"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ]), _: 1 })) : createCommentVNode("", true) ]); } var eG = Er(WK, [["render", QK], ["__scopeId", "data-v-1ddab772"]]); var N_ = (t13, e) => { const r = t13.__vccOpts || t13; for (const [n, a] of e) r[n] = a; return r; }; var tG = ["xlink:href"]; var rG = { __name: "SvgIcon", props: { /** * The svg icon to show. */ icon: { type: String, required: true }, /** * The option to spin the icon. */ spin: { type: Boolean, default: false } }, setup(t13) { return (e, r) => (openBlock(), createElementBlock("svg", { class: normalizeClass(["map-icon", { "map-icon-spin": t13.spin }]) }, [ createBaseVNode("use", { "xlink:href": `#${t13.icon}` }, null, 8, tG) ], 2)); } }; var nG = N_(rG, [["__scopeId", "data-v-e172d5ff"]]); var B_ = ` 2horpanel ? `; var $_ = ` 2vertpanel ? `; var q_ = ` 3panel ? `; var z_ = ` 4panel ? `; var V_ = ` 2horpanel ? `; var H_ = ` 2horpanel ? `; var K_ = ` 4panel ? `; var G_ = ` changeBckgd `; var U_ = ` close no bk `; var W_ = ` close `; var j_ = ` closeFullScreen `; var Y_ = ` Comment `; var Z_ = ` Connection `; var X_ = ` dock `; var J_ = ` drawLine `; var Q_ = ` drawPoint `; var eT = ` drawPolygon `; var tT = ` drawTrash `; var rT = ` fitWindow `; var nT = ` fullScreen `; var aT = 'DataPortal-Icons'; var iT = ` magnifyingGlass `; var oT = `Created by Wahyu Prihantorofrom the Noun Project`; var sT = ` openMap `; var lT = ` Artboard Copy 6 `; var uT = ` permalink `; var cT = ` play `; var dT = ` resetZoom `; var fT = ` singlepanel ? `; var vT = ` tooltips ? `; var hT = ` undock `; var pT = ` zoomIn `; var gT = ` zoomOut `; var yT = (t13, e, r, n) => { const a = ["title", "desc", "defs", "style"], i = ["width", "height"], o = n || []; let s = document.createElement("div"); s.innerHTML = t13, a.map((l) => { const c = s.querySelector(l); c && c.remove(); }), i.map((l) => { s.querySelector("svg").removeAttribute(l); }), n && o.map((l) => { Object.values(s.querySelectorAll(`[${l}]`)).map((c) => { c.removeAttribute(l); }); }); const u = s.innerHTML; return s = null, u; }; var mT = (t13) => [ // Remove XML stuffs and comments [/<\?xml[\s\S]*?>/gi, ""], [//gi, ""], [//gi, ""], // SVG XML -> HTML5 [/\<([A-Za-z]+)([^\>]*)\/\>/g, "<$1$2>"], // convert self-closing XML SVG nodes to explicitly closed HTML5 SVG nodes [/\s+/g, " "], // replace whitespace sequences with a single space [/\> \<"] // remove whitespace between tags ].reduce((e, r) => "".replace.apply(e, r), t13).trim(); var aG = true; var iG = true; var oG = ["fill"]; var Vp = Object.assign({ "/assets/icons/2horpanel.svg": B_, "/assets/icons/2vertpanel.svg": $_, "/assets/icons/3panel.svg": q_, "/assets/icons/4panel.svg": z_, "/assets/icons/5panel.svg": V_, "/assets/icons/6panel.svg": H_, "/assets/icons/6panelVertical.svg": K_, "/assets/icons/changeBckgd.svg": G_, "/assets/icons/close-no-bk.svg": U_, "/assets/icons/close.svg": W_, "/assets/icons/closeFullScreen.svg": j_, "/assets/icons/comment.svg": Y_, "/assets/icons/connection.svg": Z_, "/assets/icons/dock.svg": X_, "/assets/icons/drawLine.svg": J_, "/assets/icons/drawPoint.svg": Q_, "/assets/icons/drawPolygon.svg": eT, "/assets/icons/drawTrash.svg": tT, "/assets/icons/fitWindow.svg": rT, "/assets/icons/fullScreen.svg": nT, "/assets/icons/help.svg": aT, "/assets/icons/magnifyingGlass.svg": iT, "/assets/icons/noun-filter.svg": oT, "/assets/icons/openMap.svg": sT, "/assets/icons/pause.svg": lT, "/assets/icons/permalink.svg": uT, "/assets/icons/play.svg": cT, "/assets/icons/resetZoom.svg": dT, "/assets/icons/singlepanel.svg": fT, "/assets/icons/tooltips.svg": vT, "/assets/icons/undock.svg": hT, "/assets/icons/zoomIn.svg": pT, "/assets/icons/zoomOut.svg": gT }); var sG = Object.keys(Vp).map((t13) => { const e = yT(Vp[t13], aG, iG, oG), r = t13.replace(/^.+\/(\w+).svg$/, "$1"); return mT(e).replace("", "symbol>"); }); sG.join(` `); var Hp = Object.assign({ "/assets/icons/2horpanel.svg": B_, "/assets/icons/2vertpanel.svg": $_, "/assets/icons/3panel.svg": q_, "/assets/icons/4panel.svg": z_, "/assets/icons/5panel.svg": V_, "/assets/icons/6panel.svg": H_, "/assets/icons/6panelVertical.svg": K_, "/assets/icons/changeBckgd.svg": G_, "/assets/icons/close-no-bk.svg": U_, "/assets/icons/close.svg": W_, "/assets/icons/closeFullScreen.svg": j_, "/assets/icons/comment.svg": Y_, "/assets/icons/connection.svg": Z_, "/assets/icons/dock.svg": X_, "/assets/icons/drawLine.svg": J_, "/assets/icons/drawPoint.svg": Q_, "/assets/icons/drawPolygon.svg": eT, "/assets/icons/drawTrash.svg": tT, "/assets/icons/fitWindow.svg": rT, "/assets/icons/fullScreen.svg": nT, "/assets/icons/help.svg": aT, "/assets/icons/magnifyingGlass.svg": iT, "/assets/icons/noun-filter.svg": oT, "/assets/icons/openMap.svg": sT, "/assets/icons/pause.svg": lT, "/assets/icons/permalink.svg": uT, "/assets/icons/play.svg": cT, "/assets/icons/resetZoom.svg": dT, "/assets/icons/singlepanel.svg": fT, "/assets/icons/tooltips.svg": vT, "/assets/icons/undock.svg": hT, "/assets/icons/zoomIn.svg": pT, "/assets/icons/zoomOut.svg": gT }); var lG = Object.keys(Hp).map((t13) => { const e = yT(Hp[t13]), r = t13.replace(/^.+\/(\w+).svg$/, "$1"); return mT(e).replace("", "symbol>"); }); var uG = { name: "MapSvgSpriteColor", svgContext: Hp, svgSprite: lG.join(` `) // concatenate all symbols into $options.svgSprite }; var cG = ["innerHTML"]; function dG(t13, e, r, n, a, i) { return openBlock(), createElementBlock("svg", { width: "0", height: "0", style: { display: "none" }, innerHTML: t13.$options.svgSprite }, null, 8, cG); } var fG = N_(uG, [["render", dG]]); var vG = (t13, e) => { let r, n, a, i, o, s; e.style.left = "", e.style.top = "", e.addEventListener( "mousedown", (l) => { l.preventDefault(), r = e.offsetLeft, n = e.offsetTop, a = l.clientX, i = l.clientY, e.addEventListener("mousemove", u, false), document.addEventListener( "mouseup", () => { e.removeEventListener("mousemove", u, false); }, false ); }, false ); function u(l) { l.preventDefault(), o = r - (a - l.clientX), s = n - (i - l.clientY), e.style.left = `${o}px`, e.style.top = `${s}px`; } }; var hG = { name: "DrawToolbar", components: { MapSvgIcon: nG, MapSvgSpriteColor: fG }, props: { /** * Optional * * Associated with the Connection dialog. * This is needed to display the dialog and provides the additional drag capability to the dialog. * * e.g. * :mapCanvas="{ * containerHTML: appRef, // Reference to the map canvas container. * class: '.maplibregl-canvas', // CSS selector for the map canvas. * }" */ mapCanvas: { type: Object, default: void 0 }, /** * Array of toolbar options to display. * 'Connection' requires 'LineString' is included in the toolbar options. */ toolbarOptions: { type: Array, default: [ "Edit", "Delete", "Point", "LineString", "Polygon", "Connection" ] }, /** * Optional * * To update the toolbar icons or filter the features based on the tool type. * e.g. "All tools", "Point", "LineString", "Polygon" or "None". */ drawnType: { type: String, default: "All tools" }, activeDrawTool: { required: true }, activeDrawMode: { required: true }, /** * Optional * * Associated with the Connection dialog. * This will popup a dialog if new feature is drawn and map canvas exists. */ newlyDrawnEntry: { type: Object, default: {} }, /** * Optional * * Associated with the Connection dialog. * This will add entries to the dialog. */ connectionEntry: { type: Object, default: {} }, /** * Add following to the top hoverVisibilities array to enable tooltips for each icon. * [ * { value: false, refs: 'toolbarPopover', ref: 'editPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'deletePopover' }, * { value: false, refs: 'toolbarPopover', ref: 'pointPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'lineStringPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'polygonPopover' }, * { value: false, refs: 'toolbarPopover', ref: 'connectionPopover' }, * ] */ hoverVisibilities: { type: Array, required: true, default: [ { value: false, ref: "editPopover" }, { value: false, ref: "deletePopover" }, { value: false, ref: "pointPopover" }, { value: false, ref: "lineStringPopover" }, { value: false, ref: "polygonPopover" }, { value: false, ref: "connectionPopover" } ] } }, data: function() { return { toolbarIcons: [ { name: "Edit", active: false, disabled: false, type: "mode" }, { name: "Delete", active: false, disabled: false, type: "mode" }, { name: "Point", active: false, disabled: false, type: "tool" }, { name: "LineString", active: false, disabled: false, type: "tool" }, { name: "Polygon", active: false, disabled: false, type: "tool" }, { name: "Connection", active: false, disabled: true, type: "conn" } ], connectionDisplay: false, dialogPosition: { offsetX: 0, offsetY: 0, x: void 0, y: void 0 } }; }, computed: { showAllToolIcons: function() { return this.drawnType === "All tools" || this.drawnType === "None"; }, showEditModeIcon: function() { return this.toolbarOptions.includes("Edit"); }, showDeleteModeIcon: function() { return this.toolbarOptions.includes("Delete"); }, showDrawPointIcon: function() { return this.toolbarOptions.includes("Point") && (this.showAllToolIcons || this.drawnType === "Point"); }, showDrawLineStringIcon: function() { return this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString"); }, showDrawPolygonIcon: function() { return this.toolbarOptions.includes("Polygon") && (this.showAllToolIcons || this.drawnType === "Polygon"); }, showConnectionIcon: function() { return this.toolbarOptions.includes("Connection") && this.toolbarOptions.includes("LineString") && (this.showAllToolIcons || this.drawnType === "LineString"); }, inDrawing: function() { return this.activeDrawTool !== void 0; }, newlyDrawnExist: function() { return Object.keys(this.newlyDrawnEntry).length > 0; }, connectionExist: function() { return Object.keys(this.connectionEntry).length > 0; } }, watch: { drawnType: function() { this.disabledToolbarConnectionIcon(true); }, activeDrawMode: function(t13) { this.updateToolbarIcons(t13, "mode"), t13 === "Delete" && (this.connectionDisplay = false); }, activeDrawTool: function(t13) { this.updateToolbarIcons(t13, "tool"), t13 || (this.connectionDisplay = false); }, newlyDrawnExist: function(t13) { t13 && (this.connectionDisplay = true); }, connectionExist: function(t13) { this.disabledToolbarConnectionIcon(!t13), t13 || (this.connectionDisplay = false); }, connectionDisplay: function(t13) { this.activeToolbarConnectionIcon(t13), t13 ? this.dialogCssHacks() : this.$emit("featureTooltip", void 0); }, dialogPosition: { handler: function() { const t13 = this.$el.getBoundingClientRect(); this.dialogPosition.offsetX = t13.x, this.dialogPosition.offsetY = t13.y; }, deep: true, once: true } }, methods: { iconDisabled: function(t13) { return this.toolbarIcons.filter((e) => e.name === t13)[0].disabled; }, modeClickEvent: function(t13) { if (!this.iconDisabled(t13)) { const e = this.activeDrawMode === t13 ? void 0 : t13; this.$emit("clickToolbar", "mode", e); } }, toolClickEvent: function(t13) { if (!this.iconDisabled(t13)) { const e = this.activeDrawTool === t13 ? void 0 : t13; this.$emit("clickToolbar", "tool", e); } }, connectionClickEvent: function() { !this.iconDisabled("Connection") && !this.newlyDrawnExist && (this.connectionDisplay = !this.connectionDisplay); }, updateToolbarIcons: function(t13, e) { this.toolbarIcons.map((r) => { r.name === t13 ? r.active = true : r.active = false; }), this.toolbarIcons.filter((r) => r.type !== "conn").filter((r) => r.type !== e).map((r) => { t13 ? r.disabled = true : r.disabled = false; }), this.toolbarCssHacks(); }, disabledToolbarConnectionIcon: function(t13) { this.toolbarIcons.filter((e) => e.type === "conn").map((e) => { t13 ? e.disabled = true : e.disabled = false, this.activeDrawMode === "Delete" && (e.disabled = true); }), this.toolbarCssHacks(); }, activeToolbarConnectionIcon: function(t13) { this.toolbarIcons.filter((e) => e.type === "conn").map((e) => { t13 ? e.active = true : e.active = false; }), this.toolbarCssHacks(); }, toolbarCssHacks: function() { this.$nextTick(() => { this.toolbarIcons.map((t13) => { const e = this.$el.querySelector(`.draw${t13.name}`); e && (t13.active ? e.classList.add("active") : e.classList.remove("active"), t13.disabled ? e.classList.add("disabled") : e.classList.remove("disabled")); }); }); }, dialogCssHacks: function() { this.$nextTick(() => { const t13 = this.$el.querySelector(".connection-dialog"); vG(this.mapCanvas.containerHTML, t13); let e, r; const n = this.mapCanvas.containerHTML.getBoundingClientRect(), a = t13.getBoundingClientRect(); this.dialogPosition.x > n.width / 2 ? e = this.dialogPosition.x - a.width : e = this.dialogPosition.x, this.dialogPosition.y > n.height / 2 ? r = this.dialogPosition.y - a.height : r = this.dialogPosition.y, t13.style.transform = `translate(${e - this.dialogPosition.offsetX}px, ${r - this.dialogPosition.offsetY}px)`; }); }, hoverIndex: function(t13) { return this.hoverVisibilities.findIndex((e) => e.ref === t13); }, showTooltip: function(t13) { this.$emit("showTooltip", t13); }, hideTooltip: function(t13) { this.$emit("hideTooltip", t13); }, dialogPopUpPositionHandler: function(t13) { t13.preventDefault(), this.dialogPosition.x = t13.clientX, this.dialogPosition.y = t13.clientY, this.activeDrawTool === "Point" && this.dialogCssHacks(); } }, mounted: function() { this.$nextTick(() => { this.toolbarCssHacks(), this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).addEventListener("click", this.dialogPopUpPositionHandler, false); }); }, destroyed: function() { this.mapCanvas && this.mapCanvas.containerHTML.querySelector(this.mapCanvas.class).removeEventListener("click", this.dialogPopUpPositionHandler, false); } }; var pG = { class: "toolbar-container" }; var gG = { class: "toolbar-icons" }; function yG(t13, e, r, n, a, i) { const o = resolveComponent("map-svg-sprite-color"), s = resolveComponent("map-svg-icon"), u = Li, l = eG; return openBlock(), createElementBlock("div", pG, [ createVNode(o), createBaseVNode("div", gG, [ i.showEditModeIcon ? (openBlock(), createBlock(u, { key: 0, content: "Edit Mode", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("editPopover")].value, ref: "editPopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "comment", class: "icon-button drawEdit", onClick: e[0] || (e[0] = (c) => i.modeClickEvent("Edit")), onMouseover: e[1] || (e[1] = (c) => i.showTooltip(i.hoverIndex("editPopover"))), onMouseout: e[2] || (e[2] = (c) => i.hideTooltip(i.hoverIndex("editPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showDeleteModeIcon ? (openBlock(), createBlock(u, { key: 1, content: "Delete Mode", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("deletePopover")].value, ref: "deletePopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "drawTrash", class: "icon-button drawDelete", onClick: e[3] || (e[3] = (c) => i.modeClickEvent("Delete")), onMouseover: e[4] || (e[4] = (c) => i.showTooltip(i.hoverIndex("deletePopover"))), onMouseout: e[5] || (e[5] = (c) => i.hideTooltip(i.hoverIndex("deletePopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showDrawPointIcon ? (openBlock(), createBlock(u, { key: 2, content: "Draw Point", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("pointPopover")].value, ref: "pointPopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "drawPoint", class: "icon-button drawPoint", onClick: e[6] || (e[6] = (c) => i.toolClickEvent("Point")), onMouseover: e[7] || (e[7] = (c) => i.showTooltip(i.hoverIndex("pointPopover"))), onMouseout: e[8] || (e[8] = (c) => i.hideTooltip(i.hoverIndex("pointPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showDrawLineStringIcon ? (openBlock(), createBlock(u, { key: 3, content: "Draw LineString", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("lineStringPopover")].value, ref: "drawLinePopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "drawLine", class: "icon-button drawLineString", onClick: e[9] || (e[9] = (c) => i.toolClickEvent("LineString")), onMouseover: e[10] || (e[10] = (c) => i.showTooltip(i.hoverIndex("lineStringPopover"))), onMouseout: e[11] || (e[11] = (c) => i.hideTooltip(i.hoverIndex("lineStringPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showDrawPolygonIcon ? (openBlock(), createBlock(u, { key: 4, content: "Draw Polygon", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("polygonPopover")].value, ref: "polygonPopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "drawPolygon", class: "icon-button drawPolygon", onClick: e[12] || (e[12] = (c) => i.toolClickEvent("Polygon")), onMouseover: e[13] || (e[13] = (c) => i.showTooltip(i.hoverIndex("polygonPopover"))), onMouseout: e[14] || (e[14] = (c) => i.hideTooltip(i.hoverIndex("polygonPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true), i.showConnectionIcon ? (openBlock(), createBlock(u, { key: 5, content: "Connectivity", placement: "top", teleported: false, trigger: "manual", width: "100", "popper-class": "flatmap-popper", visible: r.hoverVisibilities[i.hoverIndex("connectionPopover")].value, ref: "connectionPopover" }, { reference: withCtx(() => [ createVNode(s, { icon: "connection", class: "icon-button drawConnection", onClick: e[15] || (e[15] = (c) => i.connectionClickEvent()), onMouseover: e[16] || (e[16] = (c) => i.showTooltip(i.hoverIndex("connectionPopover"))), onMouseout: e[17] || (e[17] = (c) => i.hideTooltip(i.hoverIndex("connectionPopover"))) }) ]), _: 1 }, 8, ["visible"])) : createCommentVNode("", true) ]), r.mapCanvas ? withDirectives((openBlock(), createBlock(l, { key: 0, class: "connection-dialog", connectionEntry: r.connectionEntry, inDrawing: i.inDrawing, connectionExist: i.connectionExist, onDialogDisplay: e[18] || (e[18] = (c) => i.connectionClickEvent()), onConfirmDrawn: e[19] || (e[19] = (c) => t13.$emit("confirmDrawn", c)), onCancelDrawn: e[20] || (e[20] = (c) => t13.$emit("cancelDrawn", c)), onFeatureTooltip: e[21] || (e[21] = (c) => t13.$emit("featureTooltip", c)) }, null, 8, ["connectionEntry", "inDrawing", "connectionExist"])), [ [vShow, t13.connectionDisplay] ]) : createCommentVNode("", true) ]); } var $7 = Er(hG, [["render", yG], ["__scopeId", "data-v-21e6f6bd"]]); var mG = { name: "HelpModeDialog", props: { /** * MultiFlatmapRef from multiflatmapvuer. Provide this when using with MultiFlatmap. */ multiflatmapRef: { type: Object, default: null }, /** * FlatmapRef from flatmapvuer. Provide this when using with Flatmap. */ flatmapRef: { type: Object, default: null }, /** * ScaffoldRef from scaffoldvuer. Provide this when using with Scaffold. */ scaffoldRef: { type: Object, default: null }, /** * The flag for last tooltip item. */ lastItem: { type: Boolean, default: false, required: false } }, mounted: function() { this.toggleHelpModeHighlight(true), this.toggleTooltipHighlight(); }, unmounted: function() { this.toggleHelpModeHighlight(false); }, watch: { lastItem: function(t13) { t13 && this.toggleTooltipHighlight(); } }, methods: { /** * This function will be called on clicking Next button. * * @public */ showNext: function() { this.$emit("show-next"); }, /** * This function will be called on clicking Finish button. * * @public */ finishHelpMode: function() { this.$emit("finish-help-mode"); }, /** * This function must be called on 'shown-map-tooltip' event. * * @public */ toggleTooltipPinHighlight: function() { const t13 = this.getCurrentFlatmap(); this.resetHighlightedItems(), this.$nextTick(() => { var i; const e = t13.querySelectorAll(".maplibregl-marker"), r = t13.querySelector( ".flatmap-popup-popper" ), n = ((i = r == null ? void 0 : r.style) == null ? void 0 : i.transform) || "", a = this.extractMarkerPosition(n); e.forEach((o) => { const s = o.style.transform; this.extractMarkerPosition(s) === a && o.classList.add("in-help-highlight"); }); }); }, /** * This function must be called on 'shown-tooltip' event. * * @public */ toggleTooltipHighlight: function() { this.resetHighlightedItems(), this.$nextTick(() => { document.querySelectorAll( '.el-popper:not([style*="none"])' ).forEach((e) => { const r = e.classList.contains("flatmap-popper"), n = e.classList.contains( "el-fade-in-linear-enter-active" ); (r || n) && this.toggleHighlight(e); }); }); }, toggleHighlight: function(t13) { const e = (t13 == null ? void 0 : t13.id) || "", r = document.querySelector( `[aria-describedby="${e}"]` ); r && r.classList.add("in-help-highlight"); }, resetHighlightedItems: function() { document.querySelectorAll(".in-help-highlight").forEach((e) => { e.classList.remove("in-help-highlight"); }); }, getCurrentScaffold: function() { var e; return ((e = this.scaffoldRef) == null ? void 0 : e.$el) || null; }, getCurrentMultiflatmap: function() { var e; return ((e = this.multiflatmapRef) == null ? void 0 : e.$el) || null; }, getCurrentFlatmap: function() { var r; const t13 = this.flatmapRef || ((r = this.multiflatmapRef) == null ? void 0 : r.getCurrentFlatmap()); return (t13 == null ? void 0 : t13.$el) || null; }, toggleHelpModeHighlight: function(t13) { const e = this.getCurrentMultiflatmap(), r = this.getCurrentFlatmap(), n = this.getCurrentScaffold(), a = document.querySelectorAll(".in-help-highlight"); e && (t13 ? e.classList.add("in-help") : e.classList.remove("in-help")), r && (t13 ? r.classList.add("in-help") : r.classList.remove("in-help")), n && (t13 ? n.classList.add("in-help") : n.classList.remove("in-help")), t13 || a.forEach((i) => { i.classList.remove("in-help-highlight"); }); }, /** * Temporary solution to find the position of map marker from popover */ extractMarkerPosition: function(t13) { const e = /translate\((.*?)\)/g, r = t13.match(e); return r ? r[r.length - 1].slice(10, -1) : ""; } } }; var hy = (t13) => (pushScopeId("data-v-3efb89fb"), t13 = t13(), popScopeId(), t13); var bG = hy(() => createBaseVNode("h4", null, "Help Mode", -1)); var wG = hy(() => createBaseVNode("p", null, [ createTextVNode(" All caught up! "), createBaseVNode("br"), createTextVNode(" Click 'Help' to restart. ") ], -1)); var CG = hy(() => createBaseVNode("p", null, 'Click "Next" to see the next item.', -1)); function xG(t13, e, r, n, a, i) { const o = mr; return openBlock(), createElementBlock("div", { class: normalizeClass(["help-mode-dialog", { finish: r.lastItem }]) }, [ bG, r.lastItem ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ wG, createBaseVNode("div", null, [ createVNode(o, { class: "button", onClick: i.finishHelpMode }, { default: withCtx(() => [ createTextVNode(" Finish ") ]), _: 1 }, 8, ["onClick"]) ]) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [ CG, createBaseVNode("div", null, [ createVNode(o, { class: "button", onClick: i.showNext }, { default: withCtx(() => [ createTextVNode(" Next ") ]), _: 1 }, 8, ["onClick"]), createVNode(o, { class: "button secondary", onClick: i.finishHelpMode }, { default: withCtx(() => [ createTextVNode(" Exit Help Mode ") ]), _: 1 }, 8, ["onClick"]) ]) ], 64)) ], 2); } var q7 = Er(mG, [["render", xG], ["__scopeId", "data-v-3efb89fb"]]); var EG = { name: "RelatedConnectivitiesButton", props: { resource: { type: String, required: true } } }; var SG = { class: "reference-button-container" }; function kG(t13, e, r, n, a, i) { const o = mr; return openBlock(), createElementBlock("div", SG, [ createVNode(o, { class: "reference-icon-button", size: "small", onClick: e[0] || (e[0] = (s) => t13.$emit("show-related-connectivities", r.resource)) }, { default: withCtx(() => [ createTextVNode(" Show related connectivities ") ]), _: 1 }) ]); } var bT = Er(EG, [["render", kG], ["__scopeId", "data-v-2f3dd1db"]]); var _G = "https://citation.doi.org"; var TG = [ { label: "APA", value: "apa" }, { label: "Chicago", value: "chicago-author-date" }, { label: "IEEE", value: "ieee" }, { label: "Bibtex", value: "bibtex" } ]; var sp = "apa"; var IG = 600; var OG = { name: "ExternalResourceCard", components: { CopyToClipboard: Sg, RelatedConnectivitiesButton: bT }, props: { resources: { type: Array, default: () => [] } }, data: function() { return { pubMedReferences: [], openLibReferences: [], isbnDBReferences: [], referecesListContent: "", citationOptions: TG, citationType: sp, crosscite_host: _G }; }, watch: { resources: function(t13) { this.formatReferences([...t13]), this.getCitationText(sp); } }, computed: { referencesWithDOI: function() { return this.pubMedReferences.filter((e) => e.type === "doi" || e.doi).length; } }, mounted: function() { this.formatReferences([...this.resources]), this.getCitationText(sp); }, methods: { showRelatedConnectivities: function(t13) { this.$emit("show-reference-connectivities", t13); }, formatReferences: function(t13) { const e = this.extractNonPubMedReferences(t13), r = t13.filter((n) => !e.includes(n)); this.pubMedReferences = r.map( (n) => typeof n == "object" ? this.extractPublicationIdFromURLString(n[0]) : this.extractPublicationIdFromURLString(n) ), this.pubMedReferences.forEach((n) => { if (n.type === "pmc") { const a = n.id; this.searchPMID(a).then((i) => { if (i && i.esearchresult) { const o = i.esearchresult.idlist || []; n.id = o[0], n.type = "pmid"; } }); } }), this.formatNonPubMedReferences(e).then((n) => { this.openLibReferences = n.filter((a) => a.type === "openlib"), this.isbnDBReferences = n.filter((a) => a.type === "isbndb"), this.formatOpenLibReferences(); }); }, extractNonPubMedReferences: function(t13) { const e = [], r = this.getPubMedDomains(); return t13.forEach((n) => { let a = 0; r.forEach((i) => { n.includes(i) && a++; }), a || e.push(n); }), e; }, formatNonPubMedReferences: async function(t13) { const e = [], r = t13.filter((l) => l.indexOf("isbn") !== -1), n = r.map((l) => "ISBN:" + l.split("/").pop()), a = n.join(","), i = n.slice(), o = (l) => r.find((c) => c.includes(l)), s = `https://openlibrary.org/api/books?bibkeys=${a}&format=json`, u = await this.fetchData(s); for (const l in u) { const c = i.indexOf(l); i.splice(c, 1); const d = u[l].info_url, f = d.split("/"), h10 = f.indexOf("books"), v = f[h10 + 1], p = l.split(":")[1], g = o(p); e.push({ id: p, type: "openlib", url: d, bookId: v, resource: g }); } return i.forEach((l) => { const c = l.split(":")[1], d = `https://isbndb.com/book/${c}`, f = o(c); e.push({ id: c, url: d, type: "isbndb", resource: f }); }), e; }, extractPublicationIdFromURLString: function(t13) { if (!t13) return; const e = decodeURIComponent(t13); let r = { id: "", type: "", citation: {}, resource: t13 }; return this.getPubMedDomains().forEach((a) => { const i = e.lastIndexOf(a); i !== -1 && (r.id = e.slice(i + a.length), a === "doi.org/" ? r.type = "doi" : a === "pmc/articles/" ? r.type = "pmc" : r.type = "pmid"); }), r.id === "" && (t13.includes("doi:") ? (r.id = this.stripPMIDPrefix(t13), r.type = "doi") : t13.includes("PMID:") && (r.id = this.stripPMIDPrefix(t13), r.type = "pmid")), r.id.endsWith("/") && (r.id = r.id.slice(0, -1)), r; }, getPubMedDomains: function() { return [ "doi.org/", "nih.gov/pubmed/", "pmc/articles/", "pubmed.ncbi.nlm.nih.gov/" ]; }, stripPMIDPrefix: function(t13) { return t13.split(":")[1]; }, onCitationFormatChange: function(t13) { this.citationType = t13, this.getCitationText(t13); }, generateCitationText: function(t13, e) { const { id: r, type: n, doi: a } = t13; if (!(t13.citation && t13.citation[e]) && r) if (t13.citation[e] = "", t13.citation.error = null, n === "doi" || a) { const i = n === "doi" ? r : a; this.getCitationTextByDOI(i).then((o) => { const s = this.replaceLinkInText(o); t13.citation[e] = s, this.updateCopyContents(); }).catch((o) => { t13.citation.error = { type: e, ref: "doi" }; }); } else n === "pmid" && this.getDOIFromPubMedID(r).then((i) => { if (i != null && i.result) { const o = i.result[r], u = ((o == null ? void 0 : o.articleids) || []).find((c) => c.idtype === "doi"), l = u == null ? void 0 : u.value; if (l) t13.doi = l, this.getCitationTextByDOI(l).then((c) => { const d = this.replaceLinkInText(c); t13.citation[e] = d, this.updateCopyContents(); }).catch((c) => { t13.citation.error = { type: e, ref: "doi" }; }); else { const { title: c, pubdate: d, authors: f } = o, h10 = f ? f.map((p) => p.name) : [], v = this.formatCopyReference({ title: c || "", date: d || "", authors: h10, url: `https://pubmed.ncbi.nlm.nih.gov/${r}` }); t13.citation[e] = v, this.updateCopyContents(); } } }).catch((i) => { t13.citation.error = { type: e, ref: "pubmed" }; }); }, getCitationText: function(t13) { async function e(r) { for (let n = 0; n < r.pubMedReferences.length; n++) r.generateCitationText(r.pubMedReferences[n], t13), r.pubMedReferences.length > 3 && n < r.pubMedReferences.length - 1 && await SK(IG); } e(this); }, reloadCitation: function(t13) { this.generateCitationText(t13, this.citationType); }, isCitationLoading: function(t13) { return t13 && !t13[this.citationType] && !t13.error; }, isCitationError: function(t13) { return t13 && t13.error && t13.error.type === this.citationType; }, updateCopyContents: function() { const t13 = this.citationOptions.find((n) => n.value === this.citationType); let e = ""; const r = []; if (this.referencesWithDOI && (e = t13 == null ? void 0 : t13.label), this.pubMedReferences.forEach((n) => { r.push(n.citation[this.citationType]); }), this.openLibReferences.forEach((n) => { r.push(this.formatCopyReference(n)); }), this.isbnDBReferences.forEach((n) => { r.push(n.url); }), r.length) { const a = ``, i = "
References
"; this.referecesListContent = i + ` ` + a; } this.$emit("references-loaded", { style: e, list: r }); }, replaceLinkInText: function(t13) { const e = "https://"; let r = t13.split(e)[1]; if (r) { r = r.split(" ")[0], r = r.trim(), r.endsWith(".") && (r = r.substring(0, r.length - 1)); const n = e + r, a = `${n}`; return t13.replace(n, a); } return t13; }, searchPMID: async function(t13) { const e = `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=${t13}&format=json`; return await this.fetchData(e); }, getCitationTextByDOI: async function(t13) { const e = `${this.crosscite_host}/format?doi=${t13}&style=${this.citationType}&lang=en-US`; return await this.fetchData(e, "text"); }, getDOIFromPubMedID: async function(t13) { const e = `https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id=${t13}&format=json`; return await this.fetchData(e); }, formatOpenLibReferences: function() { this.openLibReferences.forEach((t13) => { const { bookId: e } = t13; this.getBookData(e).then((r) => { const { title: n, authors: a, publish_date: i } = r; n && (t13.title = n), i && (t13.date = i), a && (t13.authors = [], a.forEach((o) => { this.getBookAuthor(o.key).then((s) => { const { name: u } = s; u && (t13.authors.push(u), this.updateCopyContents()); }); })), this.updateCopyContents(); }); }); }, getBookData: async function(t13) { const e = `https://openlibrary.org/books/${t13}.json`; return await this.fetchData(e); }, getBookAuthor: async function(t13) { const e = `https://openlibrary.org${t13}.json`; return await this.fetchData(e); }, formatCopyReference: function(t13) { const e = [], { title: r, date: n, authors: a, url: i } = t13; return r && e.push(r), n && e.push(`(${n})`), a && e.push(`- ${a.join(", ")}`), e.push(`
${i}
`), e.join(" "); }, fetchData: async function(t13, e) { try { const r = await fetch(t13); if (!r.ok) throw new Error(`Response status: ${r.status}`); return e === "text" ? await r.text() : await r.json(); } catch (r) { throw new Error(r); } } } }; var Za = (t13) => (pushScopeId("data-v-a49d7266"), t13 = t13(), popScopeId(), t13); var AG = { class: "resource-container" }; var PG = { class: "attribute-title-container" }; var DG = Za(() => createBaseVNode("div", { class: "attribute-title" }, "References", -1)); var RG = { class: "copy-button" }; var LG = { key: 0, class: "citation-tabs" }; var FG = { class: "citation-list" }; var MG = Za(() => createBaseVNode("span", null, "Internal Server Error", -1)); var NG = Za(() => createBaseVNode("br", null, null, -1)); var BG = Za(() => createBaseVNode("br", null, null, -1)); var $G = ["href"]; var qG = Za(() => createBaseVNode("br", null, null, -1)); var zG = Za(() => createBaseVNode("span", null, "Sorry, something went wrong.", -1)); var VG = Za(() => createBaseVNode("br", null, null, -1)); var HG = ["onClick"]; var KG = ["innerHTML"]; var GG = ["innerHTML"]; var UG = ["href"]; function WG(t13, e, r, n, a, i) { const o = Sg, s = mr, u = bT; return openBlock(), createElementBlock("div", AG, [ createBaseVNode("div", PG, [ DG, createBaseVNode("div", RG, [ createVNode(o, { label: "Copy list to clipboard", content: t13.referecesListContent }, null, 8, ["content"]) ]) ]), i.referencesWithDOI ? (openBlock(), createElementBlock("div", LG, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.citationOptions, (l) => (openBlock(), createBlock(s, { link: "", key: l.value, type: t13.citationType === l.value ? "primary" : "", onClick: (c) => i.onCitationFormatChange(l.value) }, { default: withCtx(() => [ createTextVNode(toDisplayString(l.label), 1) ]), _: 2 }, 1032, ["type", "onClick"]))), 128)) ])) : createCommentVNode("", true), createBaseVNode("ul", FG, [ (openBlock(true), createElementBlock(Fragment, null, renderList(t13.pubMedReferences, (l) => { var c, d, f, h10; return openBlock(), createElementBlock("li", { key: l.id, class: normalizeClass({ loading: i.isCitationLoading(l.citation), error: i.isCitationError(l.citation) }) }, [ l.citation ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ ((c = l.citation.error) == null ? void 0 : c.ref) === "doi" && ((d = l.citation.error) == null ? void 0 : d.type) === t13.citationType ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ MG, NG, createTextVNode(" Sorry, something went wrong."), BG, createTextVNode(" The dataset citation generator ("), createBaseVNode("a", { href: t13.crosscite_host, target: "_blank" }, toDisplayString(t13.crosscite_host), 9, $G), createTextVNode(") encountered an internal error and was unable to complete your request."), qG, createTextVNode(" Please come back later. ") ], 64)) : ((f = l.citation.error) == null ? void 0 : f.ref) === "pubmed" && ((h10 = l.citation.error) == null ? void 0 : h10.type) === t13.citationType ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [ zG, VG, createTextVNode(" Please try again. "), createBaseVNode("span", { class: "reload-button", onClick: (v) => i.reloadCitation(l) }, "Reload", 8, HG) ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [ createBaseVNode("span", { innerHTML: l.citation[t13.citationType] }, null, 8, KG), createVNode(u, { resource: l.resource, onShowRelatedConnectivities: i.showRelatedConnectivities }, null, 8, ["resource", "onShowRelatedConnectivities"]), createVNode(o, { content: l.citation[t13.citationType] }, null, 8, ["content"]) ], 64)) ], 64)) : createCommentVNode("", true) ], 2); }), 128)), (openBlock(true), createElementBlock(Fragment, null, renderList(t13.openLibReferences, (l) => (openBlock(), createElementBlock("li", { key: l.id }, [ createBaseVNode("div", { innerHTML: i.formatCopyReference(l) }, null, 8, GG), createVNode(u, { resource: l.resource, onShowRelatedConnectivities: i.showRelatedConnectivities }, null, 8, ["resource", "onShowRelatedConnectivities"]), createVNode(o, { content: i.formatCopyReference(l) }, null, 8, ["content"]) ]))), 128)), (openBlock(true), createElementBlock(Fragment, null, renderList(t13.isbnDBReferences, (l) => (openBlock(), createElementBlock("li", { key: l.id }, [ createBaseVNode("a", { href: l.url, target: "_blank" }, toDisplayString(l.url), 9, UG), createVNode(u, { resource: l.resource, onShowRelatedConnectivities: i.showRelatedConnectivities }, null, 8, ["resource", "onShowRelatedConnectivities"]), createVNode(o, { content: l.url }, null, 8, ["content"]) ]))), 128)) ]) ]); } var wT = Er(OG, [["render", WG], ["__scopeId", "data-v-a49d7266"]]); function jG(t13) { return { all: t13 = t13 || /* @__PURE__ */ new Map(), on: function(e, r) { var n = t13.get(e); n ? n.push(r) : t13.set(e, [r]); }, off: function(e, r) { var n = t13.get(e); n && (r ? n.splice(n.indexOf(r) >>> 0, 1) : t13.set(e, [])); }, emit: function(e, r) { var n = t13.get(e); n && n.slice().map(function(a) { a(r); }), (n = t13.get("*")) && n.slice().map(function(a) { a(e, r); }); } }; } var CT = new jG(); var YG = { name: "ProvenancePopup", components: { ElIconArrowUp: arrow_up_default, ElIconArrowDown: arrow_down_default, ElIconWarning: warning_default, ConnectivityList: M_, ExternalResourceCard: wT }, props: { tooltipEntry: { type: Array, default: [] } }, data: function() { return { loading: false, showDetails: false, originDescriptions: { motor: "is the location of the initial cell body of the circuit", sensory: "is the location of the initial cell body in the PNS circuit" }, entryIndex: 0, availableAnatomyFacets: [], connectivityError: {} }; }, computed: { entry: function() { return this.tooltipEntry[this.entryIndex]; }, previousLabel: function() { var t13; return this.entryIndex === 0 ? "This is the first item. Click 'Next' to see more information." : (t13 = this.tooltipEntry[this.entryIndex - 1]) == null ? void 0 : t13.title; }, nextLabel: function() { var t13; return this.entryIndex === this.tooltipEntry.length - 1 ? "This is the last item. Click 'Previous' to see more information." : (t13 = this.tooltipEntry[this.entryIndex + 1]) == null ? void 0 : t13.title; }, provSpeciesDescription: function() { let t13 = "Studied in"; return this.entry.provenanceTaxonomyLabel.forEach((e) => { t13 += ` ${e},`; }), t13 = t13.slice(0, -1), t13 += " species", t13; }, origins: function() { return this.entry.origins; }, components: function() { return this.entry.components; }, destinations: function() { return this.entry.destinations; }, originsWithDatasets: function() { return this.entry.originsWithDatasets; }, componentsWithDatasets: function() { return this.entry.componentsWithDatasets; }, destinationsWithDatasets: function() { return this.entry.destinationsWithDatasets; }, resources: function() { return this.entry.hyperlinks; } }, watch: { tooltipEntry: { deep: true, immediate: true, handler: function(t13, e) { t13 !== e && (this.entryIndex = 0); } } }, mounted: function() { this.loadAvailableAnatomyFacets(); }, methods: { previous: function() { this.entryIndex !== 0 && (this.entryIndex = this.entryIndex - 1); }, next: function() { this.entryIndex !== this.tooltipEntry.length - 1 && (this.entryIndex = this.entryIndex + 1); }, titleCase: function(t13) { return EK(t13); }, capitalise: function(t13) { return F_(t13); }, onConnectivityActionClick: function(t13) { CT.emit("onActionClick", t13); }, // Load available anatomy facets from the local storage if available. // The data is from Algolia in Sidebar. loadAvailableAnatomyFacets: function() { const t13 = localStorage.getItem( "available-anatomy-facets" ); t13 && (this.availableAnatomyFacets = JSON.parse(t13)); } } }; var ZG = (t13) => (pushScopeId("data-v-63f443c8"), t13 = t13(), popScopeId(), t13); var XG = { key: 0, class: "main" }; var JG = { key: 0, class: "toggle-button" }; var QG = { key: 1, class: "block" }; var e7 = { class: "title" }; var t72 = { key: 0, class: "subtitle" }; var r7 = { key: 2, class: "block" }; var n7 = { class: "title" }; var a7 = { key: 3, class: "attribute-title-container" }; var i7 = ZG(() => createBaseVNode("span", { class: "attribute-title" }, "Alert", -1)); var o7 = { style: { "word-break": "keep-all" } }; var s7 = { class: "content-container scrollbar" }; function l7(t13, e, r, n, a, i) { const o = mr, s = Li, u = warning_default, l = Ft, c = arrow_up_default, d = arrow_down_default, f = M_, h10 = wT, v = Eg; return i.entry ? withDirectives((openBlock(), createElementBlock("div", XG, [ r.tooltipEntry.length > 1 ? (openBlock(), createElementBlock("div", JG, [ createVNode(s, { width: "auto", trigger: "hover", teleported: false }, { reference: withCtx(() => [ createVNode(o, { class: "button", onClick: i.previous, disabled: this.entryIndex === 0 }, { default: withCtx(() => [ createTextVNode(" Previous ") ]), _: 1 }, 8, ["onClick", "disabled"]) ]), default: withCtx(() => [ createBaseVNode("span", null, toDisplayString(i.previousLabel), 1) ]), _: 1 }), createVNode(s, { width: "auto", trigger: "hover", teleported: false }, { reference: withCtx(() => [ createVNode(o, { class: "button", onClick: i.next, disabled: this.entryIndex === this.tooltipEntry.length - 1 }, { default: withCtx(() => [ createTextVNode(" Next ") ]), _: 1 }, 8, ["onClick", "disabled"]) ]), default: withCtx(() => [ createBaseVNode("span", null, toDisplayString(i.nextLabel), 1) ]), _: 1 }) ])) : createCommentVNode("", true), i.entry.title ? (openBlock(), createElementBlock("div", QG, [ createBaseVNode("div", e7, toDisplayString(i.capitalise(i.entry.title)), 1), i.entry.provenanceTaxonomyLabel && i.entry.provenanceTaxonomyLabel.length > 0 ? (openBlock(), createElementBlock("div", t72, toDisplayString(i.provSpeciesDescription), 1)) : createCommentVNode("", true) ])) : (openBlock(), createElementBlock("div", r7, [ createBaseVNode("div", n7, toDisplayString(i.entry.featureId), 1) ])), i.entry.featuresAlert ? (openBlock(), createElementBlock("div", a7, [ i7, createVNode(s, { width: "250", trigger: "hover", teleported: false, "popper-class": "popover-origin-help" }, { reference: withCtx(() => [ createVNode(l, { class: "info" }, { default: withCtx(() => [ createVNode(u) ]), _: 1 }) ]), default: withCtx(() => [ createBaseVNode("span", o7, toDisplayString(i.entry.featuresAlert), 1) ]), _: 1 }) ])) : createCommentVNode("", true), withDirectives(createBaseVNode("div", { class: "hide", id: "hide-path-info", onClick: e[0] || (e[0] = (p) => t13.showDetails = false) }, [ createTextVNode(" Hide path information "), createVNode(l, null, { default: withCtx(() => [ createVNode(c) ]), _: 1 }) ], 512), [ [vShow, t13.showDetails] ]), withDirectives(createBaseVNode("div", { class: "hide", id: "show-path-info", onClick: e[1] || (e[1] = (p) => t13.showDetails = true) }, [ createTextVNode(" Show path information "), createVNode(l, null, { default: withCtx(() => [ createVNode(d) ]), _: 1 }) ], 512), [ [vShow, !t13.showDetails] ]), createVNode(Transition, { name: "slide-fade" }, { default: withCtx(() => [ withDirectives(createBaseVNode("div", s7, [ (openBlock(), createBlock(f, { key: i.entry.featureId[0], entry: i.entry, origins: i.origins, components: i.components, destinations: i.destinations, originsWithDatasets: i.originsWithDatasets, componentsWithDatasets: i.componentsWithDatasets, destinationsWithDatasets: i.destinationsWithDatasets, availableAnatomyFacets: t13.availableAnatomyFacets, connectivityError: t13.connectivityError, onConnectivityActionClick: i.onConnectivityActionClick }, null, 8, ["entry", "origins", "components", "destinations", "originsWithDatasets", "componentsWithDatasets", "destinationsWithDatasets", "availableAnatomyFacets", "connectivityError", "onConnectivityActionClick"])), i.resources.length ? (openBlock(), createBlock(h10, { key: 0, resources: i.resources }, null, 8, ["resources"])) : createCommentVNode("", true) ], 512), [ [vShow, t13.showDetails] ]) ]), _: 1 }) ])), [ [v, t13.loading] ]) : createCommentVNode("", true); } var u7 = Er(YG, [["render", l7], ["__scopeId", "data-v-63f443c8"]]); var c7 = { name: "Tooltip", props: { tooltipEntry: { type: Array }, annotationDisplay: { type: Boolean, default: false }, annotationEntry: { type: Array } }, mounted: function() { CT.on("onActionClick", (t13) => { this.$emit("onActionClick", t13); }); } }; var d7 = { class: "tooltip-container", id: "tooltip-container" }; function f7(t13, e, r, n, a, i) { const o = j5, s = u7; return openBlock(), createElementBlock("div", d7, [ r.annotationDisplay ? (openBlock(), createBlock(o, { key: 0, annotationEntry: r.annotationEntry, onAnnotation: e[0] || (e[0] = (u) => t13.$emit("annotation", u)) }, null, 8, ["annotationEntry"])) : (openBlock(), createBlock(s, { key: 1, tooltipEntry: r.tooltipEntry }, null, 8, ["tooltipEntry"])) ]); } var z7 = Er(c7, [["render", f7], ["__scopeId", "data-v-d1e37cc2"]]); var v7 = { name: "TreeControls", props: { /** * The type of map that the TreeControls is used. Either "flatmap" or "scaffold". */ mapType: { type: String, required: true }, isReady: { type: Boolean, default: true }, /** * The title of the TreeControls. */ title: { type: String }, /** * The data of the tree. */ treeData: { type: Array, default: function() { return []; } }, showColourPicker: { type: Boolean, default: false }, /** * The active node of the tree. */ active: { type: [String, Array], required: true }, /** * The hover node of the tree. */ hover: { type: [String, Array], required: true }, enableFilter: { type: Boolean, default: true } }, data: function() { return { defaultExpandedKeys: ["All"], filterText: "", tooltipVisible: false, tooltipLabel: "", tooltipAtBottom: false }; }, computed: { isFlatmap: function() { return this.mapType === "flatmap"; }, isScaffold: function() { return this.mapType === "scaffold"; }, nodeKey: function() { if (this.isFlatmap) return "key"; if (this.isScaffold) return "id"; }, expandedKeys: function() { if (this.isFlatmap) return this.defaultExpandedKeys; if (this.isScaffold) return []; } }, watch: { filterText: { handler: function(t13) { this.$refs.regionTree && this.$refs.regionTree.filter(t13); } } }, methods: { filterNode: function(t13, e) { return t13 ? e.label ? e.label.toLowerCase().includes(t13.toLowerCase()) : false : true; }, setColour: function(t13, e) { this.$emit("setColour", t13, e); }, getBackgroundStyles: function(t13) { return "colour" in t13 ? { background: t13.colour } : {}; }, nodeIsActive: function(t13) { return this.active === t13.models; }, nodeIsHover: function(t13) { return this.hover === t13.models; }, changeActiveByNode: function(t13, e = false) { this.isFlatmap ? t13.models && this.$emit("changeActive", t13.models) : this.isScaffold && (t13.isPrimitives || t13.isRegion) && this.$emit("changeActive", t13, e); }, changeHoverByNode: function(t13, e = false) { this.isFlatmap ? t13.models && this.$emit("changeHover", t13.models) : this.isScaffold && t13.isPrimitives && this.$emit("changeHover", t13, e); }, checkChanged: function(t13, e) { if (this.isFlatmap) { const r = e.checkedKeys.includes(t13.key); t13.key === "All" ? this.$emit("checkAll", r) : this.$emit("checkChanged", { key: t13.key, value: r }); } else this.isScaffold && this.$emit("checkChanged", t13, e); }, displayTooltip: function(t13, e, r) { const a = r.target.closest(".el-tree-node__content"), i = a.clientWidth, o = a.getBoundingClientRect().x, s = a.querySelector(".lastChildInItem"); let u = 0; if (s) { const c = s.getBoundingClientRect(); u = c.x + c.width - o; } const l = u > i; this.tooltipVisible = l && e, this.tooltipLabel = t13, this.tooltipAtBottom = 0.5 > r.layerY / this.$refs.treeContainer.clientHeight; } }, unmounted: function() { this.sortedPrimitiveGroups = void 0; }, mounted: function() { this.$refs.regionTree && this.$refs.regionTree.filter(this.filterText); } }; var h7 = { class: "selections-container" }; var p7 = { class: "title-text" }; var g7 = { class: "tree-container", ref: "treeContainer" }; var y7 = { class: "tooltip-text" }; var m7 = ["onClick", "onMouseover", "onMouseenter"]; var b7 = ["onClick", "onMouseover", "onMouseenter"]; var w7 = { class: "lastChildInItem" }; var C7 = { key: 0, class: "node-options" }; function x7(t13, e, r, n, a, i) { const o = Qo, s = Xo, u = Dl, l = Li, c = pN, d = b5, f = Eg; return openBlock(), createElementBlock("div", h7, [ r.title ? (openBlock(), createBlock(u, { key: 0 }, { default: withCtx(() => [ createVNode(o, { span: 12 }, { default: withCtx(() => [ createBaseVNode("div", p7, toDisplayString(r.title), 1) ]), _: 1 }), r.enableFilter ? (openBlock(), createBlock(o, { key: 0, span: 12 }, { default: withCtx(() => [ createBaseVNode("div", null, [ createVNode(s, { class: "tree-filter-input", modelValue: t13.filterText, "onUpdate:modelValue": e[0] || (e[0] = (h10) => t13.filterText = h10), placeholder: "Filter " + r.title }, null, 8, ["modelValue", "placeholder"]) ]) ]), _: 1 })) : createCommentVNode("", true) ]), _: 1 })) : createCommentVNode("", true), createBaseVNode("div", g7, [ createBaseVNode("div", { class: normalizeClass(["tree-tooltip", t13.tooltipAtBottom ? "bottom" : ""]) }, [ createVNode(l, { ref: "tooltip", visible: t13.tooltipVisible && t13.tooltipLabel !== "", placement: "top", "show-arrow": false, teleported: false, trigger: "manual", "popper-class": "tree-tooltip-popper", "virtual-triggering": "", width: 260 }, { default: withCtx(() => [ createBaseVNode("div", y7, toDisplayString(t13.tooltipLabel), 1) ]), _: 1 }, 8, ["visible"]) ], 2), withDirectives((openBlock(), createBlock(d, { ref: "regionTree", "element-loading-background": "rgba(0, 0, 0, 0.3)", "show-checkbox": "", "node-key": i.nodeKey, data: r.treeData, "check-strictly": false, "expand-on-click-node": false, "render-after-expand": false, "default-expanded-keys": i.expandedKeys, onCheck: i.checkChanged, indent: 8, "filter-node-method": i.filterNode, class: normalizeClass([r.mapType === "flatmap" ? "hide_grandchildren_checkbox" : ""]) }, { default: withCtx(({ node: h10, data: v }) => [ r.mapType === "flatmap" ? (openBlock(), createElementBlock("span", { key: 0, class: normalizeClass(["region-tree-node", { activeItem: i.nodeIsActive(v), hoverItem: i.nodeIsHover(v) }]), onClick: (p) => i.changeActiveByNode(v), onMouseover: (p) => i.changeHoverByNode(v, false), onMouseenter: (p) => i.displayTooltip(h10.label, true, p), onMouseleave: e[1] || (e[1] = (p) => i.displayTooltip("", false, p)) }, [ createBaseVNode("div", { style: normalizeStyle(i.getBackgroundStyles(v)), class: "lastChildInItem" }, toDisplayString(h10.label), 5) ], 42, m7)) : r.mapType === "scaffold" ? (openBlock(), createElementBlock("span", { key: 1, class: normalizeClass(["region-tree-node", { activeItem: r.active.includes(v.id), hoverItem: r.hover.includes(v.id) }]), onClick: (p) => i.changeActiveByNode(v, true), onMouseover: (p) => i.changeHoverByNode(v, true, p), onMouseenter: (p) => i.displayTooltip(h10.label, true, p), onMouseleave: e[2] || (e[2] = (p) => i.displayTooltip("", false, p)) }, [ v.isPrimitives ? (openBlock(), createBlock(c, { key: 0, class: normalizeClass({ "show-picker": r.showColourPicker }), modelValue: v.activeColour, "onUpdate:modelValue": (p) => v.activeColour = p, size: "small", onChange: (p) => i.setColour(v, p) }, null, 8, ["class", "modelValue", "onUpdate:modelValue", "onChange"])) : createCommentVNode("", true), createBaseVNode("div", w7, [ createBaseVNode("span", null, toDisplayString(h10.label), 1), v.isTextureSlides ? (openBlock(), createElementBlock("span", C7, " (Texture) ")) : createCommentVNode("", true) ]) ], 42, b7)) : createCommentVNode("", true) ]), _: 1 }, 8, ["node-key", "data", "default-expanded-keys", "onCheck", "filter-node-method", "class"])), [ [f, !r.isReady] ]) ], 512) ]); } var V7 = Er(v7, [["render", x7], ["__scopeId", "data-v-e1dbd1e9"]]); async function E7(t13, e) { try { const r = await fetch(t13, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(e) }); if (!r.ok) throw new Error(`API Error: ${r.status} ${r.statusText}`); return await r.json(); } catch (r) { throw console.error("Request failed:", r), r; } } async function Na(t13) { const { flatmapAPI: e, knowledgeSource: r, queryId: n, parameters: a, orderId: i } = t13, o = `${e}competency/query`, s = Array.isArray(a) ? [...a] : []; s.push({ column: "source_id", value: r }); let u; if (typeof n == "number") u = n.toString(); else if (typeof n == "string") u = n; else throw new TypeError("queryId must be a string or a number convertible to string."); const l = { query_id: u, parameters: s }; return i && (l.order = [i]), E7(o, l); } async function H7(t13, e, r) { var h10, v; const n = Array.isArray(r) ? r : [r], a = n[0].startsWith("ilxtr:"), i = a ? 23 : 1, o = a ? "path_id" : "feature_id", s = a ? n : [], u = await Na({ flatmapAPI: t13, knowledgeSource: e, queryId: i, parameters: [ { column: o, value: n } ] }), l = ((v = (h10 = u == null ? void 0 : u.results) == null ? void 0 : h10.values) == null ? void 0 : v.map((p) => p[1])) || [], c = [.../* @__PURE__ */ new Set([...s, ...l])]; let d = []; return c.length && (d = await xT(t13, e, c)), [.../* @__PURE__ */ new Set([...c, ...d])]; } async function K7(t13, e, r) { var a; const n = await Na({ flatmapAPI: t13, knowledgeSource: e, queryId: 1, // TODO: to update to a specific query ID for origins parameters: [ { column: "feature_id", value: r } ] }); if ((a = n == null ? void 0 : n.results) != null && a.values) { const i = n.results.values.map((o) => o[1]); return [...new Set(i)]; } return []; } async function G7(t13, e, r) { var a; const n = await Na({ flatmapAPI: t13, knowledgeSource: e, queryId: 1, // TODO: to update to a specific query ID for via parameters: [ { column: "feature_id", value: r } ] }); if ((a = n == null ? void 0 : n.results) != null && a.values) { const i = n.results.values.map((o) => o[1]); return [...new Set(i)]; } return []; } async function U7(t13, e, r) { var a; const n = await Na({ flatmapAPI: t13, knowledgeSource: e, queryId: 2, parameters: [ { column: "feature_id", value: r } ] }); if ((a = n == null ? void 0 : n.results) != null && a.values) { const i = n.results.values.map((o) => o[1]); return [...new Set(i)]; } return []; } function lp(t13) { const e = []; for (const r of t13) { const n = JSON.parse(r); Array.isArray(n) && n.length >= 2 && Array.isArray(n[1]) && n[1].length === 0 && e.push(n[0]); } return e; } async function xT(t13, e, r) { var a; const n = await Na({ flatmapAPI: t13, knowledgeSource: e, queryId: 26, parameters: [ { column: "path_id", value: r } ] }); if ((a = n == null ? void 0 : n.results) != null && a.values) { const i = n.results.values.map((o) => o[2]); return [...new Set(i)]; } return []; } async function W7({ flatmapAPI: t13, knowledgeSource: e, origins: r, destinations: n, vias: a }) { var b, w, x, E; const i = lp(r), o = lp(n), s = lp(a), u = [ { column: "source_feature_id", value: i }, { column: "via_feature_id", value: s }, { column: "dest_feature_id", value: o } ], l = [ { column: "source_node_id", value: r }, { column: "via_node_id", value: a }, { column: "dest_node_id", value: n } ], c = u.some((C) => Array.isArray(C.value) && C.value.length > 0), d = [ Na({ flatmapAPI: t13, knowledgeSource: e, queryId: 24, parameters: l }) ]; c && d.push( Na({ flatmapAPI: t13, knowledgeSource: e, queryId: 25, parameters: u }) ); const f = await Promise.all(d); let h10 = [], v; if (c) { const C = f[0]; v = f[1], h10 = ((w = (b = C == null ? void 0 : C.results) == null ? void 0 : b.values) == null ? void 0 : w.map((k) => k[1])) || []; } else v = f[0]; const p = ((E = (x = v == null ? void 0 : v.results) == null ? void 0 : x.values) == null ? void 0 : E.map((C) => C[1])) || [], g = [.../* @__PURE__ */ new Set([...h10, ...p])]; let y = []; return g.length && (y = await xT(t13, e, g)), [.../* @__PURE__ */ new Set([...g, ...y])]; } var up = []; async function S7(t13, e) { const r = e.filter( (i) => up.some((o) => o.taxon === i) ), n = up.filter( (i) => r.includes(i.taxon) ), a = e.filter( (i) => !r.includes(i) ); if (a.length) { const i = await t13.queryLabels(a); if (i.length) return i.forEach((o) => { let { entity: s, label: u } = o; u === "Mammalia" && (u = "Mammalia not otherwise specified"); const l = { taxon: s, label: u }; n.push(l), up.push(l); }), n; } else return n; } async function k7(t13, e, r) { const n = `${t13}knowledge/query/`, a = { sql: e, params: r }; try { const i = await fetch(n, { method: "POST", headers: { Accept: "application/json; charset=utf-8", "Content-Type": "application/json" }, body: JSON.stringify(a) }); if (!i.ok) throw new Error(`Cannot access ${n}`); return await i.json(); } catch { return { values: [] }; } } async function _7(t13, e) { return e.length ? await (await k7( t13, `select entity, knowledge from knowledge where entity in (?${", ?".repeat(e.length - 1)}) order by source desc`, [...e] )).values : []; } function j7(t13) { var r; const e = (r = t13["node-phenotypes"]) == null ? void 0 : r["ilxtr:hasSomaLocatedIn"]; return Array.isArray(t13.connectivity) && t13.connectivity.length > 0 && Array.isArray(e) && e.length > 0; } function Y7(t13) { var a, i; const e = (a = t13["node-phenotypes"]) == null ? void 0 : a["ilxtr:hasAxonPresynapticElementIn"], r = (i = t13["node-phenotypes"]) == null ? void 0 : i["ilxtr:hasAxonSensorySubcellularElementIn"], n = Array.isArray(e) && e.length > 0 || Array.isArray(r) && r.length > 0; return Array.isArray(t13.connectivity) && t13.connectivity.length > 0 && n; } function Z7(t13) { var n, a, i; if (!Array.isArray(t13.connectivity) || t13.connectivity.length === 0) return false; const e = new Set( (((n = t13["node-phenotypes"]) == null ? void 0 : n["ilxtr:hasSomaLocatedIn"]) || []).map((o) => o[0]) ), r = /* @__PURE__ */ new Set([ ...(((a = t13["node-phenotypes"]) == null ? void 0 : a["ilxtr:hasAxonPresynapticElementIn"]) || []).map((o) => o[0]), ...(((i = t13["node-phenotypes"]) == null ? void 0 : i["ilxtr:hasAxonSensorySubcellularElementIn"]) || []).map((o) => o[0]) ]); return t13.connectivity.some((o) => { const [s, u] = o, l = s[0], c = u[0]; return !e.has(l) && !r.has(c); }); } function py(t13) { if (!Array.isArray(t13.connectivity)) return []; const e = /* @__PURE__ */ new Set(); return t13.connectivity.forEach((r) => { Array.isArray(r) && r.length && r.forEach((n) => { if (Array.isArray(n) && typeof n[0] == "string") { const a = JSON.stringify(n); e.add(a); } }); }), Array.from(e); } function cn(t13, e) { var n; const r = (n = t13["node-phenotypes"]) == null ? void 0 : n[e]; return Array.isArray(r) ? r : []; } async function gy(t13, e, r) { const n = Array.from( new Map(r.map((d) => [JSON.stringify(d), d])).values() ), a = n.flat(1 / 0), i = [...new Set(a)], s = (await _7(t13, i)).reduce((d, f) => { const h10 = f[0], v = JSON.parse(f[1]); return v.source === e && d.push({ id: h10, label: v.label }), d; }, []), u = []; return [...n.map((d) => { const f = d.flat(), h10 = []; for (let v = 0; v < f.length; v++) { const p = s.find((g) => g.id === f[v]); p && (h10.push(p.label), v > 0 && u.push({ key: [f[v], []], label: p.label })); } return { key: d, label: h10.join(", ") }; }), ...u].filter( (d, f, h10) => f === h10.findIndex((v) => v.label === d.label) ); } async function T7(t13, e, r) { const n = []; return r.forEach((a) => { if (!Array.isArray(a.connectivity) || a.connectivity.length === 0) return; const i = new Set(py(a)); cn(a, "ilxtr:hasSomaLocatedIn").forEach((o) => { const s = JSON.stringify(o); i.has(s) && n.push(o); }); }), await gy(t13, e, n); } async function I7(t13, e, r) { const n = []; return r.forEach((a) => { if (!Array.isArray(a.connectivity) || a.connectivity.length === 0) return; const i = new Set(py(a)); [ ...cn(a, "ilxtr:hasAxonPresynapticElementIn"), ...cn(a, "ilxtr:hasAxonSensorySubcellularElementIn") ].forEach((o) => { const s = JSON.stringify(o); i.has(s) && n.push(o); }); }), await gy(t13, e, n); } async function O7(t13, e, r) { const n = []; return r.forEach((a) => { if (!Array.isArray(a.connectivity) || a.connectivity.length === 0) return; const i = new Set(py(a)); [ ...cn(a, "ilxtr:hasAxonLeadingToSensorySubcellularElementIn"), ...cn(a, "ilxtr:hasAxonLocatedIn") ].forEach((o) => { const s = JSON.stringify(o); i.has(s) && n.push(o); }); }), await gy(t13, e, n); } function A7(t13, e) { return t13.filter((r) => !Array.isArray(r.connectivity) || r.connectivity.length === 0 ? false : cn(r, "ilxtr:hasSomaLocatedIn").some((a) => e.map((i) => JSON.stringify(i)).includes(JSON.stringify(a)))); } function P7(t13, e) { return t13.filter((r) => !Array.isArray(r.connectivity) || r.connectivity.length === 0 ? false : [ ...cn(r, "ilxtr:hasAxonPresynapticElementIn"), ...cn(r, "ilxtr:hasAxonSensorySubcellularElementIn") ].some((a) => e.map((i) => JSON.stringify(i)).includes(JSON.stringify(a)))); } function D7(t13, e) { return t13.filter((r) => !Array.isArray(r.connectivity) || r.connectivity.length === 0 ? false : [ ...cn(r, "ilxtr:hasAxonLeadingToSensorySubcellularElementIn"), ...cn(r, "ilxtr:hasAxonLocatedIn") ].some((a) => e.map((i) => JSON.stringify(i)).includes(JSON.stringify(a)))); } async function X7({ knowledge: t13, origins: e, destinations: r, vias: n }) { let a = t13; return e.length && (a = A7(a, e)), r.length && (a = P7(a, r)), n.length && (a = D7(a, n)), a; } async function J7(t13, e, r, n) { let a = []; const i = []; if (e) { if (e && typeof e.featureFilterRanges == "function") { const h10 = e.featureFilterRanges(); for (const [v, p] of Object.entries(h10)) { let g = { key: `flatmap.connectivity.${v}`, label: "", children: [] }, y = []; if (v === "kind") { g.label = "Pathways"; for (const m of p) { const b = n.find((w) => w.type === m); b && y.push({ key: `${g.key}.${m}`, label: b.label, colour: b.colour, colourStyle: "line", dashed: b.dashed }); } } else if (v === "taxons") { g.label = "Studied in"; const m = await S7(e, e.taxonIdentifiers); if (m.length) for (const b of p) { const w = m.find((x) => x.taxon === b); w && y.push({ key: `${g.key}.${b}`, // space added at the end of label to make sure the display name will not be updated // prevent sidebar searchfilter convertReadableLabel label: `${w.label} ` }); } } else if (v === "alert") { g.label = "Alert"; for (const m of ["with", "without"]) y.push({ key: `${g.key}.${m}`, label: `${m} alerts` }); } g.children = y.sort((m, b) => m.label.localeCompare(b.label)), g.label && g.children.length && a.push(g); } } const o = e.pathways.paths, s = r.reduce((h10, v) => { const p = v.id; if (p) { const g = o[p]; if (g && g.connectivity && g["node-phenotypes"]) { const y = g.connectivity, m = g["node-phenotypes"]; v.connectivity = [...y]; for (let b in v["node-phenotypes"]) m[b] && (v["node-phenotypes"][b] = [...m[b]]); h10.push(JSON.parse(JSON.stringify(v))); } } return h10; }, []), u = e.knowledgeSource, l = await T7(t13, u, s), c = await O7(t13, u, s), d = await I7(t13, u, s), f = (h10, v) => { const p = JSON.stringify(v.key); return { key: `flatmap.connectivity.source.${h10}.${p}`, label: v.label || p }; }; for (const h10 of ["origin", "via", "destination", "all"]) { let v = []; if (h10 === "origin") v = l.map((p) => f(h10, p)); else if (h10 === "via") v = c.map((p) => f(h10, p)); else if (h10 === "destination") v = d.map((p) => f(h10, p)); else { const p = [ ...l.map((y) => f(h10, y)), ...c.map((y) => f(h10, y)), ...d.map((y) => f(h10, y)) ], g = /* @__PURE__ */ new Set(); v = p.filter((y) => g.has(y.key) ? false : (g.add(y.key), true)); } v = v.sort((p, g) => { const y = (w) => /^[a-zA-Z]/.test(w), m = y(p.label), b = y(g.label); return m && !b ? -1 : !m && b ? 1 : p.label.localeCompare(g.label); }), v.length && i.push({ key: `flatmap.connectivity.source.${h10}`, label: h10, children: v }); } i.length && a.push(...i); } return a; } export { Sg, j5, M7, B7, M_, $7, q7, wT, z7, V7, Na, H7, K7, G7, U7, xT, W7, _7, j7, Y7, Z7, T7, I7, O7, A7, P7, D7, X7, J7 }; /*! Bundled license information: @abi-software/map-utilities/dist/map-utilities.js: (** * @vue/shared v3.4.27 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **) (*! Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) Licensed under The MIT License (http://opensource.org/licenses/MIT) *) (*! Event object based on jQuery events, MIT license https://jquery.org/license/ https://tldrlegal.com/license/mit-license https://github.com/jquery/jquery/blob/master/src/event.js *) (*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *) (*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *) */ //# sourceMappingURL=chunk-VSHHOTB7.js.map