pandorafms/pandora_console/include/visual-console-client/vc.main.min.js

2 lines
136 KiB
JavaScript

!function (t) { var e = {}; function n(i) { if (e[i]) return e[i].exports; var r = e[i] = { i: i, l: !1, exports: {} }; return t[i].call(r.exports, r, r.exports, n), r.l = !0, r.exports } n.m = t, n.c = e, n.d = function (t, e, i) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: i }) }, n.r = function (t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) }, n.t = function (t, e) { if (1 & e && (t = n(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var i = Object.create(null); if (n.r(i), Object.defineProperty(i, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var r in t) n.d(i, r, function (e) { return t[e] }.bind(null, r)); return i }, n.n = function (t) { var e = t && t.__esModule ? function () { return t.default } : function () { return t }; return n.d(e, "a", e), e }, n.o = function (t, e) { return Object.prototype.hasOwnProperty.call(t, e) }, n.p = "", n(n.s = 14) }([function (t, e, n) { "use strict"; n.d(e, "n", function () { return r }), n.d(e, "m", function () { return s }), n.d(e, "s", function () { return o }), n.d(e, "k", function () { return a }), n.d(e, "l", function () { return l }), n.d(e, "o", function () { return u }), n.d(e, "r", function () { return p }), n.d(e, "j", function () { return h }), n.d(e, "i", function () { return d }), n.d(e, "h", function () { return m }), n.d(e, "p", function () { return f }), n.d(e, "d", function () { return _ }), n.d(e, "f", function () { return y }), n.d(e, "g", function () { return b }), n.d(e, "q", function () { return v }), n.d(e, "c", function () { return E }), n.d(e, "a", function () { return w }), n.d(e, "b", function () { return O }), n.d(e, "t", function () { return k }), n.d(e, "e", function () { return M }); n(9), n(4), n(5), n(12); var i = function () { return (i = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function r(t, e) { return "number" == typeof t ? t : "string" == typeof t && t.length > 0 && !isNaN(parseInt(t)) ? parseInt(t) : e } function s(t, e) { return "number" == typeof t ? t : "string" == typeof t && t.length > 0 && !isNaN(parseFloat(t)) ? parseFloat(t) : e } function o(t) { return null == t || 0 === t.length } function a(t, e) { return "string" == typeof t && t.length > 0 ? t : e } function l(t) { return "boolean" == typeof t ? t : "number" == typeof t ? t > 0 : "string" == typeof t && ("1" === t || "true" === t) } function c(t, e, n) { void 0 === n && (n = " "), "number" == typeof t && (t = "" + t), "number" == typeof n && (n = "" + n); var i = e - t.length; if (0 === i) return t; if (i < 0) return t.substr(Math.abs(i)); if (i === n.length) return "" + n + t; if (i < n.length) return "" + n.substring(0, i) + t; for (var r = Math.floor(i / n.length), s = i - n.length * r, o = "", a = 0; a < r; a++)o += n; return 0 === s ? "" + o + t : "" + o + n.substring(0, s) + t } function u(t) { return { x: r(t.x, 0), y: r(t.y, 0) } } function p(t) { if (null == t.width || isNaN(parseInt(t.width)) || null == t.height || isNaN(parseInt(t.height))) throw new TypeError("invalid size."); return { width: parseInt(t.width), height: parseInt(t.height) } } function h(t) { return i({ moduleId: r(t.moduleId, null), moduleName: a(t.moduleName, null), moduleDescription: a(t.moduleDescription, null), moduleDisabled: l(t.moduleDisabled) }, function (t) { var e = { agentId: r(t.agentId, null), agentName: a(t.agentName, null), agentAlias: a(t.agentAlias, null), agentDescription: a(t.agentDescription, null), agentAddress: a(t.agentAddress, null), agentDisabled: l(t.agentDisabled) }; return null != t.metaconsoleId ? i({ metaconsoleId: t.metaconsoleId }, e) : e }(t)) } function d(t) { var e = { linkedLayoutStatusType: "default" }; switch (t.linkedLayoutStatusType) { case "weight": var n = r(t.linkedLayoutStatusTypeWeight, null); if (null == n) throw new TypeError("invalid status calculation properties."); t.linkedLayoutStatusTypeWeight && (e = { linkedLayoutStatusType: "weight", linkedLayoutStatusTypeWeight: n }); break; case "service": var s = r(t.linkedLayoutStatusTypeWarningThreshold, null), o = r(t.linkedLayoutStatusTypeCriticalThreshold, null); if (null == s || null == o) throw new TypeError("invalid status calculation properties."); e = { linkedLayoutStatusType: "service", linkedLayoutStatusTypeWarningThreshold: s, linkedLayoutStatusTypeCriticalThreshold: o } }return i({ linkedLayoutId: r(t.linkedLayoutId, null), linkedLayoutNodeId: r(t.linkedLayoutNodeId, null) }, e) } function m(t) { var e, n, i = (e = t.receivedAt, n = null, e instanceof Date ? e : "number" == typeof e ? new Date(1e3 * e) : "string" != typeof e || Number.isNaN(new Date(e).getTime()) ? n : new Date(e)); if (null === i) throw new TypeError("invalid meta structure"); var r = null; return t.error instanceof Error ? r = t.error : "string" == typeof t.error && (r = new Error(t.error)), { receivedAt: i, error: r, editMode: l(t.editMode), isFromCache: l(t.isFromCache), isFetching: !1, isUpdating: !1, isBeingMoved: !1, isBeingResized: !1, isSelected: !1, lineMode: !1 } } function f(t, e) { var n = t + ": " + e + ";"; return ["-webkit-" + n, "-moz-" + n, "-ms-" + n, "-o-" + n, "" + n] } function _(t) { return decodeURIComponent(escape(window.atob(t))) } function y(t, e) { if (void 0 === e && (e = null), e && Intl && Intl.DateTimeFormat) { return Intl.DateTimeFormat(e, { day: "2-digit", month: "2-digit", year: "numeric" }).format(t) } return c(t.getDate(), 2, 0) + "/" + c(t.getMonth() + 1, 2, 0) + "/" + c(t.getFullYear(), 4, 0) } function b(t) { return c(t.getHours(), 2, 0) + ":" + c(t.getMinutes(), 2, 0) + ":" + c(t.getSeconds(), 2, 0) } function v(t, e) { return t.reduce(function (t, e) { var n = e.macro, i = e.value; return t.replace(n, i) }, e) } function g(t, e) { var n = 0; return function () { for (var i = [], r = 0; r < arguments.length; r++)i[r] = arguments[r]; var s = Date.now(); if (!(s - n < t)) return n = s, e.apply(void 0, i) } } function E(t, e) { var n = null; return function () { for (var i = [], r = 0; r < arguments.length; r++)i[r] = arguments[r]; null !== n && window.clearTimeout(n), n = window.setTimeout(function () { e.apply(void 0, i), n = null }, t) } } function x(t, e) { for (var n = 0, i = 0; t && !Number.isNaN(t.offsetLeft) && !Number.isNaN(t.offsetTop) && t !== e;)n += t.offsetLeft - t.scrollLeft, i += t.offsetTop - t.scrollTop, t = t.offsetParent; return { top: i, left: n } } function w(t, e, n) { var i = n || t.parentElement, r = t.draggable, s = 0, o = 0, a = 0, l = 0, c = 0, u = 0, p = i.getBoundingClientRect(), h = x(i), d = h.top, m = d + p.height, f = h.left, _ = f + p.width, y = t.getBoundingClientRect(), b = window.getComputedStyle(t).borderWidth || "0", v = 2 * Number.parseInt(b), w = E(32, e), O = g(16, e), k = function (t) { var e = 0, n = 0, i = t.pageX, r = t.pageY, h = i - a, b = r - l, g = p.width - y.width + v, E = p.height - y.height + v, x = i < f || 0 === s && h > 0 && i < f + c, k = i > _ || h + s + y.width - v > p.width || s === g && h < 0 && i > f + g + c, M = r < d || 0 === o && b > 0 && r < d + u, A = r > m || b + o + y.height - v > p.height || o === E && b < 0 && r > d + E + u; (e = x ? 0 : k ? g : h + s) < 0 && (e = 0), (n = M ? 0 : A ? E : b + o) < 0 && (n = 0), a = i, l = r, e === s && n === o || (O(e, n), w(e, n), s = e, o = n) }, M = function () { s = 0, o = 0, a = 0, l = 0, document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", M), t.draggable = r, document.body.style.userSelect = "auto" }, A = function (e) { if (2 !== e.button) { e.stopPropagation(), t.draggable = !1, t.setAttribute("ondragstart", "return false;"), t.setAttribute("draggable", "false"); var n = x(t, i); s = n.left, o = n.top, a = e.pageX, l = e.pageY, c = e.offsetX, u = e.offsetY, p = i.getBoundingClientRect(), h = x(i), d = h.top, m = d + p.height, f = h.left, _ = f + p.width, y = t.getBoundingClientRect(), b = window.getComputedStyle(t).borderWidth || "0", v = 2 * Number.parseInt(b), document.addEventListener("mousemove", k), document.addEventListener("mouseup", M), document.body.style.userSelect = "none" } }; return t.addEventListener("mousedown", A), function () { t.removeEventListener("mousedown", A), M() } } function O(t, e) { var n = document.createElement("div"); n.className = "resize-draggable", t.appendChild(n); var i = t.parentElement, r = t.draggable, s = 0, o = 0, a = 0, l = 0, c = 0, u = i.getBoundingClientRect(), p = x(i), h = p.top, d = h + u.height, m = p.left, f = m + u.width, _ = x(t), y = _.top, b = _.left, v = window.getComputedStyle(t).borderWidth || "0", w = Number.parseInt(v), O = E(32, e), k = g(16, e), M = function (t) { var e = s + (t.pageX - a), n = o + (t.pageY - l); e === s && n === o || e < s && t.pageX > b + (s - c) || (e < 15 ? e = 15 : e + b - w / 2 >= f && (e = f - b), n < 15 ? n = 15 : n + y - w / 2 >= d && (n = d - y), k(e, n), O(e, n), s = e, o = n, a = t.pageX, l = t.pageY) }, A = function () { s = 0, o = 0, a = 0, l = 0, c = 0, 0, document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", A), t.draggable = r, document.body.style.userSelect = "auto" }; return n.addEventListener("mousedown", function (e) { e.stopPropagation(), t.draggable = !1; var n = t.getBoundingClientRect(), r = n.width, v = n.height; s = r, o = v, a = e.pageX, l = e.pageY, c = e.offsetX, e.offsetY, u = i.getBoundingClientRect(), p = x(i), h = p.top, d = h + u.height, m = p.left, f = m + u.width, _ = x(t), y = _.top, b = _.left, document.addEventListener("mousemove", M), document.addEventListener("mouseup", A), document.body.style.userSelect = "none" }), function () { n.remove(), A() } } function k(t) { return t } function M(t, e, n) { return void 0 === e && (e = 140), void 0 === n && (n = "…"), t.trim().length > e ? t.substr(0, e).trim() + n : t } }, function (t, e, n) { "use strict"; n.d(e, "b", function () { return l }); var i = n(0), r = n(2), s = n(3), o = function () { return (o = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }, a = function (t) { switch (t) { case "up": case "right": case "down": case "left": return t; default: return "down" } }; function l(t) { if (null == t.id || isNaN(parseInt(t.id))) throw new TypeError("invalid id."); if (null == t.type || isNaN(parseInt(t.type))) throw new TypeError("invalid type."); return o({ id: parseInt(t.id), type: parseInt(t.type), label: Object(i.k)(t.label, null), labelPosition: a(t.labelPosition), isLinkEnabled: Object(i.l)(t.isLinkEnabled), link: Object(i.k)(t.link, null), isOnTop: Object(i.l)(t.isOnTop), parentId: Object(i.n)(t.parentId, null), aclGroupId: Object(i.n)(t.aclGroupId, null), cacheExpiration: Object(i.n)(t.cacheExpiration, null), colorStatus: Object(i.k)(t.colorStatus, "#CCC") }, Object(i.r)(t), Object(i.o)(t)) } var c = function () { function t(t, e, n) { var s = this; void 0 === n && (n = !1), this.elementRef = document.createElement("div"), this.labelElementRef = document.createElement("div"), this.childElementRef = document.createElement("div"), this.clickEventManager = new r.a, this.dblClickEventManager = new r.a, this.movedEventManager = new r.a, this.movementFinishedEventManager = new r.a, this.resizedEventManager = new r.a, this.resizeFinishedEventManager = new r.a, this.removeEventManager = new r.a, this.selectionChangedEventManager = new r.a, this.disposables = [], this.debouncedMovementSave = Object(i.c)(500, function (t, e) { s._metadata.isBeingMoved = !1; var n = { x: s.props.x, y: s.props.y }, i = { x: t, y: e }; s.positionChanged(n, i) && (s.move(t, e), s.movementFinishedEventManager.emit({ item: s, prevPosition: n, newPosition: i })) }), this.removeMovement = null, this.debouncedResizementSave = Object(i.c)(500, function (t, e) { s._metadata.isBeingResized = !1; var n = { width: s.props.width, height: s.props.height }, i = { width: t, height: e }; s.sizeChanged(n, i) && (s.resize(t, e), s.resizeFinishedEventManager.emit({ item: s, prevSize: n, newSize: i })) }), this.removeResizement = null, this.itemProps = t, this._metadata = e, n || this.init() } return t.prototype.initMovementListener = function (t) { var e = this; 13 != this.props.type && 21 != this.props.type && (this.removeMovement = Object(i.a)(t, function (t, n) { var i = { x: e.props.x, y: e.props.y }, r = { x: t, y: n }; e.meta = o({}, e.meta, { isSelected: !0 }), e.positionChanged(i, r) && (e._metadata.isBeingMoved = !0, e.moveElement(t, n), e.movedEventManager.emit({ item: e, prevPosition: i, newPosition: r }), e.debouncedMovementSave(t, n)) })) }, t.prototype.stopMovementListener = function () { this.removeMovement && (this.removeMovement(), this.removeMovement = null) }, t.prototype.initResizementListener = function (t) { var e = this; 13 != this.props.type && 21 != this.props.type && (this.removeResizement = Object(i.b)(t, function (t, n) { if (e._metadata.isBeingResized = !0, e.props.label && e.props.label.length > 0) { var i = e.labelElementRef.getBoundingClientRect(), r = i.width, s = i.height; switch (e.props.labelPosition) { case "up": case "down": n -= s; break; case "left": case "right": t -= r } } var o = { width: e.props.width, height: e.props.height }, a = { width: t, height: n }; e.sizeChanged(o, a) && (e.resizeElement(t, n), e.resizedEventManager.emit({ item: e, prevSize: o, newSize: a }), e.debouncedResizementSave(t, n)) })) }, t.prototype.stopResizementListener = function () { this.removeResizement && (this.removeResizement(), this.removeResizement = null) }, t.prototype.init = function () { this.elementRef = this.createContainerDomElement(), this.labelElementRef = this.createLabelDomElement(), this.childElementRef = this.createDomElement(), this.elementRef.appendChild(this.childElementRef), this.elementRef.appendChild(this.labelElementRef), this.resizeElement(this.itemProps.width, this.itemProps.height), this.changeLabelPosition(this.itemProps.labelPosition) }, t.prototype.createContainerDomElement = function () { var t, e = this; return this.props.isLinkEnabled ? (t = document.createElement("a"), this.props.link ? t.href = this.props.link : t.className = "textDecorationNone") : (t = document.createElement("div")).className = "textDecorationNone", t.classList.add("visual-console-item"), this.props.isOnTop && t.classList.add("is-on-top"), t.style.left = this.props.x + "px", t.style.top = this.props.y + "px", t.addEventListener("dblclick", function (t) { e.meta.isBeingMoved || e.meta.isBeingResized || (e.unSelectItem(), e.selectItem(), e.dblClickEventManager.emit({ item: e, nativeEvent: t })) }), t.addEventListener("click", function (t) { if (e.meta.editMode) t.preventDefault(), t.stopPropagation(); else if (e.itemProps.isLinkEnabled && null != e.itemProps.link) { var n = document.createElement("div"); n.className = "div-visual-console-spinner"; var i = document.createElement("div"); i.className = "visual-console-spinner", n.appendChild(i); var r = document.getElementById("visual-console-container"); null != r && (r.classList.add("is-updating"), r.appendChild(n)) } e.meta.isBeingMoved || e.meta.isBeingResized || e.clickEventManager.emit({ item: e, nativeEvent: t }) }), this.meta.editMode && t.classList.add("is-editing"), this.meta.isFetching && t.classList.add("is-fetching"), this.meta.isUpdating && t.classList.add("is-updating"), this.meta.isSelected && t.classList.add("is-selected"), t }, t.prototype.createLabelDomElement = function () { var t = document.createElement("div"); t.className = "visual-console-item-label"; var e = this.getLabelWithMacrosReplaced(); if (e.length > 0) { var n = document.createElement("table"), i = document.createElement("tr"), r = document.createElement("tr"), s = document.createElement("tr"), o = document.createElement("td"); switch (o.innerHTML = e, i.appendChild(o), n.appendChild(r), n.appendChild(i), n.appendChild(s), n.style.textAlign = "center", this.props.labelPosition) { case "up": case "down": this.props.width > 0 && (n.style.width = this.props.width + "px", n.style.height = null); break; case "left": case "right": this.props.height > 0 && (n.style.width = null, n.style.height = this.props.height + "px") }t.appendChild(n) } return t }, t.prototype.getLabelWithMacrosReplaced = function () { var t = this.props; return Object(i.q)([{ macro: "_date_", value: Object(i.f)(new Date) }, { macro: "_time_", value: Object(i.g)(new Date) }, { macro: "_agent_", value: null != t.agentAlias ? t.agentAlias : "" }, { macro: "_agentdescription_", value: null != t.agentDescription ? t.agentDescription : "" }, { macro: "_address_", value: null != t.agentAddress ? t.agentAddress : "" }, { macro: "_module_", value: null != t.moduleName ? t.moduleName : "" }, { macro: "_moduledescription_", value: null != t.moduleDescription ? t.moduleDescription : "" }], this.props.label || "") }, t.prototype.updateDomElement = function (t) { t.innerHTML = this.createDomElement().innerHTML }, Object.defineProperty(t.prototype, "props", { get: function () { return o({}, this.itemProps) }, set: function (t) { this.setProps(t) }, enumerable: !0, configurable: !0 }), t.prototype.setProps = function (t) { var e = this.props; this.itemProps = t, this.shouldBeUpdated(e, t) && this.render(e, this._metadata) }, Object.defineProperty(t.prototype, "meta", { get: function () { return o({}, this._metadata) }, set: function (t) { this.setMeta(t) }, enumerable: !0, configurable: !0 }), t.prototype.setMeta = function (t) { var e = this._metadata; this._metadata = o({}, e, t), void 0 !== t.isSelected && e.isSelected !== t.isSelected && this.selectionChangedEventManager.emit({ selected: t.isSelected }), this.render(this.itemProps, e) }, t.prototype.shouldBeUpdated = function (t, e) { return t !== e }, t.prototype.render = function (t, e) { void 0 === t && (t = null), void 0 === e && (e = null), this.updateDomElement(this.childElementRef), t && !this.positionChanged(t, this.props) || this.moveElement(this.props.x, this.props.y), t && !this.sizeChanged(t, this.props) || this.resizeElement(this.props.width, this.props.height); var n = this.labelElementRef.innerHTML, i = this.createLabelDomElement().innerHTML; if (n !== i && (this.labelElementRef.innerHTML = i), t && t.labelPosition === this.props.labelPosition || this.changeLabelPosition(this.props.labelPosition), t && t.isOnTop === this.props.isOnTop || (this.props.isOnTop ? this.elementRef.classList.add("is-on-top") : this.elementRef.classList.remove("is-on-top")), t && t.isLinkEnabled !== this.props.isLinkEnabled) { var r = this.createContainerDomElement(); r.innerHTML = this.elementRef.innerHTML; for (var s = this.elementRef.attributes, o = 0; o < s.length; o++)if ("id" !== s[o].nodeName) { var a = this.elementRef.getAttributeNode(s[o].nodeName); null !== a && r.setAttributeNode(a.cloneNode()) } null !== this.elementRef.parentNode && this.elementRef.parentNode.replaceChild(r, this.elementRef), this.elementRef = r } if (t && this.props.isLinkEnabled && t.link !== this.props.link && null !== this.props.link && this.elementRef.setAttribute("href", this.props.link), e && e.editMode === this.meta.editMode || (this.meta.editMode ? this.elementRef.classList.add("is-editing") : this.elementRef.classList.remove("is-editing")), e && e.isFetching === this.meta.isFetching || (this.meta.isFetching ? this.elementRef.classList.add("is-fetching") : this.elementRef.classList.remove("is-fetching")), !e || e.isUpdating !== this.meta.isUpdating) if (this.meta.isUpdating) { this.elementRef.classList.add("is-updating"); var l = document.createElement("div"); l.className = "div-visual-console-spinner"; var c = document.createElement("div"); c.className = "visual-console-spinner", l.appendChild(c), this.elementRef.appendChild(l) } else { this.elementRef.classList.remove("is-updating"); var u = this.elementRef.querySelector(".div-visual-console-spinner"); if (null !== u) { var p = u.parentElement; null !== p && p.removeChild(u) } } e && e.isSelected === this.meta.isSelected || (this.meta.isSelected ? this.elementRef.classList.add("is-selected") : this.elementRef.classList.remove("is-selected")) }, t.prototype.remove = function () { this.removeEventManager.emit({ item: this }), this.disposables.forEach(function (t) { try { t.dispose() } catch (t) { } }), this.elementRef.remove() }, t.prototype.positionChanged = function (t, e) { return t.x !== e.x || t.y !== e.y }, t.prototype.changeLabelPosition = function (t) { switch (t) { case "up": this.elementRef.style.flexDirection = "column-reverse"; break; case "left": this.elementRef.style.flexDirection = "row-reverse"; break; case "right": this.elementRef.style.flexDirection = "row"; break; case "down": default: this.elementRef.style.flexDirection = "column" }var e = this.labelElementRef.getElementsByTagName("table"), n = e.length > 0 ? e.item(0) : null; if (n) switch (this.props.labelPosition) { case "up": case "down": this.props.width > 0 && (n.style.width = this.props.width + "px", n.style.height = null); break; case "left": case "right": this.props.height > 0 && (n.style.width = null, n.style.height = this.props.height + "px") } }, t.prototype.moveElement = function (t, e) { this.elementRef.style.left = t + "px", this.elementRef.style.top = e + "px" }, t.prototype.move = function (t, e) { this.moveElement(t, e), this.itemProps = o({}, this.props, { x: t, y: e }) }, t.prototype.sizeChanged = function (t, e) { return t.width !== e.width || t.height !== e.height }, t.prototype.resizeElement = function (t, e) { if (13 != this.props.type && 21 != this.props.type && (this.childElementRef.style.width = t > 0 ? t + "px" : null, this.childElementRef.style.height = e > 0 ? e + "px" : null), this.props.label && this.props.label.length > 0) { var n = this.labelElementRef.getElementsByTagName("table"), i = n.length > 0 ? n.item(0) : null; if (i) switch (this.props.labelPosition) { case "up": case "down": i.style.width = t > 0 ? t + "px" : null; break; case "left": case "right": i.style.height = e > 0 ? e + "px" : null } } }, t.prototype.resize = function (t, e) { this.resizeElement(t, e), this.itemProps = o({}, this.props, { width: t, height: e }) }, t.prototype.onClick = function (t) { var e = this.clickEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onDblClick = function (t) { var e = this.dblClickEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onMoved = function (t) { var e = this.movedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onMovementFinished = function (t) { var e = this.movementFinishedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onResized = function (t) { var e = this.resizedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onResizeFinished = function (t) { var e = this.resizeFinishedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onRemove = function (t) { var e = this.removeEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onSelectionChanged = function (t) { var e = this.selectionChangedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.selectItem = function () { this.meta = o({}, this.meta, { isSelected: !0 }), this.initMovementListener(this.elementRef), 13 !== this.props.type && 21 !== this.props.type && this.initResizementListener(this.elementRef) }, t.prototype.unSelectItem = function () { this.meta = o({}, this.meta, { isSelected: !1 }), this.stopMovementListener(), 13 !== this.props.type && this.stopResizementListener() }, t.prototype.getFormContainer = function () { return t.getFormContainer(this.props) }, t.getFormContainer = function (t) { var e = t.type ? function (t) { var e = ""; switch (t) { case 0: e = Object(i.t)("Static image"); break; case 1: e = Object(i.t)("Module graph"); break; case 2: e = Object(i.t)("Simple value"); break; case 3: e = Object(i.t)("Percentile item"); break; case 4: e = Object(i.t)("Label"); break; case 5: e = Object(i.t)("Icon"); break; case 6: case 7: case 8: e = Object(i.t)("Simple value"); break; case 9: e = Object(i.t)("Percentile item"); break; case 10: e = Object(i.t)("Service"); break; case 11: e = Object(i.t)("Group"); break; case 12: e = Object(i.t)("Box"); break; case 13: e = Object(i.t)("Line"); break; case 14: e = Object(i.t)("Event history graph"); break; case 15: case 16: e = Object(i.t)("Percentile item"); break; case 17: e = Object(i.t)("Serialized pie graph"); break; case 18: e = Object(i.t)("Bars graph"); break; case 19: e = Object(i.t)("Clock"); break; case 20: e = Object(i.t)("Color cloud"); break; case 21: e = Object(i.t)("Network link"); break; default: e = Object(i.t)("Item") }return e }(t.type) : Object(i.t)("Item"); return new s.FormContainer(e, [], []) }, t }(); e.a = c }, function (t, e, n) { "use strict"; var i = function () { return function () { var t = this; this.listeners = [], this.listenersOncer = [], this.on = function (e) { return t.listeners.push(e), { dispose: function () { return t.off(e) } } }, this.once = function (e) { t.listenersOncer.push(e) }, this.off = function (e) { var n = t.listeners.indexOf(e); n > -1 && t.listeners.splice(n, 1) }, this.emit = function (e) { t.listeners.forEach(function (t) { return t(e) }), t.listenersOncer.forEach(function (t) { return t(e) }), t.listenersOncer = [] }, this.pipe = function (e) { return t.on(function (t) { return e.emit(t) }) } } }(); e.a = i }, function (t, e, n) { "use strict"; n.r(e), n.d(e, "InputGroup", function () { return s }), n.d(e, "FormContainer", function () { return o }); var i = n(2), r = function () { return (r = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }, s = function () { function t(t, e) { this._name = "", this.currentData = {}, this.dataRequestedEventManager = new i.a, this.name = t, this.initialData = e } return Object.defineProperty(t.prototype, "name", { get: function () { return this._name }, set: function (t) { if (0 === t.length) throw new RangeError("empty name"); this._name = t }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "data", { get: function () { return r({}, this.currentData) }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "element", { get: function () { if (null == this._element) { var t = document.createElement("div"); t.className = "input-group input-group-" + this.name; var e = this.createContent(); e instanceof Array ? e.forEach(t.appendChild) : t.appendChild(e), this._element = t } return this._element }, enumerable: !0, configurable: !0 }), t.prototype.reset = function () { this.currentData = {} }, t.prototype.updateData = function (t) { this.currentData = r({}, this.currentData, t) }, t.prototype.requestData = function (t, e, n) { this.dataRequestedEventManager.emit({ identifier: t, params: e, done: n }) }, t.prototype.onDataRequested = function (t) { return this.dataRequestedEventManager.on(t) }, t }(), o = function () { function t(t, e, n) { var r = this; void 0 === e && (e = []), void 0 === n && (n = []), this.inputGroupsByName = {}, this.enabledInputGroupNames = [], this.submitEventManager = new i.a, this.itemDataRequestedEventManager = new i.a, this.handleItemDataRequested = this.itemDataRequestedEventManager.emit, this.title = t, e.length > 0 && (this.inputGroupsByName = e.reduce(function (t, e) { return e.onDataRequested(r.handleItemDataRequested), t[e.name] = e, t }, this.inputGroupsByName)), n.length > 0 && (this.enabledInputGroupNames = this.enabledInputGroupNames.concat(n.filter(function (t) { return null != r.inputGroupsByName[t] }))) } return t.prototype.getInputGroup = function (t) { return this.inputGroupsByName[t] || null }, t.prototype.addInputGroup = function (t, e) { return void 0 === e && (e = null), t.onDataRequested(this.handleItemDataRequested), this.inputGroupsByName[t.name] = t, this.enabledInputGroupNames = this.enabledInputGroupNames.filter(function (e) { return e !== t.name }), null !== e ? e <= 0 ? this.enabledInputGroupNames = [t.name].concat(this.enabledInputGroupNames) : e >= this.enabledInputGroupNames.length ? this.enabledInputGroupNames = this.enabledInputGroupNames.concat([t.name]) : this.enabledInputGroupNames = this.enabledInputGroupNames.slice(0, e).concat([t.name], this.enabledInputGroupNames.slice(e)) : this.enabledInputGroupNames = this.enabledInputGroupNames.concat([t.name]), this }, t.prototype.removeInputGroup = function (t) { return delete this.inputGroupsByName[t], this.enabledInputGroupNames = this.enabledInputGroupNames.filter(function (e) { return e !== t }), this }, t.prototype.getFormElement = function (t) { var e = this; void 0 === t && (t = "update"); var n = document.createElement("form"); n.id = "visual-console-item-edition", n.className = "visual-console-item-edition", n.addEventListener("submit", function (t) { t.preventDefault(), e.submitEventManager.emit({ nativeEvent: t, data: e.enabledInputGroupNames.reduce(function (t, n) { return e.inputGroupsByName[n] && (t = r({}, t, e.inputGroupsByName[n].data)), t }, {}) }) }); var i = document.createElement("div"); return i.className = "input-groups", this.enabledInputGroupNames.forEach(function (t) { e.inputGroupsByName[t] && i.appendChild(e.inputGroupsByName[t].element) }), n.appendChild(i), n }, t.prototype.reset = function () { var t = this; this.enabledInputGroupNames.forEach(function (e) { t.inputGroupsByName[e] && t.inputGroupsByName[e].reset() }) }, t.prototype.onSubmit = function (t) { return this.submitEventManager.on(t) }, t.prototype.onInputGroupDataRequested = function (t) { return this.itemDataRequestedEventManager.on(t) }, t }() }, function (t, e, n) { "use strict"; n(11); var i = "http://www.w3.org/2000/svg"; e.a = function (t, e, n) { var r = void 0 === n ? {} : n, s = r.size, o = r.color, a = r.spin, l = r.pulse, c = document.createElement("figure"); c.title = e, c.className = "fa fa-" + t.iconName, s && c.classList.add("fa-" + s), a ? c.classList.add("fa-spin") : l && c.classList.add("fa-pulse"); var u = document.createElementNS(i, "svg"); u.setAttribute("viewBox", "0 0 " + t.icon[0] + " " + t.icon[1]), o && u.setAttribute("fill", o); var p = document.createElementNS(i, "path"), h = "string" == typeof t.icon[4] ? t.icon[4] : t.icon[4][0]; return p.setAttribute("d", h), u.appendChild(p), c.appendChild(u), c } }, function (t, e, n) { "use strict"; n.d(e, "a", function () { return i }), n.d(e, "b", function () { return r }), n.d(e, "c", function () { return s }), n.d(e, "d", function () { return o }); var i = { prefix: "fas", iconName: "list-alt", icon: [512, 512, [], "f022", "M464 480H48c-26.51 0-48-21.49-48-48V80c0-26.51 21.49-48 48-48h416c26.51 0 48 21.49 48 48v352c0 26.51-21.49 48-48 48zM128 120c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zm0 96c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zm0 96c-22.091 0-40 17.909-40 40s17.909 40 40 40 40-17.909 40-40-17.909-40-40-40zm288-136v-32c0-6.627-5.373-12-12-12H204c-6.627 0-12 5.373-12 12v32c0 6.627 5.373 12 12 12h200c6.627 0 12-5.373 12-12zm0 96v-32c0-6.627-5.373-12-12-12H204c-6.627 0-12 5.373-12 12v32c0 6.627 5.373 12 12 12h200c6.627 0 12-5.373 12-12zm0 96v-32c0-6.627-5.373-12-12-12H204c-6.627 0-12 5.373-12 12v32c0 6.627 5.373 12 12 12h200c6.627 0 12-5.373 12-12z"] }, r = { prefix: "fas", iconName: "pencil-alt", icon: [512, 512, [], "f303", "M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z"] }, s = { prefix: "fas", iconName: "plus-circle", icon: [512, 512, [], "f055", "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"] }, o = { prefix: "fas", iconName: "trash-alt", icon: [448, 512, [], "f2ed", "M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"] } }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.d(__webpack_exports__, "b", function () { return eventsHistoryPropsDecoder }); var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0), _Item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1), __extends = (extendStatics = function (t, e) { return (extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(t, e) }, function (t, e) { function n() { this.constructor = t } extendStatics(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }), extendStatics, __assign = function () { return (__assign = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function eventsHistoryPropsDecoder(t) { if (Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html) && Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.encodedHtml)) throw new TypeError("missing html content."); return __assign({}, Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t), { type: 14, maxTime: Object(_lib__WEBPACK_IMPORTED_MODULE_0__.n)(t.maxTime, null), html: Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html) ? Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml) : t.html }, Object(_lib__WEBPACK_IMPORTED_MODULE_0__.j)(t)) } var EventsHistory = function (_super) { function EventsHistory() { return null !== _super && _super.apply(this, arguments) || this } return __extends(EventsHistory, _super), EventsHistory.prototype.createDomElement = function () { var element = document.createElement("div"); element.className = "events-history", element.innerHTML = this.props.html, !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || (element.style.opacity = "0.2"); for (var scripts = element.getElementsByTagName("script"), _loop_1 = function (i) { 0 === scripts[i].src.length && setTimeout(function () { try { eval(scripts[i].innerHTML.trim()) } catch (t) { } }, 0) }, i = 0; i < scripts.length; i++)_loop_1(i); return element }, EventsHistory.prototype.updateDomElement = function (element) { element.innerHTML = this.props.html; var aux = document.createElement("div"); aux.innerHTML = this.props.html; for (var scripts = aux.getElementsByTagName("script"), i = 0; i < scripts.length; i++)0 === scripts[i].src.length && eval(scripts[i].innerHTML.trim()) }, EventsHistory }(_Item__WEBPACK_IMPORTED_MODULE_1__.a); __webpack_exports__.a = EventsHistory }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.d(__webpack_exports__, "b", function () { return donutGraphPropsDecoder }); var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0), _Item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1), __extends = (extendStatics = function (t, e) { return (extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(t, e) }, function (t, e) { function n() { this.constructor = t } extendStatics(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }), extendStatics, __assign = function () { return (__assign = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function donutGraphPropsDecoder(t) { if (Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html) && Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.encodedHtml)) throw new TypeError("missing html content."); return __assign({}, Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t), { type: 17, html: Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html) ? Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml) : t.html, legendBackgroundColor: Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.legendBackgroundColor) ? "#000000" : t.legendBackgroundColor }, Object(_lib__WEBPACK_IMPORTED_MODULE_0__.j)(t), Object(_lib__WEBPACK_IMPORTED_MODULE_0__.i)(t)) } var DonutGraph = function (_super) { function DonutGraph() { return null !== _super && _super.apply(this, arguments) || this } return __extends(DonutGraph, _super), DonutGraph.prototype.createDomElement = function () { var element = document.createElement("div"); element.className = "donut-graph", element.innerHTML = this.props.html, !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || (element.style.opacity = "0.2"); for (var scripts = element.getElementsByTagName("script"), _loop_1 = function (i) { setTimeout(function () { 0 === scripts[i].src.length && eval(scripts[i].innerHTML.trim()) }, 0) }, i = 0; i < scripts.length; i++)_loop_1(i); return element }, DonutGraph.prototype.updateDomElement = function (element) { element.innerHTML = this.props.html; var aux = document.createElement("div"); aux.innerHTML = this.props.html; for (var scripts = aux.getElementsByTagName("script"), i = 0; i < scripts.length; i++)0 === scripts[i].src.length && eval(scripts[i].innerHTML.trim()) }, DonutGraph }(_Item__WEBPACK_IMPORTED_MODULE_1__.a); __webpack_exports__.a = DonutGraph }, function (module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.d(__webpack_exports__, "b", function () { return moduleGraphPropsDecoder }); var _lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0), _Item__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1), __extends = (extendStatics = function (t, e) { return (extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(t, e) }, function (t, e) { function n() { this.constructor = t } extendStatics(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }), extendStatics, __assign = function () { return (__assign = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }, parseBackgroundType = function (t) { switch (t) { case "white": case "black": case "transparent": return t; default: return "transparent" } }, parseGraphType = function (t) { switch (t) { case "line": case "area": return t; default: return "line" } }; function moduleGraphPropsDecoder(t) { if (Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html) && Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.encodedHtml)) throw new TypeError("missing html content."); return __assign({}, Object(_Item__WEBPACK_IMPORTED_MODULE_1__.b)(t), { type: 1, html: Object(_lib__WEBPACK_IMPORTED_MODULE_0__.s)(t.html) ? Object(_lib__WEBPACK_IMPORTED_MODULE_0__.d)(t.encodedHtml) : t.html, backgroundType: parseBackgroundType(t.backgroundType), period: Object(_lib__WEBPACK_IMPORTED_MODULE_0__.n)(t.period, null), graphType: parseGraphType(t.graphType), customGraphId: Object(_lib__WEBPACK_IMPORTED_MODULE_0__.n)(t.customGraphId, null) }, Object(_lib__WEBPACK_IMPORTED_MODULE_0__.j)(t), Object(_lib__WEBPACK_IMPORTED_MODULE_0__.i)(t)) } var ModuleGraph = function (_super) { function ModuleGraph() { return null !== _super && _super.apply(this, arguments) || this } return __extends(ModuleGraph, _super), ModuleGraph.prototype.createDomElement = function () { var element = document.createElement("div"); element.innerHTML = this.props.html, element.className = "module-graph", !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || (element.style.opacity = "0.2"); for (var legendP = element.getElementsByTagName("p"), i = 0; i < legendP.length; i++)legendP[i].style.margin = "0px"; for (var overviewGraphs = element.getElementsByClassName("overview_graph"), i = 0; i < overviewGraphs.length; i++)overviewGraphs[i].remove(); for (var scripts = element.getElementsByTagName("script"), _loop_1 = function (i) { 0 === scripts[i].src.length && setTimeout(function () { try { eval(scripts[i].innerHTML.trim()) } catch (t) { } }, 0) }, i = 0; i < scripts.length; i++)_loop_1(i); return element }, ModuleGraph.prototype.updateDomElement = function (element) { element.innerHTML = this.props.html; for (var legendP = element.getElementsByTagName("p"), i = 0; i < legendP.length; i++)legendP[i].style.margin = "0px"; for (var overviewGraphs = element.getElementsByClassName("overview_graph"), i = 0; i < overviewGraphs.length; i++)overviewGraphs[i].remove(); for (var scripts = element.getElementsByTagName("script"), i = 0; i < scripts.length; i++)0 === scripts[i].src.length && eval(scripts[i].innerHTML.trim()) }, ModuleGraph }(_Item__WEBPACK_IMPORTED_MODULE_1__.a); __webpack_exports__.a = ModuleGraph }, function (t, e) { t.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAARpJREFUeNqUU8ENwjAMTCsGyAiwAIIN2hdfmACYgLIACBYAJgA26JcXbABigo7QEbhDFxSFEIlIp7Sxz/Y5jjGJtb30B0TKJ4uQCmwLYByYauC8Gj1r/zAPyEdsV6AFhnDOCH4DDXCkD2C/KhCZWUuQHr8kMQiDwWfyqQAGEmchmedA5f5lI7HA+cyXsAY2kcxT2YwXhFIO7jyXHpZ2CktWmb2Imj3QpaRcZBc51FxJWhiYTWa1tmPSyyZsretBo2zW/LeKdwCV3kQGJzWhlNWCe3O3cGZXf1TRBmSrGziEg3TXZ6kmxTKTvFPj337+KJfa7xqs2Bu5SvvcJckiGSo9JqOrMspoNStLv8Is0ajCdRrrxmAxaS8BBgA1e3UUTVCKKgAAAABJRU5ErkJggg==" }, function (t, e, n) { }, function (t, e, n) { }, function (t, e, n) { }, function (t, e, n) { }, function (t, e, n) { "use strict"; n.r(e); n(10); var i, r = n(0), s = n(1), o = (i = function (t, e) { return (i = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(t, e) }, function (t, e) { function n() { this.constructor = t } i(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) }), a = function () { return (a = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }, l = function (t) { switch (t) { case "default": case "enabled": case "disabled": return t; default: return "default" } }; function c(t) { if ("string" != typeof t.imageSrc || 0 === t.imageSrc.length) throw new TypeError("invalid image src."); return a({}, Object(s.b)(t), { type: 0, imageSrc: t.imageSrc, showLastValueTooltip: l(t.showLastValueTooltip), statusImageSrc: Object(r.k)(t.statusImageSrc, null), lastValue: Object(r.k)(t.lastValue, null) }, Object(r.j)(t), Object(r.i)(t)) } var u = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return o(e, t), e.prototype.createDomElement = function () { var t = this.props.statusImageSrc || this.props.imageSrc, e = document.createElement("div"); return e.className = "static-graph", e.setAttribute("ondragstart", "return false;"), e.setAttribute("draggable", "false"), e.style.backgroundImage = "url(" + t + ")", e.style.backgroundRepeat = "no-repeat", e.style.backgroundSize = "contain", e.style.backgroundPosition = "center", !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || (e.style.opacity = "0.2"), null !== this.props.lastValue && "disabled" !== this.props.showLastValueTooltip && (e.className = "static-graph image forced_title", e.setAttribute("data-use_title_for_force_title", "1"), e.setAttribute("data-title", this.props.lastValue)), e }, e.prototype.updateDomElement = function (t) { var e = this.props.statusImageSrc || this.props.imageSrc; t.style.backgroundImage = "url(" + e + ")" }, e }(s.a), p = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), h = function () { return (h = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function d(t) { if ("string" != typeof t.imageSrc || 0 === t.imageSrc.length) throw new TypeError("invalid image src."); if ("string" != typeof t.image || 0 === t.image.length) throw new TypeError("invalid image."); return h({}, Object(s.b)(t), { type: 5, image: t.image, imageSrc: t.imageSrc }, Object(r.i)(t)) } var m = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return p(e, t), e.prototype.createDomElement = function () { var t = document.createElement("div"); return t.className = "icon " + this.props.image, t.style.backgroundImage = "url(" + this.props.imageSrc + ")", t.style.backgroundRepeat = "no-repeat", t.style.backgroundSize = "contain", t.style.backgroundPosition = "center", t }, e.prototype.updateDomElement = function (t) { t.style.backgroundImage = "url(" + this.props.imageSrc + ")" }, e }(s.a), f = n(3), _ = n(4), y = n(5), b = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), v = function () { return (v = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function g(t) { if ("string" != typeof t.color || 0 === t.color.length) throw new TypeError("invalid color."); return v({}, Object(s.b)(t), { type: 20, color: t.color, defaultColor: t.defaultColor, colorRanges: t.colorRanges }, Object(r.j)(t), Object(r.i)(t)) } var E = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return b(e, t), e.prototype.createContent = function () { var t = this, e = document.createElement("div"); e.className = "div-input-group"; var n = document.createElement("label"); n.textContent = Object(r.t)("Default color"), e.appendChild(n); var i = document.createElement("input"); return i.type = "color", i.required = !0, i.value = "" + (this.currentData.defaultColor || this.initialData.defaultColor || "#000000"), i.addEventListener("change", function (e) { t.updateData({ defaultColor: e.target.value }) }), e.appendChild(i), e }, e }(f.InputGroup), x = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return b(e, t), e.prototype.createContent = function () { var t = this, e = document.createElement("div"); e.className = "div-input-group div-ranges-input-group"; var n = this.createLabel("Ranges"); e.appendChild(n); var i = document.createElement("div"), r = document.createElement("div"); e.appendChild(r), e.appendChild(i); var s, o = this.currentData.colorRanges || this.initialData.colorRanges || []; return (s = function (e) { r.innerHTML = "", e.forEach(function (e, n) { return r.appendChild(t.rangeContainer(e, function (e) { return function (n) { var i = t.currentData.colorRanges || t.initialData.colorRanges || []; t.updateData({ colorRanges: i.slice(0, e).concat([n], i.slice(e + 1)) }) } }(n), function (e) { return function () { var n = t.currentData.colorRanges || t.initialData.colorRanges || [], i = n.slice(0, e).concat(n.slice(e + 1)); t.updateData({ colorRanges: i }), s(i) } }(n))) }) })(o), i.appendChild(this.initialRangeContainer(function (e) { var n = (t.currentData.colorRanges || t.initialData.colorRanges || []).concat([e]); t.updateData({ colorRanges: n }), s(n) })), e }, e.prototype.initialRangeContainer = function (t) { var e = { color: "#ffffff" }, n = v({}, e), i = document.createElement("div"), s = document.createElement("div"), o = this.createLabel("From Value"), a = this.createInputNumber(null, function (t) { n.fromValue = t }); s.appendChild(o), s.appendChild(a), i.appendChild(s); var l = document.createElement("div"), c = this.createLabel("To Value"), u = this.createInputNumber(null, function (t) { n.toValue = t }); s.appendChild(c), s.appendChild(u), i.appendChild(l); var p = document.createElement("div"), h = this.createLabel("Color"), d = this.createInputColor(e.color, function (t) { n.color = t }); s.appendChild(h), s.appendChild(d), i.appendChild(p); var m = document.createElement("a"); m.appendChild(Object(_.a)(y.c, Object(r.t)("Create color range"), { size: "small", color: "#565656" })); return m.addEventListener("click", function () { var i; void 0 !== (i = n).color && void 0 !== i.toValue && void 0 !== i.fromValue && t(n), n = e, a.value = "" + (n.fromValue || ""), u.value = "" + (n.toValue || ""), d.value = "" + n.color }), i.appendChild(m), i }, e.prototype.rangeContainer = function (t, e, n) { var i = v({}, t), s = document.createElement("div"), o = document.createElement("div"), a = this.createLabel("From Value"), l = this.createInputNumber(t.fromValue, function (t) { i.fromValue = t, e(v({}, i)) }); o.appendChild(a), o.appendChild(l), s.appendChild(o); var c = document.createElement("div"), u = this.createLabel("To Value"), p = this.createInputNumber(t.toValue, function (t) { i.toValue = t, e(v({}, i)) }); o.appendChild(u), o.appendChild(p), s.appendChild(c); var h = document.createElement("div"), d = this.createLabel("Color"), m = this.createInputColor(t.color, function (t) { i.color = t, e(v({}, i)) }); o.appendChild(d), o.appendChild(m), s.appendChild(h); var f = document.createElement("a"); return f.appendChild(Object(_.a)(y.d, Object(r.t)("Delete color range"), { size: "small", color: "#565656" })), f.addEventListener("click", n), s.appendChild(f), s }, e.prototype.createLabel = function (t) { var e = document.createElement("label"); return e.textContent = Object(r.t)(t), e }, e.prototype.createInputNumber = function (t, e) { var n = document.createElement("input"); return n.type = "number", null !== t && (n.value = "" + t), n.addEventListener("change", function (t) { var n = parseInt(t.target.value); isNaN(n) || e(n) }), n }, e.prototype.createInputColor = function (t, e) { var n = document.createElement("input"); return n.type = "color", null !== t && (n.value = t), n.addEventListener("change", function (t) { return e(t.target.value) }), n }, e }(f.InputGroup), w = "http://www.w3.org/2000/svg", O = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return b(e, t), e.prototype.createDomElement = function () { var t = document.createElement("div"); return t.className = "color-cloud", t.append(this.createSvgElement()), t }, e.prototype.resizeElement = function (e) { t.prototype.resizeElement.call(this, e, e) }, e.prototype.createSvgElement = function () { var t = "grad_" + this.props.id, e = document.createElementNS(w, "svg"); e.setAttribute("viewBox", "0 0 100 100"); var n = document.createElementNS(w, "defs"), i = document.createElementNS(w, "radialGradient"); i.setAttribute("id", t), i.setAttribute("cx", "50%"), i.setAttribute("cy", "50%"), i.setAttribute("r", "50%"), i.setAttribute("fx", "50%"), i.setAttribute("fy", "50%"); var r = document.createElementNS(w, "stop"); r.setAttribute("offset", "0%"), r.setAttribute("style", "stop-color:" + this.props.color + ";stop-opacity:0.9"); var s = document.createElementNS(w, "stop"); s.setAttribute("offset", "100%"), s.setAttribute("style", "stop-color:" + this.props.color + ";stop-opacity:0"); var o = document.createElementNS(w, "circle"); return o.setAttribute("fill", "url(#" + t + ")"), o.setAttribute("cx", "50%"), o.setAttribute("cy", "50%"), o.setAttribute("r", "50%"), i.append(r, s), n.append(i), e.append(n, o), !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || e.setAttribute("opacity", "0.2"), e }, e.prototype.getFormContainer = function () { return e.getFormContainer(this.props) }, e.getFormContainer = function (e) { var n = t.getFormContainer.call(this, e); return n.removeInputGroup("label"), n.addInputGroup(new E("color-cloud", e), 3), n.addInputGroup(new x("ranges-cloud", e), 4), n }, e }(s.a), k = n(2), M = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), A = function () { return (A = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function j(t) { var e = A({}, Object(s.b)(A({}, t, { width: 1, height: 1 })), { type: 13, label: null, isLinkEnabled: !1, parentId: null, aclGroupId: null, x: 0, y: 0, width: 0, height: 0, startPosition: { x: Object(r.n)(t.startX, 0), y: Object(r.n)(t.startY, 0) }, endPosition: { x: Object(r.n)(t.endX, 0), y: Object(r.n)(t.endY, 0) }, lineWidth: Object(r.n)(t.lineWidth || t.borderWidth, 1), color: Object(r.k)(t.borderColor || t.color, null), viewportOffsetX: 0, viewportOffsetY: 0, labelEnd: Object(r.k)(t.labelEnd, ""), labelEndWidth: Object(r.n)(t.labelEndWidth, 0), linkedEnd: t.linkedEnd, linkedStart: t.linkedStart, labelEndHeight: Object(r.n)(t.labelEndHeight, 0), labelStart: Object(r.k)(t.labelStart, ""), labelStartWidth: Object(r.n)(t.labelStartWidth, 0), labelStartHeight: Object(r.n)(t.labelStartHeight, 0) }); return A({}, e, C.extractBoxSizeAndPosition(e.startPosition, e.endPosition)) } var T = "http://www.w3.org/2000/svg", C = function (t) { function e(n, i) { var s = t.call(this, A({}, n, e.extractBoxSizeAndPosition(n.startPosition, n.endPosition)), A({}, i), !0) || this; return s.circleRadius = 8, s.moveMode = !1, s.isMoving = !1, s.lineMovedEventManager = new k.a, s.lineMovedEventDisposables = [], s.debouncedStartPositionMovementSave = Object(r.c)(500, function (t, e) { s.isMoving = !1; var n = { x: t, y: e }; s.lineMovedEventManager.emit({ item: s, startPosition: n, endPosition: s.props.endPosition }) }), s.removeStartPositionMovement = null, s.debouncedEndPositionMovementSave = Object(r.c)(500, function (t, e) { s.isMoving = !1; var n = { x: t, y: e }; s.lineMovedEventManager.emit({ item: s, endPosition: n, startPosition: s.props.startPosition }) }), s.removeEndPositionMovement = null, s.moveMode = i.editMode, s.init(), t.prototype.resizeElement.call(s, Math.max(n.width, n.viewportOffsetX), Math.max(n.height, n.viewportOffsetY)), s } return M(e, t), e.prototype.initStartPositionMovementListener = function (t, e) { var n = this; this.removeStartPositionMovement = Object(r.a)(t, function (t, e) { var i = { x: t += n.circleRadius - n.props.viewportOffsetX / 2, y: e += n.circleRadius - n.props.viewportOffsetY / 2 }; n.isMoving = !0, n.props = A({}, n.props, { startPosition: i }), n.debouncedStartPositionMovementSave(t, e) }, e) }, e.prototype.stopStartPositionMovementListener = function () { this.removeStartPositionMovement && (this.removeStartPositionMovement(), this.removeStartPositionMovement = null) }, e.prototype.initEndPositionMovementListener = function (t, e) { var n = this; this.removeEndPositionMovement = Object(r.a)(t, function (t, e) { t += n.circleRadius - n.props.viewportOffsetX / 2, e += n.circleRadius - n.props.viewportOffsetY / 2, n.isMoving = !0, n.props = A({}, n.props, { endPosition: { x: t, y: e } }), n.debouncedEndPositionMovementSave(t, e) }, e) }, e.prototype.stopEndPositionMovementListener = function () { this.removeEndPositionMovement && (this.removeEndPositionMovement(), this.removeEndPositionMovement = null) }, e.prototype.setProps = function (n) { t.prototype.setProps.call(this, A({}, n, e.extractBoxSizeAndPosition(n.startPosition, n.endPosition))) }, e.prototype.setMeta = function (e) { this.moveMode = e.editMode, t.prototype.setMeta.call(this, A({}, e, { lineMode: !0 })) }, e.prototype.createDomElement = function () { var t = document.createElement("div"); t.className = "line"; var e = this.props, n = e.x, i = e.y, r = e.width, s = e.height, o = e.lineWidth, a = e.viewportOffsetX, l = e.viewportOffsetY, c = e.startPosition, u = e.endPosition, p = e.color; r += a, s += l; var h = c.x - n + o / 2 + a / 2, d = c.y - i + o / 2 + l / 2, m = u.x - n + o / 2 + a / 2, f = u.y - i + o / 2 + l / 2, _ = document.createElementNS(T, "svg"); _.setAttribute("width", "" + (r + o)), _.setAttribute("height", "" + (s + o)); var y = document.createElementNS(T, "line"); return y.setAttribute("x1", "" + h), y.setAttribute("y1", "" + d), y.setAttribute("x2", "" + m), y.setAttribute("y2", "" + f), y.setAttribute("stroke", p || "black"), y.setAttribute("stroke-width", "" + o), _.append(y), t.append(_), t }, e.prototype.updateDomElement = function (t) { var e = this.props, n = e.x, i = e.y, r = e.width, s = e.height, o = e.lineWidth, a = e.viewportOffsetX, l = e.viewportOffsetY, c = e.startPosition, u = e.endPosition, p = e.color; r += a, s += l; var h = c.x - n + o / 2 + a / 2, d = c.y - i + o / 2 + l / 2, m = u.x - n + o / 2 + a / 2, f = u.y - i + o / 2 + l / 2, _ = t.getElementsByTagName("svg"); if (_.length > 0) { var y = _.item(0); if (null != y) { y.setAttribute("width", "" + (r + o)), y.setAttribute("height", "" + (s + o)); var b = y.getElementsByTagNameNS(T, "line"); if (b.length > 0) { var v = b.item(0); null != v && (v.setAttribute("x1", "" + h), v.setAttribute("y1", "" + d), v.setAttribute("x2", "" + m), v.setAttribute("y2", "" + f), v.setAttribute("stroke", p || "black"), v.setAttribute("stroke-width", "" + o)) } } } if (this.moveMode) { var g = document.createElement("div"), E = document.createElement("div"); if (this.isMoving) { var x = t.getElementsByClassName("visual-console-item-line-circle-start"); if (x.length > 0) (k = x.item(0)) && (g = k); var w = t.getElementsByClassName("visual-console-item-line-circle-end"); if (w.length > 0) (k = w.item(0)) && (E = k) } if (g.classList.add("visual-console-item-line-circle", "visual-console-item-line-circle-start"), g.style.width = 2 * this.circleRadius + "px", g.style.height = 2 * this.circleRadius + "px", g.style.borderRadius = "50%", g.style.backgroundColor = "" + p, g.style.position = "absolute", g.style.left = h - this.circleRadius + "px", g.style.top = d - this.circleRadius + "px", E.classList.add("visual-console-item-line-circle", "visual-console-item-line-circle-end"), E.style.width = 2 * this.circleRadius + "px", E.style.height = 2 * this.circleRadius + "px", E.style.borderRadius = "50%", E.style.backgroundColor = "" + p, E.style.position = "absolute", E.style.left = m - this.circleRadius + "px", E.style.top = f - this.circleRadius + "px", null !== t.parentElement) { for (var O = t.parentElement.getElementsByClassName("visual-console-item-line-circle"); O.length > 0;) { (k = O.item(0)) && k.remove() } t.parentElement.appendChild(g), t.parentElement.appendChild(E) } this.initStartPositionMovementListener(g, this.elementRef.parentElement), this.initEndPositionMovementListener(E, this.elementRef.parentElement) } else if (this.moveMode) this.stopStartPositionMovementListener(); else if (this.stopStartPositionMovementListener(), null !== t.parentElement) for (O = t.parentElement.getElementsByClassName("visual-console-item-line-circle"); O.length > 0;) { var k; (k = O.item(0)) && k.remove() } }, e.extractBoxSizeAndPosition = function (t, e) { return { width: Math.abs(t.x - e.x), height: Math.abs(t.y - e.y), x: Math.min(t.x, e.x), y: Math.min(t.y, e.y) } }, e.prototype.move = function (e, n) { t.prototype.moveElement.call(this, e, n); var i = this.props.startPosition.x - this.props.endPosition.x <= 0, r = this.props.startPosition.y - this.props.endPosition.y <= 0, s = { x: i ? e : this.props.width + e, y: r ? n : this.props.height + n }, o = { x: i ? this.props.width + e : e, y: r ? this.props.height + n : n }; this.props = A({}, this.props, { startPosition: s, endPosition: o }) }, e.prototype.remove = function () { this.stopStartPositionMovementListener(), t.prototype.remove.call(this) }, e.prototype.onLineMovementFinished = function (t) { var e = this.lineMovedEventManager.on(t); return this.lineMovedEventDisposables.push(e), e }, e }(s.a), P = C, S = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), I = function () { return (I = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function L(t) { return I({}, j(t), { type: 21, viewportOffsetX: 0, viewportOffsetY: 0, labelEnd: Object(r.k)(t.labelEnd, ""), labelEndWidth: Object(r.n)(t.labelEndWidth, 0), labelEndHeight: Object(r.n)(t.labelEndHeight, 0), labelStart: Object(r.k)(t.labelStart, ""), labelStartWidth: Object(r.n)(t.labelStartWidth, 0), labelStartHeight: Object(r.n)(t.labelStartHeight, 0) }) } var R = function (t) { function e(e, n) { var i = t.call(this, I({}, e), I({}, n)) || this; return i.debouncedStartPositionMovementSave = Object(r.c)(50, function (t, e) { i.isMoving = !1; var n = { x: t, y: e }; i.render(), i.lineMovedEventManager.emit({ item: i, startPosition: n, endPosition: i.props.endPosition }) }), i.debouncedEndPositionMovementSave = Object(r.c)(50, function (t, e) { i.isMoving = !1; var n = { x: t, y: e }; i.render(), i.lineMovedEventManager.emit({ item: i, endPosition: n, startPosition: i.props.startPosition }) }), i.render(), i } return S(e, t), e.prototype.updateDomElement = function (e) { t.prototype.updateDomElement.call(this, e); var n, i, r = this.props, s = r.x, o = r.y, a = r.lineWidth, l = r.viewportOffsetX, c = r.viewportOffsetY, u = r.startPosition, p = r.endPosition, h = r.color, d = r.labelEnd, m = r.labelStart, f = r.labelEndWidth, _ = r.labelEndHeight, y = r.labelStartWidth, b = r.labelStartHeight, v = e.getElementsByTagName("svg"); if (v.length > 0) { if (null != (i = v.item(0))) { for (var g = i.getElementsByTagNameNS("http://www.w3.org/2000/svg", "line"), E = i.getElementsByTagNameNS("http://www.w3.org/2000/svg", "g"); E.length > 0;)E[0].remove(); g.length > 0 && (n = g.item(0)) } if (null != i && null != n) { var x = u.x - s + a / 2 + l / 2, w = u.y - o + a / 2 + c / 2, O = p.x - s + a / 2 + l / 2, k = p.y - o + a / 2 + c / 2, M = u.x - s + a / 2 + l / 2, A = u.y - o + a / 2 + c / 2, j = p.x - s + a / 2 + l / 2, T = p.y - o + a / 2 + c / 2, C = 180 * Math.atan2(k - w, O - x) / Math.PI; if (y <= 0) { g = m.split("<br>"); y = 0, g.forEach(function (t) { t.length > y && (y = 10 * t.length) }), b <= 0 && (b = 25 * g.length) } if (f <= 0) { g = d.split("<br>"); f = 0, g.forEach(function (t) { t.length > f && (f = 10 * t.length) }), _ <= 0 && (_ = 25 * g.length) } if (M < j && (M += 25, j -= 25 + f), M > j && (M -= 25 + y, j += 25), A < T && (A += 25, T -= 25 + _), A > T && (A -= 25 + b, T += 25), void 0 === h && (h = "#000"), null !== e.parentElement) { for (var P = e.parentElement.getElementsByClassName("vc-item-nl-label"); P.length > 0;) { var S = P.item(0); S && S.remove() } for (var I = e.parentElement.getElementsByClassName("vc-item-nl-arrow"); I.length > 0;) { var L = I.item(0); L && L.remove() } } var R = 2 * a, N = x + (O - x) / 2 - R, D = w + (k - w) / 2 - R, z = document.createElement("div"); z.classList.add("vc-item-nl-arrow"), z.style.position = "absolute", z.style.border = R + "px solid transparent", z.style.borderBottom = R + "px solid " + h, z.style.left = N + "px", z.style.top = D + "px", z.style.transform = "rotate(" + (90 + C) + "deg)"; var B = document.createElement("div"); if (B.classList.add("vc-item-nl-arrow"), B.style.position = "absolute", B.style.border = R + "px solid transparent", B.style.borderBottom = R + "px solid " + h, B.style.left = N + "px", B.style.top = D + "px", B.style.transform = "rotate(" + (270 + C) + "deg)", null !== e.parentElement && (e.parentElement.appendChild(z), e.parentElement.appendChild(B)), "" != m) { var H = document.createElement("div"); try { H.innerHTML = m, H.style.position = "absolute", H.style.left = M + "px", H.style.top = A + "px", H.style.width = y + "px", H.style.border = "2px solid " + h, H.classList.add("vc-item-nl-label", "label-start") } catch (t) { console.error(t) } null !== e.parentElement && e.parentElement.appendChild(H) } if ("" != d) { var G = document.createElement("div"); try { G.innerHTML = d, G.style.position = "absolute", G.style.left = j + "px", G.style.top = T + "px", G.style.width = f + "px", G.style.border = "2px solid " + h, G.classList.add("vc-item-nl-label", "label-end") } catch (t) { console.error(t) } null !== e.parentElement && e.parentElement.appendChild(G) } } } }, e }(P), N = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), D = function () { return (D = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function z(t) { if (("string" != typeof t.imageSrc || 0 === t.imageSrc.length) && null === t.encodedHtml) throw new TypeError("invalid image src."); if (null === Object(r.n)(t.groupId, null)) throw new TypeError("invalid group Id."); var e = Object(r.l)(t.showStatistics), n = e ? function (t) { return Object(r.s)(t.html) ? Object(r.s)(t.encodedHtml) ? null : Object(r.d)(t.encodedHtml) : t.html }(t) : null; return D({}, Object(s.b)(t), { type: 11, groupId: parseInt(t.groupId), imageSrc: Object(r.k)(t.imageSrc, null), statusImageSrc: Object(r.k)(t.statusImageSrc, null), showStatistics: e, html: n }, Object(r.i)(t)) } var B = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return N(e, t), e.prototype.createDomElement = function () { var t = document.createElement("div"); return t.className = "group", this.props.showStatistics || null === this.props.statusImageSrc ? this.props.showStatistics && null != this.props.html && (t.style.backgroundImage = "none", t.innerHTML = this.props.html) : (t.style.backgroundImage = "url(" + this.props.statusImageSrc + ")", t.style.backgroundRepeat = "no-repeat", t.style.backgroundSize = "contain", t.style.backgroundPosition = "center"), t }, e.prototype.updateDomElement = function (t) { this.props.showStatistics || null === this.props.statusImageSrc ? this.props.showStatistics && null != this.props.html && (t.style.backgroundImage = "none", t.innerHTML = this.props.html) : (t.style.backgroundImage = "url(" + this.props.statusImageSrc + ")", t.style.backgroundRepeat = "no-repeat", t.style.backgroundSize = "contain", t.style.backgroundPosition = "center", t.innerHTML = "") }, e }(s.a), H = (n(13), function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }()), G = function () { return (G = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }, W = function (t) { switch (t) { case "analogic": case "digital": return t; default: return "analogic" } }, F = function (t) { switch (t) { case "datetime": case "time": return t; default: return "datetime" } }; function U(t) { if ("string" != typeof t.clockTimezone || 0 === t.clockTimezone.length) throw new TypeError("invalid timezone."); return G({}, Object(s.b)(t), { type: 19, clockType: W(t.clockType), clockFormat: F(t.clockFormat), clockTimezone: t.clockTimezone, clockTimezoneOffset: Object(r.n)(t.clockTimezoneOffset, 0), showClockTimezone: Object(r.l)(t.showClockTimezone), color: Object(r.k)(t.color, null) }, Object(r.i)(t)) } var V = function (t) { function e(n, i) { var r = t.call(this, n, i) || this; return r.intervalRef = null, r.startTick(function () { r.childElementRef.innerHTML = r.createClock().innerHTML }, "analogic" === r.props.clockType ? 2e4 : e.TICK_INTERVAL), r } return H(e, t), e.prototype.stopTick = function () { null !== this.intervalRef && (window.clearInterval(this.intervalRef), this.intervalRef = null) }, e.prototype.startTick = function (t, n) { void 0 === n && (n = e.TICK_INTERVAL), this.stopTick(), this.intervalRef = window.setInterval(t, n) }, e.prototype.createDomElement = function () { return this.createClock() }, e.prototype.updateDomElement = function (e) { var n = this.getElementSize(this.props.width, this.props.height), i = n.width, r = n.height; "digital" === this.props.clockType ? (!1 === this.meta.isBeingResized && t.prototype.resizeElement.call(this, this.props.width, this.props.height), e.classList.replace("analogic-clock", "digital-clock")) : (!1 === this.meta.isBeingResized && t.prototype.resizeElement.call(this, i, r), e.classList.replace("digital-clock", "analogic-clock")), e.innerHTML = this.createDomElement().innerHTML }, e.prototype.remove = function () { this.stopTick(), t.prototype.remove.call(this) }, e.prototype.resizeElement = function (e, n) { var i = this.getElementSize(e, n), r = i.width, s = i.height; "digital" === this.props.clockType ? t.prototype.resizeElement.call(this, e, n) : t.prototype.resizeElement.call(this, r, s) }, e.prototype.createClock = function () { switch (this.props.clockType) { case "analogic": return this.createAnalogicClock(); case "digital": return this.createDigitalClock(); default: throw new Error("invalid clock type.") } }, e.prototype.createAnalogicClock = function () { var t = "http://www.w3.org/2000/svg", e = "#FFFFF0", n = "#242124", i = "#242124", s = "#242124", o = "#525252", a = "#DC143C", l = this.getElementSize(), c = l.width, u = l.height, p = 10 * c / 100, h = document.createElement("div"); h.className = "analogic-clock", h.style.width = c + "px", h.style.height = u + "px"; var d = document.createElementNS(t, "svg"); d.setAttribute("viewBox", "0 0 100 100"); var m = document.createElementNS(t, "g"); m.setAttribute("class", "clockface"); var f = document.createElementNS(t, "circle"); f.setAttribute("cx", "50"), f.setAttribute("cy", "50"), f.setAttribute("r", "48"), f.setAttribute("fill", e), f.setAttribute("stroke", n), f.setAttribute("stroke-width", "2"), f.setAttribute("stroke-linecap", "round"), m.append(f); var _ = this.getHumanTimezone(); if (_.length > 0) { var y = document.createElementNS(t, "text"); y.setAttribute("text-anchor", "middle"), y.setAttribute("font-size", "8"), y.setAttribute("transform", "translate(30 50) rotate(90)"), y.setAttribute("fill", i), y.textContent = _, m.append(y) } var b = document.createElementNS(t, "g"); b.setAttribute("class", "marks"); var v = document.createElementNS(t, "g"); v.setAttribute("class", "mark"), v.setAttribute("transform", "translate(50 50)"); var g = document.createElementNS(t, "line"); g.setAttribute("x1", "36"), g.setAttribute("y1", "0"), g.setAttribute("x2", "46"), g.setAttribute("y2", "0"), g.setAttribute("stroke", i), g.setAttribute("stroke-width", "5"); var E = document.createElementNS(t, "line"); E.setAttribute("x1", "36"), E.setAttribute("y1", "0"), E.setAttribute("x2", "46"), E.setAttribute("y2", "0"), E.setAttribute("stroke", e), E.setAttribute("stroke-width", "1"), v.append(g, E), b.append(v); for (var x = 1; x < 60; x++) { var w = document.createElementNS(t, "line"); w.setAttribute("y1", "0"), w.setAttribute("y2", "0"), w.setAttribute("stroke", i), w.setAttribute("transform", "translate(50 50) rotate(" + 6 * x + ")"), x % 5 == 0 ? (w.setAttribute("x1", "38"), w.setAttribute("x2", "46"), w.setAttribute("stroke-width", x % 15 == 0 ? "2" : "1")) : (w.setAttribute("x1", "42"), w.setAttribute("x2", "46"), w.setAttribute("stroke-width", "0.5")), b.append(w) } var O = document.createElementNS(t, "g"); O.setAttribute("class", "hour-hand"), O.setAttribute("transform", "translate(50 50)"); var k = document.createElementNS(t, "line"); k.setAttribute("class", "hour-hand-a"), k.setAttribute("x1", "0"), k.setAttribute("y1", "0"), k.setAttribute("x2", "30"), k.setAttribute("y2", "0"), k.setAttribute("stroke", o), k.setAttribute("stroke-width", "4"), k.setAttribute("stroke-linecap", "round"); var M = document.createElementNS(t, "line"); M.setAttribute("class", "hour-hand-b"), M.setAttribute("x1", "0"), M.setAttribute("y1", "0"), M.setAttribute("x2", "29.9"), M.setAttribute("y2", "0"), M.setAttribute("stroke", s), M.setAttribute("stroke-width", "3.1"), M.setAttribute("stroke-linecap", "round"), O.append(k, M); var A = document.createElementNS(t, "g"); A.setAttribute("class", "minute-hand"), A.setAttribute("transform", "translate(50 50)"); var j = document.createElementNS(t, "line"); j.setAttribute("class", "minute-hand-a"), j.setAttribute("x1", "0"), j.setAttribute("y1", "0"), j.setAttribute("x2", "40"), j.setAttribute("y2", "0"), j.setAttribute("stroke", o), j.setAttribute("stroke-width", "2"), j.setAttribute("stroke-linecap", "round"); var T = document.createElementNS(t, "line"); T.setAttribute("class", "minute-hand-b"), T.setAttribute("x1", "0"), T.setAttribute("y1", "0"), T.setAttribute("x2", "39.9"), T.setAttribute("y2", "0"), T.setAttribute("stroke", s), T.setAttribute("stroke-width", "1.5"), T.setAttribute("stroke-linecap", "round"); var C = document.createElementNS(t, "circle"); C.setAttribute("r", "3"), C.setAttribute("fill", s), A.append(j, T, C); var P = document.createElementNS(t, "g"); P.setAttribute("class", "second-hand"), P.setAttribute("transform", "translate(50 50)"); var S = document.createElementNS(t, "line"); S.setAttribute("x1", "0"), S.setAttribute("y1", "0"), S.setAttribute("x2", "46"), S.setAttribute("y2", "0"), S.setAttribute("stroke", a), S.setAttribute("stroke-width", "1"), S.setAttribute("stroke-linecap", "round"); var I = document.createElementNS(t, "circle"); I.setAttribute("r", "2"), I.setAttribute("fill", a), P.append(S, I); var L = document.createElementNS(t, "circle"); L.setAttribute("cx", "50"), L.setAttribute("cy", "50"), L.setAttribute("r", "0.3"), L.setAttribute("fill", s); var R = this.getOriginDate(), N = R.getSeconds(), D = R.getMinutes(), z = 6 * N, B = 6 * D + N / 60 * 6, H = 30 * R.getHours() + D / 60 * 30; if (O.setAttribute("transform", "translate(50 50) rotate(" + H + ")"), A.setAttribute("transform", "translate(50 50) rotate(" + B + ")"), P.setAttribute("transform", "translate(50 50) rotate(" + z + ")"), d.append(m, b, O, A, P, L), d.setAttribute("transform", "rotate(-90)"), h.innerHTML = "\n <style>\n @keyframes rotate-hour {\n from {\n " + Object(r.p)("transform", "translate(50px, 50px) rotate(" + H + "deg)").join("\n") + "\n }\n to {\n " + Object(r.p)("transform", "translate(50px, 50px) rotate(" + (H + 360) + "deg)").join("\n") + "\n }\n }\n @keyframes rotate-minute {\n from {\n " + Object(r.p)("transform", "translate(50px, 50px) rotate(" + B + "deg)").join("\n") + "\n }\n to {\n " + Object(r.p)("transform", "translate(50px, 50px) rotate(" + (B + 360) + "deg)").join("\n") + "\n }\n }\n @keyframes rotate-second {\n from {\n " + Object(r.p)("transform", "translate(50px, 50px) rotate(" + z + "deg)").join("\n") + "\n }\n to {\n " + Object(r.p)("transform", "translate(50px, 50px) rotate(" + (z + 360) + "deg)").join("\n") + "\n }\n }\n </style>\n ", h.append(d), "datetime" === this.props.clockFormat) { var G = document.createElement("span"); G.className = "date", G.textContent = Object(r.f)(R, "default"), G.style.fontSize = p + "px", this.props.color && (G.style.color = this.props.color), h.append(G) } return h }, e.prototype.createDigitalClock = function () { var t = document.createElement("div"); t.className = "digital-clock"; var e = this.getElementSize().width, n = 6 / this.props.clockTimezone.length, i = 20 * e / 100, s = 10 * e / 100, o = Math.min(20 * n * e / 100, e / 100 * 10), a = this.getOriginDate(); if ("datetime" === this.props.clockFormat) { var l = document.createElement("span"); l.className = "date", l.textContent = Object(r.f)(a, "default"), l.style.fontSize = s + "px", this.props.color && (l.style.color = this.props.color), t.append(l) } var c = document.createElement("span"); c.className = "time", c.textContent = Object(r.g)(a), c.style.fontSize = i + "px", this.props.color && (c.style.color = this.props.color), t.append(c); var u = this.getHumanTimezone(); if (u.length > 0) { var p = document.createElement("span"); p.className = "timezone", p.textContent = u, p.style.fontSize = o + "px", this.props.color && (p.style.color = this.props.color), t.append(p) } return t }, e.prototype.getOriginDate = function (t) { void 0 === t && (t = null); var e = t || new Date, n = 1e3 * this.props.clockTimezoneOffset, i = 60 * e.getTimezoneOffset() * 1e3, r = e.getTime() + n + i; return new Date(r) }, e.prototype.getHumanTimezone = function (t) { void 0 === t && (t = this.props.clockTimezone); var e = t.split("/")[1]; return (void 0 === e ? "" : e).replace("_", " ") }, e.prototype.getElementSize = function (t, e) { switch (void 0 === t && (t = this.props.width), void 0 === e && (e = this.props.height), this.props.clockType) { case "analogic": var n = 100; t > 0 && e > 0 ? n = Math.min(t, e) : t > 0 ? n = t : e > 0 && (n = e); var i = 0; return "datetime" === this.props.clockFormat && (i = e / 8), { width: n, height: n + i }; case "digital": return t > 0 && e > 0 ? e = t / 2 < e ? t / 2 : e : t > 0 ? e = t / 2 : e > 0 ? t = 2 * e : (t = 100, e = 50), { width: t, height: e }; default: throw new Error("invalid clock type.") } }, e.TICK_INTERVAL = 1e3, e }(s.a), q = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), K = function () { return (K = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function Y(t) { return K({}, Object(s.b)(t), { type: 12, label: null, isLinkEnabled: !1, parentId: null, aclGroupId: null, borderWidth: Object(r.n)(t.borderWidth, 0), borderColor: Object(r.k)(t.borderColor, null), fillColor: Object(r.k)(t.fillColor, null), fillTransparent: t.fillTransparent }) } var X = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return q(e, t), e.prototype.createDomElement = function () { var t = document.createElement("div"); if (t.className = "box", t.style.boxSizing = "border-box", this.props.fillTransparent ? t.style.backgroundColor = "transparent" : this.props.fillColor && (t.style.backgroundColor = this.props.fillColor), this.props.borderWidth > 0) { t.style.borderStyle = "solid"; var e = Math.min(this.props.width, this.props.height) / 2, n = Math.min(this.props.borderWidth, e); t.style.borderWidth = n + "px", this.props.borderColor && (t.style.borderColor = this.props.borderColor) } return t }, e.prototype.updateDomElement = function (t) { if (this.props.fillTransparent ? t.style.backgroundColor = "transparent" : this.props.fillColor && (t.style.backgroundColor = this.props.fillColor), this.props.borderWidth > 0) { t.style.borderStyle = "solid"; var e = Math.min(this.props.width, this.props.height) / 2, n = Math.min(this.props.borderWidth, e); t.style.borderWidth = n + "px", this.props.borderColor && (t.style.borderColor = this.props.borderColor) } }, e }(s.a), J = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), Z = function () { return (Z = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function Q(t) { return Z({}, Object(s.b)(t), { type: 4 }, Object(r.i)(t)) } var $ = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return J(e, t), e.prototype.createDomElement = function () { var t = document.createElement("div"); return t.className = "label", t.innerHTML = this.getLabelWithMacrosReplaced(), t }, e.prototype.createLabelDomElement = function () { var t = document.createElement("div"); return t.className = "visual-console-item-label", t }, e }(s.a), tt = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), et = function () { return (et = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }, nt = function (t) { switch (t) { case "string": case "image": return t; default: return "string" } }, it = function (t) { switch (t) { case "none": case "avg": case "max": case "min": return t; default: return "none" } }; function rt(t) { if ("string" != typeof t.value || 0 === t.value.length) throw new TypeError("invalid value"); var e = it(t.processValue); return et({}, Object(s.b)(t), { type: 2, valueType: nt(t.valueType), value: t.value }, "none" === e ? { processValue: e } : { processValue: e, period: Object(r.n)(t.period, 0) }, Object(r.j)(t), Object(r.i)(t)) } var st = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return tt(e, t), e.prototype.createDomElement = function () { var t = document.createElement("div"); if (t.className = "simple-value", !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || (t.style.opacity = "0.2"), "image" === this.props.valueType) { var e = document.createElement("img"); e.src = this.props.value, t.append(e) } else { var n = this.props.value, i = this.getLabelWithMacrosReplaced(); i.length > 0 && (n = Object(r.q)([{ macro: /\(?_VALUE_\)?/i, value: n }], i)), t.innerHTML = n } return t }, e.prototype.createLabelDomElement = function () { var t = document.createElement("div"); return t.className = "visual-console-item-label", t }, e }(s.a), ot = n(6), at = Math.PI, lt = 2 * at, ct = lt - 1e-6; function ut() { this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "" } function pt() { return new ut } ut.prototype = pt.prototype = { constructor: ut, moveTo: function (t, e) { this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +e) }, closePath: function () { null !== this._x1 && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z") }, lineTo: function (t, e) { this._ += "L" + (this._x1 = +t) + "," + (this._y1 = +e) }, quadraticCurveTo: function (t, e, n, i) { this._ += "Q" + +t + "," + +e + "," + (this._x1 = +n) + "," + (this._y1 = +i) }, bezierCurveTo: function (t, e, n, i, r, s) { this._ += "C" + +t + "," + +e + "," + +n + "," + +i + "," + (this._x1 = +r) + "," + (this._y1 = +s) }, arcTo: function (t, e, n, i, r) { t = +t, e = +e, n = +n, i = +i, r = +r; var s = this._x1, o = this._y1, a = n - t, l = i - e, c = s - t, u = o - e, p = c * c + u * u; if (r < 0) throw new Error("negative radius: " + r); if (null === this._x1) this._ += "M" + (this._x1 = t) + "," + (this._y1 = e); else if (p > 1e-6) if (Math.abs(u * a - l * c) > 1e-6 && r) { var h = n - s, d = i - o, m = a * a + l * l, f = h * h + d * d, _ = Math.sqrt(m), y = Math.sqrt(p), b = r * Math.tan((at - Math.acos((m + p - f) / (2 * _ * y))) / 2), v = b / y, g = b / _; Math.abs(v - 1) > 1e-6 && (this._ += "L" + (t + v * c) + "," + (e + v * u)), this._ += "A" + r + "," + r + ",0,0," + +(u * h > c * d) + "," + (this._x1 = t + g * a) + "," + (this._y1 = e + g * l) } else this._ += "L" + (this._x1 = t) + "," + (this._y1 = e); else; }, arc: function (t, e, n, i, r, s) { t = +t, e = +e; var o = (n = +n) * Math.cos(i), a = n * Math.sin(i), l = t + o, c = e + a, u = 1 ^ s, p = s ? i - r : r - i; if (n < 0) throw new Error("negative radius: " + n); null === this._x1 ? this._ += "M" + l + "," + c : (Math.abs(this._x1 - l) > 1e-6 || Math.abs(this._y1 - c) > 1e-6) && (this._ += "L" + l + "," + c), n && (p < 0 && (p = p % lt + lt), p > ct ? this._ += "A" + n + "," + n + ",0,1," + u + "," + (t - o) + "," + (e - a) + "A" + n + "," + n + ",0,1," + u + "," + (this._x1 = l) + "," + (this._y1 = c) : p > 1e-6 && (this._ += "A" + n + "," + n + ",0," + +(p >= at) + "," + u + "," + (this._x1 = t + n * Math.cos(r)) + "," + (this._y1 = e + n * Math.sin(r)))) }, rect: function (t, e, n, i) { this._ += "M" + (this._x0 = this._x1 = +t) + "," + (this._y0 = this._y1 = +e) + "h" + +n + "v" + +i + "h" + -n + "Z" }, toString: function () { return this._ } }; var ht = pt, dt = function (t) { return function () { return t } }, mt = Math.abs, ft = Math.atan2, _t = Math.cos, yt = Math.max, bt = Math.min, vt = Math.sin, gt = Math.sqrt, Et = 1e-12, xt = Math.PI, wt = xt / 2, Ot = 2 * xt; function kt(t) { return t >= 1 ? wt : t <= -1 ? -wt : Math.asin(t) } function Mt(t) { return t.innerRadius } function At(t) { return t.outerRadius } function jt(t) { return t.startAngle } function Tt(t) { return t.endAngle } function Ct(t) { return t && t.padAngle } function Pt(t, e, n, i, r, s, o) { var a = t - n, l = e - i, c = (o ? s : -s) / gt(a * a + l * l), u = c * l, p = -c * a, h = t + u, d = e + p, m = n + u, f = i + p, _ = (h + m) / 2, y = (d + f) / 2, b = m - h, v = f - d, g = b * b + v * v, E = r - s, x = h * f - m * d, w = (v < 0 ? -1 : 1) * gt(yt(0, E * E * g - x * x)), O = (x * v - b * w) / g, k = (-x * b - v * w) / g, M = (x * v + b * w) / g, A = (-x * b + v * w) / g, j = O - _, T = k - y, C = M - _, P = A - y; return j * j + T * T > C * C + P * P && (O = M, k = A), { cx: O, cy: k, x01: -u, y01: -p, x11: O * (r / E - 1), y11: k * (r / E - 1) } } var St = function () { var t = Mt, e = At, n = dt(0), i = null, r = jt, s = Tt, o = Ct, a = null; function l() { var l, c, u, p = +t.apply(this, arguments), h = +e.apply(this, arguments), d = r.apply(this, arguments) - wt, m = s.apply(this, arguments) - wt, f = mt(m - d), _ = m > d; if (a || (a = l = ht()), h < p && (c = h, h = p, p = c), h > Et) if (f > Ot - Et) a.moveTo(h * _t(d), h * vt(d)), a.arc(0, 0, h, d, m, !_), p > Et && (a.moveTo(p * _t(m), p * vt(m)), a.arc(0, 0, p, m, d, _)); else { var y, b, v = d, g = m, E = d, x = m, w = f, O = f, k = o.apply(this, arguments) / 2, M = k > Et && (i ? +i.apply(this, arguments) : gt(p * p + h * h)), A = bt(mt(h - p) / 2, +n.apply(this, arguments)), j = A, T = A; if (M > Et) { var C = kt(M / p * vt(k)), P = kt(M / h * vt(k)); (w -= 2 * C) > Et ? (E += C *= _ ? 1 : -1, x -= C) : (w = 0, E = x = (d + m) / 2), (O -= 2 * P) > Et ? (v += P *= _ ? 1 : -1, g -= P) : (O = 0, v = g = (d + m) / 2) } var S = h * _t(v), I = h * vt(v), L = p * _t(x), R = p * vt(x); if (A > Et) { var N, D = h * _t(g), z = h * vt(g), B = p * _t(E), H = p * vt(E); if (f < xt && (N = function (t, e, n, i, r, s, o, a) { var l = n - t, c = i - e, u = o - r, p = a - s, h = p * l - u * c; if (!(h * h < Et)) return [t + (h = (u * (e - s) - p * (t - r)) / h) * l, e + h * c] }(S, I, B, H, D, z, L, R))) { var G = S - N[0], W = I - N[1], F = D - N[0], U = z - N[1], V = 1 / vt(((u = (G * F + W * U) / (gt(G * G + W * W) * gt(F * F + U * U))) > 1 ? 0 : u < -1 ? xt : Math.acos(u)) / 2), q = gt(N[0] * N[0] + N[1] * N[1]); j = bt(A, (p - q) / (V - 1)), T = bt(A, (h - q) / (V + 1)) } } O > Et ? T > Et ? (y = Pt(B, H, S, I, h, T, _), b = Pt(D, z, L, R, h, T, _), a.moveTo(y.cx + y.x01, y.cy + y.y01), T < A ? a.arc(y.cx, y.cy, T, ft(y.y01, y.x01), ft(b.y01, b.x01), !_) : (a.arc(y.cx, y.cy, T, ft(y.y01, y.x01), ft(y.y11, y.x11), !_), a.arc(0, 0, h, ft(y.cy + y.y11, y.cx + y.x11), ft(b.cy + b.y11, b.cx + b.x11), !_), a.arc(b.cx, b.cy, T, ft(b.y11, b.x11), ft(b.y01, b.x01), !_))) : (a.moveTo(S, I), a.arc(0, 0, h, v, g, !_)) : a.moveTo(S, I), p > Et && w > Et ? j > Et ? (y = Pt(L, R, D, z, p, -j, _), b = Pt(S, I, B, H, p, -j, _), a.lineTo(y.cx + y.x01, y.cy + y.y01), j < A ? a.arc(y.cx, y.cy, j, ft(y.y01, y.x01), ft(b.y01, b.x01), !_) : (a.arc(y.cx, y.cy, j, ft(y.y01, y.x01), ft(y.y11, y.x11), !_), a.arc(0, 0, p, ft(y.cy + y.y11, y.cx + y.x11), ft(b.cy + b.y11, b.cx + b.x11), _), a.arc(b.cx, b.cy, j, ft(b.y11, b.x11), ft(b.y01, b.x01), !_))) : a.arc(0, 0, p, x, E, _) : a.lineTo(L, R) } else a.moveTo(0, 0); if (a.closePath(), l) return a = null, l + "" || null } return l.centroid = function () { var n = (+t.apply(this, arguments) + +e.apply(this, arguments)) / 2, i = (+r.apply(this, arguments) + +s.apply(this, arguments)) / 2 - xt / 2; return [_t(i) * n, vt(i) * n] }, l.innerRadius = function (e) { return arguments.length ? (t = "function" == typeof e ? e : dt(+e), l) : t }, l.outerRadius = function (t) { return arguments.length ? (e = "function" == typeof t ? t : dt(+t), l) : e }, l.cornerRadius = function (t) { return arguments.length ? (n = "function" == typeof t ? t : dt(+t), l) : n }, l.padRadius = function (t) { return arguments.length ? (i = null == t ? null : "function" == typeof t ? t : dt(+t), l) : i }, l.startAngle = function (t) { return arguments.length ? (r = "function" == typeof t ? t : dt(+t), l) : r }, l.endAngle = function (t) { return arguments.length ? (s = "function" == typeof t ? t : dt(+t), l) : s }, l.padAngle = function (t) { return arguments.length ? (o = "function" == typeof t ? t : dt(+t), l) : o }, l.context = function (t) { return arguments.length ? (a = null == t ? null : t, l) : a }, l }; function It(t) { this._context = t } It.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._point = 0 }, lineEnd: function () { (this._line || 0 !== this._line && 1 === this._point) && this._context.closePath(), this._line = 1 - this._line }, point: function (t, e) { switch (t = +t, e = +e, this._point) { case 0: this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); break; case 1: this._point = 2; default: this._context.lineTo(t, e) } } }; var Lt = function (t) { return new It(t) }; Nt(Lt); function Rt(t) { this._curve = t } function Nt(t) { function e(e) { return new Rt(t(e)) } return e._curve = t, e } Rt.prototype = { areaStart: function () { this._curve.areaStart() }, areaEnd: function () { this._curve.areaEnd() }, lineStart: function () { this._curve.lineStart() }, lineEnd: function () { this._curve.lineEnd() }, point: function (t, e) { this._curve.point(e * Math.sin(t), e * -Math.cos(t)) } }; Array.prototype.slice; Math.sqrt(1 / 3); var Dt = Math.sin(xt / 10) / Math.sin(7 * xt / 10), zt = (Math.sin(Ot / 10), Math.cos(Ot / 10), Math.sqrt(3), Math.sqrt(3), Math.sqrt(12), function () { }); function Bt(t, e, n) { t._context.bezierCurveTo((2 * t._x0 + t._x1) / 3, (2 * t._y0 + t._y1) / 3, (t._x0 + 2 * t._x1) / 3, (t._y0 + 2 * t._y1) / 3, (t._x0 + 4 * t._x1 + e) / 6, (t._y0 + 4 * t._y1 + n) / 6) } function Ht(t) { this._context = t } Ht.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0 }, lineEnd: function () { switch (this._point) { case 3: Bt(this, this._x1, this._y1); case 2: this._context.lineTo(this._x1, this._y1) }(this._line || 0 !== this._line && 1 === this._point) && this._context.closePath(), this._line = 1 - this._line }, point: function (t, e) { switch (t = +t, e = +e, this._point) { case 0: this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); break; case 1: this._point = 2; break; case 2: this._point = 3, this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); default: Bt(this, t, e) }this._x0 = this._x1, this._x1 = t, this._y0 = this._y1, this._y1 = e } }; function Gt(t) { this._context = t } Gt.prototype = { areaStart: zt, areaEnd: zt, lineStart: function () { this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN, this._point = 0 }, lineEnd: function () { switch (this._point) { case 1: this._context.moveTo(this._x2, this._y2), this._context.closePath(); break; case 2: this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3), this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3), this._context.closePath(); break; case 3: this.point(this._x2, this._y2), this.point(this._x3, this._y3), this.point(this._x4, this._y4) } }, point: function (t, e) { switch (t = +t, e = +e, this._point) { case 0: this._point = 1, this._x2 = t, this._y2 = e; break; case 1: this._point = 2, this._x3 = t, this._y3 = e; break; case 2: this._point = 3, this._x4 = t, this._y4 = e, this._context.moveTo((this._x0 + 4 * this._x1 + t) / 6, (this._y0 + 4 * this._y1 + e) / 6); break; default: Bt(this, t, e) }this._x0 = this._x1, this._x1 = t, this._y0 = this._y1, this._y1 = e } }; function Wt(t) { this._context = t } Wt.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x0 = this._x1 = this._y0 = this._y1 = NaN, this._point = 0 }, lineEnd: function () { (this._line || 0 !== this._line && 3 === this._point) && this._context.closePath(), this._line = 1 - this._line }, point: function (t, e) { switch (t = +t, e = +e, this._point) { case 0: this._point = 1; break; case 1: this._point = 2; break; case 2: this._point = 3; var n = (this._x0 + 4 * this._x1 + t) / 6, i = (this._y0 + 4 * this._y1 + e) / 6; this._line ? this._context.lineTo(n, i) : this._context.moveTo(n, i); break; case 3: this._point = 4; default: Bt(this, t, e) }this._x0 = this._x1, this._x1 = t, this._y0 = this._y1, this._y1 = e } }; function Ft(t, e) { this._basis = new Ht(t), this._beta = e } Ft.prototype = { lineStart: function () { this._x = [], this._y = [], this._basis.lineStart() }, lineEnd: function () { var t = this._x, e = this._y, n = t.length - 1; if (n > 0) for (var i, r = t[0], s = e[0], o = t[n] - r, a = e[n] - s, l = -1; ++l <= n;)i = l / n, this._basis.point(this._beta * t[l] + (1 - this._beta) * (r + i * o), this._beta * e[l] + (1 - this._beta) * (s + i * a)); this._x = this._y = null, this._basis.lineEnd() }, point: function (t, e) { this._x.push(+t), this._y.push(+e) } }; (function t(e) { function n(t) { return 1 === e ? new Ht(t) : new Ft(t, e) } return n.beta = function (e) { return t(+e) }, n })(.85); function Ut(t, e, n) { t._context.bezierCurveTo(t._x1 + t._k * (t._x2 - t._x0), t._y1 + t._k * (t._y2 - t._y0), t._x2 + t._k * (t._x1 - e), t._y2 + t._k * (t._y1 - n), t._x2, t._y2) } function Vt(t, e) { this._context = t, this._k = (1 - e) / 6 } Vt.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0 }, lineEnd: function () { switch (this._point) { case 2: this._context.lineTo(this._x2, this._y2); break; case 3: Ut(this, this._x1, this._y1) }(this._line || 0 !== this._line && 1 === this._point) && this._context.closePath(), this._line = 1 - this._line }, point: function (t, e) { switch (t = +t, e = +e, this._point) { case 0: this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); break; case 1: this._point = 2, this._x1 = t, this._y1 = e; break; case 2: this._point = 3; default: Ut(this, t, e) }this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e } }; (function t(e) { function n(t) { return new Vt(t, e) } return n.tension = function (e) { return t(+e) }, n })(0); function qt(t, e) { this._context = t, this._k = (1 - e) / 6 } qt.prototype = { areaStart: zt, areaEnd: zt, lineStart: function () { this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._point = 0 }, lineEnd: function () { switch (this._point) { case 1: this._context.moveTo(this._x3, this._y3), this._context.closePath(); break; case 2: this._context.lineTo(this._x3, this._y3), this._context.closePath(); break; case 3: this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5) } }, point: function (t, e) { switch (t = +t, e = +e, this._point) { case 0: this._point = 1, this._x3 = t, this._y3 = e; break; case 1: this._point = 2, this._context.moveTo(this._x4 = t, this._y4 = e); break; case 2: this._point = 3, this._x5 = t, this._y5 = e; break; default: Ut(this, t, e) }this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e } }; (function t(e) { function n(t) { return new qt(t, e) } return n.tension = function (e) { return t(+e) }, n })(0); function Kt(t, e) { this._context = t, this._k = (1 - e) / 6 } Kt.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._point = 0 }, lineEnd: function () { (this._line || 0 !== this._line && 3 === this._point) && this._context.closePath(), this._line = 1 - this._line }, point: function (t, e) { switch (t = +t, e = +e, this._point) { case 0: this._point = 1; break; case 1: this._point = 2; break; case 2: this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; case 3: this._point = 4; default: Ut(this, t, e) }this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e } }; (function t(e) { function n(t) { return new Kt(t, e) } return n.tension = function (e) { return t(+e) }, n })(0); function Yt(t, e, n) { var i = t._x1, r = t._y1, s = t._x2, o = t._y2; if (t._l01_a > Et) { var a = 2 * t._l01_2a + 3 * t._l01_a * t._l12_a + t._l12_2a, l = 3 * t._l01_a * (t._l01_a + t._l12_a); i = (i * a - t._x0 * t._l12_2a + t._x2 * t._l01_2a) / l, r = (r * a - t._y0 * t._l12_2a + t._y2 * t._l01_2a) / l } if (t._l23_a > Et) { var c = 2 * t._l23_2a + 3 * t._l23_a * t._l12_a + t._l12_2a, u = 3 * t._l23_a * (t._l23_a + t._l12_a); s = (s * c + t._x1 * t._l23_2a - e * t._l12_2a) / u, o = (o * c + t._y1 * t._l23_2a - n * t._l12_2a) / u } t._context.bezierCurveTo(i, r, s, o, t._x2, t._y2) } function Xt(t, e) { this._context = t, this._alpha = e } Xt.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0 }, lineEnd: function () { switch (this._point) { case 2: this._context.lineTo(this._x2, this._y2); break; case 3: this.point(this._x2, this._y2) }(this._line || 0 !== this._line && 1 === this._point) && this._context.closePath(), this._line = 1 - this._line }, point: function (t, e) { if (t = +t, e = +e, this._point) { var n = this._x2 - t, i = this._y2 - e; this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + i * i, this._alpha)) } switch (this._point) { case 0: this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); break; case 1: this._point = 2; break; case 2: this._point = 3; default: Yt(this, t, e) }this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e } }; (function t(e) { function n(t) { return e ? new Xt(t, e) : new Vt(t, 0) } return n.alpha = function (e) { return t(+e) }, n })(.5); function Jt(t, e) { this._context = t, this._alpha = e } Jt.prototype = { areaStart: zt, areaEnd: zt, lineStart: function () { this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 = this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0 }, lineEnd: function () { switch (this._point) { case 1: this._context.moveTo(this._x3, this._y3), this._context.closePath(); break; case 2: this._context.lineTo(this._x3, this._y3), this._context.closePath(); break; case 3: this.point(this._x3, this._y3), this.point(this._x4, this._y4), this.point(this._x5, this._y5) } }, point: function (t, e) { if (t = +t, e = +e, this._point) { var n = this._x2 - t, i = this._y2 - e; this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + i * i, this._alpha)) } switch (this._point) { case 0: this._point = 1, this._x3 = t, this._y3 = e; break; case 1: this._point = 2, this._context.moveTo(this._x4 = t, this._y4 = e); break; case 2: this._point = 3, this._x5 = t, this._y5 = e; break; default: Yt(this, t, e) }this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e } }; (function t(e) { function n(t) { return e ? new Jt(t, e) : new qt(t, 0) } return n.alpha = function (e) { return t(+e) }, n })(.5); function Zt(t, e) { this._context = t, this._alpha = e } Zt.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x0 = this._x1 = this._x2 = this._y0 = this._y1 = this._y2 = NaN, this._l01_a = this._l12_a = this._l23_a = this._l01_2a = this._l12_2a = this._l23_2a = this._point = 0 }, lineEnd: function () { (this._line || 0 !== this._line && 3 === this._point) && this._context.closePath(), this._line = 1 - this._line }, point: function (t, e) { if (t = +t, e = +e, this._point) { var n = this._x2 - t, i = this._y2 - e; this._l23_a = Math.sqrt(this._l23_2a = Math.pow(n * n + i * i, this._alpha)) } switch (this._point) { case 0: this._point = 1; break; case 1: this._point = 2; break; case 2: this._point = 3, this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break; case 3: this._point = 4; default: Yt(this, t, e) }this._l01_a = this._l12_a, this._l12_a = this._l23_a, this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a, this._x0 = this._x1, this._x1 = this._x2, this._x2 = t, this._y0 = this._y1, this._y1 = this._y2, this._y2 = e } }; (function t(e) { function n(t) { return e ? new Zt(t, e) : new Kt(t, 0) } return n.alpha = function (e) { return t(+e) }, n })(.5); function Qt(t) { this._context = t } Qt.prototype = { areaStart: zt, areaEnd: zt, lineStart: function () { this._point = 0 }, lineEnd: function () { this._point && this._context.closePath() }, point: function (t, e) { t = +t, e = +e, this._point ? this._context.lineTo(t, e) : (this._point = 1, this._context.moveTo(t, e)) } }; function $t(t) { return t < 0 ? -1 : 1 } function te(t, e, n) { var i = t._x1 - t._x0, r = e - t._x1, s = (t._y1 - t._y0) / (i || r < 0 && -0), o = (n - t._y1) / (r || i < 0 && -0), a = (s * r + o * i) / (i + r); return ($t(s) + $t(o)) * Math.min(Math.abs(s), Math.abs(o), .5 * Math.abs(a)) || 0 } function ee(t, e) { var n = t._x1 - t._x0; return n ? (3 * (t._y1 - t._y0) / n - e) / 2 : e } function ne(t, e, n) { var i = t._x0, r = t._y0, s = t._x1, o = t._y1, a = (s - i) / 3; t._context.bezierCurveTo(i + a, r + a * e, s - a, o - a * n, s, o) } function ie(t) { this._context = t } function re(t) { this._context = new se(t) } function se(t) { this._context = t } function oe(t) { this._context = t } function ae(t) { var e, n, i = t.length - 1, r = new Array(i), s = new Array(i), o = new Array(i); for (r[0] = 0, s[0] = 2, o[0] = t[0] + 2 * t[1], e = 1; e < i - 1; ++e)r[e] = 1, s[e] = 4, o[e] = 4 * t[e] + 2 * t[e + 1]; for (r[i - 1] = 2, s[i - 1] = 7, o[i - 1] = 8 * t[i - 1] + t[i], e = 1; e < i; ++e)n = r[e] / s[e - 1], s[e] -= n, o[e] -= n * o[e - 1]; for (r[i - 1] = o[i - 1] / s[i - 1], e = i - 2; e >= 0; --e)r[e] = (o[e] - r[e + 1]) / s[e]; for (s[i - 1] = (t[i] + r[i - 1]) / 2, e = 0; e < i - 1; ++e)s[e] = 2 * t[e + 1] - r[e + 1]; return [r, s] } ie.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x0 = this._x1 = this._y0 = this._y1 = this._t0 = NaN, this._point = 0 }, lineEnd: function () { switch (this._point) { case 2: this._context.lineTo(this._x1, this._y1); break; case 3: ne(this, this._t0, ee(this, this._t0)) }(this._line || 0 !== this._line && 1 === this._point) && this._context.closePath(), this._line = 1 - this._line }, point: function (t, e) { var n = NaN; if (e = +e, (t = +t) !== this._x1 || e !== this._y1) { switch (this._point) { case 0: this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); break; case 1: this._point = 2; break; case 2: this._point = 3, ne(this, ee(this, n = te(this, t, e)), n); break; default: ne(this, this._t0, n = te(this, t, e)) }this._x0 = this._x1, this._x1 = t, this._y0 = this._y1, this._y1 = e, this._t0 = n } } }, (re.prototype = Object.create(ie.prototype)).point = function (t, e) { ie.prototype.point.call(this, e, t) }, se.prototype = { moveTo: function (t, e) { this._context.moveTo(e, t) }, closePath: function () { this._context.closePath() }, lineTo: function (t, e) { this._context.lineTo(e, t) }, bezierCurveTo: function (t, e, n, i, r, s) { this._context.bezierCurveTo(e, t, i, n, s, r) } }, oe.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x = [], this._y = [] }, lineEnd: function () { var t = this._x, e = this._y, n = t.length; if (n) if (this._line ? this._context.lineTo(t[0], e[0]) : this._context.moveTo(t[0], e[0]), 2 === n) this._context.lineTo(t[1], e[1]); else for (var i = ae(t), r = ae(e), s = 0, o = 1; o < n; ++s, ++o)this._context.bezierCurveTo(i[0][s], r[0][s], i[1][s], r[1][s], t[o], e[o]); (this._line || 0 !== this._line && 1 === n) && this._context.closePath(), this._line = 1 - this._line, this._x = this._y = null }, point: function (t, e) { this._x.push(+t), this._y.push(+e) } }; function le(t, e) { this._context = t, this._t = e } le.prototype = { areaStart: function () { this._line = 0 }, areaEnd: function () { this._line = NaN }, lineStart: function () { this._x = this._y = NaN, this._point = 0 }, lineEnd: function () { 0 < this._t && this._t < 1 && 2 === this._point && this._context.lineTo(this._x, this._y), (this._line || 0 !== this._line && 1 === this._point) && this._context.closePath(), this._line >= 0 && (this._t = 1 - this._t, this._line = 1 - this._line) }, point: function (t, e) { switch (t = +t, e = +e, this._point) { case 0: this._point = 1, this._line ? this._context.lineTo(t, e) : this._context.moveTo(t, e); break; case 1: this._point = 2; default: if (this._t <= 0) this._context.lineTo(this._x, e), this._context.lineTo(t, e); else { var n = this._x * (1 - this._t) + t * this._t; this._context.lineTo(n, this._y), this._context.lineTo(n, e) } }this._x = t, this._y = e } }; var ce = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), ue = function () { return (ue = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function pe(t) { switch (t) { case "progress-bar": case "bubble": case "circular-progress-bar": case "circular-progress-bar-alt": return t; default: case 3: return "progress-bar"; case 9: return "bubble"; case 15: return "circular-progress-bar"; case 16: return "circular-progress-bar-alt" } } function he(t) { switch (t) { case "percent": case "value": return t; default: return "percent" } } function de(t) { return ue({}, Object(s.b)(t), { type: 3, percentileType: pe(t.percentileType || t.type), valueType: he(t.valueType), minValue: Object(r.n)(t.minValue, null), maxValue: Object(r.n)(t.maxValue, null), color: Object(r.k)(t.color, null), labelColor: Object(r.k)(t.labelColor, null), value: Object(r.m)(t.value, null), unit: Object(r.k)(t.unit, null) }, Object(r.j)(t), Object(r.i)(t)) } var me = "http://www.w3.org/2000/svg", fe = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return ce(e, t), e.prototype.createDomElement = function () { var t, e = { background: "#000000", progress: this.props.color || "#F0F0F0", text: this.props.labelColor || "#444444" }, n = this.getProgress(), i = document.createElement("div"); null != this.props.value && (t = Intl ? Intl.NumberFormat("en-EN").format(this.props.value) : this.props.value); var r = document.createElementNS(me, "svg"); switch (this.props.percentileType) { case "progress-bar": var s = document.createElementNS(me, "rect"); s.setAttribute("fill", e.background), s.setAttribute("fill-opacity", "0.5"), s.setAttribute("width", "100%"), s.setAttribute("height", "100%"), s.setAttribute("rx", "5"), s.setAttribute("ry", "5"); var o = document.createElementNS(me, "rect"); o.setAttribute("fill", e.progress), o.setAttribute("fill-opacity", "1"), o.setAttribute("width", n + "%"), o.setAttribute("height", "100%"), o.setAttribute("rx", "5"), o.setAttribute("ry", "5"), (p = document.createElementNS(me, "text")).setAttribute("text-anchor", "middle"), p.setAttribute("alignment-baseline", "middle"), p.setAttribute("font-size", "15"), p.setAttribute("font-weight", "bold"), p.setAttribute("transform", "translate(" + this.props.width / 2 + ", 17.5)"), p.setAttribute("fill", e.text), "value" === this.props.valueType ? (p.style.fontSize = "6pt", p.textContent = this.props.unit ? t + " " + this.props.unit : "" + t) : p.textContent = n + "%", r.setAttribute("width", "100%"), r.setAttribute("height", "100%"), r.append(s, o, p); break; case "bubble": case "circular-progress-bar": case "circular-progress-bar-alt": if (r.setAttribute("viewBox", "0 0 100 100"), "bubble" === this.props.percentileType) { (a = document.createElementNS(me, "circle")).setAttribute("transform", "translate(50 50)"), a.setAttribute("fill", e.background), a.setAttribute("fill-opacity", "0.5"), a.setAttribute("r", "50"), (l = document.createElementNS(me, "circle")).setAttribute("transform", "translate(50 50)"), l.setAttribute("fill", e.progress), l.setAttribute("fill-opacity", "1"), l.setAttribute("r", "" + n / 2), r.append(a, l) } else { var a, l, c = { innerRadius: "circular-progress-bar" === this.props.percentileType ? 30 : 0, outerRadius: 50, startAngle: 0, endAngle: 2 * Math.PI }, u = St(); (a = document.createElementNS(me, "path")).setAttribute("transform", "translate(50 50)"), a.setAttribute("fill", e.background), a.setAttribute("fill-opacity", "0.5"), a.setAttribute("d", "" + u(c)), (l = document.createElementNS(me, "path")).setAttribute("transform", "translate(50 50)"), l.setAttribute("fill", e.progress), l.setAttribute("fill-opacity", "1"), l.setAttribute("d", "" + u(ue({}, c, { endAngle: c.endAngle * (n / 100) }))), r.append(a, l) } var p; if ((p = document.createElementNS(me, "text")).setAttribute("text-anchor", "middle"), p.setAttribute("alignment-baseline", "middle"), p.setAttribute("font-size", "16"), p.setAttribute("font-weight", "bold"), p.setAttribute("fill", e.text), "value" === this.props.valueType && null != this.props.value) if (this.props.unit && this.props.unit.length > 0) { var h = document.createElementNS(me, "tspan"); h.setAttribute("x", "0"), h.setAttribute("dy", "1em"), h.textContent = "" + t, h.style.fontSize = "8pt"; var d = document.createElementNS(me, "tspan"); d.setAttribute("x", "0"), d.setAttribute("dy", "1em"), d.textContent = "" + this.props.unit, d.style.fontSize = "8pt", p.append(h, d), p.setAttribute("transform", "translate(50 33)") } else p.textContent = "" + t, p.style.fontSize = "8pt", p.setAttribute("transform", "translate(50 50)"); else p.textContent = n + "%", p.setAttribute("transform", "translate(50 50)"); r.append(p) }return !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || r.setAttribute("opacity", "0.2"), null !== r && i.append(r), i }, e.prototype.updateDomElement = function (t) { !1 === this.meta.isBeingResized && this.resizeElement(this.props.width, this.props.height), t.innerHTML = this.createDomElement().innerHTML }, e.prototype.resizeElement = function (e, n) { "progress-bar" === this.props.percentileType ? t.prototype.resizeElement.call(this, e, 35) : t.prototype.resizeElement.call(this, e, e) }, e.prototype.resize = function (e) { this.resizeElement(e, e); var n = this.props.maxValue || 0; "progress-bar" === this.props.percentileType && (n = 35), t.prototype.setProps.call(this, ue({}, this.props, { width: e, height: n })) }, e.prototype.getProgress = function () { var t = this.props.minValue || 0, e = this.props.maxValue || 100, n = null == this.props.value ? 0 : this.props.value; return n <= t ? 0 : n >= e ? 100 : Math.trunc((n - t) / (e - t) * 100) }, e }(s.a), _e = n(7), ye = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), be = function () { return (be = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }, ve = function (t) { switch (t) { case "white": case "black": case "transparent": return t; default: return "transparent" } }, ge = function (t) { switch (t) { case "horizontal": case "vertical": return t; default: return "vertical" } }; function Ee(t) { if (Object(r.s)(t.html) && Object(r.s)(t.encodedHtml)) throw new TypeError("missing html content."); return be({}, Object(s.b)(t), { type: 18, html: Object(r.s)(t.html) ? Object(r.d)(t.encodedHtml) : t.html, backgroundColor: ve(t.backgroundColor), typeGraph: ge(t.typeGraph), gridColor: Object(r.s)(t.gridColor) ? "#000000" : t.gridColor }, Object(r.j)(t)) } var xe = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return ye(e, t), e.prototype.createDomElement = function () { var t = document.createElement("div"); return t.className = "bars-graph", t.style.backgroundImage = "url(" + this.props.html + ")", t.style.backgroundRepeat = "no-repeat", t.style.backgroundSize = this.props.width + "px " + this.props.height + "px", !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || (t.style.opacity = "0.2"), t }, e.prototype.updateDomElement = function (t) { t.style.backgroundImage = "url(" + this.props.html + ")", t.style.backgroundRepeat = "no-repeat", t.style.backgroundSize = this.props.width + "px " + this.props.height + "px", !0 !== this.props.agentDisabled && !0 !== this.props.moduleDisabled || (t.style.opacity = "0.2") }, e }(s.a), we = n(8), Oe = function () { var t = function (e, n) { return (t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e } || function (t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) })(e, n) }; return function (e, n) { function i() { this.constructor = e } t(e, n), e.prototype = null === n ? Object.create(n) : (i.prototype = n.prototype, new i) } }(), ke = function () { return (ke = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function Me(t) { if (null !== t.imageSrc) { if ("string" != typeof t.statusImageSrc || 0 === t.imageSrc.statusImageSrc) throw new TypeError("invalid status image src.") } else if (Object(r.s)(t.encodedTitle)) throw new TypeError("missing encode tittle content."); if (null === Object(r.n)(t.serviceId, null)) throw new TypeError("invalid service id."); return ke({}, Object(s.b)(t), { type: 10, serviceId: t.serviceId, imageSrc: Object(r.k)(t.imageSrc, null), statusImageSrc: Object(r.k)(t.statusImageSrc, null), encodedTitle: Object(r.k)(t.encodedTitle, null) }) } var Ae, je = function (t) { function e() { return null !== t && t.apply(this, arguments) || this } return Oe(e, t), e.prototype.createDomElement = function () { var t = document.createElement("div"); return t.className = "service", null !== this.props.statusImageSrc ? (t.style.background = "url(" + this.props.statusImageSrc + ") no-repeat", t.style.backgroundSize = "contain", t.style.backgroundPosition = "center", null !== this.props.encodedTitle && (t.className = "service image forced_title", t.setAttribute("data-use_title_for_force_title", "1"), t.setAttribute("data-title", Object(r.d)(this.props.encodedTitle)))) : null !== this.props.encodedTitle && (t.innerHTML = Object(r.d)(this.props.encodedTitle)), t }, e.prototype.updateDomElement = function (t) { null !== this.props.statusImageSrc ? (t.style.background = "url(" + this.props.statusImageSrc + ") no-repeat", t.style.backgroundSize = "contain", t.style.backgroundPosition = "center", null !== this.props.encodedTitle && (t.className = "service image forced_title", t.setAttribute("data-use_title_for_force_title", "1"), t.setAttribute("data-title", Object(r.d)(this.props.encodedTitle))), t.innerHTML = "") : null !== this.props.encodedTitle && (t.innerHTML = Object(r.d)(this.props.encodedTitle)) }, e }(s.a), Te = function () { return (Te = Object.assign || function (t) { for (var e, n = 1, i = arguments.length; n < i; n++)for (var r in e = arguments[n]) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t }).apply(this, arguments) }; function Ce(t) { var e = Object(r.n)(t.type, null); if (null == e) throw new TypeError("missing item type."); switch (e) { case 0: return c(t); case 1: return Object(we.b)(t); case 2: case 6: case 7: case 8: return rt(t); case 3: case 9: case 15: case 16: return de(t); case 4: return Q(t); case 5: return d(t); case 10: return Me(t); case 11: return z(t); case 12: return Y(t); case 13: return j(t); case 14: return Object(ot.b)(t); case 17: return Object(_e.b)(t); case 18: return Ee(t); case 19: return U(t); case 20: return g(t); case 21: return L(t); default: throw new TypeError("decoder not found") } } var Pe = function () { function t(t, e, n) { var i = this; this.elementsById = {}, this.elementIds = [], this.relations = {}, this.lineLinks = {}, this.lines = {}, this.clickEventManager = new k.a, this.dblClickEventManager = new k.a, this.movedEventManager = new k.a, this.lineMovedEventManager = new k.a, this.resizedEventManager = new k.a, this.selectionChangedEventManager = new k.a, this.disposables = [], this.handleElementClick = function (t) { i.clickEventManager.emit(t) }, this.handleElementDblClick = function (t) { i.dblClickEventManager.emit(t) }, this.handleElementMovement = function (t) { var e = t.item.props.id; i.getItemRelations(e).forEach(function (n) { n.parentId === e ? n.line.props = Te({}, n.line.props, { startPosition: i.getVisualCenter(t.newPosition, t.item) }) : n.childId === e && (n.line.props = Te({}, n.line.props, { endPosition: i.getVisualCenter(t.newPosition, t.item) })) }), i.updateLinesConnected(t.item.props, t.newPosition, !1) }, this.handleElementMovementFinished = function (t) { i.movedEventManager.emit(t), i.updateLinesConnected(t.item.props, t.newPosition, !0) }, this.handleLineElementMovementFinished = function (t) { i.refreshLink(t.item), i.lineMovedEventManager.emit(t) }, this.handleElementResizement = function (t) { var e = t.item, n = e.props, r = n.id, s = i.getItemRelations(r), o = { x: n.x, y: n.y }, a = i.elementsById[r].meta; i.elementsById[r].meta = Te({}, a, { isUpdating: !0 }), s.forEach(function (t) { t.parentId === r ? t.line.props = Te({}, t.line.props, { startPosition: i.getVisualCenter(o, e) }) : t.childId === r && (t.line.props = Te({}, t.line.props, { endPosition: i.getVisualCenter(o, e) })) }) }, this.handleElementResizementFinished = function (t) { i.resizedEventManager.emit(t) }, this.handleElementRemove = function (t) { i.elementIds = i.elementIds.filter(function (e) { return e !== t.item.props.id }), delete i.elementsById[t.item.props.id], i.clearRelations(t.item.props.id) }, this.handleElementSelectionChanged = function (t) { i.elements.filter(function (t) { return 1 == t.meta.isSelected }).length > 0 ? t.selected = !0 : t.selected = !1, i.selectionChangedEventManager.emit(t) }, this.handleContainerClick = function () { i.unSelectItems() }, this.containerRef = t, this._props = function (t) { var e = t.id, n = t.name, i = t.groupId, s = t.backgroundURL, o = t.backgroundColor, a = t.isFavorite, l = t.relationLineWidth; if (null == e || isNaN(parseInt(e))) throw new TypeError("invalid Id."); if ("string" != typeof n || 0 === n.length) throw new TypeError("invalid name."); if (null == i || isNaN(parseInt(i))) throw new TypeError("invalid group Id."); return Te({ id: parseInt(e), name: n, groupId: parseInt(i), backgroundURL: Object(r.k)(s, null), backgroundColor: Object(r.k)(o, null), isFavorite: Object(r.l)(a), relationLineWidth: Object(r.n)(l, 0) }, Object(r.r)(t)) }(e), this.render(), (n = n.sort(function (t, e) { return null == t.id || null == e.id ? 0 : t.id > e.id ? 1 : -1 })).forEach(function (t) { return i.addElement(t, i) }), this.buildRelations(), this.elements.forEach(function (t) { t instanceof P && i.refreshLink(t) }), this.containerRef.addEventListener("click", this.handleContainerClick) } return t.prototype.coordinatesInItem = function (t, e, n) { return 13 != n.type && 21 != n.type && (t > n.x && t < n.x + n.width && e > n.y && e < n.y + n.height) }, t.prototype.refreshLink = function (t) { var e = t.props.id, n = 0, i = 0; try { for (var r in this.elementsById) this.coordinatesInItem(t.props.startPosition.x, t.props.startPosition.y, this.elementsById[r].props) && (n = parseInt(r)), this.coordinatesInItem(t.props.endPosition.x, t.props.endPosition.y, this.elementsById[r].props) && (i = parseInt(r)); for (var r in null == this.lineLinks && (this.lineLinks = {}), null == this.lines && (this.lines = {}), n == e && (n = 0), i == e && (i = 0), null == this.lines[e] && (this.lines[e] = { start: n, end: i }), n > 0 ? (null == this.lineLinks[n] && (this.lineLinks[n] = {}), this.lineLinks[n][e] = { start: n, end: i }) : this.lines[e].start > 0 && (this.lineLinks[this.lines[e].start][e].start = 0, this.lines[e].start = 0), i > 0 ? (null == this.lineLinks[i] && (this.lineLinks[i] = {}), this.lineLinks[i][e] = { start: n, end: i }) : this.lines[e].end > 0 && (this.lineLinks[this.lines[e].end][e].end = 0, this.lines[e].end = 0), this.lines[e] = { start: n, end: i }, this.lineLinks) this.lineLinks[r][e] && 0 == this.lineLinks[r][e].start && 0 == this.lineLinks[r][e].end && (delete this.lineLinks[r][e], 0 === Object.keys(this.lineLinks[r]).length && delete this.lineLinks[r]) } catch (t) { console.error(t) } }, t.prototype.updateLinesConnected = function (t, e, n) { var i = this; null != this.lineLinks[t.id] && (Object.keys(this.lineLinks[t.id]).forEach(function (s) { var o = parseInt(s), a = i.elementsById[o]; if (a.props) { var l = a.props.startPosition.x, c = a.props.startPosition.y, u = a.props.endPosition.x, p = a.props.endPosition.y; if (t.id == i.lineLinks[t.id][o].start && (l = e.x + t.width / 2, c = e.y + t.height / 2), t.id == i.lineLinks[t.id][o].end && (u = e.x + t.width / 2, p = e.y + t.height / 2), i.updateElement(Te({}, a.props, { startX: l, startY: c, endX: u, endY: p })), n) Object(r.c)(500, function (t) { i.lineMovedEventManager.emit({ item: t.line, startPosition: { x: t.startX, y: t.startY }, endPosition: { x: t.endX, y: t.endY } }) })({ line: a, startX: l, startY: c, endX: u, endY: p }) } }), this.buildRelations(t.id, e.x + t.width / 2, e.y + t.height / 2)) }, Object.defineProperty(t.prototype, "elements", { get: function () { var t = this; return this.elementIds.map(function (e) { return t.elementsById[e] }).filter(function (t) { return null != t }) }, enumerable: !0, configurable: !0 }), t.prototype.addElement = function (t, e) { void 0 === e && (e = this); try { var n = function (t) { var e = Object(r.n)(t.type, null); if (null == e) throw new TypeError("missing item type."); var n = Object(r.h)(t); switch (e) { case 0: return new u(c(t), n); case 1: return new we.a(Object(we.b)(t), n); case 2: case 6: case 7: case 8: return new st(rt(t), n); case 3: case 9: case 15: case 16: return new fe(de(t), n); case 4: return new $(Q(t), n); case 5: return new m(d(t), n); case 10: return new je(Me(t), n); case 11: return new B(z(t), n); case 12: return new X(Y(t), n); case 13: return new P(j(t), n); case 14: return new ot.a(Object(ot.b)(t), n); case 17: return new _e.a(Object(_e.b)(t), n); case 18: return new xe(Ee(t), n); case 19: return new V(U(t), n); case 20: return new O(g(t), n); case 21: return new R(L(t), n); default: throw new TypeError("item not found") } }(t); return e.elementsById[n.props.id] = n, e.elementIds.push(n.props.id), n.onRemove(e.handleElementRemove), n.onSelectionChanged(e.handleElementSelectionChanged), n.onClick(e.handleElementClick), n.onDblClick(e.handleElementDblClick), n instanceof P ? (n.onLineMovementFinished(e.handleLineElementMovementFinished), this.refreshLink(n)) : (n.onMoved(e.handleElementMovement), n.onMovementFinished(e.handleElementMovementFinished), n.onResized(e.handleElementResizement), n.onResizeFinished(e.handleElementResizementFinished)), e.containerRef.append(n.elementRef), n } catch (t) { console.error("Error creating a new element:", t.message) } }, t.prototype.updateElements = function (t) { var e = this, n = t.map(function (t) { return t.id || null }).filter(function (t) { return null != t }); this.elementIds.filter(function (t) { return n.indexOf(t) < 0 }).forEach(function (t) { null != e.elementsById[t] && (e.elementsById[t].remove(), delete e.elementsById[t]) }), this.elementIds = n, t.forEach(function (t) { if (t.id) if (null == e.elementsById[t.id]) e.addElement(t); else try { e.elementsById[t.id].props = Ce(t) } catch (t) { console.error("Error updating an element:", t.message) } }), this.buildRelations() }, t.prototype.updateElement = function (t) { try { this.elementsById[t.id].props = Te({}, Ce(t)) } catch (t) { console.error("Error updating element:", t.message) } this.buildRelations() }, Object.defineProperty(t.prototype, "props", { get: function () { return Te({}, this._props) }, set: function (t) { var e = this.props; this._props = t, this.render(e) }, enumerable: !0, configurable: !0 }), t.prototype.render = function (t) { void 0 === t && (t = null), t ? (t.backgroundURL !== this.props.backgroundURL && (this.containerRef.style.backgroundImage = null !== this.props.backgroundURL ? "url(" + this.props.backgroundURL + ")" : ""), null != this.props.backgroundColor && t.backgroundColor !== this.props.backgroundColor && (this.containerRef.style.backgroundColor = this.props.backgroundColor), this.sizeChanged(t, this.props) && this.resizeElement(this.props.width, this.props.height)) : (this.props.backgroundURL && (this.containerRef.style.backgroundImage = null !== this.props.backgroundURL ? "url(" + this.props.backgroundURL + ")" : ""), this.props.backgroundColor && (this.containerRef.style.backgroundColor = this.props.backgroundColor), this.resizeElement(this.props.width, this.props.height)) }, t.prototype.sizeChanged = function (t, e) { return t.width !== e.width || t.height !== e.height }, t.prototype.resizeElement = function (t, e) { this.containerRef.style.width = t + "px", this.containerRef.style.height = e + "px" }, t.prototype.resize = function (t, e) { this.props = Te({}, this.props, { width: t, height: e }) }, t.prototype.remove = function () { this.disposables.forEach(function (t) { return t.dispose() }), this.elements.forEach(function (t) { return t.remove() }), this.elementsById = {}, this.elementIds = [], this.clearRelations(), this.containerRef.removeEventListener("click", this.handleContainerClick), this.containerRef.innerHTML = "" }, t.prototype.buildRelations = function (t, e, n) { var i = this; this.clearRelations(), this.elements.forEach(function (r) { if (null !== r.props.parentId) { var s = i.elementsById[r.props.parentId], o = i.elementsById[r.props.id]; s && o && (null != t ? r.props.parentId == t ? i.addRelationLine(s, o, e, n) : r.props.id == t ? i.addRelationLine(s, o, void 0, void 0, e, n) : i.addRelationLine(s, o) : i.addRelationLine(s, o)) } }) }, t.prototype.clearRelations = function (t) { if (null != t) for (var e in this.relations) { var n = e.split("|"), i = Number.parseInt(n[0]), r = Number.parseInt(n[1]); t !== i && t !== r || (this.relations[e].remove(), delete this.relations[e]) } else for (var e in this.relations) this.relations[e].remove(), delete this.relations[e] }, t.prototype.getRelationLine = function (t, e) { var n = t + "|" + e; return this.relations[n] || null }, t.prototype.getItemRelations = function (t) { var e = []; for (var n in this.relations) { var i = n.split("|"), r = Number.parseInt(i[0]), s = Number.parseInt(i[1]); t !== r && t !== s || e.push({ parentId: r, childId: s, line: this.relations[n] }) } return e }, t.prototype.getVisualCenter = function (t, e) { var n = t.x + e.elementRef.clientWidth / 2, i = t.y + e.elementRef.clientHeight / 2; if (void 0 !== e.props.label || "" !== e.props.label || null !== e.props.label) switch (e.props.labelPosition) { case "up": i = t.y + (e.elementRef.clientHeight + e.labelElementRef.clientHeight) / 2; break; case "down": i = t.y + (e.elementRef.clientHeight - e.labelElementRef.clientHeight) / 2; break; case "right": n = t.x + (e.elementRef.clientWidth - e.labelElementRef.clientWidth) / 2; break; case "left": n = t.x + (e.elementRef.clientWidth + e.labelElementRef.clientWidth) / 2 }return { x: n, y: i } }, t.prototype.addRelationLine = function (t, e, n, i, s, o) { var a = t.props.id + "|" + e.props.id; null != this.relations[a] && this.relations[a].remove(); var l = this.getVisualCenter(t.props, t), c = l.x, u = l.y, p = this.getVisualCenter(e.props, e), h = p.x, d = p.y; null != n && (c = n), null != i && (u = i), null != s && (h = s), null != o && (d = o); var m = new P(j({ id: 0, type: 13, startX: c, startY: u, endX: h, endY: d, width: 0, height: 0, lineWidth: this.props.relationLineWidth, color: Object(r.k)(e.props.colorStatus, "#CCC") }), Object(r.h)({ receivedAt: new Date })); return this.relations[a] = m, m.elementRef.style.zIndex = "0", this.containerRef.append(m.elementRef), m }, t.prototype.onItemClick = function (t) { var e = this.clickEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onItemDblClick = function (t) { var e = this.dblClickEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onItemMoved = function (t) { var e = this.movedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onLineMoved = function (t) { var e = this.lineMovedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onItemResized = function (t) { var e = this.resizedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.onItemSelectionChanged = function (t) { var e = this.selectionChangedEventManager.on(t); return this.disposables.push(e), e }, t.prototype.enableEditMode = function () { this.elements.forEach(function (t) { t.meta = Te({}, t.meta, { editMode: !0 }) }), this.containerRef.classList.add("is-editing") }, t.prototype.disableEditMode = function () { this.elements.forEach(function (t) { t.meta = Te({}, t.meta, { editMode: !1 }) }), this.containerRef.classList.remove("is-editing") }, t.prototype.selectItem = function (t, e) { var n = this; void 0 === e && (e = !1), e ? this.elementIds.forEach(function (e) { var i = n.elementsById[e].meta; e !== t && i.isSelected ? n.elementsById[e].unSelectItem() : e !== t || i.isSelected || n.elementsById[e].selectItem() }) : this.elementsById[t] && this.elementsById[t].selectItem() }, t.prototype.unSelectItem = function (t) { this.elementsById[t] && (this.elementsById[t].meta.isSelected && this.elementsById[t].unSelectItem()) }, t.prototype.unSelectItems = function () { var t = this; this.elementIds.forEach(function (e) { t.elementsById[e] && t.elementsById[e].unSelectItem() }) }, t.itemDescriptiveName = function (t) { var e; switch (t.props.type) { case 0: e = Object(r.t)("Static graph") + " - " + t.props.imageSrc; break; case 1: e = Object(r.t)("Module graph"); break; case 19: e = Object(r.t)("Clock"); break; case 18: e = Object(r.t)("Bars graph"); break; case 14: e = Object(r.t)("Event history graph"); break; case 3: e = Object(r.t)("Percentile bar"); break; case 15: e = Object(r.t)("Circular progress bar"); break; case 16: e = Object(r.t)("Circular progress bar (interior)"); break; case 2: e = Object(r.t)("Simple Value"); break; case 4: e = Object(r.t)("Label"); break; case 11: e = Object(r.t)("Group"); break; case 20: e = Object(r.t)("Color cloud"); break; case 5: e = Object(r.t)("Icon") + " - " + t.props.imageSrc; break; default: e = Object(r.t)("Item") }var n = t.props; return null != n.agentAlias && null != n.moduleName ? e += " (" + Object(r.e)(n.agentAlias, 18) + " - " + Object(r.e)(n.moduleName, 25) + ")" : null != n.agentAlias && (e += " (" + Object(r.e)(n.agentAlias, 25) + ")"), e }, t.items = ((Ae = {})[0] = u, Ae[1] = we.a, Ae[2] = st, Ae[6] = st, Ae[7] = st, Ae[8] = st, Ae[3] = fe, Ae[9] = fe, Ae[15] = fe, Ae[16] = fe, Ae[4] = $, Ae[5] = m, Ae[10] = je, Ae[11] = B, Ae[12] = X, Ae[13] = P, Ae[14] = ot.a, Ae[17] = _e.a, Ae[18] = xe, Ae[19] = V, Ae[20] = O, Ae[21] = R, Ae), t }(), Se = function () { function t(t) { this.cancellable = { cancel: function () { } }, this._status = "waiting", this.statusChangeEventManager = new k.a, this.disposables = [], this.taskInitiator = t } return Object.defineProperty(t.prototype, "status", { get: function () { return this._status }, set: function (t) { this._status = t, this.statusChangeEventManager.emit(t) }, enumerable: !0, configurable: !0 }), t.prototype.init = function () { var t = this; this.cancellable = this.taskInitiator(function () { t.status = "finished" }), this.status = "started" }, t.prototype.cancel = function () { this.cancellable.cancel(), this.status = "cancelled" }, t.prototype.onStatusChange = function (t) { var e = this.statusChangeEventManager.on(t); return this.disposables.push(e), e }, t }(); var Ie = function () { function t() { this.tasks = {} } return t.prototype.add = function (t, e, n) { void 0 === n && (n = 0), this.tasks[t] && "started" === this.tasks[t].status && this.tasks[t].cancel(); var i = n > 0 ? function (t, e) { return new Se(function () { var n = null; return t.onStatusChange(function (i) { "finished" === i && (n = window.setTimeout(function () { t.init() }, e)) }), t.init(), { cancel: function () { n && clearTimeout(n), t.cancel() } } }) }(new Se(e), n) : new Se(e); return this.tasks[t] = i, this.tasks[t] }, t.prototype.init = function (t) { !this.tasks[t] || "waiting" !== this.tasks[t].status && "cancelled" !== this.tasks[t].status && "finished" !== this.tasks[t].status || this.tasks[t].init() }, t.prototype.cancel = function (t) { this.tasks[t] && "started" === this.tasks[t].status && this.tasks[t].cancel() }, t }(); window.VisualConsole = Pe, window.VisualConsole.Form = f, window.AsyncTaskManager = Ie }]);
//# sourceMappingURL=vc.main.min.js.map