From 411dcb445df24befe1cf1d0b69b46e1e8af9c149 Mon Sep 17 00:00:00 2001 From: Nidhish Reddy Date: Mon, 23 Dec 2024 14:24:02 +0530 Subject: [PATCH 1/5] chore: Add getSupportCy and layoutUtilities --- package-lock.json | 72 +++++++++++++- package.json | 5 +- src/elementUtilities.js | 35 +++++-- src/getSupportCy.js | 31 ++++++ src/index.js | 143 +++++++++++++++++++++++++-- src/layoutUtilities.js | 208 ++++++++++++++++++++++++++++++++++++++++ src/reLayout.js | 201 -------------------------------------- 7 files changed, 477 insertions(+), 218 deletions(-) create mode 100644 src/getSupportCy.js create mode 100644 src/layoutUtilities.js delete mode 100644 src/reLayout.js diff --git a/package-lock.json b/package-lock.json index 08bdced..e3bf72b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cytoscape-expand-collapse", - "version": "4.1.1", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cytoscape-expand-collapse", - "version": "4.1.1", + "version": "1.0.0", "license": "MIT", "devDependencies": { "@babel/core": "^7.10.3", @@ -23,7 +23,9 @@ "webpack-cli": "^4.6.0" }, "peerDependencies": { - "cytoscape": "^3.3.0" + "cytoscape": "^3.3.0", + "cytoscape-dagre": "^2.5.0", + "cytoscape-fcose": "^2.2.0" } }, "node_modules/@ampproject/remapping": { @@ -2498,6 +2500,15 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "node_modules/cose-base": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz", + "integrity": "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==", + "peer": true, + "dependencies": { + "layout-base": "^2.0.0" + } + }, "node_modules/cross-env": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", @@ -2554,6 +2565,40 @@ "node": ">=0.10" } }, + "node_modules/cytoscape-dagre": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/cytoscape-dagre/-/cytoscape-dagre-2.5.0.tgz", + "integrity": "sha512-VG2Knemmshop4kh5fpLO27rYcyUaaDkRw+6PiX4bstpB+QFt0p2oauMrsjVbUamGWQ6YNavh7x2em2uZlzV44g==", + "peer": true, + "dependencies": { + "dagre": "^0.8.5" + }, + "peerDependencies": { + "cytoscape": "^3.2.22" + } + }, + "node_modules/cytoscape-fcose": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz", + "integrity": "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==", + "peer": true, + "dependencies": { + "cose-base": "^2.2.0" + }, + "peerDependencies": { + "cytoscape": "^3.2.0" + } + }, + "node_modules/dagre": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/dagre/-/dagre-0.8.5.tgz", + "integrity": "sha512-/aTqmnRta7x7MCCpExk7HQL2O4owCT2h8NT//9I1OQ9vt29Pa0BzSAkR5lwFUcQ7491yVi/3CXU9jQ5o0Mn2Sw==", + "peer": true, + "dependencies": { + "graphlib": "^2.1.8", + "lodash": "^4.17.15" + } + }, "node_modules/dateformat": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", @@ -2840,6 +2885,15 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphlib": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", + "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", + "peer": true, + "dependencies": { + "lodash": "^4.17.15" + } + }, "node_modules/growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -3157,6 +3211,12 @@ "node": ">=0.10.0" } }, + "node_modules/layout-base": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz", + "integrity": "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==", + "peer": true + }, "node_modules/loader-runner": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", @@ -3192,6 +3252,12 @@ "node": ">=8" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "peer": true + }, "node_modules/lodash._basecopy": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", diff --git a/package.json b/package.json index be6d51e..b9ac23e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "nr-cytoscape-expand-collapse", + "name": "cytoscape-expand-collapse", "version": "1.0.0", "description": "This extension provides an interface to expand-collapse nodes", "main": "./src/index.js", @@ -40,6 +40,7 @@ }, "peerDependencies": { "cytoscape": "^3.3.0", - "cytoscape-fcose": "^2.2.0" + "cytoscape-fcose": "^2.2.0", + "cytoscape-dagre": "^2.5.0" } } diff --git a/src/elementUtilities.js b/src/elementUtilities.js index fe237ef..a150e86 100644 --- a/src/elementUtilities.js +++ b/src/elementUtilities.js @@ -1,5 +1,4 @@ -const relayout = require("./reLayout"); -const { reLayout } = require("./reLayout"); +const { runLayoutAsync } = require("./layoutUtilities"); function elementUtilities(cy) { return { @@ -48,11 +47,35 @@ function elementUtilities(cy) { if (typeof layoutBy === "function") { layoutBy(); } else if (layoutBy != null) { - var layout = cy.layout(layoutBy); - if (layout && layout.run) { - await reLayout(layout); - relayout(cy, layoutBy); + var hasGroups = !!cy + .nodes() + .filter((node) => node.data().type === "group").length; + + if (hasGroups) { + // get positions of nodes before preset layout + const positions = {}; + (cy?.scratch("_cyExpandCollapse")?.positions ?? []).forEach( + ({ nodeId, position }) => { + positions[nodeId] = position; + } + ); + + // run preset layout with the positions + await runLayoutAsync( + cy.layout({ + name: "preset", + fit: false, + positions: positions, + zoom: cy.zoom(), + pan: cy.pan(), + padding: layoutBy?.padding ?? 50, + animate: layoutBy?.animate ?? true, + animationDuration: layoutBy?.animationDuration ?? 500, + animationEasing: layoutBy?.animationEasing, + }) + ); } + cy.scratch("_cyExpandCollapse").positions = null; } }, convertToRenderedPosition: function (modelPosition) { diff --git a/src/getSupportCy.js b/src/getSupportCy.js new file mode 100644 index 0000000..d9fb975 --- /dev/null +++ b/src/getSupportCy.js @@ -0,0 +1,31 @@ +const cytoscape = require("cytoscape"); +const fcose = require("cytoscape-fcose"); +const dagre = require("cytoscape-dagre"); + +/** + * Creates a new support cytoscape instance with the same elements and style as the provided instance, + * and attaches it to a container with the ID "support-map". + * + * @param {Object} cy - The original Cytoscape instance. + * @returns {Object} The new Cytoscape instance. + */ +function getSupportCy(cy) { + const cyJson = cy.json(); + + let cont = document.getElementById("support-map"); + cont.style.width = cy.container().clientWidth + "px"; + cont.style.height = cy.container().clientHeight + "px"; + + cytoscape.use(fcose); + cytoscape.use(dagre); + const supportCy = cytoscape({ + container: cont, + elements: cyJson.elements, + styleEnabled: true, + style: cyJson.style, + }); + + return supportCy; +} + +module.exports = getSupportCy; diff --git a/src/index.js b/src/index.js index 480e2ee..e90a515 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,11 @@ var undoRedoUtilities = require("./undoRedoUtilities"); var cueUtilities = require("./cueUtilities"); + const getSupportCy = require("./getSupportCy"); + const { + runLayoutAsync, + resolveCompoundNodesOverlap, + } = require("./layoutUtilities"); var saveLoadUtils = null; function extendOptions(options, extendBy) { @@ -100,8 +105,56 @@ // Collection functions // collapse given eles extend options with given param - api.collapse = function (_eles, opts) { + api.collapse = async function (_eles, opts) { var eles = this.collapsibleNodes(_eles); + + if (opts?.isGroupBy) { + // Get the support cytoscape instance + var supportCy = getSupportCy(cy); + + // Get the support nodes corresponding to the elements to be collapsed + var supportNodes = eles.map((ele) => { + var supportNode = supportCy.getElementById(ele.id()); + supportNode.toggleClass("expanded", false); + supportNode.toggleClass("cy-expand-collapse-collapsed-node", true); + supportNode.toggleClass("collapsed", true); + return supportNode; + }); + + if (supportNodes.length) { + // Collapse the support nodes + var collapsedNodesCollection = supportCy.collection(supportNodes); + expandCollapseUtilities.simpleCollapseGivenNodes( + collapsedNodesCollection + ); + + // Get the layout options from the scratchpad + var layoutBy = getScratch(cy, "options").layoutBy; + + // Run the layout asynchronously without animation + await runLayoutAsync( + supportCy.layout({ ...layoutBy, animate: false }) + ); + + // Resolve any compound nodes overlap without animation + await resolveCompoundNodesOverlap(supportCy, { + ...layoutBy, + animate: false, + }); + + var positions = supportCy.nodes().map((node) => ({ + nodeId: node.id(), + position: node.position(), + })); + + // Destroy the support cytoscape instance + supportCy.destroy(); + + // Save the positions in the scratchpad + setScratch(cy, "positions", positions); + } + } + var options = getScratch(cy, "options"); var tempOptions = extendOptions(options, opts); evalOptions(tempOptions); @@ -110,17 +163,63 @@ }; // collapse given eles recursively extend options with given param - api.collapseRecursively = function (_eles, opts) { + api.collapseRecursively = async function (_eles, opts) { var eles = this.collapsibleNodes(_eles); var options = getScratch(cy, "options"); var tempOptions = extendOptions(options, opts); evalOptions(tempOptions); + var result = await this.collapse( + eles.union(eles.descendants()), + tempOptions + ); - return this.collapse(eles.union(eles.descendants()), tempOptions); + return result; }; // expand given eles extend options with given param - api.expand = function (_eles, opts) { + api.expand = async function (_eles, opts) { + if (opts?.isGroupBy) { + // Get the support cytoscape instance + var supportCy = getSupportCy(cy); + + // Get the support node corresponding to the element to be expanded + var supportNode = supportCy.getElementById(_eles.id()); + + // Restore the collapsed children of the support node + var restoredNodes = supportNode._private.data.collapsedChildren; + supportCy.add(restoredNodes); + + // Update the classes of the support node to reflect its expanded state + supportNode.toggleClass("cy-expand-collapse-collapsed-node", false); + supportNode.toggleClass("collapsed", false); + supportNode.toggleClass("expanded", true); + + // Get the layout options from the scratchpad + var layoutBy = getScratch(cy, "options").layoutBy; + + // Run the layout asynchronously without animation + await runLayoutAsync( + supportCy.layout({ ...layoutBy, animate: false }) + ); + + // Resolve any compound nodes overlap without animation + await resolveCompoundNodesOverlap(supportCy, { + ...layoutBy, + animate: false, + }); + + var positions = supportCy.nodes().map((node) => ({ + nodeId: node.id(), + position: node.position(), + })); + + // Destroy the support cytoscape instance + supportCy.destroy(); + + // Save the positions in the scratchpad + setScratch(cy, "positions", positions); + } + var eles = this.expandableNodes(_eles); var options = getScratch(cy, "options"); var tempOptions = extendOptions(options, opts); @@ -142,12 +241,17 @@ // Core functions // collapse all collapsible nodes - api.collapseAll = function (opts) { + api.collapseAll = async function (opts) { var options = getScratch(cy, "options"); var tempOptions = extendOptions(options, opts); evalOptions(tempOptions); - return this.collapseRecursively(this.collapsibleNodes(), tempOptions); + var result = await this.collapseRecursively( + this.collapsibleNodes(), + tempOptions + ); + + return result; }; // expand all expandable nodes @@ -413,6 +517,32 @@ cytoscape("core", "expandCollapse", function (opts) { var cy = this; + // Create Support-Map Container + // Select the element with the class name "map __________cytoscape_container" + const targetElement = document.querySelector( + ".map.__________cytoscape_container" + ); + + if (targetElement) { + // Create a new div element + const newElement = document.createElement("div"); + + // Set the id attribute + newElement.id = "support-map"; + + // Set the style properties + newElement.style.zIndex = -1; + newElement.style.opacity = 0; + + // Insert the new element as a sibling after the target element + targetElement.parentNode.insertBefore( + newElement, + targetElement.nextSibling + ); + } else { + console.log("Element not found"); + } + var options = getScratch(cy, "options") || { layoutBy: null, // for rearrange after expand/collapse. It's just layout options or whole layout function. Choose your side! fisheye: true, // whether to perform fisheye view after expand/collapse you can specify a function too @@ -433,6 +563,7 @@ groupEdgesOfSameTypeOnCollapse: false, allowNestedEdgeCollapse: true, zIndex: 999, // z-index value of the canvas in which cue ımages are drawn + isGroupBy: true, }; // If opts is not 'get' that is it is a real options object then initilize the extension diff --git a/src/layoutUtilities.js b/src/layoutUtilities.js new file mode 100644 index 0000000..6cb2d2e --- /dev/null +++ b/src/layoutUtilities.js @@ -0,0 +1,208 @@ +/** + * Organizes nodes by their parent groups at each level. + * + * @param {Array} nodes - An array of node objects. Each node should have a `data` method that returns an object containing `type` and `parent` properties. + * @returns {Array} An array of objects, each representing a level. Each object contains: + * - `level` (number): The level number (1, 2, etc.). + * - `items` (Array): An array of node groups at that level. For level 1, all nodes are combined into a single group. + */ +function getNodesByGroupLevels(nodes) { + // Create a map to store nodes by their parent group at each level + const levelGroups = {}; + // Filter out default nodes and process each node + const filteredNodes = nodes.filter((node) => node.data().type !== "default"); + + // First, organize nodes by their parent groups + filteredNodes.forEach((node) => { + const parentId = node.data().parent; + + // Level 1 (root level) + if (parentId === undefined) { + if (!levelGroups[1]) { + levelGroups[1] = { + root: [], + }; + } + levelGroups[1].root.push(node); + } + // Other levels + else { + // Calculate level based on the number of '::' in the parent + const level = parentId.split("::").length + 1; + + if (!levelGroups[level]) { + levelGroups[level] = {}; + } + + // Group by parent + if (!levelGroups[level][parentId]) { + levelGroups[level][parentId] = []; + } + levelGroups[level][parentId].push(node); + } + }); + + // Convert the level groups to the required output format + const result = Object.keys(levelGroups) + .sort((a, b) => parseInt(a) - parseInt(b)) + .map((level, index) => ({ + level: index + 1, // Explicitly set length to 1, 2, etc. + items: + level === "1" + ? [levelGroups[level].root] // For length 1, combine everything into a single group + : Object.values(levelGroups[level]), + })) + .reverse(); + + return result ?? []; +} + +/** + * Runs the given layout asynchronously and returns a promise that resolves when the layout stops. + * + * @param {Object} layout - The layout object that has an `on` method to listen for events and a `run` method to start the layout. + * @returns {Promise} A promise that resolves when the layout stops. + */ +function runLayoutAsync(layout) { + return new Promise((resolve) => { + layout.on("layoutstop", resolve); + layout.run(); + }); +} + +/** + * Resolves overlap of compound nodes in a cytoscape instance by temporarily replacing expanded nodes with positioning support nodes, + * running the specified layout, and then restoring the original nodes. + * + * @param {Object} cy - The Cytoscape instance. + * @param {Object} layoutBy - The layout options to be used for arranging the nodes. + * @returns {Promise} A promise that resolves when the layout has been applied and nodes have been restored. + */ +async function resolveCompoundNodesOverlap(cy, layoutBy) { + const elementUtilities = require("./elementUtilities")(cy); + const positioningSupportNodes = cy + .nodes() + .filter((node) => node.data().type === "positioning-support"); + + if (positioningSupportNodes.length) { + return; + } + const nodesByGroupLevels = getNodesByGroupLevels(cy.nodes()); + + for (let i = 0; i < nodesByGroupLevels.length; i++) { + let removedCollection = cy.collection(); + let positioningSupportCollection = cy.collection(); + let newGroupLevelNodesCollection = cy.collection(); + + for (let j = 0; j < nodesByGroupLevels[i].items.length; j++) { + const groupLevelNodes = nodesByGroupLevels[i].items[j]; + + const newGroupLevelNodes = groupLevelNodes.map((node) => { + //check if the node is expanded + if ( + !node.hasClass("cy-expand-collapse-collapsed-node") && + node.isParent() + ) { + const positioningSupportNodeId = `support ${node.data().id}`; + const positioningSupportNode = { + group: "nodes", + data: { + id: positioningSupportNodeId, + parent: node.data().parent, + type: "positioning-support", + label: `${node.data().label}`, + }, + style: { + width: node.boundingBox().w, + height: node.boundingBox().h, + padding: 0, + "min-width": 0, + "border-width": 0, + shape: "round-rectangle", + }, + position: { + x: node.position("x"), + y: node.position("y"), + }, + }; + + cy.add(positioningSupportNode); + const removedNode = node.remove(); + removedCollection = removedCollection.union(removedNode); + const newGroupLevelNode = cy.getElementById(positioningSupportNodeId); + positioningSupportCollection = + positioningSupportCollection.union(newGroupLevelNode); + return newGroupLevelNode; + } + return node; + }); + newGroupLevelNodesCollection = + newGroupLevelNodesCollection.union(newGroupLevelNodes); + } + + // If all nodes are collapsed + if (removedCollection.length === 0 && nodesByGroupLevels.length === 1) { + const reArrange = newGroupLevelNodesCollection.layout(layoutBy); + + await runLayoutAsync(reArrange); + } else if (removedCollection.length > 0) { + const reArrange = newGroupLevelNodesCollection.layout(layoutBy); + + await runLayoutAsync(reArrange); + + removedCollection.restore(); + removedCollection.forEach((removedNode) => { + if ( + removedNode.group() !== "edges" || + removedNode.data()?.type === "default" + ) { + const positioningSupportNodeId = `support ${removedNode.data().id}`; + const positioningSupportNode = cy.getElementById( + positioningSupportNodeId + ); + if (positioningSupportNode?.length) { + // Determine the multiplier based on the relative positions of removedNode and positioningSupportNode + const multiplier = { + x: + removedNode.position().x < positioningSupportNode.position().x + ? 1 + : -1, + y: + removedNode.position().y < positioningSupportNode.position().y + ? 1 + : -1, + }; + + // Calculate the difference in positions, adjusted by the multiplier + const positionDiff = { + x: + multiplier.x === 1 + ? positioningSupportNode.position().x - + removedNode.position().x + : (removedNode.position().x - + positioningSupportNode.position().x) * + -1, + y: + multiplier.y === 1 + ? positioningSupportNode.position().y - + removedNode.position().y + : (removedNode.position().y - + positioningSupportNode.position().y) * + -1, + }; + + // Move the children of removedNode by the calculated position difference + elementUtilities.moveNodes( + positionDiff, + removedNode.children(), + undefined + ); + } + } + }); + positioningSupportCollection.remove(); + } + } +} + +module.exports = { runLayoutAsync, resolveCompoundNodesOverlap }; diff --git a/src/reLayout.js b/src/reLayout.js deleted file mode 100644 index 4a238b8..0000000 --- a/src/reLayout.js +++ /dev/null @@ -1,201 +0,0 @@ -function moveNodes(positionDiff, nodes, notCalcTopMostNodes) { - var topMostNodes = notCalcTopMostNodes ? nodes : getTopMostNodes(nodes); - var nonParents = topMostNodes.not(":parent"); - // moving parents spoils positioning, so move only nonparents - nonParents.positions(function (ele, i) { - return { - x: nonParents[i].position("x") + positionDiff.x, - y: nonParents[i].position("y") + positionDiff.y, - }; - }); - for (var i = 0; i < topMostNodes.length; i++) { - var node = topMostNodes[i]; - var children = node.children(); - moveNodes(positionDiff, children, true); - } -} - -function getTopMostNodes(nodes) { - //*// - var nodesMap = {}; - for (var i = 0; i < nodes.length; i++) { - nodesMap[nodes[i].id()] = true; - } - var roots = nodes.filter(function (ele, i) { - if (typeof ele === "number") { - ele = i; - } - - var parent = ele.parent()[0]; - while (parent != null) { - if (nodesMap[parent.id()]) { - return false; - } - parent = parent.parent()[0]; - } - return true; - }); - - return roots; -} - -const reLayout = function (layout) { - return new Promise((resolve) => { - layout.on("layoutstop", resolve); - layout.run(); - }); -}; - -function segregateNodesByGroups(nodes) { - // Create a map to store nodes by their parent group at each level - const levelGroups = {}; - // Filter out default nodes and process each node - const filteredNodes = nodes.filter((node) => node.data().type !== "default"); - - // First, organize nodes by their parent groups - filteredNodes.forEach((node) => { - const parentId = node.data().parent; - - // Level 1 (root level) - if (parentId === undefined) { - if (!levelGroups[1]) { - levelGroups[1] = { - root: [], - }; - } - levelGroups[1].root.push(node); - } - // Other levels - else { - // Calculate level based on the number of '::' in the parent - const level = parentId.split("::").length + 1; - - if (!levelGroups[level]) { - levelGroups[level] = {}; - } - - // Group by parent - if (!levelGroups[level][parentId]) { - levelGroups[level][parentId] = []; - } - levelGroups[level][parentId].push(node); - } - }); - - // Convert the level groups to the required output format - const result = Object.keys(levelGroups) - .sort((a, b) => parseInt(a) - parseInt(b)) - .map((level, index) => ({ - level: index + 1, // Explicitly set length to 1, 2, etc. - items: - level === "1" - ? [levelGroups[level].root] // For length 1, combine everything into a single group - : Object.values(levelGroups[level]), - })) - .reverse(); - - return result ?? []; -} - -async function layout(cy, layoutBy) { - const dummyNodes = cy.nodes().filter((node) => node.data().type === "fake"); - - if (dummyNodes.length) { - return; - } - const segregatedNodes = segregateNodesByGroups(cy.nodes()); - - for (let i = 0; i < segregatedNodes.length; i++) { - let removedCollection = cy.collection(); - let siblingCollection = cy.collection(); - let newGroupLevelNodesCollection = cy.collection(); - for (let j = 0; j < segregatedNodes[i].items.length; j++) { - const groupLevelNodes = segregatedNodes[i].items[j]; - - const newGroupLevelNodes = groupLevelNodes.map((node) => { - //If it is a expanded node - if ( - !node.hasClass("cy-expand-collapse-collapsed-node") && - node.isParent() - ) { - const siblingNodeId = `sibling ${node.data().id}`; - const siblingNode = { - group: "nodes", - data: { - id: siblingNodeId, - parent: node.data().parent, - type: "fake", - label: `sibling ${node.data().label}`, - }, - style: { - width: node.boundingBox().w, - height: node.boundingBox().h, - padding: 0, - "min-width": 0, - "border-width": 0, - shape: "round-rectangle", - "background-color": "#3A444B", - "background-opacity": 0.48, - }, - position: { - x: node.position("x"), - y: node.position("y"), - }, - }; - - cy.add(siblingNode); - const removedNode = node.remove(); - removedCollection = removedCollection.union(removedNode); - const sib = cy.getElementById(siblingNodeId); - siblingCollection = siblingCollection.union(sib); - return sib; - } - return node; - }); - newGroupLevelNodesCollection = - newGroupLevelNodesCollection.union(newGroupLevelNodes); - } - - if (removedCollection.length === 0 && segregatedNodes.length === 1) { - const reArrange = newGroupLevelNodesCollection.layout(layoutBy); - - await reLayout(reArrange); - } else if (removedCollection.length > 0) { - const reArrange = newGroupLevelNodesCollection.layout(layoutBy); - - await reLayout(reArrange); - - removedCollection.restore(); - removedCollection.forEach((removedNode) => { - if ( - removedNode.group() !== "edges" || - removedNode.data()?.type === "default" - ) { - const siblingNodeId = `sibling ${removedNode.data().id}`; - const siblingNode = cy.getElementById(siblingNodeId); - if (siblingNode?.length) { - const multiplier = { - x: removedNode.position().x < siblingNode.position().x ? 1 : -1, - y: removedNode.position().y < siblingNode.position().y ? 1 : -1, - }; - const positionDiff = { - x: - multiplier.x === 1 - ? siblingNode.position().x - removedNode.position().x - : (removedNode.position().x - siblingNode.position().x) * -1, - y: - multiplier.y === 1 - ? siblingNode.position().y - removedNode.position().y - : (removedNode.position().y - siblingNode.position().y) * -1, - }; - moveNodes(positionDiff, removedNode.children(), undefined); - } - } - }); - siblingCollection.remove(); - } - } -} - -module.exports = layout; -module.exports.reLayout = reLayout; From d26c2318e5d016091bc72c8a08be465c39de727c Mon Sep 17 00:00:00 2001 From: Nidhish Reddy Date: Mon, 23 Dec 2024 14:26:02 +0530 Subject: [PATCH 2/5] chore: run build --- cytoscape-expand-collapse.js | 1 - nr-cytoscape-expand-collapse.js | 3 ++- nr-cytoscape-expand-collapse.js.LICENSE.txt | 9 +++++++++ package.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) delete mode 100644 cytoscape-expand-collapse.js create mode 100644 nr-cytoscape-expand-collapse.js.LICENSE.txt diff --git a/cytoscape-expand-collapse.js b/cytoscape-expand-collapse.js deleted file mode 100644 index 7546699..0000000 --- a/cytoscape-expand-collapse.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.cytoscapeExpandCollapse=o():e.cytoscapeExpandCollapse=o()}(this,(()=>{return e={78:e=>{var o={equalBoundingBoxes:function(e,o){return e.x1==o.x1&&e.x2==o.x2&&e.y1==o.y1&&e.y2==o.y2},getUnion:function(e,o){var n={x1:Math.min(e.x1,o.x1),x2:Math.max(e.x2,o.x2),y1:Math.min(e.y1,o.y1),y2:Math.max(e.y2,o.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=o},540:(e,o,n)=>{var t=n(630),a=n(438);e.exports=function(e,o,d){var i,s,l=e;const r=function(){var e=o.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=o.container(),r=e.getContext("2d");l.append(e),i=n(537)(o);var c=function(e){var o=e.getBoundingClientRect();return{top:o.top+document.documentElement.scrollTop,left:o.left+document.documentElement.scrollLeft}},p=t((function(){e.height=o.container().offsetHeight,e.width=o.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),t=c(l);e.style.top=-(n.top-t.top),e.style.left=-(n.left-t.left),o&&h()}),0)}),250);function u(){p()}u();var g={};function f(){return o.scratch("_cyExpandCollapse").options}function h(){var e=o.width(),n=o.height();r.clearRect(0,0,e,n),s=null}function v(e,o,n,t,a){var d=new Image(t,a);d.src=e,d.onload=()=>{r.drawImage(d,o,n,t,a)}}o.on("resize",g.eCyResize=function(){u()}),o.on("expandcollapse.clearvisualcue",(function(){s&&h()}));var y,x=null,E=null;o.on("mousedown",g.eMouseDown=function(e){x=e.renderedPosition||e.cyRenderedPosition}),o.on("mouseup",g.eMouseUp=function(e){E=e.renderedPosition||e.cyRenderedPosition}),o.on("remove","node",g.eRemove=function(e){e.target==s&&h()}),o.on("select unselect",g.eSelect=function(){s&&h();var e=o.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),t=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||t){var a,d=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var p=o.zoom()<1?l/(2*o.zoom()):l/2,u=parseFloat(e.css("border-width"));a={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+u+p+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+u+p+1}}else{var g=f().expandCollapseCuePosition;a="function"==typeof g?g.call(this,e):g}var h=i.convertToRenderedPosition(a),y=((l=Math.max(l,l*o.zoom()))-(c=Math.max(c,c*o.zoom())))/2,x=h.x,E=h.y,m=x-l/2,C=E-l/2,b=l;if(d&&f().expandCueImage)v(f().expandCueImage,m,C,l,l);else if(!d&&f().collapseCueImage)v(f().collapseCueImage,m,C,l,l);else{var w=r.fillStyle,T=r.lineWidth,N=r.strokeStyle;r.fillStyle="black",r.strokeStyle="black",r.ellipse(x,E,l/2,l/2,0,0,2*Math.PI),r.fill(),r.beginPath(),r.strokeStyle="white",r.lineWidth=Math.max(2.6,2.6*o.zoom()),r.moveTo(m+y,C+l/2),r.lineTo(m+c+y,C+l/2),d&&(r.moveTo(m+l/2,C+y),r.lineTo(m+l/2,C+c+y)),r.closePath(),r.stroke(),r.strokeStyle=N,r.fillStyle=w,r.lineWidth=T}e._private.data.expandcollapseRenderedStartX=m,e._private.data.expandcollapseRenderedStartY=C,e._private.data.expandcollapseRenderedCueSize=b,s=e}}(n)}}),o.on("tap",g.eTap=function(e){var n=s;if(n){var t=n.data("expandcollapseRenderedStartX"),a=n.data("expandcollapseRenderedStartY"),i=n.data("expandcollapseRenderedCueSize"),l=t+i,r=a+i,c=e.renderedPosition||e.cyRenderedPosition,p=c.x,u=c.y,g=f(),v=(g.expandCollapseCueSensitivity-1)/2;Math.abs(x.x-E.x)<5&&Math.abs(x.y-E.y)<5&&p>=t-i*v&&p<=l+i*v&&u>=a-i*v&&u<=r+i*v&&(g.undoable&&!y&&(y=o.undoRedo({defaultActions:!1})),d.isCollapsible(n)?(h(),g.undoable?y.do("collapse",{nodes:n,options:g}):d.collapse(n,g)):d.isExpandable(n)&&(h(),g.undoable?y.do("expand",{nodes:n,options:g}):d.expand(n,g)),n.selectable()&&(n.unselectify(),o.scratch("_cyExpandCollapse").selectableChanged=!0))}}),o.on("afterUndo afterRedo",g.eUndoRedo=g.eSelect),o.on("position","node",g.ePosition=a(g.eSelect,100,h)),o.on("pan zoom",g.ePosition),g.hasEventFields=!0,function(e){var n=o.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,o.scratch("_cyExpandCollapse",n)}(g)},unbind:function(){var e=r();e.hasEventFields?(o.trigger("expandcollapse.clearvisualcue"),o.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=r();e.hasEventFields?o.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(o.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(o.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},630:e=>{var o,n,t=(o=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,t,a){var d,i,s,l,r,c,p,u,g,f=0,h=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(t=t<0?0:+t||0,!0===a){var y=!0;v=!1}else g=typeof(u=a),!u||"object"!=g&&"function"!=g||(y=!!a.leading,h="maxWait"in a&&o(+a.maxWait||0,t),v="trailing"in a?!!a.trailing:v);function x(o,t){t&&clearTimeout(t),i=c=p=void 0,o&&(f=n(),s=e.apply(r,d),c||i||(d=r=void 0))}function E(){var e=t-(n()-l);e<=0||e>t?x(p,i):c=setTimeout(E,e)}function m(){x(v,c)}function C(){if(d=arguments,l=n(),r=this,p=v&&(c||!y),!1===h)var o=y&&!c;else{i||y||(f=l);var a=h-(l-f),u=a<=0||a>h;u?(i&&(i=clearTimeout(i)),f=l,s=e.apply(r,d)):i||(i=setTimeout(m,a))}return u&&c?c=clearTimeout(c):c||t===h||(c=setTimeout(E,t)),o&&(u=!0,s=e.apply(r,d)),!u||c||i||(d=r=void 0),s}return C.cancel=function(){c&&clearTimeout(c),i&&clearTimeout(i),f=0,i=c=p=void 0},C});e.exports=t},438:e=>{e.exports=function(e,o,n){let t,a=!0;return function(){const d=this,i=arguments;clearTimeout(t),t=setTimeout((function(){t=null,e.apply(d,i),a=!0}),o),a&&(n.apply(d,i),a=!1)}}},537:e=>{e.exports=function(e){return{moveNodes:function(e,o,n){var t=n?o:this.getTopMostNodes(o),a=t.not(":parent");a.positions((function(o,n){return{x:a[n].position("x")+e.x,y:a[n].position("y")+e.y}}));for(var d=0;d{var t=n(78);e.exports=function(e){var o=n(537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,t,a){if(n._private.data.collapsedChildren){var d={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var i=n._private.data.collapsedChildren;i.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,o){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,o),e.removeData("expand"));for(var n=e.children(),t=0;ts?(r+=g,c-=g):(r-=g,c+=g),e._private.data["y-before-fisheye"]>l?(p+=f,u-=f):(p-=f,u+=f);for(var h=[],v=[],y=0;yC?r:c,E=l>b?p:u,isFinite(w)&&(T=Math.min(x,E/Math.abs(w))),0!==w&&(N=Math.min(E,x*Math.abs(w))),s>C&&(T*=-1),l>b&&(N*=-1),this.fishEyeViewMoveNode(m,T,N,n,o,t,a,d)}return 0==i.length&&e.same(n)&&this.expandNodeBaseFunction(n,o,a),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],o,n,t,a,d),e},getSiblings:function(o){return null==o.parent()[0]?e.nodes(":visible").orphans().difference(o):o.siblings(":visible")},fishEyeViewMoveNode:function(o,n,t,a,d,i,s,l){var r=e.collection();o.isParent()&&(r=o.children(":visible"));var c=this;if(0==r.length){var p={x:o._private.position.x+n,y:o._private.position.y+t};d&&i?(this.animatedlyMovingNodeCount++,o.animate({position:p,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!a.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(a,d,s)}},{duration:l||1e3})):o.position(p)}else for(var u=0;u0?t.add(a):t.add(n)}return t},expandEdge:function(o){o.unselect();var n={edges:e.collection(),oldEdges:e.collection()},t=o.data("collapsedEdges");return void 0!==t&&t.length>0&&(o.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(o),e.remove(o),n.edges=e.add(t),o.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var o=this.getEdgesDistinctEndPoints(e);return 2==o.length&&o},getEdgesDistinctEndPoints:function(e){var o=[];return e.forEach(function(e){this.containsElement(o,e.source())||o.push(e.source()),this.containsElement(o,e.target())||o.push(e.target())}.bind(this)),o},containsElement:function(e,o){for(var n=!1,t=0;t{var t;!function(){"use strict";var a=function(e){if(e){var o=n(699),t=n(540),a=null;e("core","expandCollapse",(function(e){var r=this,c=s(r,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999};if("get"!==e){c=d(c,e);var p=function(e,o){var n={};function r(o){var t=s(e,"options");o.cueEnabled&&!t.cueEnabled?n.enableCue():!o.cueEnabled&&t.cueEnabled&&n.disableCue()}return n.setOptions=function(o){r(o),l(e,"options",o)},n.extendOptions=function(o){var n=d(s(e,"options"),o);r(n),l(e,"options",n)},n.setOption=function(o,n){var t={};t[o]=n;var a=d(s(e,"options"),t);r(a),l(e,"options",a)},n.collapse=function(n,t){var a=this.collapsibleNodes(n),l=d(s(e,"options"),t);return i(l),o.collapseGivenNodes(a,l)},n.collapseRecursively=function(o,n){var t=this.collapsibleNodes(o),a=d(s(e,"options"),n);return i(a),this.collapse(t.union(t.descendants()),a)},n.expand=function(n,t){var a=this.expandableNodes(n),l=d(s(e,"options"),t);return i(l),o.expandGivenNodes(a,l)},n.expandRecursively=function(n,t){var a=this.expandableNodes(n),l=d(s(e,"options"),t);return i(l),o.expandAllNodes(a,l)},n.collapseAll=function(o){var n=d(s(e,"options"),o);return i(n),this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(o){var n=d(s(e,"options"),o);return i(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(o){var n=this;return(o||e.nodes()).filter((function(e,o){return"number"==typeof e&&(e=o),n.isCollapsible(e)}))},n.expandableNodes=function(o){var n=this;return(o||e.nodes()).filter((function(e,o){return"number"==typeof e&&(e=o),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var t=e.collection();return o.getCollapsedChildrenRecursively(n,t)},n.getAllCollapsedChildrenRecursively=function(){var o,n=e.collection(),t=e.nodes(".cy-expand-collapse-collapsed-node");for(o=0;o[e,e])));var c={edges:e.collection(),oldEdges:e.collection()};return r.forEach(function(e){const n=e[1].id();var t=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(t=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),t.length>=2){var a=o.collapseGivenEdges(t,l);c.oldEdges=c.oldEdges.add(a.oldEdges),c.edges=c.edges.add(a.edges)}}.bind(this)),c},n.expandEdgesBetweenNodes=function(o){var n,t,a=e.collection(),d=(t=[],(n=o).slice(0,n.length-1).forEach((function(e,o){n.slice(o+1,n.length).forEach((function(o){t.push([e,o])}))})),t);return d.push(...o.map((e=>[e,e]))),d.forEach(function(e){const o=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+o+'"],[target = "'+o+'"]');e[0].id()===o&&(n=e[0].connectedEdges('[source = "'+o+'"][target = "'+o+'"]')),a=a.union(n)}.bind(this)),this.expandEdges(a)},n.collapseAllEdges=function(o){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),o)},n.expandAllEdges=function(){var o=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},t=this.expandEdges(o);return n.oldEdges=n.oldEdges.add(t.oldEdges),n.edges=n.edges.add(t.edges),n},n.loadJson=function(e){a.loadJson(e)},n.saveJson=function(e,o){return a.saveJson(e,o)},n}(r,n(272)(r));a=n(554)(r,p),l(r,"api",p),o(r,p),t(c,r,p),c.cueEnabled||t("unbind",r,p),c.ready&&c.ready(),l(r,"options",c),l(r,"parentData",{})}return s(r,"api")}))}function d(e,o){var n={};for(var t in e)n[t]=e[t];for(var t in o)n.hasOwnProperty(t)&&(n[t]=o[t]);return n}function i(e){var o="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=o,e.fisheye=n}function s(e,o){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===o?n:n[o]}function l(e,o,n){s(e)[o]=n}};e.exports&&(e.exports=a),void 0===(t=function(){return a}.call(o,n,o,e))||(e.exports=t),"undefined"!=typeof cytoscape&&a(cytoscape)}()},554:e=>{e.exports=function(e,o){function n(o,a,d,i){o.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,o){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),t={layoutBy:null,animate:!1,fisheye:!1},a=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],d=0;d0?o[n](a.options):o[n](c,a.options)):(r.oldData=i(),r.nodes=n.indexOf("All")>0?o[n](t):o[n](e.collection(c),t),s=a.oldData,l={},e.nodes().not(":parent").positions((function(e,o){"number"==typeof e&&(e=o),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),r}}function l(n){var t=n.options,a=n.edges,d={};if(d.options=t,n.firstTime){var i=o.collapseEdges(a,t);d.edges=i.edges,d.oldEdges=i.oldEdges,d.firstTime=!1}else d.oldEdges=a,d.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return d}function r(n){var t=n.options,a={};if(a.options=t,n.firstTime){var d=o.collapseEdgesBetweenNodes(n.nodes,t);a.edges=d.edges,a.oldEdges=d.oldEdges,a.firstTime=!1}else a.edges=n.oldEdges,a.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}function c(n){var t=n.options,a={};if(a.options=t,n.firstTime){var d=o.collapseAllEdges(t);a.edges=d.edges,a.oldEdges=d.oldEdges,a.firstTime=!1}else a.edges=n.oldEdges,a.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}function p(n){var t=n.options,a={};if(a.options=t,n.firstTime){var d=o.expandEdges(n.edges);a.edges=d.edges,a.oldEdges=d.oldEdges,a.firstTime=!1}else a.oldEdges=n.edges,a.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}function u(n){var t=n.options,a={};if(a.options=t,n.firstTime){var d=o.expandEdgesBetweenNodes(n.nodes,t);a.edges=d.edges,a.oldEdges=d.oldEdges,a.firstTime=!1}else a.edges=n.oldEdges,a.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}function g(n){var t=n.options,a={};if(a.options=t,n.firstTime){var d=o.expandAllEdges(t);a.edges=d.edges,a.oldEdges=d.oldEdges,a.firstTime=!1}else a.edges=n.oldEdges,a.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}}}},o={},function n(t){var a=o[t];if(void 0!==a)return a.exports;var d=o[t]={exports:{}};return e[t](d,d.exports,n),d.exports}(497);var e,o})); \ No newline at end of file diff --git a/nr-cytoscape-expand-collapse.js b/nr-cytoscape-expand-collapse.js index a2f7841..b54cd91 100644 --- a/nr-cytoscape-expand-collapse.js +++ b/nr-cytoscape-expand-collapse.js @@ -1 +1,2 @@ -!function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.nrCytoscapeExpandCollapse=o():e.nrCytoscapeExpandCollapse=o()}(this,(()=>{return e={78:e=>{var o={equalBoundingBoxes:function(e,o){return e.x1==o.x1&&e.x2==o.x2&&e.y1==o.y1&&e.y2==o.y2},getUnion:function(e,o){var n={x1:Math.min(e.x1,o.x1),x2:Math.max(e.x2,o.x2),y1:Math.min(e.y1,o.y1),y2:Math.max(e.y2,o.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=o},540:(e,o,n)=>{var t=n(630),a=n(438);e.exports=function(e,o,i){var d,s,l=e;const r=function(){var e=o.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=o.container(),r=e.getContext("2d");l.append(e),d=n(537)(o);var c=function(e){var o=e.getBoundingClientRect();return{top:o.top+document.documentElement.scrollTop,left:o.left+document.documentElement.scrollLeft}},p=t((function(){e.height=o.container().offsetHeight,e.width=o.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),t=c(l);e.style.top=-(n.top-t.top),e.style.left=-(n.left-t.left),o&&h()}),0)}),250);function u(){p()}u();var g={};function f(){return o.scratch("_cyExpandCollapse").options}function h(){var e=o.width(),n=o.height();r.clearRect(0,0,e,n),s=null}function v(e,o,n,t,a){var i=new Image(t,a);i.src=e,i.onload=()=>{r.drawImage(i,o,n,t,a)}}o.on("resize",g.eCyResize=function(){u()}),o.on("expandcollapse.clearvisualcue",(function(){s&&h()}));var y,x=null,E=null;o.on("mousedown",g.eMouseDown=function(e){x=e.renderedPosition||e.cyRenderedPosition}),o.on("mouseup",g.eMouseUp=function(e){E=e.renderedPosition||e.cyRenderedPosition}),o.on("remove","node",g.eRemove=function(e){e.target==s&&h()}),o.on("select unselect",g.eSelect=function(){s&&h();var e=o.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),t=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||t){var a,i=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var p=o.zoom()<1?l/(2*o.zoom()):l/2,u=parseFloat(e.css("border-width"));a={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+u+p+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+u+p+1}}else{var g=f().expandCollapseCuePosition;a="function"==typeof g?g.call(this,e):g}var h=d.convertToRenderedPosition(a),y=((l=Math.max(l,l*o.zoom()))-(c=Math.max(c,c*o.zoom())))/2,x=h.x,E=h.y,m=x-l/2,C=E-l/2,b=l;if(i&&f().expandCueImage)v(f().expandCueImage,m,C,l,l);else if(!i&&f().collapseCueImage)v(f().collapseCueImage,m,C,l,l);else{var w=r.fillStyle,T=r.lineWidth,N=r.strokeStyle;r.fillStyle="black",r.strokeStyle="black",r.ellipse(x,E,l/2,l/2,0,0,2*Math.PI),r.fill(),r.beginPath(),r.strokeStyle="white",r.lineWidth=Math.max(2.6,2.6*o.zoom()),r.moveTo(m+y,C+l/2),r.lineTo(m+c+y,C+l/2),i&&(r.moveTo(m+l/2,C+y),r.lineTo(m+l/2,C+c+y)),r.closePath(),r.stroke(),r.strokeStyle=N,r.fillStyle=w,r.lineWidth=T}e._private.data.expandcollapseRenderedStartX=m,e._private.data.expandcollapseRenderedStartY=C,e._private.data.expandcollapseRenderedCueSize=b,s=e}}(n)}}),o.on("tap",g.eTap=function(e){var n=s;if(n){var t=n.data("expandcollapseRenderedStartX"),a=n.data("expandcollapseRenderedStartY"),d=n.data("expandcollapseRenderedCueSize"),l=t+d,r=a+d,c=e.renderedPosition||e.cyRenderedPosition,p=c.x,u=c.y,g=f(),v=(g.expandCollapseCueSensitivity-1)/2;Math.abs(x.x-E.x)<5&&Math.abs(x.y-E.y)<5&&p>=t-d*v&&p<=l+d*v&&u>=a-d*v&&u<=r+d*v&&(g.undoable&&!y&&(y=o.undoRedo({defaultActions:!1})),i.isCollapsible(n)?(h(),g.undoable?y.do("collapse",{nodes:n,options:g}):i.collapse(n,g)):i.isExpandable(n)&&(h(),g.undoable?y.do("expand",{nodes:n,options:g}):i.expand(n,g)),n.selectable()&&(n.unselectify(),o.scratch("_cyExpandCollapse").selectableChanged=!0))}}),o.on("afterUndo afterRedo",g.eUndoRedo=g.eSelect),o.on("position","node",g.ePosition=a(g.eSelect,100,h)),o.on("pan zoom",g.ePosition),g.hasEventFields=!0,function(e){var n=o.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,o.scratch("_cyExpandCollapse",n)}(g)},unbind:function(){var e=r();e.hasEventFields?(o.trigger("expandcollapse.clearvisualcue"),o.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=r();e.hasEventFields?o.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(o.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(o.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},630:e=>{var o,n,t=(o=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,t,a){var i,d,s,l,r,c,p,u,g,f=0,h=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(t=t<0?0:+t||0,!0===a){var y=!0;v=!1}else g=typeof(u=a),!u||"object"!=g&&"function"!=g||(y=!!a.leading,h="maxWait"in a&&o(+a.maxWait||0,t),v="trailing"in a?!!a.trailing:v);function x(o,t){t&&clearTimeout(t),d=c=p=void 0,o&&(f=n(),s=e.apply(r,i),c||d||(i=r=void 0))}function E(){var e=t-(n()-l);e<=0||e>t?x(p,d):c=setTimeout(E,e)}function m(){x(v,c)}function C(){if(i=arguments,l=n(),r=this,p=v&&(c||!y),!1===h)var o=y&&!c;else{d||y||(f=l);var a=h-(l-f),u=a<=0||a>h;u?(d&&(d=clearTimeout(d)),f=l,s=e.apply(r,i)):d||(d=setTimeout(m,a))}return u&&c?c=clearTimeout(c):c||t===h||(c=setTimeout(E,t)),o&&(u=!0,s=e.apply(r,i)),!u||c||d||(i=r=void 0),s}return C.cancel=function(){c&&clearTimeout(c),d&&clearTimeout(d),f=0,d=c=p=void 0},C});e.exports=t},438:e=>{e.exports=function(e,o,n){let t,a=!0;return function(){const i=this,d=arguments;clearTimeout(t),t=setTimeout((function(){t=null,e.apply(i,d),a=!0}),o),a&&(n.apply(i,d),a=!1)}}},537:(e,o,n)=>{const t=n(86),{reLayout:a}=n(86);e.exports=function(e){return{moveNodes:function(e,o,n){var t=n?o:this.getTopMostNodes(o),a=t.not(":parent");a.positions((function(o,n){return{x:a[n].position("x")+e.x,y:a[n].position("y")+e.y}}));for(var i=0;i{var t=n(78);e.exports=function(e){var o=n(537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,t,a){if(n._private.data.collapsedChildren){var i={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var d=n._private.data.collapsedChildren;d.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,o){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,o),e.removeData("expand"));for(var n=e.children(),t=0;ts?(r+=g,c-=g):(r-=g,c+=g),e._private.data["y-before-fisheye"]>l?(p+=f,u-=f):(p-=f,u+=f);for(var h=[],v=[],y=0;yC?r:c,E=l>b?p:u,isFinite(w)&&(T=Math.min(x,E/Math.abs(w))),0!==w&&(N=Math.min(E,x*Math.abs(w))),s>C&&(T*=-1),l>b&&(N*=-1),this.fishEyeViewMoveNode(m,T,N,n,o,t,a,i)}return 0==d.length&&e.same(n)&&this.expandNodeBaseFunction(n,o,a),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],o,n,t,a,i),e},getSiblings:function(o){return null==o.parent()[0]?e.nodes(":visible").orphans().difference(o):o.siblings(":visible")},fishEyeViewMoveNode:function(o,n,t,a,i,d,s,l){var r=e.collection();o.isParent()&&(r=o.children(":visible"));var c=this;if(0==r.length){var p={x:o._private.position.x+n,y:o._private.position.y+t};i&&d?(this.animatedlyMovingNodeCount++,o.animate({position:p,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!a.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(a,i,s)}},{duration:l||1e3})):o.position(p)}else for(var u=0;u0?t.add(a):t.add(n)}return t},expandEdge:function(o){o.unselect();var n={edges:e.collection(),oldEdges:e.collection()},t=o.data("collapsedEdges");return void 0!==t&&t.length>0&&(o.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(o),e.remove(o),n.edges=e.add(t),o.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var o=this.getEdgesDistinctEndPoints(e);return 2==o.length&&o},getEdgesDistinctEndPoints:function(e){var o=[];return e.forEach(function(e){this.containsElement(o,e.source())||o.push(e.source()),this.containsElement(o,e.target())||o.push(e.target())}.bind(this)),o},containsElement:function(e,o){for(var n=!1,t=0;t{var t;!function(){"use strict";var a=function(e){if(e){var o=n(699),t=n(540),a=null;e("core","expandCollapse",(function(e){var r=this,c=s(r,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999};if("get"!==e){c=i(c,e);var p=function(e,o){var n={};function r(o){var t=s(e,"options");o.cueEnabled&&!t.cueEnabled?n.enableCue():!o.cueEnabled&&t.cueEnabled&&n.disableCue()}return n.setOptions=function(o){r(o),l(e,"options",o)},n.extendOptions=function(o){var n=i(s(e,"options"),o);r(n),l(e,"options",n)},n.setOption=function(o,n){var t={};t[o]=n;var a=i(s(e,"options"),t);r(a),l(e,"options",a)},n.collapse=function(n,t){var a=this.collapsibleNodes(n),l=i(s(e,"options"),t);return d(l),o.collapseGivenNodes(a,l)},n.collapseRecursively=function(o,n){var t=this.collapsibleNodes(o),a=i(s(e,"options"),n);return d(a),this.collapse(t.union(t.descendants()),a)},n.expand=function(n,t){var a=this.expandableNodes(n),l=i(s(e,"options"),t);return d(l),o.expandGivenNodes(a,l)},n.expandRecursively=function(n,t){var a=this.expandableNodes(n),l=i(s(e,"options"),t);return d(l),o.expandAllNodes(a,l)},n.collapseAll=function(o){var n=i(s(e,"options"),o);return d(n),this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(o){var n=i(s(e,"options"),o);return d(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(o){var n=this;return(o||e.nodes()).filter((function(e,o){return"number"==typeof e&&(e=o),n.isCollapsible(e)}))},n.expandableNodes=function(o){var n=this;return(o||e.nodes()).filter((function(e,o){return"number"==typeof e&&(e=o),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var t=e.collection();return o.getCollapsedChildrenRecursively(n,t)},n.getAllCollapsedChildrenRecursively=function(){var o,n=e.collection(),t=e.nodes(".cy-expand-collapse-collapsed-node");for(o=0;o[e,e])));var c={edges:e.collection(),oldEdges:e.collection()};return r.forEach(function(e){const n=e[1].id();var t=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(t=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),t.length>=2){var a=o.collapseGivenEdges(t,l);c.oldEdges=c.oldEdges.add(a.oldEdges),c.edges=c.edges.add(a.edges)}}.bind(this)),c},n.expandEdgesBetweenNodes=function(o){var n,t,a=e.collection(),i=(t=[],(n=o).slice(0,n.length-1).forEach((function(e,o){n.slice(o+1,n.length).forEach((function(o){t.push([e,o])}))})),t);return i.push(...o.map((e=>[e,e]))),i.forEach(function(e){const o=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+o+'"],[target = "'+o+'"]');e[0].id()===o&&(n=e[0].connectedEdges('[source = "'+o+'"][target = "'+o+'"]')),a=a.union(n)}.bind(this)),this.expandEdges(a)},n.collapseAllEdges=function(o){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),o)},n.expandAllEdges=function(){var o=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},t=this.expandEdges(o);return n.oldEdges=n.oldEdges.add(t.oldEdges),n.edges=n.edges.add(t.edges),n},n.loadJson=function(e){a.loadJson(e)},n.saveJson=function(e,o){return a.saveJson(e,o)},n}(r,n(272)(r));a=n(554)(r,p),l(r,"api",p),o(r,p),t(c,r,p),c.cueEnabled||t("unbind",r,p),c.ready&&c.ready(),l(r,"options",c),l(r,"parentData",{})}return s(r,"api")}))}function i(e,o){var n={};for(var t in e)n[t]=e[t];for(var t in o)n.hasOwnProperty(t)&&(n[t]=o[t]);return n}function d(e){var o="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=o,e.fisheye=n}function s(e,o){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===o?n:n[o]}function l(e,o,n){s(e)[o]=n}};e.exports&&(e.exports=a),void 0===(t=function(){return a}.call(o,n,o,e))||(e.exports=t),"undefined"!=typeof cytoscape&&a(cytoscape)}()},86:e=>{function o(e,n,t){var a=t?n:function(e){for(var o={},n=0;n{e.on("layoutstop",o),e.run()}))};e.exports=async function(e,t){if(e.nodes().filter((e=>"fake"===e.data().type)).length)return;const a=function(e){const o={};return e.filter((e=>"default"!==e.data().type)).forEach((e=>{const n=e.data().parent;if(void 0===n)o[1]||(o[1]={root:[]}),o[1].root.push(e);else{const t=n.split("::").length+1;o[t]||(o[t]={}),o[t][n]||(o[t][n]=[]),o[t][n].push(e)}})),Object.keys(o).sort(((e,o)=>parseInt(e)-parseInt(o))).map(((e,n)=>({level:n+1,items:"1"===e?[o[e].root]:Object.values(o[e])}))).reverse()??[]}(e.nodes());for(let i=0;i{if(!o.hasClass("cy-expand-collapse-collapsed-node")&&o.isParent()){const n=`sibling ${o.data().id}`,t={group:"nodes",data:{id:n,parent:o.data().parent,type:"fake",label:`sibling ${o.data().label}`},style:{width:o.boundingBox().w,height:o.boundingBox().h,padding:0,"min-width":0,"border-width":0,shape:"round-rectangle","background-color":"#3A444B","background-opacity":.48},position:{x:o.position("x"),y:o.position("y")}};e.add(t);const a=o.remove();d=d.union(a);const i=e.getElementById(n);return s=s.union(i),i}return o}));l=l.union(n)}if(0===d.length&&1===a.length){const e=l.layout(t);await n(e)}else if(d.length>0){const a=l.layout(t);await n(a),d.restore(),d.forEach((n=>{if("edges"!==n.group()||"default"===n.data()?.type){const t=`sibling ${n.data().id}`,a=e.getElementById(t);if(a?.length){const e={x:n.position().x{e.exports=function(e,o){function n(o,a,i,d){o.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,o){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),t={layoutBy:null,animate:!1,fisheye:!1},a=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],i=0;i0?o[n](a.options):o[n](c,a.options)):(r.oldData=d(),r.nodes=n.indexOf("All")>0?o[n](t):o[n](e.collection(c),t),s=a.oldData,l={},e.nodes().not(":parent").positions((function(e,o){"number"==typeof e&&(e=o),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),r}}function l(n){var t=n.options,a=n.edges,i={};if(i.options=t,n.firstTime){var d=o.collapseEdges(a,t);i.edges=d.edges,i.oldEdges=d.oldEdges,i.firstTime=!1}else i.oldEdges=a,i.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function r(n){var t=n.options,a={};if(a.options=t,n.firstTime){var i=o.collapseEdgesBetweenNodes(n.nodes,t);a.edges=i.edges,a.oldEdges=i.oldEdges,a.firstTime=!1}else a.edges=n.oldEdges,a.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}function c(n){var t=n.options,a={};if(a.options=t,n.firstTime){var i=o.collapseAllEdges(t);a.edges=i.edges,a.oldEdges=i.oldEdges,a.firstTime=!1}else a.edges=n.oldEdges,a.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}function p(n){var t=n.options,a={};if(a.options=t,n.firstTime){var i=o.expandEdges(n.edges);a.edges=i.edges,a.oldEdges=i.oldEdges,a.firstTime=!1}else a.oldEdges=n.edges,a.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}function u(n){var t=n.options,a={};if(a.options=t,n.firstTime){var i=o.expandEdgesBetweenNodes(n.nodes,t);a.edges=i.edges,a.oldEdges=i.oldEdges,a.firstTime=!1}else a.edges=n.oldEdges,a.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}function g(n){var t=n.options,a={};if(a.options=t,n.firstTime){var i=o.expandAllEdges(t);a.edges=i.edges,a.oldEdges=i.oldEdges,a.firstTime=!1}else a.edges=n.oldEdges,a.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return a}}}},o={},function n(t){var a=o[t];if(void 0!==a)return a.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,n),i.exports}(497);var e,o})); \ No newline at end of file +/*! For license information please see nr-cytoscape-expand-collapse.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.nrCytoscapeExpandCollapse=t():e.nrCytoscapeExpandCollapse=t()}(this,(()=>(()=>{var e={6078:e=>{var t={equalBoundingBoxes:function(e,t){return e.x1==t.x1&&e.x2==t.x2&&e.y1==t.y1&&e.y2==t.y2},getUnion:function(e,t){var n={x1:Math.min(e.x1,t.x1),x2:Math.max(e.x2,t.x2),y1:Math.min(e.y1,t.y1),y2:Math.max(e.y2,t.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=t},4540:(e,t,n)=>{var r=n(3630),i=n(438);e.exports=function(e,t,o){var a,s,l=e;const u=function(){var e=t.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=t.container(),u=e.getContext("2d");l.append(e),a=n(1537)(t);var c=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}},d=r((function(){e.height=t.container().offsetHeight,e.width=t.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),r=c(l);e.style.top=-(n.top-r.top),e.style.left=-(n.left-r.left),t&&g()}),0)}),250);function h(){d()}h();var p={};function f(){return t.scratch("_cyExpandCollapse").options}function g(){var e=t.width(),n=t.height();u.clearRect(0,0,e,n),s=null}function v(e,t,n,r,i){var o=new Image(r,i);o.src=e,o.onload=()=>{u.drawImage(o,t,n,r,i)}}t.on("resize",p.eCyResize=function(){h()}),t.on("expandcollapse.clearvisualcue",(function(){s&&g()}));var y,m=null,b=null;t.on("mousedown",p.eMouseDown=function(e){m=e.renderedPosition||e.cyRenderedPosition}),t.on("mouseup",p.eMouseUp=function(e){b=e.renderedPosition||e.cyRenderedPosition}),t.on("remove","node",p.eRemove=function(e){e.target==s&&g()}),t.on("select unselect",p.eSelect=function(){s&&g();var e=t.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),r=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||r){var i,o=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var d=t.zoom()<1?l/(2*t.zoom()):l/2,h=parseFloat(e.css("border-width"));i={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+h+d+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+h+d+1}}else{var p=f().expandCollapseCuePosition;i="function"==typeof p?p.call(this,e):p}var g=a.convertToRenderedPosition(i),y=((l=Math.max(l,l*t.zoom()))-(c=Math.max(c,c*t.zoom())))/2,m=g.x,b=g.y,x=m-l/2,w=b-l/2,E=l;if(o&&f().expandCueImage)v(f().expandCueImage,x,w,l,l);else if(!o&&f().collapseCueImage)v(f().collapseCueImage,x,w,l,l);else{var _=u.fillStyle,C=u.lineWidth,T=u.strokeStyle;u.fillStyle="black",u.strokeStyle="black",u.ellipse(m,b,l/2,l/2,0,0,2*Math.PI),u.fill(),u.beginPath(),u.strokeStyle="white",u.lineWidth=Math.max(2.6,2.6*t.zoom()),u.moveTo(x+y,w+l/2),u.lineTo(x+c+y,w+l/2),o&&(u.moveTo(x+l/2,w+y),u.lineTo(x+l/2,w+c+y)),u.closePath(),u.stroke(),u.strokeStyle=T,u.fillStyle=_,u.lineWidth=C}e._private.data.expandcollapseRenderedStartX=x,e._private.data.expandcollapseRenderedStartY=w,e._private.data.expandcollapseRenderedCueSize=E,s=e}}(n)}}),t.on("tap",p.eTap=function(e){var n=s;if(n){var r=n.data("expandcollapseRenderedStartX"),i=n.data("expandcollapseRenderedStartY"),a=n.data("expandcollapseRenderedCueSize"),l=r+a,u=i+a,c=e.renderedPosition||e.cyRenderedPosition,d=c.x,h=c.y,p=f(),v=(p.expandCollapseCueSensitivity-1)/2;Math.abs(m.x-b.x)<5&&Math.abs(m.y-b.y)<5&&d>=r-a*v&&d<=l+a*v&&h>=i-a*v&&h<=u+a*v&&(p.undoable&&!y&&(y=t.undoRedo({defaultActions:!1})),o.isCollapsible(n)?(g(),p.undoable?y.do("collapse",{nodes:n,options:p}):o.collapse(n,p)):o.isExpandable(n)&&(g(),p.undoable?y.do("expand",{nodes:n,options:p}):o.expand(n,p)),n.selectable()&&(n.unselectify(),t.scratch("_cyExpandCollapse").selectableChanged=!0))}}),t.on("afterUndo afterRedo",p.eUndoRedo=p.eSelect),t.on("position","node",p.ePosition=i(p.eSelect,100,g)),t.on("pan zoom",p.ePosition),p.hasEventFields=!0,function(e){var n=t.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,t.scratch("_cyExpandCollapse",n)}(p)},unbind:function(){var e=u();e.hasEventFields?(t.trigger("expandcollapse.clearvisualcue"),t.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=u();e.hasEventFields?t.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(t.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(t.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},3630:e=>{var t,n,r=(t=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,r,i){var o,a,s,l,u,c,d,h,p,f=0,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(r=r<0?0:+r||0,!0===i){var y=!0;v=!1}else p=typeof(h=i),!h||"object"!=p&&"function"!=p||(y=!!i.leading,g="maxWait"in i&&t(+i.maxWait||0,r),v="trailing"in i?!!i.trailing:v);function m(t,r){r&&clearTimeout(r),a=c=d=void 0,t&&(f=n(),s=e.apply(u,o),c||a||(o=u=void 0))}function b(){var e=r-(n()-l);e<=0||e>r?m(d,a):c=setTimeout(b,e)}function x(){m(v,c)}function w(){if(o=arguments,l=n(),u=this,d=v&&(c||!y),!1===g)var t=y&&!c;else{a||y||(f=l);var i=g-(l-f),h=i<=0||i>g;h?(a&&(a=clearTimeout(a)),f=l,s=e.apply(u,o)):a||(a=setTimeout(x,i))}return h&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(b,r)),t&&(h=!0,s=e.apply(u,o)),!h||c||a||(o=u=void 0),s}return w.cancel=function(){c&&clearTimeout(c),a&&clearTimeout(a),f=0,a=c=d=void 0},w});e.exports=r},438:e=>{e.exports=function(e,t,n){let r,i=!0;return function(){const o=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,e.apply(o,a),i=!0}),t),i&&(n.apply(o,a),i=!1)}}},1537:(e,t,n)=>{const{runLayoutAsync:r}=n(8647);e.exports=function(e){return{moveNodes:function(e,t,n){var r=n?t:this.getTopMostNodes(t),i=r.not(":parent");i.positions((function(t,n){return{x:i[n].position("x")+e.x,y:i[n].position("y")+e.y}}));for(var o=0;o"group"===e.data().type)).length){const n={};(e?.scratch("_cyExpandCollapse")?.positions??[]).forEach((({nodeId:e,position:t})=>{n[e]=t})),await r(e.layout({name:"preset",fit:!1,positions:n,zoom:e.zoom(),pan:e.pan(),padding:t?.padding??50,animate:t?.animate??!0,animationDuration:t?.animationDuration??500,animationEasing:t?.animationEasing}))}e.scratch("_cyExpandCollapse").positions=null}},convertToRenderedPosition:function(t){var n=e.pan(),r=e.zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}}}},9272:(e,t,n)=>{var r=n(6078);e.exports=function(e){var t=n(1537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,r,i){if(n._private.data.collapsedChildren){var o={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var a=n._private.data.collapsedChildren;a.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,t){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,t),e.removeData("expand"));for(var n=e.children(),r=0;rs?(u+=p,c-=p):(u-=p,c+=p),e._private.data["y-before-fisheye"]>l?(d+=f,h-=f):(d-=f,h+=f);for(var g=[],v=[],y=0;yw?u:c,b=l>E?d:h,isFinite(_)&&(C=Math.min(m,b/Math.abs(_))),0!==_&&(T=Math.min(b,m*Math.abs(_))),s>w&&(C*=-1),l>E&&(T*=-1),this.fishEyeViewMoveNode(x,C,T,n,t,r,i,o)}return 0==a.length&&e.same(n)&&this.expandNodeBaseFunction(n,t,i),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],t,n,r,i,o),e},getSiblings:function(t){return null==t.parent()[0]?e.nodes(":visible").orphans().difference(t):t.siblings(":visible")},fishEyeViewMoveNode:function(t,n,r,i,o,a,s,l){var u=e.collection();t.isParent()&&(u=t.children(":visible"));var c=this;if(0==u.length){var d={x:t._private.position.x+n,y:t._private.position.y+r};o&&a?(this.animatedlyMovingNodeCount++,t.animate({position:d,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!i.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(i,o,s)}},{duration:l||1e3})):t.position(d)}else for(var h=0;h0?r.add(i):r.add(n)}return r},expandEdge:function(t){t.unselect();var n={edges:e.collection(),oldEdges:e.collection()},r=t.data("collapsedEdges");return void 0!==r&&r.length>0&&(t.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(t),e.remove(t),n.edges=e.add(r),t.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var t=this.getEdgesDistinctEndPoints(e);return 2==t.length&&t},getEdgesDistinctEndPoints:function(e){var t=[];return e.forEach(function(e){this.containsElement(t,e.source())||t.push(e.source()),this.containsElement(t,e.target())||t.push(e.target())}.bind(this)),t},containsElement:function(e,t){for(var n=!1,r=0;r{const r=n(4726),i=n(6527),o=n(5111);e.exports=function(e){const t=e.json();let n=document.getElementById("support-map");return n.style.width=e.container().clientWidth+"px",n.style.height=e.container().clientHeight+"px",r.use(i),r.use(o),r({container:n,elements:t.elements,styleEnabled:!0,style:t.style})}},4497:(e,t,n)=>{var r;!function(){"use strict";var i=function(e){if(!e)return;var t=n(9699),r=n(4540);const i=n(3666),{runLayoutAsync:o,resolveCompoundNodesOverlap:a}=n(8647);var s=null;function l(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n.hasOwnProperty(r)&&(n[r]=t[r]);return n}function u(e){var t="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=t,e.fisheye=n}function c(e,t){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===t?n:n[t]}function d(e,t,n){c(e)[t]=n}e("core","expandCollapse",(function(e){var h=this;const p=document.querySelector(".map.__________cytoscape_container");if(p){const e=document.createElement("div");e.id="support-map",e.style.zIndex=-1,e.style.opacity=0,p.parentNode.insertBefore(e,p.nextSibling)}else console.log("Element not found");var f=c(h,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999,isGroupBy:!0};if("get"!==e){f=l(f,e);var g=function(e,t){var n={};function h(t){var r=c(e,"options");t.cueEnabled&&!r.cueEnabled?n.enableCue():!t.cueEnabled&&r.cueEnabled&&n.disableCue()}return n.setOptions=function(t){h(t),d(e,"options",t)},n.extendOptions=function(t){var n=l(c(e,"options"),t);h(n),d(e,"options",n)},n.setOption=function(t,n){var r={};r[t]=n;var i=l(c(e,"options"),r);h(i),d(e,"options",i)},n.collapse=async function(n,r){var s=this.collapsibleNodes(n);if(r?.isGroupBy){var h=i(e),p=s.map((e=>{var t=h.getElementById(e.id());return t.toggleClass("expanded",!1),t.toggleClass("cy-expand-collapse-collapsed-node",!0),t.toggleClass("collapsed",!0),t}));if(p.length){var f=h.collection(p);t.simpleCollapseGivenNodes(f);var g=c(e,"options").layoutBy;await o(h.layout({...g,animate:!1})),await a(h,{...g,animate:!1});var v=h.nodes().map((e=>({nodeId:e.id(),position:e.position()})));h.destroy(),d(e,"positions",v)}}var y=l(c(e,"options"),r);return u(y),t.collapseGivenNodes(s,y)},n.collapseRecursively=async function(t,n){var r=this.collapsibleNodes(t),i=l(c(e,"options"),n);return u(i),await this.collapse(r.union(r.descendants()),i)},n.expand=async function(n,r){if(r?.isGroupBy){var s=i(e),h=s.getElementById(n.id()),p=h._private.data.collapsedChildren;s.add(p),h.toggleClass("cy-expand-collapse-collapsed-node",!1),h.toggleClass("collapsed",!1),h.toggleClass("expanded",!0);var f=c(e,"options").layoutBy;await o(s.layout({...f,animate:!1})),await a(s,{...f,animate:!1});var g=s.nodes().map((e=>({nodeId:e.id(),position:e.position()})));s.destroy(),d(e,"positions",g)}var v=this.expandableNodes(n),y=l(c(e,"options"),r);return u(y),t.expandGivenNodes(v,y)},n.expandRecursively=function(n,r){var i=this.expandableNodes(n),o=l(c(e,"options"),r);return u(o),t.expandAllNodes(i,o)},n.collapseAll=async function(t){var n=l(c(e,"options"),t);return u(n),await this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(t){var n=l(c(e,"options"),t);return u(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isCollapsible(e)}))},n.expandableNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var r=e.collection();return t.getCollapsedChildrenRecursively(n,r)},n.getAllCollapsedChildrenRecursively=function(){var t,n=e.collection(),r=e.nodes(".cy-expand-collapse-collapsed-node");for(t=0;t[e,e])));var u={edges:e.collection(),oldEdges:e.collection()};return s.forEach(function(e){const n=e[1].id();var r=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(r=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),r.length>=2){var i=t.collapseGivenEdges(r,a);u.oldEdges=u.oldEdges.add(i.oldEdges),u.edges=u.edges.add(i.edges)}}.bind(this)),u},n.expandEdgesBetweenNodes=function(t){var n,r,i=e.collection(),o=(r=[],(n=t).slice(0,n.length-1).forEach((function(e,t){n.slice(t+1,n.length).forEach((function(t){r.push([e,t])}))})),r);return o.push(...t.map((e=>[e,e]))),o.forEach(function(e){const t=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+t+'"],[target = "'+t+'"]');e[0].id()===t&&(n=e[0].connectedEdges('[source = "'+t+'"][target = "'+t+'"]')),i=i.union(n)}.bind(this)),this.expandEdges(i)},n.collapseAllEdges=function(t){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),t)},n.expandAllEdges=function(){var t=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},r=this.expandEdges(t);return n.oldEdges=n.oldEdges.add(r.oldEdges),n.edges=n.edges.add(r.edges),n},n.loadJson=function(e){s.loadJson(e)},n.saveJson=function(e,t){return s.saveJson(e,t)},n}(h,n(9272)(h));s=n(554)(h,g),d(h,"api",g),t(h,g),r(f,h,g),f.cueEnabled||r("unbind",h,g),f.ready&&f.ready(),d(h,"options",f),d(h,"parentData",{})}return c(h,"api")}))};e.exports&&(e.exports=i),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r),"undefined"!=typeof cytoscape&&i(cytoscape)}()},8647:(e,t,n)=>{function r(e){return new Promise((t=>{e.on("layoutstop",t),e.run()}))}e.exports={runLayoutAsync:r,resolveCompoundNodesOverlap:async function(e,t){const i=n(1537)(e);if(e.nodes().filter((e=>"positioning-support"===e.data().type)).length)return;const o=function(e){const t={};return e.filter((e=>"default"!==e.data().type)).forEach((e=>{const n=e.data().parent;if(void 0===n)t[1]||(t[1]={root:[]}),t[1].root.push(e);else{const r=n.split("::").length+1;t[r]||(t[r]={}),t[r][n]||(t[r][n]=[]),t[r][n].push(e)}})),Object.keys(t).sort(((e,t)=>parseInt(e)-parseInt(t))).map(((e,n)=>({level:n+1,items:"1"===e?[t[e].root]:Object.values(t[e])}))).reverse()??[]}(e.nodes());for(let n=0;n{if(!t.hasClass("cy-expand-collapse-collapsed-node")&&t.isParent()){const n=`support ${t.data().id}`,r={group:"nodes",data:{id:n,parent:t.data().parent,type:"positioning-support",label:`${t.data().label}`},style:{width:t.boundingBox().w,height:t.boundingBox().h,padding:0,"min-width":0,"border-width":0,shape:"round-rectangle"},position:{x:t.position("x"),y:t.position("y")}};e.add(r);const i=t.remove();a=a.union(i);const o=e.getElementById(n);return s=s.union(o),o}return t}));l=l.union(r)}if(0===a.length&&1===o.length){const e=l.layout(t);await r(e)}else if(a.length>0){const n=l.layout(t);await r(n),a.restore(),a.forEach((t=>{if("edges"!==t.group()||"default"===t.data()?.type){const n=`support ${t.data().id}`,r=e.getElementById(n);if(r?.length){const e={x:t.position().x{e.exports=function(e,t){function n(t,i,o,a){t.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,t){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),r={layoutBy:null,animate:!1,fisheye:!1},i=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],o=0;o0?t[n](i.options):t[n](c,i.options)):(u.oldData=a(),u.nodes=n.indexOf("All")>0?t[n](r):t[n](e.collection(c),r),s=i.oldData,l={},e.nodes().not(":parent").positions((function(e,t){"number"==typeof e&&(e=t),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),u}}function l(n){var r=n.options,i=n.edges,o={};if(o.options=r,n.firstTime){var a=t.collapseEdges(i,r);o.edges=a.edges,o.oldEdges=a.oldEdges,o.firstTime=!1}else o.oldEdges=i,o.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return o}function u(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function c(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function d(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdges(n.edges);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.oldEdges=n.edges,i.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function h(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function p(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}}},7799:function(e,t,n){var r;r=function(e){return(()=>{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var o in r)i[o]=r[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),o=n(880),a=n(991),s=n(767),l=n(806),u=n(902),c=n(551).FDLayoutConstants,d=n(551).LayoutConstants,h=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,v=n(551).Integer,y=n(551).IGeometry,m=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},w.prototype.newNode=function(e){return new a(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var n=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,o=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(o)||(e.nodesInRelativeVertical.push(o),e.nodeToRelativeConstraintMapVertical.set(o,[]),e.dummyToNodeForHorizontalAlignment.has(o)?e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(o).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:t.gap})}}));else{var d=new Map,h=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var t=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;h.has(r)?h.get(r).push(i):h.set(r,[i]),h.has(i)?h.get(i).push(r):h.set(i,[r])}}));var p=function(e,t){var n=[],r=[],i=new x,o=new Set,a=0;return e.forEach((function(s,l){if(!o.has(l)){n[a]=[],r[a]=!1;var u=l;for(i.push(u),o.add(u),n[a].push(u);0!=i.length;)u=i.shift(),t.has(u)&&(r[a]=!0),e.get(u).forEach((function(e){o.has(e)||(i.push(e),o.add(e),n[a].push(e))}));a++}})),{components:n,isFixed:r}},f=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(h,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(a.y)),o=Math.floor(a.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-a.x/2,d.WORLD_CENTER_Y-a.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),o=new b;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(n.x),o.setWorldOrgY(n.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=c.indexOf(v);m>=0&&c.splice(m,1),f--,d--}h=null!=t?(c.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/d,x=h;p!=d;x=++x%f){var E=c[x].getOtherEnd(e);if(E!=t){var _=(n+p*b)%360,C=(_+b)%360;w.branchRadialLayout(E,e,_,C,i+o,o),p++}}},w.maxDiagonalInTree=function(e){for(var t=v.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),o=new a(e.graphManager);o.id=r,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=o;var s=e.getGraphManager().add(e.newGraph(),o),l=i.getChild();l.add(o);for(var u=0;ui?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):"bottom"==r.labelPosVertical&&r.setHeight(o+r.labelHeight))}}))},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,o=t.labelMarginLeft,a=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,o,a)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,o=r.paddingTop,a=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,o,a,s)}))},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=h.rect.height)}n+=c+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())}));var u,c=o/i,d=a/i,h=Math.pow(n-r,2)+4*(c+r)*(d+n)*i,p=(r-n+Math.sqrt(h))/(2*(c+r));t?(u=Math.ceil(p))==p&&u++:u=Math.floor(p);var f=u*(c+r)-r;return s>f&&(f=s),f+2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},u=function(e,t){return s(t)-s(e)};e.sort((function(e,t){var n=u;return a.idealRowWidth?(n=o)(e.id,t.id):n(e,t)}));for(var c=0,d=0,h=0;h0&&(o+=e.horizontalPadding),e.rowWidth[n]=o,e.width0&&(a+=e.verticalPadding);var s=0;a>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=a,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var o=e.rowWidth[i];if(o+e.horizontalPadding+t<=e.width)return!0;var a,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),a=e.width-o>=t+e.horizontalPadding?(e.height+l)/(o+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtho&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-o,e.rowWidth[n]=e.rowWidth[n]+o,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=r[s].height);t>0&&(a+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=a,e.rowHeight[n]0)for(var d=i;d<=o;d++)u[0]+=this.grid[d][a-1].length+this.grid[d][a].length-1;if(o0)for(d=a;d<=s;d++)u[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var h,p,f=v.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function o(e,t,n,i){r.call(this,e,t,n,i)}for(var a in o.prototype=Object.create(r.prototype),r)o[a]=r[a];o.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var o=0;r.forEach((function(e){"horizontal"==t?(d.set(e,l.has(e)?u[l.get(e)]:i.get(e)),o+=d.get(e)):(d.set(e,l.has(e)?c[l.get(e)]:i.get(e)),o+=d.get(e))})),o/=r.length,e.forEach((function(e){n.has(e)||d.set(e,o)}))}else{var a=0;e.forEach((function(e){a+="horizontal"==t?l.has(e)?u[l.get(e)]:i.get(e):l.has(e)?c[l.get(e)]:i.get(e)})),a/=e.length,e.forEach((function(e){d.set(e,a)}))}}));for(var f=function(){var r=p.shift();e.get(r).forEach((function(e){if(d.get(e.id)a&&(a=y),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!h&&v.return&&v.return()}finally{if(p)throw f}}var x=(r+a)/2-(o+s)/2,w=!0,E=!1,_=void 0;try{for(var C,T=e[Symbol.iterator]();!(w=(C=T.next()).done);w=!0){var N=C.value;d.set(N,d.get(N)+x)}}catch(e){E=!0,_=e}finally{try{!w&&T.return&&T.return()}finally{if(E)throw _}}}))}return d},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach((function(e){e.left?u[l.get(e.left)]-u[l.get(e.right)]>=0?t++:n++:c[l.get(e.top)]-c[l.get(e.bottom)]>=0?r++:i++})),t>n&&r>i)for(var o=0;on)for(var a=0;ai)for(var s=0;s1)t.fixedNodeConstraint.forEach((function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[u[l.get(e.nodeId)],c[l.get(e.nodeId)]]})),_=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach((function(e){i.add(e)}));var o,a=new Set([].concat(r(i)).filter((function(e){return T.has(e)})));o=a.size>0?u[l.get(a.values().next().value)]:g(i).x,n[t].forEach((function(t){w[e]=[o,c[l.get(t)]],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},o=0;o0?u[l.get(o.values().next().value)]:g(n).y,a[t].forEach((function(t){w[e]=[u[l.get(t)],i],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},d=0;dD&&(D=A[O].length,I=O);if(D0){var W={x:0,y:0};t.fixedNodeConstraint.forEach((function(e,t){var n,r,i=(r={x:u[l.get(e.nodeId)],y:c[l.get(e.nodeId)]},{x:(n=e.position).x-r.x,y:n.y-r.y});W.x+=i.x,W.y+=i.y})),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,u.forEach((function(e,t){u[t]+=W.x})),c.forEach((function(e,t){c[t]+=W.y})),t.fixedNodeConstraint.forEach((function(e){u[l.get(e.nodeId)]=e.position.x,c[l.get(e.nodeId)]=e.position.y}))}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var q=t.alignmentConstraint.vertical,K=function(e){var t=new Set;q[e].forEach((function(e){t.add(e)}));var n,i=new Set([].concat(r(t)).filter((function(e){return T.has(e)})));n=i.size>0?u[l.get(i.values().next().value)]:g(t).x,t.forEach((function(e){T.has(e)||(u[l.get(e)]=n)}))},Z=0;Z0?c[l.get(i.values().next().value)]:g(t).y,t.forEach((function(e){T.has(e)||(c[l.get(e)]=n)}))},J=0;J<$.length;J++)Q(J)}t.relativePlacementConstraint&&function(){var e=new Map,n=new Map,r=new Map,i=new Map,o=new Map,a=new Map,s=new Set,d=new Set;if(T.forEach((function(e){s.add(e),d.add(e)})),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var h=t.alignmentConstraint.vertical,p=function(t){r.set("dummy"+t,[]),h[t].forEach((function(n){e.set(n,"dummy"+t),r.get("dummy"+t).push(n),T.has(n)&&s.add("dummy"+t)})),o.set("dummy"+t,u[l.get(h[t][0])])},f=0;f{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(45);return r})()},e.exports=r(n(3143))},5111:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=function(e){return"function"==typeof e},o=n(2),a=n(3),s=n(4);function l(e){this.options=a({},o,e)}l.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=function(e,t){return i(t)?t.apply(e,[e]):t},a=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===a.x2&&(a.x2=a.x1+a.w),void 0===a.w&&(a.w=a.x2-a.x1),void 0===a.y2&&(a.y2=a.y1+a.h),void 0===a.h&&(a.h=a.y2-a.y1);var l=new s.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),l.setGraph(u),l.setDefaultEdgeLabel((function(){return{}})),l.setDefaultNodeLabel((function(){return{}}));var d=n.nodes();i(e.sort)&&(d=d.sort(e.sort));for(var h=0;h1?t-1:0),r=1;r{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,o={getTopMostNodes:function(e){for(var t={},n=0;n0&&u.merge(e)}));for(var c=0;c1){u=s[0],c=u.connectedEdges().length,s.forEach((function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,u=!1,c=void 0;try{for(var d,h=t.nodeIndexes[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=r(p,2),g=f[0],v=f[1],y=n.cy.getElementById(g);if(y){var m=y.boundingBox(),b=t.xCoords[v]-m.w/2,x=t.xCoords[v]+m.w/2,w=t.yCoords[v]-m.h/2,E=t.yCoords[v]+m.h/2;bo&&(o=x),ws&&(s=E)}}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}var _=e.x-(o+i)/2,C=e.y-(s+a)/2;t.xCoords=t.xCoords.map((function(e){return e+_})),t.yCoords=t.yCoords.map((function(e){return e+C}))}else{Object.keys(t).forEach((function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,u=n.getRect().y,c=n.getRect().y+n.getRect().height;ro&&(o=l),us&&(s=c)}));var T=e.x-(o+i)/2,N=e.y-(s+a)/2;Object.keys(t).forEach((function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+N)}))}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,u=void 0,c=void 0,d=void 0,h=e.descendants().not(":parent"),p=h.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),o<(u=t[r.get(g.id())]+g.width()/2)&&(o=u),a>(c=n[r.get(g.id())]-g.height()/2)&&(a=c),s<(d=n[r.get(g.id())]+g.height()/2)&&(s=d)}var v={};return v.topLeftX=i,v.topLeftY=a,v.width=o-i,v.height=s-a,v},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach((function(e){var t=!1;e.children().forEach((function(e){"none"!=e.css("display")&&(t=!0)})),t||n.merge(e)})),n}};e.exports=o},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,o=n(140).CoSENode,a=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,u=n(140).layoutBase.FDLayoutConstants,c=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,h=d.nodes(),p=d.edges(),f=void 0,g=void 0,v=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,v=t.yCoords);var m=function(e){return"function"==typeof e},b=function(e,t){return m(e)?e(t):e},x=r.calcParentsWithoutChildren(n,d);null!=e.nestingFactor&&(c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(c.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(c.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(c.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(c.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,c.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,c.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,c.TILE=e.tile,c.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1),"enforced"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1),"cose"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?c.TREE_REDUCTION_ON_INCREMENTAL=!1:c.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var u=n.length,c=0;c0&&e(i.getGraphManager().add(i.newGraph(),p),h,i,l)}}(E.addRoot(),r.getTopMostNodes(h),w,e),function(t,n,r){for(var i=0,o=0,a=0;a0?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=i/o:m(e.idealEdgeLength)?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,c.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(d){var h=o.getTopMostNodes(e.eles.nodes());if((l=o.connectComponents(t,e.eles,h)).forEach((function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),e.randomize&&l.forEach((function(t){e.eles=t,r.push(a(e))})),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,v={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach((function(e,t){0==e.edges().length&&(e.nodes().forEach((function(t,n){p.merge(e.nodes()[n]),t.isParent()||(v.nodeIndexes.set(e.nodes()[n].id(),g++),v.xCoords.push(e.nodes()[0].position().x),v.yCoords.push(e.nodes()[0].position().y))})),y.push(t))})),p.length>1){var m=p.boundingBox();u.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),l.push(p),r.push(v);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),u.splice(y[b],1)}}l.forEach((function(t,n){e.eles=t,i.push(s(e,r[n])),o.relocateComponent(u[n],i[n],e)}))}else l.forEach((function(t,n){o.relocateComponent(u[n],r[n],e)}));var x=new Set;if(l.length>1){var w=[],E=n.filter((function(e){return"none"==e.css("display")}));l.forEach((function(t,n){var a=void 0;if("draft"==e.quality&&(a=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach((function(t){if("draft"==e.quality)if(t.isParent()){var u=o.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:u.topLeftX,y:u.topLeftY,width:u.width,height:u.height})}else l=a.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})})),t.edges().forEach((function(t){var l=t.source(),u=t.target();if("none"!=l.css("display")&&"none"!=u.css("display"))if("draft"==e.quality){var c=a.get(l.id()),d=a.get(u.id()),h=[],p=[];if(l.isParent()){var f=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);h.push(f.topLeftX+f.width/2),h.push(f.topLeftY+f.height/2)}else h.push(r[n].xCoords[c]),h.push(r[n].yCoords[c]);if(u.isParent()){var g=o.calcBoundingBox(u,r[n].xCoords,r[n].yCoords,a);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[d]),p.push(r[n].yCoords[d]);s.edges.push({startX:h[0],startY:h[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][u.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][u.id()].getCenterX(),endY:i[n][u.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),x.add(n))}}));var _=c.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach((function(e,t){var n=e.xCoords.map((function(e){return e+_[t].dx})),r=e.yCoords.map((function(e){return e+_[t].dy}));e.xCoords=n,e.yCoords=r}));else{var C=0;x.forEach((function(e){Object.keys(i[e]).forEach((function(t){var n=i[e][t];n.setCenter(n.getCenterX()+_[C].dx,n.getCenterY()+_[C].dy)})),C++}))}}}else{var T=e.eles.boundingBox();if(u.push({x:T.x1+T.w/2,y:T.y1+T.h/2}),e.randomize){var N=a(e);r.push(N)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),o.relocateComponent(u[0],i[0],e)):o.relocateComponent(u[0],r[0],e)}var M=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var o=void 0,a=void 0,s=t.data("id");return i.forEach((function(e){s in e&&(o={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},a=e[s])})),e.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.labelHeight/2))),null==o&&(o={x:t.position("x"),y:t.position("y")}),{x:o.x,y:o.y}}var l=void 0;return r.forEach((function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})})),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=o.calcParentsWithoutChildren(t,n),D=n.filter((function(e){return"none"==e.css("display")}));e.eles=n.not(D),n.nodes().not(":parent").not(D).layoutPositions(this,e,M),A.length>0&&A.forEach((function(e){e.position(M(e))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=u},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,o=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,a=n.nodes(),s=n.nodes(":parent"),l=new Map,u=new Map,c=new Map,d=[],h=[],p=[],f=[],g=[],v=[],y=[],m=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,_=e.samplingType,C=e.nodeSeparation,T=void 0,N=function(e,t,n){for(var r=[],i=0,o=0,a=0,s=void 0,l=[],c=0,h=1,p=0;p=i;){a=r[i++];for(var f=d[a],y=0;yc&&(c=g[w],h=w)}return h};r.connectComponents(t,n,r.getTopMostNodes(a),l),s.forEach((function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)}));for(var M=0,A=0;A0&&(r.isParent()?d[t].push(c.get(r.id())):d[t].push(r.id()))}))}));var R=function(e){var n=u.get(e),r=void 0;l.get(e).forEach((function(i){r=t.getElementById(i).isParent()?c.get(i):i,d[n].push(r),d[u.get(r)].push(e)}))},B=!0,F=!1,z=void 0;try{for(var j,V=l.keys()[Symbol.iterator]();!(B=(j=V.next()).done);B=!0)R(j.value)}catch(e){F=!0,z=e}finally{try{!B&&V.return&&V.return()}finally{if(F)throw z}}var G=void 0;if((b=u.size)>2){T=b=1)break;u=l}for(var f=0;f=1)break;u=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(579);return r})()},e.exports=r(n(7799))},4726:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var h="undefined"==typeof window?null:window,p=h?h.navigator:null;h&&h.document;var f=r(""),g=r({}),v=r((function(){})),y="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&r(e)==f},x=function(e){return null!=e&&r(e)===v},w=function(e){return!T(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&r(e)===g&&!w(e)&&e.constructor===Object},_=function(e){return null!=e&&r(e)===r(1)&&!isNaN(e)},C=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},T=function(e){return N(e)||M(e)},N=function(e){return"collection"===m(e)&&e._private.single},M=function(e){return"collection"===m(e)&&!e._private.single},A=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},I=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},O=function(e){return function(e){return null!=e&&r(e)===g}(e)&&x(e.then)},P=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},Y=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=t||n<0||d&&e-u>=o}function g(){var e=Q();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?ye(n,o-(e-u)):n}(e))}function v(e){return s=void 0,h&&r?p(e):(r=i=void 0,a)}function y(){var e=Q(),n=f(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),c?p(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ge(t)||0,W(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ve(ge(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Q())},y},be=h?h.performance:null,xe=be&&be.now?function(){return be.now()}:function(){return Date.now()},we=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(xe())}),1e3/60)}}(),Ee=function(e){return we(e)},_e=xe,Ce=9261,Te=5381,Ne=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Me=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce)+e|0},Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Te;return(t<<5)+t+e|0},De=function(e){return 2097152*e[0]+e[1]},Ie=function(e,t){return[Me(e[0],t[0]),Ae(e[1],t[1])]},Oe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ne({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},$e=function(e){e.splice(0,e.length)},Qe=function(e,t,n){return n&&(t=L(n,t)),e[t]},Je=function(e,t,n,r){n&&(t=L(n,t)),e[t]=r},et="undefined"!=typeof Map?Map:function(){function e(){i(this,e),this._obj={}}return a(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),tt=function(){function e(t){if(i(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&A(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new nt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);in;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;og;0<=g?++h:--h)v.push(o(e,r));return v},f=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},g=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i0;){var _=y.pop(),C=g(_),T=_.id();if(d[T]=C,C!==1/0)for(var N=_.neighborhood().intersect(p),M=0;M0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},ct={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t0;){if(u=(l=g.pop()).id(),v.delete(u),w++,u===d){for(var E=[],_=i,C=d,T=m[C];E.unshift(_),null!=T&&E.unshift(T),null!=(_=y[C]);)T=m[C=_.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:w}}f[u]=!0;for(var N=l._private.edges,M=0;MM&&(p[N]=M,y[N]=T,m[N]=w),!i){var A=T*u+C;!i&&p[A]>M&&(p[A]=M,y[A]=C,m[A]=w)}}}for(var D=0;D1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},yt=Math.sqrt(2),mt=function(e,t,n){0===n.length&&Ge("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(u,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=mt(i,e,t),n--}return t},xt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/yt);if(!(i<2)){for(var l=[],u=0;u0?1:e<0?-1:0},Mt=function(e,t){return Math.sqrt(At(e,t))},At=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Dt=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},St=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Lt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Bt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=l(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ft=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},zt=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},jt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Vt=function(e,t){return jt(e,t.x1,t.y1)&&jt(e,t.x2,t.y2)},Gt=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?sn(i,o):u,d=i/2,h=o/2,p=(c=Math.min(c,d,h))!==d,f=c!==h;if(p){var g=r-h-a;if((s=en(e,t,n,r,n-d+c-a,g,n+d-c+a,g,!1)).length>0)return s}if(f){var v=n+d+a;if((s=en(e,t,n,r,v,r-h+c-a,v,r+h-c+a,!1)).length>0)return s}if(p){var y=r+h+a;if((s=en(e,t,n,r,n-d+c-a,y,n+d-c+a,y,!1)).length>0)return s}if(f){var m=n-d-a;if((s=en(e,t,n,r,m,r-h+c-a,m,r+h-c+a,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=Qt(e,t,n,r,b,x,c+a)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=Qt(e,t,n,r,w,E,c+a)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var _=n+d-c,C=r+h-c;if((l=Qt(e,t,n,r,_,C,c+a)).length>0&&l[0]>=_&&l[1]>=C)return[l[0],l[1]];var T=n-d+c,N=r+h-c;return(l=Qt(e,t,n,r,T,N,c+a)).length>0&&l[0]<=T&&l[1]>=N?[l[0],l[1]]:[]},Yt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},Ut=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(ec||th)},Xt=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f,g,v,y,m,b,x,w=[];u=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,d=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0===(l=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(l=1e-5),g=-27*(d/=l)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,(h=w)[1]=0,b=u/3,p>0?(y=(y=g+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=g-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),h[0]=-b+y+m,b+=(y+m)/2,h[4]=h[2]=-b,b=Math.sqrt(3)*(-m+y)/2,h[3]=b,h[5]=-b):(h[5]=h[3]=0,0===p?(x=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),h[0]=2*x-b,h[4]=h[2]=-(x+b)):(v=(f=-f)*f*f,v=Math.acos(g/Math.sqrt(v)),x=2*Math.sqrt(f),h[0]=-b+x*Math.cos(v/3),h[2]=-b+x*Math.cos((v+2*Math.PI)/3),h[4]=-b+x*Math.cos((v+4*Math.PI)/3)));for(var E=[],_=0;_<6;_+=2)Math.abs(w[_+1])<1e-7&&w[_]>=0&&w[_]<=1&&E.push(w[_]);E.push(1),E.push(0);for(var C,T,N,M=-1,A=0;A=0?Nl?(e-i)*(e-i)+(t-o)*(t-o):u-d},Wt=function(e,t,n){for(var r,i,o,a,s=0,l=0;l=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},qt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),p=Math.sin(-u),f=0;f0){var g=Zt(c,-l);d=Kt(g)}else d=c;return Wt(e,t,d)},Kt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},Jt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,h=t-o,p=r-t,f=s-o,g=d*h-f*u,v=c*h-p*u,y=f*c-d*p;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===g||0===v?Jt(e,n,a)===a?[a,s]:Jt(e,n,i)===i?[i,o]:Jt(i,a,n)===n?[n,r]:[]:[]},tn=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f=[],g=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y0){var m=Zt(g,-s);u=Kt(m)}else u=g}else u=n;for(var b=0;bu&&(u=t)},d=function(e){return l[e]},h=0;h0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var w=r(m);b=b.id(),h[b]>h[v]+w&&(h[b]=h[v]+w,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E0;){for(var N=n.pop(),M=0;M0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:An,a=r,s=0;s=2?Sn(e,t,n,0,On,Pn):Sn(e,t,n,0,In)},squaredEuclidean:function(e,t,n){return Sn(e,t,n,0,On)},manhattan:function(e,t,n){return Sn(e,t,n,0,In)},max:function(e,t,n){return Sn(e,t,n,-1/0,kn)}};function Rn(e,t,n,r,i,o){var a;return a=x(e)?e:Ln[e]||Ln.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}Ln["squared-euclidean"]=Ln.squaredEuclidean,Ln.squaredeuclidean=Ln.squaredEuclidean;var Bn=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Fn=function(e){return Bn(e)},zn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return Rn(e,r.length,o,(function(e){return r[e](t)}),a,s)},jn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;ln)return!1;return!0},Xn=function(e,t,n){for(var r=0;ri&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],g=t[r[a]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(o=n[g.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i=M?(A=M,M=I,D=O):I>A&&(A=I);for(var P=0;P0?1:0;C[E%u.minIterations*t+F]=z,B+=z}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var j=0,V=0;V0&&r.push(i);return r}(t,o,a),U=function(e,t,n){for(var r=lr(e,t,n),i=0;il&&(s=u,l=c)}n[i]=o[s]}return lr(e,t,n)}(t,r,Y),X={},H=0;H1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},pr=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},fr={};[ot,ut,ct,ht,ft,vt,xt,dn,pn,gn,yn,Mn,$n,or,cr,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=dr(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(l.getElementById(g.shift())),c)if(c[v].length)return h;return h.found=!0,h.trail=this.spawn(f,!0),h}},{hopcroftTarjanBiconnected:hr,htbc:hr,htb:hr,hopcroftTarjanBiconnectedComponents:hr},{tarjanStronglyConnected:pr,tsc:pr,tscc:pr,tarjanStronglyConnectedComponents:pr}].forEach((function(e){Y(fr,e)}));var gr=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};gr.prototype={fulfill:function(e){return vr(this,1,"fulfillValue",e)},reject:function(e){return vr(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new gr;return n.onFulfilled.push(br(e,r,"fulfill")),n.onRejected.push(br(t,r,"reject")),yr(n),r.proxy}};var vr=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,yr(e)),e},yr=function(e){1===e.state?mr(e,"onFulfilled",e.fulfillValue):2===e.state&&mr(e,"onRejected",e.rejectReason)},mr=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1},qr.prototype.set=function(e,t){var n=this.__data__,r=Hr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Kr=qr,Zr=zr($,"Map"),$r=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function Qr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Ti.className=Ti.classNames=Ti.classes;var Ni={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:B,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ni.variable="(?:[\\w-.]|(?:\\\\"+Ni.metaChar+"))+",Ni.className="(?:[\\w-]|(?:\\\\"+Ni.metaChar+"))+",Ni.value=Ni.string+"|"+Ni.number,Ni.id=Ni.variable,function(){var e,t,n;for(e=Ni.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Ni.comparatorOp+="|\\!"+t)}();var Mi=20,Ai=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*G(e,t)}(e.selector,t.selector)})),Di=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return Ue("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Ue("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Ue("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(i,o){return i.checks.reduce((function(a,s,l){return a+(o===i&&0===l?"$":"")+function(i,o){var a=i.type,s=i.value;switch(a){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:var u=i.field,c=i.operator;return"["+u+n(e(c))+t(s)+"]";case 5:var d=i.operator,h=i.field;return"["+e(d)+h+"]";case 4:return"["+i.field+"]";case 6:var p=i.operator;return"[["+i.field+n(e(p))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var f=r(i.left,o),g=r(i.subject,o),v=r(i.right,o);return f+(f.length>0?" ":"")+g+v;case Mi:return""}}(s,o)}),"")},i="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Ki(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],Ki)},Wi.forEachUp=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Zi)},Wi.forEachUpAndDown=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],$i)},Wi.ancestors=Wi.parents,(Ui=Xi={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_i.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_i.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ui.data,Ui.removeAttr=Ui.removeData;var Qi,Ji,eo=Xi,to={};function no(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;at})),minIndegree:ro("indegree",(function(e,t){return et})),minOutdegree:ro("outdegree",(function(e,t){return et}))}),Y(to,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},Qi.modelPosition=Qi.point=Qi.position,Qi.modelPositions=Qi.points=Qi.positions,Qi.renderedPoint=Qi.renderedPosition,Qi.relativePoint=Qi.relativePosition;var ao,so,lo=Ji;ao=so={},so.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},so.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},so.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,l),h=d.biasDiff,p=d.biasComplementDiff,f=y(i.height.val-o.h,u,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-g+o.y1+o.y2+v)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ho=function(e,t){return null==t?e:co(e,t.x1,t.y1,t.x2,t.y2)},po=function(e,t,n){return Qe(e,t,n)},fo=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Rt(u,1),co(e,u.x1,u.y1,u.x2,u.y2)}}},go=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=po(o,"labelWidth",n),p=po(o,"labelHeight",n),f=po(o,"labelX",n),g=po(o,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=p,C=h,T=C/2,N=_/2;if(m)a=f-T,s=f+T,l=g-N,u=g+N;else{switch(c.value){case"left":a=f-C,s=f;break;case"center":a=f-T,s=f+T;break;case"right":a=f,s=f+C}switch(d.value){case"top":l=g-_,u=g;break;case"center":l=g-N,u=g+N;break;case"bottom":l=g,u=g+_}}var M=v-Math.max(x,w)-E-2,A=v+Math.max(x,w)+E+2,D=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;a+=M,s+=A,l+=D,u+=I;var O=n||"main",P=i.labelBounds,k=P[O]=P[O]||{};k.x1=a,k.y1=l,k.x2=s,k.y2=u,k.w=s-a,k.h=u-l,k.leftPad=M,k.rightPad=A,k.topPad=D,k.botPad=I;var S=m&&"autorotate"===b.strValue,L=null!=b.pfValue&&0!==b.pfValue;if(S||L){var R=S?po(i.rstyle,"labelAngle",n):b.pfValue,B=Math.cos(R),F=Math.sin(R),z=(a+s)/2,j=(l+u)/2;if(!m){switch(c.value){case"left":z=s;break;case"right":z=a}switch(d.value){case"top":j=u;break;case"bottom":j=l}}var V=function(e,t){return{x:(e-=z)*B-(t-=j)*F+z,y:e*F+t*B+j}},G=V(a,l),Y=V(a,u),U=V(s,l),X=V(s,u);a=Math.min(G.x,Y.x,U.x,X.x),s=Math.max(G.x,Y.x,U.x,X.x),l=Math.min(G.y,Y.y,U.y,X.y),u=Math.max(G.y,Y.y,U.y,X.y)}var H=O+"Rot",W=P[H]=P[H]||{};W.x1=a,W.y1=l,W.x2=s,W.y2=u,W.w=s-a,W.h=u-l,co(e,a,l,s,u),co(i.labelBounds.all,a,l,s,u)}return e}},vo=function(e){var t=0,n=function(e){return(e?1:0)<0&&o>0){var a=t.pstyle("outline-offset").value,s=t.pstyle("shape").value,l=o+a,u=(e.w+2*l)/e.w,c=(e.h+2*l)/e.h,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+2.4*l)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+2.4*l)/e.w:"star"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.6*l)/e.h,d=-l/3.8):"triangle"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.4*l)/e.h,d=-l/1.4):"vee"===s&&(u=(e.w+4.4*l)/e.w,c=(e.h+3.8*l)/e.h,d=.5*-l);var h=e.h*c-e.h,p=e.w*u-e.w;if(Bt(e,[Math.ceil(h/2),Math.ceil(p/2)]),0!==d){var f=(r=d,{x1:(n=e).x1+0,x2:n.x2+0,y1:n.y1+r,y2:n.y2+r,w:n.w,h:n.h});St(e,f)}}}}(h,e)}else if(g&&t.includeEdges)if(c&&!d){var M=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),o=Math.max(v.srcY,v.midY,v.tgtY),co(h,n-=_,i-=_,r+=_,o+=_),"haystack"===M){var A=v.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var D=n;n=r,r=D}if(i>(o=A[1].y)){var I=i;i=o,o=I}co(h,n-_,i-_,r+_,o+_)}}else if("bezier"===M||"unbundled-bezier"===M||M.endsWith("segments")||M.endsWith("taxi")){var O;switch(M){case"bezier":case"unbundled-bezier":O=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=v.linePts}if(null!=O)for(var P=0;P(r=L.x)){var R=n;n=r,r=R}if((i=S.y)>(o=L.y)){var B=i;i=o,o=B}co(h,n-=_,i-=_,r+=_,o+=_)}if(c&&t.includeEdges&&g&&(fo(h,e,"mid-source"),fo(h,e,"mid-target"),fo(h,e,"source"),fo(h,e,"target")),c&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;co(h,h.x1+F,h.y1+z,h.x2+F,h.y2+z)}var j=p.bodyBounds=p.bodyBounds||{};Ft(j,h),Bt(j,y),Rt(j,1),c&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,co(h,n-E,i-E,r+E,o+E));var V=p.overlayBounds=p.overlayBounds||{};Ft(V,h),Bt(V,y),Rt(V,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=kt(),c&&t.includeLabels&&(t.includeMainLabels&&go(h,e,null),g&&(t.includeSourceLabels&&go(h,e,"source"),t.includeTargetLabels&&go(h,e,"target")))}return h.x1=uo(h.x1),h.y1=uo(h.y1),h.x2=uo(h.x2),h.y2=uo(h.y2),h.w=uo(h.x2-h.x1),h.h=uo(h.y2-h.y1),h.w>0&&h.h>0&&b&&(Bt(h,y),Rt(h,1)),h}(e,bo),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=kt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ho(n,r.overlayBounds):ho(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ho(n,r.labelBounds.all):(t.includeMainLabels&&ho(n,r.labelBounds.mainRot),t.includeSourceLabels&&ho(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ho(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},bo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},xo=vo(bo),wo=Ke(bo);so.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=kt();var n=wo(e=e||bo),r=this;if(r.cy().styleEnabled())for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:Ro,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)a(s);return this},Fo.removeAllListeners=function(){return this.removeListener("*")},Fo.emit=Fo.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,jo(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(E(e)){var o=e;i.applyBypass(this,o,r),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?i.getStylePropertyValue(a,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var o=0;o0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),da.neighbourhood=da.neighborhood,da.closedNeighbourhood=da.closedNeighborhood,da.openNeighbourhood=da.openNeighborhood,Y(da,{source:Hi((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Hi((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ga({attr:"source"}),targets:ga({attr:"target"})}),Y(da,{edgesWith:Hi(va(),"edgesWith"),edgesTo:Hi(va({thisIsSrc:!0}),"edgesTo")}),Y(da,{connectedEdges:Hi((function(e){for(var t=[],n=0;n0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),da.componentsOf=da.components;var ma=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new et,o=!1;if(t){if(t.length>0&&E(t[0])&&!N(t[0])){o=!0;for(var a=[],s=new nt,l=0,u=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u0){for(var B=e.length===i.length?i:new ma(o,e),F=0;F0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var C=0;C=.001?function(t,r){for(var i=0;i<4;++i){var o=h(r,e,n);if(0===o)return r;r-=(d(r,e,n)-t)/o}return r}(t,a):0===l?a:function(t,r,i){var o,a,s=0;do{(o=d(a=r+(i-r)/2,e,n)-t)>0?i=a:r=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+i)}(o),t,r)};f.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var g="generateBezier("+[e,t,n,r]+")";return f.toString=function(){return g},f}var Ea=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),_a=function(e,t,n,r){var i=wa(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Ca={linear:function(e,t,n){return e+(t-e)*n},ease:_a(.25,.1,.25,1),"ease-in":_a(.42,0,1,1),"ease-out":_a(0,0,.58,1),"ease-in-out":_a(.42,0,.58,1),"ease-in-sine":_a(.47,0,.745,.715),"ease-out-sine":_a(.39,.575,.565,1),"ease-in-out-sine":_a(.445,.05,.55,.95),"ease-in-quad":_a(.55,.085,.68,.53),"ease-out-quad":_a(.25,.46,.45,.94),"ease-in-out-quad":_a(.455,.03,.515,.955),"ease-in-cubic":_a(.55,.055,.675,.19),"ease-out-cubic":_a(.215,.61,.355,1),"ease-in-out-cubic":_a(.645,.045,.355,1),"ease-in-quart":_a(.895,.03,.685,.22),"ease-out-quart":_a(.165,.84,.44,1),"ease-in-out-quart":_a(.77,0,.175,1),"ease-in-quint":_a(.755,.05,.855,.06),"ease-out-quint":_a(.23,1,.32,1),"ease-in-out-quint":_a(.86,0,.07,1),"ease-in-expo":_a(.95,.05,.795,.035),"ease-out-expo":_a(.19,1,.22,1),"ease-in-out-expo":_a(1,0,0,1),"ease-in-circ":_a(.6,.04,.98,.335),"ease-out-circ":_a(.075,.82,.165,1),"ease-in-out-circ":_a(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ca.linear;var r=Ea(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":_a};function Ta(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Na(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ma(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Na(e,i),s=Na(t,i);if(_(a)&&_(s))return Ta(o,a,s,n,r);if(w(a)&&w(s)){for(var l=[],u=0;u0?("spring"===d&&h.push(a.duration),a.easingImpl=Ca[d].apply(null,h)):a.easingImpl=Ca[d]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var g=a.startPosition,v=a.position;if(v&&i&&!e.locked()){var y={};Da(g.x,v.x)&&(y.x=Ma(g.x,v.x,p,f)),Da(g.y,v.y)&&(y.y=Ma(g.y,v.y,p,f)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Da(m.x,x.x)&&(w.x=Ma(m.x,x.x,p,f)),Da(m.y,x.y)&&(w.y=Ma(m.y,x.y,p,f)),e.emit("pan"));var _=a.startZoom,C=a.zoom,T=null!=C&&r;T&&(Da(_,C)&&(o.zoom=Pt(o.minZoom,Ma(_,C,p,f),o.maxZoom)),e.emit("zoom")),(E||T)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var M=0;M=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],h=d._private;h.stopped?(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Ia(0,d,e),Aa(t,d,e,n),h.applying&&(h.applying=!1),u(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Pa={animate:_i.animate(),animation:_i.animation(),animated:_i.animated(),clearQueue:_i.clearQueue(),delay:_i.delay(),delayAnimation:_i.delayAnimation(),stop:_i.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Oa(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ee((function(n){Oa(n,e),t()}))}()}}},ka={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&N(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Sa=function(e){return b(e)?new Vi(e):e},La={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bo(ka,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Sa(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Sa(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},once:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};_i.eventAliasesOn(La);var Ra={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ra.jpeg=Ra.jpg;var Ba={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n,r=e.name,i=t.extension("layout",r);if(null!=i)return n=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(Y({},e,{cy:t,eles:n}));Ge("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Ge("A `name` must be specified to make a layout");else Ge("Layout options must be specified to make a layout")}};Ba.createLayout=Ba.makeLayout=Ba.layout;var Fa={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ja.invalidateDimensions=ja.resize;var Va={collection:function(e,t){return b(e)?this.$(e):T(e)?e.collection():w(e)?(t||(t={}),new ma(this,e,t.unique,t.removed)):new ma(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Va.elements=Va.filter=Va.$;var Ga={},Ya="t";Ga.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(h||d&&p){var f=void 0;h&&p||h?f=u.properties:p&&(f=u.mappedProperties);for(var g=0;g1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],C=i.valueMin[1],T=i.valueMax[1],N=i.valueMin[2],M=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],D=null==i.valueMax[3]?1:i.valueMax[3],I=[Math.round(w+(E-w)*v),Math.round(C+(T-C)*v),Math.round(N+(M-N)*v),Math.round(A+(D-A)*v)];n={bypass:i.bypass,name:i.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,O,i.bypass,h)}if(!n)return g(),!1;n.mapping=i,i=n;break;case a.data:for(var P=i.field.split("."),k=d.data,S=0;S0&&o>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ga.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Ga.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ga.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==t||"bezier"!==n&&"bezier"!==r||e.parallelEdges().forEach((function(e){e.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==t||"none"!==n&&"none"!==r||e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))},Ga.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ua={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;ot.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Ue("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u&&new Vi(u).invalid)Ue("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();else{var c=l[2],d=!1;n=c;for(var h=[];!n.match(/^\s*$/);){var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ue("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=p[0];var f=p[1],g=p[2];this.properties[f]?i.parse(f,g)?(h.push({name:f,val:g}),s()):(Ue("Skipping property: Invalid property definition in: "+r),s()):(Ue("Skipping property: Invalid property name in: "+r),s())}if(d){a();break}i.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var p=s.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(e,c[4]);if(!f||f.mapped)return!1;var g=this.parse(e,c[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return Ue("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(d.color){var v=f.value,y=g.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var E=[],C=[],T=[],N="",M=!1,A=0;A0?" ":"")+D.strValue}return d.validate&&!d.validate(E,C)?null:d.singleEnum&&M?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:T,strValue:N,bypass:n,units:C}}var I,O,P,S=function(){for(var r=0;rd.max||d.strictMax&&t===d.max))return null;var G={name:e,value:t,strValue:""+t+(L||""),units:L,bypass:n};return d.unitless||"px"!==L&&"em"!==L?G.pfValue=t:G.pfValue="px"!==L&&L?this.getEmSizeInPixels()*t:t,"ms"!==L&&"s"!==L||(G.pfValue="ms"===L?t:1e3*t),"deg"!==L&&"rad"!==L||(G.pfValue="rad"===L?t:(I=t,Math.PI*I/180)),"%"===L&&(G.pfValue=t/100),G}if(d.propList){var Y=[],X=""+t;if("none"===X);else{for(var H=X.split(/\s*,\s*|\s+/),W=0;W255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(P)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+j+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[a,s,l,o]}return t}(P);return K?{name:e,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var Z=S();if(Z)return Z}for(var $=d.regexes?d.regexes:[d.regex],Q=0;Q<$.length;Q++){var J=new RegExp($[Q]).exec(t);if(J)return{name:e,value:d.singleRegexMatchValue?J[1]:J,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?S():null};var $a=function e(t){if(!(this instanceof e))return new e(t);A(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Ge("A style must have a core reference")},Qa=$a.prototype;Qa.instanceString=function(){return"style"},Qa.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),_(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=wt(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;_(l.x)&&(t.pan.x=l.x,a=!1),_(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else T(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};es.centre=es.center,es.autolockNodes=es.autolock,es.autoungrabifyNodes=es.autoungrabify;var ts={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ts.attr=ts.data,ts.removeAttr=ts.removeData;var ns=function(e){var t=this,n=(e=Y({},e)).container;n&&!C(n)&&C(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=Y({name:o?"grid":"null"},a.layout),a.renderer=Y({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new ma(this),listeners:[],aniEles:new ma(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:_(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&_(a.pan.x)?a.pan.x:0,y:E(a.pan)&&_(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=Y({},a,a.renderer);t.initRenderer(u),function(e,t){if(e.some(O))return wr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=Y({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e0,u=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(T(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d0;){var P=D.shift(),k=A(P,I);if(k)P.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(O);else if(null===k){Ue("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}M();var S=0;if(n.avoidOverlap)for(var L=0;L0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:q+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:q+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var us={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cs(e){this.options=Y({},us,e)}cs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h1&&t.avoidOverlap){d*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(v*v+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var ds,hs={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ps(e){this.options=Y({},hs,e)}ps.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d0&&Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m)),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,_)}for(var C=0,T=0;T1&&t.avoidOverlap){var D=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(D*D+I*I));C=Math.max(O,C)}N.r=C,C+=w}if(t.equidistant){for(var P=0,k=0,S=0;S=e.numIter||(Es(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature=e.animationThreshold&&o(),Ee(t)):(Ss(r,e),s())}();else{for(;u;)u=a(l),l++;Ss(r,e),s()}return this},gs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},gs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vs=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u0)for(a.graphSet.push(E),u=0;ur.count?0:r.graph},ms=function e(t,n,r,i){var o=i.graphSet[r];if(-10)var s=(u=r.nodeOverlap*a)*i/(g=Math.sqrt(i*i+o*o)),l=u*o/g;else{var u,c=Ms(e,i,o),d=Ms(t,-1*i,-1*o),h=d.x-c.x,p=d.y-c.y,f=h*h+p*p,g=Math.sqrt(f);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/f)*h/g,l=u*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ns=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ms=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0n?(u.x=r,u.y=i+o/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},As=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,g=t.gravity*h/p;c.offsetX+=f,c.offsetY+=g}}}}},Is=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},ks=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTopf&&(d+=p+t.componentSpacing,c=0,h=0,p=0)}}},Ls={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Rs(e){this.options=Y({},Ls,e)}Rs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},h=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=p)l=h,u=p;else if(null!=h&&null==p)l=h,u=Math.ceil(a/l);else if(null==h&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var f=c(),g=d();(f-1)*g>=a?c(f-1):(g-1)*f>=a&&d(g-1)}else for(;u*l=a?d(y+1):c(v+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x=u&&(O=0,I++)},k={},S=0;S(r=Ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5(r=Xt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var C=_[w],T=s.arrowShapes[n.pstyle(C.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(T.roughCollide(e,t,E,C.angle,{x:C.x,y:C.y},N,h)&&T.collide(e,t,E,C.angle,{x:C.x,y:C.y},N,h))return v(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Qe(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},C=_(g,m),T=_(g,x),N=_(y,m),M=_(y,x),A=[C.x+h,C.y+p,N.x+h,N.y+p,M.x+h,M.y+p,T.x+h,T.y+p];if(Wt(e,t,A))return v(n),!0}else if(jt(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),h=kt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),p=0;p4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,r,i){var o,a;if(e!==hl?gl(t,e,pl):((a=pl).x=-1*(o=fl).x,a.y=-1*o.y,a.nx=-1*o.nx,a.ny=-1*o.ny,a.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),gl(t,n,fl),Qs=pl.nx*fl.ny-pl.ny*fl.nx,Js=pl.nx*fl.nx-pl.ny*-fl.ny,nl=Math.asin(Math.max(-1,Math.min(1,Qs))),Math.abs(nl)<1e-6)return Zs=t.x,$s=t.y,void(il=al=0);el=1,tl=!1,Js<0?nl<0?nl=Math.PI+nl:(nl=Math.PI-nl,el=-1,tl=!0):nl>0&&(el=-1,tl=!0),al=void 0!==t.radius?t.radius:r,rl=nl/2,sl=Math.min(pl.len/2,fl.len/2),i?(ol=Math.abs(Math.cos(rl)*al/Math.sin(rl)))>sl?(ol=sl,il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))):il=al:(ol=Math.min(sl,al),il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))),cl=t.x+fl.nx*ol,dl=t.y+fl.ny*ol,Zs=cl-fl.ny*il*el,$s=dl+fl.nx*il*el,ll=t.x+pl.nx*ol,ul=t.y+pl.ny*ol,hl=t}(e,t,n,r,i),{cx:Zs,cy:$s,radius:il,startX:ll,startY:ul,stopX:cl,stopY:dl,startAngle:pl.ang+Math.PI/2*el,endAngle:fl.ang-Math.PI/2*el,counterClockwise:tl})}var ml={};function bl(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},M=N(C,E),A=N(T,_),D=!1;"auto"===v?g=Math.abs(M)>Math.abs(A)?i:r:v===l||v===s?(g=r,D=!0):v!==o&&v!==a||(g=i,D=!0);var I,O=g===r,P=O?A:M,k=O?T:C,S=Nt(k),L=!1;D&&(m||x)||!(v===s&&k<0||v===l&&k>0||v===o&&k>0||v===a&&k<0)||(P=(S*=-1)*Math.abs(P),L=!0);var R=function(e){return Math.abs(e)=Math.abs(P)},B=R(I=m?(b<0?1+b:b)*P:(b<0?P:0)+b*S),F=R(Math.abs(P)-Math.abs(I));if(!B&&!F||L)if(O){var z=u.y1+I+(f?d/2*S:0),j=u.x1,V=u.x2;n.segpts=[j,z,V,z]}else{var G=u.x1+I+(f?c/2*S:0),Y=u.y1,U=u.y2;n.segpts=[G,Y,G,U]}else if(O){var X=Math.abs(k)<=d/2,H=Math.abs(C)<=h/2;if(X){var W=(u.x1+u.x2)/2,q=u.y1,K=u.y2;n.segpts=[W,q,W,K]}else if(H){var Z=(u.y1+u.y2)/2,$=u.x1,Q=u.x2;n.segpts=[$,Z,Q,Z]}else n.segpts=[u.x1,u.y2]}else{var J=Math.abs(k)<=c/2,ee=Math.abs(T)<=p/2;if(J){var te=(u.y1+u.y2)/2,ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else if(ee){var ie=(u.x1+u.x2)/2,oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}else n.segpts=[u.x2,u.y1]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},ml.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!_(n.startX)||!_(n.startY),v=!_(n.arrowStartX)||!_(n.arrowStartY),y=!_(n.endX)||!_(n.endY),m=!_(n.arrowEndX)||!_(n.arrowEndY),b=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,x=Mt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xh.poolIndex()){var p=d;d=h,h=p}var f=s.srcPos=d.position(),g=s.tgtPos=h.position(),v=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=s.srcCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,C=s.tgtCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,T=s.tgtRs=h._private.rscratch,N=s.srcRs=d._private.rscratch;s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var M=0;M0){var H=u,W=At(H,_t(t)),q=At(H,_t(X)),K=W;q2&&At(H,{x:X[2],y:X[3]})0){var le=c,ue=At(le,_t(t)),ce=At(le,_t(se)),de=ue;ce2&&At(le,{x:se[2],y:se[3]})=u||m){c={cp:g,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=Pt(0,_,1),t=Ot(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=Pt(0,r-.001,1),o=Pt(0,r+.001,1),a=Ot(e,t,n,i),s=Ot(e,t,n,o);return Tl(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var C,T,N,M,A=0,D=r.allpts.length,I=0;I+3=u));I+=2);var O=(u-T)/C;O=Pt(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Mt(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(N,M,O),i=Tl(N,M)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},_l.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},_l.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Qe(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,d=i.width,h=i.height+(l-1)*(o-1)*u;Je(n.rstyle,"labelWidth",t,d),Je(n.rscratch,"labelWidth",t,d),Je(n.rstyle,"labelHeight",t,h),Je(n.rscratch,"labelHeight",t,h),Je(n.rscratch,"labelLineHeight",t,c)},_l.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Je(n.rscratch,e,t,r),r):Qe(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,p=[],f=/[\s\u200b]+|$/g,g=0;gc){var b,x="",w=0,E=d(v.matchAll(f));try{for(E.s();!(b=E.n()).done;){var _=b.value,C=_[0],T=v.substring(w,_.index);w=_.index+C.length;var N=0===x.length?T:x+T+C;this.calculateLabelDimensions(e,N).width<=c?x+=T+C:(x&&p.push(x),x=T+C)}}catch(e){E.e(e)}finally{E.f()}x.match(/^[\s\u200b]+$/)||p.push(x)}else p.push(v)}a("labelWrapCachedLines",p),i=a("labelWrapCachedText",p.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var M=e.pstyle("text-max-width").pfValue,A="",D=!1;if(this.calculateLabelDimensions(e,i).widthM);I++)A+=i[I],I===i.length-1&&(D=!0);return D||(A+="…"),A}return i},_l.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},_l.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window().document,i=Oe(t,e._private.labelDimsKey),o=n.labelDimCache||(n.labelDimCache=[]),a=o[i];if(null!=a)return a;var s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=r.createElement("canvas"),h=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}h.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var f=0,g=0,v=t.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var M=i(t);v&&(e.hoverData.tapholdCancelled=!0),n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(D):a.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(n=!0,a.panningEnabled()&&a.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};a.panBy(I),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),b)if(v){if(a.boxSelectionEnabled()&&M)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var P=!e.dragData.didDrag;P&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(w,{inDragLayer:!0});var k={x:0,y:0};if(_(x[0])&&_(x[1])&&(k.x+=x[0],k.y+=x[1],P)){var S=e.hoverData.dragDelta;S&&_(S[0])&&_(S[1])&&(k.x+=S[0],k.y+=S[1])}e.hoverData.draggingEles=!0,w.silentShift(k).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else v&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!M&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=_t(h),e.redrawHint("select",!0),e.redraw()):A(),b&&b.pannable()&&b.active()&&b.unactivate());return f[2]=c[0],f[3]=c[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,h=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:t,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:t,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:a[0],y:a[1]}),x=!1,t.timeStamp-w<=o.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:a[0],y:a[1]})):(b=setTimeout((function(){x||r(c,["oneclick","onetap","voneclick"],t,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),w=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(o.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:t,position:{x:a[0],y:a[1]}});"additive"===o.selectionType()||h||o.$(n).unmerge(g).unselect(),g.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=c&&c.grabbed();d(u),v&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}),!1);var C,T,N,M,A,D,I,O,P,k,S,L,R,B=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",B,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||B(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var F,z,j,V,G,Y,U,X=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},H=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",F=function(t){if(e.hasTouchStarted=!0,m(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var l=e.findContainerClientCoords();P=l[0],k=l[1],S=l[2],L=l[3],C=t.touches[0].clientX-P,T=t.touches[0].clientY-k,N=t.touches[1].clientX-P,M=t.touches[1].clientY-k,R=0<=C&&C<=S&&0<=N&&N<=S&&0<=T&&T<=L&&0<=M&&M<=L;var h=n.pan(),f=n.zoom();if(A=X(C,T,N,M),D=H(C,T,N,M),O=[((I=[(C+N)/2,(T+M)/2])[0]-h.x)/f,(I[1]-h.y)/f],D<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),b=y[0];if(null!=b&&(b.activate(),e.touchData.start=b,e.touchData.starts=y,e.nodeIsGrabbable(b))){var x=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),b.selected()?(w=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(w,{addToList:x})):c(b,{addToList:x}),s(b);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};b.emit(E("grabon")),w?w.forEach((function(e){e.emit(E("grab"))})):b.emit(E("grab"))}r(b,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==b&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var _=e.touchData.startPosition=[null,null,null,null,null,null],B=0;B=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var w=t.touches[0].clientX-P,E=t.touches[0].clientY-k,I=t.touches[1].clientX-P,S=t.touches[1].clientY-k,L=H(w,E,I,S);if(L/D>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(n&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var F=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&F===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=F,F&&F.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",j=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",V=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=h[0],u[1]=h[1]}if(t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=h[0],u[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=h[0],u[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;d(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);r(y,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),G=!1,t.timeStamp-U<=s.multiClickDebounceTime()?(Y&&clearTimeout(Y),G=!0,U=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):(Y=setTimeout((function(){G||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),U=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var p=[c[0],c[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return g[0]}return null},p=Object.keys(d),f=0;f0?u:Gt(i,o,e,t,n,r,a,s)},checkPoint:function(e,t,n,r,i,o,a,s){var l=2*(s="auto"===s?sn(r,i):s);if(qt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(qt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!Wt(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||!!$t(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!$t(e,t,l,l,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",rn(3,0)),this.generateRoundPolygon("round-triangle",rn(3,0)),this.generatePolygon("rectangle",rn(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",rn(5,0)),this.generateRoundPolygon("round-pentagon",rn(5,0)),this.generatePolygon("hexagon",rn(6,0)),this.generateRoundPolygon("round-hexagon",rn(6,0)),this.generatePolygon("heptagon",rn(7,0)),this.generateRoundPolygon("round-heptagon",rn(7,0)),this.generatePolygon("octagon",rn(8,0)),this.generateRoundPolygon("round-octagon",rn(8,0));var r=new Array(20),i=an(5,0),o=an(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*Bl)break;var v=e.deq(t,d,c);if(!(v.length>0))break;for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),i(t))}}},zl=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ze;i(this,e),this.idsByKey=new et,this.keyForId=new et,this.cachesByLvl=new et,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return a(e,[{key:"getIdsFor",value:function(e){null==e&&Ge("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new nt,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new et,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),jl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Vl=Ke({getKey:null,doesEleInvalidateKey:ze,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gl=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Vl(t);Y(n,r),n.lookup=new zl(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Yl=Gl.prototype;Yl.reasons=jl,Yl.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Yl.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Yl.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new st((function(e,t){return t.reqs-e.reqs}))},Yl.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Yl.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Tt(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,h=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var g=o.getTextureQueue(p),v=g[g.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidthr;M--)T=o.getElement(e,t,n,M,jl.downscale);N()}else{var A;if(!x&&!w&&!E)for(var D=r-1;D>=-4;D--){var I=l.get(e,D);if(I){A=I;break}}if(b(A))return o.queueElement(e,r),A;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:u,width:d,height:c,scaledLabelShown:h},v.usedWidth+=Math.ceil(d+8),v.eleCaches.push(f),l.set(e,r,f),o.checkTextureFullness(v),f},Yl.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},Yl.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ze(t,e):e.fullnessChecks++},Yl.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ze(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,$e(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ze(r,o),n.push(o),o}},Yl.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Yl.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,jl.dequeue)}}return i},Yl.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Be,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Yl.onDequeue=function(e){this.onDequeues.push(e)},Yl.offDequeue=function(e){Ze(this.onDequeues,e)},Yl.setupDequeueing=Fl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Ze(c,a)}}();var d=function(t){var i=(t=t||{}).after;!function(){if(!a){a=kt();for(var t=0;t32767||s>32767)return null;if(o*s>16e6)return null;var l=r.makeLayer(a,n);if(null!=i){var d=c.indexOf(i)+1;c.splice(d,0,l)}else(void 0===t.insert||t.insert)&&c.unshift(l);return l};if(r.skipping&&!o)return null;for(var h=null,p=e.length/1,f=!o,g=0;g=p||!Vt(h.bb,v.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||f?r.queueLayer(h,v):r.drawEleInLayer(h,v,n,t),h.eles.push(v),m[n]=h}}return s||(f?null:c)},Xl.getEleLevelForLayerLevel=function(e,t){return e},Xl.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Xl.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Xl.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},Xl.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=_e(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Xl.invalidateLayer=function(e){if(this.lastInvalidationTime=_e(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ze(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*c,m=u*c,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,C=y*_;e.translate(w,E),b(C),x(C),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(a.colorStrokeStyle(e,v[0],v[1],v[2],n),"straight-triangle"===d?a.drawEdgeTrianglePath(t,e,s.allpts):(a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")):e.lineCap="butt"}();i&&a.drawEdgeUnderlay(e,t),b(),x(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},uu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};lu.drawEdgeOverlay=uu("overlay"),lu.drawEdgeUnderlay=uu("underlay"),lu.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");o.pathCacheKey&&o.pathCacheKey===h?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=h,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&void 0!==arguments[5]?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),a?e.stroke():e.fill()}du.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Tt(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},du.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},du.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Qe(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},du.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Qe(o,"labelX",n),c=Qe(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var h,p=n?n+"-":"",f=Qe(o,"labelWidth",n),g=Qe(o,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(h=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(h),u=0,c=0),x){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue,T=0===t.pstyle("text-background-shape").strValue.indexOf("round");if(w>0||_>0&&E>0){var N=u-C;switch(b){case"left":N-=f;break;case"center":N-=f/2}var M=c-g-C,A=f+2*C,D=g+2*C;if(w>0){var I=e.fillStyle,O=t.pstyle("text-background-color").value;e.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+w*a+")",T?hu(e,N,M,A,D,2):e.fillRect(N,M,A,D),e.fillStyle=I}if(_>0&&E>0){var P=e.strokeStyle,k=e.lineWidth,S=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+S[0]+","+S[1]+","+S[2]+","+E*a+")",e.lineWidth=_,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(T?hu(e,N,M,A,D,2,"stroke"):e.strokeRect(N,M,A,D),"double"===L){var R=_/2;T?hu(e,N+R,M+R,A-2*R,D-2*R,2,"stroke"):e.strokeRect(N+R,M+R,A-2*R,D-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=k,e.strokeStyle=P}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Qe(o,"labelWrapCachedLines",n),z=Qe(o,"labelLineHeight",n),j=f/2,V=this.getLabelJustification(t);switch("auto"===V||("left"===b?"left"===V?u+=-f:"center"===V&&(u+=-j):"center"===b?"left"===V?u+=-j:"right"===V&&(u+=j):"right"===b&&("center"===V?u+=j:"right"===V&&(u+=f))),x){case"top":case"center":case"bottom":c-=(F.length-1)*z}for(var G=0;G0&&e.strokeText(F[G],u,c),e.fillText(F[G],u,c),c+=z}else B>0&&e.strokeText(d,u,c),e.fillText(d,u,c);0!==h&&(e.rotate(-h),e.translate(-s,-l))}}};var pu={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(_(d.x)&&_(d.y)&&(!s||t.visible())){var h,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:A;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,F[0],F[1],F[2],t)},H=function(e,t,n,r){var i,o=l.nodePathCache=l.nodePathCache||[],a=Pe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+G),s=o[a],u=!1;return null!=s?(i=s,u=!0,c.pathCache=i):(i=new Path2D,o[a]=c.pathCache=i),{path:i,cacheHit:u}},W=t.pstyle("shape").strValue,q=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(d.x,d.y);var K=H(r,i,W,q);h=K.path,v=K.cacheHit}var Z=function(){if(!v){var n=d;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i,G,c)}g?e.fill(h):e.fill()},$=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i,G,c)))},J=function(){var t=(N>0?N:-N)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=N>0?0:255;0!==N&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(h):e.fill())},ee=function(){if(M>0){if(e.lineWidth=M,e.lineCap=P,e.lineJoin=O,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(S),e.lineDashOffset=L;break;case"solid":case"double":e.setLineDash([])}if("center"!==k){if(e.save(),e.lineWidth*=2,"inside"===k)g?e.clip(h):e.clip();else{var t=new Path2D;t.rect(-r/2-M,-i/2-M,r+2*M,i+2*M),t.addPath(h),e.clip(t,"evenodd")}g?e.stroke(h):e.stroke(),e.restore()}else g?e.stroke(h):e.stroke();if("double"===I){e.lineWidth=M/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(h):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(B>0){if(e.lineWidth=B,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=d;g&&(n={x:0,y:0});var o=l.getNodeShape(t),a=M;"inside"===k&&(a=0),"outside"===k&&(a*=2);var s,u=(r+a+(B+V))/r,c=(i+a+(B+V))/i,h=r*u,p=i*c,f=l.nodeShapes[o].points;if(g&&(s=H(h,p,o,f).path),"ellipse"===o)l.drawEllipsePath(s||e,n.x,n.y,h,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var v=0,y=0,m=0;"round-diamond"===o?v=1.4*(a+V+B):"round-heptagon"===o?(v=1.075*(a+V+B),m=-(a/2+V+B)/35):"round-hexagon"===o?v=1.12*(a+V+B):"round-pentagon"===o?(v=1.13*(a+V+B),m=-(a/2+V+B)/15):"round-tag"===o?(v=1.12*(a+V+B),y=.07*(a/2+B+V)):"round-triangle"===o&&(v=(a+V+B)*(Math.PI/2),m=-(a+V/2+B)/Math.PI),0!==v&&(h=r*(u=(r+v)/r),["round-hexagon","round-tag"].includes(o)||(p=i*(c=(i+v)/i)));for(var b=h/2,x=p/2,w=(G="auto"===G?ln(h,p):G)+(a+B+V)/2,E=new Array(f.length/2),_=new Array(f.length/2),C=0;C0){if(r=r||n.position(),null==i||null==o){var d=n.padding();i=n.width()+2*d,o=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a,c),t.fill()}}}};pu.drawNodeOverlay=fu("overlay"),pu.drawNodeUnderlay=fu("underlay"),pu.hasPie=function(e){return(e=e[0])._private.hasPie},pu.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,g=t.pstyle("pie-"+h+"-background-opacity").value*n,v=p/100;v+d>1&&(v=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*v;0===p||d>=1||d+v>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),d+=v)}};for(var gu={getPixelRatio:function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;ia.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},C=a.prevViewport;void 0===C||_.zoom!==C.zoom||_.pan.x!==C.pan.x||_.pan.y!==C.pan.y||g&&!f||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var T=a.getCachedZSortedEles();function N(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function M(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var A=a.data.bufferContexts[a.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var D=u.contexts[a.NODE],I=a.textureCache.texture;_=a.textureCache.viewport,D.setTransform(1,0,0,1,0,0),h?N(D,0,0,_.width,_.height):D.clearRect(0,0,_.width,_.height);var O=m.core("outside-texture-bg-color").value,P=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(D,O[0],O[1],O[2],P),D.fillRect(0,0,_.width,_.height),b=l.zoom(),M(D,!1),D.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),D.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var k=l.extent(),S=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),L=a.hideEdgesOnViewport&&S,R=[];if(R[a.NODE]=!c[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,R[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),R[a.DRAG]=!c[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,R[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||R[a.NODE]){var B=h&&!R[a.NODE]&&1!==p;M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.nondrag,s,k):a.drawLayeredElements(D,T.nondrag,s,k),a.debug&&a.drawDebugPoints(D,T.nondrag),n||h||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||R[a.DRAG])&&(B=h&&!R[a.DRAG]&&1!==p,M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.drag,s,k):a.drawCachedElements(D,T.drag,s,k),a.debug&&a.drawDebugPoints(D,T.drag),n||h||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(M(D=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var F=m.core("selection-box-border-width").value/b;D.lineWidth=F,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),F>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=u.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var j=a.lastRedrawTime;if(a.showFps&&j){j=Math.round(j);var V=Math.round(1e3/j);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+j+" ms = "+V+" fps",0,20),D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(h&&1!==p){var G=u.contexts[a.NODE],Y=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],U=u.contexts[a.DRAG],X=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):N(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||R[a.NODE])&&(H(G,Y,R[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||R[a.DRAG])&&(H(U,X,R[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")}},vu={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},_u.png=function(e){return Tu(e,this.bufferCanvasImage(e),"image/png")},_u.jpg=function(e){return Tu(e,this.bufferCanvasImage(e),"image/jpeg")};var Nu=Au,Mu=Au.prototype;function Au(e){var t=this,n=t.cy.window().document;t.data={canvases:new Array(Mu.CANVAS_LAYERS),contexts:new Array(Mu.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Mu.CANVAS_LAYERS),bufferCanvases:new Array(Mu.BUFFER_COUNT),bufferContexts:new Array(Mu.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l{e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822:(e,t,n)=>{"use strict";var r=n(6857),i=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},135:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],u=i.addDummyNode(e,"border",s,n);o[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s{"use strict";var r=n(6857);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},9859:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909:(e,t,n)=>{var r=n(6857),i=n(3988),o=n(8191).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},8191:(e,t,n)=>{var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031:(e,t,n)=>{var r=n(6857),i=n(8191).Graph,o=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var u=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202:(e,t,n)=>{"use strict";var r=n(6857),i=n(6822),o=n(8209),a=n(9361),s=n(3988).normalizeRanks,l=n(2948),u=n(3988).removeEmptyRanks,c=n(6353),d=n(135),h=n(4850),p=n(1453),f=n(3776),g=n(3988),v=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new v({multigraph:!0,compound:!0}),n=N(e.graph());return t.setGraph(r.merge({},m,T(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=N(e.node(n));t.setNode(n,r.defaults(T(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=N(e.edge(n));t.setEdge(n,r.merge({},_,T(i,E),r.pick(i,C)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};g.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){u(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=g.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){f(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function T(e,t){return r.mapValues(r.pick(e,t),Number)}function N(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},6857:(e,t,n)=>{var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(9754),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),p=e.node(u);e.setParent(d,u),p.borderTop=d,e.setParent(h,u),p.borderBottom=h,r.forEach(c,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,f=i.borderTop?a:2*a,g=c!==p?1:s-l[u]+1;e.setEdge(d,c,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},8209:(e,t,n)=>{"use strict";var r=n(6857),i=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(u!==s+1){for(e.removeEdge(t),o=0,++s;s{var r=n(6857);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},3860:(e,t,n)=>{var r=n(6857);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},7860:(e,t,n)=>{var r=n(6857),i=n(8191).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6639:(e,t,n)=>{"use strict";var r=n(6857);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r{"use strict";var r=n(6857),i=n(8918),o=n(6639),a=n(4520),s=n(7860),l=n(4384),u=n(8191).Graph,c=n(3988);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new u;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var l,u=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){h(f%2?n:a,f%4>=2),s=c.buildLayerMatrix(e);var v=o(e,s);v{"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},4959:(e,t,n)=>{"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){var n,i,o,a;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(i=t,o=0,a=0,(n=e).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},4520:(e,t,n)=>{var r=n(6857),i=n(3860),o=n(4959),a=n(5169);e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,p={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==h})));var f=i(t,u);r.forEach(f,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(f,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(g,p);var v=a(g,l);if(d&&(v.vs=r.flatten([d,v.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.order+m.order)/(v.weight+2),v.weight+=2}return v}},5169:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,l=r.sortBy(a.rhs,(function(e){return-e.i})),u=[],c=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(u,l,h),r.forEach(s,(function(e){h+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,d+=e.weight,h=o(u,l,h)}));var p={vs:r.flatten(u,!0)};return d&&(p.barycenter=c/d,p.weight=d),p}},2948:(e,t,n)=>{var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,u=a[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank{"use strict";var r=n(6857),i=n(8191).Graph,o=n(3988);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,u=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===u)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(as)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var p=l[d];a[e]===e&&t{"use strict";var r=n(6857),i=n(3988),o=n(9741).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},8481:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph,o=n(8073).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(r.setNode(u,{});a(r,e){"use strict";var r=n(8073).longestPath,i=n(8481),o=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r},6860:(e,t,n)=>{"use strict";var r=n(6857),i=n(8481),o=n(8073).slack,a=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,u=n(3988).simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=g(n);)y(n,e,t,v(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==i){var d=u===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=c,e.hasEdge(a,l)){var p=e.edge(n,c).cutvalue;s+=d?-p:p}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=f(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function v(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(0,e.node(t.v),u)&&c!==m(0,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=g,c.enterEdge=v,c.exchangeEdges=y},8073:(e,t,n)=>{"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038:e=>{e.exports="0.8.5"},8362:(e,t,n)=>{var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619:(e,t,n)=>{var r=n(117);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},9276:(e,t,n)=>{var r=n(117);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},4919:(e,t,n)=>{var r=n(8905),i=n(117);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},8905:(e,t,n)=>{var r=n(117),i=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),u=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6678:(e,t,n)=>{var r=n(117),i=n(6291);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},3590:(e,t,n)=>{var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s{e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(9888)}},498:(e,t,n)=>{var r=n(9888);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423:(e,t,n)=>{var r=n(117),i=n(6454),o=n(1737);e.exports=function(e,t){var n,a=new i,s={},l=new o;function u(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},6291:(e,t,n)=>{var r=n(117);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),i[u].onStack=!1,c.push(u)}while(s!==u);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},9888:(e,t,n)=>{var r=n(117);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},1737:(e,t,n)=>{var r=n(117);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priority{"use strict";var r=n(117);e.exports=s;var i="\0",o="\0",a="";function s(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function l(e,t){e[t]?e[t]++:e[t]=1}function u(e,t){--e[t]||delete e[t]}function c(e,t,n,o){var s=""+t,l=""+n;if(!e&&s>l){var u=s;s=l,l=u}return s+a+l+a+(r.isUndefined(o)?i:o)}function d(e,t){return c(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},s.prototype.setEdge=function(){var e,t,n,i,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=c(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return o&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,l(this._preds[t],e),l(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[t],e),u(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166:(e,t,n)=>{e.exports={Graph:n(6454),version:n(4458)}},7494:(e,t,n)=>{var r=n(117),i=n(6454);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},117:(e,t,n)=>{var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458:e=>{e.exports="2.1.8"},3143:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(9);function a(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in a.prototype=Object.create(r.prototype),r)a[s]=r[s];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},a.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(13),a=n(0),s=n(16),l=n(5);function u(e,t,n,a){null==n&&null==a&&(a=t),r.call(this,a),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=a,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new o(t.x,t.y,n.width,n.height):new o}for(var c in u.prototype=Object.create(r.prototype),r)u[c]=r[c];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}})),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)})),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach((function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}})),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>a.WORLD_BOUNDARY?t=a.WORLD_BOUNDARY:t<-a.WORLD_BOUNDARY&&(t=-a.WORLD_BOUNDARY);var n=this.rect.y;n>a.WORLD_BOUNDARY?n=a.WORLD_BOUNDARY:n<-a.WORLD_BOUNDARY&&(n=-a.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";var r=n(0);function i(){}for(var o in r)i[o]=r[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(0),a=n(7),s=n(3),l=n(1),u=n(13),c=n(12),d=n(11);function h(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof a?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in h.prototype=Object.create(r.prototype),r)h[p]=r[p];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},h.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(c,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},h.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,l=0;l(e=u.getTop())&&(r=e),o>(t=u.getLeft())&&(o=t)}return r==i.MAX_VALUE?null:(n=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-n,this.top=r-n,new c(this.left,this.top))},h.prototype.updateBounds=function(e){for(var t,n,r,o,a,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,d=-i.MAX_VALUE,h=this.nodes,p=h.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),c>(r=g.getTop())&&(c=r),d<(o=g.getBottom())&&(d=o)}var v=new u(s,c,l-s,d-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},h.calculateBounds=function(e){for(var t,n,r,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,d=e.length,h=0;h(t=p.getLeft())&&(a=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(o=p.getBottom())&&(c=o)}return new u(a,l,s-a,c-l)},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=h},function(e,t,n){"use strict";var r,i=n(1);function o(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var o=(r=t).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return n.isInterGraph=!1,o.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,o=[],a=(o=o.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var o=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(o=1);var a=o*n[0],s=n[1]/o;n[0]a)return n[0]=r,n[1]=l,n[2]=o,n[3]=b,!1;if(io)return n[0]=s,n[1]=i,n[2]=y,n[3]=a,!1;if(ro?(n[0]=c,n[1]=d,_=!0):(n[0]=u,n[1]=l,_=!0):T===M&&(r>o?(n[0]=s,n[1]=l,_=!0):(n[0]=h,n[1]=d,_=!0)),-N===M?o>r?(n[2]=m,n[3]=b,C=!0):(n[2]=y,n[3]=v,C=!0):N===M&&(o>r?(n[2]=g,n[3]=v,C=!0):(n[2]=x,n[3]=b,C=!0)),_&&C)return!1;if(r>o?i>a?(A=this.getCardinalDirection(T,M,4),D=this.getCardinalDirection(N,M,2)):(A=this.getCardinalDirection(-T,M,3),D=this.getCardinalDirection(-N,M,1)):i>a?(A=this.getCardinalDirection(-T,M,1),D=this.getCardinalDirection(-N,M,3)):(A=this.getCardinalDirection(T,M,2),D=this.getCardinalDirection(N,M,4)),!_)switch(A){case 1:O=l,I=r+-f/M,n[0]=I,n[1]=O;break;case 2:I=h,O=i+p*M,n[0]=I,n[1]=O;break;case 3:O=d,I=r+f/M,n[0]=I,n[1]=O;break;case 4:I=c,O=i+-p*M,n[0]=I,n[1]=O}if(!C)switch(D){case 1:k=v,P=o+-E/M,n[2]=P,n[3]=k;break;case 2:P=x,k=a+w*M,n[2]=P,n[3]=k;break;case 3:k=b,P=o+E/M,n[2]=P,n[3]=k;break;case 4:P=m,k=a+-w*M,n[2]=P,n[3]=k}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var o,a,s,l,u,c,d,h=e.x,p=e.y,f=t.x,g=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(d=(o=g-p)*(l=v-m)-(a=b-y)*(s=h-f))?null:new r((s*(c=m*y-v*b)-l*(u=f*p-h*g))/d,(a*u-o*c)/d)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var c=(-l+Math.sqrt(l*l-4*s*u))/(2*s),d=(-l-Math.sqrt(l*l-4*s*u))/(2*s);return c>=0&&c<=1?[c]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),a.add(c);var d=c.getEdges();for(o=0;o-1&&u.splice(g,1)}a=new Set,l=new Map}else e=[]}return e},h.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),o=0;o=0&&t.splice(d,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,o=t[0])}return o},h.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(4),o=n(0),a=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,a,s,l,u=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*o):(a>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||u>=s[0].length))for(var c=0;ce}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),a=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),s=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),u=0;u=0;D--)if(0!==this.s[D]){for(var I=D+1;I=0;B--){if(function(e,t){return e&&t}(B0;){var H=void 0,W=void 0;for(H=N-2;H>=-1&&-1!==H;H--)if(Math.abs(o[H])<=X+U*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){o[H]=0;break}if(H===N-2)W=4;else{var q=void 0;for(q=N-1;q>=H&&q!==H;q--){var K=(q!==N?Math.abs(o[q]):0)+(q!==H+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=X+U*K){this.s[q]=0;break}}q===H?W=3:q===N-1?W=1:(W=2,H=q)}switch(H++,W){case 1:var Z=o[N-2];o[N-2]=0;for(var $=N-2;$>=H;$--){var Q=r.hypot(this.s[$],Z),J=this.s[$]/Q,ee=Z/Q;this.s[$]=Q,$!==H&&(Z=-ee*o[$-1],o[$-1]=J*o[$-1]);for(var te=0;te=this.s[H+1]);){var Ne=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=Ne,HMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),a=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),a=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),a=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),a=n(3605),s=n(9817),l=n(945);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r{var r=n(8096),i=n(2428),o=n(6449),a=n(3656),s=n(361),l=n(7167),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&l(e),p=n||c||d||h,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!u.call(e,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||f.push(v);return f}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(7237)("length");e.exports=r},7805:(e,t,n)=>{var r=n(3360),i=n(5288);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547:(e,t,n)=>{var r=n(3360),i=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733:(e,t,n)=>{var r=n(1791),i=n(5950);e.exports=function(e,t){return e&&r(t,i(t),e)}},3838:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e,t){return e&&r(t,i(t),e)}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999:(e,t,n)=>{var r=n(7217),i=n(3729),o=n(6547),a=n(4733),s=n(3838),l=n(3290),u=n(3007),c=n(2271),d=n(8948),h=n(2),p=n(3349),f=n(5861),g=n(6189),v=n(7199),y=n(5529),m=n(6449),b=n(3656),x=n(7730),w=n(3805),E=n(8440),_=n(5950),C=n(7241),T="[object Arguments]",N="[object Function]",M="[object Object]",A={};A[T]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[N]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,D,I,O,P){var k,S=1&n,L=2&n,R=4&n;if(D&&(k=O?D(t,I,O,P):D(t)),void 0!==k)return k;if(!w(t))return t;var B=m(t);if(B){if(k=g(t),!S)return u(t,k)}else{var F=f(t),z=F==N||"[object GeneratorFunction]"==F;if(b(t))return l(t,S);if(F==M||F==T||z&&!O){if(k=L||z?{}:y(t),!S)return L?d(t,s(k,t)):c(t,a(k,t))}else{if(!A[F])return O?t:{};k=v(t,F,S)}}P||(P=new r);var j=P.get(t);if(j)return j;P.set(t,k),E(t)?t.forEach((function(r){k.add(e(r,n,D,r,t,P))})):x(t)&&t.forEach((function(r,i){k.set(i,e(r,n,D,i,t,P))}));var V=B?void 0:(R?L?p:h:L?C:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(k,i,e(r,n,D,i,t,P))})),k}},9344:(e,t,n)=>{var r=n(3805),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},3599:(e,t,n)=>{var r=n(4394);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(4528),i=n(5891);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},3335:e=>{e.exports=function(e,t){return e>t}},426:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},6131:(e,t,n)=>{var r=n(2523),i=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),a=n(689),s=n(5861),l=n(6449),u=n(3656),c=n(7167),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,v,y){var m=l(e),b=l(t),x=m?h:s(e),w=b?h:s(t),E=(x=x==d?p:x)==p,_=(w=w==d?p:w)==p,C=x==w;if(C&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(C&&!E)return y||(y=new r),m||c(e)?i(e,t,n,g,v,y):o(e,t,x,n,g,v,y);if(!(1&n)){var T=E&&f.call(e,"__wrapped__"),N=_&&f.call(t,"__wrapped__");if(T||N){var M=T?e.value():e,A=N?t.value():t;return y||(y=new r),v(M,A,n,g,y)}}return!!C&&(y||(y=new r),a(e,t,n,g,v,y))}},9172:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a{e.exports=function(e){return e!=e}},5083:(e,t,n)=>{var r=n(1882),i=n(7296),o=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},6038:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),a=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903:(e,t,n)=>{var r=n(3805),i=n(5527),o=n(181),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6176:e=>{e.exports=function(e,t){return e{var r=n(909),i=n(4894);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),a=n(8586),s=n(756),l=n(7197),u=n(7797);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},5250:(e,t,n)=>{var r=n(7217),i=n(7805),o=n(6649),a=n(2824),s=n(3805),l=n(7241),u=n(4974);e.exports=function e(t,n,c,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,c,e,d,h);else{var p=d?d(u(t,l),o,l+"",t,n,h):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},2824:(e,t,n)=>{var r=n(7805),i=n(3290),o=n(1961),a=n(3007),s=n(5529),l=n(2428),u=n(6449),c=n(3693),d=n(3656),h=n(1882),p=n(3805),f=n(1331),g=n(7167),v=n(4974),y=n(9884);e.exports=function(e,t,n,m,b,x,w){var E=v(e,n),_=v(t,n),C=w.get(_);if(C)r(e,n,C);else{var T=x?x(E,_,n+"",e,t,w):void 0,N=void 0===T;if(N){var M=u(_),A=!M&&d(_),D=!M&&!A&&g(_);T=_,M||A||D?u(E)?T=E:c(E)?T=a(E):A?(N=!1,T=i(_,!0)):D?(N=!1,T=o(_,!0)):T=[]:f(_)||l(_)?(T=E,l(E)?T=y(E):p(E)&&!h(E)||(T=s(_))):N=!1}N&&(w.set(_,T),b(T,_,m,x,w),w.delete(_)),r(e,n,T)}}},6155:(e,t,n)=>{var r=n(4932),i=n(7422),o=n(5389),a=n(5128),s=n(3937),l=n(7301),u=n(3714),c=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var h=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},6001:(e,t,n)=>{var r=n(7420),i=n(631);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},7420:(e,t,n)=>{var r=n(7422),i=n(3170),o=n(1769);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5558:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},9302:(e,t,n)=>{var r=n(3488),i=n(6757),o=n(2865);e.exports=function(e,t){return o(i(e,t,r),e+"")}},3170:(e,t,n)=>{var r=n(6547),i=n(1769),o=n(361),a=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,d=c-1,h=e;null!=h&&++u{var r=n(7334),i=n(3243),o=n(3488),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},3937:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),a=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},5765:(e,t,n)=>{var r=n(8859),i=n(5325),o=n(9905),a=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var u=-1,c=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,c=o;else if(d>=200){var g=t?null:s(e);if(g)return l(g);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++u{var r=n(4932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},1234:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r{e.exports=function(e,t){return e.has(t)}},4066:(e,t,n)=>{var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),a=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736:(e,t,n)=>{var r=n(1873),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730:(e,t,n)=>{var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e{var r=n(3730);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(6547),i=n(3360);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s{var r=n(1791),i=n(4664);e.exports=function(e,t){return r(e,i(e),t)}},8948:(e,t,n)=>{var r=n(1791),i=n(6375);e.exports=function(e,t){return r(e,i(e),t)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},999:(e,t,n)=>{var r=n(9302),i=n(6800);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},5508:(e,t,n)=>{var r=n(6151),i=n(6800),o=n(7400);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t{var r=n(6545),i=n(3950),o=n(4247),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},3243:(e,t,n)=>{var r=n(6110),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f{var r=n(1873),i=n(7828),o=n(5288),a=n(5911),s=n(317),l=n(4247),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,u,d,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=l;++d{var r=n(5970),i=n(6757),o=n(2865);e.exports=function(e){return o(i(e,void 0,r),e+"")}},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},3349:(e,t,n)=>{var r=n(2199),i=n(6375),o=n(7241);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},8879:(e,t,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},6375:(e,t,n)=>{var r=n(4528),i=n(8879),o=n(4664),a=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),a=n(6545),s=n(8303),l=n(2552),u=n(7473),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),v=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case v:return c;case y:return d;case m:return h;case b:return p}return t}),e.exports=x},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),a=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199:(e,t,n)=>{var r=n(9653),i=n(6169),o=n(3201),a=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},5529:(e,t,n)=>{var r=n(9344),i=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5891:(e,t,n)=>{var r=n(1873),i=n(2428),o=n(6449),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(5288),i=n(4894),o=n(361),a=n(3805);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586:(e,t,n)=>{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},6757:(e,t,n)=>{var r=n(1033),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},4974:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2865:(e,t,n)=>{var r=n(9570),i=n(1811)(r);e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6959:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r{var r=n(9811),i=n(9698),o=n(7927);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",c=u+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*",d="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+d+c,"g");e.exports=function(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}},2629:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,4)}},8055:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,5)}},7334:e=>{e.exports=function(e){return function(){return e}}},4684:(e,t,n)=>{var r=n(9302),i=n(5288),o=n(6800),a=n(7241),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n{e.exports=n(9754)},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},5970:(e,t,n)=>{var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},9754:(e,t,n)=>{var r=n(3729),i=n(909),o=n(4066),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},2420:(e,t,n)=>{var r=n(6649),i=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},1448:(e,t,n)=>{var r=n(426),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3693:(e,t,n)=>{var r=n(4894),i=n(346);e.exports=function(e){return i(e)&&r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},2193:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(2428),a=n(6449),s=n(4894),l=n(3656),u=n(5527),c=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:(e,t,n)=>{var r=n(9172),i=n(7301),o=n(6009),a=o&&o.isMap,s=a?i(a):r;e.exports=s},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1331:(e,t,n)=>{var r=n(2552),i=n(8879),o=n(346),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},8440:(e,t,n)=>{var r=n(6038),i=n(7301),o=n(6009),a=o&&o.isSet,s=a?i(a):r;e.exports=s},5015:(e,t,n)=>{var r=n(2552),i=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},2216:e=>{e.exports=function(e){return void 0===e}},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},7241:(e,t,n)=>{var r=n(695),i=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):i(e)}},8090:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:(e,t,n)=>{var r=n(4932),i=n(5389),o=n(5128),a=n(6449);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},3916:(e,t,n)=>{var r=n(3360),i=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},4506:(e,t,n)=>{var r=n(3599),i=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},5364:(e,t,n)=>{var r=n(5250),i=n(999)((function(e,t,n){r(e,t,n)}));e.exports=i},1684:(e,t,n)=>{var r=n(3599),i=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6533:(e,t,n)=>{var r=n(3599),i=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3950:e=>{e.exports=function(){}},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},4383:(e,t,n)=>{var r=n(6001),i=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),a=n(7797);e.exports=function(e){return o(e)?r(a(e)):i(e)}},3181:(e,t,n)=>{var r=n(5508)();e.exports=r},860:(e,t,n)=>{var r=n(882),i=n(909),o=n(5389),a=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},7091:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(4894),a=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031:(e,t,n)=>{var r=n(3120),i=n(6155),o=n(9302),a=n(6800),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9884:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e){return r(e,i(e))}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752:(e,t,n)=>{var r=n(3729),i=n(9344),o=n(641),a=n(5389),s=n(8879),l=n(6449),u=n(3656),c=n(1882),d=n(3805),h=n(7167);e.exports=function(e,t,n){var p=l(e),f=p||u(e)||h(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=f?p?new g:[]:d(e)&&c(g)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},299:(e,t,n)=>{var r=n(3120),i=n(9302),o=n(5765),a=n(3693),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},7200:(e,t,n)=>{var r=n(3222),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5880:(e,t,n)=>{var r=n(514),i=n(5950);e.exports=function(e){return null==e?[]:r(e,i(e))}},7248:(e,t,n)=>{var r=n(6547),i=n(1234);e.exports=function(e,t){return i(e||[],t||[],r)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(4497)})())); \ No newline at end of file diff --git a/nr-cytoscape-expand-collapse.js.LICENSE.txt b/nr-cytoscape-expand-collapse.js.LICENSE.txt new file mode 100644 index 0000000..a9f6f12 --- /dev/null +++ b/nr-cytoscape-expand-collapse.js.LICENSE.txt @@ -0,0 +1,9 @@ +/*! +Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable +Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com) +Licensed under The MIT License (http://opensource.org/licenses/MIT) +*/ + +/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */ + +/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */ diff --git a/package.json b/package.json index b9ac23e..f3df7d1 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "cytoscape-expand-collapse", + "name": "nr-cytoscape-expand-collapse", "version": "1.0.0", "description": "This extension provides an interface to expand-collapse nodes", "main": "./src/index.js", From 178b6c1977a984fa2b8d1a39a4e10de12740e9f7 Mon Sep 17 00:00:00 2001 From: Nidhish Reddy Date: Mon, 23 Dec 2024 21:03:16 +0530 Subject: [PATCH 3/5] chore: avoid unnecessary creation of support maps --- nr-cytoscape-expand-collapse.js | 2 +- package.json | 2 +- src/index.js | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/nr-cytoscape-expand-collapse.js b/nr-cytoscape-expand-collapse.js index b54cd91..89a6977 100644 --- a/nr-cytoscape-expand-collapse.js +++ b/nr-cytoscape-expand-collapse.js @@ -1,2 +1,2 @@ /*! For license information please see nr-cytoscape-expand-collapse.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.nrCytoscapeExpandCollapse=t():e.nrCytoscapeExpandCollapse=t()}(this,(()=>(()=>{var e={6078:e=>{var t={equalBoundingBoxes:function(e,t){return e.x1==t.x1&&e.x2==t.x2&&e.y1==t.y1&&e.y2==t.y2},getUnion:function(e,t){var n={x1:Math.min(e.x1,t.x1),x2:Math.max(e.x2,t.x2),y1:Math.min(e.y1,t.y1),y2:Math.max(e.y2,t.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=t},4540:(e,t,n)=>{var r=n(3630),i=n(438);e.exports=function(e,t,o){var a,s,l=e;const u=function(){var e=t.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=t.container(),u=e.getContext("2d");l.append(e),a=n(1537)(t);var c=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}},d=r((function(){e.height=t.container().offsetHeight,e.width=t.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),r=c(l);e.style.top=-(n.top-r.top),e.style.left=-(n.left-r.left),t&&g()}),0)}),250);function h(){d()}h();var p={};function f(){return t.scratch("_cyExpandCollapse").options}function g(){var e=t.width(),n=t.height();u.clearRect(0,0,e,n),s=null}function v(e,t,n,r,i){var o=new Image(r,i);o.src=e,o.onload=()=>{u.drawImage(o,t,n,r,i)}}t.on("resize",p.eCyResize=function(){h()}),t.on("expandcollapse.clearvisualcue",(function(){s&&g()}));var y,m=null,b=null;t.on("mousedown",p.eMouseDown=function(e){m=e.renderedPosition||e.cyRenderedPosition}),t.on("mouseup",p.eMouseUp=function(e){b=e.renderedPosition||e.cyRenderedPosition}),t.on("remove","node",p.eRemove=function(e){e.target==s&&g()}),t.on("select unselect",p.eSelect=function(){s&&g();var e=t.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),r=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||r){var i,o=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var d=t.zoom()<1?l/(2*t.zoom()):l/2,h=parseFloat(e.css("border-width"));i={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+h+d+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+h+d+1}}else{var p=f().expandCollapseCuePosition;i="function"==typeof p?p.call(this,e):p}var g=a.convertToRenderedPosition(i),y=((l=Math.max(l,l*t.zoom()))-(c=Math.max(c,c*t.zoom())))/2,m=g.x,b=g.y,x=m-l/2,w=b-l/2,E=l;if(o&&f().expandCueImage)v(f().expandCueImage,x,w,l,l);else if(!o&&f().collapseCueImage)v(f().collapseCueImage,x,w,l,l);else{var _=u.fillStyle,C=u.lineWidth,T=u.strokeStyle;u.fillStyle="black",u.strokeStyle="black",u.ellipse(m,b,l/2,l/2,0,0,2*Math.PI),u.fill(),u.beginPath(),u.strokeStyle="white",u.lineWidth=Math.max(2.6,2.6*t.zoom()),u.moveTo(x+y,w+l/2),u.lineTo(x+c+y,w+l/2),o&&(u.moveTo(x+l/2,w+y),u.lineTo(x+l/2,w+c+y)),u.closePath(),u.stroke(),u.strokeStyle=T,u.fillStyle=_,u.lineWidth=C}e._private.data.expandcollapseRenderedStartX=x,e._private.data.expandcollapseRenderedStartY=w,e._private.data.expandcollapseRenderedCueSize=E,s=e}}(n)}}),t.on("tap",p.eTap=function(e){var n=s;if(n){var r=n.data("expandcollapseRenderedStartX"),i=n.data("expandcollapseRenderedStartY"),a=n.data("expandcollapseRenderedCueSize"),l=r+a,u=i+a,c=e.renderedPosition||e.cyRenderedPosition,d=c.x,h=c.y,p=f(),v=(p.expandCollapseCueSensitivity-1)/2;Math.abs(m.x-b.x)<5&&Math.abs(m.y-b.y)<5&&d>=r-a*v&&d<=l+a*v&&h>=i-a*v&&h<=u+a*v&&(p.undoable&&!y&&(y=t.undoRedo({defaultActions:!1})),o.isCollapsible(n)?(g(),p.undoable?y.do("collapse",{nodes:n,options:p}):o.collapse(n,p)):o.isExpandable(n)&&(g(),p.undoable?y.do("expand",{nodes:n,options:p}):o.expand(n,p)),n.selectable()&&(n.unselectify(),t.scratch("_cyExpandCollapse").selectableChanged=!0))}}),t.on("afterUndo afterRedo",p.eUndoRedo=p.eSelect),t.on("position","node",p.ePosition=i(p.eSelect,100,g)),t.on("pan zoom",p.ePosition),p.hasEventFields=!0,function(e){var n=t.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,t.scratch("_cyExpandCollapse",n)}(p)},unbind:function(){var e=u();e.hasEventFields?(t.trigger("expandcollapse.clearvisualcue"),t.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=u();e.hasEventFields?t.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(t.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(t.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},3630:e=>{var t,n,r=(t=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,r,i){var o,a,s,l,u,c,d,h,p,f=0,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(r=r<0?0:+r||0,!0===i){var y=!0;v=!1}else p=typeof(h=i),!h||"object"!=p&&"function"!=p||(y=!!i.leading,g="maxWait"in i&&t(+i.maxWait||0,r),v="trailing"in i?!!i.trailing:v);function m(t,r){r&&clearTimeout(r),a=c=d=void 0,t&&(f=n(),s=e.apply(u,o),c||a||(o=u=void 0))}function b(){var e=r-(n()-l);e<=0||e>r?m(d,a):c=setTimeout(b,e)}function x(){m(v,c)}function w(){if(o=arguments,l=n(),u=this,d=v&&(c||!y),!1===g)var t=y&&!c;else{a||y||(f=l);var i=g-(l-f),h=i<=0||i>g;h?(a&&(a=clearTimeout(a)),f=l,s=e.apply(u,o)):a||(a=setTimeout(x,i))}return h&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(b,r)),t&&(h=!0,s=e.apply(u,o)),!h||c||a||(o=u=void 0),s}return w.cancel=function(){c&&clearTimeout(c),a&&clearTimeout(a),f=0,a=c=d=void 0},w});e.exports=r},438:e=>{e.exports=function(e,t,n){let r,i=!0;return function(){const o=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,e.apply(o,a),i=!0}),t),i&&(n.apply(o,a),i=!1)}}},1537:(e,t,n)=>{const{runLayoutAsync:r}=n(8647);e.exports=function(e){return{moveNodes:function(e,t,n){var r=n?t:this.getTopMostNodes(t),i=r.not(":parent");i.positions((function(t,n){return{x:i[n].position("x")+e.x,y:i[n].position("y")+e.y}}));for(var o=0;o"group"===e.data().type)).length){const n={};(e?.scratch("_cyExpandCollapse")?.positions??[]).forEach((({nodeId:e,position:t})=>{n[e]=t})),await r(e.layout({name:"preset",fit:!1,positions:n,zoom:e.zoom(),pan:e.pan(),padding:t?.padding??50,animate:t?.animate??!0,animationDuration:t?.animationDuration??500,animationEasing:t?.animationEasing}))}e.scratch("_cyExpandCollapse").positions=null}},convertToRenderedPosition:function(t){var n=e.pan(),r=e.zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}}}},9272:(e,t,n)=>{var r=n(6078);e.exports=function(e){var t=n(1537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,r,i){if(n._private.data.collapsedChildren){var o={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var a=n._private.data.collapsedChildren;a.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,t){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,t),e.removeData("expand"));for(var n=e.children(),r=0;rs?(u+=p,c-=p):(u-=p,c+=p),e._private.data["y-before-fisheye"]>l?(d+=f,h-=f):(d-=f,h+=f);for(var g=[],v=[],y=0;yw?u:c,b=l>E?d:h,isFinite(_)&&(C=Math.min(m,b/Math.abs(_))),0!==_&&(T=Math.min(b,m*Math.abs(_))),s>w&&(C*=-1),l>E&&(T*=-1),this.fishEyeViewMoveNode(x,C,T,n,t,r,i,o)}return 0==a.length&&e.same(n)&&this.expandNodeBaseFunction(n,t,i),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],t,n,r,i,o),e},getSiblings:function(t){return null==t.parent()[0]?e.nodes(":visible").orphans().difference(t):t.siblings(":visible")},fishEyeViewMoveNode:function(t,n,r,i,o,a,s,l){var u=e.collection();t.isParent()&&(u=t.children(":visible"));var c=this;if(0==u.length){var d={x:t._private.position.x+n,y:t._private.position.y+r};o&&a?(this.animatedlyMovingNodeCount++,t.animate({position:d,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!i.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(i,o,s)}},{duration:l||1e3})):t.position(d)}else for(var h=0;h0?r.add(i):r.add(n)}return r},expandEdge:function(t){t.unselect();var n={edges:e.collection(),oldEdges:e.collection()},r=t.data("collapsedEdges");return void 0!==r&&r.length>0&&(t.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(t),e.remove(t),n.edges=e.add(r),t.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var t=this.getEdgesDistinctEndPoints(e);return 2==t.length&&t},getEdgesDistinctEndPoints:function(e){var t=[];return e.forEach(function(e){this.containsElement(t,e.source())||t.push(e.source()),this.containsElement(t,e.target())||t.push(e.target())}.bind(this)),t},containsElement:function(e,t){for(var n=!1,r=0;r{const r=n(4726),i=n(6527),o=n(5111);e.exports=function(e){const t=e.json();let n=document.getElementById("support-map");return n.style.width=e.container().clientWidth+"px",n.style.height=e.container().clientHeight+"px",r.use(i),r.use(o),r({container:n,elements:t.elements,styleEnabled:!0,style:t.style})}},4497:(e,t,n)=>{var r;!function(){"use strict";var i=function(e){if(!e)return;var t=n(9699),r=n(4540);const i=n(3666),{runLayoutAsync:o,resolveCompoundNodesOverlap:a}=n(8647);var s=null;function l(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n.hasOwnProperty(r)&&(n[r]=t[r]);return n}function u(e){var t="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=t,e.fisheye=n}function c(e,t){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===t?n:n[t]}function d(e,t,n){c(e)[t]=n}e("core","expandCollapse",(function(e){var h=this;const p=document.querySelector(".map.__________cytoscape_container");if(p){const e=document.createElement("div");e.id="support-map",e.style.zIndex=-1,e.style.opacity=0,p.parentNode.insertBefore(e,p.nextSibling)}else console.log("Element not found");var f=c(h,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999,isGroupBy:!0};if("get"!==e){f=l(f,e);var g=function(e,t){var n={};function h(t){var r=c(e,"options");t.cueEnabled&&!r.cueEnabled?n.enableCue():!t.cueEnabled&&r.cueEnabled&&n.disableCue()}return n.setOptions=function(t){h(t),d(e,"options",t)},n.extendOptions=function(t){var n=l(c(e,"options"),t);h(n),d(e,"options",n)},n.setOption=function(t,n){var r={};r[t]=n;var i=l(c(e,"options"),r);h(i),d(e,"options",i)},n.collapse=async function(n,r){var s=this.collapsibleNodes(n);if(r?.isGroupBy){var h=i(e),p=s.map((e=>{var t=h.getElementById(e.id());return t.toggleClass("expanded",!1),t.toggleClass("cy-expand-collapse-collapsed-node",!0),t.toggleClass("collapsed",!0),t}));if(p.length){var f=h.collection(p);t.simpleCollapseGivenNodes(f);var g=c(e,"options").layoutBy;await o(h.layout({...g,animate:!1})),await a(h,{...g,animate:!1});var v=h.nodes().map((e=>({nodeId:e.id(),position:e.position()})));h.destroy(),d(e,"positions",v)}}var y=l(c(e,"options"),r);return u(y),t.collapseGivenNodes(s,y)},n.collapseRecursively=async function(t,n){var r=this.collapsibleNodes(t),i=l(c(e,"options"),n);return u(i),await this.collapse(r.union(r.descendants()),i)},n.expand=async function(n,r){if(r?.isGroupBy){var s=i(e),h=s.getElementById(n.id()),p=h._private.data.collapsedChildren;s.add(p),h.toggleClass("cy-expand-collapse-collapsed-node",!1),h.toggleClass("collapsed",!1),h.toggleClass("expanded",!0);var f=c(e,"options").layoutBy;await o(s.layout({...f,animate:!1})),await a(s,{...f,animate:!1});var g=s.nodes().map((e=>({nodeId:e.id(),position:e.position()})));s.destroy(),d(e,"positions",g)}var v=this.expandableNodes(n),y=l(c(e,"options"),r);return u(y),t.expandGivenNodes(v,y)},n.expandRecursively=function(n,r){var i=this.expandableNodes(n),o=l(c(e,"options"),r);return u(o),t.expandAllNodes(i,o)},n.collapseAll=async function(t){var n=l(c(e,"options"),t);return u(n),await this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(t){var n=l(c(e,"options"),t);return u(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isCollapsible(e)}))},n.expandableNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var r=e.collection();return t.getCollapsedChildrenRecursively(n,r)},n.getAllCollapsedChildrenRecursively=function(){var t,n=e.collection(),r=e.nodes(".cy-expand-collapse-collapsed-node");for(t=0;t[e,e])));var u={edges:e.collection(),oldEdges:e.collection()};return s.forEach(function(e){const n=e[1].id();var r=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(r=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),r.length>=2){var i=t.collapseGivenEdges(r,a);u.oldEdges=u.oldEdges.add(i.oldEdges),u.edges=u.edges.add(i.edges)}}.bind(this)),u},n.expandEdgesBetweenNodes=function(t){var n,r,i=e.collection(),o=(r=[],(n=t).slice(0,n.length-1).forEach((function(e,t){n.slice(t+1,n.length).forEach((function(t){r.push([e,t])}))})),r);return o.push(...t.map((e=>[e,e]))),o.forEach(function(e){const t=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+t+'"],[target = "'+t+'"]');e[0].id()===t&&(n=e[0].connectedEdges('[source = "'+t+'"][target = "'+t+'"]')),i=i.union(n)}.bind(this)),this.expandEdges(i)},n.collapseAllEdges=function(t){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),t)},n.expandAllEdges=function(){var t=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},r=this.expandEdges(t);return n.oldEdges=n.oldEdges.add(r.oldEdges),n.edges=n.edges.add(r.edges),n},n.loadJson=function(e){s.loadJson(e)},n.saveJson=function(e,t){return s.saveJson(e,t)},n}(h,n(9272)(h));s=n(554)(h,g),d(h,"api",g),t(h,g),r(f,h,g),f.cueEnabled||r("unbind",h,g),f.ready&&f.ready(),d(h,"options",f),d(h,"parentData",{})}return c(h,"api")}))};e.exports&&(e.exports=i),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r),"undefined"!=typeof cytoscape&&i(cytoscape)}()},8647:(e,t,n)=>{function r(e){return new Promise((t=>{e.on("layoutstop",t),e.run()}))}e.exports={runLayoutAsync:r,resolveCompoundNodesOverlap:async function(e,t){const i=n(1537)(e);if(e.nodes().filter((e=>"positioning-support"===e.data().type)).length)return;const o=function(e){const t={};return e.filter((e=>"default"!==e.data().type)).forEach((e=>{const n=e.data().parent;if(void 0===n)t[1]||(t[1]={root:[]}),t[1].root.push(e);else{const r=n.split("::").length+1;t[r]||(t[r]={}),t[r][n]||(t[r][n]=[]),t[r][n].push(e)}})),Object.keys(t).sort(((e,t)=>parseInt(e)-parseInt(t))).map(((e,n)=>({level:n+1,items:"1"===e?[t[e].root]:Object.values(t[e])}))).reverse()??[]}(e.nodes());for(let n=0;n{if(!t.hasClass("cy-expand-collapse-collapsed-node")&&t.isParent()){const n=`support ${t.data().id}`,r={group:"nodes",data:{id:n,parent:t.data().parent,type:"positioning-support",label:`${t.data().label}`},style:{width:t.boundingBox().w,height:t.boundingBox().h,padding:0,"min-width":0,"border-width":0,shape:"round-rectangle"},position:{x:t.position("x"),y:t.position("y")}};e.add(r);const i=t.remove();a=a.union(i);const o=e.getElementById(n);return s=s.union(o),o}return t}));l=l.union(r)}if(0===a.length&&1===o.length){const e=l.layout(t);await r(e)}else if(a.length>0){const n=l.layout(t);await r(n),a.restore(),a.forEach((t=>{if("edges"!==t.group()||"default"===t.data()?.type){const n=`support ${t.data().id}`,r=e.getElementById(n);if(r?.length){const e={x:t.position().x{e.exports=function(e,t){function n(t,i,o,a){t.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,t){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),r={layoutBy:null,animate:!1,fisheye:!1},i=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],o=0;o0?t[n](i.options):t[n](c,i.options)):(u.oldData=a(),u.nodes=n.indexOf("All")>0?t[n](r):t[n](e.collection(c),r),s=i.oldData,l={},e.nodes().not(":parent").positions((function(e,t){"number"==typeof e&&(e=t),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),u}}function l(n){var r=n.options,i=n.edges,o={};if(o.options=r,n.firstTime){var a=t.collapseEdges(i,r);o.edges=a.edges,o.oldEdges=a.oldEdges,o.firstTime=!1}else o.oldEdges=i,o.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return o}function u(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function c(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function d(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdges(n.edges);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.oldEdges=n.edges,i.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function h(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function p(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}}},7799:function(e,t,n){var r;r=function(e){return(()=>{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var o in r)i[o]=r[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),o=n(880),a=n(991),s=n(767),l=n(806),u=n(902),c=n(551).FDLayoutConstants,d=n(551).LayoutConstants,h=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,v=n(551).Integer,y=n(551).IGeometry,m=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},w.prototype.newNode=function(e){return new a(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var n=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,o=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(o)||(e.nodesInRelativeVertical.push(o),e.nodeToRelativeConstraintMapVertical.set(o,[]),e.dummyToNodeForHorizontalAlignment.has(o)?e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(o).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:t.gap})}}));else{var d=new Map,h=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var t=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;h.has(r)?h.get(r).push(i):h.set(r,[i]),h.has(i)?h.get(i).push(r):h.set(i,[r])}}));var p=function(e,t){var n=[],r=[],i=new x,o=new Set,a=0;return e.forEach((function(s,l){if(!o.has(l)){n[a]=[],r[a]=!1;var u=l;for(i.push(u),o.add(u),n[a].push(u);0!=i.length;)u=i.shift(),t.has(u)&&(r[a]=!0),e.get(u).forEach((function(e){o.has(e)||(i.push(e),o.add(e),n[a].push(e))}));a++}})),{components:n,isFixed:r}},f=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(h,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(a.y)),o=Math.floor(a.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-a.x/2,d.WORLD_CENTER_Y-a.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),o=new b;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(n.x),o.setWorldOrgY(n.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=c.indexOf(v);m>=0&&c.splice(m,1),f--,d--}h=null!=t?(c.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/d,x=h;p!=d;x=++x%f){var E=c[x].getOtherEnd(e);if(E!=t){var _=(n+p*b)%360,C=(_+b)%360;w.branchRadialLayout(E,e,_,C,i+o,o),p++}}},w.maxDiagonalInTree=function(e){for(var t=v.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),o=new a(e.graphManager);o.id=r,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=o;var s=e.getGraphManager().add(e.newGraph(),o),l=i.getChild();l.add(o);for(var u=0;ui?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):"bottom"==r.labelPosVertical&&r.setHeight(o+r.labelHeight))}}))},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,o=t.labelMarginLeft,a=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,o,a)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,o=r.paddingTop,a=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,o,a,s)}))},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=h.rect.height)}n+=c+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())}));var u,c=o/i,d=a/i,h=Math.pow(n-r,2)+4*(c+r)*(d+n)*i,p=(r-n+Math.sqrt(h))/(2*(c+r));t?(u=Math.ceil(p))==p&&u++:u=Math.floor(p);var f=u*(c+r)-r;return s>f&&(f=s),f+2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},u=function(e,t){return s(t)-s(e)};e.sort((function(e,t){var n=u;return a.idealRowWidth?(n=o)(e.id,t.id):n(e,t)}));for(var c=0,d=0,h=0;h0&&(o+=e.horizontalPadding),e.rowWidth[n]=o,e.width0&&(a+=e.verticalPadding);var s=0;a>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=a,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var o=e.rowWidth[i];if(o+e.horizontalPadding+t<=e.width)return!0;var a,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),a=e.width-o>=t+e.horizontalPadding?(e.height+l)/(o+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtho&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-o,e.rowWidth[n]=e.rowWidth[n]+o,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=r[s].height);t>0&&(a+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=a,e.rowHeight[n]0)for(var d=i;d<=o;d++)u[0]+=this.grid[d][a-1].length+this.grid[d][a].length-1;if(o0)for(d=a;d<=s;d++)u[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var h,p,f=v.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function o(e,t,n,i){r.call(this,e,t,n,i)}for(var a in o.prototype=Object.create(r.prototype),r)o[a]=r[a];o.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var o=0;r.forEach((function(e){"horizontal"==t?(d.set(e,l.has(e)?u[l.get(e)]:i.get(e)),o+=d.get(e)):(d.set(e,l.has(e)?c[l.get(e)]:i.get(e)),o+=d.get(e))})),o/=r.length,e.forEach((function(e){n.has(e)||d.set(e,o)}))}else{var a=0;e.forEach((function(e){a+="horizontal"==t?l.has(e)?u[l.get(e)]:i.get(e):l.has(e)?c[l.get(e)]:i.get(e)})),a/=e.length,e.forEach((function(e){d.set(e,a)}))}}));for(var f=function(){var r=p.shift();e.get(r).forEach((function(e){if(d.get(e.id)a&&(a=y),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!h&&v.return&&v.return()}finally{if(p)throw f}}var x=(r+a)/2-(o+s)/2,w=!0,E=!1,_=void 0;try{for(var C,T=e[Symbol.iterator]();!(w=(C=T.next()).done);w=!0){var N=C.value;d.set(N,d.get(N)+x)}}catch(e){E=!0,_=e}finally{try{!w&&T.return&&T.return()}finally{if(E)throw _}}}))}return d},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach((function(e){e.left?u[l.get(e.left)]-u[l.get(e.right)]>=0?t++:n++:c[l.get(e.top)]-c[l.get(e.bottom)]>=0?r++:i++})),t>n&&r>i)for(var o=0;on)for(var a=0;ai)for(var s=0;s1)t.fixedNodeConstraint.forEach((function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[u[l.get(e.nodeId)],c[l.get(e.nodeId)]]})),_=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach((function(e){i.add(e)}));var o,a=new Set([].concat(r(i)).filter((function(e){return T.has(e)})));o=a.size>0?u[l.get(a.values().next().value)]:g(i).x,n[t].forEach((function(t){w[e]=[o,c[l.get(t)]],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},o=0;o0?u[l.get(o.values().next().value)]:g(n).y,a[t].forEach((function(t){w[e]=[u[l.get(t)],i],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},d=0;dD&&(D=A[O].length,I=O);if(D0){var W={x:0,y:0};t.fixedNodeConstraint.forEach((function(e,t){var n,r,i=(r={x:u[l.get(e.nodeId)],y:c[l.get(e.nodeId)]},{x:(n=e.position).x-r.x,y:n.y-r.y});W.x+=i.x,W.y+=i.y})),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,u.forEach((function(e,t){u[t]+=W.x})),c.forEach((function(e,t){c[t]+=W.y})),t.fixedNodeConstraint.forEach((function(e){u[l.get(e.nodeId)]=e.position.x,c[l.get(e.nodeId)]=e.position.y}))}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var q=t.alignmentConstraint.vertical,K=function(e){var t=new Set;q[e].forEach((function(e){t.add(e)}));var n,i=new Set([].concat(r(t)).filter((function(e){return T.has(e)})));n=i.size>0?u[l.get(i.values().next().value)]:g(t).x,t.forEach((function(e){T.has(e)||(u[l.get(e)]=n)}))},Z=0;Z0?c[l.get(i.values().next().value)]:g(t).y,t.forEach((function(e){T.has(e)||(c[l.get(e)]=n)}))},J=0;J<$.length;J++)Q(J)}t.relativePlacementConstraint&&function(){var e=new Map,n=new Map,r=new Map,i=new Map,o=new Map,a=new Map,s=new Set,d=new Set;if(T.forEach((function(e){s.add(e),d.add(e)})),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var h=t.alignmentConstraint.vertical,p=function(t){r.set("dummy"+t,[]),h[t].forEach((function(n){e.set(n,"dummy"+t),r.get("dummy"+t).push(n),T.has(n)&&s.add("dummy"+t)})),o.set("dummy"+t,u[l.get(h[t][0])])},f=0;f{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(45);return r})()},e.exports=r(n(3143))},5111:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=function(e){return"function"==typeof e},o=n(2),a=n(3),s=n(4);function l(e){this.options=a({},o,e)}l.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=function(e,t){return i(t)?t.apply(e,[e]):t},a=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===a.x2&&(a.x2=a.x1+a.w),void 0===a.w&&(a.w=a.x2-a.x1),void 0===a.y2&&(a.y2=a.y1+a.h),void 0===a.h&&(a.h=a.y2-a.y1);var l=new s.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),l.setGraph(u),l.setDefaultEdgeLabel((function(){return{}})),l.setDefaultNodeLabel((function(){return{}}));var d=n.nodes();i(e.sort)&&(d=d.sort(e.sort));for(var h=0;h1?t-1:0),r=1;r{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,o={getTopMostNodes:function(e){for(var t={},n=0;n0&&u.merge(e)}));for(var c=0;c1){u=s[0],c=u.connectedEdges().length,s.forEach((function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,u=!1,c=void 0;try{for(var d,h=t.nodeIndexes[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=r(p,2),g=f[0],v=f[1],y=n.cy.getElementById(g);if(y){var m=y.boundingBox(),b=t.xCoords[v]-m.w/2,x=t.xCoords[v]+m.w/2,w=t.yCoords[v]-m.h/2,E=t.yCoords[v]+m.h/2;bo&&(o=x),ws&&(s=E)}}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}var _=e.x-(o+i)/2,C=e.y-(s+a)/2;t.xCoords=t.xCoords.map((function(e){return e+_})),t.yCoords=t.yCoords.map((function(e){return e+C}))}else{Object.keys(t).forEach((function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,u=n.getRect().y,c=n.getRect().y+n.getRect().height;ro&&(o=l),us&&(s=c)}));var T=e.x-(o+i)/2,N=e.y-(s+a)/2;Object.keys(t).forEach((function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+N)}))}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,u=void 0,c=void 0,d=void 0,h=e.descendants().not(":parent"),p=h.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),o<(u=t[r.get(g.id())]+g.width()/2)&&(o=u),a>(c=n[r.get(g.id())]-g.height()/2)&&(a=c),s<(d=n[r.get(g.id())]+g.height()/2)&&(s=d)}var v={};return v.topLeftX=i,v.topLeftY=a,v.width=o-i,v.height=s-a,v},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach((function(e){var t=!1;e.children().forEach((function(e){"none"!=e.css("display")&&(t=!0)})),t||n.merge(e)})),n}};e.exports=o},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,o=n(140).CoSENode,a=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,u=n(140).layoutBase.FDLayoutConstants,c=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,h=d.nodes(),p=d.edges(),f=void 0,g=void 0,v=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,v=t.yCoords);var m=function(e){return"function"==typeof e},b=function(e,t){return m(e)?e(t):e},x=r.calcParentsWithoutChildren(n,d);null!=e.nestingFactor&&(c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(c.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(c.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(c.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(c.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,c.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,c.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,c.TILE=e.tile,c.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1),"enforced"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1),"cose"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?c.TREE_REDUCTION_ON_INCREMENTAL=!1:c.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var u=n.length,c=0;c0&&e(i.getGraphManager().add(i.newGraph(),p),h,i,l)}}(E.addRoot(),r.getTopMostNodes(h),w,e),function(t,n,r){for(var i=0,o=0,a=0;a0?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=i/o:m(e.idealEdgeLength)?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,c.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(d){var h=o.getTopMostNodes(e.eles.nodes());if((l=o.connectComponents(t,e.eles,h)).forEach((function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),e.randomize&&l.forEach((function(t){e.eles=t,r.push(a(e))})),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,v={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach((function(e,t){0==e.edges().length&&(e.nodes().forEach((function(t,n){p.merge(e.nodes()[n]),t.isParent()||(v.nodeIndexes.set(e.nodes()[n].id(),g++),v.xCoords.push(e.nodes()[0].position().x),v.yCoords.push(e.nodes()[0].position().y))})),y.push(t))})),p.length>1){var m=p.boundingBox();u.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),l.push(p),r.push(v);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),u.splice(y[b],1)}}l.forEach((function(t,n){e.eles=t,i.push(s(e,r[n])),o.relocateComponent(u[n],i[n],e)}))}else l.forEach((function(t,n){o.relocateComponent(u[n],r[n],e)}));var x=new Set;if(l.length>1){var w=[],E=n.filter((function(e){return"none"==e.css("display")}));l.forEach((function(t,n){var a=void 0;if("draft"==e.quality&&(a=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach((function(t){if("draft"==e.quality)if(t.isParent()){var u=o.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:u.topLeftX,y:u.topLeftY,width:u.width,height:u.height})}else l=a.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})})),t.edges().forEach((function(t){var l=t.source(),u=t.target();if("none"!=l.css("display")&&"none"!=u.css("display"))if("draft"==e.quality){var c=a.get(l.id()),d=a.get(u.id()),h=[],p=[];if(l.isParent()){var f=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);h.push(f.topLeftX+f.width/2),h.push(f.topLeftY+f.height/2)}else h.push(r[n].xCoords[c]),h.push(r[n].yCoords[c]);if(u.isParent()){var g=o.calcBoundingBox(u,r[n].xCoords,r[n].yCoords,a);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[d]),p.push(r[n].yCoords[d]);s.edges.push({startX:h[0],startY:h[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][u.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][u.id()].getCenterX(),endY:i[n][u.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),x.add(n))}}));var _=c.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach((function(e,t){var n=e.xCoords.map((function(e){return e+_[t].dx})),r=e.yCoords.map((function(e){return e+_[t].dy}));e.xCoords=n,e.yCoords=r}));else{var C=0;x.forEach((function(e){Object.keys(i[e]).forEach((function(t){var n=i[e][t];n.setCenter(n.getCenterX()+_[C].dx,n.getCenterY()+_[C].dy)})),C++}))}}}else{var T=e.eles.boundingBox();if(u.push({x:T.x1+T.w/2,y:T.y1+T.h/2}),e.randomize){var N=a(e);r.push(N)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),o.relocateComponent(u[0],i[0],e)):o.relocateComponent(u[0],r[0],e)}var M=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var o=void 0,a=void 0,s=t.data("id");return i.forEach((function(e){s in e&&(o={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},a=e[s])})),e.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.labelHeight/2))),null==o&&(o={x:t.position("x"),y:t.position("y")}),{x:o.x,y:o.y}}var l=void 0;return r.forEach((function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})})),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=o.calcParentsWithoutChildren(t,n),D=n.filter((function(e){return"none"==e.css("display")}));e.eles=n.not(D),n.nodes().not(":parent").not(D).layoutPositions(this,e,M),A.length>0&&A.forEach((function(e){e.position(M(e))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=u},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,o=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,a=n.nodes(),s=n.nodes(":parent"),l=new Map,u=new Map,c=new Map,d=[],h=[],p=[],f=[],g=[],v=[],y=[],m=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,_=e.samplingType,C=e.nodeSeparation,T=void 0,N=function(e,t,n){for(var r=[],i=0,o=0,a=0,s=void 0,l=[],c=0,h=1,p=0;p=i;){a=r[i++];for(var f=d[a],y=0;yc&&(c=g[w],h=w)}return h};r.connectComponents(t,n,r.getTopMostNodes(a),l),s.forEach((function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)}));for(var M=0,A=0;A0&&(r.isParent()?d[t].push(c.get(r.id())):d[t].push(r.id()))}))}));var R=function(e){var n=u.get(e),r=void 0;l.get(e).forEach((function(i){r=t.getElementById(i).isParent()?c.get(i):i,d[n].push(r),d[u.get(r)].push(e)}))},B=!0,F=!1,z=void 0;try{for(var j,V=l.keys()[Symbol.iterator]();!(B=(j=V.next()).done);B=!0)R(j.value)}catch(e){F=!0,z=e}finally{try{!B&&V.return&&V.return()}finally{if(F)throw z}}var G=void 0;if((b=u.size)>2){T=b=1)break;u=l}for(var f=0;f=1)break;u=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(579);return r})()},e.exports=r(n(7799))},4726:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var h="undefined"==typeof window?null:window,p=h?h.navigator:null;h&&h.document;var f=r(""),g=r({}),v=r((function(){})),y="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&r(e)==f},x=function(e){return null!=e&&r(e)===v},w=function(e){return!T(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&r(e)===g&&!w(e)&&e.constructor===Object},_=function(e){return null!=e&&r(e)===r(1)&&!isNaN(e)},C=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},T=function(e){return N(e)||M(e)},N=function(e){return"collection"===m(e)&&e._private.single},M=function(e){return"collection"===m(e)&&!e._private.single},A=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},I=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},O=function(e){return function(e){return null!=e&&r(e)===g}(e)&&x(e.then)},P=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},Y=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=t||n<0||d&&e-u>=o}function g(){var e=Q();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?ye(n,o-(e-u)):n}(e))}function v(e){return s=void 0,h&&r?p(e):(r=i=void 0,a)}function y(){var e=Q(),n=f(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),c?p(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ge(t)||0,W(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ve(ge(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Q())},y},be=h?h.performance:null,xe=be&&be.now?function(){return be.now()}:function(){return Date.now()},we=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(xe())}),1e3/60)}}(),Ee=function(e){return we(e)},_e=xe,Ce=9261,Te=5381,Ne=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Me=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce)+e|0},Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Te;return(t<<5)+t+e|0},De=function(e){return 2097152*e[0]+e[1]},Ie=function(e,t){return[Me(e[0],t[0]),Ae(e[1],t[1])]},Oe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ne({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},$e=function(e){e.splice(0,e.length)},Qe=function(e,t,n){return n&&(t=L(n,t)),e[t]},Je=function(e,t,n,r){n&&(t=L(n,t)),e[t]=r},et="undefined"!=typeof Map?Map:function(){function e(){i(this,e),this._obj={}}return a(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),tt=function(){function e(t){if(i(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&A(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new nt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);in;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;og;0<=g?++h:--h)v.push(o(e,r));return v},f=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},g=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i0;){var _=y.pop(),C=g(_),T=_.id();if(d[T]=C,C!==1/0)for(var N=_.neighborhood().intersect(p),M=0;M0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},ct={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t0;){if(u=(l=g.pop()).id(),v.delete(u),w++,u===d){for(var E=[],_=i,C=d,T=m[C];E.unshift(_),null!=T&&E.unshift(T),null!=(_=y[C]);)T=m[C=_.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:w}}f[u]=!0;for(var N=l._private.edges,M=0;MM&&(p[N]=M,y[N]=T,m[N]=w),!i){var A=T*u+C;!i&&p[A]>M&&(p[A]=M,y[A]=C,m[A]=w)}}}for(var D=0;D1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},yt=Math.sqrt(2),mt=function(e,t,n){0===n.length&&Ge("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(u,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=mt(i,e,t),n--}return t},xt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/yt);if(!(i<2)){for(var l=[],u=0;u0?1:e<0?-1:0},Mt=function(e,t){return Math.sqrt(At(e,t))},At=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Dt=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},St=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Lt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Bt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=l(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ft=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},zt=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},jt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Vt=function(e,t){return jt(e,t.x1,t.y1)&&jt(e,t.x2,t.y2)},Gt=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?sn(i,o):u,d=i/2,h=o/2,p=(c=Math.min(c,d,h))!==d,f=c!==h;if(p){var g=r-h-a;if((s=en(e,t,n,r,n-d+c-a,g,n+d-c+a,g,!1)).length>0)return s}if(f){var v=n+d+a;if((s=en(e,t,n,r,v,r-h+c-a,v,r+h-c+a,!1)).length>0)return s}if(p){var y=r+h+a;if((s=en(e,t,n,r,n-d+c-a,y,n+d-c+a,y,!1)).length>0)return s}if(f){var m=n-d-a;if((s=en(e,t,n,r,m,r-h+c-a,m,r+h-c+a,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=Qt(e,t,n,r,b,x,c+a)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=Qt(e,t,n,r,w,E,c+a)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var _=n+d-c,C=r+h-c;if((l=Qt(e,t,n,r,_,C,c+a)).length>0&&l[0]>=_&&l[1]>=C)return[l[0],l[1]];var T=n-d+c,N=r+h-c;return(l=Qt(e,t,n,r,T,N,c+a)).length>0&&l[0]<=T&&l[1]>=N?[l[0],l[1]]:[]},Yt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},Ut=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(ec||th)},Xt=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f,g,v,y,m,b,x,w=[];u=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,d=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0===(l=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(l=1e-5),g=-27*(d/=l)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,(h=w)[1]=0,b=u/3,p>0?(y=(y=g+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=g-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),h[0]=-b+y+m,b+=(y+m)/2,h[4]=h[2]=-b,b=Math.sqrt(3)*(-m+y)/2,h[3]=b,h[5]=-b):(h[5]=h[3]=0,0===p?(x=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),h[0]=2*x-b,h[4]=h[2]=-(x+b)):(v=(f=-f)*f*f,v=Math.acos(g/Math.sqrt(v)),x=2*Math.sqrt(f),h[0]=-b+x*Math.cos(v/3),h[2]=-b+x*Math.cos((v+2*Math.PI)/3),h[4]=-b+x*Math.cos((v+4*Math.PI)/3)));for(var E=[],_=0;_<6;_+=2)Math.abs(w[_+1])<1e-7&&w[_]>=0&&w[_]<=1&&E.push(w[_]);E.push(1),E.push(0);for(var C,T,N,M=-1,A=0;A=0?Nl?(e-i)*(e-i)+(t-o)*(t-o):u-d},Wt=function(e,t,n){for(var r,i,o,a,s=0,l=0;l=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},qt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),p=Math.sin(-u),f=0;f0){var g=Zt(c,-l);d=Kt(g)}else d=c;return Wt(e,t,d)},Kt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},Jt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,h=t-o,p=r-t,f=s-o,g=d*h-f*u,v=c*h-p*u,y=f*c-d*p;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===g||0===v?Jt(e,n,a)===a?[a,s]:Jt(e,n,i)===i?[i,o]:Jt(i,a,n)===n?[n,r]:[]:[]},tn=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f=[],g=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y0){var m=Zt(g,-s);u=Kt(m)}else u=g}else u=n;for(var b=0;bu&&(u=t)},d=function(e){return l[e]},h=0;h0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var w=r(m);b=b.id(),h[b]>h[v]+w&&(h[b]=h[v]+w,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E0;){for(var N=n.pop(),M=0;M0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:An,a=r,s=0;s=2?Sn(e,t,n,0,On,Pn):Sn(e,t,n,0,In)},squaredEuclidean:function(e,t,n){return Sn(e,t,n,0,On)},manhattan:function(e,t,n){return Sn(e,t,n,0,In)},max:function(e,t,n){return Sn(e,t,n,-1/0,kn)}};function Rn(e,t,n,r,i,o){var a;return a=x(e)?e:Ln[e]||Ln.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}Ln["squared-euclidean"]=Ln.squaredEuclidean,Ln.squaredeuclidean=Ln.squaredEuclidean;var Bn=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Fn=function(e){return Bn(e)},zn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return Rn(e,r.length,o,(function(e){return r[e](t)}),a,s)},jn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;ln)return!1;return!0},Xn=function(e,t,n){for(var r=0;ri&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],g=t[r[a]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(o=n[g.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i=M?(A=M,M=I,D=O):I>A&&(A=I);for(var P=0;P0?1:0;C[E%u.minIterations*t+F]=z,B+=z}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var j=0,V=0;V0&&r.push(i);return r}(t,o,a),U=function(e,t,n){for(var r=lr(e,t,n),i=0;il&&(s=u,l=c)}n[i]=o[s]}return lr(e,t,n)}(t,r,Y),X={},H=0;H1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},pr=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},fr={};[ot,ut,ct,ht,ft,vt,xt,dn,pn,gn,yn,Mn,$n,or,cr,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=dr(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(l.getElementById(g.shift())),c)if(c[v].length)return h;return h.found=!0,h.trail=this.spawn(f,!0),h}},{hopcroftTarjanBiconnected:hr,htbc:hr,htb:hr,hopcroftTarjanBiconnectedComponents:hr},{tarjanStronglyConnected:pr,tsc:pr,tscc:pr,tarjanStronglyConnectedComponents:pr}].forEach((function(e){Y(fr,e)}));var gr=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};gr.prototype={fulfill:function(e){return vr(this,1,"fulfillValue",e)},reject:function(e){return vr(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new gr;return n.onFulfilled.push(br(e,r,"fulfill")),n.onRejected.push(br(t,r,"reject")),yr(n),r.proxy}};var vr=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,yr(e)),e},yr=function(e){1===e.state?mr(e,"onFulfilled",e.fulfillValue):2===e.state&&mr(e,"onRejected",e.rejectReason)},mr=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1},qr.prototype.set=function(e,t){var n=this.__data__,r=Hr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Kr=qr,Zr=zr($,"Map"),$r=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function Qr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Ti.className=Ti.classNames=Ti.classes;var Ni={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:B,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ni.variable="(?:[\\w-.]|(?:\\\\"+Ni.metaChar+"))+",Ni.className="(?:[\\w-]|(?:\\\\"+Ni.metaChar+"))+",Ni.value=Ni.string+"|"+Ni.number,Ni.id=Ni.variable,function(){var e,t,n;for(e=Ni.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Ni.comparatorOp+="|\\!"+t)}();var Mi=20,Ai=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*G(e,t)}(e.selector,t.selector)})),Di=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return Ue("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Ue("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Ue("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(i,o){return i.checks.reduce((function(a,s,l){return a+(o===i&&0===l?"$":"")+function(i,o){var a=i.type,s=i.value;switch(a){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:var u=i.field,c=i.operator;return"["+u+n(e(c))+t(s)+"]";case 5:var d=i.operator,h=i.field;return"["+e(d)+h+"]";case 4:return"["+i.field+"]";case 6:var p=i.operator;return"[["+i.field+n(e(p))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var f=r(i.left,o),g=r(i.subject,o),v=r(i.right,o);return f+(f.length>0?" ":"")+g+v;case Mi:return""}}(s,o)}),"")},i="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Ki(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],Ki)},Wi.forEachUp=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Zi)},Wi.forEachUpAndDown=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],$i)},Wi.ancestors=Wi.parents,(Ui=Xi={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_i.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_i.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ui.data,Ui.removeAttr=Ui.removeData;var Qi,Ji,eo=Xi,to={};function no(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;at})),minIndegree:ro("indegree",(function(e,t){return et})),minOutdegree:ro("outdegree",(function(e,t){return et}))}),Y(to,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},Qi.modelPosition=Qi.point=Qi.position,Qi.modelPositions=Qi.points=Qi.positions,Qi.renderedPoint=Qi.renderedPosition,Qi.relativePoint=Qi.relativePosition;var ao,so,lo=Ji;ao=so={},so.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},so.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},so.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,l),h=d.biasDiff,p=d.biasComplementDiff,f=y(i.height.val-o.h,u,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-g+o.y1+o.y2+v)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ho=function(e,t){return null==t?e:co(e,t.x1,t.y1,t.x2,t.y2)},po=function(e,t,n){return Qe(e,t,n)},fo=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Rt(u,1),co(e,u.x1,u.y1,u.x2,u.y2)}}},go=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=po(o,"labelWidth",n),p=po(o,"labelHeight",n),f=po(o,"labelX",n),g=po(o,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=p,C=h,T=C/2,N=_/2;if(m)a=f-T,s=f+T,l=g-N,u=g+N;else{switch(c.value){case"left":a=f-C,s=f;break;case"center":a=f-T,s=f+T;break;case"right":a=f,s=f+C}switch(d.value){case"top":l=g-_,u=g;break;case"center":l=g-N,u=g+N;break;case"bottom":l=g,u=g+_}}var M=v-Math.max(x,w)-E-2,A=v+Math.max(x,w)+E+2,D=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;a+=M,s+=A,l+=D,u+=I;var O=n||"main",P=i.labelBounds,k=P[O]=P[O]||{};k.x1=a,k.y1=l,k.x2=s,k.y2=u,k.w=s-a,k.h=u-l,k.leftPad=M,k.rightPad=A,k.topPad=D,k.botPad=I;var S=m&&"autorotate"===b.strValue,L=null!=b.pfValue&&0!==b.pfValue;if(S||L){var R=S?po(i.rstyle,"labelAngle",n):b.pfValue,B=Math.cos(R),F=Math.sin(R),z=(a+s)/2,j=(l+u)/2;if(!m){switch(c.value){case"left":z=s;break;case"right":z=a}switch(d.value){case"top":j=u;break;case"bottom":j=l}}var V=function(e,t){return{x:(e-=z)*B-(t-=j)*F+z,y:e*F+t*B+j}},G=V(a,l),Y=V(a,u),U=V(s,l),X=V(s,u);a=Math.min(G.x,Y.x,U.x,X.x),s=Math.max(G.x,Y.x,U.x,X.x),l=Math.min(G.y,Y.y,U.y,X.y),u=Math.max(G.y,Y.y,U.y,X.y)}var H=O+"Rot",W=P[H]=P[H]||{};W.x1=a,W.y1=l,W.x2=s,W.y2=u,W.w=s-a,W.h=u-l,co(e,a,l,s,u),co(i.labelBounds.all,a,l,s,u)}return e}},vo=function(e){var t=0,n=function(e){return(e?1:0)<0&&o>0){var a=t.pstyle("outline-offset").value,s=t.pstyle("shape").value,l=o+a,u=(e.w+2*l)/e.w,c=(e.h+2*l)/e.h,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+2.4*l)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+2.4*l)/e.w:"star"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.6*l)/e.h,d=-l/3.8):"triangle"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.4*l)/e.h,d=-l/1.4):"vee"===s&&(u=(e.w+4.4*l)/e.w,c=(e.h+3.8*l)/e.h,d=.5*-l);var h=e.h*c-e.h,p=e.w*u-e.w;if(Bt(e,[Math.ceil(h/2),Math.ceil(p/2)]),0!==d){var f=(r=d,{x1:(n=e).x1+0,x2:n.x2+0,y1:n.y1+r,y2:n.y2+r,w:n.w,h:n.h});St(e,f)}}}}(h,e)}else if(g&&t.includeEdges)if(c&&!d){var M=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),o=Math.max(v.srcY,v.midY,v.tgtY),co(h,n-=_,i-=_,r+=_,o+=_),"haystack"===M){var A=v.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var D=n;n=r,r=D}if(i>(o=A[1].y)){var I=i;i=o,o=I}co(h,n-_,i-_,r+_,o+_)}}else if("bezier"===M||"unbundled-bezier"===M||M.endsWith("segments")||M.endsWith("taxi")){var O;switch(M){case"bezier":case"unbundled-bezier":O=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=v.linePts}if(null!=O)for(var P=0;P(r=L.x)){var R=n;n=r,r=R}if((i=S.y)>(o=L.y)){var B=i;i=o,o=B}co(h,n-=_,i-=_,r+=_,o+=_)}if(c&&t.includeEdges&&g&&(fo(h,e,"mid-source"),fo(h,e,"mid-target"),fo(h,e,"source"),fo(h,e,"target")),c&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;co(h,h.x1+F,h.y1+z,h.x2+F,h.y2+z)}var j=p.bodyBounds=p.bodyBounds||{};Ft(j,h),Bt(j,y),Rt(j,1),c&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,co(h,n-E,i-E,r+E,o+E));var V=p.overlayBounds=p.overlayBounds||{};Ft(V,h),Bt(V,y),Rt(V,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=kt(),c&&t.includeLabels&&(t.includeMainLabels&&go(h,e,null),g&&(t.includeSourceLabels&&go(h,e,"source"),t.includeTargetLabels&&go(h,e,"target")))}return h.x1=uo(h.x1),h.y1=uo(h.y1),h.x2=uo(h.x2),h.y2=uo(h.y2),h.w=uo(h.x2-h.x1),h.h=uo(h.y2-h.y1),h.w>0&&h.h>0&&b&&(Bt(h,y),Rt(h,1)),h}(e,bo),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=kt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ho(n,r.overlayBounds):ho(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ho(n,r.labelBounds.all):(t.includeMainLabels&&ho(n,r.labelBounds.mainRot),t.includeSourceLabels&&ho(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ho(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},bo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},xo=vo(bo),wo=Ke(bo);so.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=kt();var n=wo(e=e||bo),r=this;if(r.cy().styleEnabled())for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:Ro,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)a(s);return this},Fo.removeAllListeners=function(){return this.removeListener("*")},Fo.emit=Fo.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,jo(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(E(e)){var o=e;i.applyBypass(this,o,r),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?i.getStylePropertyValue(a,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var o=0;o0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),da.neighbourhood=da.neighborhood,da.closedNeighbourhood=da.closedNeighborhood,da.openNeighbourhood=da.openNeighborhood,Y(da,{source:Hi((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Hi((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ga({attr:"source"}),targets:ga({attr:"target"})}),Y(da,{edgesWith:Hi(va(),"edgesWith"),edgesTo:Hi(va({thisIsSrc:!0}),"edgesTo")}),Y(da,{connectedEdges:Hi((function(e){for(var t=[],n=0;n0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),da.componentsOf=da.components;var ma=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new et,o=!1;if(t){if(t.length>0&&E(t[0])&&!N(t[0])){o=!0;for(var a=[],s=new nt,l=0,u=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u0){for(var B=e.length===i.length?i:new ma(o,e),F=0;F0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var C=0;C=.001?function(t,r){for(var i=0;i<4;++i){var o=h(r,e,n);if(0===o)return r;r-=(d(r,e,n)-t)/o}return r}(t,a):0===l?a:function(t,r,i){var o,a,s=0;do{(o=d(a=r+(i-r)/2,e,n)-t)>0?i=a:r=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+i)}(o),t,r)};f.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var g="generateBezier("+[e,t,n,r]+")";return f.toString=function(){return g},f}var Ea=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),_a=function(e,t,n,r){var i=wa(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Ca={linear:function(e,t,n){return e+(t-e)*n},ease:_a(.25,.1,.25,1),"ease-in":_a(.42,0,1,1),"ease-out":_a(0,0,.58,1),"ease-in-out":_a(.42,0,.58,1),"ease-in-sine":_a(.47,0,.745,.715),"ease-out-sine":_a(.39,.575,.565,1),"ease-in-out-sine":_a(.445,.05,.55,.95),"ease-in-quad":_a(.55,.085,.68,.53),"ease-out-quad":_a(.25,.46,.45,.94),"ease-in-out-quad":_a(.455,.03,.515,.955),"ease-in-cubic":_a(.55,.055,.675,.19),"ease-out-cubic":_a(.215,.61,.355,1),"ease-in-out-cubic":_a(.645,.045,.355,1),"ease-in-quart":_a(.895,.03,.685,.22),"ease-out-quart":_a(.165,.84,.44,1),"ease-in-out-quart":_a(.77,0,.175,1),"ease-in-quint":_a(.755,.05,.855,.06),"ease-out-quint":_a(.23,1,.32,1),"ease-in-out-quint":_a(.86,0,.07,1),"ease-in-expo":_a(.95,.05,.795,.035),"ease-out-expo":_a(.19,1,.22,1),"ease-in-out-expo":_a(1,0,0,1),"ease-in-circ":_a(.6,.04,.98,.335),"ease-out-circ":_a(.075,.82,.165,1),"ease-in-out-circ":_a(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ca.linear;var r=Ea(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":_a};function Ta(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Na(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ma(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Na(e,i),s=Na(t,i);if(_(a)&&_(s))return Ta(o,a,s,n,r);if(w(a)&&w(s)){for(var l=[],u=0;u0?("spring"===d&&h.push(a.duration),a.easingImpl=Ca[d].apply(null,h)):a.easingImpl=Ca[d]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var g=a.startPosition,v=a.position;if(v&&i&&!e.locked()){var y={};Da(g.x,v.x)&&(y.x=Ma(g.x,v.x,p,f)),Da(g.y,v.y)&&(y.y=Ma(g.y,v.y,p,f)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Da(m.x,x.x)&&(w.x=Ma(m.x,x.x,p,f)),Da(m.y,x.y)&&(w.y=Ma(m.y,x.y,p,f)),e.emit("pan"));var _=a.startZoom,C=a.zoom,T=null!=C&&r;T&&(Da(_,C)&&(o.zoom=Pt(o.minZoom,Ma(_,C,p,f),o.maxZoom)),e.emit("zoom")),(E||T)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var M=0;M=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],h=d._private;h.stopped?(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Ia(0,d,e),Aa(t,d,e,n),h.applying&&(h.applying=!1),u(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Pa={animate:_i.animate(),animation:_i.animation(),animated:_i.animated(),clearQueue:_i.clearQueue(),delay:_i.delay(),delayAnimation:_i.delayAnimation(),stop:_i.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Oa(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ee((function(n){Oa(n,e),t()}))}()}}},ka={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&N(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Sa=function(e){return b(e)?new Vi(e):e},La={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bo(ka,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Sa(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Sa(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},once:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};_i.eventAliasesOn(La);var Ra={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ra.jpeg=Ra.jpg;var Ba={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n,r=e.name,i=t.extension("layout",r);if(null!=i)return n=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(Y({},e,{cy:t,eles:n}));Ge("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Ge("A `name` must be specified to make a layout");else Ge("Layout options must be specified to make a layout")}};Ba.createLayout=Ba.makeLayout=Ba.layout;var Fa={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ja.invalidateDimensions=ja.resize;var Va={collection:function(e,t){return b(e)?this.$(e):T(e)?e.collection():w(e)?(t||(t={}),new ma(this,e,t.unique,t.removed)):new ma(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Va.elements=Va.filter=Va.$;var Ga={},Ya="t";Ga.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(h||d&&p){var f=void 0;h&&p||h?f=u.properties:p&&(f=u.mappedProperties);for(var g=0;g1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],C=i.valueMin[1],T=i.valueMax[1],N=i.valueMin[2],M=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],D=null==i.valueMax[3]?1:i.valueMax[3],I=[Math.round(w+(E-w)*v),Math.round(C+(T-C)*v),Math.round(N+(M-N)*v),Math.round(A+(D-A)*v)];n={bypass:i.bypass,name:i.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,O,i.bypass,h)}if(!n)return g(),!1;n.mapping=i,i=n;break;case a.data:for(var P=i.field.split("."),k=d.data,S=0;S0&&o>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ga.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Ga.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ga.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==t||"bezier"!==n&&"bezier"!==r||e.parallelEdges().forEach((function(e){e.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==t||"none"!==n&&"none"!==r||e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))},Ga.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ua={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;ot.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Ue("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u&&new Vi(u).invalid)Ue("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();else{var c=l[2],d=!1;n=c;for(var h=[];!n.match(/^\s*$/);){var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ue("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=p[0];var f=p[1],g=p[2];this.properties[f]?i.parse(f,g)?(h.push({name:f,val:g}),s()):(Ue("Skipping property: Invalid property definition in: "+r),s()):(Ue("Skipping property: Invalid property name in: "+r),s())}if(d){a();break}i.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var p=s.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(e,c[4]);if(!f||f.mapped)return!1;var g=this.parse(e,c[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return Ue("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(d.color){var v=f.value,y=g.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var E=[],C=[],T=[],N="",M=!1,A=0;A0?" ":"")+D.strValue}return d.validate&&!d.validate(E,C)?null:d.singleEnum&&M?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:T,strValue:N,bypass:n,units:C}}var I,O,P,S=function(){for(var r=0;rd.max||d.strictMax&&t===d.max))return null;var G={name:e,value:t,strValue:""+t+(L||""),units:L,bypass:n};return d.unitless||"px"!==L&&"em"!==L?G.pfValue=t:G.pfValue="px"!==L&&L?this.getEmSizeInPixels()*t:t,"ms"!==L&&"s"!==L||(G.pfValue="ms"===L?t:1e3*t),"deg"!==L&&"rad"!==L||(G.pfValue="rad"===L?t:(I=t,Math.PI*I/180)),"%"===L&&(G.pfValue=t/100),G}if(d.propList){var Y=[],X=""+t;if("none"===X);else{for(var H=X.split(/\s*,\s*|\s+/),W=0;W255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(P)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+j+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[a,s,l,o]}return t}(P);return K?{name:e,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var Z=S();if(Z)return Z}for(var $=d.regexes?d.regexes:[d.regex],Q=0;Q<$.length;Q++){var J=new RegExp($[Q]).exec(t);if(J)return{name:e,value:d.singleRegexMatchValue?J[1]:J,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?S():null};var $a=function e(t){if(!(this instanceof e))return new e(t);A(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Ge("A style must have a core reference")},Qa=$a.prototype;Qa.instanceString=function(){return"style"},Qa.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),_(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=wt(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;_(l.x)&&(t.pan.x=l.x,a=!1),_(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else T(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};es.centre=es.center,es.autolockNodes=es.autolock,es.autoungrabifyNodes=es.autoungrabify;var ts={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ts.attr=ts.data,ts.removeAttr=ts.removeData;var ns=function(e){var t=this,n=(e=Y({},e)).container;n&&!C(n)&&C(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=Y({name:o?"grid":"null"},a.layout),a.renderer=Y({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new ma(this),listeners:[],aniEles:new ma(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:_(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&_(a.pan.x)?a.pan.x:0,y:E(a.pan)&&_(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=Y({},a,a.renderer);t.initRenderer(u),function(e,t){if(e.some(O))return wr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=Y({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e0,u=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(T(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d0;){var P=D.shift(),k=A(P,I);if(k)P.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(O);else if(null===k){Ue("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}M();var S=0;if(n.avoidOverlap)for(var L=0;L0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:q+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:q+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var us={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cs(e){this.options=Y({},us,e)}cs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h1&&t.avoidOverlap){d*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(v*v+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var ds,hs={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ps(e){this.options=Y({},hs,e)}ps.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d0&&Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m)),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,_)}for(var C=0,T=0;T1&&t.avoidOverlap){var D=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(D*D+I*I));C=Math.max(O,C)}N.r=C,C+=w}if(t.equidistant){for(var P=0,k=0,S=0;S=e.numIter||(Es(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature=e.animationThreshold&&o(),Ee(t)):(Ss(r,e),s())}();else{for(;u;)u=a(l),l++;Ss(r,e),s()}return this},gs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},gs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vs=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u0)for(a.graphSet.push(E),u=0;ur.count?0:r.graph},ms=function e(t,n,r,i){var o=i.graphSet[r];if(-10)var s=(u=r.nodeOverlap*a)*i/(g=Math.sqrt(i*i+o*o)),l=u*o/g;else{var u,c=Ms(e,i,o),d=Ms(t,-1*i,-1*o),h=d.x-c.x,p=d.y-c.y,f=h*h+p*p,g=Math.sqrt(f);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/f)*h/g,l=u*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ns=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ms=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0n?(u.x=r,u.y=i+o/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},As=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,g=t.gravity*h/p;c.offsetX+=f,c.offsetY+=g}}}}},Is=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},ks=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTopf&&(d+=p+t.componentSpacing,c=0,h=0,p=0)}}},Ls={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Rs(e){this.options=Y({},Ls,e)}Rs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},h=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=p)l=h,u=p;else if(null!=h&&null==p)l=h,u=Math.ceil(a/l);else if(null==h&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var f=c(),g=d();(f-1)*g>=a?c(f-1):(g-1)*f>=a&&d(g-1)}else for(;u*l=a?d(y+1):c(v+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x=u&&(O=0,I++)},k={},S=0;S(r=Ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5(r=Xt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var C=_[w],T=s.arrowShapes[n.pstyle(C.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(T.roughCollide(e,t,E,C.angle,{x:C.x,y:C.y},N,h)&&T.collide(e,t,E,C.angle,{x:C.x,y:C.y},N,h))return v(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Qe(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},C=_(g,m),T=_(g,x),N=_(y,m),M=_(y,x),A=[C.x+h,C.y+p,N.x+h,N.y+p,M.x+h,M.y+p,T.x+h,T.y+p];if(Wt(e,t,A))return v(n),!0}else if(jt(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),h=kt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),p=0;p4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,r,i){var o,a;if(e!==hl?gl(t,e,pl):((a=pl).x=-1*(o=fl).x,a.y=-1*o.y,a.nx=-1*o.nx,a.ny=-1*o.ny,a.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),gl(t,n,fl),Qs=pl.nx*fl.ny-pl.ny*fl.nx,Js=pl.nx*fl.nx-pl.ny*-fl.ny,nl=Math.asin(Math.max(-1,Math.min(1,Qs))),Math.abs(nl)<1e-6)return Zs=t.x,$s=t.y,void(il=al=0);el=1,tl=!1,Js<0?nl<0?nl=Math.PI+nl:(nl=Math.PI-nl,el=-1,tl=!0):nl>0&&(el=-1,tl=!0),al=void 0!==t.radius?t.radius:r,rl=nl/2,sl=Math.min(pl.len/2,fl.len/2),i?(ol=Math.abs(Math.cos(rl)*al/Math.sin(rl)))>sl?(ol=sl,il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))):il=al:(ol=Math.min(sl,al),il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))),cl=t.x+fl.nx*ol,dl=t.y+fl.ny*ol,Zs=cl-fl.ny*il*el,$s=dl+fl.nx*il*el,ll=t.x+pl.nx*ol,ul=t.y+pl.ny*ol,hl=t}(e,t,n,r,i),{cx:Zs,cy:$s,radius:il,startX:ll,startY:ul,stopX:cl,stopY:dl,startAngle:pl.ang+Math.PI/2*el,endAngle:fl.ang-Math.PI/2*el,counterClockwise:tl})}var ml={};function bl(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},M=N(C,E),A=N(T,_),D=!1;"auto"===v?g=Math.abs(M)>Math.abs(A)?i:r:v===l||v===s?(g=r,D=!0):v!==o&&v!==a||(g=i,D=!0);var I,O=g===r,P=O?A:M,k=O?T:C,S=Nt(k),L=!1;D&&(m||x)||!(v===s&&k<0||v===l&&k>0||v===o&&k>0||v===a&&k<0)||(P=(S*=-1)*Math.abs(P),L=!0);var R=function(e){return Math.abs(e)=Math.abs(P)},B=R(I=m?(b<0?1+b:b)*P:(b<0?P:0)+b*S),F=R(Math.abs(P)-Math.abs(I));if(!B&&!F||L)if(O){var z=u.y1+I+(f?d/2*S:0),j=u.x1,V=u.x2;n.segpts=[j,z,V,z]}else{var G=u.x1+I+(f?c/2*S:0),Y=u.y1,U=u.y2;n.segpts=[G,Y,G,U]}else if(O){var X=Math.abs(k)<=d/2,H=Math.abs(C)<=h/2;if(X){var W=(u.x1+u.x2)/2,q=u.y1,K=u.y2;n.segpts=[W,q,W,K]}else if(H){var Z=(u.y1+u.y2)/2,$=u.x1,Q=u.x2;n.segpts=[$,Z,Q,Z]}else n.segpts=[u.x1,u.y2]}else{var J=Math.abs(k)<=c/2,ee=Math.abs(T)<=p/2;if(J){var te=(u.y1+u.y2)/2,ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else if(ee){var ie=(u.x1+u.x2)/2,oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}else n.segpts=[u.x2,u.y1]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},ml.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!_(n.startX)||!_(n.startY),v=!_(n.arrowStartX)||!_(n.arrowStartY),y=!_(n.endX)||!_(n.endY),m=!_(n.arrowEndX)||!_(n.arrowEndY),b=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,x=Mt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xh.poolIndex()){var p=d;d=h,h=p}var f=s.srcPos=d.position(),g=s.tgtPos=h.position(),v=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=s.srcCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,C=s.tgtCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,T=s.tgtRs=h._private.rscratch,N=s.srcRs=d._private.rscratch;s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var M=0;M0){var H=u,W=At(H,_t(t)),q=At(H,_t(X)),K=W;q2&&At(H,{x:X[2],y:X[3]})0){var le=c,ue=At(le,_t(t)),ce=At(le,_t(se)),de=ue;ce2&&At(le,{x:se[2],y:se[3]})=u||m){c={cp:g,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=Pt(0,_,1),t=Ot(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=Pt(0,r-.001,1),o=Pt(0,r+.001,1),a=Ot(e,t,n,i),s=Ot(e,t,n,o);return Tl(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var C,T,N,M,A=0,D=r.allpts.length,I=0;I+3=u));I+=2);var O=(u-T)/C;O=Pt(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Mt(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(N,M,O),i=Tl(N,M)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},_l.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},_l.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Qe(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,d=i.width,h=i.height+(l-1)*(o-1)*u;Je(n.rstyle,"labelWidth",t,d),Je(n.rscratch,"labelWidth",t,d),Je(n.rstyle,"labelHeight",t,h),Je(n.rscratch,"labelHeight",t,h),Je(n.rscratch,"labelLineHeight",t,c)},_l.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Je(n.rscratch,e,t,r),r):Qe(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,p=[],f=/[\s\u200b]+|$/g,g=0;gc){var b,x="",w=0,E=d(v.matchAll(f));try{for(E.s();!(b=E.n()).done;){var _=b.value,C=_[0],T=v.substring(w,_.index);w=_.index+C.length;var N=0===x.length?T:x+T+C;this.calculateLabelDimensions(e,N).width<=c?x+=T+C:(x&&p.push(x),x=T+C)}}catch(e){E.e(e)}finally{E.f()}x.match(/^[\s\u200b]+$/)||p.push(x)}else p.push(v)}a("labelWrapCachedLines",p),i=a("labelWrapCachedText",p.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var M=e.pstyle("text-max-width").pfValue,A="",D=!1;if(this.calculateLabelDimensions(e,i).widthM);I++)A+=i[I],I===i.length-1&&(D=!0);return D||(A+="…"),A}return i},_l.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},_l.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window().document,i=Oe(t,e._private.labelDimsKey),o=n.labelDimCache||(n.labelDimCache=[]),a=o[i];if(null!=a)return a;var s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=r.createElement("canvas"),h=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}h.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var f=0,g=0,v=t.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var M=i(t);v&&(e.hoverData.tapholdCancelled=!0),n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(D):a.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(n=!0,a.panningEnabled()&&a.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};a.panBy(I),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),b)if(v){if(a.boxSelectionEnabled()&&M)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var P=!e.dragData.didDrag;P&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(w,{inDragLayer:!0});var k={x:0,y:0};if(_(x[0])&&_(x[1])&&(k.x+=x[0],k.y+=x[1],P)){var S=e.hoverData.dragDelta;S&&_(S[0])&&_(S[1])&&(k.x+=S[0],k.y+=S[1])}e.hoverData.draggingEles=!0,w.silentShift(k).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else v&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!M&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=_t(h),e.redrawHint("select",!0),e.redraw()):A(),b&&b.pannable()&&b.active()&&b.unactivate());return f[2]=c[0],f[3]=c[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,h=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:t,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:t,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:a[0],y:a[1]}),x=!1,t.timeStamp-w<=o.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:a[0],y:a[1]})):(b=setTimeout((function(){x||r(c,["oneclick","onetap","voneclick"],t,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),w=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(o.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:t,position:{x:a[0],y:a[1]}});"additive"===o.selectionType()||h||o.$(n).unmerge(g).unselect(),g.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=c&&c.grabbed();d(u),v&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}),!1);var C,T,N,M,A,D,I,O,P,k,S,L,R,B=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",B,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||B(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var F,z,j,V,G,Y,U,X=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},H=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",F=function(t){if(e.hasTouchStarted=!0,m(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var l=e.findContainerClientCoords();P=l[0],k=l[1],S=l[2],L=l[3],C=t.touches[0].clientX-P,T=t.touches[0].clientY-k,N=t.touches[1].clientX-P,M=t.touches[1].clientY-k,R=0<=C&&C<=S&&0<=N&&N<=S&&0<=T&&T<=L&&0<=M&&M<=L;var h=n.pan(),f=n.zoom();if(A=X(C,T,N,M),D=H(C,T,N,M),O=[((I=[(C+N)/2,(T+M)/2])[0]-h.x)/f,(I[1]-h.y)/f],D<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),b=y[0];if(null!=b&&(b.activate(),e.touchData.start=b,e.touchData.starts=y,e.nodeIsGrabbable(b))){var x=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),b.selected()?(w=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(w,{addToList:x})):c(b,{addToList:x}),s(b);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};b.emit(E("grabon")),w?w.forEach((function(e){e.emit(E("grab"))})):b.emit(E("grab"))}r(b,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==b&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var _=e.touchData.startPosition=[null,null,null,null,null,null],B=0;B=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var w=t.touches[0].clientX-P,E=t.touches[0].clientY-k,I=t.touches[1].clientX-P,S=t.touches[1].clientY-k,L=H(w,E,I,S);if(L/D>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(n&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var F=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&F===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=F,F&&F.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",j=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",V=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=h[0],u[1]=h[1]}if(t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=h[0],u[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=h[0],u[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;d(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);r(y,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),G=!1,t.timeStamp-U<=s.multiClickDebounceTime()?(Y&&clearTimeout(Y),G=!0,U=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):(Y=setTimeout((function(){G||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),U=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var p=[c[0],c[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return g[0]}return null},p=Object.keys(d),f=0;f0?u:Gt(i,o,e,t,n,r,a,s)},checkPoint:function(e,t,n,r,i,o,a,s){var l=2*(s="auto"===s?sn(r,i):s);if(qt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(qt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!Wt(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||!!$t(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!$t(e,t,l,l,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",rn(3,0)),this.generateRoundPolygon("round-triangle",rn(3,0)),this.generatePolygon("rectangle",rn(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",rn(5,0)),this.generateRoundPolygon("round-pentagon",rn(5,0)),this.generatePolygon("hexagon",rn(6,0)),this.generateRoundPolygon("round-hexagon",rn(6,0)),this.generatePolygon("heptagon",rn(7,0)),this.generateRoundPolygon("round-heptagon",rn(7,0)),this.generatePolygon("octagon",rn(8,0)),this.generateRoundPolygon("round-octagon",rn(8,0));var r=new Array(20),i=an(5,0),o=an(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*Bl)break;var v=e.deq(t,d,c);if(!(v.length>0))break;for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),i(t))}}},zl=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ze;i(this,e),this.idsByKey=new et,this.keyForId=new et,this.cachesByLvl=new et,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return a(e,[{key:"getIdsFor",value:function(e){null==e&&Ge("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new nt,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new et,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),jl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Vl=Ke({getKey:null,doesEleInvalidateKey:ze,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gl=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Vl(t);Y(n,r),n.lookup=new zl(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Yl=Gl.prototype;Yl.reasons=jl,Yl.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Yl.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Yl.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new st((function(e,t){return t.reqs-e.reqs}))},Yl.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Yl.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Tt(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,h=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var g=o.getTextureQueue(p),v=g[g.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidthr;M--)T=o.getElement(e,t,n,M,jl.downscale);N()}else{var A;if(!x&&!w&&!E)for(var D=r-1;D>=-4;D--){var I=l.get(e,D);if(I){A=I;break}}if(b(A))return o.queueElement(e,r),A;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:u,width:d,height:c,scaledLabelShown:h},v.usedWidth+=Math.ceil(d+8),v.eleCaches.push(f),l.set(e,r,f),o.checkTextureFullness(v),f},Yl.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},Yl.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ze(t,e):e.fullnessChecks++},Yl.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ze(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,$e(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ze(r,o),n.push(o),o}},Yl.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Yl.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,jl.dequeue)}}return i},Yl.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Be,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Yl.onDequeue=function(e){this.onDequeues.push(e)},Yl.offDequeue=function(e){Ze(this.onDequeues,e)},Yl.setupDequeueing=Fl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Ze(c,a)}}();var d=function(t){var i=(t=t||{}).after;!function(){if(!a){a=kt();for(var t=0;t32767||s>32767)return null;if(o*s>16e6)return null;var l=r.makeLayer(a,n);if(null!=i){var d=c.indexOf(i)+1;c.splice(d,0,l)}else(void 0===t.insert||t.insert)&&c.unshift(l);return l};if(r.skipping&&!o)return null;for(var h=null,p=e.length/1,f=!o,g=0;g=p||!Vt(h.bb,v.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||f?r.queueLayer(h,v):r.drawEleInLayer(h,v,n,t),h.eles.push(v),m[n]=h}}return s||(f?null:c)},Xl.getEleLevelForLayerLevel=function(e,t){return e},Xl.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Xl.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Xl.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},Xl.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=_e(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Xl.invalidateLayer=function(e){if(this.lastInvalidationTime=_e(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ze(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*c,m=u*c,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,C=y*_;e.translate(w,E),b(C),x(C),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(a.colorStrokeStyle(e,v[0],v[1],v[2],n),"straight-triangle"===d?a.drawEdgeTrianglePath(t,e,s.allpts):(a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")):e.lineCap="butt"}();i&&a.drawEdgeUnderlay(e,t),b(),x(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},uu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};lu.drawEdgeOverlay=uu("overlay"),lu.drawEdgeUnderlay=uu("underlay"),lu.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");o.pathCacheKey&&o.pathCacheKey===h?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=h,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&void 0!==arguments[5]?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),a?e.stroke():e.fill()}du.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Tt(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},du.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},du.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Qe(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},du.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Qe(o,"labelX",n),c=Qe(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var h,p=n?n+"-":"",f=Qe(o,"labelWidth",n),g=Qe(o,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(h=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(h),u=0,c=0),x){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue,T=0===t.pstyle("text-background-shape").strValue.indexOf("round");if(w>0||_>0&&E>0){var N=u-C;switch(b){case"left":N-=f;break;case"center":N-=f/2}var M=c-g-C,A=f+2*C,D=g+2*C;if(w>0){var I=e.fillStyle,O=t.pstyle("text-background-color").value;e.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+w*a+")",T?hu(e,N,M,A,D,2):e.fillRect(N,M,A,D),e.fillStyle=I}if(_>0&&E>0){var P=e.strokeStyle,k=e.lineWidth,S=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+S[0]+","+S[1]+","+S[2]+","+E*a+")",e.lineWidth=_,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(T?hu(e,N,M,A,D,2,"stroke"):e.strokeRect(N,M,A,D),"double"===L){var R=_/2;T?hu(e,N+R,M+R,A-2*R,D-2*R,2,"stroke"):e.strokeRect(N+R,M+R,A-2*R,D-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=k,e.strokeStyle=P}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Qe(o,"labelWrapCachedLines",n),z=Qe(o,"labelLineHeight",n),j=f/2,V=this.getLabelJustification(t);switch("auto"===V||("left"===b?"left"===V?u+=-f:"center"===V&&(u+=-j):"center"===b?"left"===V?u+=-j:"right"===V&&(u+=j):"right"===b&&("center"===V?u+=j:"right"===V&&(u+=f))),x){case"top":case"center":case"bottom":c-=(F.length-1)*z}for(var G=0;G0&&e.strokeText(F[G],u,c),e.fillText(F[G],u,c),c+=z}else B>0&&e.strokeText(d,u,c),e.fillText(d,u,c);0!==h&&(e.rotate(-h),e.translate(-s,-l))}}};var pu={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(_(d.x)&&_(d.y)&&(!s||t.visible())){var h,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:A;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,F[0],F[1],F[2],t)},H=function(e,t,n,r){var i,o=l.nodePathCache=l.nodePathCache||[],a=Pe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+G),s=o[a],u=!1;return null!=s?(i=s,u=!0,c.pathCache=i):(i=new Path2D,o[a]=c.pathCache=i),{path:i,cacheHit:u}},W=t.pstyle("shape").strValue,q=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(d.x,d.y);var K=H(r,i,W,q);h=K.path,v=K.cacheHit}var Z=function(){if(!v){var n=d;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i,G,c)}g?e.fill(h):e.fill()},$=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i,G,c)))},J=function(){var t=(N>0?N:-N)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=N>0?0:255;0!==N&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(h):e.fill())},ee=function(){if(M>0){if(e.lineWidth=M,e.lineCap=P,e.lineJoin=O,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(S),e.lineDashOffset=L;break;case"solid":case"double":e.setLineDash([])}if("center"!==k){if(e.save(),e.lineWidth*=2,"inside"===k)g?e.clip(h):e.clip();else{var t=new Path2D;t.rect(-r/2-M,-i/2-M,r+2*M,i+2*M),t.addPath(h),e.clip(t,"evenodd")}g?e.stroke(h):e.stroke(),e.restore()}else g?e.stroke(h):e.stroke();if("double"===I){e.lineWidth=M/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(h):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(B>0){if(e.lineWidth=B,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=d;g&&(n={x:0,y:0});var o=l.getNodeShape(t),a=M;"inside"===k&&(a=0),"outside"===k&&(a*=2);var s,u=(r+a+(B+V))/r,c=(i+a+(B+V))/i,h=r*u,p=i*c,f=l.nodeShapes[o].points;if(g&&(s=H(h,p,o,f).path),"ellipse"===o)l.drawEllipsePath(s||e,n.x,n.y,h,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var v=0,y=0,m=0;"round-diamond"===o?v=1.4*(a+V+B):"round-heptagon"===o?(v=1.075*(a+V+B),m=-(a/2+V+B)/35):"round-hexagon"===o?v=1.12*(a+V+B):"round-pentagon"===o?(v=1.13*(a+V+B),m=-(a/2+V+B)/15):"round-tag"===o?(v=1.12*(a+V+B),y=.07*(a/2+B+V)):"round-triangle"===o&&(v=(a+V+B)*(Math.PI/2),m=-(a+V/2+B)/Math.PI),0!==v&&(h=r*(u=(r+v)/r),["round-hexagon","round-tag"].includes(o)||(p=i*(c=(i+v)/i)));for(var b=h/2,x=p/2,w=(G="auto"===G?ln(h,p):G)+(a+B+V)/2,E=new Array(f.length/2),_=new Array(f.length/2),C=0;C0){if(r=r||n.position(),null==i||null==o){var d=n.padding();i=n.width()+2*d,o=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a,c),t.fill()}}}};pu.drawNodeOverlay=fu("overlay"),pu.drawNodeUnderlay=fu("underlay"),pu.hasPie=function(e){return(e=e[0])._private.hasPie},pu.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,g=t.pstyle("pie-"+h+"-background-opacity").value*n,v=p/100;v+d>1&&(v=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*v;0===p||d>=1||d+v>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),d+=v)}};for(var gu={getPixelRatio:function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;ia.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},C=a.prevViewport;void 0===C||_.zoom!==C.zoom||_.pan.x!==C.pan.x||_.pan.y!==C.pan.y||g&&!f||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var T=a.getCachedZSortedEles();function N(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function M(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var A=a.data.bufferContexts[a.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var D=u.contexts[a.NODE],I=a.textureCache.texture;_=a.textureCache.viewport,D.setTransform(1,0,0,1,0,0),h?N(D,0,0,_.width,_.height):D.clearRect(0,0,_.width,_.height);var O=m.core("outside-texture-bg-color").value,P=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(D,O[0],O[1],O[2],P),D.fillRect(0,0,_.width,_.height),b=l.zoom(),M(D,!1),D.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),D.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var k=l.extent(),S=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),L=a.hideEdgesOnViewport&&S,R=[];if(R[a.NODE]=!c[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,R[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),R[a.DRAG]=!c[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,R[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||R[a.NODE]){var B=h&&!R[a.NODE]&&1!==p;M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.nondrag,s,k):a.drawLayeredElements(D,T.nondrag,s,k),a.debug&&a.drawDebugPoints(D,T.nondrag),n||h||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||R[a.DRAG])&&(B=h&&!R[a.DRAG]&&1!==p,M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.drag,s,k):a.drawCachedElements(D,T.drag,s,k),a.debug&&a.drawDebugPoints(D,T.drag),n||h||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(M(D=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var F=m.core("selection-box-border-width").value/b;D.lineWidth=F,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),F>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=u.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var j=a.lastRedrawTime;if(a.showFps&&j){j=Math.round(j);var V=Math.round(1e3/j);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+j+" ms = "+V+" fps",0,20),D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(h&&1!==p){var G=u.contexts[a.NODE],Y=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],U=u.contexts[a.DRAG],X=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):N(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||R[a.NODE])&&(H(G,Y,R[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||R[a.DRAG])&&(H(U,X,R[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")}},vu={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},_u.png=function(e){return Tu(e,this.bufferCanvasImage(e),"image/png")},_u.jpg=function(e){return Tu(e,this.bufferCanvasImage(e),"image/jpeg")};var Nu=Au,Mu=Au.prototype;function Au(e){var t=this,n=t.cy.window().document;t.data={canvases:new Array(Mu.CANVAS_LAYERS),contexts:new Array(Mu.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Mu.CANVAS_LAYERS),bufferCanvases:new Array(Mu.BUFFER_COUNT),bufferContexts:new Array(Mu.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l{e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822:(e,t,n)=>{"use strict";var r=n(6857),i=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},135:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],u=i.addDummyNode(e,"border",s,n);o[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s{"use strict";var r=n(6857);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},9859:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909:(e,t,n)=>{var r=n(6857),i=n(3988),o=n(8191).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},8191:(e,t,n)=>{var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031:(e,t,n)=>{var r=n(6857),i=n(8191).Graph,o=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var u=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202:(e,t,n)=>{"use strict";var r=n(6857),i=n(6822),o=n(8209),a=n(9361),s=n(3988).normalizeRanks,l=n(2948),u=n(3988).removeEmptyRanks,c=n(6353),d=n(135),h=n(4850),p=n(1453),f=n(3776),g=n(3988),v=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new v({multigraph:!0,compound:!0}),n=N(e.graph());return t.setGraph(r.merge({},m,T(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=N(e.node(n));t.setNode(n,r.defaults(T(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=N(e.edge(n));t.setEdge(n,r.merge({},_,T(i,E),r.pick(i,C)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};g.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){u(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=g.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){f(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function T(e,t){return r.mapValues(r.pick(e,t),Number)}function N(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},6857:(e,t,n)=>{var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(9754),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),p=e.node(u);e.setParent(d,u),p.borderTop=d,e.setParent(h,u),p.borderBottom=h,r.forEach(c,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,f=i.borderTop?a:2*a,g=c!==p?1:s-l[u]+1;e.setEdge(d,c,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},8209:(e,t,n)=>{"use strict";var r=n(6857),i=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(u!==s+1){for(e.removeEdge(t),o=0,++s;s{var r=n(6857);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},3860:(e,t,n)=>{var r=n(6857);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},7860:(e,t,n)=>{var r=n(6857),i=n(8191).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6639:(e,t,n)=>{"use strict";var r=n(6857);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r{"use strict";var r=n(6857),i=n(8918),o=n(6639),a=n(4520),s=n(7860),l=n(4384),u=n(8191).Graph,c=n(3988);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new u;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var l,u=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){h(f%2?n:a,f%4>=2),s=c.buildLayerMatrix(e);var v=o(e,s);v{"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},4959:(e,t,n)=>{"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){var n,i,o,a;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(i=t,o=0,a=0,(n=e).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},4520:(e,t,n)=>{var r=n(6857),i=n(3860),o=n(4959),a=n(5169);e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,p={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==h})));var f=i(t,u);r.forEach(f,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(f,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(g,p);var v=a(g,l);if(d&&(v.vs=r.flatten([d,v.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.order+m.order)/(v.weight+2),v.weight+=2}return v}},5169:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,l=r.sortBy(a.rhs,(function(e){return-e.i})),u=[],c=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(u,l,h),r.forEach(s,(function(e){h+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,d+=e.weight,h=o(u,l,h)}));var p={vs:r.flatten(u,!0)};return d&&(p.barycenter=c/d,p.weight=d),p}},2948:(e,t,n)=>{var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,u=a[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank{"use strict";var r=n(6857),i=n(8191).Graph,o=n(3988);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,u=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===u)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(as)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var p=l[d];a[e]===e&&t{"use strict";var r=n(6857),i=n(3988),o=n(9741).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},8481:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph,o=n(8073).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(r.setNode(u,{});a(r,e){"use strict";var r=n(8073).longestPath,i=n(8481),o=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r},6860:(e,t,n)=>{"use strict";var r=n(6857),i=n(8481),o=n(8073).slack,a=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,u=n(3988).simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=g(n);)y(n,e,t,v(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==i){var d=u===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=c,e.hasEdge(a,l)){var p=e.edge(n,c).cutvalue;s+=d?-p:p}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=f(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function v(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(0,e.node(t.v),u)&&c!==m(0,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=g,c.enterEdge=v,c.exchangeEdges=y},8073:(e,t,n)=>{"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038:e=>{e.exports="0.8.5"},8362:(e,t,n)=>{var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619:(e,t,n)=>{var r=n(117);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},9276:(e,t,n)=>{var r=n(117);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},4919:(e,t,n)=>{var r=n(8905),i=n(117);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},8905:(e,t,n)=>{var r=n(117),i=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),u=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6678:(e,t,n)=>{var r=n(117),i=n(6291);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},3590:(e,t,n)=>{var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s{e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(9888)}},498:(e,t,n)=>{var r=n(9888);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423:(e,t,n)=>{var r=n(117),i=n(6454),o=n(1737);e.exports=function(e,t){var n,a=new i,s={},l=new o;function u(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},6291:(e,t,n)=>{var r=n(117);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),i[u].onStack=!1,c.push(u)}while(s!==u);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},9888:(e,t,n)=>{var r=n(117);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},1737:(e,t,n)=>{var r=n(117);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priority{"use strict";var r=n(117);e.exports=s;var i="\0",o="\0",a="";function s(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function l(e,t){e[t]?e[t]++:e[t]=1}function u(e,t){--e[t]||delete e[t]}function c(e,t,n,o){var s=""+t,l=""+n;if(!e&&s>l){var u=s;s=l,l=u}return s+a+l+a+(r.isUndefined(o)?i:o)}function d(e,t){return c(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},s.prototype.setEdge=function(){var e,t,n,i,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=c(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return o&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,l(this._preds[t],e),l(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[t],e),u(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166:(e,t,n)=>{e.exports={Graph:n(6454),version:n(4458)}},7494:(e,t,n)=>{var r=n(117),i=n(6454);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},117:(e,t,n)=>{var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458:e=>{e.exports="2.1.8"},3143:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(9);function a(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in a.prototype=Object.create(r.prototype),r)a[s]=r[s];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},a.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(13),a=n(0),s=n(16),l=n(5);function u(e,t,n,a){null==n&&null==a&&(a=t),r.call(this,a),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=a,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new o(t.x,t.y,n.width,n.height):new o}for(var c in u.prototype=Object.create(r.prototype),r)u[c]=r[c];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}})),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)})),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach((function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}})),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>a.WORLD_BOUNDARY?t=a.WORLD_BOUNDARY:t<-a.WORLD_BOUNDARY&&(t=-a.WORLD_BOUNDARY);var n=this.rect.y;n>a.WORLD_BOUNDARY?n=a.WORLD_BOUNDARY:n<-a.WORLD_BOUNDARY&&(n=-a.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";var r=n(0);function i(){}for(var o in r)i[o]=r[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(0),a=n(7),s=n(3),l=n(1),u=n(13),c=n(12),d=n(11);function h(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof a?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in h.prototype=Object.create(r.prototype),r)h[p]=r[p];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},h.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(c,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},h.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,l=0;l(e=u.getTop())&&(r=e),o>(t=u.getLeft())&&(o=t)}return r==i.MAX_VALUE?null:(n=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-n,this.top=r-n,new c(this.left,this.top))},h.prototype.updateBounds=function(e){for(var t,n,r,o,a,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,d=-i.MAX_VALUE,h=this.nodes,p=h.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),c>(r=g.getTop())&&(c=r),d<(o=g.getBottom())&&(d=o)}var v=new u(s,c,l-s,d-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},h.calculateBounds=function(e){for(var t,n,r,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,d=e.length,h=0;h(t=p.getLeft())&&(a=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(o=p.getBottom())&&(c=o)}return new u(a,l,s-a,c-l)},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=h},function(e,t,n){"use strict";var r,i=n(1);function o(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var o=(r=t).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return n.isInterGraph=!1,o.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,o=[],a=(o=o.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var o=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(o=1);var a=o*n[0],s=n[1]/o;n[0]a)return n[0]=r,n[1]=l,n[2]=o,n[3]=b,!1;if(io)return n[0]=s,n[1]=i,n[2]=y,n[3]=a,!1;if(ro?(n[0]=c,n[1]=d,_=!0):(n[0]=u,n[1]=l,_=!0):T===M&&(r>o?(n[0]=s,n[1]=l,_=!0):(n[0]=h,n[1]=d,_=!0)),-N===M?o>r?(n[2]=m,n[3]=b,C=!0):(n[2]=y,n[3]=v,C=!0):N===M&&(o>r?(n[2]=g,n[3]=v,C=!0):(n[2]=x,n[3]=b,C=!0)),_&&C)return!1;if(r>o?i>a?(A=this.getCardinalDirection(T,M,4),D=this.getCardinalDirection(N,M,2)):(A=this.getCardinalDirection(-T,M,3),D=this.getCardinalDirection(-N,M,1)):i>a?(A=this.getCardinalDirection(-T,M,1),D=this.getCardinalDirection(-N,M,3)):(A=this.getCardinalDirection(T,M,2),D=this.getCardinalDirection(N,M,4)),!_)switch(A){case 1:O=l,I=r+-f/M,n[0]=I,n[1]=O;break;case 2:I=h,O=i+p*M,n[0]=I,n[1]=O;break;case 3:O=d,I=r+f/M,n[0]=I,n[1]=O;break;case 4:I=c,O=i+-p*M,n[0]=I,n[1]=O}if(!C)switch(D){case 1:k=v,P=o+-E/M,n[2]=P,n[3]=k;break;case 2:P=x,k=a+w*M,n[2]=P,n[3]=k;break;case 3:k=b,P=o+E/M,n[2]=P,n[3]=k;break;case 4:P=m,k=a+-w*M,n[2]=P,n[3]=k}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var o,a,s,l,u,c,d,h=e.x,p=e.y,f=t.x,g=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(d=(o=g-p)*(l=v-m)-(a=b-y)*(s=h-f))?null:new r((s*(c=m*y-v*b)-l*(u=f*p-h*g))/d,(a*u-o*c)/d)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var c=(-l+Math.sqrt(l*l-4*s*u))/(2*s),d=(-l-Math.sqrt(l*l-4*s*u))/(2*s);return c>=0&&c<=1?[c]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),a.add(c);var d=c.getEdges();for(o=0;o-1&&u.splice(g,1)}a=new Set,l=new Map}else e=[]}return e},h.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),o=0;o=0&&t.splice(d,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,o=t[0])}return o},h.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(4),o=n(0),a=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,a,s,l,u=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*o):(a>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||u>=s[0].length))for(var c=0;ce}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),a=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),s=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),u=0;u=0;D--)if(0!==this.s[D]){for(var I=D+1;I=0;B--){if(function(e,t){return e&&t}(B0;){var H=void 0,W=void 0;for(H=N-2;H>=-1&&-1!==H;H--)if(Math.abs(o[H])<=X+U*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){o[H]=0;break}if(H===N-2)W=4;else{var q=void 0;for(q=N-1;q>=H&&q!==H;q--){var K=(q!==N?Math.abs(o[q]):0)+(q!==H+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=X+U*K){this.s[q]=0;break}}q===H?W=3:q===N-1?W=1:(W=2,H=q)}switch(H++,W){case 1:var Z=o[N-2];o[N-2]=0;for(var $=N-2;$>=H;$--){var Q=r.hypot(this.s[$],Z),J=this.s[$]/Q,ee=Z/Q;this.s[$]=Q,$!==H&&(Z=-ee*o[$-1],o[$-1]=J*o[$-1]);for(var te=0;te=this.s[H+1]);){var Ne=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=Ne,HMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),a=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),a=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),a=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),a=n(3605),s=n(9817),l=n(945);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r{var r=n(8096),i=n(2428),o=n(6449),a=n(3656),s=n(361),l=n(7167),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&l(e),p=n||c||d||h,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!u.call(e,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||f.push(v);return f}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(7237)("length");e.exports=r},7805:(e,t,n)=>{var r=n(3360),i=n(5288);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547:(e,t,n)=>{var r=n(3360),i=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733:(e,t,n)=>{var r=n(1791),i=n(5950);e.exports=function(e,t){return e&&r(t,i(t),e)}},3838:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e,t){return e&&r(t,i(t),e)}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999:(e,t,n)=>{var r=n(7217),i=n(3729),o=n(6547),a=n(4733),s=n(3838),l=n(3290),u=n(3007),c=n(2271),d=n(8948),h=n(2),p=n(3349),f=n(5861),g=n(6189),v=n(7199),y=n(5529),m=n(6449),b=n(3656),x=n(7730),w=n(3805),E=n(8440),_=n(5950),C=n(7241),T="[object Arguments]",N="[object Function]",M="[object Object]",A={};A[T]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[N]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,D,I,O,P){var k,S=1&n,L=2&n,R=4&n;if(D&&(k=O?D(t,I,O,P):D(t)),void 0!==k)return k;if(!w(t))return t;var B=m(t);if(B){if(k=g(t),!S)return u(t,k)}else{var F=f(t),z=F==N||"[object GeneratorFunction]"==F;if(b(t))return l(t,S);if(F==M||F==T||z&&!O){if(k=L||z?{}:y(t),!S)return L?d(t,s(k,t)):c(t,a(k,t))}else{if(!A[F])return O?t:{};k=v(t,F,S)}}P||(P=new r);var j=P.get(t);if(j)return j;P.set(t,k),E(t)?t.forEach((function(r){k.add(e(r,n,D,r,t,P))})):x(t)&&t.forEach((function(r,i){k.set(i,e(r,n,D,i,t,P))}));var V=B?void 0:(R?L?p:h:L?C:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(k,i,e(r,n,D,i,t,P))})),k}},9344:(e,t,n)=>{var r=n(3805),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},3599:(e,t,n)=>{var r=n(4394);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(4528),i=n(5891);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},3335:e=>{e.exports=function(e,t){return e>t}},426:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},6131:(e,t,n)=>{var r=n(2523),i=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),a=n(689),s=n(5861),l=n(6449),u=n(3656),c=n(7167),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,v,y){var m=l(e),b=l(t),x=m?h:s(e),w=b?h:s(t),E=(x=x==d?p:x)==p,_=(w=w==d?p:w)==p,C=x==w;if(C&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(C&&!E)return y||(y=new r),m||c(e)?i(e,t,n,g,v,y):o(e,t,x,n,g,v,y);if(!(1&n)){var T=E&&f.call(e,"__wrapped__"),N=_&&f.call(t,"__wrapped__");if(T||N){var M=T?e.value():e,A=N?t.value():t;return y||(y=new r),v(M,A,n,g,y)}}return!!C&&(y||(y=new r),a(e,t,n,g,v,y))}},9172:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a{e.exports=function(e){return e!=e}},5083:(e,t,n)=>{var r=n(1882),i=n(7296),o=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},6038:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),a=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903:(e,t,n)=>{var r=n(3805),i=n(5527),o=n(181),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6176:e=>{e.exports=function(e,t){return e{var r=n(909),i=n(4894);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),a=n(8586),s=n(756),l=n(7197),u=n(7797);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},5250:(e,t,n)=>{var r=n(7217),i=n(7805),o=n(6649),a=n(2824),s=n(3805),l=n(7241),u=n(4974);e.exports=function e(t,n,c,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,c,e,d,h);else{var p=d?d(u(t,l),o,l+"",t,n,h):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},2824:(e,t,n)=>{var r=n(7805),i=n(3290),o=n(1961),a=n(3007),s=n(5529),l=n(2428),u=n(6449),c=n(3693),d=n(3656),h=n(1882),p=n(3805),f=n(1331),g=n(7167),v=n(4974),y=n(9884);e.exports=function(e,t,n,m,b,x,w){var E=v(e,n),_=v(t,n),C=w.get(_);if(C)r(e,n,C);else{var T=x?x(E,_,n+"",e,t,w):void 0,N=void 0===T;if(N){var M=u(_),A=!M&&d(_),D=!M&&!A&&g(_);T=_,M||A||D?u(E)?T=E:c(E)?T=a(E):A?(N=!1,T=i(_,!0)):D?(N=!1,T=o(_,!0)):T=[]:f(_)||l(_)?(T=E,l(E)?T=y(E):p(E)&&!h(E)||(T=s(_))):N=!1}N&&(w.set(_,T),b(T,_,m,x,w),w.delete(_)),r(e,n,T)}}},6155:(e,t,n)=>{var r=n(4932),i=n(7422),o=n(5389),a=n(5128),s=n(3937),l=n(7301),u=n(3714),c=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var h=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},6001:(e,t,n)=>{var r=n(7420),i=n(631);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},7420:(e,t,n)=>{var r=n(7422),i=n(3170),o=n(1769);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5558:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},9302:(e,t,n)=>{var r=n(3488),i=n(6757),o=n(2865);e.exports=function(e,t){return o(i(e,t,r),e+"")}},3170:(e,t,n)=>{var r=n(6547),i=n(1769),o=n(361),a=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,d=c-1,h=e;null!=h&&++u{var r=n(7334),i=n(3243),o=n(3488),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},3937:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),a=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},5765:(e,t,n)=>{var r=n(8859),i=n(5325),o=n(9905),a=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var u=-1,c=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,c=o;else if(d>=200){var g=t?null:s(e);if(g)return l(g);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++u{var r=n(4932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},1234:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r{e.exports=function(e,t){return e.has(t)}},4066:(e,t,n)=>{var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),a=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736:(e,t,n)=>{var r=n(1873),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730:(e,t,n)=>{var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e{var r=n(3730);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(6547),i=n(3360);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s{var r=n(1791),i=n(4664);e.exports=function(e,t){return r(e,i(e),t)}},8948:(e,t,n)=>{var r=n(1791),i=n(6375);e.exports=function(e,t){return r(e,i(e),t)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},999:(e,t,n)=>{var r=n(9302),i=n(6800);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},5508:(e,t,n)=>{var r=n(6151),i=n(6800),o=n(7400);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t{var r=n(6545),i=n(3950),o=n(4247),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},3243:(e,t,n)=>{var r=n(6110),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f{var r=n(1873),i=n(7828),o=n(5288),a=n(5911),s=n(317),l=n(4247),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,u,d,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=l;++d{var r=n(5970),i=n(6757),o=n(2865);e.exports=function(e){return o(i(e,void 0,r),e+"")}},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},3349:(e,t,n)=>{var r=n(2199),i=n(6375),o=n(7241);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},8879:(e,t,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},6375:(e,t,n)=>{var r=n(4528),i=n(8879),o=n(4664),a=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),a=n(6545),s=n(8303),l=n(2552),u=n(7473),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),v=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case v:return c;case y:return d;case m:return h;case b:return p}return t}),e.exports=x},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),a=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199:(e,t,n)=>{var r=n(9653),i=n(6169),o=n(3201),a=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},5529:(e,t,n)=>{var r=n(9344),i=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5891:(e,t,n)=>{var r=n(1873),i=n(2428),o=n(6449),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(5288),i=n(4894),o=n(361),a=n(3805);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586:(e,t,n)=>{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},6757:(e,t,n)=>{var r=n(1033),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},4974:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2865:(e,t,n)=>{var r=n(9570),i=n(1811)(r);e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6959:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r{var r=n(9811),i=n(9698),o=n(7927);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",c=u+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*",d="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+d+c,"g");e.exports=function(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}},2629:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,4)}},8055:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,5)}},7334:e=>{e.exports=function(e){return function(){return e}}},4684:(e,t,n)=>{var r=n(9302),i=n(5288),o=n(6800),a=n(7241),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n{e.exports=n(9754)},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},5970:(e,t,n)=>{var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},9754:(e,t,n)=>{var r=n(3729),i=n(909),o=n(4066),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},2420:(e,t,n)=>{var r=n(6649),i=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},1448:(e,t,n)=>{var r=n(426),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3693:(e,t,n)=>{var r=n(4894),i=n(346);e.exports=function(e){return i(e)&&r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},2193:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(2428),a=n(6449),s=n(4894),l=n(3656),u=n(5527),c=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:(e,t,n)=>{var r=n(9172),i=n(7301),o=n(6009),a=o&&o.isMap,s=a?i(a):r;e.exports=s},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1331:(e,t,n)=>{var r=n(2552),i=n(8879),o=n(346),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},8440:(e,t,n)=>{var r=n(6038),i=n(7301),o=n(6009),a=o&&o.isSet,s=a?i(a):r;e.exports=s},5015:(e,t,n)=>{var r=n(2552),i=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},2216:e=>{e.exports=function(e){return void 0===e}},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},7241:(e,t,n)=>{var r=n(695),i=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):i(e)}},8090:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:(e,t,n)=>{var r=n(4932),i=n(5389),o=n(5128),a=n(6449);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},3916:(e,t,n)=>{var r=n(3360),i=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},4506:(e,t,n)=>{var r=n(3599),i=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},5364:(e,t,n)=>{var r=n(5250),i=n(999)((function(e,t,n){r(e,t,n)}));e.exports=i},1684:(e,t,n)=>{var r=n(3599),i=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6533:(e,t,n)=>{var r=n(3599),i=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3950:e=>{e.exports=function(){}},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},4383:(e,t,n)=>{var r=n(6001),i=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),a=n(7797);e.exports=function(e){return o(e)?r(a(e)):i(e)}},3181:(e,t,n)=>{var r=n(5508)();e.exports=r},860:(e,t,n)=>{var r=n(882),i=n(909),o=n(5389),a=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},7091:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(4894),a=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031:(e,t,n)=>{var r=n(3120),i=n(6155),o=n(9302),a=n(6800),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9884:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e){return r(e,i(e))}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752:(e,t,n)=>{var r=n(3729),i=n(9344),o=n(641),a=n(5389),s=n(8879),l=n(6449),u=n(3656),c=n(1882),d=n(3805),h=n(7167);e.exports=function(e,t,n){var p=l(e),f=p||u(e)||h(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=f?p?new g:[]:d(e)&&c(g)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},299:(e,t,n)=>{var r=n(3120),i=n(9302),o=n(5765),a=n(3693),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},7200:(e,t,n)=>{var r=n(3222),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5880:(e,t,n)=>{var r=n(514),i=n(5950);e.exports=function(e){return null==e?[]:r(e,i(e))}},7248:(e,t,n)=>{var r=n(6547),i=n(1234);e.exports=function(e,t){return i(e||[],t||[],r)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(4497)})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.nrCytoscapeExpandCollapse=t():e.nrCytoscapeExpandCollapse=t()}(this,(()=>(()=>{var e={6078:e=>{var t={equalBoundingBoxes:function(e,t){return e.x1==t.x1&&e.x2==t.x2&&e.y1==t.y1&&e.y2==t.y2},getUnion:function(e,t){var n={x1:Math.min(e.x1,t.x1),x2:Math.max(e.x2,t.x2),y1:Math.min(e.y1,t.y1),y2:Math.max(e.y2,t.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=t},4540:(e,t,n)=>{var r=n(3630),i=n(438);e.exports=function(e,t,o){var a,s,l=e;const u=function(){var e=t.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=t.container(),u=e.getContext("2d");l.append(e),a=n(1537)(t);var c=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}},d=r((function(){e.height=t.container().offsetHeight,e.width=t.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),r=c(l);e.style.top=-(n.top-r.top),e.style.left=-(n.left-r.left),t&&g()}),0)}),250);function h(){d()}h();var p={};function f(){return t.scratch("_cyExpandCollapse").options}function g(){var e=t.width(),n=t.height();u.clearRect(0,0,e,n),s=null}function v(e,t,n,r,i){var o=new Image(r,i);o.src=e,o.onload=()=>{u.drawImage(o,t,n,r,i)}}t.on("resize",p.eCyResize=function(){h()}),t.on("expandcollapse.clearvisualcue",(function(){s&&g()}));var y,m=null,b=null;t.on("mousedown",p.eMouseDown=function(e){m=e.renderedPosition||e.cyRenderedPosition}),t.on("mouseup",p.eMouseUp=function(e){b=e.renderedPosition||e.cyRenderedPosition}),t.on("remove","node",p.eRemove=function(e){e.target==s&&g()}),t.on("select unselect",p.eSelect=function(){s&&g();var e=t.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),r=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||r){var i,o=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var d=t.zoom()<1?l/(2*t.zoom()):l/2,h=parseFloat(e.css("border-width"));i={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+h+d+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+h+d+1}}else{var p=f().expandCollapseCuePosition;i="function"==typeof p?p.call(this,e):p}var g=a.convertToRenderedPosition(i),y=((l=Math.max(l,l*t.zoom()))-(c=Math.max(c,c*t.zoom())))/2,m=g.x,b=g.y,x=m-l/2,w=b-l/2,E=l;if(o&&f().expandCueImage)v(f().expandCueImage,x,w,l,l);else if(!o&&f().collapseCueImage)v(f().collapseCueImage,x,w,l,l);else{var _=u.fillStyle,C=u.lineWidth,T=u.strokeStyle;u.fillStyle="black",u.strokeStyle="black",u.ellipse(m,b,l/2,l/2,0,0,2*Math.PI),u.fill(),u.beginPath(),u.strokeStyle="white",u.lineWidth=Math.max(2.6,2.6*t.zoom()),u.moveTo(x+y,w+l/2),u.lineTo(x+c+y,w+l/2),o&&(u.moveTo(x+l/2,w+y),u.lineTo(x+l/2,w+c+y)),u.closePath(),u.stroke(),u.strokeStyle=T,u.fillStyle=_,u.lineWidth=C}e._private.data.expandcollapseRenderedStartX=x,e._private.data.expandcollapseRenderedStartY=w,e._private.data.expandcollapseRenderedCueSize=E,s=e}}(n)}}),t.on("tap",p.eTap=function(e){var n=s;if(n){var r=n.data("expandcollapseRenderedStartX"),i=n.data("expandcollapseRenderedStartY"),a=n.data("expandcollapseRenderedCueSize"),l=r+a,u=i+a,c=e.renderedPosition||e.cyRenderedPosition,d=c.x,h=c.y,p=f(),v=(p.expandCollapseCueSensitivity-1)/2;Math.abs(m.x-b.x)<5&&Math.abs(m.y-b.y)<5&&d>=r-a*v&&d<=l+a*v&&h>=i-a*v&&h<=u+a*v&&(p.undoable&&!y&&(y=t.undoRedo({defaultActions:!1})),o.isCollapsible(n)?(g(),p.undoable?y.do("collapse",{nodes:n,options:p}):o.collapse(n,p)):o.isExpandable(n)&&(g(),p.undoable?y.do("expand",{nodes:n,options:p}):o.expand(n,p)),n.selectable()&&(n.unselectify(),t.scratch("_cyExpandCollapse").selectableChanged=!0))}}),t.on("afterUndo afterRedo",p.eUndoRedo=p.eSelect),t.on("position","node",p.ePosition=i(p.eSelect,100,g)),t.on("pan zoom",p.ePosition),p.hasEventFields=!0,function(e){var n=t.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,t.scratch("_cyExpandCollapse",n)}(p)},unbind:function(){var e=u();e.hasEventFields?(t.trigger("expandcollapse.clearvisualcue"),t.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=u();e.hasEventFields?t.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(t.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(t.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},3630:e=>{var t,n,r=(t=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,r,i){var o,a,s,l,u,c,d,h,p,f=0,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(r=r<0?0:+r||0,!0===i){var y=!0;v=!1}else p=typeof(h=i),!h||"object"!=p&&"function"!=p||(y=!!i.leading,g="maxWait"in i&&t(+i.maxWait||0,r),v="trailing"in i?!!i.trailing:v);function m(t,r){r&&clearTimeout(r),a=c=d=void 0,t&&(f=n(),s=e.apply(u,o),c||a||(o=u=void 0))}function b(){var e=r-(n()-l);e<=0||e>r?m(d,a):c=setTimeout(b,e)}function x(){m(v,c)}function w(){if(o=arguments,l=n(),u=this,d=v&&(c||!y),!1===g)var t=y&&!c;else{a||y||(f=l);var i=g-(l-f),h=i<=0||i>g;h?(a&&(a=clearTimeout(a)),f=l,s=e.apply(u,o)):a||(a=setTimeout(x,i))}return h&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(b,r)),t&&(h=!0,s=e.apply(u,o)),!h||c||a||(o=u=void 0),s}return w.cancel=function(){c&&clearTimeout(c),a&&clearTimeout(a),f=0,a=c=d=void 0},w});e.exports=r},438:e=>{e.exports=function(e,t,n){let r,i=!0;return function(){const o=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,e.apply(o,a),i=!0}),t),i&&(n.apply(o,a),i=!1)}}},1537:(e,t,n)=>{const{runLayoutAsync:r}=n(8647);e.exports=function(e){return{moveNodes:function(e,t,n){var r=n?t:this.getTopMostNodes(t),i=r.not(":parent");i.positions((function(t,n){return{x:i[n].position("x")+e.x,y:i[n].position("y")+e.y}}));for(var o=0;o"group"===e.data().type)).length){const n={};(e?.scratch("_cyExpandCollapse")?.positions??[]).forEach((({nodeId:e,position:t})=>{n[e]=t})),await r(e.layout({name:"preset",fit:!1,positions:n,zoom:e.zoom(),pan:e.pan(),padding:t?.padding??50,animate:t?.animate??!0,animationDuration:t?.animationDuration??500,animationEasing:t?.animationEasing}))}e.scratch("_cyExpandCollapse").positions=null}},convertToRenderedPosition:function(t){var n=e.pan(),r=e.zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}}}},9272:(e,t,n)=>{var r=n(6078);e.exports=function(e){var t=n(1537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,r,i){if(n._private.data.collapsedChildren){var o={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var a=n._private.data.collapsedChildren;a.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,t){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,t),e.removeData("expand"));for(var n=e.children(),r=0;rs?(u+=p,c-=p):(u-=p,c+=p),e._private.data["y-before-fisheye"]>l?(d+=f,h-=f):(d-=f,h+=f);for(var g=[],v=[],y=0;yw?u:c,b=l>E?d:h,isFinite(_)&&(C=Math.min(m,b/Math.abs(_))),0!==_&&(T=Math.min(b,m*Math.abs(_))),s>w&&(C*=-1),l>E&&(T*=-1),this.fishEyeViewMoveNode(x,C,T,n,t,r,i,o)}return 0==a.length&&e.same(n)&&this.expandNodeBaseFunction(n,t,i),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],t,n,r,i,o),e},getSiblings:function(t){return null==t.parent()[0]?e.nodes(":visible").orphans().difference(t):t.siblings(":visible")},fishEyeViewMoveNode:function(t,n,r,i,o,a,s,l){var u=e.collection();t.isParent()&&(u=t.children(":visible"));var c=this;if(0==u.length){var d={x:t._private.position.x+n,y:t._private.position.y+r};o&&a?(this.animatedlyMovingNodeCount++,t.animate({position:d,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!i.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(i,o,s)}},{duration:l||1e3})):t.position(d)}else for(var h=0;h0?r.add(i):r.add(n)}return r},expandEdge:function(t){t.unselect();var n={edges:e.collection(),oldEdges:e.collection()},r=t.data("collapsedEdges");return void 0!==r&&r.length>0&&(t.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(t),e.remove(t),n.edges=e.add(r),t.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var t=this.getEdgesDistinctEndPoints(e);return 2==t.length&&t},getEdgesDistinctEndPoints:function(e){var t=[];return e.forEach(function(e){this.containsElement(t,e.source())||t.push(e.source()),this.containsElement(t,e.target())||t.push(e.target())}.bind(this)),t},containsElement:function(e,t){for(var n=!1,r=0;r{const r=n(4726),i=n(6527),o=n(5111);e.exports=function(e){const t=e.json();let n=document.getElementById("support-map");return n.style.width=e.container().clientWidth+"px",n.style.height=e.container().clientHeight+"px",r.use(i),r.use(o),r({container:n,elements:t.elements,styleEnabled:!0,style:t.style})}},4497:(e,t,n)=>{var r;!function(){"use strict";var i=function(e){if(!e)return;var t=n(9699),r=n(4540);const i=n(3666),{runLayoutAsync:o,resolveCompoundNodesOverlap:a}=n(8647);var s=null;function l(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n.hasOwnProperty(r)&&(n[r]=t[r]);return n}function u(e){var t="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=t,e.fisheye=n}function c(e,t){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===t?n:n[t]}function d(e,t,n){c(e)[t]=n}e("core","expandCollapse",(function(e){var h=this;const p=document.querySelector(".map.__________cytoscape_container"),f=document.getElementById("support-map");if(p&&!f){const e=document.createElement("div");e.id="support-map",e.style.zIndex=-1,e.style.opacity=0,p.parentNode.insertBefore(e,p.nextSibling)}var g=c(h,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999,isGroupBy:!0};if("get"!==e){g=l(g,e);var v=function(e,t){var n={};function h(t){var r=c(e,"options");t.cueEnabled&&!r.cueEnabled?n.enableCue():!t.cueEnabled&&r.cueEnabled&&n.disableCue()}return n.setOptions=function(t){h(t),d(e,"options",t)},n.extendOptions=function(t){var n=l(c(e,"options"),t);h(n),d(e,"options",n)},n.setOption=function(t,n){var r={};r[t]=n;var i=l(c(e,"options"),r);h(i),d(e,"options",i)},n.collapse=async function(n,r){var s=this.collapsibleNodes(n);if(r?.isGroupBy){var h=i(e),p=s.map((e=>{var t=h.getElementById(e.id());return t.toggleClass("expanded",!1),t.toggleClass("cy-expand-collapse-collapsed-node",!0),t.toggleClass("collapsed",!0),t}));if(p.length){var f=h.collection(p);t.simpleCollapseGivenNodes(f);var g=c(e,"options").layoutBy;await o(h.layout({...g,animate:!1})),await a(h,{...g,animate:!1});var v=h.nodes().map((e=>({nodeId:e.id(),position:e.position()})));h.destroy(),d(e,"positions",v)}}var y=l(c(e,"options"),r);return u(y),t.collapseGivenNodes(s,y)},n.collapseRecursively=async function(t,n){var r=this.collapsibleNodes(t),i=l(c(e,"options"),n);return u(i),await this.collapse(r.union(r.descendants()),i)},n.expand=async function(n,r){if(r?.isGroupBy){var s=i(e),h=s.getElementById(n.id()),p=h._private.data.collapsedChildren;s.add(p),h.toggleClass("cy-expand-collapse-collapsed-node",!1),h.toggleClass("collapsed",!1),h.toggleClass("expanded",!0);var f=c(e,"options").layoutBy;await o(s.layout({...f,animate:!1})),await a(s,{...f,animate:!1});var g=s.nodes().map((e=>({nodeId:e.id(),position:e.position()})));s.destroy(),d(e,"positions",g)}var v=this.expandableNodes(n),y=l(c(e,"options"),r);return u(y),t.expandGivenNodes(v,y)},n.expandRecursively=function(n,r){var i=this.expandableNodes(n),o=l(c(e,"options"),r);return u(o),t.expandAllNodes(i,o)},n.collapseAll=async function(t){var n=l(c(e,"options"),t);return u(n),await this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(t){var n=l(c(e,"options"),t);return u(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isCollapsible(e)}))},n.expandableNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var r=e.collection();return t.getCollapsedChildrenRecursively(n,r)},n.getAllCollapsedChildrenRecursively=function(){var t,n=e.collection(),r=e.nodes(".cy-expand-collapse-collapsed-node");for(t=0;t[e,e])));var u={edges:e.collection(),oldEdges:e.collection()};return s.forEach(function(e){const n=e[1].id();var r=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(r=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),r.length>=2){var i=t.collapseGivenEdges(r,a);u.oldEdges=u.oldEdges.add(i.oldEdges),u.edges=u.edges.add(i.edges)}}.bind(this)),u},n.expandEdgesBetweenNodes=function(t){var n,r,i=e.collection(),o=(r=[],(n=t).slice(0,n.length-1).forEach((function(e,t){n.slice(t+1,n.length).forEach((function(t){r.push([e,t])}))})),r);return o.push(...t.map((e=>[e,e]))),o.forEach(function(e){const t=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+t+'"],[target = "'+t+'"]');e[0].id()===t&&(n=e[0].connectedEdges('[source = "'+t+'"][target = "'+t+'"]')),i=i.union(n)}.bind(this)),this.expandEdges(i)},n.collapseAllEdges=function(t){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),t)},n.expandAllEdges=function(){var t=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},r=this.expandEdges(t);return n.oldEdges=n.oldEdges.add(r.oldEdges),n.edges=n.edges.add(r.edges),n},n.loadJson=function(e){s.loadJson(e)},n.saveJson=function(e,t){return s.saveJson(e,t)},n}(h,n(9272)(h));s=n(554)(h,v),d(h,"api",v),t(h,v),r(g,h,v),g.cueEnabled||r("unbind",h,v),g.ready&&g.ready(),d(h,"options",g),d(h,"parentData",{})}return c(h,"api")}))};e.exports&&(e.exports=i),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r),"undefined"!=typeof cytoscape&&i(cytoscape)}()},8647:(e,t,n)=>{function r(e){return new Promise((t=>{e.on("layoutstop",t),e.run()}))}e.exports={runLayoutAsync:r,resolveCompoundNodesOverlap:async function(e,t){const i=n(1537)(e);if(e.nodes().filter((e=>"positioning-support"===e.data().type)).length)return;const o=function(e){const t={};return e.filter((e=>"default"!==e.data().type)).forEach((e=>{const n=e.data().parent;if(void 0===n)t[1]||(t[1]={root:[]}),t[1].root.push(e);else{const r=n.split("::").length+1;t[r]||(t[r]={}),t[r][n]||(t[r][n]=[]),t[r][n].push(e)}})),Object.keys(t).sort(((e,t)=>parseInt(e)-parseInt(t))).map(((e,n)=>({level:n+1,items:"1"===e?[t[e].root]:Object.values(t[e])}))).reverse()??[]}(e.nodes());for(let n=0;n{if(!t.hasClass("cy-expand-collapse-collapsed-node")&&t.isParent()){const n=`support ${t.data().id}`,r={group:"nodes",data:{id:n,parent:t.data().parent,type:"positioning-support",label:`${t.data().label}`},style:{width:t.boundingBox().w,height:t.boundingBox().h,padding:0,"min-width":0,"border-width":0,shape:"round-rectangle"},position:{x:t.position("x"),y:t.position("y")}};e.add(r);const i=t.remove();a=a.union(i);const o=e.getElementById(n);return s=s.union(o),o}return t}));l=l.union(r)}if(0===a.length&&1===o.length){const e=l.layout(t);await r(e)}else if(a.length>0){const n=l.layout(t);await r(n),a.restore(),a.forEach((t=>{if("edges"!==t.group()||"default"===t.data()?.type){const n=`support ${t.data().id}`,r=e.getElementById(n);if(r?.length){const e={x:t.position().x{e.exports=function(e,t){function n(t,i,o,a){t.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,t){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),r={layoutBy:null,animate:!1,fisheye:!1},i=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],o=0;o0?t[n](i.options):t[n](c,i.options)):(u.oldData=a(),u.nodes=n.indexOf("All")>0?t[n](r):t[n](e.collection(c),r),s=i.oldData,l={},e.nodes().not(":parent").positions((function(e,t){"number"==typeof e&&(e=t),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),u}}function l(n){var r=n.options,i=n.edges,o={};if(o.options=r,n.firstTime){var a=t.collapseEdges(i,r);o.edges=a.edges,o.oldEdges=a.oldEdges,o.firstTime=!1}else o.oldEdges=i,o.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return o}function u(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function c(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function d(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdges(n.edges);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.oldEdges=n.edges,i.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function h(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function p(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}}},7799:function(e,t,n){var r;r=function(e){return(()=>{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var o in r)i[o]=r[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),o=n(880),a=n(991),s=n(767),l=n(806),u=n(902),c=n(551).FDLayoutConstants,d=n(551).LayoutConstants,h=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,v=n(551).Integer,y=n(551).IGeometry,m=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},w.prototype.newNode=function(e){return new a(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var n=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,o=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(o)||(e.nodesInRelativeVertical.push(o),e.nodeToRelativeConstraintMapVertical.set(o,[]),e.dummyToNodeForHorizontalAlignment.has(o)?e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(o).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:t.gap})}}));else{var d=new Map,h=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var t=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;h.has(r)?h.get(r).push(i):h.set(r,[i]),h.has(i)?h.get(i).push(r):h.set(i,[r])}}));var p=function(e,t){var n=[],r=[],i=new x,o=new Set,a=0;return e.forEach((function(s,l){if(!o.has(l)){n[a]=[],r[a]=!1;var u=l;for(i.push(u),o.add(u),n[a].push(u);0!=i.length;)u=i.shift(),t.has(u)&&(r[a]=!0),e.get(u).forEach((function(e){o.has(e)||(i.push(e),o.add(e),n[a].push(e))}));a++}})),{components:n,isFixed:r}},f=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(h,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(a.y)),o=Math.floor(a.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-a.x/2,d.WORLD_CENTER_Y-a.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),o=new b;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(n.x),o.setWorldOrgY(n.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=c.indexOf(v);m>=0&&c.splice(m,1),f--,d--}h=null!=t?(c.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/d,x=h;p!=d;x=++x%f){var E=c[x].getOtherEnd(e);if(E!=t){var _=(n+p*b)%360,C=(_+b)%360;w.branchRadialLayout(E,e,_,C,i+o,o),p++}}},w.maxDiagonalInTree=function(e){for(var t=v.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),o=new a(e.graphManager);o.id=r,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=o;var s=e.getGraphManager().add(e.newGraph(),o),l=i.getChild();l.add(o);for(var u=0;ui?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):"bottom"==r.labelPosVertical&&r.setHeight(o+r.labelHeight))}}))},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,o=t.labelMarginLeft,a=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,o,a)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,o=r.paddingTop,a=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,o,a,s)}))},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=h.rect.height)}n+=c+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())}));var u,c=o/i,d=a/i,h=Math.pow(n-r,2)+4*(c+r)*(d+n)*i,p=(r-n+Math.sqrt(h))/(2*(c+r));t?(u=Math.ceil(p))==p&&u++:u=Math.floor(p);var f=u*(c+r)-r;return s>f&&(f=s),f+2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},u=function(e,t){return s(t)-s(e)};e.sort((function(e,t){var n=u;return a.idealRowWidth?(n=o)(e.id,t.id):n(e,t)}));for(var c=0,d=0,h=0;h0&&(o+=e.horizontalPadding),e.rowWidth[n]=o,e.width0&&(a+=e.verticalPadding);var s=0;a>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=a,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var o=e.rowWidth[i];if(o+e.horizontalPadding+t<=e.width)return!0;var a,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),a=e.width-o>=t+e.horizontalPadding?(e.height+l)/(o+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtho&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-o,e.rowWidth[n]=e.rowWidth[n]+o,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=r[s].height);t>0&&(a+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=a,e.rowHeight[n]0)for(var d=i;d<=o;d++)u[0]+=this.grid[d][a-1].length+this.grid[d][a].length-1;if(o0)for(d=a;d<=s;d++)u[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var h,p,f=v.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function o(e,t,n,i){r.call(this,e,t,n,i)}for(var a in o.prototype=Object.create(r.prototype),r)o[a]=r[a];o.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var o=0;r.forEach((function(e){"horizontal"==t?(d.set(e,l.has(e)?u[l.get(e)]:i.get(e)),o+=d.get(e)):(d.set(e,l.has(e)?c[l.get(e)]:i.get(e)),o+=d.get(e))})),o/=r.length,e.forEach((function(e){n.has(e)||d.set(e,o)}))}else{var a=0;e.forEach((function(e){a+="horizontal"==t?l.has(e)?u[l.get(e)]:i.get(e):l.has(e)?c[l.get(e)]:i.get(e)})),a/=e.length,e.forEach((function(e){d.set(e,a)}))}}));for(var f=function(){var r=p.shift();e.get(r).forEach((function(e){if(d.get(e.id)a&&(a=y),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!h&&v.return&&v.return()}finally{if(p)throw f}}var x=(r+a)/2-(o+s)/2,w=!0,E=!1,_=void 0;try{for(var C,T=e[Symbol.iterator]();!(w=(C=T.next()).done);w=!0){var N=C.value;d.set(N,d.get(N)+x)}}catch(e){E=!0,_=e}finally{try{!w&&T.return&&T.return()}finally{if(E)throw _}}}))}return d},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach((function(e){e.left?u[l.get(e.left)]-u[l.get(e.right)]>=0?t++:n++:c[l.get(e.top)]-c[l.get(e.bottom)]>=0?r++:i++})),t>n&&r>i)for(var o=0;on)for(var a=0;ai)for(var s=0;s1)t.fixedNodeConstraint.forEach((function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[u[l.get(e.nodeId)],c[l.get(e.nodeId)]]})),_=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach((function(e){i.add(e)}));var o,a=new Set([].concat(r(i)).filter((function(e){return T.has(e)})));o=a.size>0?u[l.get(a.values().next().value)]:g(i).x,n[t].forEach((function(t){w[e]=[o,c[l.get(t)]],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},o=0;o0?u[l.get(o.values().next().value)]:g(n).y,a[t].forEach((function(t){w[e]=[u[l.get(t)],i],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},d=0;dD&&(D=A[O].length,I=O);if(D0){var W={x:0,y:0};t.fixedNodeConstraint.forEach((function(e,t){var n,r,i=(r={x:u[l.get(e.nodeId)],y:c[l.get(e.nodeId)]},{x:(n=e.position).x-r.x,y:n.y-r.y});W.x+=i.x,W.y+=i.y})),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,u.forEach((function(e,t){u[t]+=W.x})),c.forEach((function(e,t){c[t]+=W.y})),t.fixedNodeConstraint.forEach((function(e){u[l.get(e.nodeId)]=e.position.x,c[l.get(e.nodeId)]=e.position.y}))}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var q=t.alignmentConstraint.vertical,K=function(e){var t=new Set;q[e].forEach((function(e){t.add(e)}));var n,i=new Set([].concat(r(t)).filter((function(e){return T.has(e)})));n=i.size>0?u[l.get(i.values().next().value)]:g(t).x,t.forEach((function(e){T.has(e)||(u[l.get(e)]=n)}))},Z=0;Z0?c[l.get(i.values().next().value)]:g(t).y,t.forEach((function(e){T.has(e)||(c[l.get(e)]=n)}))},J=0;J<$.length;J++)Q(J)}t.relativePlacementConstraint&&function(){var e=new Map,n=new Map,r=new Map,i=new Map,o=new Map,a=new Map,s=new Set,d=new Set;if(T.forEach((function(e){s.add(e),d.add(e)})),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var h=t.alignmentConstraint.vertical,p=function(t){r.set("dummy"+t,[]),h[t].forEach((function(n){e.set(n,"dummy"+t),r.get("dummy"+t).push(n),T.has(n)&&s.add("dummy"+t)})),o.set("dummy"+t,u[l.get(h[t][0])])},f=0;f{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(45);return r})()},e.exports=r(n(3143))},5111:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=function(e){return"function"==typeof e},o=n(2),a=n(3),s=n(4);function l(e){this.options=a({},o,e)}l.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=function(e,t){return i(t)?t.apply(e,[e]):t},a=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===a.x2&&(a.x2=a.x1+a.w),void 0===a.w&&(a.w=a.x2-a.x1),void 0===a.y2&&(a.y2=a.y1+a.h),void 0===a.h&&(a.h=a.y2-a.y1);var l=new s.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),l.setGraph(u),l.setDefaultEdgeLabel((function(){return{}})),l.setDefaultNodeLabel((function(){return{}}));var d=n.nodes();i(e.sort)&&(d=d.sort(e.sort));for(var h=0;h1?t-1:0),r=1;r{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,o={getTopMostNodes:function(e){for(var t={},n=0;n0&&u.merge(e)}));for(var c=0;c1){u=s[0],c=u.connectedEdges().length,s.forEach((function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,u=!1,c=void 0;try{for(var d,h=t.nodeIndexes[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=r(p,2),g=f[0],v=f[1],y=n.cy.getElementById(g);if(y){var m=y.boundingBox(),b=t.xCoords[v]-m.w/2,x=t.xCoords[v]+m.w/2,w=t.yCoords[v]-m.h/2,E=t.yCoords[v]+m.h/2;bo&&(o=x),ws&&(s=E)}}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}var _=e.x-(o+i)/2,C=e.y-(s+a)/2;t.xCoords=t.xCoords.map((function(e){return e+_})),t.yCoords=t.yCoords.map((function(e){return e+C}))}else{Object.keys(t).forEach((function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,u=n.getRect().y,c=n.getRect().y+n.getRect().height;ro&&(o=l),us&&(s=c)}));var T=e.x-(o+i)/2,N=e.y-(s+a)/2;Object.keys(t).forEach((function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+N)}))}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,u=void 0,c=void 0,d=void 0,h=e.descendants().not(":parent"),p=h.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),o<(u=t[r.get(g.id())]+g.width()/2)&&(o=u),a>(c=n[r.get(g.id())]-g.height()/2)&&(a=c),s<(d=n[r.get(g.id())]+g.height()/2)&&(s=d)}var v={};return v.topLeftX=i,v.topLeftY=a,v.width=o-i,v.height=s-a,v},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach((function(e){var t=!1;e.children().forEach((function(e){"none"!=e.css("display")&&(t=!0)})),t||n.merge(e)})),n}};e.exports=o},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,o=n(140).CoSENode,a=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,u=n(140).layoutBase.FDLayoutConstants,c=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,h=d.nodes(),p=d.edges(),f=void 0,g=void 0,v=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,v=t.yCoords);var m=function(e){return"function"==typeof e},b=function(e,t){return m(e)?e(t):e},x=r.calcParentsWithoutChildren(n,d);null!=e.nestingFactor&&(c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(c.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(c.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(c.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(c.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,c.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,c.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,c.TILE=e.tile,c.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1),"enforced"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1),"cose"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?c.TREE_REDUCTION_ON_INCREMENTAL=!1:c.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var u=n.length,c=0;c0&&e(i.getGraphManager().add(i.newGraph(),p),h,i,l)}}(E.addRoot(),r.getTopMostNodes(h),w,e),function(t,n,r){for(var i=0,o=0,a=0;a0?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=i/o:m(e.idealEdgeLength)?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,c.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(d){var h=o.getTopMostNodes(e.eles.nodes());if((l=o.connectComponents(t,e.eles,h)).forEach((function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),e.randomize&&l.forEach((function(t){e.eles=t,r.push(a(e))})),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,v={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach((function(e,t){0==e.edges().length&&(e.nodes().forEach((function(t,n){p.merge(e.nodes()[n]),t.isParent()||(v.nodeIndexes.set(e.nodes()[n].id(),g++),v.xCoords.push(e.nodes()[0].position().x),v.yCoords.push(e.nodes()[0].position().y))})),y.push(t))})),p.length>1){var m=p.boundingBox();u.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),l.push(p),r.push(v);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),u.splice(y[b],1)}}l.forEach((function(t,n){e.eles=t,i.push(s(e,r[n])),o.relocateComponent(u[n],i[n],e)}))}else l.forEach((function(t,n){o.relocateComponent(u[n],r[n],e)}));var x=new Set;if(l.length>1){var w=[],E=n.filter((function(e){return"none"==e.css("display")}));l.forEach((function(t,n){var a=void 0;if("draft"==e.quality&&(a=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach((function(t){if("draft"==e.quality)if(t.isParent()){var u=o.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:u.topLeftX,y:u.topLeftY,width:u.width,height:u.height})}else l=a.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})})),t.edges().forEach((function(t){var l=t.source(),u=t.target();if("none"!=l.css("display")&&"none"!=u.css("display"))if("draft"==e.quality){var c=a.get(l.id()),d=a.get(u.id()),h=[],p=[];if(l.isParent()){var f=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);h.push(f.topLeftX+f.width/2),h.push(f.topLeftY+f.height/2)}else h.push(r[n].xCoords[c]),h.push(r[n].yCoords[c]);if(u.isParent()){var g=o.calcBoundingBox(u,r[n].xCoords,r[n].yCoords,a);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[d]),p.push(r[n].yCoords[d]);s.edges.push({startX:h[0],startY:h[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][u.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][u.id()].getCenterX(),endY:i[n][u.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),x.add(n))}}));var _=c.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach((function(e,t){var n=e.xCoords.map((function(e){return e+_[t].dx})),r=e.yCoords.map((function(e){return e+_[t].dy}));e.xCoords=n,e.yCoords=r}));else{var C=0;x.forEach((function(e){Object.keys(i[e]).forEach((function(t){var n=i[e][t];n.setCenter(n.getCenterX()+_[C].dx,n.getCenterY()+_[C].dy)})),C++}))}}}else{var T=e.eles.boundingBox();if(u.push({x:T.x1+T.w/2,y:T.y1+T.h/2}),e.randomize){var N=a(e);r.push(N)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),o.relocateComponent(u[0],i[0],e)):o.relocateComponent(u[0],r[0],e)}var M=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var o=void 0,a=void 0,s=t.data("id");return i.forEach((function(e){s in e&&(o={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},a=e[s])})),e.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.labelHeight/2))),null==o&&(o={x:t.position("x"),y:t.position("y")}),{x:o.x,y:o.y}}var l=void 0;return r.forEach((function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})})),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=o.calcParentsWithoutChildren(t,n),D=n.filter((function(e){return"none"==e.css("display")}));e.eles=n.not(D),n.nodes().not(":parent").not(D).layoutPositions(this,e,M),A.length>0&&A.forEach((function(e){e.position(M(e))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=u},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,o=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,a=n.nodes(),s=n.nodes(":parent"),l=new Map,u=new Map,c=new Map,d=[],h=[],p=[],f=[],g=[],v=[],y=[],m=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,_=e.samplingType,C=e.nodeSeparation,T=void 0,N=function(e,t,n){for(var r=[],i=0,o=0,a=0,s=void 0,l=[],c=0,h=1,p=0;p=i;){a=r[i++];for(var f=d[a],y=0;yc&&(c=g[w],h=w)}return h};r.connectComponents(t,n,r.getTopMostNodes(a),l),s.forEach((function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)}));for(var M=0,A=0;A0&&(r.isParent()?d[t].push(c.get(r.id())):d[t].push(r.id()))}))}));var R=function(e){var n=u.get(e),r=void 0;l.get(e).forEach((function(i){r=t.getElementById(i).isParent()?c.get(i):i,d[n].push(r),d[u.get(r)].push(e)}))},B=!0,F=!1,z=void 0;try{for(var j,V=l.keys()[Symbol.iterator]();!(B=(j=V.next()).done);B=!0)R(j.value)}catch(e){F=!0,z=e}finally{try{!B&&V.return&&V.return()}finally{if(F)throw z}}var G=void 0;if((b=u.size)>2){T=b=1)break;u=l}for(var f=0;f=1)break;u=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(579);return r})()},e.exports=r(n(7799))},4726:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var h="undefined"==typeof window?null:window,p=h?h.navigator:null;h&&h.document;var f=r(""),g=r({}),v=r((function(){})),y="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&r(e)==f},x=function(e){return null!=e&&r(e)===v},w=function(e){return!T(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&r(e)===g&&!w(e)&&e.constructor===Object},_=function(e){return null!=e&&r(e)===r(1)&&!isNaN(e)},C=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},T=function(e){return N(e)||M(e)},N=function(e){return"collection"===m(e)&&e._private.single},M=function(e){return"collection"===m(e)&&!e._private.single},A=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},I=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},O=function(e){return function(e){return null!=e&&r(e)===g}(e)&&x(e.then)},P=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},Y=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=t||n<0||d&&e-u>=o}function g(){var e=Q();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?ye(n,o-(e-u)):n}(e))}function v(e){return s=void 0,h&&r?p(e):(r=i=void 0,a)}function y(){var e=Q(),n=f(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),c?p(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ge(t)||0,W(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ve(ge(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Q())},y},be=h?h.performance:null,xe=be&&be.now?function(){return be.now()}:function(){return Date.now()},we=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(xe())}),1e3/60)}}(),Ee=function(e){return we(e)},_e=xe,Ce=9261,Te=5381,Ne=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Me=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce)+e|0},Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Te;return(t<<5)+t+e|0},De=function(e){return 2097152*e[0]+e[1]},Ie=function(e,t){return[Me(e[0],t[0]),Ae(e[1],t[1])]},Oe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ne({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},$e=function(e){e.splice(0,e.length)},Qe=function(e,t,n){return n&&(t=L(n,t)),e[t]},Je=function(e,t,n,r){n&&(t=L(n,t)),e[t]=r},et="undefined"!=typeof Map?Map:function(){function e(){i(this,e),this._obj={}}return a(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),tt=function(){function e(t){if(i(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&A(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new nt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);in;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;og;0<=g?++h:--h)v.push(o(e,r));return v},f=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},g=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i0;){var _=y.pop(),C=g(_),T=_.id();if(d[T]=C,C!==1/0)for(var N=_.neighborhood().intersect(p),M=0;M0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},ct={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t0;){if(u=(l=g.pop()).id(),v.delete(u),w++,u===d){for(var E=[],_=i,C=d,T=m[C];E.unshift(_),null!=T&&E.unshift(T),null!=(_=y[C]);)T=m[C=_.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:w}}f[u]=!0;for(var N=l._private.edges,M=0;MM&&(p[N]=M,y[N]=T,m[N]=w),!i){var A=T*u+C;!i&&p[A]>M&&(p[A]=M,y[A]=C,m[A]=w)}}}for(var D=0;D1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},yt=Math.sqrt(2),mt=function(e,t,n){0===n.length&&Ge("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(u,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=mt(i,e,t),n--}return t},xt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/yt);if(!(i<2)){for(var l=[],u=0;u0?1:e<0?-1:0},Mt=function(e,t){return Math.sqrt(At(e,t))},At=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Dt=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},St=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Lt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Bt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=l(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ft=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},zt=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},jt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Vt=function(e,t){return jt(e,t.x1,t.y1)&&jt(e,t.x2,t.y2)},Gt=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?sn(i,o):u,d=i/2,h=o/2,p=(c=Math.min(c,d,h))!==d,f=c!==h;if(p){var g=r-h-a;if((s=en(e,t,n,r,n-d+c-a,g,n+d-c+a,g,!1)).length>0)return s}if(f){var v=n+d+a;if((s=en(e,t,n,r,v,r-h+c-a,v,r+h-c+a,!1)).length>0)return s}if(p){var y=r+h+a;if((s=en(e,t,n,r,n-d+c-a,y,n+d-c+a,y,!1)).length>0)return s}if(f){var m=n-d-a;if((s=en(e,t,n,r,m,r-h+c-a,m,r+h-c+a,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=Qt(e,t,n,r,b,x,c+a)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=Qt(e,t,n,r,w,E,c+a)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var _=n+d-c,C=r+h-c;if((l=Qt(e,t,n,r,_,C,c+a)).length>0&&l[0]>=_&&l[1]>=C)return[l[0],l[1]];var T=n-d+c,N=r+h-c;return(l=Qt(e,t,n,r,T,N,c+a)).length>0&&l[0]<=T&&l[1]>=N?[l[0],l[1]]:[]},Yt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},Ut=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(ec||th)},Xt=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f,g,v,y,m,b,x,w=[];u=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,d=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0===(l=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(l=1e-5),g=-27*(d/=l)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,(h=w)[1]=0,b=u/3,p>0?(y=(y=g+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=g-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),h[0]=-b+y+m,b+=(y+m)/2,h[4]=h[2]=-b,b=Math.sqrt(3)*(-m+y)/2,h[3]=b,h[5]=-b):(h[5]=h[3]=0,0===p?(x=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),h[0]=2*x-b,h[4]=h[2]=-(x+b)):(v=(f=-f)*f*f,v=Math.acos(g/Math.sqrt(v)),x=2*Math.sqrt(f),h[0]=-b+x*Math.cos(v/3),h[2]=-b+x*Math.cos((v+2*Math.PI)/3),h[4]=-b+x*Math.cos((v+4*Math.PI)/3)));for(var E=[],_=0;_<6;_+=2)Math.abs(w[_+1])<1e-7&&w[_]>=0&&w[_]<=1&&E.push(w[_]);E.push(1),E.push(0);for(var C,T,N,M=-1,A=0;A=0?Nl?(e-i)*(e-i)+(t-o)*(t-o):u-d},Wt=function(e,t,n){for(var r,i,o,a,s=0,l=0;l=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},qt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),p=Math.sin(-u),f=0;f0){var g=Zt(c,-l);d=Kt(g)}else d=c;return Wt(e,t,d)},Kt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},Jt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,h=t-o,p=r-t,f=s-o,g=d*h-f*u,v=c*h-p*u,y=f*c-d*p;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===g||0===v?Jt(e,n,a)===a?[a,s]:Jt(e,n,i)===i?[i,o]:Jt(i,a,n)===n?[n,r]:[]:[]},tn=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f=[],g=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y0){var m=Zt(g,-s);u=Kt(m)}else u=g}else u=n;for(var b=0;bu&&(u=t)},d=function(e){return l[e]},h=0;h0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var w=r(m);b=b.id(),h[b]>h[v]+w&&(h[b]=h[v]+w,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E0;){for(var N=n.pop(),M=0;M0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:An,a=r,s=0;s=2?Sn(e,t,n,0,On,Pn):Sn(e,t,n,0,In)},squaredEuclidean:function(e,t,n){return Sn(e,t,n,0,On)},manhattan:function(e,t,n){return Sn(e,t,n,0,In)},max:function(e,t,n){return Sn(e,t,n,-1/0,kn)}};function Rn(e,t,n,r,i,o){var a;return a=x(e)?e:Ln[e]||Ln.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}Ln["squared-euclidean"]=Ln.squaredEuclidean,Ln.squaredeuclidean=Ln.squaredEuclidean;var Bn=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Fn=function(e){return Bn(e)},zn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return Rn(e,r.length,o,(function(e){return r[e](t)}),a,s)},jn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;ln)return!1;return!0},Xn=function(e,t,n){for(var r=0;ri&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],g=t[r[a]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(o=n[g.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i=M?(A=M,M=I,D=O):I>A&&(A=I);for(var P=0;P0?1:0;C[E%u.minIterations*t+F]=z,B+=z}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var j=0,V=0;V0&&r.push(i);return r}(t,o,a),U=function(e,t,n){for(var r=lr(e,t,n),i=0;il&&(s=u,l=c)}n[i]=o[s]}return lr(e,t,n)}(t,r,Y),X={},H=0;H1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},pr=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},fr={};[ot,ut,ct,ht,ft,vt,xt,dn,pn,gn,yn,Mn,$n,or,cr,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=dr(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(l.getElementById(g.shift())),c)if(c[v].length)return h;return h.found=!0,h.trail=this.spawn(f,!0),h}},{hopcroftTarjanBiconnected:hr,htbc:hr,htb:hr,hopcroftTarjanBiconnectedComponents:hr},{tarjanStronglyConnected:pr,tsc:pr,tscc:pr,tarjanStronglyConnectedComponents:pr}].forEach((function(e){Y(fr,e)}));var gr=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};gr.prototype={fulfill:function(e){return vr(this,1,"fulfillValue",e)},reject:function(e){return vr(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new gr;return n.onFulfilled.push(br(e,r,"fulfill")),n.onRejected.push(br(t,r,"reject")),yr(n),r.proxy}};var vr=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,yr(e)),e},yr=function(e){1===e.state?mr(e,"onFulfilled",e.fulfillValue):2===e.state&&mr(e,"onRejected",e.rejectReason)},mr=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1},qr.prototype.set=function(e,t){var n=this.__data__,r=Hr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Kr=qr,Zr=zr($,"Map"),$r=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function Qr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Ti.className=Ti.classNames=Ti.classes;var Ni={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:B,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ni.variable="(?:[\\w-.]|(?:\\\\"+Ni.metaChar+"))+",Ni.className="(?:[\\w-]|(?:\\\\"+Ni.metaChar+"))+",Ni.value=Ni.string+"|"+Ni.number,Ni.id=Ni.variable,function(){var e,t,n;for(e=Ni.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Ni.comparatorOp+="|\\!"+t)}();var Mi=20,Ai=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*G(e,t)}(e.selector,t.selector)})),Di=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return Ue("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Ue("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Ue("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(i,o){return i.checks.reduce((function(a,s,l){return a+(o===i&&0===l?"$":"")+function(i,o){var a=i.type,s=i.value;switch(a){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:var u=i.field,c=i.operator;return"["+u+n(e(c))+t(s)+"]";case 5:var d=i.operator,h=i.field;return"["+e(d)+h+"]";case 4:return"["+i.field+"]";case 6:var p=i.operator;return"[["+i.field+n(e(p))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var f=r(i.left,o),g=r(i.subject,o),v=r(i.right,o);return f+(f.length>0?" ":"")+g+v;case Mi:return""}}(s,o)}),"")},i="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Ki(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],Ki)},Wi.forEachUp=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Zi)},Wi.forEachUpAndDown=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],$i)},Wi.ancestors=Wi.parents,(Ui=Xi={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_i.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_i.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ui.data,Ui.removeAttr=Ui.removeData;var Qi,Ji,eo=Xi,to={};function no(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;at})),minIndegree:ro("indegree",(function(e,t){return et})),minOutdegree:ro("outdegree",(function(e,t){return et}))}),Y(to,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},Qi.modelPosition=Qi.point=Qi.position,Qi.modelPositions=Qi.points=Qi.positions,Qi.renderedPoint=Qi.renderedPosition,Qi.relativePoint=Qi.relativePosition;var ao,so,lo=Ji;ao=so={},so.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},so.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},so.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,l),h=d.biasDiff,p=d.biasComplementDiff,f=y(i.height.val-o.h,u,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-g+o.y1+o.y2+v)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ho=function(e,t){return null==t?e:co(e,t.x1,t.y1,t.x2,t.y2)},po=function(e,t,n){return Qe(e,t,n)},fo=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Rt(u,1),co(e,u.x1,u.y1,u.x2,u.y2)}}},go=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=po(o,"labelWidth",n),p=po(o,"labelHeight",n),f=po(o,"labelX",n),g=po(o,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=p,C=h,T=C/2,N=_/2;if(m)a=f-T,s=f+T,l=g-N,u=g+N;else{switch(c.value){case"left":a=f-C,s=f;break;case"center":a=f-T,s=f+T;break;case"right":a=f,s=f+C}switch(d.value){case"top":l=g-_,u=g;break;case"center":l=g-N,u=g+N;break;case"bottom":l=g,u=g+_}}var M=v-Math.max(x,w)-E-2,A=v+Math.max(x,w)+E+2,D=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;a+=M,s+=A,l+=D,u+=I;var O=n||"main",P=i.labelBounds,k=P[O]=P[O]||{};k.x1=a,k.y1=l,k.x2=s,k.y2=u,k.w=s-a,k.h=u-l,k.leftPad=M,k.rightPad=A,k.topPad=D,k.botPad=I;var S=m&&"autorotate"===b.strValue,L=null!=b.pfValue&&0!==b.pfValue;if(S||L){var R=S?po(i.rstyle,"labelAngle",n):b.pfValue,B=Math.cos(R),F=Math.sin(R),z=(a+s)/2,j=(l+u)/2;if(!m){switch(c.value){case"left":z=s;break;case"right":z=a}switch(d.value){case"top":j=u;break;case"bottom":j=l}}var V=function(e,t){return{x:(e-=z)*B-(t-=j)*F+z,y:e*F+t*B+j}},G=V(a,l),Y=V(a,u),U=V(s,l),X=V(s,u);a=Math.min(G.x,Y.x,U.x,X.x),s=Math.max(G.x,Y.x,U.x,X.x),l=Math.min(G.y,Y.y,U.y,X.y),u=Math.max(G.y,Y.y,U.y,X.y)}var H=O+"Rot",W=P[H]=P[H]||{};W.x1=a,W.y1=l,W.x2=s,W.y2=u,W.w=s-a,W.h=u-l,co(e,a,l,s,u),co(i.labelBounds.all,a,l,s,u)}return e}},vo=function(e){var t=0,n=function(e){return(e?1:0)<0&&o>0){var a=t.pstyle("outline-offset").value,s=t.pstyle("shape").value,l=o+a,u=(e.w+2*l)/e.w,c=(e.h+2*l)/e.h,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+2.4*l)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+2.4*l)/e.w:"star"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.6*l)/e.h,d=-l/3.8):"triangle"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.4*l)/e.h,d=-l/1.4):"vee"===s&&(u=(e.w+4.4*l)/e.w,c=(e.h+3.8*l)/e.h,d=.5*-l);var h=e.h*c-e.h,p=e.w*u-e.w;if(Bt(e,[Math.ceil(h/2),Math.ceil(p/2)]),0!==d){var f=(r=d,{x1:(n=e).x1+0,x2:n.x2+0,y1:n.y1+r,y2:n.y2+r,w:n.w,h:n.h});St(e,f)}}}}(h,e)}else if(g&&t.includeEdges)if(c&&!d){var M=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),o=Math.max(v.srcY,v.midY,v.tgtY),co(h,n-=_,i-=_,r+=_,o+=_),"haystack"===M){var A=v.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var D=n;n=r,r=D}if(i>(o=A[1].y)){var I=i;i=o,o=I}co(h,n-_,i-_,r+_,o+_)}}else if("bezier"===M||"unbundled-bezier"===M||M.endsWith("segments")||M.endsWith("taxi")){var O;switch(M){case"bezier":case"unbundled-bezier":O=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=v.linePts}if(null!=O)for(var P=0;P(r=L.x)){var R=n;n=r,r=R}if((i=S.y)>(o=L.y)){var B=i;i=o,o=B}co(h,n-=_,i-=_,r+=_,o+=_)}if(c&&t.includeEdges&&g&&(fo(h,e,"mid-source"),fo(h,e,"mid-target"),fo(h,e,"source"),fo(h,e,"target")),c&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;co(h,h.x1+F,h.y1+z,h.x2+F,h.y2+z)}var j=p.bodyBounds=p.bodyBounds||{};Ft(j,h),Bt(j,y),Rt(j,1),c&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,co(h,n-E,i-E,r+E,o+E));var V=p.overlayBounds=p.overlayBounds||{};Ft(V,h),Bt(V,y),Rt(V,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=kt(),c&&t.includeLabels&&(t.includeMainLabels&&go(h,e,null),g&&(t.includeSourceLabels&&go(h,e,"source"),t.includeTargetLabels&&go(h,e,"target")))}return h.x1=uo(h.x1),h.y1=uo(h.y1),h.x2=uo(h.x2),h.y2=uo(h.y2),h.w=uo(h.x2-h.x1),h.h=uo(h.y2-h.y1),h.w>0&&h.h>0&&b&&(Bt(h,y),Rt(h,1)),h}(e,bo),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=kt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ho(n,r.overlayBounds):ho(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ho(n,r.labelBounds.all):(t.includeMainLabels&&ho(n,r.labelBounds.mainRot),t.includeSourceLabels&&ho(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ho(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},bo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},xo=vo(bo),wo=Ke(bo);so.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=kt();var n=wo(e=e||bo),r=this;if(r.cy().styleEnabled())for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:Ro,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)a(s);return this},Fo.removeAllListeners=function(){return this.removeListener("*")},Fo.emit=Fo.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,jo(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(E(e)){var o=e;i.applyBypass(this,o,r),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?i.getStylePropertyValue(a,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var o=0;o0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),da.neighbourhood=da.neighborhood,da.closedNeighbourhood=da.closedNeighborhood,da.openNeighbourhood=da.openNeighborhood,Y(da,{source:Hi((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Hi((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ga({attr:"source"}),targets:ga({attr:"target"})}),Y(da,{edgesWith:Hi(va(),"edgesWith"),edgesTo:Hi(va({thisIsSrc:!0}),"edgesTo")}),Y(da,{connectedEdges:Hi((function(e){for(var t=[],n=0;n0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),da.componentsOf=da.components;var ma=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new et,o=!1;if(t){if(t.length>0&&E(t[0])&&!N(t[0])){o=!0;for(var a=[],s=new nt,l=0,u=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u0){for(var B=e.length===i.length?i:new ma(o,e),F=0;F0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var C=0;C=.001?function(t,r){for(var i=0;i<4;++i){var o=h(r,e,n);if(0===o)return r;r-=(d(r,e,n)-t)/o}return r}(t,a):0===l?a:function(t,r,i){var o,a,s=0;do{(o=d(a=r+(i-r)/2,e,n)-t)>0?i=a:r=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+i)}(o),t,r)};f.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var g="generateBezier("+[e,t,n,r]+")";return f.toString=function(){return g},f}var Ea=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),_a=function(e,t,n,r){var i=wa(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Ca={linear:function(e,t,n){return e+(t-e)*n},ease:_a(.25,.1,.25,1),"ease-in":_a(.42,0,1,1),"ease-out":_a(0,0,.58,1),"ease-in-out":_a(.42,0,.58,1),"ease-in-sine":_a(.47,0,.745,.715),"ease-out-sine":_a(.39,.575,.565,1),"ease-in-out-sine":_a(.445,.05,.55,.95),"ease-in-quad":_a(.55,.085,.68,.53),"ease-out-quad":_a(.25,.46,.45,.94),"ease-in-out-quad":_a(.455,.03,.515,.955),"ease-in-cubic":_a(.55,.055,.675,.19),"ease-out-cubic":_a(.215,.61,.355,1),"ease-in-out-cubic":_a(.645,.045,.355,1),"ease-in-quart":_a(.895,.03,.685,.22),"ease-out-quart":_a(.165,.84,.44,1),"ease-in-out-quart":_a(.77,0,.175,1),"ease-in-quint":_a(.755,.05,.855,.06),"ease-out-quint":_a(.23,1,.32,1),"ease-in-out-quint":_a(.86,0,.07,1),"ease-in-expo":_a(.95,.05,.795,.035),"ease-out-expo":_a(.19,1,.22,1),"ease-in-out-expo":_a(1,0,0,1),"ease-in-circ":_a(.6,.04,.98,.335),"ease-out-circ":_a(.075,.82,.165,1),"ease-in-out-circ":_a(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ca.linear;var r=Ea(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":_a};function Ta(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Na(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ma(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Na(e,i),s=Na(t,i);if(_(a)&&_(s))return Ta(o,a,s,n,r);if(w(a)&&w(s)){for(var l=[],u=0;u0?("spring"===d&&h.push(a.duration),a.easingImpl=Ca[d].apply(null,h)):a.easingImpl=Ca[d]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var g=a.startPosition,v=a.position;if(v&&i&&!e.locked()){var y={};Da(g.x,v.x)&&(y.x=Ma(g.x,v.x,p,f)),Da(g.y,v.y)&&(y.y=Ma(g.y,v.y,p,f)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Da(m.x,x.x)&&(w.x=Ma(m.x,x.x,p,f)),Da(m.y,x.y)&&(w.y=Ma(m.y,x.y,p,f)),e.emit("pan"));var _=a.startZoom,C=a.zoom,T=null!=C&&r;T&&(Da(_,C)&&(o.zoom=Pt(o.minZoom,Ma(_,C,p,f),o.maxZoom)),e.emit("zoom")),(E||T)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var M=0;M=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],h=d._private;h.stopped?(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Ia(0,d,e),Aa(t,d,e,n),h.applying&&(h.applying=!1),u(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Pa={animate:_i.animate(),animation:_i.animation(),animated:_i.animated(),clearQueue:_i.clearQueue(),delay:_i.delay(),delayAnimation:_i.delayAnimation(),stop:_i.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Oa(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ee((function(n){Oa(n,e),t()}))}()}}},ka={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&N(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Sa=function(e){return b(e)?new Vi(e):e},La={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bo(ka,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Sa(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Sa(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},once:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};_i.eventAliasesOn(La);var Ra={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ra.jpeg=Ra.jpg;var Ba={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n,r=e.name,i=t.extension("layout",r);if(null!=i)return n=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(Y({},e,{cy:t,eles:n}));Ge("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Ge("A `name` must be specified to make a layout");else Ge("Layout options must be specified to make a layout")}};Ba.createLayout=Ba.makeLayout=Ba.layout;var Fa={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ja.invalidateDimensions=ja.resize;var Va={collection:function(e,t){return b(e)?this.$(e):T(e)?e.collection():w(e)?(t||(t={}),new ma(this,e,t.unique,t.removed)):new ma(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Va.elements=Va.filter=Va.$;var Ga={},Ya="t";Ga.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(h||d&&p){var f=void 0;h&&p||h?f=u.properties:p&&(f=u.mappedProperties);for(var g=0;g1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],C=i.valueMin[1],T=i.valueMax[1],N=i.valueMin[2],M=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],D=null==i.valueMax[3]?1:i.valueMax[3],I=[Math.round(w+(E-w)*v),Math.round(C+(T-C)*v),Math.round(N+(M-N)*v),Math.round(A+(D-A)*v)];n={bypass:i.bypass,name:i.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,O,i.bypass,h)}if(!n)return g(),!1;n.mapping=i,i=n;break;case a.data:for(var P=i.field.split("."),k=d.data,S=0;S0&&o>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ga.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Ga.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ga.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==t||"bezier"!==n&&"bezier"!==r||e.parallelEdges().forEach((function(e){e.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==t||"none"!==n&&"none"!==r||e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))},Ga.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ua={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;ot.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Ue("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u&&new Vi(u).invalid)Ue("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();else{var c=l[2],d=!1;n=c;for(var h=[];!n.match(/^\s*$/);){var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ue("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=p[0];var f=p[1],g=p[2];this.properties[f]?i.parse(f,g)?(h.push({name:f,val:g}),s()):(Ue("Skipping property: Invalid property definition in: "+r),s()):(Ue("Skipping property: Invalid property name in: "+r),s())}if(d){a();break}i.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var p=s.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(e,c[4]);if(!f||f.mapped)return!1;var g=this.parse(e,c[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return Ue("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(d.color){var v=f.value,y=g.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var E=[],C=[],T=[],N="",M=!1,A=0;A0?" ":"")+D.strValue}return d.validate&&!d.validate(E,C)?null:d.singleEnum&&M?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:T,strValue:N,bypass:n,units:C}}var I,O,P,S=function(){for(var r=0;rd.max||d.strictMax&&t===d.max))return null;var G={name:e,value:t,strValue:""+t+(L||""),units:L,bypass:n};return d.unitless||"px"!==L&&"em"!==L?G.pfValue=t:G.pfValue="px"!==L&&L?this.getEmSizeInPixels()*t:t,"ms"!==L&&"s"!==L||(G.pfValue="ms"===L?t:1e3*t),"deg"!==L&&"rad"!==L||(G.pfValue="rad"===L?t:(I=t,Math.PI*I/180)),"%"===L&&(G.pfValue=t/100),G}if(d.propList){var Y=[],X=""+t;if("none"===X);else{for(var H=X.split(/\s*,\s*|\s+/),W=0;W255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(P)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+j+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[a,s,l,o]}return t}(P);return K?{name:e,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var Z=S();if(Z)return Z}for(var $=d.regexes?d.regexes:[d.regex],Q=0;Q<$.length;Q++){var J=new RegExp($[Q]).exec(t);if(J)return{name:e,value:d.singleRegexMatchValue?J[1]:J,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?S():null};var $a=function e(t){if(!(this instanceof e))return new e(t);A(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Ge("A style must have a core reference")},Qa=$a.prototype;Qa.instanceString=function(){return"style"},Qa.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),_(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=wt(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;_(l.x)&&(t.pan.x=l.x,a=!1),_(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else T(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};es.centre=es.center,es.autolockNodes=es.autolock,es.autoungrabifyNodes=es.autoungrabify;var ts={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ts.attr=ts.data,ts.removeAttr=ts.removeData;var ns=function(e){var t=this,n=(e=Y({},e)).container;n&&!C(n)&&C(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=Y({name:o?"grid":"null"},a.layout),a.renderer=Y({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new ma(this),listeners:[],aniEles:new ma(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:_(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&_(a.pan.x)?a.pan.x:0,y:E(a.pan)&&_(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=Y({},a,a.renderer);t.initRenderer(u),function(e,t){if(e.some(O))return wr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=Y({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e0,u=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(T(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d0;){var P=D.shift(),k=A(P,I);if(k)P.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(O);else if(null===k){Ue("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}M();var S=0;if(n.avoidOverlap)for(var L=0;L0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:q+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:q+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var us={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cs(e){this.options=Y({},us,e)}cs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h1&&t.avoidOverlap){d*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(v*v+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var ds,hs={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ps(e){this.options=Y({},hs,e)}ps.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d0&&Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m)),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,_)}for(var C=0,T=0;T1&&t.avoidOverlap){var D=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(D*D+I*I));C=Math.max(O,C)}N.r=C,C+=w}if(t.equidistant){for(var P=0,k=0,S=0;S=e.numIter||(Es(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature=e.animationThreshold&&o(),Ee(t)):(Ss(r,e),s())}();else{for(;u;)u=a(l),l++;Ss(r,e),s()}return this},gs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},gs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vs=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u0)for(a.graphSet.push(E),u=0;ur.count?0:r.graph},ms=function e(t,n,r,i){var o=i.graphSet[r];if(-10)var s=(u=r.nodeOverlap*a)*i/(g=Math.sqrt(i*i+o*o)),l=u*o/g;else{var u,c=Ms(e,i,o),d=Ms(t,-1*i,-1*o),h=d.x-c.x,p=d.y-c.y,f=h*h+p*p,g=Math.sqrt(f);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/f)*h/g,l=u*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ns=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ms=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0n?(u.x=r,u.y=i+o/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},As=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,g=t.gravity*h/p;c.offsetX+=f,c.offsetY+=g}}}}},Is=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},ks=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTopf&&(d+=p+t.componentSpacing,c=0,h=0,p=0)}}},Ls={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Rs(e){this.options=Y({},Ls,e)}Rs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},h=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=p)l=h,u=p;else if(null!=h&&null==p)l=h,u=Math.ceil(a/l);else if(null==h&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var f=c(),g=d();(f-1)*g>=a?c(f-1):(g-1)*f>=a&&d(g-1)}else for(;u*l=a?d(y+1):c(v+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x=u&&(O=0,I++)},k={},S=0;S(r=Ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5(r=Xt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var C=_[w],T=s.arrowShapes[n.pstyle(C.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(T.roughCollide(e,t,E,C.angle,{x:C.x,y:C.y},N,h)&&T.collide(e,t,E,C.angle,{x:C.x,y:C.y},N,h))return v(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Qe(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},C=_(g,m),T=_(g,x),N=_(y,m),M=_(y,x),A=[C.x+h,C.y+p,N.x+h,N.y+p,M.x+h,M.y+p,T.x+h,T.y+p];if(Wt(e,t,A))return v(n),!0}else if(jt(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),h=kt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),p=0;p4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,r,i){var o,a;if(e!==hl?gl(t,e,pl):((a=pl).x=-1*(o=fl).x,a.y=-1*o.y,a.nx=-1*o.nx,a.ny=-1*o.ny,a.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),gl(t,n,fl),Qs=pl.nx*fl.ny-pl.ny*fl.nx,Js=pl.nx*fl.nx-pl.ny*-fl.ny,nl=Math.asin(Math.max(-1,Math.min(1,Qs))),Math.abs(nl)<1e-6)return Zs=t.x,$s=t.y,void(il=al=0);el=1,tl=!1,Js<0?nl<0?nl=Math.PI+nl:(nl=Math.PI-nl,el=-1,tl=!0):nl>0&&(el=-1,tl=!0),al=void 0!==t.radius?t.radius:r,rl=nl/2,sl=Math.min(pl.len/2,fl.len/2),i?(ol=Math.abs(Math.cos(rl)*al/Math.sin(rl)))>sl?(ol=sl,il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))):il=al:(ol=Math.min(sl,al),il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))),cl=t.x+fl.nx*ol,dl=t.y+fl.ny*ol,Zs=cl-fl.ny*il*el,$s=dl+fl.nx*il*el,ll=t.x+pl.nx*ol,ul=t.y+pl.ny*ol,hl=t}(e,t,n,r,i),{cx:Zs,cy:$s,radius:il,startX:ll,startY:ul,stopX:cl,stopY:dl,startAngle:pl.ang+Math.PI/2*el,endAngle:fl.ang-Math.PI/2*el,counterClockwise:tl})}var ml={};function bl(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},M=N(C,E),A=N(T,_),D=!1;"auto"===v?g=Math.abs(M)>Math.abs(A)?i:r:v===l||v===s?(g=r,D=!0):v!==o&&v!==a||(g=i,D=!0);var I,O=g===r,P=O?A:M,k=O?T:C,S=Nt(k),L=!1;D&&(m||x)||!(v===s&&k<0||v===l&&k>0||v===o&&k>0||v===a&&k<0)||(P=(S*=-1)*Math.abs(P),L=!0);var R=function(e){return Math.abs(e)=Math.abs(P)},B=R(I=m?(b<0?1+b:b)*P:(b<0?P:0)+b*S),F=R(Math.abs(P)-Math.abs(I));if(!B&&!F||L)if(O){var z=u.y1+I+(f?d/2*S:0),j=u.x1,V=u.x2;n.segpts=[j,z,V,z]}else{var G=u.x1+I+(f?c/2*S:0),Y=u.y1,U=u.y2;n.segpts=[G,Y,G,U]}else if(O){var X=Math.abs(k)<=d/2,H=Math.abs(C)<=h/2;if(X){var W=(u.x1+u.x2)/2,q=u.y1,K=u.y2;n.segpts=[W,q,W,K]}else if(H){var Z=(u.y1+u.y2)/2,$=u.x1,Q=u.x2;n.segpts=[$,Z,Q,Z]}else n.segpts=[u.x1,u.y2]}else{var J=Math.abs(k)<=c/2,ee=Math.abs(T)<=p/2;if(J){var te=(u.y1+u.y2)/2,ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else if(ee){var ie=(u.x1+u.x2)/2,oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}else n.segpts=[u.x2,u.y1]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},ml.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!_(n.startX)||!_(n.startY),v=!_(n.arrowStartX)||!_(n.arrowStartY),y=!_(n.endX)||!_(n.endY),m=!_(n.arrowEndX)||!_(n.arrowEndY),b=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,x=Mt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xh.poolIndex()){var p=d;d=h,h=p}var f=s.srcPos=d.position(),g=s.tgtPos=h.position(),v=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=s.srcCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,C=s.tgtCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,T=s.tgtRs=h._private.rscratch,N=s.srcRs=d._private.rscratch;s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var M=0;M0){var H=u,W=At(H,_t(t)),q=At(H,_t(X)),K=W;q2&&At(H,{x:X[2],y:X[3]})0){var le=c,ue=At(le,_t(t)),ce=At(le,_t(se)),de=ue;ce2&&At(le,{x:se[2],y:se[3]})=u||m){c={cp:g,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=Pt(0,_,1),t=Ot(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=Pt(0,r-.001,1),o=Pt(0,r+.001,1),a=Ot(e,t,n,i),s=Ot(e,t,n,o);return Tl(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var C,T,N,M,A=0,D=r.allpts.length,I=0;I+3=u));I+=2);var O=(u-T)/C;O=Pt(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Mt(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(N,M,O),i=Tl(N,M)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},_l.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},_l.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Qe(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,d=i.width,h=i.height+(l-1)*(o-1)*u;Je(n.rstyle,"labelWidth",t,d),Je(n.rscratch,"labelWidth",t,d),Je(n.rstyle,"labelHeight",t,h),Je(n.rscratch,"labelHeight",t,h),Je(n.rscratch,"labelLineHeight",t,c)},_l.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Je(n.rscratch,e,t,r),r):Qe(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,p=[],f=/[\s\u200b]+|$/g,g=0;gc){var b,x="",w=0,E=d(v.matchAll(f));try{for(E.s();!(b=E.n()).done;){var _=b.value,C=_[0],T=v.substring(w,_.index);w=_.index+C.length;var N=0===x.length?T:x+T+C;this.calculateLabelDimensions(e,N).width<=c?x+=T+C:(x&&p.push(x),x=T+C)}}catch(e){E.e(e)}finally{E.f()}x.match(/^[\s\u200b]+$/)||p.push(x)}else p.push(v)}a("labelWrapCachedLines",p),i=a("labelWrapCachedText",p.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var M=e.pstyle("text-max-width").pfValue,A="",D=!1;if(this.calculateLabelDimensions(e,i).widthM);I++)A+=i[I],I===i.length-1&&(D=!0);return D||(A+="…"),A}return i},_l.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},_l.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window().document,i=Oe(t,e._private.labelDimsKey),o=n.labelDimCache||(n.labelDimCache=[]),a=o[i];if(null!=a)return a;var s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=r.createElement("canvas"),h=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}h.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var f=0,g=0,v=t.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var M=i(t);v&&(e.hoverData.tapholdCancelled=!0),n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(D):a.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(n=!0,a.panningEnabled()&&a.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};a.panBy(I),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),b)if(v){if(a.boxSelectionEnabled()&&M)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var P=!e.dragData.didDrag;P&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(w,{inDragLayer:!0});var k={x:0,y:0};if(_(x[0])&&_(x[1])&&(k.x+=x[0],k.y+=x[1],P)){var S=e.hoverData.dragDelta;S&&_(S[0])&&_(S[1])&&(k.x+=S[0],k.y+=S[1])}e.hoverData.draggingEles=!0,w.silentShift(k).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else v&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!M&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=_t(h),e.redrawHint("select",!0),e.redraw()):A(),b&&b.pannable()&&b.active()&&b.unactivate());return f[2]=c[0],f[3]=c[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,h=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:t,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:t,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:a[0],y:a[1]}),x=!1,t.timeStamp-w<=o.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:a[0],y:a[1]})):(b=setTimeout((function(){x||r(c,["oneclick","onetap","voneclick"],t,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),w=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(o.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:t,position:{x:a[0],y:a[1]}});"additive"===o.selectionType()||h||o.$(n).unmerge(g).unselect(),g.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=c&&c.grabbed();d(u),v&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}),!1);var C,T,N,M,A,D,I,O,P,k,S,L,R,B=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",B,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||B(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var F,z,j,V,G,Y,U,X=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},H=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",F=function(t){if(e.hasTouchStarted=!0,m(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var l=e.findContainerClientCoords();P=l[0],k=l[1],S=l[2],L=l[3],C=t.touches[0].clientX-P,T=t.touches[0].clientY-k,N=t.touches[1].clientX-P,M=t.touches[1].clientY-k,R=0<=C&&C<=S&&0<=N&&N<=S&&0<=T&&T<=L&&0<=M&&M<=L;var h=n.pan(),f=n.zoom();if(A=X(C,T,N,M),D=H(C,T,N,M),O=[((I=[(C+N)/2,(T+M)/2])[0]-h.x)/f,(I[1]-h.y)/f],D<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),b=y[0];if(null!=b&&(b.activate(),e.touchData.start=b,e.touchData.starts=y,e.nodeIsGrabbable(b))){var x=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),b.selected()?(w=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(w,{addToList:x})):c(b,{addToList:x}),s(b);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};b.emit(E("grabon")),w?w.forEach((function(e){e.emit(E("grab"))})):b.emit(E("grab"))}r(b,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==b&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var _=e.touchData.startPosition=[null,null,null,null,null,null],B=0;B=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var w=t.touches[0].clientX-P,E=t.touches[0].clientY-k,I=t.touches[1].clientX-P,S=t.touches[1].clientY-k,L=H(w,E,I,S);if(L/D>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(n&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var F=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&F===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=F,F&&F.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",j=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",V=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=h[0],u[1]=h[1]}if(t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=h[0],u[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=h[0],u[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;d(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);r(y,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),G=!1,t.timeStamp-U<=s.multiClickDebounceTime()?(Y&&clearTimeout(Y),G=!0,U=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):(Y=setTimeout((function(){G||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),U=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var p=[c[0],c[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return g[0]}return null},p=Object.keys(d),f=0;f0?u:Gt(i,o,e,t,n,r,a,s)},checkPoint:function(e,t,n,r,i,o,a,s){var l=2*(s="auto"===s?sn(r,i):s);if(qt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(qt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!Wt(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||!!$t(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!$t(e,t,l,l,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",rn(3,0)),this.generateRoundPolygon("round-triangle",rn(3,0)),this.generatePolygon("rectangle",rn(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",rn(5,0)),this.generateRoundPolygon("round-pentagon",rn(5,0)),this.generatePolygon("hexagon",rn(6,0)),this.generateRoundPolygon("round-hexagon",rn(6,0)),this.generatePolygon("heptagon",rn(7,0)),this.generateRoundPolygon("round-heptagon",rn(7,0)),this.generatePolygon("octagon",rn(8,0)),this.generateRoundPolygon("round-octagon",rn(8,0));var r=new Array(20),i=an(5,0),o=an(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*Bl)break;var v=e.deq(t,d,c);if(!(v.length>0))break;for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),i(t))}}},zl=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ze;i(this,e),this.idsByKey=new et,this.keyForId=new et,this.cachesByLvl=new et,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return a(e,[{key:"getIdsFor",value:function(e){null==e&&Ge("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new nt,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new et,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),jl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Vl=Ke({getKey:null,doesEleInvalidateKey:ze,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gl=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Vl(t);Y(n,r),n.lookup=new zl(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Yl=Gl.prototype;Yl.reasons=jl,Yl.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Yl.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Yl.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new st((function(e,t){return t.reqs-e.reqs}))},Yl.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Yl.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Tt(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,h=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var g=o.getTextureQueue(p),v=g[g.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidthr;M--)T=o.getElement(e,t,n,M,jl.downscale);N()}else{var A;if(!x&&!w&&!E)for(var D=r-1;D>=-4;D--){var I=l.get(e,D);if(I){A=I;break}}if(b(A))return o.queueElement(e,r),A;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:u,width:d,height:c,scaledLabelShown:h},v.usedWidth+=Math.ceil(d+8),v.eleCaches.push(f),l.set(e,r,f),o.checkTextureFullness(v),f},Yl.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},Yl.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ze(t,e):e.fullnessChecks++},Yl.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ze(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,$e(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ze(r,o),n.push(o),o}},Yl.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Yl.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,jl.dequeue)}}return i},Yl.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Be,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Yl.onDequeue=function(e){this.onDequeues.push(e)},Yl.offDequeue=function(e){Ze(this.onDequeues,e)},Yl.setupDequeueing=Fl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Ze(c,a)}}();var d=function(t){var i=(t=t||{}).after;!function(){if(!a){a=kt();for(var t=0;t32767||s>32767)return null;if(o*s>16e6)return null;var l=r.makeLayer(a,n);if(null!=i){var d=c.indexOf(i)+1;c.splice(d,0,l)}else(void 0===t.insert||t.insert)&&c.unshift(l);return l};if(r.skipping&&!o)return null;for(var h=null,p=e.length/1,f=!o,g=0;g=p||!Vt(h.bb,v.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||f?r.queueLayer(h,v):r.drawEleInLayer(h,v,n,t),h.eles.push(v),m[n]=h}}return s||(f?null:c)},Xl.getEleLevelForLayerLevel=function(e,t){return e},Xl.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Xl.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Xl.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},Xl.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=_e(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Xl.invalidateLayer=function(e){if(this.lastInvalidationTime=_e(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ze(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*c,m=u*c,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,C=y*_;e.translate(w,E),b(C),x(C),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(a.colorStrokeStyle(e,v[0],v[1],v[2],n),"straight-triangle"===d?a.drawEdgeTrianglePath(t,e,s.allpts):(a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")):e.lineCap="butt"}();i&&a.drawEdgeUnderlay(e,t),b(),x(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},uu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};lu.drawEdgeOverlay=uu("overlay"),lu.drawEdgeUnderlay=uu("underlay"),lu.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");o.pathCacheKey&&o.pathCacheKey===h?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=h,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&void 0!==arguments[5]?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),a?e.stroke():e.fill()}du.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Tt(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},du.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},du.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Qe(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},du.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Qe(o,"labelX",n),c=Qe(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var h,p=n?n+"-":"",f=Qe(o,"labelWidth",n),g=Qe(o,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(h=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(h),u=0,c=0),x){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue,T=0===t.pstyle("text-background-shape").strValue.indexOf("round");if(w>0||_>0&&E>0){var N=u-C;switch(b){case"left":N-=f;break;case"center":N-=f/2}var M=c-g-C,A=f+2*C,D=g+2*C;if(w>0){var I=e.fillStyle,O=t.pstyle("text-background-color").value;e.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+w*a+")",T?hu(e,N,M,A,D,2):e.fillRect(N,M,A,D),e.fillStyle=I}if(_>0&&E>0){var P=e.strokeStyle,k=e.lineWidth,S=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+S[0]+","+S[1]+","+S[2]+","+E*a+")",e.lineWidth=_,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(T?hu(e,N,M,A,D,2,"stroke"):e.strokeRect(N,M,A,D),"double"===L){var R=_/2;T?hu(e,N+R,M+R,A-2*R,D-2*R,2,"stroke"):e.strokeRect(N+R,M+R,A-2*R,D-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=k,e.strokeStyle=P}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Qe(o,"labelWrapCachedLines",n),z=Qe(o,"labelLineHeight",n),j=f/2,V=this.getLabelJustification(t);switch("auto"===V||("left"===b?"left"===V?u+=-f:"center"===V&&(u+=-j):"center"===b?"left"===V?u+=-j:"right"===V&&(u+=j):"right"===b&&("center"===V?u+=j:"right"===V&&(u+=f))),x){case"top":case"center":case"bottom":c-=(F.length-1)*z}for(var G=0;G0&&e.strokeText(F[G],u,c),e.fillText(F[G],u,c),c+=z}else B>0&&e.strokeText(d,u,c),e.fillText(d,u,c);0!==h&&(e.rotate(-h),e.translate(-s,-l))}}};var pu={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(_(d.x)&&_(d.y)&&(!s||t.visible())){var h,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:A;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,F[0],F[1],F[2],t)},H=function(e,t,n,r){var i,o=l.nodePathCache=l.nodePathCache||[],a=Pe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+G),s=o[a],u=!1;return null!=s?(i=s,u=!0,c.pathCache=i):(i=new Path2D,o[a]=c.pathCache=i),{path:i,cacheHit:u}},W=t.pstyle("shape").strValue,q=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(d.x,d.y);var K=H(r,i,W,q);h=K.path,v=K.cacheHit}var Z=function(){if(!v){var n=d;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i,G,c)}g?e.fill(h):e.fill()},$=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i,G,c)))},J=function(){var t=(N>0?N:-N)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=N>0?0:255;0!==N&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(h):e.fill())},ee=function(){if(M>0){if(e.lineWidth=M,e.lineCap=P,e.lineJoin=O,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(S),e.lineDashOffset=L;break;case"solid":case"double":e.setLineDash([])}if("center"!==k){if(e.save(),e.lineWidth*=2,"inside"===k)g?e.clip(h):e.clip();else{var t=new Path2D;t.rect(-r/2-M,-i/2-M,r+2*M,i+2*M),t.addPath(h),e.clip(t,"evenodd")}g?e.stroke(h):e.stroke(),e.restore()}else g?e.stroke(h):e.stroke();if("double"===I){e.lineWidth=M/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(h):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(B>0){if(e.lineWidth=B,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=d;g&&(n={x:0,y:0});var o=l.getNodeShape(t),a=M;"inside"===k&&(a=0),"outside"===k&&(a*=2);var s,u=(r+a+(B+V))/r,c=(i+a+(B+V))/i,h=r*u,p=i*c,f=l.nodeShapes[o].points;if(g&&(s=H(h,p,o,f).path),"ellipse"===o)l.drawEllipsePath(s||e,n.x,n.y,h,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var v=0,y=0,m=0;"round-diamond"===o?v=1.4*(a+V+B):"round-heptagon"===o?(v=1.075*(a+V+B),m=-(a/2+V+B)/35):"round-hexagon"===o?v=1.12*(a+V+B):"round-pentagon"===o?(v=1.13*(a+V+B),m=-(a/2+V+B)/15):"round-tag"===o?(v=1.12*(a+V+B),y=.07*(a/2+B+V)):"round-triangle"===o&&(v=(a+V+B)*(Math.PI/2),m=-(a+V/2+B)/Math.PI),0!==v&&(h=r*(u=(r+v)/r),["round-hexagon","round-tag"].includes(o)||(p=i*(c=(i+v)/i)));for(var b=h/2,x=p/2,w=(G="auto"===G?ln(h,p):G)+(a+B+V)/2,E=new Array(f.length/2),_=new Array(f.length/2),C=0;C0){if(r=r||n.position(),null==i||null==o){var d=n.padding();i=n.width()+2*d,o=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a,c),t.fill()}}}};pu.drawNodeOverlay=fu("overlay"),pu.drawNodeUnderlay=fu("underlay"),pu.hasPie=function(e){return(e=e[0])._private.hasPie},pu.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,g=t.pstyle("pie-"+h+"-background-opacity").value*n,v=p/100;v+d>1&&(v=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*v;0===p||d>=1||d+v>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),d+=v)}};for(var gu={getPixelRatio:function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;ia.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},C=a.prevViewport;void 0===C||_.zoom!==C.zoom||_.pan.x!==C.pan.x||_.pan.y!==C.pan.y||g&&!f||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var T=a.getCachedZSortedEles();function N(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function M(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var A=a.data.bufferContexts[a.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var D=u.contexts[a.NODE],I=a.textureCache.texture;_=a.textureCache.viewport,D.setTransform(1,0,0,1,0,0),h?N(D,0,0,_.width,_.height):D.clearRect(0,0,_.width,_.height);var O=m.core("outside-texture-bg-color").value,P=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(D,O[0],O[1],O[2],P),D.fillRect(0,0,_.width,_.height),b=l.zoom(),M(D,!1),D.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),D.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var k=l.extent(),S=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),L=a.hideEdgesOnViewport&&S,R=[];if(R[a.NODE]=!c[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,R[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),R[a.DRAG]=!c[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,R[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||R[a.NODE]){var B=h&&!R[a.NODE]&&1!==p;M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.nondrag,s,k):a.drawLayeredElements(D,T.nondrag,s,k),a.debug&&a.drawDebugPoints(D,T.nondrag),n||h||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||R[a.DRAG])&&(B=h&&!R[a.DRAG]&&1!==p,M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.drag,s,k):a.drawCachedElements(D,T.drag,s,k),a.debug&&a.drawDebugPoints(D,T.drag),n||h||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(M(D=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var F=m.core("selection-box-border-width").value/b;D.lineWidth=F,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),F>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=u.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var j=a.lastRedrawTime;if(a.showFps&&j){j=Math.round(j);var V=Math.round(1e3/j);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+j+" ms = "+V+" fps",0,20),D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(h&&1!==p){var G=u.contexts[a.NODE],Y=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],U=u.contexts[a.DRAG],X=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):N(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||R[a.NODE])&&(H(G,Y,R[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||R[a.DRAG])&&(H(U,X,R[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")}},vu={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},_u.png=function(e){return Tu(e,this.bufferCanvasImage(e),"image/png")},_u.jpg=function(e){return Tu(e,this.bufferCanvasImage(e),"image/jpeg")};var Nu=Au,Mu=Au.prototype;function Au(e){var t=this,n=t.cy.window().document;t.data={canvases:new Array(Mu.CANVAS_LAYERS),contexts:new Array(Mu.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Mu.CANVAS_LAYERS),bufferCanvases:new Array(Mu.BUFFER_COUNT),bufferContexts:new Array(Mu.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l{e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822:(e,t,n)=>{"use strict";var r=n(6857),i=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},135:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],u=i.addDummyNode(e,"border",s,n);o[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s{"use strict";var r=n(6857);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},9859:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909:(e,t,n)=>{var r=n(6857),i=n(3988),o=n(8191).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},8191:(e,t,n)=>{var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031:(e,t,n)=>{var r=n(6857),i=n(8191).Graph,o=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var u=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202:(e,t,n)=>{"use strict";var r=n(6857),i=n(6822),o=n(8209),a=n(9361),s=n(3988).normalizeRanks,l=n(2948),u=n(3988).removeEmptyRanks,c=n(6353),d=n(135),h=n(4850),p=n(1453),f=n(3776),g=n(3988),v=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new v({multigraph:!0,compound:!0}),n=N(e.graph());return t.setGraph(r.merge({},m,T(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=N(e.node(n));t.setNode(n,r.defaults(T(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=N(e.edge(n));t.setEdge(n,r.merge({},_,T(i,E),r.pick(i,C)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};g.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){u(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=g.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){f(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function T(e,t){return r.mapValues(r.pick(e,t),Number)}function N(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},6857:(e,t,n)=>{var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(9754),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),p=e.node(u);e.setParent(d,u),p.borderTop=d,e.setParent(h,u),p.borderBottom=h,r.forEach(c,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,f=i.borderTop?a:2*a,g=c!==p?1:s-l[u]+1;e.setEdge(d,c,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},8209:(e,t,n)=>{"use strict";var r=n(6857),i=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(u!==s+1){for(e.removeEdge(t),o=0,++s;s{var r=n(6857);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},3860:(e,t,n)=>{var r=n(6857);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},7860:(e,t,n)=>{var r=n(6857),i=n(8191).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6639:(e,t,n)=>{"use strict";var r=n(6857);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r{"use strict";var r=n(6857),i=n(8918),o=n(6639),a=n(4520),s=n(7860),l=n(4384),u=n(8191).Graph,c=n(3988);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new u;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var l,u=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){h(f%2?n:a,f%4>=2),s=c.buildLayerMatrix(e);var v=o(e,s);v{"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},4959:(e,t,n)=>{"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){var n,i,o,a;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(i=t,o=0,a=0,(n=e).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},4520:(e,t,n)=>{var r=n(6857),i=n(3860),o=n(4959),a=n(5169);e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,p={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==h})));var f=i(t,u);r.forEach(f,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(f,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(g,p);var v=a(g,l);if(d&&(v.vs=r.flatten([d,v.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.order+m.order)/(v.weight+2),v.weight+=2}return v}},5169:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,l=r.sortBy(a.rhs,(function(e){return-e.i})),u=[],c=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(u,l,h),r.forEach(s,(function(e){h+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,d+=e.weight,h=o(u,l,h)}));var p={vs:r.flatten(u,!0)};return d&&(p.barycenter=c/d,p.weight=d),p}},2948:(e,t,n)=>{var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,u=a[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank{"use strict";var r=n(6857),i=n(8191).Graph,o=n(3988);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,u=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===u)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(as)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var p=l[d];a[e]===e&&t{"use strict";var r=n(6857),i=n(3988),o=n(9741).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},8481:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph,o=n(8073).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(r.setNode(u,{});a(r,e){"use strict";var r=n(8073).longestPath,i=n(8481),o=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r},6860:(e,t,n)=>{"use strict";var r=n(6857),i=n(8481),o=n(8073).slack,a=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,u=n(3988).simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=g(n);)y(n,e,t,v(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==i){var d=u===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=c,e.hasEdge(a,l)){var p=e.edge(n,c).cutvalue;s+=d?-p:p}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=f(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function v(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(0,e.node(t.v),u)&&c!==m(0,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=g,c.enterEdge=v,c.exchangeEdges=y},8073:(e,t,n)=>{"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038:e=>{e.exports="0.8.5"},8362:(e,t,n)=>{var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619:(e,t,n)=>{var r=n(117);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},9276:(e,t,n)=>{var r=n(117);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},4919:(e,t,n)=>{var r=n(8905),i=n(117);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},8905:(e,t,n)=>{var r=n(117),i=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),u=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6678:(e,t,n)=>{var r=n(117),i=n(6291);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},3590:(e,t,n)=>{var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s{e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(9888)}},498:(e,t,n)=>{var r=n(9888);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423:(e,t,n)=>{var r=n(117),i=n(6454),o=n(1737);e.exports=function(e,t){var n,a=new i,s={},l=new o;function u(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},6291:(e,t,n)=>{var r=n(117);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),i[u].onStack=!1,c.push(u)}while(s!==u);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},9888:(e,t,n)=>{var r=n(117);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},1737:(e,t,n)=>{var r=n(117);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priority{"use strict";var r=n(117);e.exports=s;var i="\0",o="\0",a="";function s(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function l(e,t){e[t]?e[t]++:e[t]=1}function u(e,t){--e[t]||delete e[t]}function c(e,t,n,o){var s=""+t,l=""+n;if(!e&&s>l){var u=s;s=l,l=u}return s+a+l+a+(r.isUndefined(o)?i:o)}function d(e,t){return c(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},s.prototype.setEdge=function(){var e,t,n,i,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=c(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return o&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,l(this._preds[t],e),l(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[t],e),u(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166:(e,t,n)=>{e.exports={Graph:n(6454),version:n(4458)}},7494:(e,t,n)=>{var r=n(117),i=n(6454);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},117:(e,t,n)=>{var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458:e=>{e.exports="2.1.8"},3143:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(9);function a(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in a.prototype=Object.create(r.prototype),r)a[s]=r[s];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},a.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(13),a=n(0),s=n(16),l=n(5);function u(e,t,n,a){null==n&&null==a&&(a=t),r.call(this,a),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=a,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new o(t.x,t.y,n.width,n.height):new o}for(var c in u.prototype=Object.create(r.prototype),r)u[c]=r[c];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}})),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)})),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach((function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}})),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>a.WORLD_BOUNDARY?t=a.WORLD_BOUNDARY:t<-a.WORLD_BOUNDARY&&(t=-a.WORLD_BOUNDARY);var n=this.rect.y;n>a.WORLD_BOUNDARY?n=a.WORLD_BOUNDARY:n<-a.WORLD_BOUNDARY&&(n=-a.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";var r=n(0);function i(){}for(var o in r)i[o]=r[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(0),a=n(7),s=n(3),l=n(1),u=n(13),c=n(12),d=n(11);function h(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof a?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in h.prototype=Object.create(r.prototype),r)h[p]=r[p];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},h.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(c,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},h.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,l=0;l(e=u.getTop())&&(r=e),o>(t=u.getLeft())&&(o=t)}return r==i.MAX_VALUE?null:(n=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-n,this.top=r-n,new c(this.left,this.top))},h.prototype.updateBounds=function(e){for(var t,n,r,o,a,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,d=-i.MAX_VALUE,h=this.nodes,p=h.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),c>(r=g.getTop())&&(c=r),d<(o=g.getBottom())&&(d=o)}var v=new u(s,c,l-s,d-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},h.calculateBounds=function(e){for(var t,n,r,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,d=e.length,h=0;h(t=p.getLeft())&&(a=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(o=p.getBottom())&&(c=o)}return new u(a,l,s-a,c-l)},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=h},function(e,t,n){"use strict";var r,i=n(1);function o(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var o=(r=t).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return n.isInterGraph=!1,o.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,o=[],a=(o=o.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var o=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(o=1);var a=o*n[0],s=n[1]/o;n[0]a)return n[0]=r,n[1]=l,n[2]=o,n[3]=b,!1;if(io)return n[0]=s,n[1]=i,n[2]=y,n[3]=a,!1;if(ro?(n[0]=c,n[1]=d,_=!0):(n[0]=u,n[1]=l,_=!0):T===M&&(r>o?(n[0]=s,n[1]=l,_=!0):(n[0]=h,n[1]=d,_=!0)),-N===M?o>r?(n[2]=m,n[3]=b,C=!0):(n[2]=y,n[3]=v,C=!0):N===M&&(o>r?(n[2]=g,n[3]=v,C=!0):(n[2]=x,n[3]=b,C=!0)),_&&C)return!1;if(r>o?i>a?(A=this.getCardinalDirection(T,M,4),D=this.getCardinalDirection(N,M,2)):(A=this.getCardinalDirection(-T,M,3),D=this.getCardinalDirection(-N,M,1)):i>a?(A=this.getCardinalDirection(-T,M,1),D=this.getCardinalDirection(-N,M,3)):(A=this.getCardinalDirection(T,M,2),D=this.getCardinalDirection(N,M,4)),!_)switch(A){case 1:O=l,I=r+-f/M,n[0]=I,n[1]=O;break;case 2:I=h,O=i+p*M,n[0]=I,n[1]=O;break;case 3:O=d,I=r+f/M,n[0]=I,n[1]=O;break;case 4:I=c,O=i+-p*M,n[0]=I,n[1]=O}if(!C)switch(D){case 1:k=v,P=o+-E/M,n[2]=P,n[3]=k;break;case 2:P=x,k=a+w*M,n[2]=P,n[3]=k;break;case 3:k=b,P=o+E/M,n[2]=P,n[3]=k;break;case 4:P=m,k=a+-w*M,n[2]=P,n[3]=k}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var o,a,s,l,u,c,d,h=e.x,p=e.y,f=t.x,g=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(d=(o=g-p)*(l=v-m)-(a=b-y)*(s=h-f))?null:new r((s*(c=m*y-v*b)-l*(u=f*p-h*g))/d,(a*u-o*c)/d)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var c=(-l+Math.sqrt(l*l-4*s*u))/(2*s),d=(-l-Math.sqrt(l*l-4*s*u))/(2*s);return c>=0&&c<=1?[c]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),a.add(c);var d=c.getEdges();for(o=0;o-1&&u.splice(g,1)}a=new Set,l=new Map}else e=[]}return e},h.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),o=0;o=0&&t.splice(d,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,o=t[0])}return o},h.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(4),o=n(0),a=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,a,s,l,u=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*o):(a>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||u>=s[0].length))for(var c=0;ce}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),a=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),s=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),u=0;u=0;D--)if(0!==this.s[D]){for(var I=D+1;I=0;B--){if(function(e,t){return e&&t}(B0;){var H=void 0,W=void 0;for(H=N-2;H>=-1&&-1!==H;H--)if(Math.abs(o[H])<=X+U*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){o[H]=0;break}if(H===N-2)W=4;else{var q=void 0;for(q=N-1;q>=H&&q!==H;q--){var K=(q!==N?Math.abs(o[q]):0)+(q!==H+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=X+U*K){this.s[q]=0;break}}q===H?W=3:q===N-1?W=1:(W=2,H=q)}switch(H++,W){case 1:var Z=o[N-2];o[N-2]=0;for(var $=N-2;$>=H;$--){var Q=r.hypot(this.s[$],Z),J=this.s[$]/Q,ee=Z/Q;this.s[$]=Q,$!==H&&(Z=-ee*o[$-1],o[$-1]=J*o[$-1]);for(var te=0;te=this.s[H+1]);){var Ne=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=Ne,HMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),a=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),a=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),a=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),a=n(3605),s=n(9817),l=n(945);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r{var r=n(8096),i=n(2428),o=n(6449),a=n(3656),s=n(361),l=n(7167),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&l(e),p=n||c||d||h,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!u.call(e,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||f.push(v);return f}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(7237)("length");e.exports=r},7805:(e,t,n)=>{var r=n(3360),i=n(5288);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547:(e,t,n)=>{var r=n(3360),i=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733:(e,t,n)=>{var r=n(1791),i=n(5950);e.exports=function(e,t){return e&&r(t,i(t),e)}},3838:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e,t){return e&&r(t,i(t),e)}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999:(e,t,n)=>{var r=n(7217),i=n(3729),o=n(6547),a=n(4733),s=n(3838),l=n(3290),u=n(3007),c=n(2271),d=n(8948),h=n(2),p=n(3349),f=n(5861),g=n(6189),v=n(7199),y=n(5529),m=n(6449),b=n(3656),x=n(7730),w=n(3805),E=n(8440),_=n(5950),C=n(7241),T="[object Arguments]",N="[object Function]",M="[object Object]",A={};A[T]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[N]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,D,I,O,P){var k,S=1&n,L=2&n,R=4&n;if(D&&(k=O?D(t,I,O,P):D(t)),void 0!==k)return k;if(!w(t))return t;var B=m(t);if(B){if(k=g(t),!S)return u(t,k)}else{var F=f(t),z=F==N||"[object GeneratorFunction]"==F;if(b(t))return l(t,S);if(F==M||F==T||z&&!O){if(k=L||z?{}:y(t),!S)return L?d(t,s(k,t)):c(t,a(k,t))}else{if(!A[F])return O?t:{};k=v(t,F,S)}}P||(P=new r);var j=P.get(t);if(j)return j;P.set(t,k),E(t)?t.forEach((function(r){k.add(e(r,n,D,r,t,P))})):x(t)&&t.forEach((function(r,i){k.set(i,e(r,n,D,i,t,P))}));var V=B?void 0:(R?L?p:h:L?C:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(k,i,e(r,n,D,i,t,P))})),k}},9344:(e,t,n)=>{var r=n(3805),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},3599:(e,t,n)=>{var r=n(4394);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(4528),i=n(5891);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},3335:e=>{e.exports=function(e,t){return e>t}},426:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},6131:(e,t,n)=>{var r=n(2523),i=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),a=n(689),s=n(5861),l=n(6449),u=n(3656),c=n(7167),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,v,y){var m=l(e),b=l(t),x=m?h:s(e),w=b?h:s(t),E=(x=x==d?p:x)==p,_=(w=w==d?p:w)==p,C=x==w;if(C&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(C&&!E)return y||(y=new r),m||c(e)?i(e,t,n,g,v,y):o(e,t,x,n,g,v,y);if(!(1&n)){var T=E&&f.call(e,"__wrapped__"),N=_&&f.call(t,"__wrapped__");if(T||N){var M=T?e.value():e,A=N?t.value():t;return y||(y=new r),v(M,A,n,g,y)}}return!!C&&(y||(y=new r),a(e,t,n,g,v,y))}},9172:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a{e.exports=function(e){return e!=e}},5083:(e,t,n)=>{var r=n(1882),i=n(7296),o=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},6038:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),a=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903:(e,t,n)=>{var r=n(3805),i=n(5527),o=n(181),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6176:e=>{e.exports=function(e,t){return e{var r=n(909),i=n(4894);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),a=n(8586),s=n(756),l=n(7197),u=n(7797);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},5250:(e,t,n)=>{var r=n(7217),i=n(7805),o=n(6649),a=n(2824),s=n(3805),l=n(7241),u=n(4974);e.exports=function e(t,n,c,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,c,e,d,h);else{var p=d?d(u(t,l),o,l+"",t,n,h):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},2824:(e,t,n)=>{var r=n(7805),i=n(3290),o=n(1961),a=n(3007),s=n(5529),l=n(2428),u=n(6449),c=n(3693),d=n(3656),h=n(1882),p=n(3805),f=n(1331),g=n(7167),v=n(4974),y=n(9884);e.exports=function(e,t,n,m,b,x,w){var E=v(e,n),_=v(t,n),C=w.get(_);if(C)r(e,n,C);else{var T=x?x(E,_,n+"",e,t,w):void 0,N=void 0===T;if(N){var M=u(_),A=!M&&d(_),D=!M&&!A&&g(_);T=_,M||A||D?u(E)?T=E:c(E)?T=a(E):A?(N=!1,T=i(_,!0)):D?(N=!1,T=o(_,!0)):T=[]:f(_)||l(_)?(T=E,l(E)?T=y(E):p(E)&&!h(E)||(T=s(_))):N=!1}N&&(w.set(_,T),b(T,_,m,x,w),w.delete(_)),r(e,n,T)}}},6155:(e,t,n)=>{var r=n(4932),i=n(7422),o=n(5389),a=n(5128),s=n(3937),l=n(7301),u=n(3714),c=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var h=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},6001:(e,t,n)=>{var r=n(7420),i=n(631);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},7420:(e,t,n)=>{var r=n(7422),i=n(3170),o=n(1769);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5558:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},9302:(e,t,n)=>{var r=n(3488),i=n(6757),o=n(2865);e.exports=function(e,t){return o(i(e,t,r),e+"")}},3170:(e,t,n)=>{var r=n(6547),i=n(1769),o=n(361),a=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,d=c-1,h=e;null!=h&&++u{var r=n(7334),i=n(3243),o=n(3488),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},3937:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),a=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},5765:(e,t,n)=>{var r=n(8859),i=n(5325),o=n(9905),a=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var u=-1,c=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,c=o;else if(d>=200){var g=t?null:s(e);if(g)return l(g);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++u{var r=n(4932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},1234:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r{e.exports=function(e,t){return e.has(t)}},4066:(e,t,n)=>{var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),a=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736:(e,t,n)=>{var r=n(1873),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730:(e,t,n)=>{var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e{var r=n(3730);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(6547),i=n(3360);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s{var r=n(1791),i=n(4664);e.exports=function(e,t){return r(e,i(e),t)}},8948:(e,t,n)=>{var r=n(1791),i=n(6375);e.exports=function(e,t){return r(e,i(e),t)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},999:(e,t,n)=>{var r=n(9302),i=n(6800);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},5508:(e,t,n)=>{var r=n(6151),i=n(6800),o=n(7400);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t{var r=n(6545),i=n(3950),o=n(4247),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},3243:(e,t,n)=>{var r=n(6110),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f{var r=n(1873),i=n(7828),o=n(5288),a=n(5911),s=n(317),l=n(4247),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,u,d,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=l;++d{var r=n(5970),i=n(6757),o=n(2865);e.exports=function(e){return o(i(e,void 0,r),e+"")}},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},3349:(e,t,n)=>{var r=n(2199),i=n(6375),o=n(7241);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},8879:(e,t,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},6375:(e,t,n)=>{var r=n(4528),i=n(8879),o=n(4664),a=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),a=n(6545),s=n(8303),l=n(2552),u=n(7473),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),v=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case v:return c;case y:return d;case m:return h;case b:return p}return t}),e.exports=x},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),a=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199:(e,t,n)=>{var r=n(9653),i=n(6169),o=n(3201),a=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},5529:(e,t,n)=>{var r=n(9344),i=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5891:(e,t,n)=>{var r=n(1873),i=n(2428),o=n(6449),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(5288),i=n(4894),o=n(361),a=n(3805);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586:(e,t,n)=>{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},6757:(e,t,n)=>{var r=n(1033),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},4974:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2865:(e,t,n)=>{var r=n(9570),i=n(1811)(r);e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6959:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r{var r=n(9811),i=n(9698),o=n(7927);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",c=u+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*",d="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+d+c,"g");e.exports=function(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}},2629:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,4)}},8055:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,5)}},7334:e=>{e.exports=function(e){return function(){return e}}},4684:(e,t,n)=>{var r=n(9302),i=n(5288),o=n(6800),a=n(7241),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n{e.exports=n(9754)},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},5970:(e,t,n)=>{var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},9754:(e,t,n)=>{var r=n(3729),i=n(909),o=n(4066),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},2420:(e,t,n)=>{var r=n(6649),i=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},1448:(e,t,n)=>{var r=n(426),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3693:(e,t,n)=>{var r=n(4894),i=n(346);e.exports=function(e){return i(e)&&r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},2193:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(2428),a=n(6449),s=n(4894),l=n(3656),u=n(5527),c=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:(e,t,n)=>{var r=n(9172),i=n(7301),o=n(6009),a=o&&o.isMap,s=a?i(a):r;e.exports=s},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1331:(e,t,n)=>{var r=n(2552),i=n(8879),o=n(346),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},8440:(e,t,n)=>{var r=n(6038),i=n(7301),o=n(6009),a=o&&o.isSet,s=a?i(a):r;e.exports=s},5015:(e,t,n)=>{var r=n(2552),i=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},2216:e=>{e.exports=function(e){return void 0===e}},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},7241:(e,t,n)=>{var r=n(695),i=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):i(e)}},8090:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:(e,t,n)=>{var r=n(4932),i=n(5389),o=n(5128),a=n(6449);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},3916:(e,t,n)=>{var r=n(3360),i=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},4506:(e,t,n)=>{var r=n(3599),i=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},5364:(e,t,n)=>{var r=n(5250),i=n(999)((function(e,t,n){r(e,t,n)}));e.exports=i},1684:(e,t,n)=>{var r=n(3599),i=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6533:(e,t,n)=>{var r=n(3599),i=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3950:e=>{e.exports=function(){}},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},4383:(e,t,n)=>{var r=n(6001),i=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),a=n(7797);e.exports=function(e){return o(e)?r(a(e)):i(e)}},3181:(e,t,n)=>{var r=n(5508)();e.exports=r},860:(e,t,n)=>{var r=n(882),i=n(909),o=n(5389),a=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},7091:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(4894),a=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031:(e,t,n)=>{var r=n(3120),i=n(6155),o=n(9302),a=n(6800),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9884:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e){return r(e,i(e))}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752:(e,t,n)=>{var r=n(3729),i=n(9344),o=n(641),a=n(5389),s=n(8879),l=n(6449),u=n(3656),c=n(1882),d=n(3805),h=n(7167);e.exports=function(e,t,n){var p=l(e),f=p||u(e)||h(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=f?p?new g:[]:d(e)&&c(g)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},299:(e,t,n)=>{var r=n(3120),i=n(9302),o=n(5765),a=n(3693),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},7200:(e,t,n)=>{var r=n(3222),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5880:(e,t,n)=>{var r=n(514),i=n(5950);e.exports=function(e){return null==e?[]:r(e,i(e))}},7248:(e,t,n)=>{var r=n(6547),i=n(1234);e.exports=function(e,t){return i(e||[],t||[],r)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(4497)})())); \ No newline at end of file diff --git a/package.json b/package.json index f3df7d1..f6a30c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nr-cytoscape-expand-collapse", - "version": "1.0.0", + "version": "1.0.1", "description": "This extension provides an interface to expand-collapse nodes", "main": "./src/index.js", "spm": { diff --git a/src/index.js b/src/index.js index e90a515..68c47a3 100644 --- a/src/index.js +++ b/src/index.js @@ -522,8 +522,9 @@ const targetElement = document.querySelector( ".map.__________cytoscape_container" ); + const supportMapElement = document.getElementById("support-map"); - if (targetElement) { + if (targetElement && !supportMapElement) { // Create a new div element const newElement = document.createElement("div"); @@ -539,8 +540,6 @@ newElement, targetElement.nextSibling ); - } else { - console.log("Element not found"); } var options = getScratch(cy, "options") || { From 405835cd0ac7bf5e6645aac6e7bc64eddc5b58ec Mon Sep 17 00:00:00 2001 From: Nidhish Reddy Date: Thu, 26 Dec 2024 16:09:32 +0530 Subject: [PATCH 4/5] chore: refactor layoutUtilities.js --- nr-cytoscape-expand-collapse.js | 2 +- package.json | 2 +- src/layoutUtilities.js | 16 ++++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/nr-cytoscape-expand-collapse.js b/nr-cytoscape-expand-collapse.js index 89a6977..91c9101 100644 --- a/nr-cytoscape-expand-collapse.js +++ b/nr-cytoscape-expand-collapse.js @@ -1,2 +1,2 @@ /*! For license information please see nr-cytoscape-expand-collapse.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.nrCytoscapeExpandCollapse=t():e.nrCytoscapeExpandCollapse=t()}(this,(()=>(()=>{var e={6078:e=>{var t={equalBoundingBoxes:function(e,t){return e.x1==t.x1&&e.x2==t.x2&&e.y1==t.y1&&e.y2==t.y2},getUnion:function(e,t){var n={x1:Math.min(e.x1,t.x1),x2:Math.max(e.x2,t.x2),y1:Math.min(e.y1,t.y1),y2:Math.max(e.y2,t.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=t},4540:(e,t,n)=>{var r=n(3630),i=n(438);e.exports=function(e,t,o){var a,s,l=e;const u=function(){var e=t.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=t.container(),u=e.getContext("2d");l.append(e),a=n(1537)(t);var c=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}},d=r((function(){e.height=t.container().offsetHeight,e.width=t.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),r=c(l);e.style.top=-(n.top-r.top),e.style.left=-(n.left-r.left),t&&g()}),0)}),250);function h(){d()}h();var p={};function f(){return t.scratch("_cyExpandCollapse").options}function g(){var e=t.width(),n=t.height();u.clearRect(0,0,e,n),s=null}function v(e,t,n,r,i){var o=new Image(r,i);o.src=e,o.onload=()=>{u.drawImage(o,t,n,r,i)}}t.on("resize",p.eCyResize=function(){h()}),t.on("expandcollapse.clearvisualcue",(function(){s&&g()}));var y,m=null,b=null;t.on("mousedown",p.eMouseDown=function(e){m=e.renderedPosition||e.cyRenderedPosition}),t.on("mouseup",p.eMouseUp=function(e){b=e.renderedPosition||e.cyRenderedPosition}),t.on("remove","node",p.eRemove=function(e){e.target==s&&g()}),t.on("select unselect",p.eSelect=function(){s&&g();var e=t.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),r=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||r){var i,o=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var d=t.zoom()<1?l/(2*t.zoom()):l/2,h=parseFloat(e.css("border-width"));i={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+h+d+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+h+d+1}}else{var p=f().expandCollapseCuePosition;i="function"==typeof p?p.call(this,e):p}var g=a.convertToRenderedPosition(i),y=((l=Math.max(l,l*t.zoom()))-(c=Math.max(c,c*t.zoom())))/2,m=g.x,b=g.y,x=m-l/2,w=b-l/2,E=l;if(o&&f().expandCueImage)v(f().expandCueImage,x,w,l,l);else if(!o&&f().collapseCueImage)v(f().collapseCueImage,x,w,l,l);else{var _=u.fillStyle,C=u.lineWidth,T=u.strokeStyle;u.fillStyle="black",u.strokeStyle="black",u.ellipse(m,b,l/2,l/2,0,0,2*Math.PI),u.fill(),u.beginPath(),u.strokeStyle="white",u.lineWidth=Math.max(2.6,2.6*t.zoom()),u.moveTo(x+y,w+l/2),u.lineTo(x+c+y,w+l/2),o&&(u.moveTo(x+l/2,w+y),u.lineTo(x+l/2,w+c+y)),u.closePath(),u.stroke(),u.strokeStyle=T,u.fillStyle=_,u.lineWidth=C}e._private.data.expandcollapseRenderedStartX=x,e._private.data.expandcollapseRenderedStartY=w,e._private.data.expandcollapseRenderedCueSize=E,s=e}}(n)}}),t.on("tap",p.eTap=function(e){var n=s;if(n){var r=n.data("expandcollapseRenderedStartX"),i=n.data("expandcollapseRenderedStartY"),a=n.data("expandcollapseRenderedCueSize"),l=r+a,u=i+a,c=e.renderedPosition||e.cyRenderedPosition,d=c.x,h=c.y,p=f(),v=(p.expandCollapseCueSensitivity-1)/2;Math.abs(m.x-b.x)<5&&Math.abs(m.y-b.y)<5&&d>=r-a*v&&d<=l+a*v&&h>=i-a*v&&h<=u+a*v&&(p.undoable&&!y&&(y=t.undoRedo({defaultActions:!1})),o.isCollapsible(n)?(g(),p.undoable?y.do("collapse",{nodes:n,options:p}):o.collapse(n,p)):o.isExpandable(n)&&(g(),p.undoable?y.do("expand",{nodes:n,options:p}):o.expand(n,p)),n.selectable()&&(n.unselectify(),t.scratch("_cyExpandCollapse").selectableChanged=!0))}}),t.on("afterUndo afterRedo",p.eUndoRedo=p.eSelect),t.on("position","node",p.ePosition=i(p.eSelect,100,g)),t.on("pan zoom",p.ePosition),p.hasEventFields=!0,function(e){var n=t.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,t.scratch("_cyExpandCollapse",n)}(p)},unbind:function(){var e=u();e.hasEventFields?(t.trigger("expandcollapse.clearvisualcue"),t.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=u();e.hasEventFields?t.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(t.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(t.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},3630:e=>{var t,n,r=(t=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,r,i){var o,a,s,l,u,c,d,h,p,f=0,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(r=r<0?0:+r||0,!0===i){var y=!0;v=!1}else p=typeof(h=i),!h||"object"!=p&&"function"!=p||(y=!!i.leading,g="maxWait"in i&&t(+i.maxWait||0,r),v="trailing"in i?!!i.trailing:v);function m(t,r){r&&clearTimeout(r),a=c=d=void 0,t&&(f=n(),s=e.apply(u,o),c||a||(o=u=void 0))}function b(){var e=r-(n()-l);e<=0||e>r?m(d,a):c=setTimeout(b,e)}function x(){m(v,c)}function w(){if(o=arguments,l=n(),u=this,d=v&&(c||!y),!1===g)var t=y&&!c;else{a||y||(f=l);var i=g-(l-f),h=i<=0||i>g;h?(a&&(a=clearTimeout(a)),f=l,s=e.apply(u,o)):a||(a=setTimeout(x,i))}return h&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(b,r)),t&&(h=!0,s=e.apply(u,o)),!h||c||a||(o=u=void 0),s}return w.cancel=function(){c&&clearTimeout(c),a&&clearTimeout(a),f=0,a=c=d=void 0},w});e.exports=r},438:e=>{e.exports=function(e,t,n){let r,i=!0;return function(){const o=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,e.apply(o,a),i=!0}),t),i&&(n.apply(o,a),i=!1)}}},1537:(e,t,n)=>{const{runLayoutAsync:r}=n(8647);e.exports=function(e){return{moveNodes:function(e,t,n){var r=n?t:this.getTopMostNodes(t),i=r.not(":parent");i.positions((function(t,n){return{x:i[n].position("x")+e.x,y:i[n].position("y")+e.y}}));for(var o=0;o"group"===e.data().type)).length){const n={};(e?.scratch("_cyExpandCollapse")?.positions??[]).forEach((({nodeId:e,position:t})=>{n[e]=t})),await r(e.layout({name:"preset",fit:!1,positions:n,zoom:e.zoom(),pan:e.pan(),padding:t?.padding??50,animate:t?.animate??!0,animationDuration:t?.animationDuration??500,animationEasing:t?.animationEasing}))}e.scratch("_cyExpandCollapse").positions=null}},convertToRenderedPosition:function(t){var n=e.pan(),r=e.zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}}}},9272:(e,t,n)=>{var r=n(6078);e.exports=function(e){var t=n(1537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,r,i){if(n._private.data.collapsedChildren){var o={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var a=n._private.data.collapsedChildren;a.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,t){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,t),e.removeData("expand"));for(var n=e.children(),r=0;rs?(u+=p,c-=p):(u-=p,c+=p),e._private.data["y-before-fisheye"]>l?(d+=f,h-=f):(d-=f,h+=f);for(var g=[],v=[],y=0;yw?u:c,b=l>E?d:h,isFinite(_)&&(C=Math.min(m,b/Math.abs(_))),0!==_&&(T=Math.min(b,m*Math.abs(_))),s>w&&(C*=-1),l>E&&(T*=-1),this.fishEyeViewMoveNode(x,C,T,n,t,r,i,o)}return 0==a.length&&e.same(n)&&this.expandNodeBaseFunction(n,t,i),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],t,n,r,i,o),e},getSiblings:function(t){return null==t.parent()[0]?e.nodes(":visible").orphans().difference(t):t.siblings(":visible")},fishEyeViewMoveNode:function(t,n,r,i,o,a,s,l){var u=e.collection();t.isParent()&&(u=t.children(":visible"));var c=this;if(0==u.length){var d={x:t._private.position.x+n,y:t._private.position.y+r};o&&a?(this.animatedlyMovingNodeCount++,t.animate({position:d,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!i.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(i,o,s)}},{duration:l||1e3})):t.position(d)}else for(var h=0;h0?r.add(i):r.add(n)}return r},expandEdge:function(t){t.unselect();var n={edges:e.collection(),oldEdges:e.collection()},r=t.data("collapsedEdges");return void 0!==r&&r.length>0&&(t.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(t),e.remove(t),n.edges=e.add(r),t.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var t=this.getEdgesDistinctEndPoints(e);return 2==t.length&&t},getEdgesDistinctEndPoints:function(e){var t=[];return e.forEach(function(e){this.containsElement(t,e.source())||t.push(e.source()),this.containsElement(t,e.target())||t.push(e.target())}.bind(this)),t},containsElement:function(e,t){for(var n=!1,r=0;r{const r=n(4726),i=n(6527),o=n(5111);e.exports=function(e){const t=e.json();let n=document.getElementById("support-map");return n.style.width=e.container().clientWidth+"px",n.style.height=e.container().clientHeight+"px",r.use(i),r.use(o),r({container:n,elements:t.elements,styleEnabled:!0,style:t.style})}},4497:(e,t,n)=>{var r;!function(){"use strict";var i=function(e){if(!e)return;var t=n(9699),r=n(4540);const i=n(3666),{runLayoutAsync:o,resolveCompoundNodesOverlap:a}=n(8647);var s=null;function l(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n.hasOwnProperty(r)&&(n[r]=t[r]);return n}function u(e){var t="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=t,e.fisheye=n}function c(e,t){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===t?n:n[t]}function d(e,t,n){c(e)[t]=n}e("core","expandCollapse",(function(e){var h=this;const p=document.querySelector(".map.__________cytoscape_container"),f=document.getElementById("support-map");if(p&&!f){const e=document.createElement("div");e.id="support-map",e.style.zIndex=-1,e.style.opacity=0,p.parentNode.insertBefore(e,p.nextSibling)}var g=c(h,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999,isGroupBy:!0};if("get"!==e){g=l(g,e);var v=function(e,t){var n={};function h(t){var r=c(e,"options");t.cueEnabled&&!r.cueEnabled?n.enableCue():!t.cueEnabled&&r.cueEnabled&&n.disableCue()}return n.setOptions=function(t){h(t),d(e,"options",t)},n.extendOptions=function(t){var n=l(c(e,"options"),t);h(n),d(e,"options",n)},n.setOption=function(t,n){var r={};r[t]=n;var i=l(c(e,"options"),r);h(i),d(e,"options",i)},n.collapse=async function(n,r){var s=this.collapsibleNodes(n);if(r?.isGroupBy){var h=i(e),p=s.map((e=>{var t=h.getElementById(e.id());return t.toggleClass("expanded",!1),t.toggleClass("cy-expand-collapse-collapsed-node",!0),t.toggleClass("collapsed",!0),t}));if(p.length){var f=h.collection(p);t.simpleCollapseGivenNodes(f);var g=c(e,"options").layoutBy;await o(h.layout({...g,animate:!1})),await a(h,{...g,animate:!1});var v=h.nodes().map((e=>({nodeId:e.id(),position:e.position()})));h.destroy(),d(e,"positions",v)}}var y=l(c(e,"options"),r);return u(y),t.collapseGivenNodes(s,y)},n.collapseRecursively=async function(t,n){var r=this.collapsibleNodes(t),i=l(c(e,"options"),n);return u(i),await this.collapse(r.union(r.descendants()),i)},n.expand=async function(n,r){if(r?.isGroupBy){var s=i(e),h=s.getElementById(n.id()),p=h._private.data.collapsedChildren;s.add(p),h.toggleClass("cy-expand-collapse-collapsed-node",!1),h.toggleClass("collapsed",!1),h.toggleClass("expanded",!0);var f=c(e,"options").layoutBy;await o(s.layout({...f,animate:!1})),await a(s,{...f,animate:!1});var g=s.nodes().map((e=>({nodeId:e.id(),position:e.position()})));s.destroy(),d(e,"positions",g)}var v=this.expandableNodes(n),y=l(c(e,"options"),r);return u(y),t.expandGivenNodes(v,y)},n.expandRecursively=function(n,r){var i=this.expandableNodes(n),o=l(c(e,"options"),r);return u(o),t.expandAllNodes(i,o)},n.collapseAll=async function(t){var n=l(c(e,"options"),t);return u(n),await this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(t){var n=l(c(e,"options"),t);return u(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isCollapsible(e)}))},n.expandableNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var r=e.collection();return t.getCollapsedChildrenRecursively(n,r)},n.getAllCollapsedChildrenRecursively=function(){var t,n=e.collection(),r=e.nodes(".cy-expand-collapse-collapsed-node");for(t=0;t[e,e])));var u={edges:e.collection(),oldEdges:e.collection()};return s.forEach(function(e){const n=e[1].id();var r=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(r=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),r.length>=2){var i=t.collapseGivenEdges(r,a);u.oldEdges=u.oldEdges.add(i.oldEdges),u.edges=u.edges.add(i.edges)}}.bind(this)),u},n.expandEdgesBetweenNodes=function(t){var n,r,i=e.collection(),o=(r=[],(n=t).slice(0,n.length-1).forEach((function(e,t){n.slice(t+1,n.length).forEach((function(t){r.push([e,t])}))})),r);return o.push(...t.map((e=>[e,e]))),o.forEach(function(e){const t=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+t+'"],[target = "'+t+'"]');e[0].id()===t&&(n=e[0].connectedEdges('[source = "'+t+'"][target = "'+t+'"]')),i=i.union(n)}.bind(this)),this.expandEdges(i)},n.collapseAllEdges=function(t){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),t)},n.expandAllEdges=function(){var t=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},r=this.expandEdges(t);return n.oldEdges=n.oldEdges.add(r.oldEdges),n.edges=n.edges.add(r.edges),n},n.loadJson=function(e){s.loadJson(e)},n.saveJson=function(e,t){return s.saveJson(e,t)},n}(h,n(9272)(h));s=n(554)(h,v),d(h,"api",v),t(h,v),r(g,h,v),g.cueEnabled||r("unbind",h,v),g.ready&&g.ready(),d(h,"options",g),d(h,"parentData",{})}return c(h,"api")}))};e.exports&&(e.exports=i),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r),"undefined"!=typeof cytoscape&&i(cytoscape)}()},8647:(e,t,n)=>{function r(e){return new Promise((t=>{e.on("layoutstop",t),e.run()}))}e.exports={runLayoutAsync:r,resolveCompoundNodesOverlap:async function(e,t){const i=n(1537)(e);if(e.nodes().filter((e=>"positioning-support"===e.data().type)).length)return;const o=function(e){const t={};return e.filter((e=>"default"!==e.data().type)).forEach((e=>{const n=e.data().parent;if(void 0===n)t[1]||(t[1]={root:[]}),t[1].root.push(e);else{const r=n.split("::").length+1;t[r]||(t[r]={}),t[r][n]||(t[r][n]=[]),t[r][n].push(e)}})),Object.keys(t).sort(((e,t)=>parseInt(e)-parseInt(t))).map(((e,n)=>({level:n+1,items:"1"===e?[t[e].root]:Object.values(t[e])}))).reverse()??[]}(e.nodes());for(let n=0;n{if(!t.hasClass("cy-expand-collapse-collapsed-node")&&t.isParent()){const n=`support ${t.data().id}`,r={group:"nodes",data:{id:n,parent:t.data().parent,type:"positioning-support",label:`${t.data().label}`},style:{width:t.boundingBox().w,height:t.boundingBox().h,padding:0,"min-width":0,"border-width":0,shape:"round-rectangle"},position:{x:t.position("x"),y:t.position("y")}};e.add(r);const i=t.remove();a=a.union(i);const o=e.getElementById(n);return s=s.union(o),o}return t}));l=l.union(r)}if(0===a.length&&1===o.length){const e=l.layout(t);await r(e)}else if(a.length>0){const n=l.layout(t);await r(n),a.restore(),a.forEach((t=>{if("edges"!==t.group()||"default"===t.data()?.type){const n=`support ${t.data().id}`,r=e.getElementById(n);if(r?.length){const e={x:t.position().x{e.exports=function(e,t){function n(t,i,o,a){t.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,t){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),r={layoutBy:null,animate:!1,fisheye:!1},i=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],o=0;o0?t[n](i.options):t[n](c,i.options)):(u.oldData=a(),u.nodes=n.indexOf("All")>0?t[n](r):t[n](e.collection(c),r),s=i.oldData,l={},e.nodes().not(":parent").positions((function(e,t){"number"==typeof e&&(e=t),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),u}}function l(n){var r=n.options,i=n.edges,o={};if(o.options=r,n.firstTime){var a=t.collapseEdges(i,r);o.edges=a.edges,o.oldEdges=a.oldEdges,o.firstTime=!1}else o.oldEdges=i,o.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return o}function u(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function c(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function d(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdges(n.edges);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.oldEdges=n.edges,i.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function h(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function p(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}}},7799:function(e,t,n){var r;r=function(e){return(()=>{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var o in r)i[o]=r[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),o=n(880),a=n(991),s=n(767),l=n(806),u=n(902),c=n(551).FDLayoutConstants,d=n(551).LayoutConstants,h=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,v=n(551).Integer,y=n(551).IGeometry,m=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},w.prototype.newNode=function(e){return new a(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var n=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,o=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(o)||(e.nodesInRelativeVertical.push(o),e.nodeToRelativeConstraintMapVertical.set(o,[]),e.dummyToNodeForHorizontalAlignment.has(o)?e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(o).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:t.gap})}}));else{var d=new Map,h=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var t=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;h.has(r)?h.get(r).push(i):h.set(r,[i]),h.has(i)?h.get(i).push(r):h.set(i,[r])}}));var p=function(e,t){var n=[],r=[],i=new x,o=new Set,a=0;return e.forEach((function(s,l){if(!o.has(l)){n[a]=[],r[a]=!1;var u=l;for(i.push(u),o.add(u),n[a].push(u);0!=i.length;)u=i.shift(),t.has(u)&&(r[a]=!0),e.get(u).forEach((function(e){o.has(e)||(i.push(e),o.add(e),n[a].push(e))}));a++}})),{components:n,isFixed:r}},f=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(h,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(a.y)),o=Math.floor(a.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-a.x/2,d.WORLD_CENTER_Y-a.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),o=new b;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(n.x),o.setWorldOrgY(n.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=c.indexOf(v);m>=0&&c.splice(m,1),f--,d--}h=null!=t?(c.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/d,x=h;p!=d;x=++x%f){var E=c[x].getOtherEnd(e);if(E!=t){var _=(n+p*b)%360,C=(_+b)%360;w.branchRadialLayout(E,e,_,C,i+o,o),p++}}},w.maxDiagonalInTree=function(e){for(var t=v.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),o=new a(e.graphManager);o.id=r,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=o;var s=e.getGraphManager().add(e.newGraph(),o),l=i.getChild();l.add(o);for(var u=0;ui?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):"bottom"==r.labelPosVertical&&r.setHeight(o+r.labelHeight))}}))},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,o=t.labelMarginLeft,a=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,o,a)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,o=r.paddingTop,a=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,o,a,s)}))},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=h.rect.height)}n+=c+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())}));var u,c=o/i,d=a/i,h=Math.pow(n-r,2)+4*(c+r)*(d+n)*i,p=(r-n+Math.sqrt(h))/(2*(c+r));t?(u=Math.ceil(p))==p&&u++:u=Math.floor(p);var f=u*(c+r)-r;return s>f&&(f=s),f+2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},u=function(e,t){return s(t)-s(e)};e.sort((function(e,t){var n=u;return a.idealRowWidth?(n=o)(e.id,t.id):n(e,t)}));for(var c=0,d=0,h=0;h0&&(o+=e.horizontalPadding),e.rowWidth[n]=o,e.width0&&(a+=e.verticalPadding);var s=0;a>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=a,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var o=e.rowWidth[i];if(o+e.horizontalPadding+t<=e.width)return!0;var a,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),a=e.width-o>=t+e.horizontalPadding?(e.height+l)/(o+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtho&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-o,e.rowWidth[n]=e.rowWidth[n]+o,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=r[s].height);t>0&&(a+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=a,e.rowHeight[n]0)for(var d=i;d<=o;d++)u[0]+=this.grid[d][a-1].length+this.grid[d][a].length-1;if(o0)for(d=a;d<=s;d++)u[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var h,p,f=v.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function o(e,t,n,i){r.call(this,e,t,n,i)}for(var a in o.prototype=Object.create(r.prototype),r)o[a]=r[a];o.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var o=0;r.forEach((function(e){"horizontal"==t?(d.set(e,l.has(e)?u[l.get(e)]:i.get(e)),o+=d.get(e)):(d.set(e,l.has(e)?c[l.get(e)]:i.get(e)),o+=d.get(e))})),o/=r.length,e.forEach((function(e){n.has(e)||d.set(e,o)}))}else{var a=0;e.forEach((function(e){a+="horizontal"==t?l.has(e)?u[l.get(e)]:i.get(e):l.has(e)?c[l.get(e)]:i.get(e)})),a/=e.length,e.forEach((function(e){d.set(e,a)}))}}));for(var f=function(){var r=p.shift();e.get(r).forEach((function(e){if(d.get(e.id)a&&(a=y),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!h&&v.return&&v.return()}finally{if(p)throw f}}var x=(r+a)/2-(o+s)/2,w=!0,E=!1,_=void 0;try{for(var C,T=e[Symbol.iterator]();!(w=(C=T.next()).done);w=!0){var N=C.value;d.set(N,d.get(N)+x)}}catch(e){E=!0,_=e}finally{try{!w&&T.return&&T.return()}finally{if(E)throw _}}}))}return d},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach((function(e){e.left?u[l.get(e.left)]-u[l.get(e.right)]>=0?t++:n++:c[l.get(e.top)]-c[l.get(e.bottom)]>=0?r++:i++})),t>n&&r>i)for(var o=0;on)for(var a=0;ai)for(var s=0;s1)t.fixedNodeConstraint.forEach((function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[u[l.get(e.nodeId)],c[l.get(e.nodeId)]]})),_=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach((function(e){i.add(e)}));var o,a=new Set([].concat(r(i)).filter((function(e){return T.has(e)})));o=a.size>0?u[l.get(a.values().next().value)]:g(i).x,n[t].forEach((function(t){w[e]=[o,c[l.get(t)]],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},o=0;o0?u[l.get(o.values().next().value)]:g(n).y,a[t].forEach((function(t){w[e]=[u[l.get(t)],i],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},d=0;dD&&(D=A[O].length,I=O);if(D0){var W={x:0,y:0};t.fixedNodeConstraint.forEach((function(e,t){var n,r,i=(r={x:u[l.get(e.nodeId)],y:c[l.get(e.nodeId)]},{x:(n=e.position).x-r.x,y:n.y-r.y});W.x+=i.x,W.y+=i.y})),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,u.forEach((function(e,t){u[t]+=W.x})),c.forEach((function(e,t){c[t]+=W.y})),t.fixedNodeConstraint.forEach((function(e){u[l.get(e.nodeId)]=e.position.x,c[l.get(e.nodeId)]=e.position.y}))}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var q=t.alignmentConstraint.vertical,K=function(e){var t=new Set;q[e].forEach((function(e){t.add(e)}));var n,i=new Set([].concat(r(t)).filter((function(e){return T.has(e)})));n=i.size>0?u[l.get(i.values().next().value)]:g(t).x,t.forEach((function(e){T.has(e)||(u[l.get(e)]=n)}))},Z=0;Z0?c[l.get(i.values().next().value)]:g(t).y,t.forEach((function(e){T.has(e)||(c[l.get(e)]=n)}))},J=0;J<$.length;J++)Q(J)}t.relativePlacementConstraint&&function(){var e=new Map,n=new Map,r=new Map,i=new Map,o=new Map,a=new Map,s=new Set,d=new Set;if(T.forEach((function(e){s.add(e),d.add(e)})),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var h=t.alignmentConstraint.vertical,p=function(t){r.set("dummy"+t,[]),h[t].forEach((function(n){e.set(n,"dummy"+t),r.get("dummy"+t).push(n),T.has(n)&&s.add("dummy"+t)})),o.set("dummy"+t,u[l.get(h[t][0])])},f=0;f{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(45);return r})()},e.exports=r(n(3143))},5111:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=function(e){return"function"==typeof e},o=n(2),a=n(3),s=n(4);function l(e){this.options=a({},o,e)}l.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=function(e,t){return i(t)?t.apply(e,[e]):t},a=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===a.x2&&(a.x2=a.x1+a.w),void 0===a.w&&(a.w=a.x2-a.x1),void 0===a.y2&&(a.y2=a.y1+a.h),void 0===a.h&&(a.h=a.y2-a.y1);var l=new s.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),l.setGraph(u),l.setDefaultEdgeLabel((function(){return{}})),l.setDefaultNodeLabel((function(){return{}}));var d=n.nodes();i(e.sort)&&(d=d.sort(e.sort));for(var h=0;h1?t-1:0),r=1;r{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,o={getTopMostNodes:function(e){for(var t={},n=0;n0&&u.merge(e)}));for(var c=0;c1){u=s[0],c=u.connectedEdges().length,s.forEach((function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,u=!1,c=void 0;try{for(var d,h=t.nodeIndexes[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=r(p,2),g=f[0],v=f[1],y=n.cy.getElementById(g);if(y){var m=y.boundingBox(),b=t.xCoords[v]-m.w/2,x=t.xCoords[v]+m.w/2,w=t.yCoords[v]-m.h/2,E=t.yCoords[v]+m.h/2;bo&&(o=x),ws&&(s=E)}}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}var _=e.x-(o+i)/2,C=e.y-(s+a)/2;t.xCoords=t.xCoords.map((function(e){return e+_})),t.yCoords=t.yCoords.map((function(e){return e+C}))}else{Object.keys(t).forEach((function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,u=n.getRect().y,c=n.getRect().y+n.getRect().height;ro&&(o=l),us&&(s=c)}));var T=e.x-(o+i)/2,N=e.y-(s+a)/2;Object.keys(t).forEach((function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+N)}))}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,u=void 0,c=void 0,d=void 0,h=e.descendants().not(":parent"),p=h.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),o<(u=t[r.get(g.id())]+g.width()/2)&&(o=u),a>(c=n[r.get(g.id())]-g.height()/2)&&(a=c),s<(d=n[r.get(g.id())]+g.height()/2)&&(s=d)}var v={};return v.topLeftX=i,v.topLeftY=a,v.width=o-i,v.height=s-a,v},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach((function(e){var t=!1;e.children().forEach((function(e){"none"!=e.css("display")&&(t=!0)})),t||n.merge(e)})),n}};e.exports=o},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,o=n(140).CoSENode,a=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,u=n(140).layoutBase.FDLayoutConstants,c=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,h=d.nodes(),p=d.edges(),f=void 0,g=void 0,v=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,v=t.yCoords);var m=function(e){return"function"==typeof e},b=function(e,t){return m(e)?e(t):e},x=r.calcParentsWithoutChildren(n,d);null!=e.nestingFactor&&(c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(c.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(c.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(c.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(c.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,c.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,c.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,c.TILE=e.tile,c.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1),"enforced"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1),"cose"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?c.TREE_REDUCTION_ON_INCREMENTAL=!1:c.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var u=n.length,c=0;c0&&e(i.getGraphManager().add(i.newGraph(),p),h,i,l)}}(E.addRoot(),r.getTopMostNodes(h),w,e),function(t,n,r){for(var i=0,o=0,a=0;a0?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=i/o:m(e.idealEdgeLength)?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,c.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(d){var h=o.getTopMostNodes(e.eles.nodes());if((l=o.connectComponents(t,e.eles,h)).forEach((function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),e.randomize&&l.forEach((function(t){e.eles=t,r.push(a(e))})),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,v={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach((function(e,t){0==e.edges().length&&(e.nodes().forEach((function(t,n){p.merge(e.nodes()[n]),t.isParent()||(v.nodeIndexes.set(e.nodes()[n].id(),g++),v.xCoords.push(e.nodes()[0].position().x),v.yCoords.push(e.nodes()[0].position().y))})),y.push(t))})),p.length>1){var m=p.boundingBox();u.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),l.push(p),r.push(v);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),u.splice(y[b],1)}}l.forEach((function(t,n){e.eles=t,i.push(s(e,r[n])),o.relocateComponent(u[n],i[n],e)}))}else l.forEach((function(t,n){o.relocateComponent(u[n],r[n],e)}));var x=new Set;if(l.length>1){var w=[],E=n.filter((function(e){return"none"==e.css("display")}));l.forEach((function(t,n){var a=void 0;if("draft"==e.quality&&(a=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach((function(t){if("draft"==e.quality)if(t.isParent()){var u=o.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:u.topLeftX,y:u.topLeftY,width:u.width,height:u.height})}else l=a.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})})),t.edges().forEach((function(t){var l=t.source(),u=t.target();if("none"!=l.css("display")&&"none"!=u.css("display"))if("draft"==e.quality){var c=a.get(l.id()),d=a.get(u.id()),h=[],p=[];if(l.isParent()){var f=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);h.push(f.topLeftX+f.width/2),h.push(f.topLeftY+f.height/2)}else h.push(r[n].xCoords[c]),h.push(r[n].yCoords[c]);if(u.isParent()){var g=o.calcBoundingBox(u,r[n].xCoords,r[n].yCoords,a);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[d]),p.push(r[n].yCoords[d]);s.edges.push({startX:h[0],startY:h[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][u.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][u.id()].getCenterX(),endY:i[n][u.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),x.add(n))}}));var _=c.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach((function(e,t){var n=e.xCoords.map((function(e){return e+_[t].dx})),r=e.yCoords.map((function(e){return e+_[t].dy}));e.xCoords=n,e.yCoords=r}));else{var C=0;x.forEach((function(e){Object.keys(i[e]).forEach((function(t){var n=i[e][t];n.setCenter(n.getCenterX()+_[C].dx,n.getCenterY()+_[C].dy)})),C++}))}}}else{var T=e.eles.boundingBox();if(u.push({x:T.x1+T.w/2,y:T.y1+T.h/2}),e.randomize){var N=a(e);r.push(N)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),o.relocateComponent(u[0],i[0],e)):o.relocateComponent(u[0],r[0],e)}var M=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var o=void 0,a=void 0,s=t.data("id");return i.forEach((function(e){s in e&&(o={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},a=e[s])})),e.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.labelHeight/2))),null==o&&(o={x:t.position("x"),y:t.position("y")}),{x:o.x,y:o.y}}var l=void 0;return r.forEach((function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})})),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=o.calcParentsWithoutChildren(t,n),D=n.filter((function(e){return"none"==e.css("display")}));e.eles=n.not(D),n.nodes().not(":parent").not(D).layoutPositions(this,e,M),A.length>0&&A.forEach((function(e){e.position(M(e))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=u},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,o=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,a=n.nodes(),s=n.nodes(":parent"),l=new Map,u=new Map,c=new Map,d=[],h=[],p=[],f=[],g=[],v=[],y=[],m=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,_=e.samplingType,C=e.nodeSeparation,T=void 0,N=function(e,t,n){for(var r=[],i=0,o=0,a=0,s=void 0,l=[],c=0,h=1,p=0;p=i;){a=r[i++];for(var f=d[a],y=0;yc&&(c=g[w],h=w)}return h};r.connectComponents(t,n,r.getTopMostNodes(a),l),s.forEach((function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)}));for(var M=0,A=0;A0&&(r.isParent()?d[t].push(c.get(r.id())):d[t].push(r.id()))}))}));var R=function(e){var n=u.get(e),r=void 0;l.get(e).forEach((function(i){r=t.getElementById(i).isParent()?c.get(i):i,d[n].push(r),d[u.get(r)].push(e)}))},B=!0,F=!1,z=void 0;try{for(var j,V=l.keys()[Symbol.iterator]();!(B=(j=V.next()).done);B=!0)R(j.value)}catch(e){F=!0,z=e}finally{try{!B&&V.return&&V.return()}finally{if(F)throw z}}var G=void 0;if((b=u.size)>2){T=b=1)break;u=l}for(var f=0;f=1)break;u=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(579);return r})()},e.exports=r(n(7799))},4726:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var h="undefined"==typeof window?null:window,p=h?h.navigator:null;h&&h.document;var f=r(""),g=r({}),v=r((function(){})),y="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&r(e)==f},x=function(e){return null!=e&&r(e)===v},w=function(e){return!T(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&r(e)===g&&!w(e)&&e.constructor===Object},_=function(e){return null!=e&&r(e)===r(1)&&!isNaN(e)},C=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},T=function(e){return N(e)||M(e)},N=function(e){return"collection"===m(e)&&e._private.single},M=function(e){return"collection"===m(e)&&!e._private.single},A=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},I=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},O=function(e){return function(e){return null!=e&&r(e)===g}(e)&&x(e.then)},P=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},Y=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=t||n<0||d&&e-u>=o}function g(){var e=Q();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?ye(n,o-(e-u)):n}(e))}function v(e){return s=void 0,h&&r?p(e):(r=i=void 0,a)}function y(){var e=Q(),n=f(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),c?p(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ge(t)||0,W(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ve(ge(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Q())},y},be=h?h.performance:null,xe=be&&be.now?function(){return be.now()}:function(){return Date.now()},we=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(xe())}),1e3/60)}}(),Ee=function(e){return we(e)},_e=xe,Ce=9261,Te=5381,Ne=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Me=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce)+e|0},Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Te;return(t<<5)+t+e|0},De=function(e){return 2097152*e[0]+e[1]},Ie=function(e,t){return[Me(e[0],t[0]),Ae(e[1],t[1])]},Oe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ne({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},$e=function(e){e.splice(0,e.length)},Qe=function(e,t,n){return n&&(t=L(n,t)),e[t]},Je=function(e,t,n,r){n&&(t=L(n,t)),e[t]=r},et="undefined"!=typeof Map?Map:function(){function e(){i(this,e),this._obj={}}return a(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),tt=function(){function e(t){if(i(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&A(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new nt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);in;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;og;0<=g?++h:--h)v.push(o(e,r));return v},f=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},g=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i0;){var _=y.pop(),C=g(_),T=_.id();if(d[T]=C,C!==1/0)for(var N=_.neighborhood().intersect(p),M=0;M0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},ct={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t0;){if(u=(l=g.pop()).id(),v.delete(u),w++,u===d){for(var E=[],_=i,C=d,T=m[C];E.unshift(_),null!=T&&E.unshift(T),null!=(_=y[C]);)T=m[C=_.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:w}}f[u]=!0;for(var N=l._private.edges,M=0;MM&&(p[N]=M,y[N]=T,m[N]=w),!i){var A=T*u+C;!i&&p[A]>M&&(p[A]=M,y[A]=C,m[A]=w)}}}for(var D=0;D1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},yt=Math.sqrt(2),mt=function(e,t,n){0===n.length&&Ge("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(u,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=mt(i,e,t),n--}return t},xt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/yt);if(!(i<2)){for(var l=[],u=0;u0?1:e<0?-1:0},Mt=function(e,t){return Math.sqrt(At(e,t))},At=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Dt=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},St=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Lt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Bt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=l(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ft=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},zt=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},jt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Vt=function(e,t){return jt(e,t.x1,t.y1)&&jt(e,t.x2,t.y2)},Gt=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?sn(i,o):u,d=i/2,h=o/2,p=(c=Math.min(c,d,h))!==d,f=c!==h;if(p){var g=r-h-a;if((s=en(e,t,n,r,n-d+c-a,g,n+d-c+a,g,!1)).length>0)return s}if(f){var v=n+d+a;if((s=en(e,t,n,r,v,r-h+c-a,v,r+h-c+a,!1)).length>0)return s}if(p){var y=r+h+a;if((s=en(e,t,n,r,n-d+c-a,y,n+d-c+a,y,!1)).length>0)return s}if(f){var m=n-d-a;if((s=en(e,t,n,r,m,r-h+c-a,m,r+h-c+a,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=Qt(e,t,n,r,b,x,c+a)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=Qt(e,t,n,r,w,E,c+a)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var _=n+d-c,C=r+h-c;if((l=Qt(e,t,n,r,_,C,c+a)).length>0&&l[0]>=_&&l[1]>=C)return[l[0],l[1]];var T=n-d+c,N=r+h-c;return(l=Qt(e,t,n,r,T,N,c+a)).length>0&&l[0]<=T&&l[1]>=N?[l[0],l[1]]:[]},Yt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},Ut=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(ec||th)},Xt=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f,g,v,y,m,b,x,w=[];u=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,d=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0===(l=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(l=1e-5),g=-27*(d/=l)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,(h=w)[1]=0,b=u/3,p>0?(y=(y=g+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=g-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),h[0]=-b+y+m,b+=(y+m)/2,h[4]=h[2]=-b,b=Math.sqrt(3)*(-m+y)/2,h[3]=b,h[5]=-b):(h[5]=h[3]=0,0===p?(x=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),h[0]=2*x-b,h[4]=h[2]=-(x+b)):(v=(f=-f)*f*f,v=Math.acos(g/Math.sqrt(v)),x=2*Math.sqrt(f),h[0]=-b+x*Math.cos(v/3),h[2]=-b+x*Math.cos((v+2*Math.PI)/3),h[4]=-b+x*Math.cos((v+4*Math.PI)/3)));for(var E=[],_=0;_<6;_+=2)Math.abs(w[_+1])<1e-7&&w[_]>=0&&w[_]<=1&&E.push(w[_]);E.push(1),E.push(0);for(var C,T,N,M=-1,A=0;A=0?Nl?(e-i)*(e-i)+(t-o)*(t-o):u-d},Wt=function(e,t,n){for(var r,i,o,a,s=0,l=0;l=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},qt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),p=Math.sin(-u),f=0;f0){var g=Zt(c,-l);d=Kt(g)}else d=c;return Wt(e,t,d)},Kt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},Jt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,h=t-o,p=r-t,f=s-o,g=d*h-f*u,v=c*h-p*u,y=f*c-d*p;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===g||0===v?Jt(e,n,a)===a?[a,s]:Jt(e,n,i)===i?[i,o]:Jt(i,a,n)===n?[n,r]:[]:[]},tn=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f=[],g=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y0){var m=Zt(g,-s);u=Kt(m)}else u=g}else u=n;for(var b=0;bu&&(u=t)},d=function(e){return l[e]},h=0;h0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var w=r(m);b=b.id(),h[b]>h[v]+w&&(h[b]=h[v]+w,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E0;){for(var N=n.pop(),M=0;M0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:An,a=r,s=0;s=2?Sn(e,t,n,0,On,Pn):Sn(e,t,n,0,In)},squaredEuclidean:function(e,t,n){return Sn(e,t,n,0,On)},manhattan:function(e,t,n){return Sn(e,t,n,0,In)},max:function(e,t,n){return Sn(e,t,n,-1/0,kn)}};function Rn(e,t,n,r,i,o){var a;return a=x(e)?e:Ln[e]||Ln.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}Ln["squared-euclidean"]=Ln.squaredEuclidean,Ln.squaredeuclidean=Ln.squaredEuclidean;var Bn=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Fn=function(e){return Bn(e)},zn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return Rn(e,r.length,o,(function(e){return r[e](t)}),a,s)},jn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;ln)return!1;return!0},Xn=function(e,t,n){for(var r=0;ri&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],g=t[r[a]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(o=n[g.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i=M?(A=M,M=I,D=O):I>A&&(A=I);for(var P=0;P0?1:0;C[E%u.minIterations*t+F]=z,B+=z}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var j=0,V=0;V0&&r.push(i);return r}(t,o,a),U=function(e,t,n){for(var r=lr(e,t,n),i=0;il&&(s=u,l=c)}n[i]=o[s]}return lr(e,t,n)}(t,r,Y),X={},H=0;H1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},pr=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},fr={};[ot,ut,ct,ht,ft,vt,xt,dn,pn,gn,yn,Mn,$n,or,cr,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=dr(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(l.getElementById(g.shift())),c)if(c[v].length)return h;return h.found=!0,h.trail=this.spawn(f,!0),h}},{hopcroftTarjanBiconnected:hr,htbc:hr,htb:hr,hopcroftTarjanBiconnectedComponents:hr},{tarjanStronglyConnected:pr,tsc:pr,tscc:pr,tarjanStronglyConnectedComponents:pr}].forEach((function(e){Y(fr,e)}));var gr=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};gr.prototype={fulfill:function(e){return vr(this,1,"fulfillValue",e)},reject:function(e){return vr(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new gr;return n.onFulfilled.push(br(e,r,"fulfill")),n.onRejected.push(br(t,r,"reject")),yr(n),r.proxy}};var vr=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,yr(e)),e},yr=function(e){1===e.state?mr(e,"onFulfilled",e.fulfillValue):2===e.state&&mr(e,"onRejected",e.rejectReason)},mr=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1},qr.prototype.set=function(e,t){var n=this.__data__,r=Hr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Kr=qr,Zr=zr($,"Map"),$r=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function Qr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Ti.className=Ti.classNames=Ti.classes;var Ni={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:B,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ni.variable="(?:[\\w-.]|(?:\\\\"+Ni.metaChar+"))+",Ni.className="(?:[\\w-]|(?:\\\\"+Ni.metaChar+"))+",Ni.value=Ni.string+"|"+Ni.number,Ni.id=Ni.variable,function(){var e,t,n;for(e=Ni.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Ni.comparatorOp+="|\\!"+t)}();var Mi=20,Ai=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*G(e,t)}(e.selector,t.selector)})),Di=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return Ue("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Ue("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Ue("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(i,o){return i.checks.reduce((function(a,s,l){return a+(o===i&&0===l?"$":"")+function(i,o){var a=i.type,s=i.value;switch(a){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:var u=i.field,c=i.operator;return"["+u+n(e(c))+t(s)+"]";case 5:var d=i.operator,h=i.field;return"["+e(d)+h+"]";case 4:return"["+i.field+"]";case 6:var p=i.operator;return"[["+i.field+n(e(p))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var f=r(i.left,o),g=r(i.subject,o),v=r(i.right,o);return f+(f.length>0?" ":"")+g+v;case Mi:return""}}(s,o)}),"")},i="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Ki(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],Ki)},Wi.forEachUp=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Zi)},Wi.forEachUpAndDown=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],$i)},Wi.ancestors=Wi.parents,(Ui=Xi={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_i.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_i.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ui.data,Ui.removeAttr=Ui.removeData;var Qi,Ji,eo=Xi,to={};function no(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;at})),minIndegree:ro("indegree",(function(e,t){return et})),minOutdegree:ro("outdegree",(function(e,t){return et}))}),Y(to,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},Qi.modelPosition=Qi.point=Qi.position,Qi.modelPositions=Qi.points=Qi.positions,Qi.renderedPoint=Qi.renderedPosition,Qi.relativePoint=Qi.relativePosition;var ao,so,lo=Ji;ao=so={},so.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},so.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},so.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,l),h=d.biasDiff,p=d.biasComplementDiff,f=y(i.height.val-o.h,u,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-g+o.y1+o.y2+v)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ho=function(e,t){return null==t?e:co(e,t.x1,t.y1,t.x2,t.y2)},po=function(e,t,n){return Qe(e,t,n)},fo=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Rt(u,1),co(e,u.x1,u.y1,u.x2,u.y2)}}},go=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=po(o,"labelWidth",n),p=po(o,"labelHeight",n),f=po(o,"labelX",n),g=po(o,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=p,C=h,T=C/2,N=_/2;if(m)a=f-T,s=f+T,l=g-N,u=g+N;else{switch(c.value){case"left":a=f-C,s=f;break;case"center":a=f-T,s=f+T;break;case"right":a=f,s=f+C}switch(d.value){case"top":l=g-_,u=g;break;case"center":l=g-N,u=g+N;break;case"bottom":l=g,u=g+_}}var M=v-Math.max(x,w)-E-2,A=v+Math.max(x,w)+E+2,D=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;a+=M,s+=A,l+=D,u+=I;var O=n||"main",P=i.labelBounds,k=P[O]=P[O]||{};k.x1=a,k.y1=l,k.x2=s,k.y2=u,k.w=s-a,k.h=u-l,k.leftPad=M,k.rightPad=A,k.topPad=D,k.botPad=I;var S=m&&"autorotate"===b.strValue,L=null!=b.pfValue&&0!==b.pfValue;if(S||L){var R=S?po(i.rstyle,"labelAngle",n):b.pfValue,B=Math.cos(R),F=Math.sin(R),z=(a+s)/2,j=(l+u)/2;if(!m){switch(c.value){case"left":z=s;break;case"right":z=a}switch(d.value){case"top":j=u;break;case"bottom":j=l}}var V=function(e,t){return{x:(e-=z)*B-(t-=j)*F+z,y:e*F+t*B+j}},G=V(a,l),Y=V(a,u),U=V(s,l),X=V(s,u);a=Math.min(G.x,Y.x,U.x,X.x),s=Math.max(G.x,Y.x,U.x,X.x),l=Math.min(G.y,Y.y,U.y,X.y),u=Math.max(G.y,Y.y,U.y,X.y)}var H=O+"Rot",W=P[H]=P[H]||{};W.x1=a,W.y1=l,W.x2=s,W.y2=u,W.w=s-a,W.h=u-l,co(e,a,l,s,u),co(i.labelBounds.all,a,l,s,u)}return e}},vo=function(e){var t=0,n=function(e){return(e?1:0)<0&&o>0){var a=t.pstyle("outline-offset").value,s=t.pstyle("shape").value,l=o+a,u=(e.w+2*l)/e.w,c=(e.h+2*l)/e.h,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+2.4*l)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+2.4*l)/e.w:"star"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.6*l)/e.h,d=-l/3.8):"triangle"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.4*l)/e.h,d=-l/1.4):"vee"===s&&(u=(e.w+4.4*l)/e.w,c=(e.h+3.8*l)/e.h,d=.5*-l);var h=e.h*c-e.h,p=e.w*u-e.w;if(Bt(e,[Math.ceil(h/2),Math.ceil(p/2)]),0!==d){var f=(r=d,{x1:(n=e).x1+0,x2:n.x2+0,y1:n.y1+r,y2:n.y2+r,w:n.w,h:n.h});St(e,f)}}}}(h,e)}else if(g&&t.includeEdges)if(c&&!d){var M=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),o=Math.max(v.srcY,v.midY,v.tgtY),co(h,n-=_,i-=_,r+=_,o+=_),"haystack"===M){var A=v.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var D=n;n=r,r=D}if(i>(o=A[1].y)){var I=i;i=o,o=I}co(h,n-_,i-_,r+_,o+_)}}else if("bezier"===M||"unbundled-bezier"===M||M.endsWith("segments")||M.endsWith("taxi")){var O;switch(M){case"bezier":case"unbundled-bezier":O=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=v.linePts}if(null!=O)for(var P=0;P(r=L.x)){var R=n;n=r,r=R}if((i=S.y)>(o=L.y)){var B=i;i=o,o=B}co(h,n-=_,i-=_,r+=_,o+=_)}if(c&&t.includeEdges&&g&&(fo(h,e,"mid-source"),fo(h,e,"mid-target"),fo(h,e,"source"),fo(h,e,"target")),c&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;co(h,h.x1+F,h.y1+z,h.x2+F,h.y2+z)}var j=p.bodyBounds=p.bodyBounds||{};Ft(j,h),Bt(j,y),Rt(j,1),c&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,co(h,n-E,i-E,r+E,o+E));var V=p.overlayBounds=p.overlayBounds||{};Ft(V,h),Bt(V,y),Rt(V,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=kt(),c&&t.includeLabels&&(t.includeMainLabels&&go(h,e,null),g&&(t.includeSourceLabels&&go(h,e,"source"),t.includeTargetLabels&&go(h,e,"target")))}return h.x1=uo(h.x1),h.y1=uo(h.y1),h.x2=uo(h.x2),h.y2=uo(h.y2),h.w=uo(h.x2-h.x1),h.h=uo(h.y2-h.y1),h.w>0&&h.h>0&&b&&(Bt(h,y),Rt(h,1)),h}(e,bo),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=kt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ho(n,r.overlayBounds):ho(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ho(n,r.labelBounds.all):(t.includeMainLabels&&ho(n,r.labelBounds.mainRot),t.includeSourceLabels&&ho(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ho(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},bo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},xo=vo(bo),wo=Ke(bo);so.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=kt();var n=wo(e=e||bo),r=this;if(r.cy().styleEnabled())for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:Ro,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)a(s);return this},Fo.removeAllListeners=function(){return this.removeListener("*")},Fo.emit=Fo.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,jo(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(E(e)){var o=e;i.applyBypass(this,o,r),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?i.getStylePropertyValue(a,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var o=0;o0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),da.neighbourhood=da.neighborhood,da.closedNeighbourhood=da.closedNeighborhood,da.openNeighbourhood=da.openNeighborhood,Y(da,{source:Hi((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Hi((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ga({attr:"source"}),targets:ga({attr:"target"})}),Y(da,{edgesWith:Hi(va(),"edgesWith"),edgesTo:Hi(va({thisIsSrc:!0}),"edgesTo")}),Y(da,{connectedEdges:Hi((function(e){for(var t=[],n=0;n0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),da.componentsOf=da.components;var ma=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new et,o=!1;if(t){if(t.length>0&&E(t[0])&&!N(t[0])){o=!0;for(var a=[],s=new nt,l=0,u=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u0){for(var B=e.length===i.length?i:new ma(o,e),F=0;F0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var C=0;C=.001?function(t,r){for(var i=0;i<4;++i){var o=h(r,e,n);if(0===o)return r;r-=(d(r,e,n)-t)/o}return r}(t,a):0===l?a:function(t,r,i){var o,a,s=0;do{(o=d(a=r+(i-r)/2,e,n)-t)>0?i=a:r=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+i)}(o),t,r)};f.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var g="generateBezier("+[e,t,n,r]+")";return f.toString=function(){return g},f}var Ea=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),_a=function(e,t,n,r){var i=wa(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Ca={linear:function(e,t,n){return e+(t-e)*n},ease:_a(.25,.1,.25,1),"ease-in":_a(.42,0,1,1),"ease-out":_a(0,0,.58,1),"ease-in-out":_a(.42,0,.58,1),"ease-in-sine":_a(.47,0,.745,.715),"ease-out-sine":_a(.39,.575,.565,1),"ease-in-out-sine":_a(.445,.05,.55,.95),"ease-in-quad":_a(.55,.085,.68,.53),"ease-out-quad":_a(.25,.46,.45,.94),"ease-in-out-quad":_a(.455,.03,.515,.955),"ease-in-cubic":_a(.55,.055,.675,.19),"ease-out-cubic":_a(.215,.61,.355,1),"ease-in-out-cubic":_a(.645,.045,.355,1),"ease-in-quart":_a(.895,.03,.685,.22),"ease-out-quart":_a(.165,.84,.44,1),"ease-in-out-quart":_a(.77,0,.175,1),"ease-in-quint":_a(.755,.05,.855,.06),"ease-out-quint":_a(.23,1,.32,1),"ease-in-out-quint":_a(.86,0,.07,1),"ease-in-expo":_a(.95,.05,.795,.035),"ease-out-expo":_a(.19,1,.22,1),"ease-in-out-expo":_a(1,0,0,1),"ease-in-circ":_a(.6,.04,.98,.335),"ease-out-circ":_a(.075,.82,.165,1),"ease-in-out-circ":_a(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ca.linear;var r=Ea(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":_a};function Ta(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Na(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ma(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Na(e,i),s=Na(t,i);if(_(a)&&_(s))return Ta(o,a,s,n,r);if(w(a)&&w(s)){for(var l=[],u=0;u0?("spring"===d&&h.push(a.duration),a.easingImpl=Ca[d].apply(null,h)):a.easingImpl=Ca[d]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var g=a.startPosition,v=a.position;if(v&&i&&!e.locked()){var y={};Da(g.x,v.x)&&(y.x=Ma(g.x,v.x,p,f)),Da(g.y,v.y)&&(y.y=Ma(g.y,v.y,p,f)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Da(m.x,x.x)&&(w.x=Ma(m.x,x.x,p,f)),Da(m.y,x.y)&&(w.y=Ma(m.y,x.y,p,f)),e.emit("pan"));var _=a.startZoom,C=a.zoom,T=null!=C&&r;T&&(Da(_,C)&&(o.zoom=Pt(o.minZoom,Ma(_,C,p,f),o.maxZoom)),e.emit("zoom")),(E||T)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var M=0;M=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],h=d._private;h.stopped?(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Ia(0,d,e),Aa(t,d,e,n),h.applying&&(h.applying=!1),u(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Pa={animate:_i.animate(),animation:_i.animation(),animated:_i.animated(),clearQueue:_i.clearQueue(),delay:_i.delay(),delayAnimation:_i.delayAnimation(),stop:_i.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Oa(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ee((function(n){Oa(n,e),t()}))}()}}},ka={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&N(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Sa=function(e){return b(e)?new Vi(e):e},La={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bo(ka,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Sa(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Sa(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},once:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};_i.eventAliasesOn(La);var Ra={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ra.jpeg=Ra.jpg;var Ba={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n,r=e.name,i=t.extension("layout",r);if(null!=i)return n=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(Y({},e,{cy:t,eles:n}));Ge("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Ge("A `name` must be specified to make a layout");else Ge("Layout options must be specified to make a layout")}};Ba.createLayout=Ba.makeLayout=Ba.layout;var Fa={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ja.invalidateDimensions=ja.resize;var Va={collection:function(e,t){return b(e)?this.$(e):T(e)?e.collection():w(e)?(t||(t={}),new ma(this,e,t.unique,t.removed)):new ma(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Va.elements=Va.filter=Va.$;var Ga={},Ya="t";Ga.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(h||d&&p){var f=void 0;h&&p||h?f=u.properties:p&&(f=u.mappedProperties);for(var g=0;g1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],C=i.valueMin[1],T=i.valueMax[1],N=i.valueMin[2],M=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],D=null==i.valueMax[3]?1:i.valueMax[3],I=[Math.round(w+(E-w)*v),Math.round(C+(T-C)*v),Math.round(N+(M-N)*v),Math.round(A+(D-A)*v)];n={bypass:i.bypass,name:i.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,O,i.bypass,h)}if(!n)return g(),!1;n.mapping=i,i=n;break;case a.data:for(var P=i.field.split("."),k=d.data,S=0;S0&&o>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ga.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Ga.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ga.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==t||"bezier"!==n&&"bezier"!==r||e.parallelEdges().forEach((function(e){e.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==t||"none"!==n&&"none"!==r||e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))},Ga.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ua={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;ot.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Ue("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u&&new Vi(u).invalid)Ue("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();else{var c=l[2],d=!1;n=c;for(var h=[];!n.match(/^\s*$/);){var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ue("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=p[0];var f=p[1],g=p[2];this.properties[f]?i.parse(f,g)?(h.push({name:f,val:g}),s()):(Ue("Skipping property: Invalid property definition in: "+r),s()):(Ue("Skipping property: Invalid property name in: "+r),s())}if(d){a();break}i.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var p=s.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(e,c[4]);if(!f||f.mapped)return!1;var g=this.parse(e,c[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return Ue("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(d.color){var v=f.value,y=g.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var E=[],C=[],T=[],N="",M=!1,A=0;A0?" ":"")+D.strValue}return d.validate&&!d.validate(E,C)?null:d.singleEnum&&M?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:T,strValue:N,bypass:n,units:C}}var I,O,P,S=function(){for(var r=0;rd.max||d.strictMax&&t===d.max))return null;var G={name:e,value:t,strValue:""+t+(L||""),units:L,bypass:n};return d.unitless||"px"!==L&&"em"!==L?G.pfValue=t:G.pfValue="px"!==L&&L?this.getEmSizeInPixels()*t:t,"ms"!==L&&"s"!==L||(G.pfValue="ms"===L?t:1e3*t),"deg"!==L&&"rad"!==L||(G.pfValue="rad"===L?t:(I=t,Math.PI*I/180)),"%"===L&&(G.pfValue=t/100),G}if(d.propList){var Y=[],X=""+t;if("none"===X);else{for(var H=X.split(/\s*,\s*|\s+/),W=0;W255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(P)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+j+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[a,s,l,o]}return t}(P);return K?{name:e,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var Z=S();if(Z)return Z}for(var $=d.regexes?d.regexes:[d.regex],Q=0;Q<$.length;Q++){var J=new RegExp($[Q]).exec(t);if(J)return{name:e,value:d.singleRegexMatchValue?J[1]:J,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?S():null};var $a=function e(t){if(!(this instanceof e))return new e(t);A(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Ge("A style must have a core reference")},Qa=$a.prototype;Qa.instanceString=function(){return"style"},Qa.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),_(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=wt(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;_(l.x)&&(t.pan.x=l.x,a=!1),_(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else T(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};es.centre=es.center,es.autolockNodes=es.autolock,es.autoungrabifyNodes=es.autoungrabify;var ts={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ts.attr=ts.data,ts.removeAttr=ts.removeData;var ns=function(e){var t=this,n=(e=Y({},e)).container;n&&!C(n)&&C(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=Y({name:o?"grid":"null"},a.layout),a.renderer=Y({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new ma(this),listeners:[],aniEles:new ma(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:_(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&_(a.pan.x)?a.pan.x:0,y:E(a.pan)&&_(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=Y({},a,a.renderer);t.initRenderer(u),function(e,t){if(e.some(O))return wr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=Y({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e0,u=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(T(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d0;){var P=D.shift(),k=A(P,I);if(k)P.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(O);else if(null===k){Ue("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}M();var S=0;if(n.avoidOverlap)for(var L=0;L0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:q+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:q+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var us={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cs(e){this.options=Y({},us,e)}cs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h1&&t.avoidOverlap){d*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(v*v+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var ds,hs={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ps(e){this.options=Y({},hs,e)}ps.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d0&&Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m)),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,_)}for(var C=0,T=0;T1&&t.avoidOverlap){var D=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(D*D+I*I));C=Math.max(O,C)}N.r=C,C+=w}if(t.equidistant){for(var P=0,k=0,S=0;S=e.numIter||(Es(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature=e.animationThreshold&&o(),Ee(t)):(Ss(r,e),s())}();else{for(;u;)u=a(l),l++;Ss(r,e),s()}return this},gs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},gs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vs=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u0)for(a.graphSet.push(E),u=0;ur.count?0:r.graph},ms=function e(t,n,r,i){var o=i.graphSet[r];if(-10)var s=(u=r.nodeOverlap*a)*i/(g=Math.sqrt(i*i+o*o)),l=u*o/g;else{var u,c=Ms(e,i,o),d=Ms(t,-1*i,-1*o),h=d.x-c.x,p=d.y-c.y,f=h*h+p*p,g=Math.sqrt(f);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/f)*h/g,l=u*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ns=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ms=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0n?(u.x=r,u.y=i+o/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},As=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,g=t.gravity*h/p;c.offsetX+=f,c.offsetY+=g}}}}},Is=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},ks=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTopf&&(d+=p+t.componentSpacing,c=0,h=0,p=0)}}},Ls={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Rs(e){this.options=Y({},Ls,e)}Rs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},h=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=p)l=h,u=p;else if(null!=h&&null==p)l=h,u=Math.ceil(a/l);else if(null==h&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var f=c(),g=d();(f-1)*g>=a?c(f-1):(g-1)*f>=a&&d(g-1)}else for(;u*l=a?d(y+1):c(v+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x=u&&(O=0,I++)},k={},S=0;S(r=Ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5(r=Xt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var C=_[w],T=s.arrowShapes[n.pstyle(C.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(T.roughCollide(e,t,E,C.angle,{x:C.x,y:C.y},N,h)&&T.collide(e,t,E,C.angle,{x:C.x,y:C.y},N,h))return v(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Qe(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},C=_(g,m),T=_(g,x),N=_(y,m),M=_(y,x),A=[C.x+h,C.y+p,N.x+h,N.y+p,M.x+h,M.y+p,T.x+h,T.y+p];if(Wt(e,t,A))return v(n),!0}else if(jt(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),h=kt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),p=0;p4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,r,i){var o,a;if(e!==hl?gl(t,e,pl):((a=pl).x=-1*(o=fl).x,a.y=-1*o.y,a.nx=-1*o.nx,a.ny=-1*o.ny,a.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),gl(t,n,fl),Qs=pl.nx*fl.ny-pl.ny*fl.nx,Js=pl.nx*fl.nx-pl.ny*-fl.ny,nl=Math.asin(Math.max(-1,Math.min(1,Qs))),Math.abs(nl)<1e-6)return Zs=t.x,$s=t.y,void(il=al=0);el=1,tl=!1,Js<0?nl<0?nl=Math.PI+nl:(nl=Math.PI-nl,el=-1,tl=!0):nl>0&&(el=-1,tl=!0),al=void 0!==t.radius?t.radius:r,rl=nl/2,sl=Math.min(pl.len/2,fl.len/2),i?(ol=Math.abs(Math.cos(rl)*al/Math.sin(rl)))>sl?(ol=sl,il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))):il=al:(ol=Math.min(sl,al),il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))),cl=t.x+fl.nx*ol,dl=t.y+fl.ny*ol,Zs=cl-fl.ny*il*el,$s=dl+fl.nx*il*el,ll=t.x+pl.nx*ol,ul=t.y+pl.ny*ol,hl=t}(e,t,n,r,i),{cx:Zs,cy:$s,radius:il,startX:ll,startY:ul,stopX:cl,stopY:dl,startAngle:pl.ang+Math.PI/2*el,endAngle:fl.ang-Math.PI/2*el,counterClockwise:tl})}var ml={};function bl(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},M=N(C,E),A=N(T,_),D=!1;"auto"===v?g=Math.abs(M)>Math.abs(A)?i:r:v===l||v===s?(g=r,D=!0):v!==o&&v!==a||(g=i,D=!0);var I,O=g===r,P=O?A:M,k=O?T:C,S=Nt(k),L=!1;D&&(m||x)||!(v===s&&k<0||v===l&&k>0||v===o&&k>0||v===a&&k<0)||(P=(S*=-1)*Math.abs(P),L=!0);var R=function(e){return Math.abs(e)=Math.abs(P)},B=R(I=m?(b<0?1+b:b)*P:(b<0?P:0)+b*S),F=R(Math.abs(P)-Math.abs(I));if(!B&&!F||L)if(O){var z=u.y1+I+(f?d/2*S:0),j=u.x1,V=u.x2;n.segpts=[j,z,V,z]}else{var G=u.x1+I+(f?c/2*S:0),Y=u.y1,U=u.y2;n.segpts=[G,Y,G,U]}else if(O){var X=Math.abs(k)<=d/2,H=Math.abs(C)<=h/2;if(X){var W=(u.x1+u.x2)/2,q=u.y1,K=u.y2;n.segpts=[W,q,W,K]}else if(H){var Z=(u.y1+u.y2)/2,$=u.x1,Q=u.x2;n.segpts=[$,Z,Q,Z]}else n.segpts=[u.x1,u.y2]}else{var J=Math.abs(k)<=c/2,ee=Math.abs(T)<=p/2;if(J){var te=(u.y1+u.y2)/2,ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else if(ee){var ie=(u.x1+u.x2)/2,oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}else n.segpts=[u.x2,u.y1]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},ml.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!_(n.startX)||!_(n.startY),v=!_(n.arrowStartX)||!_(n.arrowStartY),y=!_(n.endX)||!_(n.endY),m=!_(n.arrowEndX)||!_(n.arrowEndY),b=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,x=Mt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xh.poolIndex()){var p=d;d=h,h=p}var f=s.srcPos=d.position(),g=s.tgtPos=h.position(),v=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=s.srcCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,C=s.tgtCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,T=s.tgtRs=h._private.rscratch,N=s.srcRs=d._private.rscratch;s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var M=0;M0){var H=u,W=At(H,_t(t)),q=At(H,_t(X)),K=W;q2&&At(H,{x:X[2],y:X[3]})0){var le=c,ue=At(le,_t(t)),ce=At(le,_t(se)),de=ue;ce2&&At(le,{x:se[2],y:se[3]})=u||m){c={cp:g,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=Pt(0,_,1),t=Ot(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=Pt(0,r-.001,1),o=Pt(0,r+.001,1),a=Ot(e,t,n,i),s=Ot(e,t,n,o);return Tl(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var C,T,N,M,A=0,D=r.allpts.length,I=0;I+3=u));I+=2);var O=(u-T)/C;O=Pt(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Mt(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(N,M,O),i=Tl(N,M)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},_l.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},_l.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Qe(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,d=i.width,h=i.height+(l-1)*(o-1)*u;Je(n.rstyle,"labelWidth",t,d),Je(n.rscratch,"labelWidth",t,d),Je(n.rstyle,"labelHeight",t,h),Je(n.rscratch,"labelHeight",t,h),Je(n.rscratch,"labelLineHeight",t,c)},_l.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Je(n.rscratch,e,t,r),r):Qe(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,p=[],f=/[\s\u200b]+|$/g,g=0;gc){var b,x="",w=0,E=d(v.matchAll(f));try{for(E.s();!(b=E.n()).done;){var _=b.value,C=_[0],T=v.substring(w,_.index);w=_.index+C.length;var N=0===x.length?T:x+T+C;this.calculateLabelDimensions(e,N).width<=c?x+=T+C:(x&&p.push(x),x=T+C)}}catch(e){E.e(e)}finally{E.f()}x.match(/^[\s\u200b]+$/)||p.push(x)}else p.push(v)}a("labelWrapCachedLines",p),i=a("labelWrapCachedText",p.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var M=e.pstyle("text-max-width").pfValue,A="",D=!1;if(this.calculateLabelDimensions(e,i).widthM);I++)A+=i[I],I===i.length-1&&(D=!0);return D||(A+="…"),A}return i},_l.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},_l.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window().document,i=Oe(t,e._private.labelDimsKey),o=n.labelDimCache||(n.labelDimCache=[]),a=o[i];if(null!=a)return a;var s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=r.createElement("canvas"),h=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}h.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var f=0,g=0,v=t.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var M=i(t);v&&(e.hoverData.tapholdCancelled=!0),n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(D):a.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(n=!0,a.panningEnabled()&&a.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};a.panBy(I),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),b)if(v){if(a.boxSelectionEnabled()&&M)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var P=!e.dragData.didDrag;P&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(w,{inDragLayer:!0});var k={x:0,y:0};if(_(x[0])&&_(x[1])&&(k.x+=x[0],k.y+=x[1],P)){var S=e.hoverData.dragDelta;S&&_(S[0])&&_(S[1])&&(k.x+=S[0],k.y+=S[1])}e.hoverData.draggingEles=!0,w.silentShift(k).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else v&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!M&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=_t(h),e.redrawHint("select",!0),e.redraw()):A(),b&&b.pannable()&&b.active()&&b.unactivate());return f[2]=c[0],f[3]=c[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,h=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:t,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:t,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:a[0],y:a[1]}),x=!1,t.timeStamp-w<=o.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:a[0],y:a[1]})):(b=setTimeout((function(){x||r(c,["oneclick","onetap","voneclick"],t,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),w=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(o.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:t,position:{x:a[0],y:a[1]}});"additive"===o.selectionType()||h||o.$(n).unmerge(g).unselect(),g.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=c&&c.grabbed();d(u),v&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}),!1);var C,T,N,M,A,D,I,O,P,k,S,L,R,B=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",B,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||B(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var F,z,j,V,G,Y,U,X=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},H=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",F=function(t){if(e.hasTouchStarted=!0,m(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var l=e.findContainerClientCoords();P=l[0],k=l[1],S=l[2],L=l[3],C=t.touches[0].clientX-P,T=t.touches[0].clientY-k,N=t.touches[1].clientX-P,M=t.touches[1].clientY-k,R=0<=C&&C<=S&&0<=N&&N<=S&&0<=T&&T<=L&&0<=M&&M<=L;var h=n.pan(),f=n.zoom();if(A=X(C,T,N,M),D=H(C,T,N,M),O=[((I=[(C+N)/2,(T+M)/2])[0]-h.x)/f,(I[1]-h.y)/f],D<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),b=y[0];if(null!=b&&(b.activate(),e.touchData.start=b,e.touchData.starts=y,e.nodeIsGrabbable(b))){var x=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),b.selected()?(w=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(w,{addToList:x})):c(b,{addToList:x}),s(b);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};b.emit(E("grabon")),w?w.forEach((function(e){e.emit(E("grab"))})):b.emit(E("grab"))}r(b,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==b&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var _=e.touchData.startPosition=[null,null,null,null,null,null],B=0;B=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var w=t.touches[0].clientX-P,E=t.touches[0].clientY-k,I=t.touches[1].clientX-P,S=t.touches[1].clientY-k,L=H(w,E,I,S);if(L/D>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(n&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var F=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&F===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=F,F&&F.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",j=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",V=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=h[0],u[1]=h[1]}if(t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=h[0],u[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=h[0],u[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;d(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);r(y,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),G=!1,t.timeStamp-U<=s.multiClickDebounceTime()?(Y&&clearTimeout(Y),G=!0,U=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):(Y=setTimeout((function(){G||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),U=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var p=[c[0],c[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return g[0]}return null},p=Object.keys(d),f=0;f0?u:Gt(i,o,e,t,n,r,a,s)},checkPoint:function(e,t,n,r,i,o,a,s){var l=2*(s="auto"===s?sn(r,i):s);if(qt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(qt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!Wt(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||!!$t(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!$t(e,t,l,l,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",rn(3,0)),this.generateRoundPolygon("round-triangle",rn(3,0)),this.generatePolygon("rectangle",rn(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",rn(5,0)),this.generateRoundPolygon("round-pentagon",rn(5,0)),this.generatePolygon("hexagon",rn(6,0)),this.generateRoundPolygon("round-hexagon",rn(6,0)),this.generatePolygon("heptagon",rn(7,0)),this.generateRoundPolygon("round-heptagon",rn(7,0)),this.generatePolygon("octagon",rn(8,0)),this.generateRoundPolygon("round-octagon",rn(8,0));var r=new Array(20),i=an(5,0),o=an(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*Bl)break;var v=e.deq(t,d,c);if(!(v.length>0))break;for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),i(t))}}},zl=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ze;i(this,e),this.idsByKey=new et,this.keyForId=new et,this.cachesByLvl=new et,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return a(e,[{key:"getIdsFor",value:function(e){null==e&&Ge("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new nt,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new et,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),jl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Vl=Ke({getKey:null,doesEleInvalidateKey:ze,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gl=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Vl(t);Y(n,r),n.lookup=new zl(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Yl=Gl.prototype;Yl.reasons=jl,Yl.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Yl.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Yl.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new st((function(e,t){return t.reqs-e.reqs}))},Yl.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Yl.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Tt(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,h=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var g=o.getTextureQueue(p),v=g[g.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidthr;M--)T=o.getElement(e,t,n,M,jl.downscale);N()}else{var A;if(!x&&!w&&!E)for(var D=r-1;D>=-4;D--){var I=l.get(e,D);if(I){A=I;break}}if(b(A))return o.queueElement(e,r),A;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:u,width:d,height:c,scaledLabelShown:h},v.usedWidth+=Math.ceil(d+8),v.eleCaches.push(f),l.set(e,r,f),o.checkTextureFullness(v),f},Yl.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},Yl.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ze(t,e):e.fullnessChecks++},Yl.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ze(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,$e(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ze(r,o),n.push(o),o}},Yl.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Yl.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,jl.dequeue)}}return i},Yl.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Be,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Yl.onDequeue=function(e){this.onDequeues.push(e)},Yl.offDequeue=function(e){Ze(this.onDequeues,e)},Yl.setupDequeueing=Fl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Ze(c,a)}}();var d=function(t){var i=(t=t||{}).after;!function(){if(!a){a=kt();for(var t=0;t32767||s>32767)return null;if(o*s>16e6)return null;var l=r.makeLayer(a,n);if(null!=i){var d=c.indexOf(i)+1;c.splice(d,0,l)}else(void 0===t.insert||t.insert)&&c.unshift(l);return l};if(r.skipping&&!o)return null;for(var h=null,p=e.length/1,f=!o,g=0;g=p||!Vt(h.bb,v.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||f?r.queueLayer(h,v):r.drawEleInLayer(h,v,n,t),h.eles.push(v),m[n]=h}}return s||(f?null:c)},Xl.getEleLevelForLayerLevel=function(e,t){return e},Xl.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Xl.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Xl.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},Xl.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=_e(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Xl.invalidateLayer=function(e){if(this.lastInvalidationTime=_e(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ze(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*c,m=u*c,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,C=y*_;e.translate(w,E),b(C),x(C),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(a.colorStrokeStyle(e,v[0],v[1],v[2],n),"straight-triangle"===d?a.drawEdgeTrianglePath(t,e,s.allpts):(a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")):e.lineCap="butt"}();i&&a.drawEdgeUnderlay(e,t),b(),x(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},uu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};lu.drawEdgeOverlay=uu("overlay"),lu.drawEdgeUnderlay=uu("underlay"),lu.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");o.pathCacheKey&&o.pathCacheKey===h?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=h,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&void 0!==arguments[5]?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),a?e.stroke():e.fill()}du.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Tt(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},du.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},du.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Qe(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},du.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Qe(o,"labelX",n),c=Qe(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var h,p=n?n+"-":"",f=Qe(o,"labelWidth",n),g=Qe(o,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(h=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(h),u=0,c=0),x){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue,T=0===t.pstyle("text-background-shape").strValue.indexOf("round");if(w>0||_>0&&E>0){var N=u-C;switch(b){case"left":N-=f;break;case"center":N-=f/2}var M=c-g-C,A=f+2*C,D=g+2*C;if(w>0){var I=e.fillStyle,O=t.pstyle("text-background-color").value;e.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+w*a+")",T?hu(e,N,M,A,D,2):e.fillRect(N,M,A,D),e.fillStyle=I}if(_>0&&E>0){var P=e.strokeStyle,k=e.lineWidth,S=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+S[0]+","+S[1]+","+S[2]+","+E*a+")",e.lineWidth=_,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(T?hu(e,N,M,A,D,2,"stroke"):e.strokeRect(N,M,A,D),"double"===L){var R=_/2;T?hu(e,N+R,M+R,A-2*R,D-2*R,2,"stroke"):e.strokeRect(N+R,M+R,A-2*R,D-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=k,e.strokeStyle=P}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Qe(o,"labelWrapCachedLines",n),z=Qe(o,"labelLineHeight",n),j=f/2,V=this.getLabelJustification(t);switch("auto"===V||("left"===b?"left"===V?u+=-f:"center"===V&&(u+=-j):"center"===b?"left"===V?u+=-j:"right"===V&&(u+=j):"right"===b&&("center"===V?u+=j:"right"===V&&(u+=f))),x){case"top":case"center":case"bottom":c-=(F.length-1)*z}for(var G=0;G0&&e.strokeText(F[G],u,c),e.fillText(F[G],u,c),c+=z}else B>0&&e.strokeText(d,u,c),e.fillText(d,u,c);0!==h&&(e.rotate(-h),e.translate(-s,-l))}}};var pu={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(_(d.x)&&_(d.y)&&(!s||t.visible())){var h,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:A;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,F[0],F[1],F[2],t)},H=function(e,t,n,r){var i,o=l.nodePathCache=l.nodePathCache||[],a=Pe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+G),s=o[a],u=!1;return null!=s?(i=s,u=!0,c.pathCache=i):(i=new Path2D,o[a]=c.pathCache=i),{path:i,cacheHit:u}},W=t.pstyle("shape").strValue,q=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(d.x,d.y);var K=H(r,i,W,q);h=K.path,v=K.cacheHit}var Z=function(){if(!v){var n=d;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i,G,c)}g?e.fill(h):e.fill()},$=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i,G,c)))},J=function(){var t=(N>0?N:-N)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=N>0?0:255;0!==N&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(h):e.fill())},ee=function(){if(M>0){if(e.lineWidth=M,e.lineCap=P,e.lineJoin=O,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(S),e.lineDashOffset=L;break;case"solid":case"double":e.setLineDash([])}if("center"!==k){if(e.save(),e.lineWidth*=2,"inside"===k)g?e.clip(h):e.clip();else{var t=new Path2D;t.rect(-r/2-M,-i/2-M,r+2*M,i+2*M),t.addPath(h),e.clip(t,"evenodd")}g?e.stroke(h):e.stroke(),e.restore()}else g?e.stroke(h):e.stroke();if("double"===I){e.lineWidth=M/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(h):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(B>0){if(e.lineWidth=B,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=d;g&&(n={x:0,y:0});var o=l.getNodeShape(t),a=M;"inside"===k&&(a=0),"outside"===k&&(a*=2);var s,u=(r+a+(B+V))/r,c=(i+a+(B+V))/i,h=r*u,p=i*c,f=l.nodeShapes[o].points;if(g&&(s=H(h,p,o,f).path),"ellipse"===o)l.drawEllipsePath(s||e,n.x,n.y,h,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var v=0,y=0,m=0;"round-diamond"===o?v=1.4*(a+V+B):"round-heptagon"===o?(v=1.075*(a+V+B),m=-(a/2+V+B)/35):"round-hexagon"===o?v=1.12*(a+V+B):"round-pentagon"===o?(v=1.13*(a+V+B),m=-(a/2+V+B)/15):"round-tag"===o?(v=1.12*(a+V+B),y=.07*(a/2+B+V)):"round-triangle"===o&&(v=(a+V+B)*(Math.PI/2),m=-(a+V/2+B)/Math.PI),0!==v&&(h=r*(u=(r+v)/r),["round-hexagon","round-tag"].includes(o)||(p=i*(c=(i+v)/i)));for(var b=h/2,x=p/2,w=(G="auto"===G?ln(h,p):G)+(a+B+V)/2,E=new Array(f.length/2),_=new Array(f.length/2),C=0;C0){if(r=r||n.position(),null==i||null==o){var d=n.padding();i=n.width()+2*d,o=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a,c),t.fill()}}}};pu.drawNodeOverlay=fu("overlay"),pu.drawNodeUnderlay=fu("underlay"),pu.hasPie=function(e){return(e=e[0])._private.hasPie},pu.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,g=t.pstyle("pie-"+h+"-background-opacity").value*n,v=p/100;v+d>1&&(v=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*v;0===p||d>=1||d+v>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),d+=v)}};for(var gu={getPixelRatio:function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;ia.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},C=a.prevViewport;void 0===C||_.zoom!==C.zoom||_.pan.x!==C.pan.x||_.pan.y!==C.pan.y||g&&!f||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var T=a.getCachedZSortedEles();function N(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function M(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var A=a.data.bufferContexts[a.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var D=u.contexts[a.NODE],I=a.textureCache.texture;_=a.textureCache.viewport,D.setTransform(1,0,0,1,0,0),h?N(D,0,0,_.width,_.height):D.clearRect(0,0,_.width,_.height);var O=m.core("outside-texture-bg-color").value,P=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(D,O[0],O[1],O[2],P),D.fillRect(0,0,_.width,_.height),b=l.zoom(),M(D,!1),D.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),D.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var k=l.extent(),S=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),L=a.hideEdgesOnViewport&&S,R=[];if(R[a.NODE]=!c[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,R[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),R[a.DRAG]=!c[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,R[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||R[a.NODE]){var B=h&&!R[a.NODE]&&1!==p;M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.nondrag,s,k):a.drawLayeredElements(D,T.nondrag,s,k),a.debug&&a.drawDebugPoints(D,T.nondrag),n||h||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||R[a.DRAG])&&(B=h&&!R[a.DRAG]&&1!==p,M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.drag,s,k):a.drawCachedElements(D,T.drag,s,k),a.debug&&a.drawDebugPoints(D,T.drag),n||h||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(M(D=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var F=m.core("selection-box-border-width").value/b;D.lineWidth=F,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),F>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=u.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var j=a.lastRedrawTime;if(a.showFps&&j){j=Math.round(j);var V=Math.round(1e3/j);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+j+" ms = "+V+" fps",0,20),D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(h&&1!==p){var G=u.contexts[a.NODE],Y=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],U=u.contexts[a.DRAG],X=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):N(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||R[a.NODE])&&(H(G,Y,R[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||R[a.DRAG])&&(H(U,X,R[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")}},vu={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},_u.png=function(e){return Tu(e,this.bufferCanvasImage(e),"image/png")},_u.jpg=function(e){return Tu(e,this.bufferCanvasImage(e),"image/jpeg")};var Nu=Au,Mu=Au.prototype;function Au(e){var t=this,n=t.cy.window().document;t.data={canvases:new Array(Mu.CANVAS_LAYERS),contexts:new Array(Mu.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Mu.CANVAS_LAYERS),bufferCanvases:new Array(Mu.BUFFER_COUNT),bufferContexts:new Array(Mu.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l{e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822:(e,t,n)=>{"use strict";var r=n(6857),i=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},135:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],u=i.addDummyNode(e,"border",s,n);o[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s{"use strict";var r=n(6857);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},9859:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909:(e,t,n)=>{var r=n(6857),i=n(3988),o=n(8191).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},8191:(e,t,n)=>{var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031:(e,t,n)=>{var r=n(6857),i=n(8191).Graph,o=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var u=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202:(e,t,n)=>{"use strict";var r=n(6857),i=n(6822),o=n(8209),a=n(9361),s=n(3988).normalizeRanks,l=n(2948),u=n(3988).removeEmptyRanks,c=n(6353),d=n(135),h=n(4850),p=n(1453),f=n(3776),g=n(3988),v=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new v({multigraph:!0,compound:!0}),n=N(e.graph());return t.setGraph(r.merge({},m,T(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=N(e.node(n));t.setNode(n,r.defaults(T(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=N(e.edge(n));t.setEdge(n,r.merge({},_,T(i,E),r.pick(i,C)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};g.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){u(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=g.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){f(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function T(e,t){return r.mapValues(r.pick(e,t),Number)}function N(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},6857:(e,t,n)=>{var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(9754),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),p=e.node(u);e.setParent(d,u),p.borderTop=d,e.setParent(h,u),p.borderBottom=h,r.forEach(c,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,f=i.borderTop?a:2*a,g=c!==p?1:s-l[u]+1;e.setEdge(d,c,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},8209:(e,t,n)=>{"use strict";var r=n(6857),i=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(u!==s+1){for(e.removeEdge(t),o=0,++s;s{var r=n(6857);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},3860:(e,t,n)=>{var r=n(6857);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},7860:(e,t,n)=>{var r=n(6857),i=n(8191).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6639:(e,t,n)=>{"use strict";var r=n(6857);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r{"use strict";var r=n(6857),i=n(8918),o=n(6639),a=n(4520),s=n(7860),l=n(4384),u=n(8191).Graph,c=n(3988);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new u;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var l,u=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){h(f%2?n:a,f%4>=2),s=c.buildLayerMatrix(e);var v=o(e,s);v{"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},4959:(e,t,n)=>{"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){var n,i,o,a;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(i=t,o=0,a=0,(n=e).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},4520:(e,t,n)=>{var r=n(6857),i=n(3860),o=n(4959),a=n(5169);e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,p={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==h})));var f=i(t,u);r.forEach(f,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(f,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(g,p);var v=a(g,l);if(d&&(v.vs=r.flatten([d,v.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.order+m.order)/(v.weight+2),v.weight+=2}return v}},5169:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,l=r.sortBy(a.rhs,(function(e){return-e.i})),u=[],c=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(u,l,h),r.forEach(s,(function(e){h+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,d+=e.weight,h=o(u,l,h)}));var p={vs:r.flatten(u,!0)};return d&&(p.barycenter=c/d,p.weight=d),p}},2948:(e,t,n)=>{var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,u=a[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank{"use strict";var r=n(6857),i=n(8191).Graph,o=n(3988);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,u=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===u)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(as)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var p=l[d];a[e]===e&&t{"use strict";var r=n(6857),i=n(3988),o=n(9741).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},8481:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph,o=n(8073).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(r.setNode(u,{});a(r,e){"use strict";var r=n(8073).longestPath,i=n(8481),o=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r},6860:(e,t,n)=>{"use strict";var r=n(6857),i=n(8481),o=n(8073).slack,a=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,u=n(3988).simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=g(n);)y(n,e,t,v(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==i){var d=u===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=c,e.hasEdge(a,l)){var p=e.edge(n,c).cutvalue;s+=d?-p:p}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=f(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function v(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(0,e.node(t.v),u)&&c!==m(0,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=g,c.enterEdge=v,c.exchangeEdges=y},8073:(e,t,n)=>{"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038:e=>{e.exports="0.8.5"},8362:(e,t,n)=>{var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619:(e,t,n)=>{var r=n(117);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},9276:(e,t,n)=>{var r=n(117);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},4919:(e,t,n)=>{var r=n(8905),i=n(117);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},8905:(e,t,n)=>{var r=n(117),i=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),u=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6678:(e,t,n)=>{var r=n(117),i=n(6291);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},3590:(e,t,n)=>{var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s{e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(9888)}},498:(e,t,n)=>{var r=n(9888);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423:(e,t,n)=>{var r=n(117),i=n(6454),o=n(1737);e.exports=function(e,t){var n,a=new i,s={},l=new o;function u(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},6291:(e,t,n)=>{var r=n(117);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),i[u].onStack=!1,c.push(u)}while(s!==u);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},9888:(e,t,n)=>{var r=n(117);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},1737:(e,t,n)=>{var r=n(117);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priority{"use strict";var r=n(117);e.exports=s;var i="\0",o="\0",a="";function s(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function l(e,t){e[t]?e[t]++:e[t]=1}function u(e,t){--e[t]||delete e[t]}function c(e,t,n,o){var s=""+t,l=""+n;if(!e&&s>l){var u=s;s=l,l=u}return s+a+l+a+(r.isUndefined(o)?i:o)}function d(e,t){return c(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},s.prototype.setEdge=function(){var e,t,n,i,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=c(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return o&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,l(this._preds[t],e),l(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[t],e),u(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166:(e,t,n)=>{e.exports={Graph:n(6454),version:n(4458)}},7494:(e,t,n)=>{var r=n(117),i=n(6454);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},117:(e,t,n)=>{var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458:e=>{e.exports="2.1.8"},3143:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(9);function a(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in a.prototype=Object.create(r.prototype),r)a[s]=r[s];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},a.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(13),a=n(0),s=n(16),l=n(5);function u(e,t,n,a){null==n&&null==a&&(a=t),r.call(this,a),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=a,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new o(t.x,t.y,n.width,n.height):new o}for(var c in u.prototype=Object.create(r.prototype),r)u[c]=r[c];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}})),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)})),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach((function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}})),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>a.WORLD_BOUNDARY?t=a.WORLD_BOUNDARY:t<-a.WORLD_BOUNDARY&&(t=-a.WORLD_BOUNDARY);var n=this.rect.y;n>a.WORLD_BOUNDARY?n=a.WORLD_BOUNDARY:n<-a.WORLD_BOUNDARY&&(n=-a.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";var r=n(0);function i(){}for(var o in r)i[o]=r[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(0),a=n(7),s=n(3),l=n(1),u=n(13),c=n(12),d=n(11);function h(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof a?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in h.prototype=Object.create(r.prototype),r)h[p]=r[p];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},h.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(c,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},h.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,l=0;l(e=u.getTop())&&(r=e),o>(t=u.getLeft())&&(o=t)}return r==i.MAX_VALUE?null:(n=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-n,this.top=r-n,new c(this.left,this.top))},h.prototype.updateBounds=function(e){for(var t,n,r,o,a,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,d=-i.MAX_VALUE,h=this.nodes,p=h.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),c>(r=g.getTop())&&(c=r),d<(o=g.getBottom())&&(d=o)}var v=new u(s,c,l-s,d-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},h.calculateBounds=function(e){for(var t,n,r,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,d=e.length,h=0;h(t=p.getLeft())&&(a=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(o=p.getBottom())&&(c=o)}return new u(a,l,s-a,c-l)},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=h},function(e,t,n){"use strict";var r,i=n(1);function o(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var o=(r=t).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return n.isInterGraph=!1,o.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,o=[],a=(o=o.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var o=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(o=1);var a=o*n[0],s=n[1]/o;n[0]a)return n[0]=r,n[1]=l,n[2]=o,n[3]=b,!1;if(io)return n[0]=s,n[1]=i,n[2]=y,n[3]=a,!1;if(ro?(n[0]=c,n[1]=d,_=!0):(n[0]=u,n[1]=l,_=!0):T===M&&(r>o?(n[0]=s,n[1]=l,_=!0):(n[0]=h,n[1]=d,_=!0)),-N===M?o>r?(n[2]=m,n[3]=b,C=!0):(n[2]=y,n[3]=v,C=!0):N===M&&(o>r?(n[2]=g,n[3]=v,C=!0):(n[2]=x,n[3]=b,C=!0)),_&&C)return!1;if(r>o?i>a?(A=this.getCardinalDirection(T,M,4),D=this.getCardinalDirection(N,M,2)):(A=this.getCardinalDirection(-T,M,3),D=this.getCardinalDirection(-N,M,1)):i>a?(A=this.getCardinalDirection(-T,M,1),D=this.getCardinalDirection(-N,M,3)):(A=this.getCardinalDirection(T,M,2),D=this.getCardinalDirection(N,M,4)),!_)switch(A){case 1:O=l,I=r+-f/M,n[0]=I,n[1]=O;break;case 2:I=h,O=i+p*M,n[0]=I,n[1]=O;break;case 3:O=d,I=r+f/M,n[0]=I,n[1]=O;break;case 4:I=c,O=i+-p*M,n[0]=I,n[1]=O}if(!C)switch(D){case 1:k=v,P=o+-E/M,n[2]=P,n[3]=k;break;case 2:P=x,k=a+w*M,n[2]=P,n[3]=k;break;case 3:k=b,P=o+E/M,n[2]=P,n[3]=k;break;case 4:P=m,k=a+-w*M,n[2]=P,n[3]=k}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var o,a,s,l,u,c,d,h=e.x,p=e.y,f=t.x,g=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(d=(o=g-p)*(l=v-m)-(a=b-y)*(s=h-f))?null:new r((s*(c=m*y-v*b)-l*(u=f*p-h*g))/d,(a*u-o*c)/d)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var c=(-l+Math.sqrt(l*l-4*s*u))/(2*s),d=(-l-Math.sqrt(l*l-4*s*u))/(2*s);return c>=0&&c<=1?[c]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),a.add(c);var d=c.getEdges();for(o=0;o-1&&u.splice(g,1)}a=new Set,l=new Map}else e=[]}return e},h.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),o=0;o=0&&t.splice(d,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,o=t[0])}return o},h.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(4),o=n(0),a=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,a,s,l,u=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*o):(a>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||u>=s[0].length))for(var c=0;ce}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),a=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),s=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),u=0;u=0;D--)if(0!==this.s[D]){for(var I=D+1;I=0;B--){if(function(e,t){return e&&t}(B0;){var H=void 0,W=void 0;for(H=N-2;H>=-1&&-1!==H;H--)if(Math.abs(o[H])<=X+U*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){o[H]=0;break}if(H===N-2)W=4;else{var q=void 0;for(q=N-1;q>=H&&q!==H;q--){var K=(q!==N?Math.abs(o[q]):0)+(q!==H+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=X+U*K){this.s[q]=0;break}}q===H?W=3:q===N-1?W=1:(W=2,H=q)}switch(H++,W){case 1:var Z=o[N-2];o[N-2]=0;for(var $=N-2;$>=H;$--){var Q=r.hypot(this.s[$],Z),J=this.s[$]/Q,ee=Z/Q;this.s[$]=Q,$!==H&&(Z=-ee*o[$-1],o[$-1]=J*o[$-1]);for(var te=0;te=this.s[H+1]);){var Ne=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=Ne,HMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),a=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),a=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),a=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),a=n(3605),s=n(9817),l=n(945);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r{var r=n(8096),i=n(2428),o=n(6449),a=n(3656),s=n(361),l=n(7167),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&l(e),p=n||c||d||h,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!u.call(e,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||f.push(v);return f}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(7237)("length");e.exports=r},7805:(e,t,n)=>{var r=n(3360),i=n(5288);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547:(e,t,n)=>{var r=n(3360),i=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733:(e,t,n)=>{var r=n(1791),i=n(5950);e.exports=function(e,t){return e&&r(t,i(t),e)}},3838:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e,t){return e&&r(t,i(t),e)}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999:(e,t,n)=>{var r=n(7217),i=n(3729),o=n(6547),a=n(4733),s=n(3838),l=n(3290),u=n(3007),c=n(2271),d=n(8948),h=n(2),p=n(3349),f=n(5861),g=n(6189),v=n(7199),y=n(5529),m=n(6449),b=n(3656),x=n(7730),w=n(3805),E=n(8440),_=n(5950),C=n(7241),T="[object Arguments]",N="[object Function]",M="[object Object]",A={};A[T]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[N]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,D,I,O,P){var k,S=1&n,L=2&n,R=4&n;if(D&&(k=O?D(t,I,O,P):D(t)),void 0!==k)return k;if(!w(t))return t;var B=m(t);if(B){if(k=g(t),!S)return u(t,k)}else{var F=f(t),z=F==N||"[object GeneratorFunction]"==F;if(b(t))return l(t,S);if(F==M||F==T||z&&!O){if(k=L||z?{}:y(t),!S)return L?d(t,s(k,t)):c(t,a(k,t))}else{if(!A[F])return O?t:{};k=v(t,F,S)}}P||(P=new r);var j=P.get(t);if(j)return j;P.set(t,k),E(t)?t.forEach((function(r){k.add(e(r,n,D,r,t,P))})):x(t)&&t.forEach((function(r,i){k.set(i,e(r,n,D,i,t,P))}));var V=B?void 0:(R?L?p:h:L?C:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(k,i,e(r,n,D,i,t,P))})),k}},9344:(e,t,n)=>{var r=n(3805),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},3599:(e,t,n)=>{var r=n(4394);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(4528),i=n(5891);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},3335:e=>{e.exports=function(e,t){return e>t}},426:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},6131:(e,t,n)=>{var r=n(2523),i=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),a=n(689),s=n(5861),l=n(6449),u=n(3656),c=n(7167),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,v,y){var m=l(e),b=l(t),x=m?h:s(e),w=b?h:s(t),E=(x=x==d?p:x)==p,_=(w=w==d?p:w)==p,C=x==w;if(C&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(C&&!E)return y||(y=new r),m||c(e)?i(e,t,n,g,v,y):o(e,t,x,n,g,v,y);if(!(1&n)){var T=E&&f.call(e,"__wrapped__"),N=_&&f.call(t,"__wrapped__");if(T||N){var M=T?e.value():e,A=N?t.value():t;return y||(y=new r),v(M,A,n,g,y)}}return!!C&&(y||(y=new r),a(e,t,n,g,v,y))}},9172:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a{e.exports=function(e){return e!=e}},5083:(e,t,n)=>{var r=n(1882),i=n(7296),o=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},6038:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),a=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903:(e,t,n)=>{var r=n(3805),i=n(5527),o=n(181),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6176:e=>{e.exports=function(e,t){return e{var r=n(909),i=n(4894);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),a=n(8586),s=n(756),l=n(7197),u=n(7797);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},5250:(e,t,n)=>{var r=n(7217),i=n(7805),o=n(6649),a=n(2824),s=n(3805),l=n(7241),u=n(4974);e.exports=function e(t,n,c,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,c,e,d,h);else{var p=d?d(u(t,l),o,l+"",t,n,h):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},2824:(e,t,n)=>{var r=n(7805),i=n(3290),o=n(1961),a=n(3007),s=n(5529),l=n(2428),u=n(6449),c=n(3693),d=n(3656),h=n(1882),p=n(3805),f=n(1331),g=n(7167),v=n(4974),y=n(9884);e.exports=function(e,t,n,m,b,x,w){var E=v(e,n),_=v(t,n),C=w.get(_);if(C)r(e,n,C);else{var T=x?x(E,_,n+"",e,t,w):void 0,N=void 0===T;if(N){var M=u(_),A=!M&&d(_),D=!M&&!A&&g(_);T=_,M||A||D?u(E)?T=E:c(E)?T=a(E):A?(N=!1,T=i(_,!0)):D?(N=!1,T=o(_,!0)):T=[]:f(_)||l(_)?(T=E,l(E)?T=y(E):p(E)&&!h(E)||(T=s(_))):N=!1}N&&(w.set(_,T),b(T,_,m,x,w),w.delete(_)),r(e,n,T)}}},6155:(e,t,n)=>{var r=n(4932),i=n(7422),o=n(5389),a=n(5128),s=n(3937),l=n(7301),u=n(3714),c=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var h=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},6001:(e,t,n)=>{var r=n(7420),i=n(631);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},7420:(e,t,n)=>{var r=n(7422),i=n(3170),o=n(1769);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5558:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},9302:(e,t,n)=>{var r=n(3488),i=n(6757),o=n(2865);e.exports=function(e,t){return o(i(e,t,r),e+"")}},3170:(e,t,n)=>{var r=n(6547),i=n(1769),o=n(361),a=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,d=c-1,h=e;null!=h&&++u{var r=n(7334),i=n(3243),o=n(3488),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},3937:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),a=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},5765:(e,t,n)=>{var r=n(8859),i=n(5325),o=n(9905),a=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var u=-1,c=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,c=o;else if(d>=200){var g=t?null:s(e);if(g)return l(g);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++u{var r=n(4932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},1234:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r{e.exports=function(e,t){return e.has(t)}},4066:(e,t,n)=>{var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),a=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736:(e,t,n)=>{var r=n(1873),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730:(e,t,n)=>{var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e{var r=n(3730);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(6547),i=n(3360);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s{var r=n(1791),i=n(4664);e.exports=function(e,t){return r(e,i(e),t)}},8948:(e,t,n)=>{var r=n(1791),i=n(6375);e.exports=function(e,t){return r(e,i(e),t)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},999:(e,t,n)=>{var r=n(9302),i=n(6800);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},5508:(e,t,n)=>{var r=n(6151),i=n(6800),o=n(7400);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t{var r=n(6545),i=n(3950),o=n(4247),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},3243:(e,t,n)=>{var r=n(6110),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f{var r=n(1873),i=n(7828),o=n(5288),a=n(5911),s=n(317),l=n(4247),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,u,d,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=l;++d{var r=n(5970),i=n(6757),o=n(2865);e.exports=function(e){return o(i(e,void 0,r),e+"")}},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},3349:(e,t,n)=>{var r=n(2199),i=n(6375),o=n(7241);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},8879:(e,t,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},6375:(e,t,n)=>{var r=n(4528),i=n(8879),o=n(4664),a=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),a=n(6545),s=n(8303),l=n(2552),u=n(7473),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),v=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case v:return c;case y:return d;case m:return h;case b:return p}return t}),e.exports=x},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),a=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199:(e,t,n)=>{var r=n(9653),i=n(6169),o=n(3201),a=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},5529:(e,t,n)=>{var r=n(9344),i=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5891:(e,t,n)=>{var r=n(1873),i=n(2428),o=n(6449),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(5288),i=n(4894),o=n(361),a=n(3805);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586:(e,t,n)=>{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},6757:(e,t,n)=>{var r=n(1033),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},4974:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2865:(e,t,n)=>{var r=n(9570),i=n(1811)(r);e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6959:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r{var r=n(9811),i=n(9698),o=n(7927);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",c=u+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*",d="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+d+c,"g");e.exports=function(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}},2629:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,4)}},8055:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,5)}},7334:e=>{e.exports=function(e){return function(){return e}}},4684:(e,t,n)=>{var r=n(9302),i=n(5288),o=n(6800),a=n(7241),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n{e.exports=n(9754)},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},5970:(e,t,n)=>{var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},9754:(e,t,n)=>{var r=n(3729),i=n(909),o=n(4066),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},2420:(e,t,n)=>{var r=n(6649),i=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},1448:(e,t,n)=>{var r=n(426),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3693:(e,t,n)=>{var r=n(4894),i=n(346);e.exports=function(e){return i(e)&&r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},2193:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(2428),a=n(6449),s=n(4894),l=n(3656),u=n(5527),c=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:(e,t,n)=>{var r=n(9172),i=n(7301),o=n(6009),a=o&&o.isMap,s=a?i(a):r;e.exports=s},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1331:(e,t,n)=>{var r=n(2552),i=n(8879),o=n(346),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},8440:(e,t,n)=>{var r=n(6038),i=n(7301),o=n(6009),a=o&&o.isSet,s=a?i(a):r;e.exports=s},5015:(e,t,n)=>{var r=n(2552),i=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},2216:e=>{e.exports=function(e){return void 0===e}},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},7241:(e,t,n)=>{var r=n(695),i=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):i(e)}},8090:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:(e,t,n)=>{var r=n(4932),i=n(5389),o=n(5128),a=n(6449);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},3916:(e,t,n)=>{var r=n(3360),i=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},4506:(e,t,n)=>{var r=n(3599),i=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},5364:(e,t,n)=>{var r=n(5250),i=n(999)((function(e,t,n){r(e,t,n)}));e.exports=i},1684:(e,t,n)=>{var r=n(3599),i=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6533:(e,t,n)=>{var r=n(3599),i=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3950:e=>{e.exports=function(){}},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},4383:(e,t,n)=>{var r=n(6001),i=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),a=n(7797);e.exports=function(e){return o(e)?r(a(e)):i(e)}},3181:(e,t,n)=>{var r=n(5508)();e.exports=r},860:(e,t,n)=>{var r=n(882),i=n(909),o=n(5389),a=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},7091:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(4894),a=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031:(e,t,n)=>{var r=n(3120),i=n(6155),o=n(9302),a=n(6800),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9884:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e){return r(e,i(e))}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752:(e,t,n)=>{var r=n(3729),i=n(9344),o=n(641),a=n(5389),s=n(8879),l=n(6449),u=n(3656),c=n(1882),d=n(3805),h=n(7167);e.exports=function(e,t,n){var p=l(e),f=p||u(e)||h(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=f?p?new g:[]:d(e)&&c(g)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},299:(e,t,n)=>{var r=n(3120),i=n(9302),o=n(5765),a=n(3693),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},7200:(e,t,n)=>{var r=n(3222),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5880:(e,t,n)=>{var r=n(514),i=n(5950);e.exports=function(e){return null==e?[]:r(e,i(e))}},7248:(e,t,n)=>{var r=n(6547),i=n(1234);e.exports=function(e,t){return i(e||[],t||[],r)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(4497)})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.nrCytoscapeExpandCollapse=t():e.nrCytoscapeExpandCollapse=t()}(this,(()=>(()=>{var e={6078:e=>{var t={equalBoundingBoxes:function(e,t){return e.x1==t.x1&&e.x2==t.x2&&e.y1==t.y1&&e.y2==t.y2},getUnion:function(e,t){var n={x1:Math.min(e.x1,t.x1),x2:Math.max(e.x2,t.x2),y1:Math.min(e.y1,t.y1),y2:Math.max(e.y2,t.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=t},4540:(e,t,n)=>{var r=n(3630),i=n(438);e.exports=function(e,t,o){var a,s,l=e;const u=function(){var e=t.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=t.container(),u=e.getContext("2d");l.append(e),a=n(1537)(t);var c=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}},d=r((function(){e.height=t.container().offsetHeight,e.width=t.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),r=c(l);e.style.top=-(n.top-r.top),e.style.left=-(n.left-r.left),t&&g()}),0)}),250);function h(){d()}h();var p={};function f(){return t.scratch("_cyExpandCollapse").options}function g(){var e=t.width(),n=t.height();u.clearRect(0,0,e,n),s=null}function v(e,t,n,r,i){var o=new Image(r,i);o.src=e,o.onload=()=>{u.drawImage(o,t,n,r,i)}}t.on("resize",p.eCyResize=function(){h()}),t.on("expandcollapse.clearvisualcue",(function(){s&&g()}));var y,m=null,b=null;t.on("mousedown",p.eMouseDown=function(e){m=e.renderedPosition||e.cyRenderedPosition}),t.on("mouseup",p.eMouseUp=function(e){b=e.renderedPosition||e.cyRenderedPosition}),t.on("remove","node",p.eRemove=function(e){e.target==s&&g()}),t.on("select unselect",p.eSelect=function(){s&&g();var e=t.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),r=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||r){var i,o=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var d=t.zoom()<1?l/(2*t.zoom()):l/2,h=parseFloat(e.css("border-width"));i={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+h+d+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+h+d+1}}else{var p=f().expandCollapseCuePosition;i="function"==typeof p?p.call(this,e):p}var g=a.convertToRenderedPosition(i),y=((l=Math.max(l,l*t.zoom()))-(c=Math.max(c,c*t.zoom())))/2,m=g.x,b=g.y,x=m-l/2,w=b-l/2,E=l;if(o&&f().expandCueImage)v(f().expandCueImage,x,w,l,l);else if(!o&&f().collapseCueImage)v(f().collapseCueImage,x,w,l,l);else{var _=u.fillStyle,C=u.lineWidth,T=u.strokeStyle;u.fillStyle="black",u.strokeStyle="black",u.ellipse(m,b,l/2,l/2,0,0,2*Math.PI),u.fill(),u.beginPath(),u.strokeStyle="white",u.lineWidth=Math.max(2.6,2.6*t.zoom()),u.moveTo(x+y,w+l/2),u.lineTo(x+c+y,w+l/2),o&&(u.moveTo(x+l/2,w+y),u.lineTo(x+l/2,w+c+y)),u.closePath(),u.stroke(),u.strokeStyle=T,u.fillStyle=_,u.lineWidth=C}e._private.data.expandcollapseRenderedStartX=x,e._private.data.expandcollapseRenderedStartY=w,e._private.data.expandcollapseRenderedCueSize=E,s=e}}(n)}}),t.on("tap",p.eTap=function(e){var n=s;if(n){var r=n.data("expandcollapseRenderedStartX"),i=n.data("expandcollapseRenderedStartY"),a=n.data("expandcollapseRenderedCueSize"),l=r+a,u=i+a,c=e.renderedPosition||e.cyRenderedPosition,d=c.x,h=c.y,p=f(),v=(p.expandCollapseCueSensitivity-1)/2;Math.abs(m.x-b.x)<5&&Math.abs(m.y-b.y)<5&&d>=r-a*v&&d<=l+a*v&&h>=i-a*v&&h<=u+a*v&&(p.undoable&&!y&&(y=t.undoRedo({defaultActions:!1})),o.isCollapsible(n)?(g(),p.undoable?y.do("collapse",{nodes:n,options:p}):o.collapse(n,p)):o.isExpandable(n)&&(g(),p.undoable?y.do("expand",{nodes:n,options:p}):o.expand(n,p)),n.selectable()&&(n.unselectify(),t.scratch("_cyExpandCollapse").selectableChanged=!0))}}),t.on("afterUndo afterRedo",p.eUndoRedo=p.eSelect),t.on("position","node",p.ePosition=i(p.eSelect,100,g)),t.on("pan zoom",p.ePosition),p.hasEventFields=!0,function(e){var n=t.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,t.scratch("_cyExpandCollapse",n)}(p)},unbind:function(){var e=u();e.hasEventFields?(t.trigger("expandcollapse.clearvisualcue"),t.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=u();e.hasEventFields?t.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(t.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(t.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},3630:e=>{var t,n,r=(t=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,r,i){var o,a,s,l,u,c,d,h,p,f=0,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(r=r<0?0:+r||0,!0===i){var y=!0;v=!1}else p=typeof(h=i),!h||"object"!=p&&"function"!=p||(y=!!i.leading,g="maxWait"in i&&t(+i.maxWait||0,r),v="trailing"in i?!!i.trailing:v);function m(t,r){r&&clearTimeout(r),a=c=d=void 0,t&&(f=n(),s=e.apply(u,o),c||a||(o=u=void 0))}function b(){var e=r-(n()-l);e<=0||e>r?m(d,a):c=setTimeout(b,e)}function x(){m(v,c)}function w(){if(o=arguments,l=n(),u=this,d=v&&(c||!y),!1===g)var t=y&&!c;else{a||y||(f=l);var i=g-(l-f),h=i<=0||i>g;h?(a&&(a=clearTimeout(a)),f=l,s=e.apply(u,o)):a||(a=setTimeout(x,i))}return h&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(b,r)),t&&(h=!0,s=e.apply(u,o)),!h||c||a||(o=u=void 0),s}return w.cancel=function(){c&&clearTimeout(c),a&&clearTimeout(a),f=0,a=c=d=void 0},w});e.exports=r},438:e=>{e.exports=function(e,t,n){let r,i=!0;return function(){const o=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,e.apply(o,a),i=!0}),t),i&&(n.apply(o,a),i=!1)}}},1537:(e,t,n)=>{const{runLayoutAsync:r}=n(8647);e.exports=function(e){return{moveNodes:function(e,t,n){var r=n?t:this.getTopMostNodes(t),i=r.not(":parent");i.positions((function(t,n){return{x:i[n].position("x")+e.x,y:i[n].position("y")+e.y}}));for(var o=0;o"group"===e.data().type)).length){const n={};(e?.scratch("_cyExpandCollapse")?.positions??[]).forEach((({nodeId:e,position:t})=>{n[e]=t})),await r(e.layout({name:"preset",fit:!1,positions:n,zoom:e.zoom(),pan:e.pan(),padding:t?.padding??50,animate:t?.animate??!0,animationDuration:t?.animationDuration??500,animationEasing:t?.animationEasing}))}e.scratch("_cyExpandCollapse").positions=null}},convertToRenderedPosition:function(t){var n=e.pan(),r=e.zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}}}},9272:(e,t,n)=>{var r=n(6078);e.exports=function(e){var t=n(1537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,r,i){if(n._private.data.collapsedChildren){var o={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var a=n._private.data.collapsedChildren;a.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,t){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,t),e.removeData("expand"));for(var n=e.children(),r=0;rs?(u+=p,c-=p):(u-=p,c+=p),e._private.data["y-before-fisheye"]>l?(d+=f,h-=f):(d-=f,h+=f);for(var g=[],v=[],y=0;yw?u:c,b=l>E?d:h,isFinite(_)&&(C=Math.min(m,b/Math.abs(_))),0!==_&&(T=Math.min(b,m*Math.abs(_))),s>w&&(C*=-1),l>E&&(T*=-1),this.fishEyeViewMoveNode(x,C,T,n,t,r,i,o)}return 0==a.length&&e.same(n)&&this.expandNodeBaseFunction(n,t,i),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],t,n,r,i,o),e},getSiblings:function(t){return null==t.parent()[0]?e.nodes(":visible").orphans().difference(t):t.siblings(":visible")},fishEyeViewMoveNode:function(t,n,r,i,o,a,s,l){var u=e.collection();t.isParent()&&(u=t.children(":visible"));var c=this;if(0==u.length){var d={x:t._private.position.x+n,y:t._private.position.y+r};o&&a?(this.animatedlyMovingNodeCount++,t.animate({position:d,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!i.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(i,o,s)}},{duration:l||1e3})):t.position(d)}else for(var h=0;h0?r.add(i):r.add(n)}return r},expandEdge:function(t){t.unselect();var n={edges:e.collection(),oldEdges:e.collection()},r=t.data("collapsedEdges");return void 0!==r&&r.length>0&&(t.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(t),e.remove(t),n.edges=e.add(r),t.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var t=this.getEdgesDistinctEndPoints(e);return 2==t.length&&t},getEdgesDistinctEndPoints:function(e){var t=[];return e.forEach(function(e){this.containsElement(t,e.source())||t.push(e.source()),this.containsElement(t,e.target())||t.push(e.target())}.bind(this)),t},containsElement:function(e,t){for(var n=!1,r=0;r{const r=n(4726),i=n(6527),o=n(5111);e.exports=function(e){const t=e.json();let n=document.getElementById("support-map");return n.style.width=e.container().clientWidth+"px",n.style.height=e.container().clientHeight+"px",r.use(i),r.use(o),r({container:n,elements:t.elements,styleEnabled:!0,style:t.style})}},4497:(e,t,n)=>{var r;!function(){"use strict";var i=function(e){if(!e)return;var t=n(9699),r=n(4540);const i=n(3666),{runLayoutAsync:o,resolveCompoundNodesOverlap:a}=n(8647);var s=null;function l(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n.hasOwnProperty(r)&&(n[r]=t[r]);return n}function u(e){var t="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=t,e.fisheye=n}function c(e,t){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===t?n:n[t]}function d(e,t,n){c(e)[t]=n}e("core","expandCollapse",(function(e){var h=this;const p=document.querySelector(".map.__________cytoscape_container"),f=document.getElementById("support-map");if(p&&!f){const e=document.createElement("div");e.id="support-map",e.style.zIndex=-1,e.style.opacity=0,p.parentNode.insertBefore(e,p.nextSibling)}var g=c(h,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999,isGroupBy:!0};if("get"!==e){g=l(g,e);var v=function(e,t){var n={};function h(t){var r=c(e,"options");t.cueEnabled&&!r.cueEnabled?n.enableCue():!t.cueEnabled&&r.cueEnabled&&n.disableCue()}return n.setOptions=function(t){h(t),d(e,"options",t)},n.extendOptions=function(t){var n=l(c(e,"options"),t);h(n),d(e,"options",n)},n.setOption=function(t,n){var r={};r[t]=n;var i=l(c(e,"options"),r);h(i),d(e,"options",i)},n.collapse=async function(n,r){var s=this.collapsibleNodes(n);if(r?.isGroupBy){var h=i(e),p=s.map((e=>{var t=h.getElementById(e.id());return t.toggleClass("expanded",!1),t.toggleClass("cy-expand-collapse-collapsed-node",!0),t.toggleClass("collapsed",!0),t}));if(p.length){var f=h.collection(p);t.simpleCollapseGivenNodes(f);var g=c(e,"options").layoutBy;await o(h.layout({...g,animate:!1})),await a(h,{...g,animate:!1});var v=h.nodes().map((e=>({nodeId:e.id(),position:e.position()})));h.destroy(),d(e,"positions",v)}}var y=l(c(e,"options"),r);return u(y),t.collapseGivenNodes(s,y)},n.collapseRecursively=async function(t,n){var r=this.collapsibleNodes(t),i=l(c(e,"options"),n);return u(i),await this.collapse(r.union(r.descendants()),i)},n.expand=async function(n,r){if(r?.isGroupBy){var s=i(e),h=s.getElementById(n.id()),p=h._private.data.collapsedChildren;s.add(p),h.toggleClass("cy-expand-collapse-collapsed-node",!1),h.toggleClass("collapsed",!1),h.toggleClass("expanded",!0);var f=c(e,"options").layoutBy;await o(s.layout({...f,animate:!1})),await a(s,{...f,animate:!1});var g=s.nodes().map((e=>({nodeId:e.id(),position:e.position()})));s.destroy(),d(e,"positions",g)}var v=this.expandableNodes(n),y=l(c(e,"options"),r);return u(y),t.expandGivenNodes(v,y)},n.expandRecursively=function(n,r){var i=this.expandableNodes(n),o=l(c(e,"options"),r);return u(o),t.expandAllNodes(i,o)},n.collapseAll=async function(t){var n=l(c(e,"options"),t);return u(n),await this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(t){var n=l(c(e,"options"),t);return u(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isCollapsible(e)}))},n.expandableNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var r=e.collection();return t.getCollapsedChildrenRecursively(n,r)},n.getAllCollapsedChildrenRecursively=function(){var t,n=e.collection(),r=e.nodes(".cy-expand-collapse-collapsed-node");for(t=0;t[e,e])));var u={edges:e.collection(),oldEdges:e.collection()};return s.forEach(function(e){const n=e[1].id();var r=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(r=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),r.length>=2){var i=t.collapseGivenEdges(r,a);u.oldEdges=u.oldEdges.add(i.oldEdges),u.edges=u.edges.add(i.edges)}}.bind(this)),u},n.expandEdgesBetweenNodes=function(t){var n,r,i=e.collection(),o=(r=[],(n=t).slice(0,n.length-1).forEach((function(e,t){n.slice(t+1,n.length).forEach((function(t){r.push([e,t])}))})),r);return o.push(...t.map((e=>[e,e]))),o.forEach(function(e){const t=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+t+'"],[target = "'+t+'"]');e[0].id()===t&&(n=e[0].connectedEdges('[source = "'+t+'"][target = "'+t+'"]')),i=i.union(n)}.bind(this)),this.expandEdges(i)},n.collapseAllEdges=function(t){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),t)},n.expandAllEdges=function(){var t=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},r=this.expandEdges(t);return n.oldEdges=n.oldEdges.add(r.oldEdges),n.edges=n.edges.add(r.edges),n},n.loadJson=function(e){s.loadJson(e)},n.saveJson=function(e,t){return s.saveJson(e,t)},n}(h,n(9272)(h));s=n(554)(h,v),d(h,"api",v),t(h,v),r(g,h,v),g.cueEnabled||r("unbind",h,v),g.ready&&g.ready(),d(h,"options",g),d(h,"parentData",{})}return c(h,"api")}))};e.exports&&(e.exports=i),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r),"undefined"!=typeof cytoscape&&i(cytoscape)}()},8647:(e,t,n)=>{function r(e){return new Promise((t=>{e.on("layoutstop",t),e.run()}))}e.exports={runLayoutAsync:r,resolveCompoundNodesOverlap:async function(e,t){const i=n(1537)(e);if(e.nodes().filter((e=>"positioning-support"===e.data().type)).length)return;const o=function(e){const t={};return e.filter((e=>"default"!==e.data().type)).forEach((e=>{const n=e.data().parent;if(void 0===n)t[1]||(t[1]={root:[]}),t[1].root.push(e);else{const r=n.split("::").length;t[r]||(t[r]={}),t[r][n]||(t[r][n]=[]),t[r][n].push(e)}})),Object.keys(t).sort(((e,t)=>parseInt(t)-parseInt(e))).map((e=>({level:e,items:Object.values(t[e])})))??[]}(e.nodes());for(let n=0;n{if(!t.hasClass("cy-expand-collapse-collapsed-node")&&t.isParent()){const n=`support ${t.data().id}`,r={group:"nodes",data:{id:n,parent:t.data().parent,type:"positioning-support",label:`${t.data().label}`},style:{width:t.boundingBox().w,height:t.boundingBox().h,padding:0,"min-width":0,"border-width":0,shape:"round-rectangle"},position:{x:t.position("x"),y:t.position("y")}};e.add(r);const i=t.remove();a=a.union(i);const o=e.getElementById(n);return s=s.union(o),o}return t}));l=l.union(r)}if(0===a.length&&1===o.length){const e=l.layout(t);await r(e)}else if(a.length>0){const n=l.layout(t);await r(n),a.restore(),a.forEach((t=>{if("edges"!==t.group()||"default"===t.data()?.type){const n=`support ${t.data().id}`,r=e.getElementById(n);if(r?.length){const e={x:t.position().x{e.exports=function(e,t){function n(t,i,o,a){t.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,t){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),r={layoutBy:null,animate:!1,fisheye:!1},i=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],o=0;o0?t[n](i.options):t[n](c,i.options)):(u.oldData=a(),u.nodes=n.indexOf("All")>0?t[n](r):t[n](e.collection(c),r),s=i.oldData,l={},e.nodes().not(":parent").positions((function(e,t){"number"==typeof e&&(e=t),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),u}}function l(n){var r=n.options,i=n.edges,o={};if(o.options=r,n.firstTime){var a=t.collapseEdges(i,r);o.edges=a.edges,o.oldEdges=a.oldEdges,o.firstTime=!1}else o.oldEdges=i,o.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return o}function u(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function c(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function d(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdges(n.edges);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.oldEdges=n.edges,i.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function h(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function p(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}}},7799:function(e,t,n){var r;r=function(e){return(()=>{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var o in r)i[o]=r[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),o=n(880),a=n(991),s=n(767),l=n(806),u=n(902),c=n(551).FDLayoutConstants,d=n(551).LayoutConstants,h=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,v=n(551).Integer,y=n(551).IGeometry,m=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},w.prototype.newNode=function(e){return new a(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var n=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,o=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(o)||(e.nodesInRelativeVertical.push(o),e.nodeToRelativeConstraintMapVertical.set(o,[]),e.dummyToNodeForHorizontalAlignment.has(o)?e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(o).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:t.gap})}}));else{var d=new Map,h=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var t=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;h.has(r)?h.get(r).push(i):h.set(r,[i]),h.has(i)?h.get(i).push(r):h.set(i,[r])}}));var p=function(e,t){var n=[],r=[],i=new x,o=new Set,a=0;return e.forEach((function(s,l){if(!o.has(l)){n[a]=[],r[a]=!1;var u=l;for(i.push(u),o.add(u),n[a].push(u);0!=i.length;)u=i.shift(),t.has(u)&&(r[a]=!0),e.get(u).forEach((function(e){o.has(e)||(i.push(e),o.add(e),n[a].push(e))}));a++}})),{components:n,isFixed:r}},f=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(h,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(a.y)),o=Math.floor(a.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-a.x/2,d.WORLD_CENTER_Y-a.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),o=new b;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(n.x),o.setWorldOrgY(n.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=c.indexOf(v);m>=0&&c.splice(m,1),f--,d--}h=null!=t?(c.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/d,x=h;p!=d;x=++x%f){var E=c[x].getOtherEnd(e);if(E!=t){var _=(n+p*b)%360,C=(_+b)%360;w.branchRadialLayout(E,e,_,C,i+o,o),p++}}},w.maxDiagonalInTree=function(e){for(var t=v.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),o=new a(e.graphManager);o.id=r,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=o;var s=e.getGraphManager().add(e.newGraph(),o),l=i.getChild();l.add(o);for(var u=0;ui?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):"bottom"==r.labelPosVertical&&r.setHeight(o+r.labelHeight))}}))},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,o=t.labelMarginLeft,a=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,o,a)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,o=r.paddingTop,a=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,o,a,s)}))},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=h.rect.height)}n+=c+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())}));var u,c=o/i,d=a/i,h=Math.pow(n-r,2)+4*(c+r)*(d+n)*i,p=(r-n+Math.sqrt(h))/(2*(c+r));t?(u=Math.ceil(p))==p&&u++:u=Math.floor(p);var f=u*(c+r)-r;return s>f&&(f=s),f+2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},u=function(e,t){return s(t)-s(e)};e.sort((function(e,t){var n=u;return a.idealRowWidth?(n=o)(e.id,t.id):n(e,t)}));for(var c=0,d=0,h=0;h0&&(o+=e.horizontalPadding),e.rowWidth[n]=o,e.width0&&(a+=e.verticalPadding);var s=0;a>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=a,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var o=e.rowWidth[i];if(o+e.horizontalPadding+t<=e.width)return!0;var a,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),a=e.width-o>=t+e.horizontalPadding?(e.height+l)/(o+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtho&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-o,e.rowWidth[n]=e.rowWidth[n]+o,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=r[s].height);t>0&&(a+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=a,e.rowHeight[n]0)for(var d=i;d<=o;d++)u[0]+=this.grid[d][a-1].length+this.grid[d][a].length-1;if(o0)for(d=a;d<=s;d++)u[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var h,p,f=v.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function o(e,t,n,i){r.call(this,e,t,n,i)}for(var a in o.prototype=Object.create(r.prototype),r)o[a]=r[a];o.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var o=0;r.forEach((function(e){"horizontal"==t?(d.set(e,l.has(e)?u[l.get(e)]:i.get(e)),o+=d.get(e)):(d.set(e,l.has(e)?c[l.get(e)]:i.get(e)),o+=d.get(e))})),o/=r.length,e.forEach((function(e){n.has(e)||d.set(e,o)}))}else{var a=0;e.forEach((function(e){a+="horizontal"==t?l.has(e)?u[l.get(e)]:i.get(e):l.has(e)?c[l.get(e)]:i.get(e)})),a/=e.length,e.forEach((function(e){d.set(e,a)}))}}));for(var f=function(){var r=p.shift();e.get(r).forEach((function(e){if(d.get(e.id)a&&(a=y),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!h&&v.return&&v.return()}finally{if(p)throw f}}var x=(r+a)/2-(o+s)/2,w=!0,E=!1,_=void 0;try{for(var C,T=e[Symbol.iterator]();!(w=(C=T.next()).done);w=!0){var N=C.value;d.set(N,d.get(N)+x)}}catch(e){E=!0,_=e}finally{try{!w&&T.return&&T.return()}finally{if(E)throw _}}}))}return d},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach((function(e){e.left?u[l.get(e.left)]-u[l.get(e.right)]>=0?t++:n++:c[l.get(e.top)]-c[l.get(e.bottom)]>=0?r++:i++})),t>n&&r>i)for(var o=0;on)for(var a=0;ai)for(var s=0;s1)t.fixedNodeConstraint.forEach((function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[u[l.get(e.nodeId)],c[l.get(e.nodeId)]]})),_=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach((function(e){i.add(e)}));var o,a=new Set([].concat(r(i)).filter((function(e){return T.has(e)})));o=a.size>0?u[l.get(a.values().next().value)]:g(i).x,n[t].forEach((function(t){w[e]=[o,c[l.get(t)]],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},o=0;o0?u[l.get(o.values().next().value)]:g(n).y,a[t].forEach((function(t){w[e]=[u[l.get(t)],i],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},d=0;dD&&(D=A[O].length,I=O);if(D0){var W={x:0,y:0};t.fixedNodeConstraint.forEach((function(e,t){var n,r,i=(r={x:u[l.get(e.nodeId)],y:c[l.get(e.nodeId)]},{x:(n=e.position).x-r.x,y:n.y-r.y});W.x+=i.x,W.y+=i.y})),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,u.forEach((function(e,t){u[t]+=W.x})),c.forEach((function(e,t){c[t]+=W.y})),t.fixedNodeConstraint.forEach((function(e){u[l.get(e.nodeId)]=e.position.x,c[l.get(e.nodeId)]=e.position.y}))}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var q=t.alignmentConstraint.vertical,K=function(e){var t=new Set;q[e].forEach((function(e){t.add(e)}));var n,i=new Set([].concat(r(t)).filter((function(e){return T.has(e)})));n=i.size>0?u[l.get(i.values().next().value)]:g(t).x,t.forEach((function(e){T.has(e)||(u[l.get(e)]=n)}))},Z=0;Z0?c[l.get(i.values().next().value)]:g(t).y,t.forEach((function(e){T.has(e)||(c[l.get(e)]=n)}))},J=0;J<$.length;J++)Q(J)}t.relativePlacementConstraint&&function(){var e=new Map,n=new Map,r=new Map,i=new Map,o=new Map,a=new Map,s=new Set,d=new Set;if(T.forEach((function(e){s.add(e),d.add(e)})),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var h=t.alignmentConstraint.vertical,p=function(t){r.set("dummy"+t,[]),h[t].forEach((function(n){e.set(n,"dummy"+t),r.get("dummy"+t).push(n),T.has(n)&&s.add("dummy"+t)})),o.set("dummy"+t,u[l.get(h[t][0])])},f=0;f{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(45);return r})()},e.exports=r(n(3143))},5111:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=function(e){return"function"==typeof e},o=n(2),a=n(3),s=n(4);function l(e){this.options=a({},o,e)}l.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=function(e,t){return i(t)?t.apply(e,[e]):t},a=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===a.x2&&(a.x2=a.x1+a.w),void 0===a.w&&(a.w=a.x2-a.x1),void 0===a.y2&&(a.y2=a.y1+a.h),void 0===a.h&&(a.h=a.y2-a.y1);var l=new s.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),l.setGraph(u),l.setDefaultEdgeLabel((function(){return{}})),l.setDefaultNodeLabel((function(){return{}}));var d=n.nodes();i(e.sort)&&(d=d.sort(e.sort));for(var h=0;h1?t-1:0),r=1;r{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,o={getTopMostNodes:function(e){for(var t={},n=0;n0&&u.merge(e)}));for(var c=0;c1){u=s[0],c=u.connectedEdges().length,s.forEach((function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,u=!1,c=void 0;try{for(var d,h=t.nodeIndexes[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=r(p,2),g=f[0],v=f[1],y=n.cy.getElementById(g);if(y){var m=y.boundingBox(),b=t.xCoords[v]-m.w/2,x=t.xCoords[v]+m.w/2,w=t.yCoords[v]-m.h/2,E=t.yCoords[v]+m.h/2;bo&&(o=x),ws&&(s=E)}}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}var _=e.x-(o+i)/2,C=e.y-(s+a)/2;t.xCoords=t.xCoords.map((function(e){return e+_})),t.yCoords=t.yCoords.map((function(e){return e+C}))}else{Object.keys(t).forEach((function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,u=n.getRect().y,c=n.getRect().y+n.getRect().height;ro&&(o=l),us&&(s=c)}));var T=e.x-(o+i)/2,N=e.y-(s+a)/2;Object.keys(t).forEach((function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+N)}))}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,u=void 0,c=void 0,d=void 0,h=e.descendants().not(":parent"),p=h.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),o<(u=t[r.get(g.id())]+g.width()/2)&&(o=u),a>(c=n[r.get(g.id())]-g.height()/2)&&(a=c),s<(d=n[r.get(g.id())]+g.height()/2)&&(s=d)}var v={};return v.topLeftX=i,v.topLeftY=a,v.width=o-i,v.height=s-a,v},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach((function(e){var t=!1;e.children().forEach((function(e){"none"!=e.css("display")&&(t=!0)})),t||n.merge(e)})),n}};e.exports=o},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,o=n(140).CoSENode,a=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,u=n(140).layoutBase.FDLayoutConstants,c=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,h=d.nodes(),p=d.edges(),f=void 0,g=void 0,v=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,v=t.yCoords);var m=function(e){return"function"==typeof e},b=function(e,t){return m(e)?e(t):e},x=r.calcParentsWithoutChildren(n,d);null!=e.nestingFactor&&(c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(c.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(c.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(c.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(c.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,c.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,c.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,c.TILE=e.tile,c.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1),"enforced"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1),"cose"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?c.TREE_REDUCTION_ON_INCREMENTAL=!1:c.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var u=n.length,c=0;c0&&e(i.getGraphManager().add(i.newGraph(),p),h,i,l)}}(E.addRoot(),r.getTopMostNodes(h),w,e),function(t,n,r){for(var i=0,o=0,a=0;a0?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=i/o:m(e.idealEdgeLength)?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,c.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(d){var h=o.getTopMostNodes(e.eles.nodes());if((l=o.connectComponents(t,e.eles,h)).forEach((function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),e.randomize&&l.forEach((function(t){e.eles=t,r.push(a(e))})),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,v={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach((function(e,t){0==e.edges().length&&(e.nodes().forEach((function(t,n){p.merge(e.nodes()[n]),t.isParent()||(v.nodeIndexes.set(e.nodes()[n].id(),g++),v.xCoords.push(e.nodes()[0].position().x),v.yCoords.push(e.nodes()[0].position().y))})),y.push(t))})),p.length>1){var m=p.boundingBox();u.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),l.push(p),r.push(v);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),u.splice(y[b],1)}}l.forEach((function(t,n){e.eles=t,i.push(s(e,r[n])),o.relocateComponent(u[n],i[n],e)}))}else l.forEach((function(t,n){o.relocateComponent(u[n],r[n],e)}));var x=new Set;if(l.length>1){var w=[],E=n.filter((function(e){return"none"==e.css("display")}));l.forEach((function(t,n){var a=void 0;if("draft"==e.quality&&(a=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach((function(t){if("draft"==e.quality)if(t.isParent()){var u=o.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:u.topLeftX,y:u.topLeftY,width:u.width,height:u.height})}else l=a.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})})),t.edges().forEach((function(t){var l=t.source(),u=t.target();if("none"!=l.css("display")&&"none"!=u.css("display"))if("draft"==e.quality){var c=a.get(l.id()),d=a.get(u.id()),h=[],p=[];if(l.isParent()){var f=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);h.push(f.topLeftX+f.width/2),h.push(f.topLeftY+f.height/2)}else h.push(r[n].xCoords[c]),h.push(r[n].yCoords[c]);if(u.isParent()){var g=o.calcBoundingBox(u,r[n].xCoords,r[n].yCoords,a);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[d]),p.push(r[n].yCoords[d]);s.edges.push({startX:h[0],startY:h[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][u.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][u.id()].getCenterX(),endY:i[n][u.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),x.add(n))}}));var _=c.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach((function(e,t){var n=e.xCoords.map((function(e){return e+_[t].dx})),r=e.yCoords.map((function(e){return e+_[t].dy}));e.xCoords=n,e.yCoords=r}));else{var C=0;x.forEach((function(e){Object.keys(i[e]).forEach((function(t){var n=i[e][t];n.setCenter(n.getCenterX()+_[C].dx,n.getCenterY()+_[C].dy)})),C++}))}}}else{var T=e.eles.boundingBox();if(u.push({x:T.x1+T.w/2,y:T.y1+T.h/2}),e.randomize){var N=a(e);r.push(N)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),o.relocateComponent(u[0],i[0],e)):o.relocateComponent(u[0],r[0],e)}var M=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var o=void 0,a=void 0,s=t.data("id");return i.forEach((function(e){s in e&&(o={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},a=e[s])})),e.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.labelHeight/2))),null==o&&(o={x:t.position("x"),y:t.position("y")}),{x:o.x,y:o.y}}var l=void 0;return r.forEach((function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})})),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=o.calcParentsWithoutChildren(t,n),D=n.filter((function(e){return"none"==e.css("display")}));e.eles=n.not(D),n.nodes().not(":parent").not(D).layoutPositions(this,e,M),A.length>0&&A.forEach((function(e){e.position(M(e))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=u},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,o=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,a=n.nodes(),s=n.nodes(":parent"),l=new Map,u=new Map,c=new Map,d=[],h=[],p=[],f=[],g=[],v=[],y=[],m=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,_=e.samplingType,C=e.nodeSeparation,T=void 0,N=function(e,t,n){for(var r=[],i=0,o=0,a=0,s=void 0,l=[],c=0,h=1,p=0;p=i;){a=r[i++];for(var f=d[a],y=0;yc&&(c=g[w],h=w)}return h};r.connectComponents(t,n,r.getTopMostNodes(a),l),s.forEach((function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)}));for(var M=0,A=0;A0&&(r.isParent()?d[t].push(c.get(r.id())):d[t].push(r.id()))}))}));var R=function(e){var n=u.get(e),r=void 0;l.get(e).forEach((function(i){r=t.getElementById(i).isParent()?c.get(i):i,d[n].push(r),d[u.get(r)].push(e)}))},B=!0,F=!1,z=void 0;try{for(var j,V=l.keys()[Symbol.iterator]();!(B=(j=V.next()).done);B=!0)R(j.value)}catch(e){F=!0,z=e}finally{try{!B&&V.return&&V.return()}finally{if(F)throw z}}var G=void 0;if((b=u.size)>2){T=b=1)break;u=l}for(var f=0;f=1)break;u=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(579);return r})()},e.exports=r(n(7799))},4726:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var h="undefined"==typeof window?null:window,p=h?h.navigator:null;h&&h.document;var f=r(""),g=r({}),v=r((function(){})),y="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&r(e)==f},x=function(e){return null!=e&&r(e)===v},w=function(e){return!T(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&r(e)===g&&!w(e)&&e.constructor===Object},_=function(e){return null!=e&&r(e)===r(1)&&!isNaN(e)},C=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},T=function(e){return N(e)||M(e)},N=function(e){return"collection"===m(e)&&e._private.single},M=function(e){return"collection"===m(e)&&!e._private.single},A=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},I=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},O=function(e){return function(e){return null!=e&&r(e)===g}(e)&&x(e.then)},P=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},Y=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=t||n<0||d&&e-u>=o}function g(){var e=Q();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?ye(n,o-(e-u)):n}(e))}function v(e){return s=void 0,h&&r?p(e):(r=i=void 0,a)}function y(){var e=Q(),n=f(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),c?p(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ge(t)||0,W(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ve(ge(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Q())},y},be=h?h.performance:null,xe=be&&be.now?function(){return be.now()}:function(){return Date.now()},we=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(xe())}),1e3/60)}}(),Ee=function(e){return we(e)},_e=xe,Ce=9261,Te=5381,Ne=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Me=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce)+e|0},Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Te;return(t<<5)+t+e|0},De=function(e){return 2097152*e[0]+e[1]},Ie=function(e,t){return[Me(e[0],t[0]),Ae(e[1],t[1])]},Oe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ne({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},$e=function(e){e.splice(0,e.length)},Qe=function(e,t,n){return n&&(t=L(n,t)),e[t]},Je=function(e,t,n,r){n&&(t=L(n,t)),e[t]=r},et="undefined"!=typeof Map?Map:function(){function e(){i(this,e),this._obj={}}return a(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),tt=function(){function e(t){if(i(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&A(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new nt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);in;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;og;0<=g?++h:--h)v.push(o(e,r));return v},f=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},g=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i0;){var _=y.pop(),C=g(_),T=_.id();if(d[T]=C,C!==1/0)for(var N=_.neighborhood().intersect(p),M=0;M0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},ct={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t0;){if(u=(l=g.pop()).id(),v.delete(u),w++,u===d){for(var E=[],_=i,C=d,T=m[C];E.unshift(_),null!=T&&E.unshift(T),null!=(_=y[C]);)T=m[C=_.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:w}}f[u]=!0;for(var N=l._private.edges,M=0;MM&&(p[N]=M,y[N]=T,m[N]=w),!i){var A=T*u+C;!i&&p[A]>M&&(p[A]=M,y[A]=C,m[A]=w)}}}for(var D=0;D1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},yt=Math.sqrt(2),mt=function(e,t,n){0===n.length&&Ge("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(u,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=mt(i,e,t),n--}return t},xt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/yt);if(!(i<2)){for(var l=[],u=0;u0?1:e<0?-1:0},Mt=function(e,t){return Math.sqrt(At(e,t))},At=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Dt=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},St=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Lt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Bt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=l(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ft=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},zt=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},jt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Vt=function(e,t){return jt(e,t.x1,t.y1)&&jt(e,t.x2,t.y2)},Gt=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?sn(i,o):u,d=i/2,h=o/2,p=(c=Math.min(c,d,h))!==d,f=c!==h;if(p){var g=r-h-a;if((s=en(e,t,n,r,n-d+c-a,g,n+d-c+a,g,!1)).length>0)return s}if(f){var v=n+d+a;if((s=en(e,t,n,r,v,r-h+c-a,v,r+h-c+a,!1)).length>0)return s}if(p){var y=r+h+a;if((s=en(e,t,n,r,n-d+c-a,y,n+d-c+a,y,!1)).length>0)return s}if(f){var m=n-d-a;if((s=en(e,t,n,r,m,r-h+c-a,m,r+h-c+a,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=Qt(e,t,n,r,b,x,c+a)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=Qt(e,t,n,r,w,E,c+a)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var _=n+d-c,C=r+h-c;if((l=Qt(e,t,n,r,_,C,c+a)).length>0&&l[0]>=_&&l[1]>=C)return[l[0],l[1]];var T=n-d+c,N=r+h-c;return(l=Qt(e,t,n,r,T,N,c+a)).length>0&&l[0]<=T&&l[1]>=N?[l[0],l[1]]:[]},Yt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},Ut=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(ec||th)},Xt=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f,g,v,y,m,b,x,w=[];u=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,d=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0===(l=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(l=1e-5),g=-27*(d/=l)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,(h=w)[1]=0,b=u/3,p>0?(y=(y=g+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=g-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),h[0]=-b+y+m,b+=(y+m)/2,h[4]=h[2]=-b,b=Math.sqrt(3)*(-m+y)/2,h[3]=b,h[5]=-b):(h[5]=h[3]=0,0===p?(x=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),h[0]=2*x-b,h[4]=h[2]=-(x+b)):(v=(f=-f)*f*f,v=Math.acos(g/Math.sqrt(v)),x=2*Math.sqrt(f),h[0]=-b+x*Math.cos(v/3),h[2]=-b+x*Math.cos((v+2*Math.PI)/3),h[4]=-b+x*Math.cos((v+4*Math.PI)/3)));for(var E=[],_=0;_<6;_+=2)Math.abs(w[_+1])<1e-7&&w[_]>=0&&w[_]<=1&&E.push(w[_]);E.push(1),E.push(0);for(var C,T,N,M=-1,A=0;A=0?Nl?(e-i)*(e-i)+(t-o)*(t-o):u-d},Wt=function(e,t,n){for(var r,i,o,a,s=0,l=0;l=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},qt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),p=Math.sin(-u),f=0;f0){var g=Zt(c,-l);d=Kt(g)}else d=c;return Wt(e,t,d)},Kt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},Jt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,h=t-o,p=r-t,f=s-o,g=d*h-f*u,v=c*h-p*u,y=f*c-d*p;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===g||0===v?Jt(e,n,a)===a?[a,s]:Jt(e,n,i)===i?[i,o]:Jt(i,a,n)===n?[n,r]:[]:[]},tn=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f=[],g=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y0){var m=Zt(g,-s);u=Kt(m)}else u=g}else u=n;for(var b=0;bu&&(u=t)},d=function(e){return l[e]},h=0;h0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var w=r(m);b=b.id(),h[b]>h[v]+w&&(h[b]=h[v]+w,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E0;){for(var N=n.pop(),M=0;M0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:An,a=r,s=0;s=2?Sn(e,t,n,0,On,Pn):Sn(e,t,n,0,In)},squaredEuclidean:function(e,t,n){return Sn(e,t,n,0,On)},manhattan:function(e,t,n){return Sn(e,t,n,0,In)},max:function(e,t,n){return Sn(e,t,n,-1/0,kn)}};function Rn(e,t,n,r,i,o){var a;return a=x(e)?e:Ln[e]||Ln.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}Ln["squared-euclidean"]=Ln.squaredEuclidean,Ln.squaredeuclidean=Ln.squaredEuclidean;var Bn=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Fn=function(e){return Bn(e)},zn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return Rn(e,r.length,o,(function(e){return r[e](t)}),a,s)},jn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;ln)return!1;return!0},Xn=function(e,t,n){for(var r=0;ri&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],g=t[r[a]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(o=n[g.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i=M?(A=M,M=I,D=O):I>A&&(A=I);for(var P=0;P0?1:0;C[E%u.minIterations*t+F]=z,B+=z}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var j=0,V=0;V0&&r.push(i);return r}(t,o,a),U=function(e,t,n){for(var r=lr(e,t,n),i=0;il&&(s=u,l=c)}n[i]=o[s]}return lr(e,t,n)}(t,r,Y),X={},H=0;H1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},pr=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},fr={};[ot,ut,ct,ht,ft,vt,xt,dn,pn,gn,yn,Mn,$n,or,cr,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=dr(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(l.getElementById(g.shift())),c)if(c[v].length)return h;return h.found=!0,h.trail=this.spawn(f,!0),h}},{hopcroftTarjanBiconnected:hr,htbc:hr,htb:hr,hopcroftTarjanBiconnectedComponents:hr},{tarjanStronglyConnected:pr,tsc:pr,tscc:pr,tarjanStronglyConnectedComponents:pr}].forEach((function(e){Y(fr,e)}));var gr=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};gr.prototype={fulfill:function(e){return vr(this,1,"fulfillValue",e)},reject:function(e){return vr(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new gr;return n.onFulfilled.push(br(e,r,"fulfill")),n.onRejected.push(br(t,r,"reject")),yr(n),r.proxy}};var vr=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,yr(e)),e},yr=function(e){1===e.state?mr(e,"onFulfilled",e.fulfillValue):2===e.state&&mr(e,"onRejected",e.rejectReason)},mr=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1},qr.prototype.set=function(e,t){var n=this.__data__,r=Hr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Kr=qr,Zr=zr($,"Map"),$r=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function Qr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Ti.className=Ti.classNames=Ti.classes;var Ni={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:B,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ni.variable="(?:[\\w-.]|(?:\\\\"+Ni.metaChar+"))+",Ni.className="(?:[\\w-]|(?:\\\\"+Ni.metaChar+"))+",Ni.value=Ni.string+"|"+Ni.number,Ni.id=Ni.variable,function(){var e,t,n;for(e=Ni.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Ni.comparatorOp+="|\\!"+t)}();var Mi=20,Ai=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*G(e,t)}(e.selector,t.selector)})),Di=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return Ue("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Ue("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Ue("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(i,o){return i.checks.reduce((function(a,s,l){return a+(o===i&&0===l?"$":"")+function(i,o){var a=i.type,s=i.value;switch(a){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:var u=i.field,c=i.operator;return"["+u+n(e(c))+t(s)+"]";case 5:var d=i.operator,h=i.field;return"["+e(d)+h+"]";case 4:return"["+i.field+"]";case 6:var p=i.operator;return"[["+i.field+n(e(p))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var f=r(i.left,o),g=r(i.subject,o),v=r(i.right,o);return f+(f.length>0?" ":"")+g+v;case Mi:return""}}(s,o)}),"")},i="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Ki(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],Ki)},Wi.forEachUp=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Zi)},Wi.forEachUpAndDown=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],$i)},Wi.ancestors=Wi.parents,(Ui=Xi={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_i.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_i.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ui.data,Ui.removeAttr=Ui.removeData;var Qi,Ji,eo=Xi,to={};function no(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;at})),minIndegree:ro("indegree",(function(e,t){return et})),minOutdegree:ro("outdegree",(function(e,t){return et}))}),Y(to,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},Qi.modelPosition=Qi.point=Qi.position,Qi.modelPositions=Qi.points=Qi.positions,Qi.renderedPoint=Qi.renderedPosition,Qi.relativePoint=Qi.relativePosition;var ao,so,lo=Ji;ao=so={},so.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},so.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},so.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,l),h=d.biasDiff,p=d.biasComplementDiff,f=y(i.height.val-o.h,u,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-g+o.y1+o.y2+v)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ho=function(e,t){return null==t?e:co(e,t.x1,t.y1,t.x2,t.y2)},po=function(e,t,n){return Qe(e,t,n)},fo=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Rt(u,1),co(e,u.x1,u.y1,u.x2,u.y2)}}},go=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=po(o,"labelWidth",n),p=po(o,"labelHeight",n),f=po(o,"labelX",n),g=po(o,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=p,C=h,T=C/2,N=_/2;if(m)a=f-T,s=f+T,l=g-N,u=g+N;else{switch(c.value){case"left":a=f-C,s=f;break;case"center":a=f-T,s=f+T;break;case"right":a=f,s=f+C}switch(d.value){case"top":l=g-_,u=g;break;case"center":l=g-N,u=g+N;break;case"bottom":l=g,u=g+_}}var M=v-Math.max(x,w)-E-2,A=v+Math.max(x,w)+E+2,D=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;a+=M,s+=A,l+=D,u+=I;var O=n||"main",P=i.labelBounds,k=P[O]=P[O]||{};k.x1=a,k.y1=l,k.x2=s,k.y2=u,k.w=s-a,k.h=u-l,k.leftPad=M,k.rightPad=A,k.topPad=D,k.botPad=I;var S=m&&"autorotate"===b.strValue,L=null!=b.pfValue&&0!==b.pfValue;if(S||L){var R=S?po(i.rstyle,"labelAngle",n):b.pfValue,B=Math.cos(R),F=Math.sin(R),z=(a+s)/2,j=(l+u)/2;if(!m){switch(c.value){case"left":z=s;break;case"right":z=a}switch(d.value){case"top":j=u;break;case"bottom":j=l}}var V=function(e,t){return{x:(e-=z)*B-(t-=j)*F+z,y:e*F+t*B+j}},G=V(a,l),Y=V(a,u),U=V(s,l),X=V(s,u);a=Math.min(G.x,Y.x,U.x,X.x),s=Math.max(G.x,Y.x,U.x,X.x),l=Math.min(G.y,Y.y,U.y,X.y),u=Math.max(G.y,Y.y,U.y,X.y)}var H=O+"Rot",W=P[H]=P[H]||{};W.x1=a,W.y1=l,W.x2=s,W.y2=u,W.w=s-a,W.h=u-l,co(e,a,l,s,u),co(i.labelBounds.all,a,l,s,u)}return e}},vo=function(e){var t=0,n=function(e){return(e?1:0)<0&&o>0){var a=t.pstyle("outline-offset").value,s=t.pstyle("shape").value,l=o+a,u=(e.w+2*l)/e.w,c=(e.h+2*l)/e.h,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+2.4*l)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+2.4*l)/e.w:"star"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.6*l)/e.h,d=-l/3.8):"triangle"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.4*l)/e.h,d=-l/1.4):"vee"===s&&(u=(e.w+4.4*l)/e.w,c=(e.h+3.8*l)/e.h,d=.5*-l);var h=e.h*c-e.h,p=e.w*u-e.w;if(Bt(e,[Math.ceil(h/2),Math.ceil(p/2)]),0!==d){var f=(r=d,{x1:(n=e).x1+0,x2:n.x2+0,y1:n.y1+r,y2:n.y2+r,w:n.w,h:n.h});St(e,f)}}}}(h,e)}else if(g&&t.includeEdges)if(c&&!d){var M=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),o=Math.max(v.srcY,v.midY,v.tgtY),co(h,n-=_,i-=_,r+=_,o+=_),"haystack"===M){var A=v.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var D=n;n=r,r=D}if(i>(o=A[1].y)){var I=i;i=o,o=I}co(h,n-_,i-_,r+_,o+_)}}else if("bezier"===M||"unbundled-bezier"===M||M.endsWith("segments")||M.endsWith("taxi")){var O;switch(M){case"bezier":case"unbundled-bezier":O=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=v.linePts}if(null!=O)for(var P=0;P(r=L.x)){var R=n;n=r,r=R}if((i=S.y)>(o=L.y)){var B=i;i=o,o=B}co(h,n-=_,i-=_,r+=_,o+=_)}if(c&&t.includeEdges&&g&&(fo(h,e,"mid-source"),fo(h,e,"mid-target"),fo(h,e,"source"),fo(h,e,"target")),c&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;co(h,h.x1+F,h.y1+z,h.x2+F,h.y2+z)}var j=p.bodyBounds=p.bodyBounds||{};Ft(j,h),Bt(j,y),Rt(j,1),c&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,co(h,n-E,i-E,r+E,o+E));var V=p.overlayBounds=p.overlayBounds||{};Ft(V,h),Bt(V,y),Rt(V,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=kt(),c&&t.includeLabels&&(t.includeMainLabels&&go(h,e,null),g&&(t.includeSourceLabels&&go(h,e,"source"),t.includeTargetLabels&&go(h,e,"target")))}return h.x1=uo(h.x1),h.y1=uo(h.y1),h.x2=uo(h.x2),h.y2=uo(h.y2),h.w=uo(h.x2-h.x1),h.h=uo(h.y2-h.y1),h.w>0&&h.h>0&&b&&(Bt(h,y),Rt(h,1)),h}(e,bo),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=kt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ho(n,r.overlayBounds):ho(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ho(n,r.labelBounds.all):(t.includeMainLabels&&ho(n,r.labelBounds.mainRot),t.includeSourceLabels&&ho(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ho(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},bo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},xo=vo(bo),wo=Ke(bo);so.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=kt();var n=wo(e=e||bo),r=this;if(r.cy().styleEnabled())for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:Ro,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)a(s);return this},Fo.removeAllListeners=function(){return this.removeListener("*")},Fo.emit=Fo.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,jo(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(E(e)){var o=e;i.applyBypass(this,o,r),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?i.getStylePropertyValue(a,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var o=0;o0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),da.neighbourhood=da.neighborhood,da.closedNeighbourhood=da.closedNeighborhood,da.openNeighbourhood=da.openNeighborhood,Y(da,{source:Hi((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Hi((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ga({attr:"source"}),targets:ga({attr:"target"})}),Y(da,{edgesWith:Hi(va(),"edgesWith"),edgesTo:Hi(va({thisIsSrc:!0}),"edgesTo")}),Y(da,{connectedEdges:Hi((function(e){for(var t=[],n=0;n0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),da.componentsOf=da.components;var ma=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new et,o=!1;if(t){if(t.length>0&&E(t[0])&&!N(t[0])){o=!0;for(var a=[],s=new nt,l=0,u=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u0){for(var B=e.length===i.length?i:new ma(o,e),F=0;F0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var C=0;C=.001?function(t,r){for(var i=0;i<4;++i){var o=h(r,e,n);if(0===o)return r;r-=(d(r,e,n)-t)/o}return r}(t,a):0===l?a:function(t,r,i){var o,a,s=0;do{(o=d(a=r+(i-r)/2,e,n)-t)>0?i=a:r=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+i)}(o),t,r)};f.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var g="generateBezier("+[e,t,n,r]+")";return f.toString=function(){return g},f}var Ea=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),_a=function(e,t,n,r){var i=wa(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Ca={linear:function(e,t,n){return e+(t-e)*n},ease:_a(.25,.1,.25,1),"ease-in":_a(.42,0,1,1),"ease-out":_a(0,0,.58,1),"ease-in-out":_a(.42,0,.58,1),"ease-in-sine":_a(.47,0,.745,.715),"ease-out-sine":_a(.39,.575,.565,1),"ease-in-out-sine":_a(.445,.05,.55,.95),"ease-in-quad":_a(.55,.085,.68,.53),"ease-out-quad":_a(.25,.46,.45,.94),"ease-in-out-quad":_a(.455,.03,.515,.955),"ease-in-cubic":_a(.55,.055,.675,.19),"ease-out-cubic":_a(.215,.61,.355,1),"ease-in-out-cubic":_a(.645,.045,.355,1),"ease-in-quart":_a(.895,.03,.685,.22),"ease-out-quart":_a(.165,.84,.44,1),"ease-in-out-quart":_a(.77,0,.175,1),"ease-in-quint":_a(.755,.05,.855,.06),"ease-out-quint":_a(.23,1,.32,1),"ease-in-out-quint":_a(.86,0,.07,1),"ease-in-expo":_a(.95,.05,.795,.035),"ease-out-expo":_a(.19,1,.22,1),"ease-in-out-expo":_a(1,0,0,1),"ease-in-circ":_a(.6,.04,.98,.335),"ease-out-circ":_a(.075,.82,.165,1),"ease-in-out-circ":_a(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ca.linear;var r=Ea(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":_a};function Ta(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Na(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ma(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Na(e,i),s=Na(t,i);if(_(a)&&_(s))return Ta(o,a,s,n,r);if(w(a)&&w(s)){for(var l=[],u=0;u0?("spring"===d&&h.push(a.duration),a.easingImpl=Ca[d].apply(null,h)):a.easingImpl=Ca[d]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var g=a.startPosition,v=a.position;if(v&&i&&!e.locked()){var y={};Da(g.x,v.x)&&(y.x=Ma(g.x,v.x,p,f)),Da(g.y,v.y)&&(y.y=Ma(g.y,v.y,p,f)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Da(m.x,x.x)&&(w.x=Ma(m.x,x.x,p,f)),Da(m.y,x.y)&&(w.y=Ma(m.y,x.y,p,f)),e.emit("pan"));var _=a.startZoom,C=a.zoom,T=null!=C&&r;T&&(Da(_,C)&&(o.zoom=Pt(o.minZoom,Ma(_,C,p,f),o.maxZoom)),e.emit("zoom")),(E||T)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var M=0;M=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],h=d._private;h.stopped?(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Ia(0,d,e),Aa(t,d,e,n),h.applying&&(h.applying=!1),u(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Pa={animate:_i.animate(),animation:_i.animation(),animated:_i.animated(),clearQueue:_i.clearQueue(),delay:_i.delay(),delayAnimation:_i.delayAnimation(),stop:_i.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Oa(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ee((function(n){Oa(n,e),t()}))}()}}},ka={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&N(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Sa=function(e){return b(e)?new Vi(e):e},La={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bo(ka,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Sa(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Sa(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},once:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};_i.eventAliasesOn(La);var Ra={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ra.jpeg=Ra.jpg;var Ba={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n,r=e.name,i=t.extension("layout",r);if(null!=i)return n=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(Y({},e,{cy:t,eles:n}));Ge("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Ge("A `name` must be specified to make a layout");else Ge("Layout options must be specified to make a layout")}};Ba.createLayout=Ba.makeLayout=Ba.layout;var Fa={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ja.invalidateDimensions=ja.resize;var Va={collection:function(e,t){return b(e)?this.$(e):T(e)?e.collection():w(e)?(t||(t={}),new ma(this,e,t.unique,t.removed)):new ma(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Va.elements=Va.filter=Va.$;var Ga={},Ya="t";Ga.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(h||d&&p){var f=void 0;h&&p||h?f=u.properties:p&&(f=u.mappedProperties);for(var g=0;g1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],C=i.valueMin[1],T=i.valueMax[1],N=i.valueMin[2],M=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],D=null==i.valueMax[3]?1:i.valueMax[3],I=[Math.round(w+(E-w)*v),Math.round(C+(T-C)*v),Math.round(N+(M-N)*v),Math.round(A+(D-A)*v)];n={bypass:i.bypass,name:i.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,O,i.bypass,h)}if(!n)return g(),!1;n.mapping=i,i=n;break;case a.data:for(var P=i.field.split("."),k=d.data,S=0;S0&&o>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ga.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Ga.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ga.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==t||"bezier"!==n&&"bezier"!==r||e.parallelEdges().forEach((function(e){e.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==t||"none"!==n&&"none"!==r||e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))},Ga.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ua={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;ot.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Ue("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u&&new Vi(u).invalid)Ue("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();else{var c=l[2],d=!1;n=c;for(var h=[];!n.match(/^\s*$/);){var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ue("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=p[0];var f=p[1],g=p[2];this.properties[f]?i.parse(f,g)?(h.push({name:f,val:g}),s()):(Ue("Skipping property: Invalid property definition in: "+r),s()):(Ue("Skipping property: Invalid property name in: "+r),s())}if(d){a();break}i.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var p=s.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(e,c[4]);if(!f||f.mapped)return!1;var g=this.parse(e,c[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return Ue("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(d.color){var v=f.value,y=g.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var E=[],C=[],T=[],N="",M=!1,A=0;A0?" ":"")+D.strValue}return d.validate&&!d.validate(E,C)?null:d.singleEnum&&M?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:T,strValue:N,bypass:n,units:C}}var I,O,P,S=function(){for(var r=0;rd.max||d.strictMax&&t===d.max))return null;var G={name:e,value:t,strValue:""+t+(L||""),units:L,bypass:n};return d.unitless||"px"!==L&&"em"!==L?G.pfValue=t:G.pfValue="px"!==L&&L?this.getEmSizeInPixels()*t:t,"ms"!==L&&"s"!==L||(G.pfValue="ms"===L?t:1e3*t),"deg"!==L&&"rad"!==L||(G.pfValue="rad"===L?t:(I=t,Math.PI*I/180)),"%"===L&&(G.pfValue=t/100),G}if(d.propList){var Y=[],X=""+t;if("none"===X);else{for(var H=X.split(/\s*,\s*|\s+/),W=0;W255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(P)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+j+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[a,s,l,o]}return t}(P);return K?{name:e,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var Z=S();if(Z)return Z}for(var $=d.regexes?d.regexes:[d.regex],Q=0;Q<$.length;Q++){var J=new RegExp($[Q]).exec(t);if(J)return{name:e,value:d.singleRegexMatchValue?J[1]:J,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?S():null};var $a=function e(t){if(!(this instanceof e))return new e(t);A(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Ge("A style must have a core reference")},Qa=$a.prototype;Qa.instanceString=function(){return"style"},Qa.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),_(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=wt(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;_(l.x)&&(t.pan.x=l.x,a=!1),_(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else T(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};es.centre=es.center,es.autolockNodes=es.autolock,es.autoungrabifyNodes=es.autoungrabify;var ts={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ts.attr=ts.data,ts.removeAttr=ts.removeData;var ns=function(e){var t=this,n=(e=Y({},e)).container;n&&!C(n)&&C(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=Y({name:o?"grid":"null"},a.layout),a.renderer=Y({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new ma(this),listeners:[],aniEles:new ma(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:_(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&_(a.pan.x)?a.pan.x:0,y:E(a.pan)&&_(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=Y({},a,a.renderer);t.initRenderer(u),function(e,t){if(e.some(O))return wr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=Y({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e0,u=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(T(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d0;){var P=D.shift(),k=A(P,I);if(k)P.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(O);else if(null===k){Ue("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}M();var S=0;if(n.avoidOverlap)for(var L=0;L0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:q+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:q+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var us={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cs(e){this.options=Y({},us,e)}cs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h1&&t.avoidOverlap){d*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(v*v+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var ds,hs={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ps(e){this.options=Y({},hs,e)}ps.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d0&&Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m)),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,_)}for(var C=0,T=0;T1&&t.avoidOverlap){var D=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(D*D+I*I));C=Math.max(O,C)}N.r=C,C+=w}if(t.equidistant){for(var P=0,k=0,S=0;S=e.numIter||(Es(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature=e.animationThreshold&&o(),Ee(t)):(Ss(r,e),s())}();else{for(;u;)u=a(l),l++;Ss(r,e),s()}return this},gs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},gs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vs=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u0)for(a.graphSet.push(E),u=0;ur.count?0:r.graph},ms=function e(t,n,r,i){var o=i.graphSet[r];if(-10)var s=(u=r.nodeOverlap*a)*i/(g=Math.sqrt(i*i+o*o)),l=u*o/g;else{var u,c=Ms(e,i,o),d=Ms(t,-1*i,-1*o),h=d.x-c.x,p=d.y-c.y,f=h*h+p*p,g=Math.sqrt(f);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/f)*h/g,l=u*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ns=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ms=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0n?(u.x=r,u.y=i+o/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},As=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,g=t.gravity*h/p;c.offsetX+=f,c.offsetY+=g}}}}},Is=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},ks=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTopf&&(d+=p+t.componentSpacing,c=0,h=0,p=0)}}},Ls={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Rs(e){this.options=Y({},Ls,e)}Rs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},h=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=p)l=h,u=p;else if(null!=h&&null==p)l=h,u=Math.ceil(a/l);else if(null==h&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var f=c(),g=d();(f-1)*g>=a?c(f-1):(g-1)*f>=a&&d(g-1)}else for(;u*l=a?d(y+1):c(v+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x=u&&(O=0,I++)},k={},S=0;S(r=Ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5(r=Xt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var C=_[w],T=s.arrowShapes[n.pstyle(C.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(T.roughCollide(e,t,E,C.angle,{x:C.x,y:C.y},N,h)&&T.collide(e,t,E,C.angle,{x:C.x,y:C.y},N,h))return v(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Qe(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},C=_(g,m),T=_(g,x),N=_(y,m),M=_(y,x),A=[C.x+h,C.y+p,N.x+h,N.y+p,M.x+h,M.y+p,T.x+h,T.y+p];if(Wt(e,t,A))return v(n),!0}else if(jt(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),h=kt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),p=0;p4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,r,i){var o,a;if(e!==hl?gl(t,e,pl):((a=pl).x=-1*(o=fl).x,a.y=-1*o.y,a.nx=-1*o.nx,a.ny=-1*o.ny,a.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),gl(t,n,fl),Qs=pl.nx*fl.ny-pl.ny*fl.nx,Js=pl.nx*fl.nx-pl.ny*-fl.ny,nl=Math.asin(Math.max(-1,Math.min(1,Qs))),Math.abs(nl)<1e-6)return Zs=t.x,$s=t.y,void(il=al=0);el=1,tl=!1,Js<0?nl<0?nl=Math.PI+nl:(nl=Math.PI-nl,el=-1,tl=!0):nl>0&&(el=-1,tl=!0),al=void 0!==t.radius?t.radius:r,rl=nl/2,sl=Math.min(pl.len/2,fl.len/2),i?(ol=Math.abs(Math.cos(rl)*al/Math.sin(rl)))>sl?(ol=sl,il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))):il=al:(ol=Math.min(sl,al),il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))),cl=t.x+fl.nx*ol,dl=t.y+fl.ny*ol,Zs=cl-fl.ny*il*el,$s=dl+fl.nx*il*el,ll=t.x+pl.nx*ol,ul=t.y+pl.ny*ol,hl=t}(e,t,n,r,i),{cx:Zs,cy:$s,radius:il,startX:ll,startY:ul,stopX:cl,stopY:dl,startAngle:pl.ang+Math.PI/2*el,endAngle:fl.ang-Math.PI/2*el,counterClockwise:tl})}var ml={};function bl(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},M=N(C,E),A=N(T,_),D=!1;"auto"===v?g=Math.abs(M)>Math.abs(A)?i:r:v===l||v===s?(g=r,D=!0):v!==o&&v!==a||(g=i,D=!0);var I,O=g===r,P=O?A:M,k=O?T:C,S=Nt(k),L=!1;D&&(m||x)||!(v===s&&k<0||v===l&&k>0||v===o&&k>0||v===a&&k<0)||(P=(S*=-1)*Math.abs(P),L=!0);var R=function(e){return Math.abs(e)=Math.abs(P)},B=R(I=m?(b<0?1+b:b)*P:(b<0?P:0)+b*S),F=R(Math.abs(P)-Math.abs(I));if(!B&&!F||L)if(O){var z=u.y1+I+(f?d/2*S:0),j=u.x1,V=u.x2;n.segpts=[j,z,V,z]}else{var G=u.x1+I+(f?c/2*S:0),Y=u.y1,U=u.y2;n.segpts=[G,Y,G,U]}else if(O){var X=Math.abs(k)<=d/2,H=Math.abs(C)<=h/2;if(X){var W=(u.x1+u.x2)/2,q=u.y1,K=u.y2;n.segpts=[W,q,W,K]}else if(H){var Z=(u.y1+u.y2)/2,$=u.x1,Q=u.x2;n.segpts=[$,Z,Q,Z]}else n.segpts=[u.x1,u.y2]}else{var J=Math.abs(k)<=c/2,ee=Math.abs(T)<=p/2;if(J){var te=(u.y1+u.y2)/2,ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else if(ee){var ie=(u.x1+u.x2)/2,oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}else n.segpts=[u.x2,u.y1]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},ml.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!_(n.startX)||!_(n.startY),v=!_(n.arrowStartX)||!_(n.arrowStartY),y=!_(n.endX)||!_(n.endY),m=!_(n.arrowEndX)||!_(n.arrowEndY),b=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,x=Mt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xh.poolIndex()){var p=d;d=h,h=p}var f=s.srcPos=d.position(),g=s.tgtPos=h.position(),v=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=s.srcCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,C=s.tgtCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,T=s.tgtRs=h._private.rscratch,N=s.srcRs=d._private.rscratch;s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var M=0;M0){var H=u,W=At(H,_t(t)),q=At(H,_t(X)),K=W;q2&&At(H,{x:X[2],y:X[3]})0){var le=c,ue=At(le,_t(t)),ce=At(le,_t(se)),de=ue;ce2&&At(le,{x:se[2],y:se[3]})=u||m){c={cp:g,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=Pt(0,_,1),t=Ot(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=Pt(0,r-.001,1),o=Pt(0,r+.001,1),a=Ot(e,t,n,i),s=Ot(e,t,n,o);return Tl(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var C,T,N,M,A=0,D=r.allpts.length,I=0;I+3=u));I+=2);var O=(u-T)/C;O=Pt(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Mt(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(N,M,O),i=Tl(N,M)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},_l.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},_l.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Qe(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,d=i.width,h=i.height+(l-1)*(o-1)*u;Je(n.rstyle,"labelWidth",t,d),Je(n.rscratch,"labelWidth",t,d),Je(n.rstyle,"labelHeight",t,h),Je(n.rscratch,"labelHeight",t,h),Je(n.rscratch,"labelLineHeight",t,c)},_l.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Je(n.rscratch,e,t,r),r):Qe(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,p=[],f=/[\s\u200b]+|$/g,g=0;gc){var b,x="",w=0,E=d(v.matchAll(f));try{for(E.s();!(b=E.n()).done;){var _=b.value,C=_[0],T=v.substring(w,_.index);w=_.index+C.length;var N=0===x.length?T:x+T+C;this.calculateLabelDimensions(e,N).width<=c?x+=T+C:(x&&p.push(x),x=T+C)}}catch(e){E.e(e)}finally{E.f()}x.match(/^[\s\u200b]+$/)||p.push(x)}else p.push(v)}a("labelWrapCachedLines",p),i=a("labelWrapCachedText",p.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var M=e.pstyle("text-max-width").pfValue,A="",D=!1;if(this.calculateLabelDimensions(e,i).widthM);I++)A+=i[I],I===i.length-1&&(D=!0);return D||(A+="…"),A}return i},_l.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},_l.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window().document,i=Oe(t,e._private.labelDimsKey),o=n.labelDimCache||(n.labelDimCache=[]),a=o[i];if(null!=a)return a;var s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=r.createElement("canvas"),h=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}h.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var f=0,g=0,v=t.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var M=i(t);v&&(e.hoverData.tapholdCancelled=!0),n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(D):a.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(n=!0,a.panningEnabled()&&a.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};a.panBy(I),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),b)if(v){if(a.boxSelectionEnabled()&&M)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var P=!e.dragData.didDrag;P&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(w,{inDragLayer:!0});var k={x:0,y:0};if(_(x[0])&&_(x[1])&&(k.x+=x[0],k.y+=x[1],P)){var S=e.hoverData.dragDelta;S&&_(S[0])&&_(S[1])&&(k.x+=S[0],k.y+=S[1])}e.hoverData.draggingEles=!0,w.silentShift(k).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else v&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!M&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=_t(h),e.redrawHint("select",!0),e.redraw()):A(),b&&b.pannable()&&b.active()&&b.unactivate());return f[2]=c[0],f[3]=c[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,h=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:t,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:t,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:a[0],y:a[1]}),x=!1,t.timeStamp-w<=o.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:a[0],y:a[1]})):(b=setTimeout((function(){x||r(c,["oneclick","onetap","voneclick"],t,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),w=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(o.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:t,position:{x:a[0],y:a[1]}});"additive"===o.selectionType()||h||o.$(n).unmerge(g).unselect(),g.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=c&&c.grabbed();d(u),v&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}),!1);var C,T,N,M,A,D,I,O,P,k,S,L,R,B=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",B,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||B(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var F,z,j,V,G,Y,U,X=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},H=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",F=function(t){if(e.hasTouchStarted=!0,m(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var l=e.findContainerClientCoords();P=l[0],k=l[1],S=l[2],L=l[3],C=t.touches[0].clientX-P,T=t.touches[0].clientY-k,N=t.touches[1].clientX-P,M=t.touches[1].clientY-k,R=0<=C&&C<=S&&0<=N&&N<=S&&0<=T&&T<=L&&0<=M&&M<=L;var h=n.pan(),f=n.zoom();if(A=X(C,T,N,M),D=H(C,T,N,M),O=[((I=[(C+N)/2,(T+M)/2])[0]-h.x)/f,(I[1]-h.y)/f],D<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),b=y[0];if(null!=b&&(b.activate(),e.touchData.start=b,e.touchData.starts=y,e.nodeIsGrabbable(b))){var x=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),b.selected()?(w=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(w,{addToList:x})):c(b,{addToList:x}),s(b);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};b.emit(E("grabon")),w?w.forEach((function(e){e.emit(E("grab"))})):b.emit(E("grab"))}r(b,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==b&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var _=e.touchData.startPosition=[null,null,null,null,null,null],B=0;B=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var w=t.touches[0].clientX-P,E=t.touches[0].clientY-k,I=t.touches[1].clientX-P,S=t.touches[1].clientY-k,L=H(w,E,I,S);if(L/D>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(n&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var F=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&F===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=F,F&&F.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",j=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",V=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=h[0],u[1]=h[1]}if(t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=h[0],u[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=h[0],u[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;d(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);r(y,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),G=!1,t.timeStamp-U<=s.multiClickDebounceTime()?(Y&&clearTimeout(Y),G=!0,U=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):(Y=setTimeout((function(){G||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),U=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var p=[c[0],c[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return g[0]}return null},p=Object.keys(d),f=0;f0?u:Gt(i,o,e,t,n,r,a,s)},checkPoint:function(e,t,n,r,i,o,a,s){var l=2*(s="auto"===s?sn(r,i):s);if(qt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(qt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!Wt(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||!!$t(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!$t(e,t,l,l,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",rn(3,0)),this.generateRoundPolygon("round-triangle",rn(3,0)),this.generatePolygon("rectangle",rn(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",rn(5,0)),this.generateRoundPolygon("round-pentagon",rn(5,0)),this.generatePolygon("hexagon",rn(6,0)),this.generateRoundPolygon("round-hexagon",rn(6,0)),this.generatePolygon("heptagon",rn(7,0)),this.generateRoundPolygon("round-heptagon",rn(7,0)),this.generatePolygon("octagon",rn(8,0)),this.generateRoundPolygon("round-octagon",rn(8,0));var r=new Array(20),i=an(5,0),o=an(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*Bl)break;var v=e.deq(t,d,c);if(!(v.length>0))break;for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),i(t))}}},zl=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ze;i(this,e),this.idsByKey=new et,this.keyForId=new et,this.cachesByLvl=new et,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return a(e,[{key:"getIdsFor",value:function(e){null==e&&Ge("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new nt,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new et,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),jl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Vl=Ke({getKey:null,doesEleInvalidateKey:ze,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gl=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Vl(t);Y(n,r),n.lookup=new zl(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Yl=Gl.prototype;Yl.reasons=jl,Yl.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Yl.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Yl.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new st((function(e,t){return t.reqs-e.reqs}))},Yl.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Yl.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Tt(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,h=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var g=o.getTextureQueue(p),v=g[g.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidthr;M--)T=o.getElement(e,t,n,M,jl.downscale);N()}else{var A;if(!x&&!w&&!E)for(var D=r-1;D>=-4;D--){var I=l.get(e,D);if(I){A=I;break}}if(b(A))return o.queueElement(e,r),A;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:u,width:d,height:c,scaledLabelShown:h},v.usedWidth+=Math.ceil(d+8),v.eleCaches.push(f),l.set(e,r,f),o.checkTextureFullness(v),f},Yl.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},Yl.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ze(t,e):e.fullnessChecks++},Yl.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ze(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,$e(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ze(r,o),n.push(o),o}},Yl.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Yl.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,jl.dequeue)}}return i},Yl.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Be,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Yl.onDequeue=function(e){this.onDequeues.push(e)},Yl.offDequeue=function(e){Ze(this.onDequeues,e)},Yl.setupDequeueing=Fl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Ze(c,a)}}();var d=function(t){var i=(t=t||{}).after;!function(){if(!a){a=kt();for(var t=0;t32767||s>32767)return null;if(o*s>16e6)return null;var l=r.makeLayer(a,n);if(null!=i){var d=c.indexOf(i)+1;c.splice(d,0,l)}else(void 0===t.insert||t.insert)&&c.unshift(l);return l};if(r.skipping&&!o)return null;for(var h=null,p=e.length/1,f=!o,g=0;g=p||!Vt(h.bb,v.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||f?r.queueLayer(h,v):r.drawEleInLayer(h,v,n,t),h.eles.push(v),m[n]=h}}return s||(f?null:c)},Xl.getEleLevelForLayerLevel=function(e,t){return e},Xl.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Xl.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Xl.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},Xl.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=_e(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Xl.invalidateLayer=function(e){if(this.lastInvalidationTime=_e(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ze(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*c,m=u*c,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,C=y*_;e.translate(w,E),b(C),x(C),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(a.colorStrokeStyle(e,v[0],v[1],v[2],n),"straight-triangle"===d?a.drawEdgeTrianglePath(t,e,s.allpts):(a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")):e.lineCap="butt"}();i&&a.drawEdgeUnderlay(e,t),b(),x(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},uu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};lu.drawEdgeOverlay=uu("overlay"),lu.drawEdgeUnderlay=uu("underlay"),lu.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");o.pathCacheKey&&o.pathCacheKey===h?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=h,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&void 0!==arguments[5]?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),a?e.stroke():e.fill()}du.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Tt(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},du.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},du.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Qe(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},du.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Qe(o,"labelX",n),c=Qe(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var h,p=n?n+"-":"",f=Qe(o,"labelWidth",n),g=Qe(o,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(h=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(h),u=0,c=0),x){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue,T=0===t.pstyle("text-background-shape").strValue.indexOf("round");if(w>0||_>0&&E>0){var N=u-C;switch(b){case"left":N-=f;break;case"center":N-=f/2}var M=c-g-C,A=f+2*C,D=g+2*C;if(w>0){var I=e.fillStyle,O=t.pstyle("text-background-color").value;e.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+w*a+")",T?hu(e,N,M,A,D,2):e.fillRect(N,M,A,D),e.fillStyle=I}if(_>0&&E>0){var P=e.strokeStyle,k=e.lineWidth,S=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+S[0]+","+S[1]+","+S[2]+","+E*a+")",e.lineWidth=_,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(T?hu(e,N,M,A,D,2,"stroke"):e.strokeRect(N,M,A,D),"double"===L){var R=_/2;T?hu(e,N+R,M+R,A-2*R,D-2*R,2,"stroke"):e.strokeRect(N+R,M+R,A-2*R,D-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=k,e.strokeStyle=P}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Qe(o,"labelWrapCachedLines",n),z=Qe(o,"labelLineHeight",n),j=f/2,V=this.getLabelJustification(t);switch("auto"===V||("left"===b?"left"===V?u+=-f:"center"===V&&(u+=-j):"center"===b?"left"===V?u+=-j:"right"===V&&(u+=j):"right"===b&&("center"===V?u+=j:"right"===V&&(u+=f))),x){case"top":case"center":case"bottom":c-=(F.length-1)*z}for(var G=0;G0&&e.strokeText(F[G],u,c),e.fillText(F[G],u,c),c+=z}else B>0&&e.strokeText(d,u,c),e.fillText(d,u,c);0!==h&&(e.rotate(-h),e.translate(-s,-l))}}};var pu={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(_(d.x)&&_(d.y)&&(!s||t.visible())){var h,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:A;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,F[0],F[1],F[2],t)},H=function(e,t,n,r){var i,o=l.nodePathCache=l.nodePathCache||[],a=Pe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+G),s=o[a],u=!1;return null!=s?(i=s,u=!0,c.pathCache=i):(i=new Path2D,o[a]=c.pathCache=i),{path:i,cacheHit:u}},W=t.pstyle("shape").strValue,q=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(d.x,d.y);var K=H(r,i,W,q);h=K.path,v=K.cacheHit}var Z=function(){if(!v){var n=d;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i,G,c)}g?e.fill(h):e.fill()},$=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i,G,c)))},J=function(){var t=(N>0?N:-N)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=N>0?0:255;0!==N&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(h):e.fill())},ee=function(){if(M>0){if(e.lineWidth=M,e.lineCap=P,e.lineJoin=O,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(S),e.lineDashOffset=L;break;case"solid":case"double":e.setLineDash([])}if("center"!==k){if(e.save(),e.lineWidth*=2,"inside"===k)g?e.clip(h):e.clip();else{var t=new Path2D;t.rect(-r/2-M,-i/2-M,r+2*M,i+2*M),t.addPath(h),e.clip(t,"evenodd")}g?e.stroke(h):e.stroke(),e.restore()}else g?e.stroke(h):e.stroke();if("double"===I){e.lineWidth=M/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(h):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(B>0){if(e.lineWidth=B,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=d;g&&(n={x:0,y:0});var o=l.getNodeShape(t),a=M;"inside"===k&&(a=0),"outside"===k&&(a*=2);var s,u=(r+a+(B+V))/r,c=(i+a+(B+V))/i,h=r*u,p=i*c,f=l.nodeShapes[o].points;if(g&&(s=H(h,p,o,f).path),"ellipse"===o)l.drawEllipsePath(s||e,n.x,n.y,h,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var v=0,y=0,m=0;"round-diamond"===o?v=1.4*(a+V+B):"round-heptagon"===o?(v=1.075*(a+V+B),m=-(a/2+V+B)/35):"round-hexagon"===o?v=1.12*(a+V+B):"round-pentagon"===o?(v=1.13*(a+V+B),m=-(a/2+V+B)/15):"round-tag"===o?(v=1.12*(a+V+B),y=.07*(a/2+B+V)):"round-triangle"===o&&(v=(a+V+B)*(Math.PI/2),m=-(a+V/2+B)/Math.PI),0!==v&&(h=r*(u=(r+v)/r),["round-hexagon","round-tag"].includes(o)||(p=i*(c=(i+v)/i)));for(var b=h/2,x=p/2,w=(G="auto"===G?ln(h,p):G)+(a+B+V)/2,E=new Array(f.length/2),_=new Array(f.length/2),C=0;C0){if(r=r||n.position(),null==i||null==o){var d=n.padding();i=n.width()+2*d,o=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a,c),t.fill()}}}};pu.drawNodeOverlay=fu("overlay"),pu.drawNodeUnderlay=fu("underlay"),pu.hasPie=function(e){return(e=e[0])._private.hasPie},pu.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,g=t.pstyle("pie-"+h+"-background-opacity").value*n,v=p/100;v+d>1&&(v=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*v;0===p||d>=1||d+v>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),d+=v)}};for(var gu={getPixelRatio:function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;ia.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},C=a.prevViewport;void 0===C||_.zoom!==C.zoom||_.pan.x!==C.pan.x||_.pan.y!==C.pan.y||g&&!f||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var T=a.getCachedZSortedEles();function N(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function M(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var A=a.data.bufferContexts[a.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var D=u.contexts[a.NODE],I=a.textureCache.texture;_=a.textureCache.viewport,D.setTransform(1,0,0,1,0,0),h?N(D,0,0,_.width,_.height):D.clearRect(0,0,_.width,_.height);var O=m.core("outside-texture-bg-color").value,P=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(D,O[0],O[1],O[2],P),D.fillRect(0,0,_.width,_.height),b=l.zoom(),M(D,!1),D.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),D.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var k=l.extent(),S=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),L=a.hideEdgesOnViewport&&S,R=[];if(R[a.NODE]=!c[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,R[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),R[a.DRAG]=!c[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,R[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||R[a.NODE]){var B=h&&!R[a.NODE]&&1!==p;M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.nondrag,s,k):a.drawLayeredElements(D,T.nondrag,s,k),a.debug&&a.drawDebugPoints(D,T.nondrag),n||h||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||R[a.DRAG])&&(B=h&&!R[a.DRAG]&&1!==p,M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.drag,s,k):a.drawCachedElements(D,T.drag,s,k),a.debug&&a.drawDebugPoints(D,T.drag),n||h||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(M(D=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var F=m.core("selection-box-border-width").value/b;D.lineWidth=F,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),F>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=u.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var j=a.lastRedrawTime;if(a.showFps&&j){j=Math.round(j);var V=Math.round(1e3/j);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+j+" ms = "+V+" fps",0,20),D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(h&&1!==p){var G=u.contexts[a.NODE],Y=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],U=u.contexts[a.DRAG],X=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):N(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||R[a.NODE])&&(H(G,Y,R[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||R[a.DRAG])&&(H(U,X,R[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")}},vu={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},_u.png=function(e){return Tu(e,this.bufferCanvasImage(e),"image/png")},_u.jpg=function(e){return Tu(e,this.bufferCanvasImage(e),"image/jpeg")};var Nu=Au,Mu=Au.prototype;function Au(e){var t=this,n=t.cy.window().document;t.data={canvases:new Array(Mu.CANVAS_LAYERS),contexts:new Array(Mu.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Mu.CANVAS_LAYERS),bufferCanvases:new Array(Mu.BUFFER_COUNT),bufferContexts:new Array(Mu.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l{e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822:(e,t,n)=>{"use strict";var r=n(6857),i=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},135:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],u=i.addDummyNode(e,"border",s,n);o[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s{"use strict";var r=n(6857);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},9859:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909:(e,t,n)=>{var r=n(6857),i=n(3988),o=n(8191).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},8191:(e,t,n)=>{var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031:(e,t,n)=>{var r=n(6857),i=n(8191).Graph,o=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var u=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202:(e,t,n)=>{"use strict";var r=n(6857),i=n(6822),o=n(8209),a=n(9361),s=n(3988).normalizeRanks,l=n(2948),u=n(3988).removeEmptyRanks,c=n(6353),d=n(135),h=n(4850),p=n(1453),f=n(3776),g=n(3988),v=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new v({multigraph:!0,compound:!0}),n=N(e.graph());return t.setGraph(r.merge({},m,T(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=N(e.node(n));t.setNode(n,r.defaults(T(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=N(e.edge(n));t.setEdge(n,r.merge({},_,T(i,E),r.pick(i,C)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};g.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){u(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=g.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){f(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function T(e,t){return r.mapValues(r.pick(e,t),Number)}function N(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},6857:(e,t,n)=>{var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(9754),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),p=e.node(u);e.setParent(d,u),p.borderTop=d,e.setParent(h,u),p.borderBottom=h,r.forEach(c,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,f=i.borderTop?a:2*a,g=c!==p?1:s-l[u]+1;e.setEdge(d,c,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},8209:(e,t,n)=>{"use strict";var r=n(6857),i=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(u!==s+1){for(e.removeEdge(t),o=0,++s;s{var r=n(6857);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},3860:(e,t,n)=>{var r=n(6857);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},7860:(e,t,n)=>{var r=n(6857),i=n(8191).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6639:(e,t,n)=>{"use strict";var r=n(6857);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r{"use strict";var r=n(6857),i=n(8918),o=n(6639),a=n(4520),s=n(7860),l=n(4384),u=n(8191).Graph,c=n(3988);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new u;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var l,u=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){h(f%2?n:a,f%4>=2),s=c.buildLayerMatrix(e);var v=o(e,s);v{"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},4959:(e,t,n)=>{"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){var n,i,o,a;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(i=t,o=0,a=0,(n=e).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},4520:(e,t,n)=>{var r=n(6857),i=n(3860),o=n(4959),a=n(5169);e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,p={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==h})));var f=i(t,u);r.forEach(f,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(f,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(g,p);var v=a(g,l);if(d&&(v.vs=r.flatten([d,v.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.order+m.order)/(v.weight+2),v.weight+=2}return v}},5169:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,l=r.sortBy(a.rhs,(function(e){return-e.i})),u=[],c=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(u,l,h),r.forEach(s,(function(e){h+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,d+=e.weight,h=o(u,l,h)}));var p={vs:r.flatten(u,!0)};return d&&(p.barycenter=c/d,p.weight=d),p}},2948:(e,t,n)=>{var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,u=a[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank{"use strict";var r=n(6857),i=n(8191).Graph,o=n(3988);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,u=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===u)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(as)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var p=l[d];a[e]===e&&t{"use strict";var r=n(6857),i=n(3988),o=n(9741).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},8481:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph,o=n(8073).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(r.setNode(u,{});a(r,e){"use strict";var r=n(8073).longestPath,i=n(8481),o=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r},6860:(e,t,n)=>{"use strict";var r=n(6857),i=n(8481),o=n(8073).slack,a=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,u=n(3988).simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=g(n);)y(n,e,t,v(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==i){var d=u===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=c,e.hasEdge(a,l)){var p=e.edge(n,c).cutvalue;s+=d?-p:p}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=f(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function v(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(0,e.node(t.v),u)&&c!==m(0,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=g,c.enterEdge=v,c.exchangeEdges=y},8073:(e,t,n)=>{"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038:e=>{e.exports="0.8.5"},8362:(e,t,n)=>{var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619:(e,t,n)=>{var r=n(117);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},9276:(e,t,n)=>{var r=n(117);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},4919:(e,t,n)=>{var r=n(8905),i=n(117);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},8905:(e,t,n)=>{var r=n(117),i=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),u=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6678:(e,t,n)=>{var r=n(117),i=n(6291);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},3590:(e,t,n)=>{var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s{e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(9888)}},498:(e,t,n)=>{var r=n(9888);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423:(e,t,n)=>{var r=n(117),i=n(6454),o=n(1737);e.exports=function(e,t){var n,a=new i,s={},l=new o;function u(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},6291:(e,t,n)=>{var r=n(117);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),i[u].onStack=!1,c.push(u)}while(s!==u);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},9888:(e,t,n)=>{var r=n(117);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},1737:(e,t,n)=>{var r=n(117);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priority{"use strict";var r=n(117);e.exports=s;var i="\0",o="\0",a="";function s(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function l(e,t){e[t]?e[t]++:e[t]=1}function u(e,t){--e[t]||delete e[t]}function c(e,t,n,o){var s=""+t,l=""+n;if(!e&&s>l){var u=s;s=l,l=u}return s+a+l+a+(r.isUndefined(o)?i:o)}function d(e,t){return c(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},s.prototype.setEdge=function(){var e,t,n,i,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=c(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return o&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,l(this._preds[t],e),l(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[t],e),u(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166:(e,t,n)=>{e.exports={Graph:n(6454),version:n(4458)}},7494:(e,t,n)=>{var r=n(117),i=n(6454);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},117:(e,t,n)=>{var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458:e=>{e.exports="2.1.8"},3143:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(9);function a(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in a.prototype=Object.create(r.prototype),r)a[s]=r[s];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},a.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(13),a=n(0),s=n(16),l=n(5);function u(e,t,n,a){null==n&&null==a&&(a=t),r.call(this,a),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=a,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new o(t.x,t.y,n.width,n.height):new o}for(var c in u.prototype=Object.create(r.prototype),r)u[c]=r[c];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}})),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)})),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach((function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}})),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>a.WORLD_BOUNDARY?t=a.WORLD_BOUNDARY:t<-a.WORLD_BOUNDARY&&(t=-a.WORLD_BOUNDARY);var n=this.rect.y;n>a.WORLD_BOUNDARY?n=a.WORLD_BOUNDARY:n<-a.WORLD_BOUNDARY&&(n=-a.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";var r=n(0);function i(){}for(var o in r)i[o]=r[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(0),a=n(7),s=n(3),l=n(1),u=n(13),c=n(12),d=n(11);function h(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof a?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in h.prototype=Object.create(r.prototype),r)h[p]=r[p];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},h.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(c,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},h.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,l=0;l(e=u.getTop())&&(r=e),o>(t=u.getLeft())&&(o=t)}return r==i.MAX_VALUE?null:(n=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-n,this.top=r-n,new c(this.left,this.top))},h.prototype.updateBounds=function(e){for(var t,n,r,o,a,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,d=-i.MAX_VALUE,h=this.nodes,p=h.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),c>(r=g.getTop())&&(c=r),d<(o=g.getBottom())&&(d=o)}var v=new u(s,c,l-s,d-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},h.calculateBounds=function(e){for(var t,n,r,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,d=e.length,h=0;h(t=p.getLeft())&&(a=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(o=p.getBottom())&&(c=o)}return new u(a,l,s-a,c-l)},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=h},function(e,t,n){"use strict";var r,i=n(1);function o(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var o=(r=t).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return n.isInterGraph=!1,o.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,o=[],a=(o=o.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var o=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(o=1);var a=o*n[0],s=n[1]/o;n[0]a)return n[0]=r,n[1]=l,n[2]=o,n[3]=b,!1;if(io)return n[0]=s,n[1]=i,n[2]=y,n[3]=a,!1;if(ro?(n[0]=c,n[1]=d,_=!0):(n[0]=u,n[1]=l,_=!0):T===M&&(r>o?(n[0]=s,n[1]=l,_=!0):(n[0]=h,n[1]=d,_=!0)),-N===M?o>r?(n[2]=m,n[3]=b,C=!0):(n[2]=y,n[3]=v,C=!0):N===M&&(o>r?(n[2]=g,n[3]=v,C=!0):(n[2]=x,n[3]=b,C=!0)),_&&C)return!1;if(r>o?i>a?(A=this.getCardinalDirection(T,M,4),D=this.getCardinalDirection(N,M,2)):(A=this.getCardinalDirection(-T,M,3),D=this.getCardinalDirection(-N,M,1)):i>a?(A=this.getCardinalDirection(-T,M,1),D=this.getCardinalDirection(-N,M,3)):(A=this.getCardinalDirection(T,M,2),D=this.getCardinalDirection(N,M,4)),!_)switch(A){case 1:O=l,I=r+-f/M,n[0]=I,n[1]=O;break;case 2:I=h,O=i+p*M,n[0]=I,n[1]=O;break;case 3:O=d,I=r+f/M,n[0]=I,n[1]=O;break;case 4:I=c,O=i+-p*M,n[0]=I,n[1]=O}if(!C)switch(D){case 1:k=v,P=o+-E/M,n[2]=P,n[3]=k;break;case 2:P=x,k=a+w*M,n[2]=P,n[3]=k;break;case 3:k=b,P=o+E/M,n[2]=P,n[3]=k;break;case 4:P=m,k=a+-w*M,n[2]=P,n[3]=k}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var o,a,s,l,u,c,d,h=e.x,p=e.y,f=t.x,g=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(d=(o=g-p)*(l=v-m)-(a=b-y)*(s=h-f))?null:new r((s*(c=m*y-v*b)-l*(u=f*p-h*g))/d,(a*u-o*c)/d)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var c=(-l+Math.sqrt(l*l-4*s*u))/(2*s),d=(-l-Math.sqrt(l*l-4*s*u))/(2*s);return c>=0&&c<=1?[c]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),a.add(c);var d=c.getEdges();for(o=0;o-1&&u.splice(g,1)}a=new Set,l=new Map}else e=[]}return e},h.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),o=0;o=0&&t.splice(d,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,o=t[0])}return o},h.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(4),o=n(0),a=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,a,s,l,u=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*o):(a>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||u>=s[0].length))for(var c=0;ce}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),a=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),s=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),u=0;u=0;D--)if(0!==this.s[D]){for(var I=D+1;I=0;B--){if(function(e,t){return e&&t}(B0;){var H=void 0,W=void 0;for(H=N-2;H>=-1&&-1!==H;H--)if(Math.abs(o[H])<=X+U*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){o[H]=0;break}if(H===N-2)W=4;else{var q=void 0;for(q=N-1;q>=H&&q!==H;q--){var K=(q!==N?Math.abs(o[q]):0)+(q!==H+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=X+U*K){this.s[q]=0;break}}q===H?W=3:q===N-1?W=1:(W=2,H=q)}switch(H++,W){case 1:var Z=o[N-2];o[N-2]=0;for(var $=N-2;$>=H;$--){var Q=r.hypot(this.s[$],Z),J=this.s[$]/Q,ee=Z/Q;this.s[$]=Q,$!==H&&(Z=-ee*o[$-1],o[$-1]=J*o[$-1]);for(var te=0;te=this.s[H+1]);){var Ne=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=Ne,HMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),a=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),a=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),a=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),a=n(3605),s=n(9817),l=n(945);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r{var r=n(8096),i=n(2428),o=n(6449),a=n(3656),s=n(361),l=n(7167),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&l(e),p=n||c||d||h,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!u.call(e,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||f.push(v);return f}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(7237)("length");e.exports=r},7805:(e,t,n)=>{var r=n(3360),i=n(5288);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547:(e,t,n)=>{var r=n(3360),i=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733:(e,t,n)=>{var r=n(1791),i=n(5950);e.exports=function(e,t){return e&&r(t,i(t),e)}},3838:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e,t){return e&&r(t,i(t),e)}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999:(e,t,n)=>{var r=n(7217),i=n(3729),o=n(6547),a=n(4733),s=n(3838),l=n(3290),u=n(3007),c=n(2271),d=n(8948),h=n(2),p=n(3349),f=n(5861),g=n(6189),v=n(7199),y=n(5529),m=n(6449),b=n(3656),x=n(7730),w=n(3805),E=n(8440),_=n(5950),C=n(7241),T="[object Arguments]",N="[object Function]",M="[object Object]",A={};A[T]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[N]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,D,I,O,P){var k,S=1&n,L=2&n,R=4&n;if(D&&(k=O?D(t,I,O,P):D(t)),void 0!==k)return k;if(!w(t))return t;var B=m(t);if(B){if(k=g(t),!S)return u(t,k)}else{var F=f(t),z=F==N||"[object GeneratorFunction]"==F;if(b(t))return l(t,S);if(F==M||F==T||z&&!O){if(k=L||z?{}:y(t),!S)return L?d(t,s(k,t)):c(t,a(k,t))}else{if(!A[F])return O?t:{};k=v(t,F,S)}}P||(P=new r);var j=P.get(t);if(j)return j;P.set(t,k),E(t)?t.forEach((function(r){k.add(e(r,n,D,r,t,P))})):x(t)&&t.forEach((function(r,i){k.set(i,e(r,n,D,i,t,P))}));var V=B?void 0:(R?L?p:h:L?C:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(k,i,e(r,n,D,i,t,P))})),k}},9344:(e,t,n)=>{var r=n(3805),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},3599:(e,t,n)=>{var r=n(4394);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(4528),i=n(5891);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},3335:e=>{e.exports=function(e,t){return e>t}},426:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},6131:(e,t,n)=>{var r=n(2523),i=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),a=n(689),s=n(5861),l=n(6449),u=n(3656),c=n(7167),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,v,y){var m=l(e),b=l(t),x=m?h:s(e),w=b?h:s(t),E=(x=x==d?p:x)==p,_=(w=w==d?p:w)==p,C=x==w;if(C&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(C&&!E)return y||(y=new r),m||c(e)?i(e,t,n,g,v,y):o(e,t,x,n,g,v,y);if(!(1&n)){var T=E&&f.call(e,"__wrapped__"),N=_&&f.call(t,"__wrapped__");if(T||N){var M=T?e.value():e,A=N?t.value():t;return y||(y=new r),v(M,A,n,g,y)}}return!!C&&(y||(y=new r),a(e,t,n,g,v,y))}},9172:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a{e.exports=function(e){return e!=e}},5083:(e,t,n)=>{var r=n(1882),i=n(7296),o=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},6038:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),a=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903:(e,t,n)=>{var r=n(3805),i=n(5527),o=n(181),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6176:e=>{e.exports=function(e,t){return e{var r=n(909),i=n(4894);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),a=n(8586),s=n(756),l=n(7197),u=n(7797);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},5250:(e,t,n)=>{var r=n(7217),i=n(7805),o=n(6649),a=n(2824),s=n(3805),l=n(7241),u=n(4974);e.exports=function e(t,n,c,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,c,e,d,h);else{var p=d?d(u(t,l),o,l+"",t,n,h):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},2824:(e,t,n)=>{var r=n(7805),i=n(3290),o=n(1961),a=n(3007),s=n(5529),l=n(2428),u=n(6449),c=n(3693),d=n(3656),h=n(1882),p=n(3805),f=n(1331),g=n(7167),v=n(4974),y=n(9884);e.exports=function(e,t,n,m,b,x,w){var E=v(e,n),_=v(t,n),C=w.get(_);if(C)r(e,n,C);else{var T=x?x(E,_,n+"",e,t,w):void 0,N=void 0===T;if(N){var M=u(_),A=!M&&d(_),D=!M&&!A&&g(_);T=_,M||A||D?u(E)?T=E:c(E)?T=a(E):A?(N=!1,T=i(_,!0)):D?(N=!1,T=o(_,!0)):T=[]:f(_)||l(_)?(T=E,l(E)?T=y(E):p(E)&&!h(E)||(T=s(_))):N=!1}N&&(w.set(_,T),b(T,_,m,x,w),w.delete(_)),r(e,n,T)}}},6155:(e,t,n)=>{var r=n(4932),i=n(7422),o=n(5389),a=n(5128),s=n(3937),l=n(7301),u=n(3714),c=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var h=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},6001:(e,t,n)=>{var r=n(7420),i=n(631);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},7420:(e,t,n)=>{var r=n(7422),i=n(3170),o=n(1769);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5558:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},9302:(e,t,n)=>{var r=n(3488),i=n(6757),o=n(2865);e.exports=function(e,t){return o(i(e,t,r),e+"")}},3170:(e,t,n)=>{var r=n(6547),i=n(1769),o=n(361),a=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,d=c-1,h=e;null!=h&&++u{var r=n(7334),i=n(3243),o=n(3488),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},3937:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),a=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},5765:(e,t,n)=>{var r=n(8859),i=n(5325),o=n(9905),a=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var u=-1,c=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,c=o;else if(d>=200){var g=t?null:s(e);if(g)return l(g);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++u{var r=n(4932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},1234:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r{e.exports=function(e,t){return e.has(t)}},4066:(e,t,n)=>{var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),a=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736:(e,t,n)=>{var r=n(1873),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730:(e,t,n)=>{var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e{var r=n(3730);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(6547),i=n(3360);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s{var r=n(1791),i=n(4664);e.exports=function(e,t){return r(e,i(e),t)}},8948:(e,t,n)=>{var r=n(1791),i=n(6375);e.exports=function(e,t){return r(e,i(e),t)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},999:(e,t,n)=>{var r=n(9302),i=n(6800);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},5508:(e,t,n)=>{var r=n(6151),i=n(6800),o=n(7400);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t{var r=n(6545),i=n(3950),o=n(4247),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},3243:(e,t,n)=>{var r=n(6110),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f{var r=n(1873),i=n(7828),o=n(5288),a=n(5911),s=n(317),l=n(4247),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,u,d,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=l;++d{var r=n(5970),i=n(6757),o=n(2865);e.exports=function(e){return o(i(e,void 0,r),e+"")}},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},3349:(e,t,n)=>{var r=n(2199),i=n(6375),o=n(7241);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},8879:(e,t,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},6375:(e,t,n)=>{var r=n(4528),i=n(8879),o=n(4664),a=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),a=n(6545),s=n(8303),l=n(2552),u=n(7473),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),v=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case v:return c;case y:return d;case m:return h;case b:return p}return t}),e.exports=x},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),a=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199:(e,t,n)=>{var r=n(9653),i=n(6169),o=n(3201),a=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},5529:(e,t,n)=>{var r=n(9344),i=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5891:(e,t,n)=>{var r=n(1873),i=n(2428),o=n(6449),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(5288),i=n(4894),o=n(361),a=n(3805);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586:(e,t,n)=>{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},6757:(e,t,n)=>{var r=n(1033),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},4974:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2865:(e,t,n)=>{var r=n(9570),i=n(1811)(r);e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6959:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r{var r=n(9811),i=n(9698),o=n(7927);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",c=u+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*",d="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+d+c,"g");e.exports=function(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}},2629:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,4)}},8055:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,5)}},7334:e=>{e.exports=function(e){return function(){return e}}},4684:(e,t,n)=>{var r=n(9302),i=n(5288),o=n(6800),a=n(7241),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n{e.exports=n(9754)},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},5970:(e,t,n)=>{var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},9754:(e,t,n)=>{var r=n(3729),i=n(909),o=n(4066),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},2420:(e,t,n)=>{var r=n(6649),i=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},1448:(e,t,n)=>{var r=n(426),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3693:(e,t,n)=>{var r=n(4894),i=n(346);e.exports=function(e){return i(e)&&r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},2193:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(2428),a=n(6449),s=n(4894),l=n(3656),u=n(5527),c=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:(e,t,n)=>{var r=n(9172),i=n(7301),o=n(6009),a=o&&o.isMap,s=a?i(a):r;e.exports=s},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1331:(e,t,n)=>{var r=n(2552),i=n(8879),o=n(346),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},8440:(e,t,n)=>{var r=n(6038),i=n(7301),o=n(6009),a=o&&o.isSet,s=a?i(a):r;e.exports=s},5015:(e,t,n)=>{var r=n(2552),i=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},2216:e=>{e.exports=function(e){return void 0===e}},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},7241:(e,t,n)=>{var r=n(695),i=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):i(e)}},8090:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:(e,t,n)=>{var r=n(4932),i=n(5389),o=n(5128),a=n(6449);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},3916:(e,t,n)=>{var r=n(3360),i=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},4506:(e,t,n)=>{var r=n(3599),i=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},5364:(e,t,n)=>{var r=n(5250),i=n(999)((function(e,t,n){r(e,t,n)}));e.exports=i},1684:(e,t,n)=>{var r=n(3599),i=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6533:(e,t,n)=>{var r=n(3599),i=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3950:e=>{e.exports=function(){}},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},4383:(e,t,n)=>{var r=n(6001),i=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),a=n(7797);e.exports=function(e){return o(e)?r(a(e)):i(e)}},3181:(e,t,n)=>{var r=n(5508)();e.exports=r},860:(e,t,n)=>{var r=n(882),i=n(909),o=n(5389),a=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},7091:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(4894),a=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031:(e,t,n)=>{var r=n(3120),i=n(6155),o=n(9302),a=n(6800),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9884:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e){return r(e,i(e))}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752:(e,t,n)=>{var r=n(3729),i=n(9344),o=n(641),a=n(5389),s=n(8879),l=n(6449),u=n(3656),c=n(1882),d=n(3805),h=n(7167);e.exports=function(e,t,n){var p=l(e),f=p||u(e)||h(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=f?p?new g:[]:d(e)&&c(g)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},299:(e,t,n)=>{var r=n(3120),i=n(9302),o=n(5765),a=n(3693),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},7200:(e,t,n)=>{var r=n(3222),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5880:(e,t,n)=>{var r=n(514),i=n(5950);e.exports=function(e){return null==e?[]:r(e,i(e))}},7248:(e,t,n)=>{var r=n(6547),i=n(1234);e.exports=function(e,t){return i(e||[],t||[],r)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(4497)})())); \ No newline at end of file diff --git a/package.json b/package.json index f6a30c2..35ce609 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nr-cytoscape-expand-collapse", - "version": "1.0.1", + "version": "1.0.2", "description": "This extension provides an interface to expand-collapse nodes", "main": "./src/index.js", "spm": { diff --git a/src/layoutUtilities.js b/src/layoutUtilities.js index 6cb2d2e..0fd7ab3 100644 --- a/src/layoutUtilities.js +++ b/src/layoutUtilities.js @@ -28,7 +28,7 @@ function getNodesByGroupLevels(nodes) { // Other levels else { // Calculate level based on the number of '::' in the parent - const level = parentId.split("::").length + 1; + const level = parentId.split("::").length; if (!levelGroups[level]) { levelGroups[level] = {}; @@ -44,15 +44,11 @@ function getNodesByGroupLevels(nodes) { // Convert the level groups to the required output format const result = Object.keys(levelGroups) - .sort((a, b) => parseInt(a) - parseInt(b)) - .map((level, index) => ({ - level: index + 1, // Explicitly set length to 1, 2, etc. - items: - level === "1" - ? [levelGroups[level].root] // For length 1, combine everything into a single group - : Object.values(levelGroups[level]), - })) - .reverse(); + .sort((a, b) => parseInt(b) - parseInt(a)) + .map((level) => ({ + level: level, + items: Object.values(levelGroups[level]), + })); return result ?? []; } From e46df1e53596247757290e6e00b7a5dd1b22d4f8 Mon Sep 17 00:00:00 2001 From: Nidhish Reddy Date: Thu, 26 Dec 2024 18:28:43 +0530 Subject: [PATCH 5/5] chore: refactor isGroupBy logic --- nr-cytoscape-expand-collapse.js | 2 +- package.json | 2 +- src/index.js | 19 +++++++++---------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/nr-cytoscape-expand-collapse.js b/nr-cytoscape-expand-collapse.js index 91c9101..59f5d7c 100644 --- a/nr-cytoscape-expand-collapse.js +++ b/nr-cytoscape-expand-collapse.js @@ -1,2 +1,2 @@ /*! For license information please see nr-cytoscape-expand-collapse.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.nrCytoscapeExpandCollapse=t():e.nrCytoscapeExpandCollapse=t()}(this,(()=>(()=>{var e={6078:e=>{var t={equalBoundingBoxes:function(e,t){return e.x1==t.x1&&e.x2==t.x2&&e.y1==t.y1&&e.y2==t.y2},getUnion:function(e,t){var n={x1:Math.min(e.x1,t.x1),x2:Math.max(e.x2,t.x2),y1:Math.min(e.y1,t.y1),y2:Math.max(e.y2,t.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=t},4540:(e,t,n)=>{var r=n(3630),i=n(438);e.exports=function(e,t,o){var a,s,l=e;const u=function(){var e=t.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=t.container(),u=e.getContext("2d");l.append(e),a=n(1537)(t);var c=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}},d=r((function(){e.height=t.container().offsetHeight,e.width=t.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),r=c(l);e.style.top=-(n.top-r.top),e.style.left=-(n.left-r.left),t&&g()}),0)}),250);function h(){d()}h();var p={};function f(){return t.scratch("_cyExpandCollapse").options}function g(){var e=t.width(),n=t.height();u.clearRect(0,0,e,n),s=null}function v(e,t,n,r,i){var o=new Image(r,i);o.src=e,o.onload=()=>{u.drawImage(o,t,n,r,i)}}t.on("resize",p.eCyResize=function(){h()}),t.on("expandcollapse.clearvisualcue",(function(){s&&g()}));var y,m=null,b=null;t.on("mousedown",p.eMouseDown=function(e){m=e.renderedPosition||e.cyRenderedPosition}),t.on("mouseup",p.eMouseUp=function(e){b=e.renderedPosition||e.cyRenderedPosition}),t.on("remove","node",p.eRemove=function(e){e.target==s&&g()}),t.on("select unselect",p.eSelect=function(){s&&g();var e=t.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),r=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||r){var i,o=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var d=t.zoom()<1?l/(2*t.zoom()):l/2,h=parseFloat(e.css("border-width"));i={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+h+d+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+h+d+1}}else{var p=f().expandCollapseCuePosition;i="function"==typeof p?p.call(this,e):p}var g=a.convertToRenderedPosition(i),y=((l=Math.max(l,l*t.zoom()))-(c=Math.max(c,c*t.zoom())))/2,m=g.x,b=g.y,x=m-l/2,w=b-l/2,E=l;if(o&&f().expandCueImage)v(f().expandCueImage,x,w,l,l);else if(!o&&f().collapseCueImage)v(f().collapseCueImage,x,w,l,l);else{var _=u.fillStyle,C=u.lineWidth,T=u.strokeStyle;u.fillStyle="black",u.strokeStyle="black",u.ellipse(m,b,l/2,l/2,0,0,2*Math.PI),u.fill(),u.beginPath(),u.strokeStyle="white",u.lineWidth=Math.max(2.6,2.6*t.zoom()),u.moveTo(x+y,w+l/2),u.lineTo(x+c+y,w+l/2),o&&(u.moveTo(x+l/2,w+y),u.lineTo(x+l/2,w+c+y)),u.closePath(),u.stroke(),u.strokeStyle=T,u.fillStyle=_,u.lineWidth=C}e._private.data.expandcollapseRenderedStartX=x,e._private.data.expandcollapseRenderedStartY=w,e._private.data.expandcollapseRenderedCueSize=E,s=e}}(n)}}),t.on("tap",p.eTap=function(e){var n=s;if(n){var r=n.data("expandcollapseRenderedStartX"),i=n.data("expandcollapseRenderedStartY"),a=n.data("expandcollapseRenderedCueSize"),l=r+a,u=i+a,c=e.renderedPosition||e.cyRenderedPosition,d=c.x,h=c.y,p=f(),v=(p.expandCollapseCueSensitivity-1)/2;Math.abs(m.x-b.x)<5&&Math.abs(m.y-b.y)<5&&d>=r-a*v&&d<=l+a*v&&h>=i-a*v&&h<=u+a*v&&(p.undoable&&!y&&(y=t.undoRedo({defaultActions:!1})),o.isCollapsible(n)?(g(),p.undoable?y.do("collapse",{nodes:n,options:p}):o.collapse(n,p)):o.isExpandable(n)&&(g(),p.undoable?y.do("expand",{nodes:n,options:p}):o.expand(n,p)),n.selectable()&&(n.unselectify(),t.scratch("_cyExpandCollapse").selectableChanged=!0))}}),t.on("afterUndo afterRedo",p.eUndoRedo=p.eSelect),t.on("position","node",p.ePosition=i(p.eSelect,100,g)),t.on("pan zoom",p.ePosition),p.hasEventFields=!0,function(e){var n=t.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,t.scratch("_cyExpandCollapse",n)}(p)},unbind:function(){var e=u();e.hasEventFields?(t.trigger("expandcollapse.clearvisualcue"),t.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=u();e.hasEventFields?t.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(t.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(t.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},3630:e=>{var t,n,r=(t=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,r,i){var o,a,s,l,u,c,d,h,p,f=0,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(r=r<0?0:+r||0,!0===i){var y=!0;v=!1}else p=typeof(h=i),!h||"object"!=p&&"function"!=p||(y=!!i.leading,g="maxWait"in i&&t(+i.maxWait||0,r),v="trailing"in i?!!i.trailing:v);function m(t,r){r&&clearTimeout(r),a=c=d=void 0,t&&(f=n(),s=e.apply(u,o),c||a||(o=u=void 0))}function b(){var e=r-(n()-l);e<=0||e>r?m(d,a):c=setTimeout(b,e)}function x(){m(v,c)}function w(){if(o=arguments,l=n(),u=this,d=v&&(c||!y),!1===g)var t=y&&!c;else{a||y||(f=l);var i=g-(l-f),h=i<=0||i>g;h?(a&&(a=clearTimeout(a)),f=l,s=e.apply(u,o)):a||(a=setTimeout(x,i))}return h&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(b,r)),t&&(h=!0,s=e.apply(u,o)),!h||c||a||(o=u=void 0),s}return w.cancel=function(){c&&clearTimeout(c),a&&clearTimeout(a),f=0,a=c=d=void 0},w});e.exports=r},438:e=>{e.exports=function(e,t,n){let r,i=!0;return function(){const o=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,e.apply(o,a),i=!0}),t),i&&(n.apply(o,a),i=!1)}}},1537:(e,t,n)=>{const{runLayoutAsync:r}=n(8647);e.exports=function(e){return{moveNodes:function(e,t,n){var r=n?t:this.getTopMostNodes(t),i=r.not(":parent");i.positions((function(t,n){return{x:i[n].position("x")+e.x,y:i[n].position("y")+e.y}}));for(var o=0;o"group"===e.data().type)).length){const n={};(e?.scratch("_cyExpandCollapse")?.positions??[]).forEach((({nodeId:e,position:t})=>{n[e]=t})),await r(e.layout({name:"preset",fit:!1,positions:n,zoom:e.zoom(),pan:e.pan(),padding:t?.padding??50,animate:t?.animate??!0,animationDuration:t?.animationDuration??500,animationEasing:t?.animationEasing}))}e.scratch("_cyExpandCollapse").positions=null}},convertToRenderedPosition:function(t){var n=e.pan(),r=e.zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}}}},9272:(e,t,n)=>{var r=n(6078);e.exports=function(e){var t=n(1537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,r,i){if(n._private.data.collapsedChildren){var o={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var a=n._private.data.collapsedChildren;a.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,t){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,t),e.removeData("expand"));for(var n=e.children(),r=0;rs?(u+=p,c-=p):(u-=p,c+=p),e._private.data["y-before-fisheye"]>l?(d+=f,h-=f):(d-=f,h+=f);for(var g=[],v=[],y=0;yw?u:c,b=l>E?d:h,isFinite(_)&&(C=Math.min(m,b/Math.abs(_))),0!==_&&(T=Math.min(b,m*Math.abs(_))),s>w&&(C*=-1),l>E&&(T*=-1),this.fishEyeViewMoveNode(x,C,T,n,t,r,i,o)}return 0==a.length&&e.same(n)&&this.expandNodeBaseFunction(n,t,i),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],t,n,r,i,o),e},getSiblings:function(t){return null==t.parent()[0]?e.nodes(":visible").orphans().difference(t):t.siblings(":visible")},fishEyeViewMoveNode:function(t,n,r,i,o,a,s,l){var u=e.collection();t.isParent()&&(u=t.children(":visible"));var c=this;if(0==u.length){var d={x:t._private.position.x+n,y:t._private.position.y+r};o&&a?(this.animatedlyMovingNodeCount++,t.animate({position:d,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!i.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(i,o,s)}},{duration:l||1e3})):t.position(d)}else for(var h=0;h0?r.add(i):r.add(n)}return r},expandEdge:function(t){t.unselect();var n={edges:e.collection(),oldEdges:e.collection()},r=t.data("collapsedEdges");return void 0!==r&&r.length>0&&(t.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(t),e.remove(t),n.edges=e.add(r),t.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var t=this.getEdgesDistinctEndPoints(e);return 2==t.length&&t},getEdgesDistinctEndPoints:function(e){var t=[];return e.forEach(function(e){this.containsElement(t,e.source())||t.push(e.source()),this.containsElement(t,e.target())||t.push(e.target())}.bind(this)),t},containsElement:function(e,t){for(var n=!1,r=0;r{const r=n(4726),i=n(6527),o=n(5111);e.exports=function(e){const t=e.json();let n=document.getElementById("support-map");return n.style.width=e.container().clientWidth+"px",n.style.height=e.container().clientHeight+"px",r.use(i),r.use(o),r({container:n,elements:t.elements,styleEnabled:!0,style:t.style})}},4497:(e,t,n)=>{var r;!function(){"use strict";var i=function(e){if(!e)return;var t=n(9699),r=n(4540);const i=n(3666),{runLayoutAsync:o,resolveCompoundNodesOverlap:a}=n(8647);var s=null;function l(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n.hasOwnProperty(r)&&(n[r]=t[r]);return n}function u(e){var t="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=t,e.fisheye=n}function c(e,t){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===t?n:n[t]}function d(e,t,n){c(e)[t]=n}e("core","expandCollapse",(function(e){var h=this;const p=document.querySelector(".map.__________cytoscape_container"),f=document.getElementById("support-map");if(p&&!f){const e=document.createElement("div");e.id="support-map",e.style.zIndex=-1,e.style.opacity=0,p.parentNode.insertBefore(e,p.nextSibling)}var g=c(h,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999,isGroupBy:!0};if("get"!==e){g=l(g,e);var v=function(e,t){var n={};function h(t){var r=c(e,"options");t.cueEnabled&&!r.cueEnabled?n.enableCue():!t.cueEnabled&&r.cueEnabled&&n.disableCue()}return n.setOptions=function(t){h(t),d(e,"options",t)},n.extendOptions=function(t){var n=l(c(e,"options"),t);h(n),d(e,"options",n)},n.setOption=function(t,n){var r={};r[t]=n;var i=l(c(e,"options"),r);h(i),d(e,"options",i)},n.collapse=async function(n,r){var s=this.collapsibleNodes(n);if(r?.isGroupBy){var h=i(e),p=s.map((e=>{var t=h.getElementById(e.id());return t.toggleClass("expanded",!1),t.toggleClass("cy-expand-collapse-collapsed-node",!0),t.toggleClass("collapsed",!0),t}));if(p.length){var f=h.collection(p);t.simpleCollapseGivenNodes(f);var g=c(e,"options").layoutBy;await o(h.layout({...g,animate:!1})),await a(h,{...g,animate:!1});var v=h.nodes().map((e=>({nodeId:e.id(),position:e.position()})));h.destroy(),d(e,"positions",v)}}var y=l(c(e,"options"),r);return u(y),t.collapseGivenNodes(s,y)},n.collapseRecursively=async function(t,n){var r=this.collapsibleNodes(t),i=l(c(e,"options"),n);return u(i),await this.collapse(r.union(r.descendants()),i)},n.expand=async function(n,r){if(r?.isGroupBy){var s=i(e),h=s.getElementById(n.id()),p=h._private.data.collapsedChildren;s.add(p),h.toggleClass("cy-expand-collapse-collapsed-node",!1),h.toggleClass("collapsed",!1),h.toggleClass("expanded",!0);var f=c(e,"options").layoutBy;await o(s.layout({...f,animate:!1})),await a(s,{...f,animate:!1});var g=s.nodes().map((e=>({nodeId:e.id(),position:e.position()})));s.destroy(),d(e,"positions",g)}var v=this.expandableNodes(n),y=l(c(e,"options"),r);return u(y),t.expandGivenNodes(v,y)},n.expandRecursively=function(n,r){var i=this.expandableNodes(n),o=l(c(e,"options"),r);return u(o),t.expandAllNodes(i,o)},n.collapseAll=async function(t){var n=l(c(e,"options"),t);return u(n),await this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(t){var n=l(c(e,"options"),t);return u(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isCollapsible(e)}))},n.expandableNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var r=e.collection();return t.getCollapsedChildrenRecursively(n,r)},n.getAllCollapsedChildrenRecursively=function(){var t,n=e.collection(),r=e.nodes(".cy-expand-collapse-collapsed-node");for(t=0;t[e,e])));var u={edges:e.collection(),oldEdges:e.collection()};return s.forEach(function(e){const n=e[1].id();var r=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(r=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),r.length>=2){var i=t.collapseGivenEdges(r,a);u.oldEdges=u.oldEdges.add(i.oldEdges),u.edges=u.edges.add(i.edges)}}.bind(this)),u},n.expandEdgesBetweenNodes=function(t){var n,r,i=e.collection(),o=(r=[],(n=t).slice(0,n.length-1).forEach((function(e,t){n.slice(t+1,n.length).forEach((function(t){r.push([e,t])}))})),r);return o.push(...t.map((e=>[e,e]))),o.forEach(function(e){const t=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+t+'"],[target = "'+t+'"]');e[0].id()===t&&(n=e[0].connectedEdges('[source = "'+t+'"][target = "'+t+'"]')),i=i.union(n)}.bind(this)),this.expandEdges(i)},n.collapseAllEdges=function(t){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),t)},n.expandAllEdges=function(){var t=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},r=this.expandEdges(t);return n.oldEdges=n.oldEdges.add(r.oldEdges),n.edges=n.edges.add(r.edges),n},n.loadJson=function(e){s.loadJson(e)},n.saveJson=function(e,t){return s.saveJson(e,t)},n}(h,n(9272)(h));s=n(554)(h,v),d(h,"api",v),t(h,v),r(g,h,v),g.cueEnabled||r("unbind",h,v),g.ready&&g.ready(),d(h,"options",g),d(h,"parentData",{})}return c(h,"api")}))};e.exports&&(e.exports=i),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r),"undefined"!=typeof cytoscape&&i(cytoscape)}()},8647:(e,t,n)=>{function r(e){return new Promise((t=>{e.on("layoutstop",t),e.run()}))}e.exports={runLayoutAsync:r,resolveCompoundNodesOverlap:async function(e,t){const i=n(1537)(e);if(e.nodes().filter((e=>"positioning-support"===e.data().type)).length)return;const o=function(e){const t={};return e.filter((e=>"default"!==e.data().type)).forEach((e=>{const n=e.data().parent;if(void 0===n)t[1]||(t[1]={root:[]}),t[1].root.push(e);else{const r=n.split("::").length;t[r]||(t[r]={}),t[r][n]||(t[r][n]=[]),t[r][n].push(e)}})),Object.keys(t).sort(((e,t)=>parseInt(t)-parseInt(e))).map((e=>({level:e,items:Object.values(t[e])})))??[]}(e.nodes());for(let n=0;n{if(!t.hasClass("cy-expand-collapse-collapsed-node")&&t.isParent()){const n=`support ${t.data().id}`,r={group:"nodes",data:{id:n,parent:t.data().parent,type:"positioning-support",label:`${t.data().label}`},style:{width:t.boundingBox().w,height:t.boundingBox().h,padding:0,"min-width":0,"border-width":0,shape:"round-rectangle"},position:{x:t.position("x"),y:t.position("y")}};e.add(r);const i=t.remove();a=a.union(i);const o=e.getElementById(n);return s=s.union(o),o}return t}));l=l.union(r)}if(0===a.length&&1===o.length){const e=l.layout(t);await r(e)}else if(a.length>0){const n=l.layout(t);await r(n),a.restore(),a.forEach((t=>{if("edges"!==t.group()||"default"===t.data()?.type){const n=`support ${t.data().id}`,r=e.getElementById(n);if(r?.length){const e={x:t.position().x{e.exports=function(e,t){function n(t,i,o,a){t.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,t){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),r={layoutBy:null,animate:!1,fisheye:!1},i=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],o=0;o0?t[n](i.options):t[n](c,i.options)):(u.oldData=a(),u.nodes=n.indexOf("All")>0?t[n](r):t[n](e.collection(c),r),s=i.oldData,l={},e.nodes().not(":parent").positions((function(e,t){"number"==typeof e&&(e=t),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),u}}function l(n){var r=n.options,i=n.edges,o={};if(o.options=r,n.firstTime){var a=t.collapseEdges(i,r);o.edges=a.edges,o.oldEdges=a.oldEdges,o.firstTime=!1}else o.oldEdges=i,o.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return o}function u(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function c(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function d(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdges(n.edges);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.oldEdges=n.edges,i.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function h(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function p(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}}},7799:function(e,t,n){var r;r=function(e){return(()=>{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var o in r)i[o]=r[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),o=n(880),a=n(991),s=n(767),l=n(806),u=n(902),c=n(551).FDLayoutConstants,d=n(551).LayoutConstants,h=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,v=n(551).Integer,y=n(551).IGeometry,m=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},w.prototype.newNode=function(e){return new a(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var n=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,o=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(o)||(e.nodesInRelativeVertical.push(o),e.nodeToRelativeConstraintMapVertical.set(o,[]),e.dummyToNodeForHorizontalAlignment.has(o)?e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(o).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:t.gap})}}));else{var d=new Map,h=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var t=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;h.has(r)?h.get(r).push(i):h.set(r,[i]),h.has(i)?h.get(i).push(r):h.set(i,[r])}}));var p=function(e,t){var n=[],r=[],i=new x,o=new Set,a=0;return e.forEach((function(s,l){if(!o.has(l)){n[a]=[],r[a]=!1;var u=l;for(i.push(u),o.add(u),n[a].push(u);0!=i.length;)u=i.shift(),t.has(u)&&(r[a]=!0),e.get(u).forEach((function(e){o.has(e)||(i.push(e),o.add(e),n[a].push(e))}));a++}})),{components:n,isFixed:r}},f=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(h,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(a.y)),o=Math.floor(a.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-a.x/2,d.WORLD_CENTER_Y-a.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),o=new b;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(n.x),o.setWorldOrgY(n.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=c.indexOf(v);m>=0&&c.splice(m,1),f--,d--}h=null!=t?(c.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/d,x=h;p!=d;x=++x%f){var E=c[x].getOtherEnd(e);if(E!=t){var _=(n+p*b)%360,C=(_+b)%360;w.branchRadialLayout(E,e,_,C,i+o,o),p++}}},w.maxDiagonalInTree=function(e){for(var t=v.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),o=new a(e.graphManager);o.id=r,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=o;var s=e.getGraphManager().add(e.newGraph(),o),l=i.getChild();l.add(o);for(var u=0;ui?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):"bottom"==r.labelPosVertical&&r.setHeight(o+r.labelHeight))}}))},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,o=t.labelMarginLeft,a=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,o,a)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,o=r.paddingTop,a=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,o,a,s)}))},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=h.rect.height)}n+=c+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())}));var u,c=o/i,d=a/i,h=Math.pow(n-r,2)+4*(c+r)*(d+n)*i,p=(r-n+Math.sqrt(h))/(2*(c+r));t?(u=Math.ceil(p))==p&&u++:u=Math.floor(p);var f=u*(c+r)-r;return s>f&&(f=s),f+2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},u=function(e,t){return s(t)-s(e)};e.sort((function(e,t){var n=u;return a.idealRowWidth?(n=o)(e.id,t.id):n(e,t)}));for(var c=0,d=0,h=0;h0&&(o+=e.horizontalPadding),e.rowWidth[n]=o,e.width0&&(a+=e.verticalPadding);var s=0;a>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=a,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var o=e.rowWidth[i];if(o+e.horizontalPadding+t<=e.width)return!0;var a,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),a=e.width-o>=t+e.horizontalPadding?(e.height+l)/(o+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtho&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-o,e.rowWidth[n]=e.rowWidth[n]+o,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=r[s].height);t>0&&(a+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=a,e.rowHeight[n]0)for(var d=i;d<=o;d++)u[0]+=this.grid[d][a-1].length+this.grid[d][a].length-1;if(o0)for(d=a;d<=s;d++)u[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var h,p,f=v.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function o(e,t,n,i){r.call(this,e,t,n,i)}for(var a in o.prototype=Object.create(r.prototype),r)o[a]=r[a];o.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var o=0;r.forEach((function(e){"horizontal"==t?(d.set(e,l.has(e)?u[l.get(e)]:i.get(e)),o+=d.get(e)):(d.set(e,l.has(e)?c[l.get(e)]:i.get(e)),o+=d.get(e))})),o/=r.length,e.forEach((function(e){n.has(e)||d.set(e,o)}))}else{var a=0;e.forEach((function(e){a+="horizontal"==t?l.has(e)?u[l.get(e)]:i.get(e):l.has(e)?c[l.get(e)]:i.get(e)})),a/=e.length,e.forEach((function(e){d.set(e,a)}))}}));for(var f=function(){var r=p.shift();e.get(r).forEach((function(e){if(d.get(e.id)a&&(a=y),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!h&&v.return&&v.return()}finally{if(p)throw f}}var x=(r+a)/2-(o+s)/2,w=!0,E=!1,_=void 0;try{for(var C,T=e[Symbol.iterator]();!(w=(C=T.next()).done);w=!0){var N=C.value;d.set(N,d.get(N)+x)}}catch(e){E=!0,_=e}finally{try{!w&&T.return&&T.return()}finally{if(E)throw _}}}))}return d},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach((function(e){e.left?u[l.get(e.left)]-u[l.get(e.right)]>=0?t++:n++:c[l.get(e.top)]-c[l.get(e.bottom)]>=0?r++:i++})),t>n&&r>i)for(var o=0;on)for(var a=0;ai)for(var s=0;s1)t.fixedNodeConstraint.forEach((function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[u[l.get(e.nodeId)],c[l.get(e.nodeId)]]})),_=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach((function(e){i.add(e)}));var o,a=new Set([].concat(r(i)).filter((function(e){return T.has(e)})));o=a.size>0?u[l.get(a.values().next().value)]:g(i).x,n[t].forEach((function(t){w[e]=[o,c[l.get(t)]],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},o=0;o0?u[l.get(o.values().next().value)]:g(n).y,a[t].forEach((function(t){w[e]=[u[l.get(t)],i],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},d=0;dD&&(D=A[O].length,I=O);if(D0){var W={x:0,y:0};t.fixedNodeConstraint.forEach((function(e,t){var n,r,i=(r={x:u[l.get(e.nodeId)],y:c[l.get(e.nodeId)]},{x:(n=e.position).x-r.x,y:n.y-r.y});W.x+=i.x,W.y+=i.y})),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,u.forEach((function(e,t){u[t]+=W.x})),c.forEach((function(e,t){c[t]+=W.y})),t.fixedNodeConstraint.forEach((function(e){u[l.get(e.nodeId)]=e.position.x,c[l.get(e.nodeId)]=e.position.y}))}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var q=t.alignmentConstraint.vertical,K=function(e){var t=new Set;q[e].forEach((function(e){t.add(e)}));var n,i=new Set([].concat(r(t)).filter((function(e){return T.has(e)})));n=i.size>0?u[l.get(i.values().next().value)]:g(t).x,t.forEach((function(e){T.has(e)||(u[l.get(e)]=n)}))},Z=0;Z0?c[l.get(i.values().next().value)]:g(t).y,t.forEach((function(e){T.has(e)||(c[l.get(e)]=n)}))},J=0;J<$.length;J++)Q(J)}t.relativePlacementConstraint&&function(){var e=new Map,n=new Map,r=new Map,i=new Map,o=new Map,a=new Map,s=new Set,d=new Set;if(T.forEach((function(e){s.add(e),d.add(e)})),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var h=t.alignmentConstraint.vertical,p=function(t){r.set("dummy"+t,[]),h[t].forEach((function(n){e.set(n,"dummy"+t),r.get("dummy"+t).push(n),T.has(n)&&s.add("dummy"+t)})),o.set("dummy"+t,u[l.get(h[t][0])])},f=0;f{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(45);return r})()},e.exports=r(n(3143))},5111:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=function(e){return"function"==typeof e},o=n(2),a=n(3),s=n(4);function l(e){this.options=a({},o,e)}l.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=function(e,t){return i(t)?t.apply(e,[e]):t},a=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===a.x2&&(a.x2=a.x1+a.w),void 0===a.w&&(a.w=a.x2-a.x1),void 0===a.y2&&(a.y2=a.y1+a.h),void 0===a.h&&(a.h=a.y2-a.y1);var l=new s.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),l.setGraph(u),l.setDefaultEdgeLabel((function(){return{}})),l.setDefaultNodeLabel((function(){return{}}));var d=n.nodes();i(e.sort)&&(d=d.sort(e.sort));for(var h=0;h1?t-1:0),r=1;r{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,o={getTopMostNodes:function(e){for(var t={},n=0;n0&&u.merge(e)}));for(var c=0;c1){u=s[0],c=u.connectedEdges().length,s.forEach((function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,u=!1,c=void 0;try{for(var d,h=t.nodeIndexes[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=r(p,2),g=f[0],v=f[1],y=n.cy.getElementById(g);if(y){var m=y.boundingBox(),b=t.xCoords[v]-m.w/2,x=t.xCoords[v]+m.w/2,w=t.yCoords[v]-m.h/2,E=t.yCoords[v]+m.h/2;bo&&(o=x),ws&&(s=E)}}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}var _=e.x-(o+i)/2,C=e.y-(s+a)/2;t.xCoords=t.xCoords.map((function(e){return e+_})),t.yCoords=t.yCoords.map((function(e){return e+C}))}else{Object.keys(t).forEach((function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,u=n.getRect().y,c=n.getRect().y+n.getRect().height;ro&&(o=l),us&&(s=c)}));var T=e.x-(o+i)/2,N=e.y-(s+a)/2;Object.keys(t).forEach((function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+N)}))}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,u=void 0,c=void 0,d=void 0,h=e.descendants().not(":parent"),p=h.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),o<(u=t[r.get(g.id())]+g.width()/2)&&(o=u),a>(c=n[r.get(g.id())]-g.height()/2)&&(a=c),s<(d=n[r.get(g.id())]+g.height()/2)&&(s=d)}var v={};return v.topLeftX=i,v.topLeftY=a,v.width=o-i,v.height=s-a,v},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach((function(e){var t=!1;e.children().forEach((function(e){"none"!=e.css("display")&&(t=!0)})),t||n.merge(e)})),n}};e.exports=o},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,o=n(140).CoSENode,a=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,u=n(140).layoutBase.FDLayoutConstants,c=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,h=d.nodes(),p=d.edges(),f=void 0,g=void 0,v=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,v=t.yCoords);var m=function(e){return"function"==typeof e},b=function(e,t){return m(e)?e(t):e},x=r.calcParentsWithoutChildren(n,d);null!=e.nestingFactor&&(c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(c.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(c.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(c.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(c.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,c.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,c.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,c.TILE=e.tile,c.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1),"enforced"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1),"cose"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?c.TREE_REDUCTION_ON_INCREMENTAL=!1:c.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var u=n.length,c=0;c0&&e(i.getGraphManager().add(i.newGraph(),p),h,i,l)}}(E.addRoot(),r.getTopMostNodes(h),w,e),function(t,n,r){for(var i=0,o=0,a=0;a0?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=i/o:m(e.idealEdgeLength)?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,c.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(d){var h=o.getTopMostNodes(e.eles.nodes());if((l=o.connectComponents(t,e.eles,h)).forEach((function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),e.randomize&&l.forEach((function(t){e.eles=t,r.push(a(e))})),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,v={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach((function(e,t){0==e.edges().length&&(e.nodes().forEach((function(t,n){p.merge(e.nodes()[n]),t.isParent()||(v.nodeIndexes.set(e.nodes()[n].id(),g++),v.xCoords.push(e.nodes()[0].position().x),v.yCoords.push(e.nodes()[0].position().y))})),y.push(t))})),p.length>1){var m=p.boundingBox();u.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),l.push(p),r.push(v);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),u.splice(y[b],1)}}l.forEach((function(t,n){e.eles=t,i.push(s(e,r[n])),o.relocateComponent(u[n],i[n],e)}))}else l.forEach((function(t,n){o.relocateComponent(u[n],r[n],e)}));var x=new Set;if(l.length>1){var w=[],E=n.filter((function(e){return"none"==e.css("display")}));l.forEach((function(t,n){var a=void 0;if("draft"==e.quality&&(a=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach((function(t){if("draft"==e.quality)if(t.isParent()){var u=o.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:u.topLeftX,y:u.topLeftY,width:u.width,height:u.height})}else l=a.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})})),t.edges().forEach((function(t){var l=t.source(),u=t.target();if("none"!=l.css("display")&&"none"!=u.css("display"))if("draft"==e.quality){var c=a.get(l.id()),d=a.get(u.id()),h=[],p=[];if(l.isParent()){var f=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);h.push(f.topLeftX+f.width/2),h.push(f.topLeftY+f.height/2)}else h.push(r[n].xCoords[c]),h.push(r[n].yCoords[c]);if(u.isParent()){var g=o.calcBoundingBox(u,r[n].xCoords,r[n].yCoords,a);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[d]),p.push(r[n].yCoords[d]);s.edges.push({startX:h[0],startY:h[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][u.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][u.id()].getCenterX(),endY:i[n][u.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),x.add(n))}}));var _=c.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach((function(e,t){var n=e.xCoords.map((function(e){return e+_[t].dx})),r=e.yCoords.map((function(e){return e+_[t].dy}));e.xCoords=n,e.yCoords=r}));else{var C=0;x.forEach((function(e){Object.keys(i[e]).forEach((function(t){var n=i[e][t];n.setCenter(n.getCenterX()+_[C].dx,n.getCenterY()+_[C].dy)})),C++}))}}}else{var T=e.eles.boundingBox();if(u.push({x:T.x1+T.w/2,y:T.y1+T.h/2}),e.randomize){var N=a(e);r.push(N)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),o.relocateComponent(u[0],i[0],e)):o.relocateComponent(u[0],r[0],e)}var M=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var o=void 0,a=void 0,s=t.data("id");return i.forEach((function(e){s in e&&(o={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},a=e[s])})),e.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.labelHeight/2))),null==o&&(o={x:t.position("x"),y:t.position("y")}),{x:o.x,y:o.y}}var l=void 0;return r.forEach((function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})})),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=o.calcParentsWithoutChildren(t,n),D=n.filter((function(e){return"none"==e.css("display")}));e.eles=n.not(D),n.nodes().not(":parent").not(D).layoutPositions(this,e,M),A.length>0&&A.forEach((function(e){e.position(M(e))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=u},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,o=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,a=n.nodes(),s=n.nodes(":parent"),l=new Map,u=new Map,c=new Map,d=[],h=[],p=[],f=[],g=[],v=[],y=[],m=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,_=e.samplingType,C=e.nodeSeparation,T=void 0,N=function(e,t,n){for(var r=[],i=0,o=0,a=0,s=void 0,l=[],c=0,h=1,p=0;p=i;){a=r[i++];for(var f=d[a],y=0;yc&&(c=g[w],h=w)}return h};r.connectComponents(t,n,r.getTopMostNodes(a),l),s.forEach((function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)}));for(var M=0,A=0;A0&&(r.isParent()?d[t].push(c.get(r.id())):d[t].push(r.id()))}))}));var R=function(e){var n=u.get(e),r=void 0;l.get(e).forEach((function(i){r=t.getElementById(i).isParent()?c.get(i):i,d[n].push(r),d[u.get(r)].push(e)}))},B=!0,F=!1,z=void 0;try{for(var j,V=l.keys()[Symbol.iterator]();!(B=(j=V.next()).done);B=!0)R(j.value)}catch(e){F=!0,z=e}finally{try{!B&&V.return&&V.return()}finally{if(F)throw z}}var G=void 0;if((b=u.size)>2){T=b=1)break;u=l}for(var f=0;f=1)break;u=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(579);return r})()},e.exports=r(n(7799))},4726:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var h="undefined"==typeof window?null:window,p=h?h.navigator:null;h&&h.document;var f=r(""),g=r({}),v=r((function(){})),y="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&r(e)==f},x=function(e){return null!=e&&r(e)===v},w=function(e){return!T(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&r(e)===g&&!w(e)&&e.constructor===Object},_=function(e){return null!=e&&r(e)===r(1)&&!isNaN(e)},C=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},T=function(e){return N(e)||M(e)},N=function(e){return"collection"===m(e)&&e._private.single},M=function(e){return"collection"===m(e)&&!e._private.single},A=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},I=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},O=function(e){return function(e){return null!=e&&r(e)===g}(e)&&x(e.then)},P=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},Y=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=t||n<0||d&&e-u>=o}function g(){var e=Q();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?ye(n,o-(e-u)):n}(e))}function v(e){return s=void 0,h&&r?p(e):(r=i=void 0,a)}function y(){var e=Q(),n=f(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),c?p(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ge(t)||0,W(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ve(ge(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Q())},y},be=h?h.performance:null,xe=be&&be.now?function(){return be.now()}:function(){return Date.now()},we=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(xe())}),1e3/60)}}(),Ee=function(e){return we(e)},_e=xe,Ce=9261,Te=5381,Ne=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Me=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce)+e|0},Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Te;return(t<<5)+t+e|0},De=function(e){return 2097152*e[0]+e[1]},Ie=function(e,t){return[Me(e[0],t[0]),Ae(e[1],t[1])]},Oe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ne({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},$e=function(e){e.splice(0,e.length)},Qe=function(e,t,n){return n&&(t=L(n,t)),e[t]},Je=function(e,t,n,r){n&&(t=L(n,t)),e[t]=r},et="undefined"!=typeof Map?Map:function(){function e(){i(this,e),this._obj={}}return a(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),tt=function(){function e(t){if(i(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&A(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new nt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);in;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;og;0<=g?++h:--h)v.push(o(e,r));return v},f=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},g=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i0;){var _=y.pop(),C=g(_),T=_.id();if(d[T]=C,C!==1/0)for(var N=_.neighborhood().intersect(p),M=0;M0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},ct={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t0;){if(u=(l=g.pop()).id(),v.delete(u),w++,u===d){for(var E=[],_=i,C=d,T=m[C];E.unshift(_),null!=T&&E.unshift(T),null!=(_=y[C]);)T=m[C=_.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:w}}f[u]=!0;for(var N=l._private.edges,M=0;MM&&(p[N]=M,y[N]=T,m[N]=w),!i){var A=T*u+C;!i&&p[A]>M&&(p[A]=M,y[A]=C,m[A]=w)}}}for(var D=0;D1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},yt=Math.sqrt(2),mt=function(e,t,n){0===n.length&&Ge("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(u,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=mt(i,e,t),n--}return t},xt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/yt);if(!(i<2)){for(var l=[],u=0;u0?1:e<0?-1:0},Mt=function(e,t){return Math.sqrt(At(e,t))},At=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Dt=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},St=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Lt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Bt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=l(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ft=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},zt=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},jt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Vt=function(e,t){return jt(e,t.x1,t.y1)&&jt(e,t.x2,t.y2)},Gt=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?sn(i,o):u,d=i/2,h=o/2,p=(c=Math.min(c,d,h))!==d,f=c!==h;if(p){var g=r-h-a;if((s=en(e,t,n,r,n-d+c-a,g,n+d-c+a,g,!1)).length>0)return s}if(f){var v=n+d+a;if((s=en(e,t,n,r,v,r-h+c-a,v,r+h-c+a,!1)).length>0)return s}if(p){var y=r+h+a;if((s=en(e,t,n,r,n-d+c-a,y,n+d-c+a,y,!1)).length>0)return s}if(f){var m=n-d-a;if((s=en(e,t,n,r,m,r-h+c-a,m,r+h-c+a,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=Qt(e,t,n,r,b,x,c+a)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=Qt(e,t,n,r,w,E,c+a)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var _=n+d-c,C=r+h-c;if((l=Qt(e,t,n,r,_,C,c+a)).length>0&&l[0]>=_&&l[1]>=C)return[l[0],l[1]];var T=n-d+c,N=r+h-c;return(l=Qt(e,t,n,r,T,N,c+a)).length>0&&l[0]<=T&&l[1]>=N?[l[0],l[1]]:[]},Yt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},Ut=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(ec||th)},Xt=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f,g,v,y,m,b,x,w=[];u=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,d=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0===(l=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(l=1e-5),g=-27*(d/=l)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,(h=w)[1]=0,b=u/3,p>0?(y=(y=g+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=g-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),h[0]=-b+y+m,b+=(y+m)/2,h[4]=h[2]=-b,b=Math.sqrt(3)*(-m+y)/2,h[3]=b,h[5]=-b):(h[5]=h[3]=0,0===p?(x=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),h[0]=2*x-b,h[4]=h[2]=-(x+b)):(v=(f=-f)*f*f,v=Math.acos(g/Math.sqrt(v)),x=2*Math.sqrt(f),h[0]=-b+x*Math.cos(v/3),h[2]=-b+x*Math.cos((v+2*Math.PI)/3),h[4]=-b+x*Math.cos((v+4*Math.PI)/3)));for(var E=[],_=0;_<6;_+=2)Math.abs(w[_+1])<1e-7&&w[_]>=0&&w[_]<=1&&E.push(w[_]);E.push(1),E.push(0);for(var C,T,N,M=-1,A=0;A=0?Nl?(e-i)*(e-i)+(t-o)*(t-o):u-d},Wt=function(e,t,n){for(var r,i,o,a,s=0,l=0;l=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},qt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),p=Math.sin(-u),f=0;f0){var g=Zt(c,-l);d=Kt(g)}else d=c;return Wt(e,t,d)},Kt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},Jt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,h=t-o,p=r-t,f=s-o,g=d*h-f*u,v=c*h-p*u,y=f*c-d*p;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===g||0===v?Jt(e,n,a)===a?[a,s]:Jt(e,n,i)===i?[i,o]:Jt(i,a,n)===n?[n,r]:[]:[]},tn=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f=[],g=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y0){var m=Zt(g,-s);u=Kt(m)}else u=g}else u=n;for(var b=0;bu&&(u=t)},d=function(e){return l[e]},h=0;h0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var w=r(m);b=b.id(),h[b]>h[v]+w&&(h[b]=h[v]+w,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E0;){for(var N=n.pop(),M=0;M0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:An,a=r,s=0;s=2?Sn(e,t,n,0,On,Pn):Sn(e,t,n,0,In)},squaredEuclidean:function(e,t,n){return Sn(e,t,n,0,On)},manhattan:function(e,t,n){return Sn(e,t,n,0,In)},max:function(e,t,n){return Sn(e,t,n,-1/0,kn)}};function Rn(e,t,n,r,i,o){var a;return a=x(e)?e:Ln[e]||Ln.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}Ln["squared-euclidean"]=Ln.squaredEuclidean,Ln.squaredeuclidean=Ln.squaredEuclidean;var Bn=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Fn=function(e){return Bn(e)},zn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return Rn(e,r.length,o,(function(e){return r[e](t)}),a,s)},jn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;ln)return!1;return!0},Xn=function(e,t,n){for(var r=0;ri&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],g=t[r[a]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(o=n[g.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i=M?(A=M,M=I,D=O):I>A&&(A=I);for(var P=0;P0?1:0;C[E%u.minIterations*t+F]=z,B+=z}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var j=0,V=0;V0&&r.push(i);return r}(t,o,a),U=function(e,t,n){for(var r=lr(e,t,n),i=0;il&&(s=u,l=c)}n[i]=o[s]}return lr(e,t,n)}(t,r,Y),X={},H=0;H1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},pr=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},fr={};[ot,ut,ct,ht,ft,vt,xt,dn,pn,gn,yn,Mn,$n,or,cr,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=dr(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(l.getElementById(g.shift())),c)if(c[v].length)return h;return h.found=!0,h.trail=this.spawn(f,!0),h}},{hopcroftTarjanBiconnected:hr,htbc:hr,htb:hr,hopcroftTarjanBiconnectedComponents:hr},{tarjanStronglyConnected:pr,tsc:pr,tscc:pr,tarjanStronglyConnectedComponents:pr}].forEach((function(e){Y(fr,e)}));var gr=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};gr.prototype={fulfill:function(e){return vr(this,1,"fulfillValue",e)},reject:function(e){return vr(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new gr;return n.onFulfilled.push(br(e,r,"fulfill")),n.onRejected.push(br(t,r,"reject")),yr(n),r.proxy}};var vr=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,yr(e)),e},yr=function(e){1===e.state?mr(e,"onFulfilled",e.fulfillValue):2===e.state&&mr(e,"onRejected",e.rejectReason)},mr=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1},qr.prototype.set=function(e,t){var n=this.__data__,r=Hr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Kr=qr,Zr=zr($,"Map"),$r=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function Qr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Ti.className=Ti.classNames=Ti.classes;var Ni={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:B,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ni.variable="(?:[\\w-.]|(?:\\\\"+Ni.metaChar+"))+",Ni.className="(?:[\\w-]|(?:\\\\"+Ni.metaChar+"))+",Ni.value=Ni.string+"|"+Ni.number,Ni.id=Ni.variable,function(){var e,t,n;for(e=Ni.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Ni.comparatorOp+="|\\!"+t)}();var Mi=20,Ai=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*G(e,t)}(e.selector,t.selector)})),Di=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return Ue("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Ue("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Ue("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(i,o){return i.checks.reduce((function(a,s,l){return a+(o===i&&0===l?"$":"")+function(i,o){var a=i.type,s=i.value;switch(a){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:var u=i.field,c=i.operator;return"["+u+n(e(c))+t(s)+"]";case 5:var d=i.operator,h=i.field;return"["+e(d)+h+"]";case 4:return"["+i.field+"]";case 6:var p=i.operator;return"[["+i.field+n(e(p))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var f=r(i.left,o),g=r(i.subject,o),v=r(i.right,o);return f+(f.length>0?" ":"")+g+v;case Mi:return""}}(s,o)}),"")},i="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Ki(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],Ki)},Wi.forEachUp=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Zi)},Wi.forEachUpAndDown=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],$i)},Wi.ancestors=Wi.parents,(Ui=Xi={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_i.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_i.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ui.data,Ui.removeAttr=Ui.removeData;var Qi,Ji,eo=Xi,to={};function no(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;at})),minIndegree:ro("indegree",(function(e,t){return et})),minOutdegree:ro("outdegree",(function(e,t){return et}))}),Y(to,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},Qi.modelPosition=Qi.point=Qi.position,Qi.modelPositions=Qi.points=Qi.positions,Qi.renderedPoint=Qi.renderedPosition,Qi.relativePoint=Qi.relativePosition;var ao,so,lo=Ji;ao=so={},so.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},so.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},so.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,l),h=d.biasDiff,p=d.biasComplementDiff,f=y(i.height.val-o.h,u,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-g+o.y1+o.y2+v)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ho=function(e,t){return null==t?e:co(e,t.x1,t.y1,t.x2,t.y2)},po=function(e,t,n){return Qe(e,t,n)},fo=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Rt(u,1),co(e,u.x1,u.y1,u.x2,u.y2)}}},go=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=po(o,"labelWidth",n),p=po(o,"labelHeight",n),f=po(o,"labelX",n),g=po(o,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=p,C=h,T=C/2,N=_/2;if(m)a=f-T,s=f+T,l=g-N,u=g+N;else{switch(c.value){case"left":a=f-C,s=f;break;case"center":a=f-T,s=f+T;break;case"right":a=f,s=f+C}switch(d.value){case"top":l=g-_,u=g;break;case"center":l=g-N,u=g+N;break;case"bottom":l=g,u=g+_}}var M=v-Math.max(x,w)-E-2,A=v+Math.max(x,w)+E+2,D=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;a+=M,s+=A,l+=D,u+=I;var O=n||"main",P=i.labelBounds,k=P[O]=P[O]||{};k.x1=a,k.y1=l,k.x2=s,k.y2=u,k.w=s-a,k.h=u-l,k.leftPad=M,k.rightPad=A,k.topPad=D,k.botPad=I;var S=m&&"autorotate"===b.strValue,L=null!=b.pfValue&&0!==b.pfValue;if(S||L){var R=S?po(i.rstyle,"labelAngle",n):b.pfValue,B=Math.cos(R),F=Math.sin(R),z=(a+s)/2,j=(l+u)/2;if(!m){switch(c.value){case"left":z=s;break;case"right":z=a}switch(d.value){case"top":j=u;break;case"bottom":j=l}}var V=function(e,t){return{x:(e-=z)*B-(t-=j)*F+z,y:e*F+t*B+j}},G=V(a,l),Y=V(a,u),U=V(s,l),X=V(s,u);a=Math.min(G.x,Y.x,U.x,X.x),s=Math.max(G.x,Y.x,U.x,X.x),l=Math.min(G.y,Y.y,U.y,X.y),u=Math.max(G.y,Y.y,U.y,X.y)}var H=O+"Rot",W=P[H]=P[H]||{};W.x1=a,W.y1=l,W.x2=s,W.y2=u,W.w=s-a,W.h=u-l,co(e,a,l,s,u),co(i.labelBounds.all,a,l,s,u)}return e}},vo=function(e){var t=0,n=function(e){return(e?1:0)<0&&o>0){var a=t.pstyle("outline-offset").value,s=t.pstyle("shape").value,l=o+a,u=(e.w+2*l)/e.w,c=(e.h+2*l)/e.h,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+2.4*l)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+2.4*l)/e.w:"star"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.6*l)/e.h,d=-l/3.8):"triangle"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.4*l)/e.h,d=-l/1.4):"vee"===s&&(u=(e.w+4.4*l)/e.w,c=(e.h+3.8*l)/e.h,d=.5*-l);var h=e.h*c-e.h,p=e.w*u-e.w;if(Bt(e,[Math.ceil(h/2),Math.ceil(p/2)]),0!==d){var f=(r=d,{x1:(n=e).x1+0,x2:n.x2+0,y1:n.y1+r,y2:n.y2+r,w:n.w,h:n.h});St(e,f)}}}}(h,e)}else if(g&&t.includeEdges)if(c&&!d){var M=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),o=Math.max(v.srcY,v.midY,v.tgtY),co(h,n-=_,i-=_,r+=_,o+=_),"haystack"===M){var A=v.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var D=n;n=r,r=D}if(i>(o=A[1].y)){var I=i;i=o,o=I}co(h,n-_,i-_,r+_,o+_)}}else if("bezier"===M||"unbundled-bezier"===M||M.endsWith("segments")||M.endsWith("taxi")){var O;switch(M){case"bezier":case"unbundled-bezier":O=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=v.linePts}if(null!=O)for(var P=0;P(r=L.x)){var R=n;n=r,r=R}if((i=S.y)>(o=L.y)){var B=i;i=o,o=B}co(h,n-=_,i-=_,r+=_,o+=_)}if(c&&t.includeEdges&&g&&(fo(h,e,"mid-source"),fo(h,e,"mid-target"),fo(h,e,"source"),fo(h,e,"target")),c&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;co(h,h.x1+F,h.y1+z,h.x2+F,h.y2+z)}var j=p.bodyBounds=p.bodyBounds||{};Ft(j,h),Bt(j,y),Rt(j,1),c&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,co(h,n-E,i-E,r+E,o+E));var V=p.overlayBounds=p.overlayBounds||{};Ft(V,h),Bt(V,y),Rt(V,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=kt(),c&&t.includeLabels&&(t.includeMainLabels&&go(h,e,null),g&&(t.includeSourceLabels&&go(h,e,"source"),t.includeTargetLabels&&go(h,e,"target")))}return h.x1=uo(h.x1),h.y1=uo(h.y1),h.x2=uo(h.x2),h.y2=uo(h.y2),h.w=uo(h.x2-h.x1),h.h=uo(h.y2-h.y1),h.w>0&&h.h>0&&b&&(Bt(h,y),Rt(h,1)),h}(e,bo),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=kt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ho(n,r.overlayBounds):ho(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ho(n,r.labelBounds.all):(t.includeMainLabels&&ho(n,r.labelBounds.mainRot),t.includeSourceLabels&&ho(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ho(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},bo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},xo=vo(bo),wo=Ke(bo);so.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=kt();var n=wo(e=e||bo),r=this;if(r.cy().styleEnabled())for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:Ro,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)a(s);return this},Fo.removeAllListeners=function(){return this.removeListener("*")},Fo.emit=Fo.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,jo(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(E(e)){var o=e;i.applyBypass(this,o,r),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?i.getStylePropertyValue(a,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var o=0;o0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),da.neighbourhood=da.neighborhood,da.closedNeighbourhood=da.closedNeighborhood,da.openNeighbourhood=da.openNeighborhood,Y(da,{source:Hi((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Hi((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ga({attr:"source"}),targets:ga({attr:"target"})}),Y(da,{edgesWith:Hi(va(),"edgesWith"),edgesTo:Hi(va({thisIsSrc:!0}),"edgesTo")}),Y(da,{connectedEdges:Hi((function(e){for(var t=[],n=0;n0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),da.componentsOf=da.components;var ma=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new et,o=!1;if(t){if(t.length>0&&E(t[0])&&!N(t[0])){o=!0;for(var a=[],s=new nt,l=0,u=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u0){for(var B=e.length===i.length?i:new ma(o,e),F=0;F0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var C=0;C=.001?function(t,r){for(var i=0;i<4;++i){var o=h(r,e,n);if(0===o)return r;r-=(d(r,e,n)-t)/o}return r}(t,a):0===l?a:function(t,r,i){var o,a,s=0;do{(o=d(a=r+(i-r)/2,e,n)-t)>0?i=a:r=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+i)}(o),t,r)};f.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var g="generateBezier("+[e,t,n,r]+")";return f.toString=function(){return g},f}var Ea=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),_a=function(e,t,n,r){var i=wa(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Ca={linear:function(e,t,n){return e+(t-e)*n},ease:_a(.25,.1,.25,1),"ease-in":_a(.42,0,1,1),"ease-out":_a(0,0,.58,1),"ease-in-out":_a(.42,0,.58,1),"ease-in-sine":_a(.47,0,.745,.715),"ease-out-sine":_a(.39,.575,.565,1),"ease-in-out-sine":_a(.445,.05,.55,.95),"ease-in-quad":_a(.55,.085,.68,.53),"ease-out-quad":_a(.25,.46,.45,.94),"ease-in-out-quad":_a(.455,.03,.515,.955),"ease-in-cubic":_a(.55,.055,.675,.19),"ease-out-cubic":_a(.215,.61,.355,1),"ease-in-out-cubic":_a(.645,.045,.355,1),"ease-in-quart":_a(.895,.03,.685,.22),"ease-out-quart":_a(.165,.84,.44,1),"ease-in-out-quart":_a(.77,0,.175,1),"ease-in-quint":_a(.755,.05,.855,.06),"ease-out-quint":_a(.23,1,.32,1),"ease-in-out-quint":_a(.86,0,.07,1),"ease-in-expo":_a(.95,.05,.795,.035),"ease-out-expo":_a(.19,1,.22,1),"ease-in-out-expo":_a(1,0,0,1),"ease-in-circ":_a(.6,.04,.98,.335),"ease-out-circ":_a(.075,.82,.165,1),"ease-in-out-circ":_a(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ca.linear;var r=Ea(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":_a};function Ta(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Na(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ma(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Na(e,i),s=Na(t,i);if(_(a)&&_(s))return Ta(o,a,s,n,r);if(w(a)&&w(s)){for(var l=[],u=0;u0?("spring"===d&&h.push(a.duration),a.easingImpl=Ca[d].apply(null,h)):a.easingImpl=Ca[d]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var g=a.startPosition,v=a.position;if(v&&i&&!e.locked()){var y={};Da(g.x,v.x)&&(y.x=Ma(g.x,v.x,p,f)),Da(g.y,v.y)&&(y.y=Ma(g.y,v.y,p,f)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Da(m.x,x.x)&&(w.x=Ma(m.x,x.x,p,f)),Da(m.y,x.y)&&(w.y=Ma(m.y,x.y,p,f)),e.emit("pan"));var _=a.startZoom,C=a.zoom,T=null!=C&&r;T&&(Da(_,C)&&(o.zoom=Pt(o.minZoom,Ma(_,C,p,f),o.maxZoom)),e.emit("zoom")),(E||T)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var M=0;M=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],h=d._private;h.stopped?(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Ia(0,d,e),Aa(t,d,e,n),h.applying&&(h.applying=!1),u(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Pa={animate:_i.animate(),animation:_i.animation(),animated:_i.animated(),clearQueue:_i.clearQueue(),delay:_i.delay(),delayAnimation:_i.delayAnimation(),stop:_i.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Oa(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ee((function(n){Oa(n,e),t()}))}()}}},ka={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&N(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Sa=function(e){return b(e)?new Vi(e):e},La={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bo(ka,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Sa(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Sa(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},once:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};_i.eventAliasesOn(La);var Ra={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ra.jpeg=Ra.jpg;var Ba={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n,r=e.name,i=t.extension("layout",r);if(null!=i)return n=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(Y({},e,{cy:t,eles:n}));Ge("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Ge("A `name` must be specified to make a layout");else Ge("Layout options must be specified to make a layout")}};Ba.createLayout=Ba.makeLayout=Ba.layout;var Fa={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ja.invalidateDimensions=ja.resize;var Va={collection:function(e,t){return b(e)?this.$(e):T(e)?e.collection():w(e)?(t||(t={}),new ma(this,e,t.unique,t.removed)):new ma(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Va.elements=Va.filter=Va.$;var Ga={},Ya="t";Ga.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(h||d&&p){var f=void 0;h&&p||h?f=u.properties:p&&(f=u.mappedProperties);for(var g=0;g1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],C=i.valueMin[1],T=i.valueMax[1],N=i.valueMin[2],M=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],D=null==i.valueMax[3]?1:i.valueMax[3],I=[Math.round(w+(E-w)*v),Math.round(C+(T-C)*v),Math.round(N+(M-N)*v),Math.round(A+(D-A)*v)];n={bypass:i.bypass,name:i.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,O,i.bypass,h)}if(!n)return g(),!1;n.mapping=i,i=n;break;case a.data:for(var P=i.field.split("."),k=d.data,S=0;S0&&o>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ga.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Ga.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ga.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==t||"bezier"!==n&&"bezier"!==r||e.parallelEdges().forEach((function(e){e.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==t||"none"!==n&&"none"!==r||e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))},Ga.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ua={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;ot.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Ue("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u&&new Vi(u).invalid)Ue("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();else{var c=l[2],d=!1;n=c;for(var h=[];!n.match(/^\s*$/);){var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ue("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=p[0];var f=p[1],g=p[2];this.properties[f]?i.parse(f,g)?(h.push({name:f,val:g}),s()):(Ue("Skipping property: Invalid property definition in: "+r),s()):(Ue("Skipping property: Invalid property name in: "+r),s())}if(d){a();break}i.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var p=s.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(e,c[4]);if(!f||f.mapped)return!1;var g=this.parse(e,c[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return Ue("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(d.color){var v=f.value,y=g.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var E=[],C=[],T=[],N="",M=!1,A=0;A0?" ":"")+D.strValue}return d.validate&&!d.validate(E,C)?null:d.singleEnum&&M?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:T,strValue:N,bypass:n,units:C}}var I,O,P,S=function(){for(var r=0;rd.max||d.strictMax&&t===d.max))return null;var G={name:e,value:t,strValue:""+t+(L||""),units:L,bypass:n};return d.unitless||"px"!==L&&"em"!==L?G.pfValue=t:G.pfValue="px"!==L&&L?this.getEmSizeInPixels()*t:t,"ms"!==L&&"s"!==L||(G.pfValue="ms"===L?t:1e3*t),"deg"!==L&&"rad"!==L||(G.pfValue="rad"===L?t:(I=t,Math.PI*I/180)),"%"===L&&(G.pfValue=t/100),G}if(d.propList){var Y=[],X=""+t;if("none"===X);else{for(var H=X.split(/\s*,\s*|\s+/),W=0;W255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(P)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+j+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[a,s,l,o]}return t}(P);return K?{name:e,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var Z=S();if(Z)return Z}for(var $=d.regexes?d.regexes:[d.regex],Q=0;Q<$.length;Q++){var J=new RegExp($[Q]).exec(t);if(J)return{name:e,value:d.singleRegexMatchValue?J[1]:J,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?S():null};var $a=function e(t){if(!(this instanceof e))return new e(t);A(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Ge("A style must have a core reference")},Qa=$a.prototype;Qa.instanceString=function(){return"style"},Qa.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),_(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=wt(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;_(l.x)&&(t.pan.x=l.x,a=!1),_(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else T(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};es.centre=es.center,es.autolockNodes=es.autolock,es.autoungrabifyNodes=es.autoungrabify;var ts={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ts.attr=ts.data,ts.removeAttr=ts.removeData;var ns=function(e){var t=this,n=(e=Y({},e)).container;n&&!C(n)&&C(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=Y({name:o?"grid":"null"},a.layout),a.renderer=Y({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new ma(this),listeners:[],aniEles:new ma(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:_(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&_(a.pan.x)?a.pan.x:0,y:E(a.pan)&&_(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=Y({},a,a.renderer);t.initRenderer(u),function(e,t){if(e.some(O))return wr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=Y({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e0,u=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(T(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d0;){var P=D.shift(),k=A(P,I);if(k)P.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(O);else if(null===k){Ue("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}M();var S=0;if(n.avoidOverlap)for(var L=0;L0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:q+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:q+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var us={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cs(e){this.options=Y({},us,e)}cs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h1&&t.avoidOverlap){d*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(v*v+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var ds,hs={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ps(e){this.options=Y({},hs,e)}ps.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d0&&Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m)),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,_)}for(var C=0,T=0;T1&&t.avoidOverlap){var D=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(D*D+I*I));C=Math.max(O,C)}N.r=C,C+=w}if(t.equidistant){for(var P=0,k=0,S=0;S=e.numIter||(Es(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature=e.animationThreshold&&o(),Ee(t)):(Ss(r,e),s())}();else{for(;u;)u=a(l),l++;Ss(r,e),s()}return this},gs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},gs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vs=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u0)for(a.graphSet.push(E),u=0;ur.count?0:r.graph},ms=function e(t,n,r,i){var o=i.graphSet[r];if(-10)var s=(u=r.nodeOverlap*a)*i/(g=Math.sqrt(i*i+o*o)),l=u*o/g;else{var u,c=Ms(e,i,o),d=Ms(t,-1*i,-1*o),h=d.x-c.x,p=d.y-c.y,f=h*h+p*p,g=Math.sqrt(f);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/f)*h/g,l=u*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ns=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ms=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0n?(u.x=r,u.y=i+o/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},As=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,g=t.gravity*h/p;c.offsetX+=f,c.offsetY+=g}}}}},Is=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},ks=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTopf&&(d+=p+t.componentSpacing,c=0,h=0,p=0)}}},Ls={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Rs(e){this.options=Y({},Ls,e)}Rs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},h=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=p)l=h,u=p;else if(null!=h&&null==p)l=h,u=Math.ceil(a/l);else if(null==h&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var f=c(),g=d();(f-1)*g>=a?c(f-1):(g-1)*f>=a&&d(g-1)}else for(;u*l=a?d(y+1):c(v+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x=u&&(O=0,I++)},k={},S=0;S(r=Ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5(r=Xt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var C=_[w],T=s.arrowShapes[n.pstyle(C.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(T.roughCollide(e,t,E,C.angle,{x:C.x,y:C.y},N,h)&&T.collide(e,t,E,C.angle,{x:C.x,y:C.y},N,h))return v(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Qe(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},C=_(g,m),T=_(g,x),N=_(y,m),M=_(y,x),A=[C.x+h,C.y+p,N.x+h,N.y+p,M.x+h,M.y+p,T.x+h,T.y+p];if(Wt(e,t,A))return v(n),!0}else if(jt(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),h=kt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),p=0;p4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,r,i){var o,a;if(e!==hl?gl(t,e,pl):((a=pl).x=-1*(o=fl).x,a.y=-1*o.y,a.nx=-1*o.nx,a.ny=-1*o.ny,a.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),gl(t,n,fl),Qs=pl.nx*fl.ny-pl.ny*fl.nx,Js=pl.nx*fl.nx-pl.ny*-fl.ny,nl=Math.asin(Math.max(-1,Math.min(1,Qs))),Math.abs(nl)<1e-6)return Zs=t.x,$s=t.y,void(il=al=0);el=1,tl=!1,Js<0?nl<0?nl=Math.PI+nl:(nl=Math.PI-nl,el=-1,tl=!0):nl>0&&(el=-1,tl=!0),al=void 0!==t.radius?t.radius:r,rl=nl/2,sl=Math.min(pl.len/2,fl.len/2),i?(ol=Math.abs(Math.cos(rl)*al/Math.sin(rl)))>sl?(ol=sl,il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))):il=al:(ol=Math.min(sl,al),il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))),cl=t.x+fl.nx*ol,dl=t.y+fl.ny*ol,Zs=cl-fl.ny*il*el,$s=dl+fl.nx*il*el,ll=t.x+pl.nx*ol,ul=t.y+pl.ny*ol,hl=t}(e,t,n,r,i),{cx:Zs,cy:$s,radius:il,startX:ll,startY:ul,stopX:cl,stopY:dl,startAngle:pl.ang+Math.PI/2*el,endAngle:fl.ang-Math.PI/2*el,counterClockwise:tl})}var ml={};function bl(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},M=N(C,E),A=N(T,_),D=!1;"auto"===v?g=Math.abs(M)>Math.abs(A)?i:r:v===l||v===s?(g=r,D=!0):v!==o&&v!==a||(g=i,D=!0);var I,O=g===r,P=O?A:M,k=O?T:C,S=Nt(k),L=!1;D&&(m||x)||!(v===s&&k<0||v===l&&k>0||v===o&&k>0||v===a&&k<0)||(P=(S*=-1)*Math.abs(P),L=!0);var R=function(e){return Math.abs(e)=Math.abs(P)},B=R(I=m?(b<0?1+b:b)*P:(b<0?P:0)+b*S),F=R(Math.abs(P)-Math.abs(I));if(!B&&!F||L)if(O){var z=u.y1+I+(f?d/2*S:0),j=u.x1,V=u.x2;n.segpts=[j,z,V,z]}else{var G=u.x1+I+(f?c/2*S:0),Y=u.y1,U=u.y2;n.segpts=[G,Y,G,U]}else if(O){var X=Math.abs(k)<=d/2,H=Math.abs(C)<=h/2;if(X){var W=(u.x1+u.x2)/2,q=u.y1,K=u.y2;n.segpts=[W,q,W,K]}else if(H){var Z=(u.y1+u.y2)/2,$=u.x1,Q=u.x2;n.segpts=[$,Z,Q,Z]}else n.segpts=[u.x1,u.y2]}else{var J=Math.abs(k)<=c/2,ee=Math.abs(T)<=p/2;if(J){var te=(u.y1+u.y2)/2,ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else if(ee){var ie=(u.x1+u.x2)/2,oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}else n.segpts=[u.x2,u.y1]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},ml.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!_(n.startX)||!_(n.startY),v=!_(n.arrowStartX)||!_(n.arrowStartY),y=!_(n.endX)||!_(n.endY),m=!_(n.arrowEndX)||!_(n.arrowEndY),b=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,x=Mt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xh.poolIndex()){var p=d;d=h,h=p}var f=s.srcPos=d.position(),g=s.tgtPos=h.position(),v=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=s.srcCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,C=s.tgtCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,T=s.tgtRs=h._private.rscratch,N=s.srcRs=d._private.rscratch;s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var M=0;M0){var H=u,W=At(H,_t(t)),q=At(H,_t(X)),K=W;q2&&At(H,{x:X[2],y:X[3]})0){var le=c,ue=At(le,_t(t)),ce=At(le,_t(se)),de=ue;ce2&&At(le,{x:se[2],y:se[3]})=u||m){c={cp:g,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=Pt(0,_,1),t=Ot(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=Pt(0,r-.001,1),o=Pt(0,r+.001,1),a=Ot(e,t,n,i),s=Ot(e,t,n,o);return Tl(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var C,T,N,M,A=0,D=r.allpts.length,I=0;I+3=u));I+=2);var O=(u-T)/C;O=Pt(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Mt(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(N,M,O),i=Tl(N,M)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},_l.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},_l.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Qe(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,d=i.width,h=i.height+(l-1)*(o-1)*u;Je(n.rstyle,"labelWidth",t,d),Je(n.rscratch,"labelWidth",t,d),Je(n.rstyle,"labelHeight",t,h),Je(n.rscratch,"labelHeight",t,h),Je(n.rscratch,"labelLineHeight",t,c)},_l.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Je(n.rscratch,e,t,r),r):Qe(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,p=[],f=/[\s\u200b]+|$/g,g=0;gc){var b,x="",w=0,E=d(v.matchAll(f));try{for(E.s();!(b=E.n()).done;){var _=b.value,C=_[0],T=v.substring(w,_.index);w=_.index+C.length;var N=0===x.length?T:x+T+C;this.calculateLabelDimensions(e,N).width<=c?x+=T+C:(x&&p.push(x),x=T+C)}}catch(e){E.e(e)}finally{E.f()}x.match(/^[\s\u200b]+$/)||p.push(x)}else p.push(v)}a("labelWrapCachedLines",p),i=a("labelWrapCachedText",p.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var M=e.pstyle("text-max-width").pfValue,A="",D=!1;if(this.calculateLabelDimensions(e,i).widthM);I++)A+=i[I],I===i.length-1&&(D=!0);return D||(A+="…"),A}return i},_l.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},_l.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window().document,i=Oe(t,e._private.labelDimsKey),o=n.labelDimCache||(n.labelDimCache=[]),a=o[i];if(null!=a)return a;var s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=r.createElement("canvas"),h=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}h.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var f=0,g=0,v=t.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var M=i(t);v&&(e.hoverData.tapholdCancelled=!0),n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(D):a.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(n=!0,a.panningEnabled()&&a.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};a.panBy(I),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),b)if(v){if(a.boxSelectionEnabled()&&M)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var P=!e.dragData.didDrag;P&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(w,{inDragLayer:!0});var k={x:0,y:0};if(_(x[0])&&_(x[1])&&(k.x+=x[0],k.y+=x[1],P)){var S=e.hoverData.dragDelta;S&&_(S[0])&&_(S[1])&&(k.x+=S[0],k.y+=S[1])}e.hoverData.draggingEles=!0,w.silentShift(k).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else v&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!M&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=_t(h),e.redrawHint("select",!0),e.redraw()):A(),b&&b.pannable()&&b.active()&&b.unactivate());return f[2]=c[0],f[3]=c[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,h=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:t,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:t,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:a[0],y:a[1]}),x=!1,t.timeStamp-w<=o.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:a[0],y:a[1]})):(b=setTimeout((function(){x||r(c,["oneclick","onetap","voneclick"],t,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),w=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(o.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:t,position:{x:a[0],y:a[1]}});"additive"===o.selectionType()||h||o.$(n).unmerge(g).unselect(),g.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=c&&c.grabbed();d(u),v&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}),!1);var C,T,N,M,A,D,I,O,P,k,S,L,R,B=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",B,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||B(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var F,z,j,V,G,Y,U,X=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},H=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",F=function(t){if(e.hasTouchStarted=!0,m(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var l=e.findContainerClientCoords();P=l[0],k=l[1],S=l[2],L=l[3],C=t.touches[0].clientX-P,T=t.touches[0].clientY-k,N=t.touches[1].clientX-P,M=t.touches[1].clientY-k,R=0<=C&&C<=S&&0<=N&&N<=S&&0<=T&&T<=L&&0<=M&&M<=L;var h=n.pan(),f=n.zoom();if(A=X(C,T,N,M),D=H(C,T,N,M),O=[((I=[(C+N)/2,(T+M)/2])[0]-h.x)/f,(I[1]-h.y)/f],D<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),b=y[0];if(null!=b&&(b.activate(),e.touchData.start=b,e.touchData.starts=y,e.nodeIsGrabbable(b))){var x=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),b.selected()?(w=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(w,{addToList:x})):c(b,{addToList:x}),s(b);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};b.emit(E("grabon")),w?w.forEach((function(e){e.emit(E("grab"))})):b.emit(E("grab"))}r(b,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==b&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var _=e.touchData.startPosition=[null,null,null,null,null,null],B=0;B=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var w=t.touches[0].clientX-P,E=t.touches[0].clientY-k,I=t.touches[1].clientX-P,S=t.touches[1].clientY-k,L=H(w,E,I,S);if(L/D>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(n&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var F=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&F===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=F,F&&F.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",j=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",V=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=h[0],u[1]=h[1]}if(t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=h[0],u[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=h[0],u[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;d(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);r(y,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),G=!1,t.timeStamp-U<=s.multiClickDebounceTime()?(Y&&clearTimeout(Y),G=!0,U=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):(Y=setTimeout((function(){G||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),U=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var p=[c[0],c[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return g[0]}return null},p=Object.keys(d),f=0;f0?u:Gt(i,o,e,t,n,r,a,s)},checkPoint:function(e,t,n,r,i,o,a,s){var l=2*(s="auto"===s?sn(r,i):s);if(qt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(qt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!Wt(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||!!$t(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!$t(e,t,l,l,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",rn(3,0)),this.generateRoundPolygon("round-triangle",rn(3,0)),this.generatePolygon("rectangle",rn(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",rn(5,0)),this.generateRoundPolygon("round-pentagon",rn(5,0)),this.generatePolygon("hexagon",rn(6,0)),this.generateRoundPolygon("round-hexagon",rn(6,0)),this.generatePolygon("heptagon",rn(7,0)),this.generateRoundPolygon("round-heptagon",rn(7,0)),this.generatePolygon("octagon",rn(8,0)),this.generateRoundPolygon("round-octagon",rn(8,0));var r=new Array(20),i=an(5,0),o=an(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*Bl)break;var v=e.deq(t,d,c);if(!(v.length>0))break;for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),i(t))}}},zl=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ze;i(this,e),this.idsByKey=new et,this.keyForId=new et,this.cachesByLvl=new et,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return a(e,[{key:"getIdsFor",value:function(e){null==e&&Ge("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new nt,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new et,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),jl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Vl=Ke({getKey:null,doesEleInvalidateKey:ze,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gl=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Vl(t);Y(n,r),n.lookup=new zl(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Yl=Gl.prototype;Yl.reasons=jl,Yl.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Yl.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Yl.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new st((function(e,t){return t.reqs-e.reqs}))},Yl.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Yl.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Tt(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,h=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var g=o.getTextureQueue(p),v=g[g.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidthr;M--)T=o.getElement(e,t,n,M,jl.downscale);N()}else{var A;if(!x&&!w&&!E)for(var D=r-1;D>=-4;D--){var I=l.get(e,D);if(I){A=I;break}}if(b(A))return o.queueElement(e,r),A;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:u,width:d,height:c,scaledLabelShown:h},v.usedWidth+=Math.ceil(d+8),v.eleCaches.push(f),l.set(e,r,f),o.checkTextureFullness(v),f},Yl.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},Yl.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ze(t,e):e.fullnessChecks++},Yl.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ze(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,$e(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ze(r,o),n.push(o),o}},Yl.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Yl.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,jl.dequeue)}}return i},Yl.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Be,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Yl.onDequeue=function(e){this.onDequeues.push(e)},Yl.offDequeue=function(e){Ze(this.onDequeues,e)},Yl.setupDequeueing=Fl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Ze(c,a)}}();var d=function(t){var i=(t=t||{}).after;!function(){if(!a){a=kt();for(var t=0;t32767||s>32767)return null;if(o*s>16e6)return null;var l=r.makeLayer(a,n);if(null!=i){var d=c.indexOf(i)+1;c.splice(d,0,l)}else(void 0===t.insert||t.insert)&&c.unshift(l);return l};if(r.skipping&&!o)return null;for(var h=null,p=e.length/1,f=!o,g=0;g=p||!Vt(h.bb,v.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||f?r.queueLayer(h,v):r.drawEleInLayer(h,v,n,t),h.eles.push(v),m[n]=h}}return s||(f?null:c)},Xl.getEleLevelForLayerLevel=function(e,t){return e},Xl.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Xl.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Xl.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},Xl.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=_e(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Xl.invalidateLayer=function(e){if(this.lastInvalidationTime=_e(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ze(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*c,m=u*c,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,C=y*_;e.translate(w,E),b(C),x(C),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(a.colorStrokeStyle(e,v[0],v[1],v[2],n),"straight-triangle"===d?a.drawEdgeTrianglePath(t,e,s.allpts):(a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")):e.lineCap="butt"}();i&&a.drawEdgeUnderlay(e,t),b(),x(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},uu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};lu.drawEdgeOverlay=uu("overlay"),lu.drawEdgeUnderlay=uu("underlay"),lu.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");o.pathCacheKey&&o.pathCacheKey===h?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=h,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&void 0!==arguments[5]?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),a?e.stroke():e.fill()}du.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Tt(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},du.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},du.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Qe(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},du.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Qe(o,"labelX",n),c=Qe(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var h,p=n?n+"-":"",f=Qe(o,"labelWidth",n),g=Qe(o,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(h=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(h),u=0,c=0),x){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue,T=0===t.pstyle("text-background-shape").strValue.indexOf("round");if(w>0||_>0&&E>0){var N=u-C;switch(b){case"left":N-=f;break;case"center":N-=f/2}var M=c-g-C,A=f+2*C,D=g+2*C;if(w>0){var I=e.fillStyle,O=t.pstyle("text-background-color").value;e.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+w*a+")",T?hu(e,N,M,A,D,2):e.fillRect(N,M,A,D),e.fillStyle=I}if(_>0&&E>0){var P=e.strokeStyle,k=e.lineWidth,S=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+S[0]+","+S[1]+","+S[2]+","+E*a+")",e.lineWidth=_,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(T?hu(e,N,M,A,D,2,"stroke"):e.strokeRect(N,M,A,D),"double"===L){var R=_/2;T?hu(e,N+R,M+R,A-2*R,D-2*R,2,"stroke"):e.strokeRect(N+R,M+R,A-2*R,D-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=k,e.strokeStyle=P}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Qe(o,"labelWrapCachedLines",n),z=Qe(o,"labelLineHeight",n),j=f/2,V=this.getLabelJustification(t);switch("auto"===V||("left"===b?"left"===V?u+=-f:"center"===V&&(u+=-j):"center"===b?"left"===V?u+=-j:"right"===V&&(u+=j):"right"===b&&("center"===V?u+=j:"right"===V&&(u+=f))),x){case"top":case"center":case"bottom":c-=(F.length-1)*z}for(var G=0;G0&&e.strokeText(F[G],u,c),e.fillText(F[G],u,c),c+=z}else B>0&&e.strokeText(d,u,c),e.fillText(d,u,c);0!==h&&(e.rotate(-h),e.translate(-s,-l))}}};var pu={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(_(d.x)&&_(d.y)&&(!s||t.visible())){var h,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:A;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,F[0],F[1],F[2],t)},H=function(e,t,n,r){var i,o=l.nodePathCache=l.nodePathCache||[],a=Pe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+G),s=o[a],u=!1;return null!=s?(i=s,u=!0,c.pathCache=i):(i=new Path2D,o[a]=c.pathCache=i),{path:i,cacheHit:u}},W=t.pstyle("shape").strValue,q=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(d.x,d.y);var K=H(r,i,W,q);h=K.path,v=K.cacheHit}var Z=function(){if(!v){var n=d;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i,G,c)}g?e.fill(h):e.fill()},$=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i,G,c)))},J=function(){var t=(N>0?N:-N)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=N>0?0:255;0!==N&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(h):e.fill())},ee=function(){if(M>0){if(e.lineWidth=M,e.lineCap=P,e.lineJoin=O,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(S),e.lineDashOffset=L;break;case"solid":case"double":e.setLineDash([])}if("center"!==k){if(e.save(),e.lineWidth*=2,"inside"===k)g?e.clip(h):e.clip();else{var t=new Path2D;t.rect(-r/2-M,-i/2-M,r+2*M,i+2*M),t.addPath(h),e.clip(t,"evenodd")}g?e.stroke(h):e.stroke(),e.restore()}else g?e.stroke(h):e.stroke();if("double"===I){e.lineWidth=M/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(h):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(B>0){if(e.lineWidth=B,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=d;g&&(n={x:0,y:0});var o=l.getNodeShape(t),a=M;"inside"===k&&(a=0),"outside"===k&&(a*=2);var s,u=(r+a+(B+V))/r,c=(i+a+(B+V))/i,h=r*u,p=i*c,f=l.nodeShapes[o].points;if(g&&(s=H(h,p,o,f).path),"ellipse"===o)l.drawEllipsePath(s||e,n.x,n.y,h,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var v=0,y=0,m=0;"round-diamond"===o?v=1.4*(a+V+B):"round-heptagon"===o?(v=1.075*(a+V+B),m=-(a/2+V+B)/35):"round-hexagon"===o?v=1.12*(a+V+B):"round-pentagon"===o?(v=1.13*(a+V+B),m=-(a/2+V+B)/15):"round-tag"===o?(v=1.12*(a+V+B),y=.07*(a/2+B+V)):"round-triangle"===o&&(v=(a+V+B)*(Math.PI/2),m=-(a+V/2+B)/Math.PI),0!==v&&(h=r*(u=(r+v)/r),["round-hexagon","round-tag"].includes(o)||(p=i*(c=(i+v)/i)));for(var b=h/2,x=p/2,w=(G="auto"===G?ln(h,p):G)+(a+B+V)/2,E=new Array(f.length/2),_=new Array(f.length/2),C=0;C0){if(r=r||n.position(),null==i||null==o){var d=n.padding();i=n.width()+2*d,o=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a,c),t.fill()}}}};pu.drawNodeOverlay=fu("overlay"),pu.drawNodeUnderlay=fu("underlay"),pu.hasPie=function(e){return(e=e[0])._private.hasPie},pu.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,g=t.pstyle("pie-"+h+"-background-opacity").value*n,v=p/100;v+d>1&&(v=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*v;0===p||d>=1||d+v>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),d+=v)}};for(var gu={getPixelRatio:function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;ia.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},C=a.prevViewport;void 0===C||_.zoom!==C.zoom||_.pan.x!==C.pan.x||_.pan.y!==C.pan.y||g&&!f||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var T=a.getCachedZSortedEles();function N(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function M(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var A=a.data.bufferContexts[a.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var D=u.contexts[a.NODE],I=a.textureCache.texture;_=a.textureCache.viewport,D.setTransform(1,0,0,1,0,0),h?N(D,0,0,_.width,_.height):D.clearRect(0,0,_.width,_.height);var O=m.core("outside-texture-bg-color").value,P=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(D,O[0],O[1],O[2],P),D.fillRect(0,0,_.width,_.height),b=l.zoom(),M(D,!1),D.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),D.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var k=l.extent(),S=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),L=a.hideEdgesOnViewport&&S,R=[];if(R[a.NODE]=!c[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,R[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),R[a.DRAG]=!c[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,R[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||R[a.NODE]){var B=h&&!R[a.NODE]&&1!==p;M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.nondrag,s,k):a.drawLayeredElements(D,T.nondrag,s,k),a.debug&&a.drawDebugPoints(D,T.nondrag),n||h||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||R[a.DRAG])&&(B=h&&!R[a.DRAG]&&1!==p,M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.drag,s,k):a.drawCachedElements(D,T.drag,s,k),a.debug&&a.drawDebugPoints(D,T.drag),n||h||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(M(D=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var F=m.core("selection-box-border-width").value/b;D.lineWidth=F,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),F>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=u.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var j=a.lastRedrawTime;if(a.showFps&&j){j=Math.round(j);var V=Math.round(1e3/j);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+j+" ms = "+V+" fps",0,20),D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(h&&1!==p){var G=u.contexts[a.NODE],Y=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],U=u.contexts[a.DRAG],X=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):N(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||R[a.NODE])&&(H(G,Y,R[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||R[a.DRAG])&&(H(U,X,R[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")}},vu={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},_u.png=function(e){return Tu(e,this.bufferCanvasImage(e),"image/png")},_u.jpg=function(e){return Tu(e,this.bufferCanvasImage(e),"image/jpeg")};var Nu=Au,Mu=Au.prototype;function Au(e){var t=this,n=t.cy.window().document;t.data={canvases:new Array(Mu.CANVAS_LAYERS),contexts:new Array(Mu.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Mu.CANVAS_LAYERS),bufferCanvases:new Array(Mu.BUFFER_COUNT),bufferContexts:new Array(Mu.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l{e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822:(e,t,n)=>{"use strict";var r=n(6857),i=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},135:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],u=i.addDummyNode(e,"border",s,n);o[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s{"use strict";var r=n(6857);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},9859:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909:(e,t,n)=>{var r=n(6857),i=n(3988),o=n(8191).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},8191:(e,t,n)=>{var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031:(e,t,n)=>{var r=n(6857),i=n(8191).Graph,o=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var u=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202:(e,t,n)=>{"use strict";var r=n(6857),i=n(6822),o=n(8209),a=n(9361),s=n(3988).normalizeRanks,l=n(2948),u=n(3988).removeEmptyRanks,c=n(6353),d=n(135),h=n(4850),p=n(1453),f=n(3776),g=n(3988),v=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new v({multigraph:!0,compound:!0}),n=N(e.graph());return t.setGraph(r.merge({},m,T(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=N(e.node(n));t.setNode(n,r.defaults(T(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=N(e.edge(n));t.setEdge(n,r.merge({},_,T(i,E),r.pick(i,C)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};g.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){u(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=g.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){f(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function T(e,t){return r.mapValues(r.pick(e,t),Number)}function N(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},6857:(e,t,n)=>{var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(9754),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),p=e.node(u);e.setParent(d,u),p.borderTop=d,e.setParent(h,u),p.borderBottom=h,r.forEach(c,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,f=i.borderTop?a:2*a,g=c!==p?1:s-l[u]+1;e.setEdge(d,c,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},8209:(e,t,n)=>{"use strict";var r=n(6857),i=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(u!==s+1){for(e.removeEdge(t),o=0,++s;s{var r=n(6857);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},3860:(e,t,n)=>{var r=n(6857);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},7860:(e,t,n)=>{var r=n(6857),i=n(8191).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6639:(e,t,n)=>{"use strict";var r=n(6857);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r{"use strict";var r=n(6857),i=n(8918),o=n(6639),a=n(4520),s=n(7860),l=n(4384),u=n(8191).Graph,c=n(3988);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new u;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var l,u=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){h(f%2?n:a,f%4>=2),s=c.buildLayerMatrix(e);var v=o(e,s);v{"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},4959:(e,t,n)=>{"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){var n,i,o,a;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(i=t,o=0,a=0,(n=e).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},4520:(e,t,n)=>{var r=n(6857),i=n(3860),o=n(4959),a=n(5169);e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,p={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==h})));var f=i(t,u);r.forEach(f,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(f,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(g,p);var v=a(g,l);if(d&&(v.vs=r.flatten([d,v.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.order+m.order)/(v.weight+2),v.weight+=2}return v}},5169:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,l=r.sortBy(a.rhs,(function(e){return-e.i})),u=[],c=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(u,l,h),r.forEach(s,(function(e){h+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,d+=e.weight,h=o(u,l,h)}));var p={vs:r.flatten(u,!0)};return d&&(p.barycenter=c/d,p.weight=d),p}},2948:(e,t,n)=>{var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,u=a[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank{"use strict";var r=n(6857),i=n(8191).Graph,o=n(3988);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,u=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===u)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(as)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var p=l[d];a[e]===e&&t{"use strict";var r=n(6857),i=n(3988),o=n(9741).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},8481:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph,o=n(8073).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(r.setNode(u,{});a(r,e){"use strict";var r=n(8073).longestPath,i=n(8481),o=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r},6860:(e,t,n)=>{"use strict";var r=n(6857),i=n(8481),o=n(8073).slack,a=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,u=n(3988).simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=g(n);)y(n,e,t,v(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==i){var d=u===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=c,e.hasEdge(a,l)){var p=e.edge(n,c).cutvalue;s+=d?-p:p}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=f(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function v(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(0,e.node(t.v),u)&&c!==m(0,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=g,c.enterEdge=v,c.exchangeEdges=y},8073:(e,t,n)=>{"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038:e=>{e.exports="0.8.5"},8362:(e,t,n)=>{var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619:(e,t,n)=>{var r=n(117);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},9276:(e,t,n)=>{var r=n(117);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},4919:(e,t,n)=>{var r=n(8905),i=n(117);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},8905:(e,t,n)=>{var r=n(117),i=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),u=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6678:(e,t,n)=>{var r=n(117),i=n(6291);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},3590:(e,t,n)=>{var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s{e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(9888)}},498:(e,t,n)=>{var r=n(9888);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423:(e,t,n)=>{var r=n(117),i=n(6454),o=n(1737);e.exports=function(e,t){var n,a=new i,s={},l=new o;function u(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},6291:(e,t,n)=>{var r=n(117);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),i[u].onStack=!1,c.push(u)}while(s!==u);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},9888:(e,t,n)=>{var r=n(117);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},1737:(e,t,n)=>{var r=n(117);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priority{"use strict";var r=n(117);e.exports=s;var i="\0",o="\0",a="";function s(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function l(e,t){e[t]?e[t]++:e[t]=1}function u(e,t){--e[t]||delete e[t]}function c(e,t,n,o){var s=""+t,l=""+n;if(!e&&s>l){var u=s;s=l,l=u}return s+a+l+a+(r.isUndefined(o)?i:o)}function d(e,t){return c(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},s.prototype.setEdge=function(){var e,t,n,i,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=c(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return o&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,l(this._preds[t],e),l(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[t],e),u(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166:(e,t,n)=>{e.exports={Graph:n(6454),version:n(4458)}},7494:(e,t,n)=>{var r=n(117),i=n(6454);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},117:(e,t,n)=>{var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458:e=>{e.exports="2.1.8"},3143:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(9);function a(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in a.prototype=Object.create(r.prototype),r)a[s]=r[s];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},a.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(13),a=n(0),s=n(16),l=n(5);function u(e,t,n,a){null==n&&null==a&&(a=t),r.call(this,a),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=a,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new o(t.x,t.y,n.width,n.height):new o}for(var c in u.prototype=Object.create(r.prototype),r)u[c]=r[c];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}})),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)})),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach((function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}})),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>a.WORLD_BOUNDARY?t=a.WORLD_BOUNDARY:t<-a.WORLD_BOUNDARY&&(t=-a.WORLD_BOUNDARY);var n=this.rect.y;n>a.WORLD_BOUNDARY?n=a.WORLD_BOUNDARY:n<-a.WORLD_BOUNDARY&&(n=-a.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";var r=n(0);function i(){}for(var o in r)i[o]=r[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(0),a=n(7),s=n(3),l=n(1),u=n(13),c=n(12),d=n(11);function h(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof a?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in h.prototype=Object.create(r.prototype),r)h[p]=r[p];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},h.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(c,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},h.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,l=0;l(e=u.getTop())&&(r=e),o>(t=u.getLeft())&&(o=t)}return r==i.MAX_VALUE?null:(n=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-n,this.top=r-n,new c(this.left,this.top))},h.prototype.updateBounds=function(e){for(var t,n,r,o,a,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,d=-i.MAX_VALUE,h=this.nodes,p=h.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),c>(r=g.getTop())&&(c=r),d<(o=g.getBottom())&&(d=o)}var v=new u(s,c,l-s,d-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},h.calculateBounds=function(e){for(var t,n,r,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,d=e.length,h=0;h(t=p.getLeft())&&(a=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(o=p.getBottom())&&(c=o)}return new u(a,l,s-a,c-l)},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=h},function(e,t,n){"use strict";var r,i=n(1);function o(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var o=(r=t).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return n.isInterGraph=!1,o.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,o=[],a=(o=o.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var o=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(o=1);var a=o*n[0],s=n[1]/o;n[0]a)return n[0]=r,n[1]=l,n[2]=o,n[3]=b,!1;if(io)return n[0]=s,n[1]=i,n[2]=y,n[3]=a,!1;if(ro?(n[0]=c,n[1]=d,_=!0):(n[0]=u,n[1]=l,_=!0):T===M&&(r>o?(n[0]=s,n[1]=l,_=!0):(n[0]=h,n[1]=d,_=!0)),-N===M?o>r?(n[2]=m,n[3]=b,C=!0):(n[2]=y,n[3]=v,C=!0):N===M&&(o>r?(n[2]=g,n[3]=v,C=!0):(n[2]=x,n[3]=b,C=!0)),_&&C)return!1;if(r>o?i>a?(A=this.getCardinalDirection(T,M,4),D=this.getCardinalDirection(N,M,2)):(A=this.getCardinalDirection(-T,M,3),D=this.getCardinalDirection(-N,M,1)):i>a?(A=this.getCardinalDirection(-T,M,1),D=this.getCardinalDirection(-N,M,3)):(A=this.getCardinalDirection(T,M,2),D=this.getCardinalDirection(N,M,4)),!_)switch(A){case 1:O=l,I=r+-f/M,n[0]=I,n[1]=O;break;case 2:I=h,O=i+p*M,n[0]=I,n[1]=O;break;case 3:O=d,I=r+f/M,n[0]=I,n[1]=O;break;case 4:I=c,O=i+-p*M,n[0]=I,n[1]=O}if(!C)switch(D){case 1:k=v,P=o+-E/M,n[2]=P,n[3]=k;break;case 2:P=x,k=a+w*M,n[2]=P,n[3]=k;break;case 3:k=b,P=o+E/M,n[2]=P,n[3]=k;break;case 4:P=m,k=a+-w*M,n[2]=P,n[3]=k}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var o,a,s,l,u,c,d,h=e.x,p=e.y,f=t.x,g=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(d=(o=g-p)*(l=v-m)-(a=b-y)*(s=h-f))?null:new r((s*(c=m*y-v*b)-l*(u=f*p-h*g))/d,(a*u-o*c)/d)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var c=(-l+Math.sqrt(l*l-4*s*u))/(2*s),d=(-l-Math.sqrt(l*l-4*s*u))/(2*s);return c>=0&&c<=1?[c]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),a.add(c);var d=c.getEdges();for(o=0;o-1&&u.splice(g,1)}a=new Set,l=new Map}else e=[]}return e},h.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),o=0;o=0&&t.splice(d,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,o=t[0])}return o},h.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(4),o=n(0),a=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,a,s,l,u=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*o):(a>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||u>=s[0].length))for(var c=0;ce}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),a=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),s=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),u=0;u=0;D--)if(0!==this.s[D]){for(var I=D+1;I=0;B--){if(function(e,t){return e&&t}(B0;){var H=void 0,W=void 0;for(H=N-2;H>=-1&&-1!==H;H--)if(Math.abs(o[H])<=X+U*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){o[H]=0;break}if(H===N-2)W=4;else{var q=void 0;for(q=N-1;q>=H&&q!==H;q--){var K=(q!==N?Math.abs(o[q]):0)+(q!==H+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=X+U*K){this.s[q]=0;break}}q===H?W=3:q===N-1?W=1:(W=2,H=q)}switch(H++,W){case 1:var Z=o[N-2];o[N-2]=0;for(var $=N-2;$>=H;$--){var Q=r.hypot(this.s[$],Z),J=this.s[$]/Q,ee=Z/Q;this.s[$]=Q,$!==H&&(Z=-ee*o[$-1],o[$-1]=J*o[$-1]);for(var te=0;te=this.s[H+1]);){var Ne=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=Ne,HMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),a=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),a=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),a=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),a=n(3605),s=n(9817),l=n(945);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r{var r=n(8096),i=n(2428),o=n(6449),a=n(3656),s=n(361),l=n(7167),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&l(e),p=n||c||d||h,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!u.call(e,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||f.push(v);return f}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(7237)("length");e.exports=r},7805:(e,t,n)=>{var r=n(3360),i=n(5288);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547:(e,t,n)=>{var r=n(3360),i=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733:(e,t,n)=>{var r=n(1791),i=n(5950);e.exports=function(e,t){return e&&r(t,i(t),e)}},3838:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e,t){return e&&r(t,i(t),e)}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999:(e,t,n)=>{var r=n(7217),i=n(3729),o=n(6547),a=n(4733),s=n(3838),l=n(3290),u=n(3007),c=n(2271),d=n(8948),h=n(2),p=n(3349),f=n(5861),g=n(6189),v=n(7199),y=n(5529),m=n(6449),b=n(3656),x=n(7730),w=n(3805),E=n(8440),_=n(5950),C=n(7241),T="[object Arguments]",N="[object Function]",M="[object Object]",A={};A[T]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[N]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,D,I,O,P){var k,S=1&n,L=2&n,R=4&n;if(D&&(k=O?D(t,I,O,P):D(t)),void 0!==k)return k;if(!w(t))return t;var B=m(t);if(B){if(k=g(t),!S)return u(t,k)}else{var F=f(t),z=F==N||"[object GeneratorFunction]"==F;if(b(t))return l(t,S);if(F==M||F==T||z&&!O){if(k=L||z?{}:y(t),!S)return L?d(t,s(k,t)):c(t,a(k,t))}else{if(!A[F])return O?t:{};k=v(t,F,S)}}P||(P=new r);var j=P.get(t);if(j)return j;P.set(t,k),E(t)?t.forEach((function(r){k.add(e(r,n,D,r,t,P))})):x(t)&&t.forEach((function(r,i){k.set(i,e(r,n,D,i,t,P))}));var V=B?void 0:(R?L?p:h:L?C:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(k,i,e(r,n,D,i,t,P))})),k}},9344:(e,t,n)=>{var r=n(3805),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},3599:(e,t,n)=>{var r=n(4394);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(4528),i=n(5891);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},3335:e=>{e.exports=function(e,t){return e>t}},426:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},6131:(e,t,n)=>{var r=n(2523),i=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),a=n(689),s=n(5861),l=n(6449),u=n(3656),c=n(7167),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,v,y){var m=l(e),b=l(t),x=m?h:s(e),w=b?h:s(t),E=(x=x==d?p:x)==p,_=(w=w==d?p:w)==p,C=x==w;if(C&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(C&&!E)return y||(y=new r),m||c(e)?i(e,t,n,g,v,y):o(e,t,x,n,g,v,y);if(!(1&n)){var T=E&&f.call(e,"__wrapped__"),N=_&&f.call(t,"__wrapped__");if(T||N){var M=T?e.value():e,A=N?t.value():t;return y||(y=new r),v(M,A,n,g,y)}}return!!C&&(y||(y=new r),a(e,t,n,g,v,y))}},9172:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a{e.exports=function(e){return e!=e}},5083:(e,t,n)=>{var r=n(1882),i=n(7296),o=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},6038:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),a=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903:(e,t,n)=>{var r=n(3805),i=n(5527),o=n(181),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6176:e=>{e.exports=function(e,t){return e{var r=n(909),i=n(4894);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),a=n(8586),s=n(756),l=n(7197),u=n(7797);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},5250:(e,t,n)=>{var r=n(7217),i=n(7805),o=n(6649),a=n(2824),s=n(3805),l=n(7241),u=n(4974);e.exports=function e(t,n,c,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,c,e,d,h);else{var p=d?d(u(t,l),o,l+"",t,n,h):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},2824:(e,t,n)=>{var r=n(7805),i=n(3290),o=n(1961),a=n(3007),s=n(5529),l=n(2428),u=n(6449),c=n(3693),d=n(3656),h=n(1882),p=n(3805),f=n(1331),g=n(7167),v=n(4974),y=n(9884);e.exports=function(e,t,n,m,b,x,w){var E=v(e,n),_=v(t,n),C=w.get(_);if(C)r(e,n,C);else{var T=x?x(E,_,n+"",e,t,w):void 0,N=void 0===T;if(N){var M=u(_),A=!M&&d(_),D=!M&&!A&&g(_);T=_,M||A||D?u(E)?T=E:c(E)?T=a(E):A?(N=!1,T=i(_,!0)):D?(N=!1,T=o(_,!0)):T=[]:f(_)||l(_)?(T=E,l(E)?T=y(E):p(E)&&!h(E)||(T=s(_))):N=!1}N&&(w.set(_,T),b(T,_,m,x,w),w.delete(_)),r(e,n,T)}}},6155:(e,t,n)=>{var r=n(4932),i=n(7422),o=n(5389),a=n(5128),s=n(3937),l=n(7301),u=n(3714),c=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var h=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},6001:(e,t,n)=>{var r=n(7420),i=n(631);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},7420:(e,t,n)=>{var r=n(7422),i=n(3170),o=n(1769);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5558:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},9302:(e,t,n)=>{var r=n(3488),i=n(6757),o=n(2865);e.exports=function(e,t){return o(i(e,t,r),e+"")}},3170:(e,t,n)=>{var r=n(6547),i=n(1769),o=n(361),a=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,d=c-1,h=e;null!=h&&++u{var r=n(7334),i=n(3243),o=n(3488),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},3937:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),a=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},5765:(e,t,n)=>{var r=n(8859),i=n(5325),o=n(9905),a=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var u=-1,c=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,c=o;else if(d>=200){var g=t?null:s(e);if(g)return l(g);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++u{var r=n(4932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},1234:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r{e.exports=function(e,t){return e.has(t)}},4066:(e,t,n)=>{var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),a=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736:(e,t,n)=>{var r=n(1873),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730:(e,t,n)=>{var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e{var r=n(3730);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(6547),i=n(3360);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s{var r=n(1791),i=n(4664);e.exports=function(e,t){return r(e,i(e),t)}},8948:(e,t,n)=>{var r=n(1791),i=n(6375);e.exports=function(e,t){return r(e,i(e),t)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},999:(e,t,n)=>{var r=n(9302),i=n(6800);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},5508:(e,t,n)=>{var r=n(6151),i=n(6800),o=n(7400);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t{var r=n(6545),i=n(3950),o=n(4247),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},3243:(e,t,n)=>{var r=n(6110),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f{var r=n(1873),i=n(7828),o=n(5288),a=n(5911),s=n(317),l=n(4247),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,u,d,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=l;++d{var r=n(5970),i=n(6757),o=n(2865);e.exports=function(e){return o(i(e,void 0,r),e+"")}},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},3349:(e,t,n)=>{var r=n(2199),i=n(6375),o=n(7241);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},8879:(e,t,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},6375:(e,t,n)=>{var r=n(4528),i=n(8879),o=n(4664),a=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),a=n(6545),s=n(8303),l=n(2552),u=n(7473),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),v=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case v:return c;case y:return d;case m:return h;case b:return p}return t}),e.exports=x},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),a=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199:(e,t,n)=>{var r=n(9653),i=n(6169),o=n(3201),a=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},5529:(e,t,n)=>{var r=n(9344),i=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5891:(e,t,n)=>{var r=n(1873),i=n(2428),o=n(6449),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(5288),i=n(4894),o=n(361),a=n(3805);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586:(e,t,n)=>{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},6757:(e,t,n)=>{var r=n(1033),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},4974:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2865:(e,t,n)=>{var r=n(9570),i=n(1811)(r);e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6959:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r{var r=n(9811),i=n(9698),o=n(7927);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",c=u+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*",d="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+d+c,"g");e.exports=function(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}},2629:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,4)}},8055:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,5)}},7334:e=>{e.exports=function(e){return function(){return e}}},4684:(e,t,n)=>{var r=n(9302),i=n(5288),o=n(6800),a=n(7241),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n{e.exports=n(9754)},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},5970:(e,t,n)=>{var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},9754:(e,t,n)=>{var r=n(3729),i=n(909),o=n(4066),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},2420:(e,t,n)=>{var r=n(6649),i=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},1448:(e,t,n)=>{var r=n(426),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3693:(e,t,n)=>{var r=n(4894),i=n(346);e.exports=function(e){return i(e)&&r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},2193:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(2428),a=n(6449),s=n(4894),l=n(3656),u=n(5527),c=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:(e,t,n)=>{var r=n(9172),i=n(7301),o=n(6009),a=o&&o.isMap,s=a?i(a):r;e.exports=s},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1331:(e,t,n)=>{var r=n(2552),i=n(8879),o=n(346),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},8440:(e,t,n)=>{var r=n(6038),i=n(7301),o=n(6009),a=o&&o.isSet,s=a?i(a):r;e.exports=s},5015:(e,t,n)=>{var r=n(2552),i=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},2216:e=>{e.exports=function(e){return void 0===e}},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},7241:(e,t,n)=>{var r=n(695),i=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):i(e)}},8090:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:(e,t,n)=>{var r=n(4932),i=n(5389),o=n(5128),a=n(6449);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},3916:(e,t,n)=>{var r=n(3360),i=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},4506:(e,t,n)=>{var r=n(3599),i=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},5364:(e,t,n)=>{var r=n(5250),i=n(999)((function(e,t,n){r(e,t,n)}));e.exports=i},1684:(e,t,n)=>{var r=n(3599),i=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6533:(e,t,n)=>{var r=n(3599),i=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3950:e=>{e.exports=function(){}},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},4383:(e,t,n)=>{var r=n(6001),i=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),a=n(7797);e.exports=function(e){return o(e)?r(a(e)):i(e)}},3181:(e,t,n)=>{var r=n(5508)();e.exports=r},860:(e,t,n)=>{var r=n(882),i=n(909),o=n(5389),a=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},7091:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(4894),a=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031:(e,t,n)=>{var r=n(3120),i=n(6155),o=n(9302),a=n(6800),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9884:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e){return r(e,i(e))}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752:(e,t,n)=>{var r=n(3729),i=n(9344),o=n(641),a=n(5389),s=n(8879),l=n(6449),u=n(3656),c=n(1882),d=n(3805),h=n(7167);e.exports=function(e,t,n){var p=l(e),f=p||u(e)||h(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=f?p?new g:[]:d(e)&&c(g)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},299:(e,t,n)=>{var r=n(3120),i=n(9302),o=n(5765),a=n(3693),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},7200:(e,t,n)=>{var r=n(3222),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5880:(e,t,n)=>{var r=n(514),i=n(5950);e.exports=function(e){return null==e?[]:r(e,i(e))}},7248:(e,t,n)=>{var r=n(6547),i=n(1234);e.exports=function(e,t){return i(e||[],t||[],r)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(4497)})())); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.nrCytoscapeExpandCollapse=t():e.nrCytoscapeExpandCollapse=t()}(this,(()=>(()=>{var e={6078:e=>{var t={equalBoundingBoxes:function(e,t){return e.x1==t.x1&&e.x2==t.x2&&e.y1==t.y1&&e.y2==t.y2},getUnion:function(e,t){var n={x1:Math.min(e.x1,t.x1),x2:Math.max(e.x2,t.x2),y1:Math.min(e.y1,t.y1),y2:Math.max(e.y2,t.y2)};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n}};e.exports=t},4540:(e,t,n)=>{var r=n(3630),i=n(438);e.exports=function(e,t,o){var a,s,l=e;const u=function(){var e=t.scratch("_cyExpandCollapse");return e&&e.cueUtilities};var c={init:function(){var e=document.createElement("canvas");e.classList.add("expand-collapse-canvas");var l=t.container(),u=e.getContext("2d");l.append(e),a=n(1537)(t);var c=function(e){var t=e.getBoundingClientRect();return{top:t.top+document.documentElement.scrollTop,left:t.left+document.documentElement.scrollLeft}},d=r((function(){e.height=t.container().offsetHeight,e.width=t.container().offsetWidth,e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.zIndex=f().zIndex,setTimeout((function(){var n=c(e),r=c(l);e.style.top=-(n.top-r.top),e.style.left=-(n.left-r.left),t&&g()}),0)}),250);function h(){d()}h();var p={};function f(){return t.scratch("_cyExpandCollapse").options}function g(){var e=t.width(),n=t.height();u.clearRect(0,0,e,n),s=null}function v(e,t,n,r,i){var o=new Image(r,i);o.src=e,o.onload=()=>{u.drawImage(o,t,n,r,i)}}t.on("resize",p.eCyResize=function(){h()}),t.on("expandcollapse.clearvisualcue",(function(){s&&g()}));var y,m=null,b=null;t.on("mousedown",p.eMouseDown=function(e){m=e.renderedPosition||e.cyRenderedPosition}),t.on("mouseup",p.eMouseUp=function(e){b=e.renderedPosition||e.cyRenderedPosition}),t.on("remove","node",p.eRemove=function(e){e.target==s&&g()}),t.on("select unselect",p.eSelect=function(){s&&g();var e=t.nodes(":selected");if(1===e.length){var n=e[0];(n.isParent()||n.hasClass("cy-expand-collapse-collapsed-node"))&&function(e){var n=e.children(),r=e.data("collapsedChildren");if(null!=n&&null!=n&&n.length>0||r){var i,o=e.hasClass("cy-expand-collapse-collapsed-node"),l=f().expandCollapseCueSize,c=f().expandCollapseCueLineSize;if("top-left"===f().expandCollapseCuePosition){var d=t.zoom()<1?l/(2*t.zoom()):l/2,h=parseFloat(e.css("border-width"));i={x:e.position("x")-e.width()/2-parseFloat(e.css("padding-left"))+h+d+1,y:e.position("y")-e.height()/2-parseFloat(e.css("padding-top"))+h+d+1}}else{var p=f().expandCollapseCuePosition;i="function"==typeof p?p.call(this,e):p}var g=a.convertToRenderedPosition(i),y=((l=Math.max(l,l*t.zoom()))-(c=Math.max(c,c*t.zoom())))/2,m=g.x,b=g.y,x=m-l/2,w=b-l/2,E=l;if(o&&f().expandCueImage)v(f().expandCueImage,x,w,l,l);else if(!o&&f().collapseCueImage)v(f().collapseCueImage,x,w,l,l);else{var _=u.fillStyle,C=u.lineWidth,T=u.strokeStyle;u.fillStyle="black",u.strokeStyle="black",u.ellipse(m,b,l/2,l/2,0,0,2*Math.PI),u.fill(),u.beginPath(),u.strokeStyle="white",u.lineWidth=Math.max(2.6,2.6*t.zoom()),u.moveTo(x+y,w+l/2),u.lineTo(x+c+y,w+l/2),o&&(u.moveTo(x+l/2,w+y),u.lineTo(x+l/2,w+c+y)),u.closePath(),u.stroke(),u.strokeStyle=T,u.fillStyle=_,u.lineWidth=C}e._private.data.expandcollapseRenderedStartX=x,e._private.data.expandcollapseRenderedStartY=w,e._private.data.expandcollapseRenderedCueSize=E,s=e}}(n)}}),t.on("tap",p.eTap=function(e){var n=s;if(n){var r=n.data("expandcollapseRenderedStartX"),i=n.data("expandcollapseRenderedStartY"),a=n.data("expandcollapseRenderedCueSize"),l=r+a,u=i+a,c=e.renderedPosition||e.cyRenderedPosition,d=c.x,h=c.y,p=f(),v=(p.expandCollapseCueSensitivity-1)/2;Math.abs(m.x-b.x)<5&&Math.abs(m.y-b.y)<5&&d>=r-a*v&&d<=l+a*v&&h>=i-a*v&&h<=u+a*v&&(p.undoable&&!y&&(y=t.undoRedo({defaultActions:!1})),o.isCollapsible(n)?(g(),p.undoable?y.do("collapse",{nodes:n,options:p}):o.collapse(n,p)):o.isExpandable(n)&&(g(),p.undoable?y.do("expand",{nodes:n,options:p}):o.expand(n,p)),n.selectable()&&(n.unselectify(),t.scratch("_cyExpandCollapse").selectableChanged=!0))}}),t.on("afterUndo afterRedo",p.eUndoRedo=p.eSelect),t.on("position","node",p.ePosition=i(p.eSelect,100,g)),t.on("pan zoom",p.ePosition),p.hasEventFields=!0,function(e){var n=t.scratch("_cyExpandCollapse");null==n&&(n={}),n.cueUtilities=e,t.scratch("_cyExpandCollapse",n)}(p)},unbind:function(){var e=u();e.hasEventFields?(t.trigger("expandcollapse.clearvisualcue"),t.off("mousedown","node",e.eMouseDown).off("mouseup","node",e.eMouseUp).off("remove","node",e.eRemove).off("tap","node",e.eTap).off("add","node",e.eAdd).off("position","node",e.ePosition).off("pan zoom",e.ePosition).off("select unselect",e.eSelect).off("free","node",e.eFree).off("resize",e.eCyResize).off("afterUndo afterRedo",e.eUndoRedo)):console.log("events to unbind does not exist")},rebind:function(){var e=u();e.hasEventFields?t.on("mousedown","node",e.eMouseDown).on("mouseup","node",e.eMouseUp).on("remove","node",e.eRemove).on("tap","node",e.eTap).on("add","node",e.eAdd).on("position","node",e.ePosition).on("pan zoom",e.ePosition).on("select unselect",e.eSelect).on("free","node",e.eFree).on("resize",e.eCyResize).on("afterUndo afterRedo",e.eUndoRedo):console.log("events to rebind does not exist")}};if(c[l])return c[l].apply(t.container(),Array.prototype.slice.call(arguments,1));if("object"==typeof l||!l)return c.init.apply(t.container(),arguments);throw new Error("No such function `"+l+"` for cytoscape.js-expand-collapse")}},3630:e=>{var t,n,r=(t=Math.max,n=Date.now||function(){return(new Date).getTime()},function(e,r,i){var o,a,s,l,u,c,d,h,p,f=0,g=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(r=r<0?0:+r||0,!0===i){var y=!0;v=!1}else p=typeof(h=i),!h||"object"!=p&&"function"!=p||(y=!!i.leading,g="maxWait"in i&&t(+i.maxWait||0,r),v="trailing"in i?!!i.trailing:v);function m(t,r){r&&clearTimeout(r),a=c=d=void 0,t&&(f=n(),s=e.apply(u,o),c||a||(o=u=void 0))}function b(){var e=r-(n()-l);e<=0||e>r?m(d,a):c=setTimeout(b,e)}function x(){m(v,c)}function w(){if(o=arguments,l=n(),u=this,d=v&&(c||!y),!1===g)var t=y&&!c;else{a||y||(f=l);var i=g-(l-f),h=i<=0||i>g;h?(a&&(a=clearTimeout(a)),f=l,s=e.apply(u,o)):a||(a=setTimeout(x,i))}return h&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(b,r)),t&&(h=!0,s=e.apply(u,o)),!h||c||a||(o=u=void 0),s}return w.cancel=function(){c&&clearTimeout(c),a&&clearTimeout(a),f=0,a=c=d=void 0},w});e.exports=r},438:e=>{e.exports=function(e,t,n){let r,i=!0;return function(){const o=this,a=arguments;clearTimeout(r),r=setTimeout((function(){r=null,e.apply(o,a),i=!0}),t),i&&(n.apply(o,a),i=!1)}}},1537:(e,t,n)=>{const{runLayoutAsync:r}=n(8647);e.exports=function(e){return{moveNodes:function(e,t,n){var r=n?t:this.getTopMostNodes(t),i=r.not(":parent");i.positions((function(t,n){return{x:i[n].position("x")+e.x,y:i[n].position("y")+e.y}}));for(var o=0;o"group"===e.data().type)).length){const n={};(e?.scratch("_cyExpandCollapse")?.positions??[]).forEach((({nodeId:e,position:t})=>{n[e]=t})),await r(e.layout({name:"preset",fit:!1,positions:n,zoom:e.zoom(),pan:e.pan(),padding:t?.padding??50,animate:t?.animate??!0,animationDuration:t?.animationDuration??500,animationEasing:t?.animationEasing}))}e.scratch("_cyExpandCollapse").positions=null}},convertToRenderedPosition:function(t){var n=e.pan(),r=e.zoom();return{x:t.x*r+n.x,y:t.y*r+n.y}}}}},9272:(e,t,n)=>{var r=n(6078);e.exports=function(e){var t=n(1537)(e);return{animatedlyMovingNodeCount:0,expandNodeBaseFunction:function(n,r,i){if(n._private.data.collapsedChildren){var o={x:n._private.position.x-n._private.data["position-before-collapse"].x,y:n._private.position.y-n._private.data["position-before-collapse"].y};n.removeData("infoLabel"),n.removeClass("cy-expand-collapse-collapsed-node"),n.trigger("expandcollapse.beforeexpand");var a=n._private.data.collapsedChildren;a.restore();for(var s=e.scratch("_cyExpandCollapse").parentData,l=0;l0&&(this.collapseNode(e),e.removeData("collapse"))},expandTopDown:function(e,t){e.data("expand")&&null!=e._private.data.collapsedChildren&&(this.expandNode(e,t),e.removeData("expand"));for(var n=e.children(),r=0;rs?(u+=p,c-=p):(u-=p,c+=p),e._private.data["y-before-fisheye"]>l?(d+=f,h-=f):(d-=f,h+=f);for(var g=[],v=[],y=0;yw?u:c,b=l>E?d:h,isFinite(_)&&(C=Math.min(m,b/Math.abs(_))),0!==_&&(T=Math.min(b,m*Math.abs(_))),s>w&&(C*=-1),l>E&&(T*=-1),this.fishEyeViewMoveNode(x,C,T,n,t,r,i,o)}return 0==a.length&&e.same(n)&&this.expandNodeBaseFunction(n,t,i),null!=e.parent()[0]&&this.fishEyeViewExpandGivenNode(e.parent()[0],t,n,r,i,o),e},getSiblings:function(t){return null==t.parent()[0]?e.nodes(":visible").orphans().difference(t):t.siblings(":visible")},fishEyeViewMoveNode:function(t,n,r,i,o,a,s,l){var u=e.collection();t.isParent()&&(u=t.children(":visible"));var c=this;if(0==u.length){var d={x:t._private.position.x+n,y:t._private.position.y+r};o&&a?(this.animatedlyMovingNodeCount++,t.animate({position:d,complete:function(){c.animatedlyMovingNodeCount--,c.animatedlyMovingNodeCount>0||!i.hasClass("cy-expand-collapse-collapsed-node")||c.expandNodeBaseFunction(i,o,s)}},{duration:l||1e3})):t.position(d)}else for(var h=0;h0?r.add(i):r.add(n)}return r},expandEdge:function(t){t.unselect();var n={edges:e.collection(),oldEdges:e.collection()},r=t.data("collapsedEdges");return void 0!==r&&r.length>0&&(t.trigger("expandcollapse.beforeexpandedge"),n.oldEdges=n.oldEdges.add(t),e.remove(t),n.edges=e.add(r),t.trigger("expandcollapse.afterexpandedge")),n},isValidEdgesForCollapse:function(e){var t=this.getEdgesDistinctEndPoints(e);return 2==t.length&&t},getEdgesDistinctEndPoints:function(e){var t=[];return e.forEach(function(e){this.containsElement(t,e.source())||t.push(e.source()),this.containsElement(t,e.target())||t.push(e.target())}.bind(this)),t},containsElement:function(e,t){for(var n=!1,r=0;r{const r=n(4726),i=n(6527),o=n(5111);e.exports=function(e){const t=e.json();let n=document.getElementById("support-map");return n.style.width=e.container().clientWidth+"px",n.style.height=e.container().clientHeight+"px",r.use(i),r.use(o),r({container:n,elements:t.elements,styleEnabled:!0,style:t.style})}},4497:(e,t,n)=>{var r;!function(){"use strict";var i=function(e){if(!e)return;var t=n(9699),r=n(4540);const i=n(3666),{runLayoutAsync:o,resolveCompoundNodesOverlap:a}=n(8647);var s=null;function l(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n.hasOwnProperty(r)&&(n[r]=t[r]);return n}function u(e){var t="function"==typeof e.animate?e.animate.call():e.animate,n="function"==typeof e.fisheye?e.fisheye.call():e.fisheye;e.animate=t,e.fisheye=n}function c(e,t){void 0===e.scratch("_cyExpandCollapse")&&e.scratch("_cyExpandCollapse",{});var n=e.scratch("_cyExpandCollapse");return void 0===t?n:n[t]}function d(e,t,n){c(e)[t]=n}e("core","expandCollapse",(function(e){var h=this;const p=document.querySelector(".map.__________cytoscape_container"),f=document.getElementById("support-map");if(p&&!f){const e=document.createElement("div");e.id="support-map",e.style.zIndex=-1,e.style.opacity=0,p.parentNode.insertBefore(e,p.nextSibling)}var g=c(h,"options")||{layoutBy:null,fisheye:!0,animate:!0,animationDuration:1e3,ready:function(){},undoable:!0,cueEnabled:!0,expandCollapseCuePosition:"top-left",expandCollapseCueSize:12,expandCollapseCueLineSize:8,expandCueImage:void 0,collapseCueImage:void 0,expandCollapseCueSensitivity:1,edgeTypeInfo:"edgeType",groupEdgesOfSameTypeOnCollapse:!1,allowNestedEdgeCollapse:!0,zIndex:999,isGroupBy:!0};if("get"!==e){g=l(g,e);var v=function(e,t){var n={};function h(t){var r=c(e,"options");t.cueEnabled&&!r.cueEnabled?n.enableCue():!t.cueEnabled&&r.cueEnabled&&n.disableCue()}return n.setOptions=function(t){h(t),d(e,"options",t)},n.extendOptions=function(t){var n=l(c(e,"options"),t);h(n),d(e,"options",n)},n.setOption=function(t,n){var r={};r[t]=n;var i=l(c(e,"options"),r);h(i),d(e,"options",i)},n.collapse=async function(n,r){var s=this.collapsibleNodes(n),h=l(c(e,"options"),r);if(u(h),h?.isGroupBy){var p=i(e),f=s.map((e=>{var t=p.getElementById(e.id());return t.toggleClass("expanded",!1),t.toggleClass("cy-expand-collapse-collapsed-node",!0),t.toggleClass("collapsed",!0),t}));if(f.length){var g=p.collection(f);t.simpleCollapseGivenNodes(g);var v=c(e,"options").layoutBy;await o(p.layout({...v,animate:!1})),await a(p,{...v,animate:!1});var y=p.nodes().map((e=>({nodeId:e.id(),position:e.position()})));p.destroy(),d(e,"positions",y)}}return t.collapseGivenNodes(s,h)},n.collapseRecursively=async function(t,n){var r=this.collapsibleNodes(t),i=l(c(e,"options"),n);return u(i),await this.collapse(r.union(r.descendants()),i)},n.expand=async function(n,r){var s=l(c(e,"options"),r);if(u(s),s?.isGroupBy){var h=i(e),p=h.getElementById(n.id()),f=p._private.data.collapsedChildren;h.add(f),p.toggleClass("cy-expand-collapse-collapsed-node",!1),p.toggleClass("collapsed",!1),p.toggleClass("expanded",!0);var g=c(e,"options").layoutBy;await o(h.layout({...g,animate:!1})),await a(h,{...g,animate:!1});var v=h.nodes().map((e=>({nodeId:e.id(),position:e.position()})));h.destroy(),d(e,"positions",v)}var y=this.expandableNodes(n);return t.expandGivenNodes(y,s)},n.expandRecursively=function(n,r){var i=this.expandableNodes(n),o=l(c(e,"options"),r);return u(o),t.expandAllNodes(i,o)},n.collapseAll=async function(t){var n=l(c(e,"options"),t);return u(n),await this.collapseRecursively(this.collapsibleNodes(),n)},n.expandAll=function(t){var n=l(c(e,"options"),t);return u(n),this.expandRecursively(this.expandableNodes(),n)},n.isExpandable=function(e){return e.hasClass("cy-expand-collapse-collapsed-node")},n.isCollapsible=function(e){return!this.isExpandable(e)&&e.isParent()},n.collapsibleNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isCollapsible(e)}))},n.expandableNodes=function(t){var n=this;return(t||e.nodes()).filter((function(e,t){return"number"==typeof e&&(e=t),n.isExpandable(e)}))},n.getCollapsedChildren=function(e){return e.data("collapsedChildren")},n.getCollapsedChildrenRecursively=function(n){var r=e.collection();return t.getCollapsedChildrenRecursively(n,r)},n.getAllCollapsedChildrenRecursively=function(){var t,n=e.collection(),r=e.nodes(".cy-expand-collapse-collapsed-node");for(t=0;t[e,e])));var u={edges:e.collection(),oldEdges:e.collection()};return s.forEach(function(e){const n=e[1].id();var r=e[0].connectedEdges('[source = "'+n+'"],[target = "'+n+'"]');if(e[0].id()===n&&(r=e[0].connectedEdges('[source = "'+n+'"][target = "'+n+'"]')),r.length>=2){var i=t.collapseGivenEdges(r,a);u.oldEdges=u.oldEdges.add(i.oldEdges),u.edges=u.edges.add(i.edges)}}.bind(this)),u},n.expandEdgesBetweenNodes=function(t){var n,r,i=e.collection(),o=(r=[],(n=t).slice(0,n.length-1).forEach((function(e,t){n.slice(t+1,n.length).forEach((function(t){r.push([e,t])}))})),r);return o.push(...t.map((e=>[e,e]))),o.forEach(function(e){const t=e[1].id();var n=e[0].connectedEdges('.cy-expand-collapse-collapsed-edge[source = "'+t+'"],[target = "'+t+'"]');e[0].id()===t&&(n=e[0].connectedEdges('[source = "'+t+'"][target = "'+t+'"]')),i=i.union(n)}.bind(this)),this.expandEdges(i)},n.collapseAllEdges=function(t){return this.collapseEdgesBetweenNodes(e.edges().connectedNodes(),t)},n.expandAllEdges=function(){var t=e.edges(".cy-expand-collapse-collapsed-edge"),n={edges:e.collection(),oldEdges:e.collection()},r=this.expandEdges(t);return n.oldEdges=n.oldEdges.add(r.oldEdges),n.edges=n.edges.add(r.edges),n},n.loadJson=function(e){s.loadJson(e)},n.saveJson=function(e,t){return s.saveJson(e,t)},n}(h,n(9272)(h));s=n(554)(h,v),d(h,"api",v),t(h,v),r(g,h,v),g.cueEnabled||r("unbind",h,v),g.ready&&g.ready(),d(h,"options",g),d(h,"parentData",{})}return c(h,"api")}))};e.exports&&(e.exports=i),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r),"undefined"!=typeof cytoscape&&i(cytoscape)}()},8647:(e,t,n)=>{function r(e){return new Promise((t=>{e.on("layoutstop",t),e.run()}))}e.exports={runLayoutAsync:r,resolveCompoundNodesOverlap:async function(e,t){const i=n(1537)(e);if(e.nodes().filter((e=>"positioning-support"===e.data().type)).length)return;const o=function(e){const t={};return e.filter((e=>"default"!==e.data().type)).forEach((e=>{const n=e.data().parent;if(void 0===n)t[1]||(t[1]={root:[]}),t[1].root.push(e);else{const r=n.split("::").length;t[r]||(t[r]={}),t[r][n]||(t[r][n]=[]),t[r][n].push(e)}})),Object.keys(t).sort(((e,t)=>parseInt(t)-parseInt(e))).map((e=>({level:e,items:Object.values(t[e])})))??[]}(e.nodes());for(let n=0;n{if(!t.hasClass("cy-expand-collapse-collapsed-node")&&t.isParent()){const n=`support ${t.data().id}`,r={group:"nodes",data:{id:n,parent:t.data().parent,type:"positioning-support",label:`${t.data().label}`},style:{width:t.boundingBox().w,height:t.boundingBox().h,padding:0,"min-width":0,"border-width":0,shape:"round-rectangle"},position:{x:t.position("x"),y:t.position("y")}};e.add(r);const i=t.remove();a=a.union(i);const o=e.getElementById(n);return s=s.union(o),o}return t}));l=l.union(r)}if(0===a.length&&1===o.length){const e=l.layout(t);await r(e)}else if(a.length>0){const n=l.layout(t);await r(n),a.restore(),a.forEach((t=>{if("edges"!==t.group()||"default"===t.data()?.type){const n=`support ${t.data().id}`,r=e.getElementById(n);if(r?.length){const e={x:t.position().x{e.exports=function(e,t){function n(t,i,o,a){t.sort((e=>"edges"===e.group?1:-1));let s=e.collection();for(let l=0;l{e.exports=function(e,t){if(null!=e.undoRedo){for(var n=e.undoRedo({},!0),r={layoutBy:null,animate:!1,fisheye:!1},i=["collapse","collapseRecursively","collapseAll","expand","expandRecursively","expandAll"],o=0;o0?t[n](i.options):t[n](c,i.options)):(u.oldData=a(),u.nodes=n.indexOf("All")>0?t[n](r):t[n](e.collection(c),r),s=i.oldData,l={},e.nodes().not(":parent").positions((function(e,t){"number"==typeof e&&(e=t),l[e.id()]={x:e.position("x"),y:e.position("y")};var n=s[e.id()];return{x:n.x,y:n.y}}))),u}}function l(n){var r=n.options,i=n.edges,o={};if(o.options=r,n.firstTime){var a=t.collapseEdges(i,r);o.edges=a.edges,o.oldEdges=a.oldEdges,o.firstTime=!1}else o.oldEdges=i,o.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return o}function u(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function c(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.collapseAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function d(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdges(n.edges);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.oldEdges=n.edges,i.edges=n.oldEdges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function h(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandEdgesBetweenNodes(n.nodes,r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}function p(n){var r=n.options,i={};if(i.options=r,n.firstTime){var o=t.expandAllEdges(r);i.edges=o.edges,i.oldEdges=o.oldEdges,i.firstTime=!1}else i.edges=n.oldEdges,i.oldEdges=n.edges,n.edges.length>0&&n.oldEdges.length>0&&(e.remove(n.edges),e.add(n.oldEdges));return i}}},7799:function(e,t,n){var r;r=function(e){return(()=>{"use strict";var t={45:(e,t,n)=>{var r={};r.layoutBase=n(551),r.CoSEConstants=n(806),r.CoSEEdge=n(767),r.CoSEGraph=n(880),r.CoSEGraphManager=n(578),r.CoSELayout=n(765),r.CoSENode=n(991),r.ConstraintHandler=n(902),e.exports=r},806:(e,t,n)=>{var r=n(551).FDLayoutConstants;function i(){}for(var o in r)i[o]=r[o];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=r.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,i.ENFORCE_CONSTRAINTS=!0,i.APPLY_LAYOUT=!0,i.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,i.TREE_REDUCTION_ON_INCREMENTAL=!0,i.PURE_INCREMENTAL=i.DEFAULT_INCREMENTAL,e.exports=i},767:(e,t,n)=>{var r=n(551).FDLayoutEdge;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},880:(e,t,n)=>{var r=n(551).LGraph;function i(e,t,n){r.call(this,e,t,n)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},578:(e,t,n)=>{var r=n(551).LGraphManager;function i(e){r.call(this,e)}for(var o in i.prototype=Object.create(r.prototype),r)i[o]=r[o];e.exports=i},765:(e,t,n)=>{var r=n(551).FDLayout,i=n(578),o=n(880),a=n(991),s=n(767),l=n(806),u=n(902),c=n(551).FDLayoutConstants,d=n(551).LayoutConstants,h=n(551).Point,p=n(551).PointD,f=n(551).DimensionD,g=n(551).Layout,v=n(551).Integer,y=n(551).IGeometry,m=n(551).LGraph,b=n(551).Transform,x=n(551).LinkedList;function w(){r.call(this),this.toBeTiled={},this.constraints={}}for(var E in w.prototype=Object.create(r.prototype),r)w[E]=r[E];w.prototype.newGraphManager=function(){var e=new i(this);return this.graphManager=e,e},w.prototype.newGraph=function(e){return new o(null,this.graphManager,e)},w.prototype.newNode=function(e){return new a(this.graphManager,e)},w.prototype.newEdge=function(e){return new s(null,null,e)},w.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.isSubLayout||(l.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=l.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=l.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},w.prototype.initSpringEmbedder=function(){r.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},w.prototype.layout=function(){return d.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},w.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental)l.TREE_REDUCTION_ON_INCREMENTAL&&(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)})),this.graphManager.setAllNodesToApplyGravitation(n));else{var e=this.getFlatForest();if(e.length>0)this.positionNodesRadially(e);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes()),n=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(n),this.positionNodesRandomly()}}return Object.keys(this.constraints).length>0&&(u.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),l.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},w.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes()),t=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(t),this.graphManager.updateBounds(),this.updateGrid(),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),l.PURE_INCREMENTAL?this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var n=!this.isTreeGrowing&&!this.isGrowthFinished,r=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(n,r),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},w.prototype.getPositionsData=function(){for(var e=this.graphManager.getAllNodes(),t={},n=0;n0&&this.updateDisplacements(),t=0;t0&&(r.fixedNodeWeight=o)}if(this.constraints.relativePlacementConstraint){var a=new Map,s=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach((function(t){e.fixedNodesOnHorizontal.add(t),e.fixedNodesOnVertical.add(t)})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var u=this.constraints.alignmentConstraint.vertical;for(n=0;n=2*e.length/3;r--)t=Math.floor(Math.random()*(r+1)),n=e[r],e[r]=e[t],e[t]=n;return e},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var n=a.has(t.left)?a.get(t.left):t.left,r=a.has(t.right)?a.get(t.right):t.right;e.nodesInRelativeHorizontal.includes(n)||(e.nodesInRelativeHorizontal.push(n),e.nodeToRelativeConstraintMapHorizontal.set(n,[]),e.dummyToNodeForVerticalAlignment.has(n)?e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(n)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(n,e.idToNodeMap.get(n).getCenterX())),e.nodesInRelativeHorizontal.includes(r)||(e.nodesInRelativeHorizontal.push(r),e.nodeToRelativeConstraintMapHorizontal.set(r,[]),e.dummyToNodeForVerticalAlignment.has(r)?e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(e.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX()):e.nodeToTempPositionMapHorizontal.set(r,e.idToNodeMap.get(r).getCenterX())),e.nodeToRelativeConstraintMapHorizontal.get(n).push({right:r,gap:t.gap}),e.nodeToRelativeConstraintMapHorizontal.get(r).push({left:n,gap:t.gap})}else{var i=s.has(t.top)?s.get(t.top):t.top,o=s.has(t.bottom)?s.get(t.bottom):t.bottom;e.nodesInRelativeVertical.includes(i)||(e.nodesInRelativeVertical.push(i),e.nodeToRelativeConstraintMapVertical.set(i,[]),e.dummyToNodeForHorizontalAlignment.has(i)?e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(i)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(i,e.idToNodeMap.get(i).getCenterY())),e.nodesInRelativeVertical.includes(o)||(e.nodesInRelativeVertical.push(o),e.nodeToRelativeConstraintMapVertical.set(o,[]),e.dummyToNodeForHorizontalAlignment.has(o)?e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(e.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY()):e.nodeToTempPositionMapVertical.set(o,e.idToNodeMap.get(o).getCenterY())),e.nodeToRelativeConstraintMapVertical.get(i).push({bottom:o,gap:t.gap}),e.nodeToRelativeConstraintMapVertical.get(o).push({top:i,gap:t.gap})}}));else{var d=new Map,h=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var t=a.has(e.left)?a.get(e.left):e.left,n=a.has(e.right)?a.get(e.right):e.right;d.has(t)?d.get(t).push(n):d.set(t,[n]),d.has(n)?d.get(n).push(t):d.set(n,[t])}else{var r=s.has(e.top)?s.get(e.top):e.top,i=s.has(e.bottom)?s.get(e.bottom):e.bottom;h.has(r)?h.get(r).push(i):h.set(r,[i]),h.has(i)?h.get(i).push(r):h.set(i,[r])}}));var p=function(e,t){var n=[],r=[],i=new x,o=new Set,a=0;return e.forEach((function(s,l){if(!o.has(l)){n[a]=[],r[a]=!1;var u=l;for(i.push(u),o.add(u),n[a].push(u);0!=i.length;)u=i.shift(),t.has(u)&&(r[a]=!0),e.get(u).forEach((function(e){o.has(e)||(i.push(e),o.add(e),n[a].push(e))}));a++}})),{components:n,isFixed:r}},f=p(d,e.fixedNodesOnHorizontal);this.componentsOnHorizontal=f.components,this.fixedComponentsOnHorizontal=f.isFixed;var g=p(h,e.fixedNodesOnVertical);this.componentsOnVertical=g.components,this.fixedComponentsOnVertical=g.isFixed}}},w.prototype.updateDisplacements=function(){var e=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach((function(t){var n=e.idToNodeMap.get(t.nodeId);n.displacementX=0,n.displacementY=0})),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var t=this.constraints.alignmentConstraint.vertical,n=0;n1)for(s=0;sr&&(r=Math.floor(a.y)),o=Math.floor(a.x+l.DEFAULT_COMPONENT_SEPERATION)}this.transform(new p(d.WORLD_CENTER_X-a.x/2,d.WORLD_CENTER_Y-a.y/2))},w.radialLayout=function(e,t,n){var r=Math.max(this.maxDiagonalInTree(e),l.DEFAULT_RADIAL_SEPARATION);w.branchRadialLayout(t,null,0,359,0,r);var i=m.calculateBounds(e),o=new b;o.setDeviceOrgX(i.getMinX()),o.setDeviceOrgY(i.getMinY()),o.setWorldOrgX(n.x),o.setWorldOrgY(n.y);for(var a=0;a1;){var v=g[0];g.splice(0,1);var m=c.indexOf(v);m>=0&&c.splice(m,1),f--,d--}h=null!=t?(c.indexOf(g[0])+1)%f:0;for(var b=Math.abs(r-n)/d,x=h;p!=d;x=++x%f){var E=c[x].getOtherEnd(e);if(E!=t){var _=(n+p*b)%360,C=(_+b)%360;w.branchRadialLayout(E,e,_,C,i+o,o),p++}}},w.maxDiagonalInTree=function(e){for(var t=v.MIN_VALUE,n=0;nt&&(t=r)}return t},w.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},w.prototype.groupZeroDegreeMembers=function(){var e=this,t={};this.memberGroups={},this.idToDummyNode={};for(var n=[],r=this.graphManager.getAllNodes(),i=0;i1){var r="DummyCompound_"+n;e.memberGroups[r]=t[n];var i=t[n][0].getParent(),o=new a(e.graphManager);o.id=r,o.paddingLeft=i.paddingLeft||0,o.paddingRight=i.paddingRight||0,o.paddingBottom=i.paddingBottom||0,o.paddingTop=i.paddingTop||0,e.idToDummyNode[r]=o;var s=e.getGraphManager().add(e.newGraph(),o),l=i.getChild();l.add(o);for(var u=0;ui?(r.rect.x-=(r.labelWidth-i)/2,r.setWidth(r.labelWidth),r.labelMarginLeft=(r.labelWidth-i)/2):"right"==r.labelPosHorizontal&&r.setWidth(i+r.labelWidth)),r.labelHeight&&("top"==r.labelPosVertical?(r.rect.y-=r.labelHeight,r.setHeight(o+r.labelHeight),r.labelMarginTop=r.labelHeight):"center"==r.labelPosVertical&&r.labelHeight>o?(r.rect.y-=(r.labelHeight-o)/2,r.setHeight(r.labelHeight),r.labelMarginTop=(r.labelHeight-o)/2):"bottom"==r.labelPosVertical&&r.setHeight(o+r.labelHeight))}}))},w.prototype.repopulateCompounds=function(){for(var e=this.compoundOrder.length-1;e>=0;e--){var t=this.compoundOrder[e],n=t.id,r=t.paddingLeft,i=t.paddingTop,o=t.labelMarginLeft,a=t.labelMarginTop;this.adjustLocations(this.tiledMemberPack[n],t.rect.x,t.rect.y,r,i,o,a)}},w.prototype.repopulateZeroDegreeMembers=function(){var e=this,t=this.tiledZeroDegreePack;Object.keys(t).forEach((function(n){var r=e.idToDummyNode[n],i=r.paddingLeft,o=r.paddingTop,a=r.labelMarginLeft,s=r.labelMarginTop;e.adjustLocations(t[n],r.rect.x,r.rect.y,i,o,a,s)}))},w.prototype.getToBeTiled=function(e){var t=e.id;if(null!=this.toBeTiled[t])return this.toBeTiled[t];var n=e.getChild();if(null==n)return this.toBeTiled[t]=!1,!1;for(var r=n.getNodes(),i=0;i0)return this.toBeTiled[t]=!1,!1;if(null!=o.getChild()){if(!this.getToBeTiled(o))return this.toBeTiled[t]=!1,!1}else this.toBeTiled[o.id]=!1}return this.toBeTiled[t]=!0,!0},w.prototype.getNodeDegree=function(e){e.id;for(var t=e.getEdges(),n=0,r=0;rc&&(c=h.rect.height)}n+=c+e.verticalPadding}},w.prototype.tileCompoundMembers=function(e,t){var n=this;this.tiledMemberPack=[],Object.keys(e).forEach((function(r){var i=t[r];if(n.tiledMemberPack[r]=n.tileNodes(e[r],i.paddingLeft+i.paddingRight),i.rect.width=n.tiledMemberPack[r].width,i.rect.height=n.tiledMemberPack[r].height,i.setCenter(n.tiledMemberPack[r].centerX,n.tiledMemberPack[r].centerY),i.labelMarginLeft=0,i.labelMarginTop=0,l.NODE_DIMENSIONS_INCLUDE_LABELS){var o=i.rect.width,a=i.rect.height;i.labelWidth&&("left"==i.labelPosHorizontal?(i.rect.x-=i.labelWidth,i.setWidth(o+i.labelWidth),i.labelMarginLeft=i.labelWidth):"center"==i.labelPosHorizontal&&i.labelWidth>o?(i.rect.x-=(i.labelWidth-o)/2,i.setWidth(i.labelWidth),i.labelMarginLeft=(i.labelWidth-o)/2):"right"==i.labelPosHorizontal&&i.setWidth(o+i.labelWidth)),i.labelHeight&&("top"==i.labelPosVertical?(i.rect.y-=i.labelHeight,i.setHeight(a+i.labelHeight),i.labelMarginTop=i.labelHeight):"center"==i.labelPosVertical&&i.labelHeight>a?(i.rect.y-=(i.labelHeight-a)/2,i.setHeight(i.labelHeight),i.labelMarginTop=(i.labelHeight-a)/2):"bottom"==i.labelPosVertical&&i.setHeight(a+i.labelHeight))}}))},w.prototype.tileNodes=function(e,t){var n=this.tileNodesByFavoringDim(e,t,!0),r=this.tileNodesByFavoringDim(e,t,!1),i=this.getOrgRatio(n);return this.getOrgRatio(r)s&&(s=e.getWidth())}));var u,c=o/i,d=a/i,h=Math.pow(n-r,2)+4*(c+r)*(d+n)*i,p=(r-n+Math.sqrt(h))/(2*(c+r));t?(u=Math.ceil(p))==p&&u++:u=Math.floor(p);var f=u*(c+r)-r;return s>f&&(f=s),f+2*r},w.prototype.tileNodesByFavoringDim=function(e,t,n){var r=l.TILING_PADDING_VERTICAL,i=l.TILING_PADDING_HORIZONTAL,o=l.TILING_COMPARE_BY,a={rows:[],rowWidth:[],rowHeight:[],width:0,height:t,verticalPadding:r,horizontalPadding:i,centerX:0,centerY:0};o&&(a.idealRowWidth=this.calcIdealRowWidth(e,n));var s=function(e){return e.rect.width*e.rect.height},u=function(e,t){return s(t)-s(e)};e.sort((function(e,t){var n=u;return a.idealRowWidth?(n=o)(e.id,t.id):n(e,t)}));for(var c=0,d=0,h=0;h0&&(o+=e.horizontalPadding),e.rowWidth[n]=o,e.width0&&(a+=e.verticalPadding);var s=0;a>e.rowHeight[n]&&(s=e.rowHeight[n],e.rowHeight[n]=a,s=e.rowHeight[n]-s),e.height+=s,e.rows[n].push(t)},w.prototype.getShortestRowIndex=function(e){for(var t=-1,n=Number.MAX_VALUE,r=0;rn&&(t=r,n=e.rowWidth[r]);return t},w.prototype.canAddHorizontal=function(e,t,n){if(e.idealRowWidth){var r=e.rows.length-1;return e.rowWidth[r]+t+e.horizontalPadding<=e.idealRowWidth}var i=this.getShortestRowIndex(e);if(i<0)return!0;var o=e.rowWidth[i];if(o+e.horizontalPadding+t<=e.width)return!0;var a,s,l=0;return e.rowHeight[i]0&&(l=n+e.verticalPadding-e.rowHeight[i]),a=e.width-o>=t+e.horizontalPadding?(e.height+l)/(o+t+e.horizontalPadding):(e.height+l)/e.width,l=n+e.verticalPadding,(s=e.widtho&&t!=n){r.splice(-1,1),e.rows[n].push(i),e.rowWidth[t]=e.rowWidth[t]-o,e.rowWidth[n]=e.rowWidth[n]+o,e.width=e.rowWidth[instance.getLongestRowIndex(e)];for(var a=Number.MIN_VALUE,s=0;sa&&(a=r[s].height);t>0&&(a+=e.verticalPadding);var l=e.rowHeight[t]+e.rowHeight[n];e.rowHeight[t]=a,e.rowHeight[n]0)for(var d=i;d<=o;d++)u[0]+=this.grid[d][a-1].length+this.grid[d][a].length-1;if(o0)for(d=a;d<=s;d++)u[3]+=this.grid[i-1][d].length+this.grid[i][d].length-1;for(var h,p,f=v.MAX_VALUE,g=0;g{var r=n(551).FDLayoutNode,i=n(551).IMath;function o(e,t,n,i){r.call(this,e,t,n,i)}for(var a in o.prototype=Object.create(r.prototype),r)o[a]=r[a];o.prototype.calculateDisplacement=function(){var e=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=e.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=e.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementX=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>e.coolingFactor*e.maxNodeDisplacement&&(this.displacementY=e.coolingFactor*e.maxNodeDisplacement*i.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},o.prototype.propogateDisplacementToChildren=function(e,t){for(var n,r=this.getChild().getNodes(),i=0;i{function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0){var o=0;r.forEach((function(e){"horizontal"==t?(d.set(e,l.has(e)?u[l.get(e)]:i.get(e)),o+=d.get(e)):(d.set(e,l.has(e)?c[l.get(e)]:i.get(e)),o+=d.get(e))})),o/=r.length,e.forEach((function(e){n.has(e)||d.set(e,o)}))}else{var a=0;e.forEach((function(e){a+="horizontal"==t?l.has(e)?u[l.get(e)]:i.get(e):l.has(e)?c[l.get(e)]:i.get(e)})),a/=e.length,e.forEach((function(e){d.set(e,a)}))}}));for(var f=function(){var r=p.shift();e.get(r).forEach((function(e){if(d.get(e.id)a&&(a=y),bs&&(s=b)}}catch(e){p=!0,f=e}finally{try{!h&&v.return&&v.return()}finally{if(p)throw f}}var x=(r+a)/2-(o+s)/2,w=!0,E=!1,_=void 0;try{for(var C,T=e[Symbol.iterator]();!(w=(C=T.next()).done);w=!0){var N=C.value;d.set(N,d.get(N)+x)}}catch(e){E=!0,_=e}finally{try{!w&&T.return&&T.return()}finally{if(E)throw _}}}))}return d},y=function(e){var t=0,n=0,r=0,i=0;if(e.forEach((function(e){e.left?u[l.get(e.left)]-u[l.get(e.right)]>=0?t++:n++:c[l.get(e.top)]-c[l.get(e.bottom)]>=0?r++:i++})),t>n&&r>i)for(var o=0;on)for(var a=0;ai)for(var s=0;s1)t.fixedNodeConstraint.forEach((function(e,t){w[t]=[e.position.x,e.position.y],E[t]=[u[l.get(e.nodeId)],c[l.get(e.nodeId)]]})),_=!0;else if(t.alignmentConstraint)!function(){var e=0;if(t.alignmentConstraint.vertical){for(var n=t.alignmentConstraint.vertical,i=function(t){var i=new Set;n[t].forEach((function(e){i.add(e)}));var o,a=new Set([].concat(r(i)).filter((function(e){return T.has(e)})));o=a.size>0?u[l.get(a.values().next().value)]:g(i).x,n[t].forEach((function(t){w[e]=[o,c[l.get(t)]],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},o=0;o0?u[l.get(o.values().next().value)]:g(n).y,a[t].forEach((function(t){w[e]=[u[l.get(t)],i],E[e]=[u[l.get(t)],c[l.get(t)]],e++}))},d=0;dD&&(D=A[O].length,I=O);if(D0){var W={x:0,y:0};t.fixedNodeConstraint.forEach((function(e,t){var n,r,i=(r={x:u[l.get(e.nodeId)],y:c[l.get(e.nodeId)]},{x:(n=e.position).x-r.x,y:n.y-r.y});W.x+=i.x,W.y+=i.y})),W.x/=t.fixedNodeConstraint.length,W.y/=t.fixedNodeConstraint.length,u.forEach((function(e,t){u[t]+=W.x})),c.forEach((function(e,t){c[t]+=W.y})),t.fixedNodeConstraint.forEach((function(e){u[l.get(e.nodeId)]=e.position.x,c[l.get(e.nodeId)]=e.position.y}))}if(t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var q=t.alignmentConstraint.vertical,K=function(e){var t=new Set;q[e].forEach((function(e){t.add(e)}));var n,i=new Set([].concat(r(t)).filter((function(e){return T.has(e)})));n=i.size>0?u[l.get(i.values().next().value)]:g(t).x,t.forEach((function(e){T.has(e)||(u[l.get(e)]=n)}))},Z=0;Z0?c[l.get(i.values().next().value)]:g(t).y,t.forEach((function(e){T.has(e)||(c[l.get(e)]=n)}))},J=0;J<$.length;J++)Q(J)}t.relativePlacementConstraint&&function(){var e=new Map,n=new Map,r=new Map,i=new Map,o=new Map,a=new Map,s=new Set,d=new Set;if(T.forEach((function(e){s.add(e),d.add(e)})),t.alignmentConstraint){if(t.alignmentConstraint.vertical)for(var h=t.alignmentConstraint.vertical,p=function(t){r.set("dummy"+t,[]),h[t].forEach((function(n){e.set(n,"dummy"+t),r.get("dummy"+t).push(n),T.has(n)&&s.add("dummy"+t)})),o.set("dummy"+t,u[l.get(h[t][0])])},f=0;f{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(45);return r})()},e.exports=r(n(3143))},5111:function(e,t,n){var r;r=function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){var r=n(1),i=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var i=function(e){return"function"==typeof e},o=n(2),a=n(3),s=n(4);function l(e){this.options=a({},o,e)}l.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,o=function(e,t){return i(t)?t.apply(e,[e]):t},a=e.boundingBox||{x1:0,y1:0,w:t.width(),h:t.height()};void 0===a.x2&&(a.x2=a.x1+a.w),void 0===a.w&&(a.w=a.x2-a.x1),void 0===a.y2&&(a.y2=a.y1+a.h),void 0===a.h&&(a.h=a.y2-a.y1);var l=new s.graphlib.Graph({multigraph:!0,compound:!0}),u={},c=function(e,t){null!=t&&(u[e]=t)};c("nodesep",e.nodeSep),c("edgesep",e.edgeSep),c("ranksep",e.rankSep),c("rankdir",e.rankDir),c("align",e.align),c("ranker",e.ranker),c("acyclicer",e.acyclicer),l.setGraph(u),l.setDefaultEdgeLabel((function(){return{}})),l.setDefaultNodeLabel((function(){return{}}));var d=n.nodes();i(e.sort)&&(d=d.sort(e.sort));for(var h=0;h1?t-1:0),r=1;r{"use strict";var t={658:e=>{e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r{var r=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=n(140).layoutBase.LinkedList,o={getTopMostNodes:function(e){for(var t={},n=0;n0&&u.merge(e)}));for(var c=0;c1){u=s[0],c=u.connectedEdges().length,s.forEach((function(e){e.connectedEdges().length0&&r.set("dummy"+(r.size+1),p),f},relocateComponent:function(e,t,n){if(!n.fixedNodeConstraint){var i=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;if("draft"==n.quality){var l=!0,u=!1,c=void 0;try{for(var d,h=t.nodeIndexes[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value,f=r(p,2),g=f[0],v=f[1],y=n.cy.getElementById(g);if(y){var m=y.boundingBox(),b=t.xCoords[v]-m.w/2,x=t.xCoords[v]+m.w/2,w=t.yCoords[v]-m.h/2,E=t.yCoords[v]+m.h/2;bo&&(o=x),ws&&(s=E)}}}catch(e){u=!0,c=e}finally{try{!l&&h.return&&h.return()}finally{if(u)throw c}}var _=e.x-(o+i)/2,C=e.y-(s+a)/2;t.xCoords=t.xCoords.map((function(e){return e+_})),t.yCoords=t.yCoords.map((function(e){return e+C}))}else{Object.keys(t).forEach((function(e){var n=t[e],r=n.getRect().x,l=n.getRect().x+n.getRect().width,u=n.getRect().y,c=n.getRect().y+n.getRect().height;ro&&(o=l),us&&(s=c)}));var T=e.x-(o+i)/2,N=e.y-(s+a)/2;Object.keys(t).forEach((function(e){var n=t[e];n.setCenter(n.getCenterX()+T,n.getCenterY()+N)}))}}},calcBoundingBox:function(e,t,n,r){for(var i=Number.MAX_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=void 0,u=void 0,c=void 0,d=void 0,h=e.descendants().not(":parent"),p=h.length,f=0;f(l=t[r.get(g.id())]-g.width()/2)&&(i=l),o<(u=t[r.get(g.id())]+g.width()/2)&&(o=u),a>(c=n[r.get(g.id())]-g.height()/2)&&(a=c),s<(d=n[r.get(g.id())]+g.height()/2)&&(s=d)}var v={};return v.topLeftX=i,v.topLeftY=a,v.width=o-i,v.height=s-a,v},calcParentsWithoutChildren:function(e,t){var n=e.collection();return t.nodes(":parent").forEach((function(e){var t=!1;e.children().forEach((function(e){"none"!=e.css("display")&&(t=!0)})),t||n.merge(e)})),n}};e.exports=o},816:(e,t,n)=>{var r=n(548),i=n(140).CoSELayout,o=n(140).CoSENode,a=n(140).layoutBase.PointD,s=n(140).layoutBase.DimensionD,l=n(140).layoutBase.LayoutConstants,u=n(140).layoutBase.FDLayoutConstants,c=n(140).CoSEConstants;e.exports={coseLayout:function(e,t){var n=e.cy,d=e.eles,h=d.nodes(),p=d.edges(),f=void 0,g=void 0,v=void 0,y={};e.randomize&&(f=t.nodeIndexes,g=t.xCoords,v=t.yCoords);var m=function(e){return"function"==typeof e},b=function(e,t){return m(e)?e(t):e},x=r.calcParentsWithoutChildren(n,d);null!=e.nestingFactor&&(c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=u.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor),null!=e.gravity&&(c.DEFAULT_GRAVITY_STRENGTH=u.DEFAULT_GRAVITY_STRENGTH=e.gravity),null!=e.numIter&&(c.MAX_ITERATIONS=u.MAX_ITERATIONS=e.numIter),null!=e.gravityRange&&(c.DEFAULT_GRAVITY_RANGE_FACTOR=u.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange),null!=e.gravityCompound&&(c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=u.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound),null!=e.gravityRangeCompound&&(c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=u.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound),null!=e.initialEnergyOnIncremental&&(c.DEFAULT_COOLING_FACTOR_INCREMENTAL=u.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental),null!=e.tilingCompareBy&&(c.TILING_COMPARE_BY=e.tilingCompareBy),"proof"==e.quality?l.QUALITY=2:l.QUALITY=0,c.NODE_DIMENSIONS_INCLUDE_LABELS=u.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!e.randomize,c.ANIMATE=u.ANIMATE=l.ANIMATE=e.animate,c.TILE=e.tile,c.TILING_PADDING_VERTICAL="function"==typeof e.tilingPaddingVertical?e.tilingPaddingVertical.call():e.tilingPaddingVertical,c.TILING_PADDING_HORIZONTAL="function"==typeof e.tilingPaddingHorizontal?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal,c.DEFAULT_INCREMENTAL=u.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=!0,c.PURE_INCREMENTAL=!e.randomize,l.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions,"transformed"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!1),"enforced"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!1),"cose"==e.step&&(c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!1,c.APPLY_LAYOUT=!0),"all"==e.step&&(e.randomize?c.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:c.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,c.ENFORCE_CONSTRAINTS=!0,c.APPLY_LAYOUT=!0),e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint?c.TREE_REDUCTION_ON_INCREMENTAL=!1:c.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new i,E=w.newGraphManager();return function e(t,n,i,l){for(var u=n.length,c=0;c0&&e(i.getGraphManager().add(i.newGraph(),p),h,i,l)}}(E.addRoot(),r.getTopMostNodes(h),w,e),function(t,n,r){for(var i=0,o=0,a=0;a0?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=i/o:m(e.idealEdgeLength)?c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=50:c.DEFAULT_EDGE_LENGTH=u.DEFAULT_EDGE_LENGTH=e.idealEdgeLength,c.MIN_REPULSION_DIST=u.MIN_REPULSION_DIST=u.DEFAULT_EDGE_LENGTH/10,c.DEFAULT_RADIAL_SEPARATION=u.DEFAULT_EDGE_LENGTH)}(w,E,p),function(e,t){t.fixedNodeConstraint&&(e.constraints.fixedNodeConstraint=t.fixedNodeConstraint),t.alignmentConstraint&&(e.constraints.alignmentConstraint=t.alignmentConstraint),t.relativePlacementConstraint&&(e.constraints.relativePlacementConstraint=t.relativePlacementConstraint)}(w,e),w.runLayout(),y}}},212:(e,t,n)=>{var r=function(){function e(e,t){for(var n=0;n0)if(d){var h=o.getTopMostNodes(e.eles.nodes());if((l=o.connectComponents(t,e.eles,h)).forEach((function(e){var t=e.boundingBox();u.push({x:t.x1+t.w/2,y:t.y1+t.h/2})})),e.randomize&&l.forEach((function(t){e.eles=t,r.push(a(e))})),"default"==e.quality||"proof"==e.quality){var p=t.collection();if(e.tile){var f=new Map,g=0,v={nodeIndexes:f,xCoords:[],yCoords:[]},y=[];if(l.forEach((function(e,t){0==e.edges().length&&(e.nodes().forEach((function(t,n){p.merge(e.nodes()[n]),t.isParent()||(v.nodeIndexes.set(e.nodes()[n].id(),g++),v.xCoords.push(e.nodes()[0].position().x),v.yCoords.push(e.nodes()[0].position().y))})),y.push(t))})),p.length>1){var m=p.boundingBox();u.push({x:m.x1+m.w/2,y:m.y1+m.h/2}),l.push(p),r.push(v);for(var b=y.length-1;b>=0;b--)l.splice(y[b],1),r.splice(y[b],1),u.splice(y[b],1)}}l.forEach((function(t,n){e.eles=t,i.push(s(e,r[n])),o.relocateComponent(u[n],i[n],e)}))}else l.forEach((function(t,n){o.relocateComponent(u[n],r[n],e)}));var x=new Set;if(l.length>1){var w=[],E=n.filter((function(e){return"none"==e.css("display")}));l.forEach((function(t,n){var a=void 0;if("draft"==e.quality&&(a=r[n].nodeIndexes),t.nodes().not(E).length>0){var s={edges:[],nodes:[]},l=void 0;t.nodes().not(E).forEach((function(t){if("draft"==e.quality)if(t.isParent()){var u=o.calcBoundingBox(t,r[n].xCoords,r[n].yCoords,a);s.nodes.push({x:u.topLeftX,y:u.topLeftY,width:u.width,height:u.height})}else l=a.get(t.id()),s.nodes.push({x:r[n].xCoords[l]-t.boundingbox().w/2,y:r[n].yCoords[l]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h});else i[n][t.id()]&&s.nodes.push({x:i[n][t.id()].getLeft(),y:i[n][t.id()].getTop(),width:i[n][t.id()].getWidth(),height:i[n][t.id()].getHeight()})})),t.edges().forEach((function(t){var l=t.source(),u=t.target();if("none"!=l.css("display")&&"none"!=u.css("display"))if("draft"==e.quality){var c=a.get(l.id()),d=a.get(u.id()),h=[],p=[];if(l.isParent()){var f=o.calcBoundingBox(l,r[n].xCoords,r[n].yCoords,a);h.push(f.topLeftX+f.width/2),h.push(f.topLeftY+f.height/2)}else h.push(r[n].xCoords[c]),h.push(r[n].yCoords[c]);if(u.isParent()){var g=o.calcBoundingBox(u,r[n].xCoords,r[n].yCoords,a);p.push(g.topLeftX+g.width/2),p.push(g.topLeftY+g.height/2)}else p.push(r[n].xCoords[d]),p.push(r[n].yCoords[d]);s.edges.push({startX:h[0],startY:h[1],endX:p[0],endY:p[1]})}else i[n][l.id()]&&i[n][u.id()]&&s.edges.push({startX:i[n][l.id()].getCenterX(),startY:i[n][l.id()].getCenterY(),endX:i[n][u.id()].getCenterX(),endY:i[n][u.id()].getCenterY()})})),s.nodes.length>0&&(w.push(s),x.add(n))}}));var _=c.packComponents(w,e.randomize).shifts;if("draft"==e.quality)r.forEach((function(e,t){var n=e.xCoords.map((function(e){return e+_[t].dx})),r=e.yCoords.map((function(e){return e+_[t].dy}));e.xCoords=n,e.yCoords=r}));else{var C=0;x.forEach((function(e){Object.keys(i[e]).forEach((function(t){var n=i[e][t];n.setCenter(n.getCenterX()+_[C].dx,n.getCenterY()+_[C].dy)})),C++}))}}}else{var T=e.eles.boundingBox();if(u.push({x:T.x1+T.w/2,y:T.y1+T.h/2}),e.randomize){var N=a(e);r.push(N)}"default"==e.quality||"proof"==e.quality?(i.push(s(e,r[0])),o.relocateComponent(u[0],i[0],e)):o.relocateComponent(u[0],r[0],e)}var M=function(t,n){if("default"==e.quality||"proof"==e.quality){"number"==typeof t&&(t=n);var o=void 0,a=void 0,s=t.data("id");return i.forEach((function(e){s in e&&(o={x:e[s].getRect().getCenterX(),y:e[s].getRect().getCenterY()},a=e[s])})),e.nodeDimensionsIncludeLabels&&(a.labelWidth&&("left"==a.labelPosHorizontal?o.x+=a.labelWidth/2:"right"==a.labelPosHorizontal&&(o.x-=a.labelWidth/2)),a.labelHeight&&("top"==a.labelPosVertical?o.y+=a.labelHeight/2:"bottom"==a.labelPosVertical&&(o.y-=a.labelHeight/2))),null==o&&(o={x:t.position("x"),y:t.position("y")}),{x:o.x,y:o.y}}var l=void 0;return r.forEach((function(e){var n=e.nodeIndexes.get(t.id());null!=n&&(l={x:e.xCoords[n],y:e.yCoords[n]})})),null==l&&(l={x:t.position("x"),y:t.position("y")}),{x:l.x,y:l.y}};if("default"==e.quality||"proof"==e.quality||e.randomize){var A=o.calcParentsWithoutChildren(t,n),D=n.filter((function(e){return"none"==e.css("display")}));e.eles=n.not(D),n.nodes().not(":parent").not(D).layoutPositions(this,e,M),A.length>0&&A.forEach((function(e){e.position(M(e))}))}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),e}();e.exports=u},657:(e,t,n)=>{var r=n(548),i=n(140).layoutBase.Matrix,o=n(140).layoutBase.SVD;e.exports={spectralLayout:function(e){var t=e.cy,n=e.eles,a=n.nodes(),s=n.nodes(":parent"),l=new Map,u=new Map,c=new Map,d=[],h=[],p=[],f=[],g=[],v=[],y=[],m=[],b=void 0,x=1e8,w=1e-9,E=e.piTol,_=e.samplingType,C=e.nodeSeparation,T=void 0,N=function(e,t,n){for(var r=[],i=0,o=0,a=0,s=void 0,l=[],c=0,h=1,p=0;p=i;){a=r[i++];for(var f=d[a],y=0;yc&&(c=g[w],h=w)}return h};r.connectComponents(t,n,r.getTopMostNodes(a),l),s.forEach((function(e){r.connectComponents(t,n,r.getTopMostNodes(e.descendants().intersection(n)),l)}));for(var M=0,A=0;A0&&(r.isParent()?d[t].push(c.get(r.id())):d[t].push(r.id()))}))}));var R=function(e){var n=u.get(e),r=void 0;l.get(e).forEach((function(i){r=t.getElementById(i).isParent()?c.get(i):i,d[n].push(r),d[u.get(r)].push(e)}))},B=!0,F=!1,z=void 0;try{for(var j,V=l.keys()[Symbol.iterator]();!(B=(j=V.next()).done);B=!0)R(j.value)}catch(e){F=!0,z=e}finally{try{!B&&V.return&&V.return()}finally{if(F)throw z}}var G=void 0;if((b=u.size)>2){T=b=1)break;u=l}for(var f=0;f=1)break;u=l}for(var y=0;y{var r=n(212),i=function(e){e&&e("layout","fcose",r)};"undefined"!=typeof cytoscape&&i(cytoscape),e.exports=i},140:t=>{t.exports=e}},n={},r=function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r](o,o.exports,e),o.exports}(579);return r})()},e.exports=r(n(7799))},4726:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}var h="undefined"==typeof window?null:window,p=h?h.navigator:null;h&&h.document;var f=r(""),g=r({}),v=r((function(){})),y="undefined"==typeof HTMLElement?"undefined":r(HTMLElement),m=function(e){return e&&e.instanceString&&x(e.instanceString)?e.instanceString():null},b=function(e){return null!=e&&r(e)==f},x=function(e){return null!=e&&r(e)===v},w=function(e){return!T(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},E=function(e){return null!=e&&r(e)===g&&!w(e)&&e.constructor===Object},_=function(e){return null!=e&&r(e)===r(1)&&!isNaN(e)},C=function(e){return"undefined"===y?void 0:null!=e&&e instanceof HTMLElement},T=function(e){return N(e)||M(e)},N=function(e){return"collection"===m(e)&&e._private.single},M=function(e){return"collection"===m(e)&&!e._private.single},A=function(e){return"core"===m(e)},D=function(e){return"stylesheet"===m(e)},I=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},O=function(e){return function(e){return null!=e&&r(e)===g}(e)&&x(e.then)},P=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var e=[],t=0;tt?1:0},Y=null!=Object.assign?Object.assign.bind(Object):function(e){for(var t=arguments,n=1;n=t||n<0||d&&e-u>=o}function g(){var e=Q();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?ye(n,o-(e-u)):n}(e))}function v(e){return s=void 0,h&&r?p(e):(r=i=void 0,a)}function y(){var e=Q(),n=f(e);if(r=arguments,i=this,l=e,n){if(void 0===s)return function(e){return u=e,s=setTimeout(g,t),c?p(e):a}(l);if(d)return clearTimeout(s),s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ge(t)||0,W(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ve(ge(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),y.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=i=s=void 0},y.flush=function(){return void 0===s?a:v(Q())},y},be=h?h.performance:null,xe=be&&be.now?function(){return be.now()}:function(){return Date.now()},we=function(){if(h){if(h.requestAnimationFrame)return function(e){h.requestAnimationFrame(e)};if(h.mozRequestAnimationFrame)return function(e){h.mozRequestAnimationFrame(e)};if(h.webkitRequestAnimationFrame)return function(e){h.webkitRequestAnimationFrame(e)};if(h.msRequestAnimationFrame)return function(e){h.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout((function(){e(xe())}),1e3/60)}}(),Ee=function(e){return we(e)},_e=xe,Ce=9261,Te=5381,Ne=function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce;!(t=e.next()).done;)n=65599*n+t.value|0;return n},Me=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce)+e|0},Ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Te;return(t<<5)+t+e|0},De=function(e){return 2097152*e[0]+e[1]},Ie=function(e,t){return[Me(e[0],t[0]),Ae(e[1],t[1])]},Oe=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return Ne({next:function(){return r=0&&(e[r]!==t||(e.splice(r,1),!n));r--);},$e=function(e){e.splice(0,e.length)},Qe=function(e,t,n){return n&&(t=L(n,t)),e[t]},Je=function(e,t,n,r){n&&(t=L(n,t)),e[t]=r},et="undefined"!=typeof Map?Map:function(){function e(){i(this,e),this._obj={}}return a(e,[{key:"set",value:function(e,t){return this._obj[e]=t,this}},{key:"delete",value:function(e){return this._obj[e]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(e){return void 0!==this._obj[e]}},{key:"get",value:function(e){return this._obj[e]}}]),e}(),tt=function(){function e(t){if(i(this,e),this._obj=Object.create(null),this.size=0,null!=t){var n;n=null!=t.instanceString&&t.instanceString()===this.instanceString()?t.toArray():t;for(var r=0;r2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&A(e)){var r=t.group;if(null==r&&(r=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===r||"edges"===r){this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===r:!!t.pannable,active:!1,classes:new nt,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==i.position.x&&(i.position.x=0),null==i.position.y&&(i.position.y=0),t.renderedPosition){var o=t.renderedPosition,a=e.pan(),s=e.zoom();i.position={x:(o.x-a.x)/s,y:(o.y-a.y)/s}}var l=[];w(t.classes)?l=t.classes:b(t.classes)&&(l=t.classes.split(/\s+/));for(var u=0,c=l.length;ut?1:0},u=function(e,t,i,o,a){var s;if(null==i&&(i=0),null==a&&(a=n),i<0)throw new Error("lo must be non-negative");for(null==o&&(o=e.length);in;0<=n?t++:t--)u.push(t);return u}.apply(this).reverse()).length;og;0<=g?++h:--h)v.push(o(e,r));return v},f=function(e,t,r,i){var o,a,s;for(null==i&&(i=n),o=e[r];r>t&&i(o,a=e[s=r-1>>1])<0;)e[r]=a,r=s;return e[r]=o},g=function(e,t,r){var i,o,a,s,l;for(null==r&&(r=n),o=e.length,l=t,a=e[t],i=2*t+1;i0;){var _=y.pop(),C=g(_),T=_.id();if(d[T]=C,C!==1/0)for(var N=_.neighborhood().intersect(p),M=0;M0)for(n.unshift(t);c[i];){var o=c[i];n.unshift(o.edge),n.unshift(o.node),i=(r=o.node).id()}return a.spawn(n)}}}},ct={kruskal:function(e){e=e||function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,o=new Array(i),a=n,s=function(e){for(var t=0;t0;){if(u=(l=g.pop()).id(),v.delete(u),w++,u===d){for(var E=[],_=i,C=d,T=m[C];E.unshift(_),null!=T&&E.unshift(T),null!=(_=y[C]);)T=m[C=_.id()];return{found:!0,distance:h[u],path:this.spawn(E),steps:w}}f[u]=!0;for(var N=l._private.edges,M=0;MM&&(p[N]=M,y[N]=T,m[N]=w),!i){var A=T*u+C;!i&&p[A]>M&&(p[A]=M,y[A]=C,m[A]=w)}}}for(var D=0;D1&&void 0!==arguments[1]?arguments[1]:o,r=[],i=m(e);;){if(null==i)return t.spawn();var a=y(i),l=a.edge,u=a.pred;if(r.unshift(i[0]),i.same(n)&&r.length>0)break;null!=l&&r.unshift(l),i=u}return s.spawn(r)},hasNegativeWeightCycle:f,negativeWeightCycles:g}}},yt=Math.sqrt(2),mt=function(e,t,n){0===n.length&&Ge("Karger-Stein must be run on a connected (sub)graph");for(var r=n[e],i=r[1],o=r[2],a=t[i],s=t[o],l=n,u=l.length-1;u>=0;u--){var c=l[u],d=c[1],h=c[2];(t[d]===a&&t[h]===s||t[d]===s&&t[h]===a)&&l.splice(u,1)}for(var p=0;pr;){var i=Math.floor(Math.random()*t.length);t=mt(i,e,t),n--}return t},xt={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy((function(e){return e.isLoop()}));var i=n.length,o=r.length,a=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),s=Math.floor(i/yt);if(!(i<2)){for(var l=[],u=0;u0?1:e<0?-1:0},Mt=function(e,t){return Math.sqrt(At(e,t))},At=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},Dt=function(e){for(var t=e.length,n=0,r=0;r=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},St=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},Lt=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},Rt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Bt=function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===o.length)t=n=r=i=o[0];else if(2===o.length)t=r=o[0],i=n=o[1];else if(4===o.length){var a=l(o,4);t=a[0],n=a[1],r=a[2],i=a[3]}return e.x1-=i,e.x2+=n,e.y1-=t,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Ft=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},zt=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2t.y2||t.y1>e.y2)},jt=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},Vt=function(e,t){return jt(e,t.x1,t.y1)&&jt(e,t.x2,t.y2)},Gt=function(e,t,n,r,i,o,a){var s,l,u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",c="auto"===u?sn(i,o):u,d=i/2,h=o/2,p=(c=Math.min(c,d,h))!==d,f=c!==h;if(p){var g=r-h-a;if((s=en(e,t,n,r,n-d+c-a,g,n+d-c+a,g,!1)).length>0)return s}if(f){var v=n+d+a;if((s=en(e,t,n,r,v,r-h+c-a,v,r+h-c+a,!1)).length>0)return s}if(p){var y=r+h+a;if((s=en(e,t,n,r,n-d+c-a,y,n+d-c+a,y,!1)).length>0)return s}if(f){var m=n-d-a;if((s=en(e,t,n,r,m,r-h+c-a,m,r+h-c+a,!1)).length>0)return s}var b=n-d+c,x=r-h+c;if((l=Qt(e,t,n,r,b,x,c+a)).length>0&&l[0]<=b&&l[1]<=x)return[l[0],l[1]];var w=n+d-c,E=r-h+c;if((l=Qt(e,t,n,r,w,E,c+a)).length>0&&l[0]>=w&&l[1]<=E)return[l[0],l[1]];var _=n+d-c,C=r+h-c;if((l=Qt(e,t,n,r,_,C,c+a)).length>0&&l[0]>=_&&l[1]>=C)return[l[0],l[1]];var T=n-d+c,N=r+h-c;return(l=Qt(e,t,n,r,T,N,c+a)).length>0&&l[0]<=T&&l[1]>=N?[l[0],l[1]]:[]},Yt=function(e,t,n,r,i,o,a){var s=a,l=Math.min(n,i),u=Math.max(n,i),c=Math.min(r,o),d=Math.max(r,o);return l-s<=e&&e<=u+s&&c-s<=t&&t<=d+s},Ut=function(e,t,n,r,i,o,a,s,l){var u=Math.min(n,a,i)-l,c=Math.max(n,a,i)+l,d=Math.min(r,s,o)-l,h=Math.max(r,s,o)+l;return!(ec||th)},Xt=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f,g,v,y,m,b,x,w=[];u=9*n*i-3*n*n-3*n*a-6*i*i+3*i*a+9*r*o-3*r*r-3*r*s-6*o*o+3*o*s,c=3*n*n-6*n*i+n*a-n*e+2*i*i+2*i*e-a*e+3*r*r-6*r*o+r*s-r*t+2*o*o+2*o*t-s*t,d=1*n*i-n*n+n*e-i*e+r*o-r*r+r*t-o*t,0===(l=1*n*n-4*n*i+2*n*a+4*i*i-4*i*a+a*a+r*r-4*r*o+2*r*s+4*o*o-4*o*s+s*s)&&(l=1e-5),g=-27*(d/=l)+(u/=l)*(9*(c/=l)-u*u*2),p=(f=(3*c-u*u)/9)*f*f+(g/=54)*g,(h=w)[1]=0,b=u/3,p>0?(y=(y=g+Math.sqrt(p))<0?-Math.pow(-y,1/3):Math.pow(y,1/3),m=(m=g-Math.sqrt(p))<0?-Math.pow(-m,1/3):Math.pow(m,1/3),h[0]=-b+y+m,b+=(y+m)/2,h[4]=h[2]=-b,b=Math.sqrt(3)*(-m+y)/2,h[3]=b,h[5]=-b):(h[5]=h[3]=0,0===p?(x=g<0?-Math.pow(-g,1/3):Math.pow(g,1/3),h[0]=2*x-b,h[4]=h[2]=-(x+b)):(v=(f=-f)*f*f,v=Math.acos(g/Math.sqrt(v)),x=2*Math.sqrt(f),h[0]=-b+x*Math.cos(v/3),h[2]=-b+x*Math.cos((v+2*Math.PI)/3),h[4]=-b+x*Math.cos((v+4*Math.PI)/3)));for(var E=[],_=0;_<6;_+=2)Math.abs(w[_+1])<1e-7&&w[_]>=0&&w[_]<=1&&E.push(w[_]);E.push(1),E.push(0);for(var C,T,N,M=-1,A=0;A=0?Nl?(e-i)*(e-i)+(t-o)*(t-o):u-d},Wt=function(e,t,n){for(var r,i,o,a,s=0,l=0;l=e&&e>=o||r<=e&&e<=o))continue;(e-r)/(o-r)*(a-i)+i>t&&s++}return s%2!=0},qt=function(e,t,n,r,i,o,a,s,l){var u,c=new Array(n.length);null!=s[0]?(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2):u=s;for(var d,h=Math.cos(-u),p=Math.sin(-u),f=0;f0){var g=Zt(c,-l);d=Kt(g)}else d=c;return Wt(e,t,d)},Kt=function(e){for(var t,n,r,i,o,a,s,l,u=new Array(e.length/2),c=0;c=0&&f<=1&&v.push(f),g>=0&&g<=1&&v.push(g),0===v.length)return[];var y=v[0]*s[0]+e,m=v[0]*s[1]+t;return v.length>1?v[0]==v[1]?[y,m]:[y,m,v[1]*s[0]+e,v[1]*s[1]+t]:[y,m]},Jt=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},en=function(e,t,n,r,i,o,a,s,l){var u=e-i,c=n-e,d=a-i,h=t-o,p=r-t,f=s-o,g=d*h-f*u,v=c*h-p*u,y=f*c-d*p;if(0!==y){var m=g/y,b=v/y,x=-.001;return x<=m&&m<=1.001&&x<=b&&b<=1.001||l?[e+m*c,t+m*p]:[]}return 0===g||0===v?Jt(e,n,a)===a?[a,s]:Jt(e,n,i)===i?[i,o]:Jt(i,a,n)===n?[n,r]:[]:[]},tn=function(e,t,n,r,i,o,a,s){var l,u,c,d,h,p,f=[],g=new Array(n.length),v=!0;if(null==o&&(v=!1),v){for(var y=0;y0){var m=Zt(g,-s);u=Kt(m)}else u=g}else u=n;for(var b=0;bu&&(u=t)},d=function(e){return l[e]},h=0;h0?x.edgesTo(b)[0]:b.edgesTo(x)[0];var w=r(m);b=b.id(),h[b]>h[v]+w&&(h[b]=h[v]+w,p.nodes.indexOf(b)<0?p.push(b):p.updateItem(b),u[b]=0,l[b]=[]),h[b]==h[v]+w&&(u[b]=u[b]+u[v],l[b].push(v))}else for(var E=0;E0;){for(var N=n.pop(),M=0;M0&&a.push(n[s]);0!==a.length&&i.push(r.collection(a))}return i}(c,l,t,r);return b=function(e){for(var t=0;t5&&void 0!==arguments[5]?arguments[5]:An,a=r,s=0;s=2?Sn(e,t,n,0,On,Pn):Sn(e,t,n,0,In)},squaredEuclidean:function(e,t,n){return Sn(e,t,n,0,On)},manhattan:function(e,t,n){return Sn(e,t,n,0,In)},max:function(e,t,n){return Sn(e,t,n,-1/0,kn)}};function Rn(e,t,n,r,i,o){var a;return a=x(e)?e:Ln[e]||Ln.euclidean,0===t&&x(e)?a(i,o):a(t,n,r,i,o)}Ln["squared-euclidean"]=Ln.squaredEuclidean,Ln.squaredeuclidean=Ln.squaredEuclidean;var Bn=Ke({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Fn=function(e){return Bn(e)},zn=function(e,t,n,r,i){var o="kMedoids"!==i?function(e){return n[e]}:function(e){return r[e](n)},a=n,s=t;return Rn(e,r.length,o,(function(e){return r[e](t)}),a,s)},jn=function(e,t,n){for(var r=n.length,i=new Array(r),o=new Array(r),a=new Array(t),s=null,l=0;ln)return!1;return!0},Xn=function(e,t,n){for(var r=0;ri&&(i=t[l][u],o=u);a[o].push(e[l])}for(var c=0;c=i.threshold||"dendrogram"===i.mode&&1===e.length)return!1;var p,f=t[a],g=t[r[a]];p="dendrogram"===i.mode?{left:f,right:g,key:f.key}:{value:f.value.concat(g.value),key:f.key},e[f.index]=p,e.splice(g.index,1),t[f.key]=p;for(var v=0;vn[g.key][y.key]&&(o=n[g.key][y.key])):"max"===i.linkage?(o=n[f.key][y.key],n[f.key][y.key]a&&(o=l,a=t[i*e+l])}o>0&&r.push(o)}for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n0&&e.splice(0,t)):e=e.slice(t,n);for(var o=0,a=e.length-1;a>=0;a--){var s=e[a];i?isFinite(s)||(e[a]=-1/0,o++):e.splice(a,1)}r&&e.sort((function(e,t){return e-t}));var l=e.length,u=Math.floor(l/2);return l%2!=0?e[u+1+o]:(e[u-1+o]+e[u+o])/2}(e):"mean"===t?function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=0,i=0,o=t;o1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=1/0,i=t;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,r=-1/0,i=t;i=M?(A=M,M=I,D=O):I>A&&(A=I);for(var P=0;P0?1:0;C[E%u.minIterations*t+F]=z,B+=z}if(B>0&&(E>=u.minIterations-1||E==u.maxIterations-1)){for(var j=0,V=0;V0&&r.push(i);return r}(t,o,a),U=function(e,t,n){for(var r=lr(e,t,n),i=0;il&&(s=u,l=c)}n[i]=o[s]}return lr(e,t,n)}(t,r,Y),X={},H=0;H1)}}));var l=Object.keys(t).filter((function(e){return t[e].cutVertex})).map((function(t){return e.getElementById(t)}));return{cut:e.spawn(l),components:i}},pr=function(){var e=this,t={},n=0,r=[],i=[],o=e.spawn(e),a=function a(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach((function(e){var n=e.target().id();n!==s&&(n in t||a(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))})),t[s].index===t[s].low){for(var l=e.spawn();;){var u=i.pop();if(l.merge(e.getElementById(u)),t[u].low=t[s].index,t[u].explored=!0,u===s)break}var c=l.edgesWith(l),d=l.merge(c);r.push(d),o=o.difference(d)}};return e.forEach((function(e){if(e.isNode()){var n=e.id();n in t||a(n)}})),{cut:o,components:r}},fr={};[ot,ut,ct,ht,ft,vt,xt,dn,pn,gn,yn,Mn,$n,or,cr,{hierholzer:function(e){if(!E(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n,r,i,o=dr(e),a=o.root,s=o.directed,l=this,u=!1;a&&(i=b(a)?this.filter(a)[0].id():a[0].id());var c={},d={};s?l.forEach((function(e){var t=e.id();if(e.isNode()){var i=e.indegree(!0),o=e.outdegree(!0),a=i-o,s=o-i;1==a?n?u=!0:n=t:1==s?r?u=!0:r=t:(s>1||a>1)&&(u=!0),c[t]=[],e.outgoers().forEach((function(e){e.isEdge()&&c[t].push(e.id())}))}else d[t]=[void 0,e.target().id()]})):l.forEach((function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(n?r?u=!0:r=t:n=t),c[t]=[],e.connectedEdges().forEach((function(e){return c[t].push(e.id())}))):d[t]=[e.source().id(),e.target().id()]}));var h={found:!1,trail:void 0};if(u)return h;if(r&&n)if(s){if(i&&r!=i)return h;i=r}else{if(i&&r!=i&&n!=i)return h;i||(i=r)}else i||(i=l[0].id());var p=function(e){for(var t,n,r,i=e,o=[e];c[i].length;)t=c[i].shift(),n=d[t][0],i!=(r=d[t][1])?(c[r]=c[r].filter((function(e){return e!=t})),i=r):s||i==n||(c[n]=c[n].filter((function(e){return e!=t})),i=n),o.unshift(t),o.unshift(i);return o},f=[],g=[];for(g=p(i);1!=g.length;)0==c[g[0]].length?(f.unshift(l.getElementById(g.shift())),f.unshift(l.getElementById(g.shift()))):g=p(g.shift()).concat(g);for(var v in f.unshift(l.getElementById(g.shift())),c)if(c[v].length)return h;return h.found=!0,h.trail=this.spawn(f,!0),h}},{hopcroftTarjanBiconnected:hr,htbc:hr,htb:hr,hopcroftTarjanBiconnectedComponents:hr},{tarjanStronglyConnected:pr,tsc:pr,tscc:pr,tarjanStronglyConnectedComponents:pr}].forEach((function(e){Y(fr,e)}));var gr=function e(t){if(!(this instanceof e))return new e(t);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof t&&t.call(this,this.fulfill.bind(this),this.reject.bind(this))};gr.prototype={fulfill:function(e){return vr(this,1,"fulfillValue",e)},reject:function(e){return vr(this,2,"rejectReason",e)},then:function(e,t){var n=this,r=new gr;return n.onFulfilled.push(br(e,r,"fulfill")),n.onRejected.push(br(t,r,"reject")),yr(n),r.proxy}};var vr=function(e,t,n,r){return 0===e.state&&(e.state=t,e[n]=r,yr(e)),e},yr=function(e){1===e.state?mr(e,"onFulfilled",e.fulfillValue):2===e.state&&mr(e,"onRejected",e.rejectReason)},mr=function(e,t,n){if(0!==e[t].length){var r=e[t];e[t]=[];var i=function(){for(var e=0;e0:void 0}},clearQueue:function(){return function(){var e=this,t=void 0!==e.length?e:[e];if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n-1},qr.prototype.set=function(e,t){var n=this.__data__,r=Hr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Kr=qr,Zr=zr($,"Map"),$r=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function Qr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e0&&this.spawn(r).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){w(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=void 0===t,i=[],o=0,a=n.length;o0&&this.spawn(i).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout((function(){n.removeClass(e)}),t),n}};Ti.className=Ti.classNames=Ti.classes;var Ni={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:B,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ni.variable="(?:[\\w-.]|(?:\\\\"+Ni.metaChar+"))+",Ni.className="(?:[\\w-]|(?:\\\\"+Ni.metaChar+"))+",Ni.value=Ni.string+"|"+Ni.number,Ni.id=Ni.variable,function(){var e,t,n;for(e=Ni.comparatorOp.split("|"),n=0;n=0||"="!==t&&(Ni.comparatorOp+="|\\!"+t)}();var Mi=20,Ai=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort((function(e,t){return function(e,t){return-1*G(e,t)}(e.selector,t.selector)})),Di=function(){for(var e,t={},n=0;n0&&u.edgeCount>0)return Ue("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(u.edgeCount>1)return Ue("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===u.edgeCount&&Ue("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(e){return null==e?"":e},t=function(t){return b(t)?'"'+t+'"':e(t)},n=function(e){return" "+e+" "},r=function(i,o){return i.checks.reduce((function(a,s,l){return a+(o===i&&0===l?"$":"")+function(i,o){var a=i.type,s=i.value;switch(a){case 0:var l=e(s);return l.substring(0,l.length-1);case 3:var u=i.field,c=i.operator;return"["+u+n(e(c))+t(s)+"]";case 5:var d=i.operator,h=i.field;return"["+e(d)+h+"]";case 4:return"["+i.field+"]";case 6:var p=i.operator;return"[["+i.field+n(e(p))+t(s)+"]]";case 7:return s;case 8:return"#"+s;case 9:return"."+s;case 17:case 15:return r(i.parent,o)+n(">")+r(i.child,o);case 18:case 16:return r(i.ancestor,o)+" "+r(i.descendant,o);case 19:var f=r(i.left,o),g=r(i.subject,o),v=r(i.right,o);return f+(f.length>0?" ":"")+g+v;case Mi:return""}}(s,o)}),"")},i="",o=0;o1&&o=0&&(t=t.replace("!",""),c=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),u=!0),(a||l||u)&&(i=a||s?""+e:"",o=""+n),u&&(e=i=i.toLowerCase(),n=o=o.toLowerCase()),t){case"*=":r=i.indexOf(o)>=0;break;case"$=":r=i.indexOf(o,i.length-o.length)>=0;break;case"^=":r=0===i.indexOf(o);break;case"=":r=e===n;break;case">":d=!0,r=e>n;break;case">=":d=!0,r=e>=n;break;case"<":d=!0,r=e0;){var u=i.shift();t(u),o.add(u.id()),a&&r(i,o,u)}return e}function Ki(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i1&&void 0!==arguments[1])||arguments[1],Ki)},Wi.forEachUp=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],Zi)},Wi.forEachUpAndDown=function(e){return qi(this,e,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],$i)},Wi.ancestors=Wi.parents,(Ui=Xi={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:_i.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:_i.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}}).attr=Ui.data,Ui.removeAttr=Ui.removeData;var Qi,Ji,eo=Xi,to={};function no(e){return function(t){var n=this;if(void 0===t&&(t=!0),0!==n.length&&n.isNode()&&!n.removed()){for(var r=0,i=n[0],o=i._private.edges,a=0;at})),minIndegree:ro("indegree",(function(e,t){return et})),minOutdegree:ro("outdegree",(function(e,t){return et}))}),Y(to,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r0,c=u;u&&(l=l[0]);var d=c?l.position():{x:0,y:0};return i={x:s.x-d.x,y:s.y-d.y},void 0===e?i:i[e]}for(var h=0;h0,v=g;g&&(f=f[0]);var y=v?f.position():{x:0,y:0};void 0!==t?p.position(e,t+y[e]):void 0!==i&&p.position({x:i.x+y.x,y:i.y+y.y})}}else if(!o)return;return this}},Qi.modelPosition=Qi.point=Qi.position,Qi.modelPositions=Qi.points=Qi.positions,Qi.renderedPoint=Qi.renderedPosition,Qi.relativePoint=Qi.relativePosition;var ao,so,lo=Ji;ao=so={},so.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),o=t.x1*r+i.x,a=t.x2*r+i.x,s=t.y1*r+i.y,l=t.y2*r+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},so.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();return t.styleEnabled()&&t.hasCompoundNodes()?(this.forEachUp((function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify("bounds")}})),this):this},so.updateCompoundBounds=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes())return this;if(!e&&t.batching())return this;function n(e){if(e.isParent()){var t=e._private,n=e.children(),r="include"===e.pstyle("compound-sizing-wrt-labels").value,i={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}},o=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),a=t.position;0!==o.w&&0!==o.h||((o={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue}).x1=a.x-o.w/2,o.x2=a.x+o.w/2,o.y1=a.y-o.h/2,o.y2=a.y+o.h/2);var s=i.width.left.value;"px"===i.width.left.units&&i.width.val>0&&(s=100*s/i.width.val);var l=i.width.right.value;"px"===i.width.right.units&&i.width.val>0&&(l=100*l/i.width.val);var u=i.height.top.value;"px"===i.height.top.units&&i.height.val>0&&(u=100*u/i.height.val);var c=i.height.bottom.value;"px"===i.height.bottom.units&&i.height.val>0&&(c=100*c/i.height.val);var d=y(i.width.val-o.w,s,l),h=d.biasDiff,p=d.biasComplementDiff,f=y(i.height.val-o.h,u,c),g=f.biasDiff,v=f.biasComplementDiff;t.autoPadding=function(e,t,n,r){if("%"!==n.units)return"px"===n.units?n.pfValue:0;switch(r){case"width":return e>0?n.pfValue*e:0;case"height":return t>0?n.pfValue*t:0;case"average":return e>0&&t>0?n.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case"max":return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}}(o.w,o.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value),t.autoWidth=Math.max(o.w,i.width.val),a.x=(-h+o.x1+o.x2+p)/2,t.autoHeight=Math.max(o.h,i.height.val),a.y=(-g+o.y1+o.y2+v)/2}function y(e,t,n){var r=0,i=0,o=t+n;return e>0&&o>0&&(r=t/o*e,i=n/o*e),{biasDiff:r,biasComplementDiff:i}}}for(var r=0;re.x2?r:e.x2,e.y1=ne.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},ho=function(e,t){return null==t?e:co(e,t.x1,t.y1,t.x2,t.y2)},po=function(e,t,n){return Qe(e,t,n)},fo=function(e,t,n){if(!t.cy().headless()){var r,i,o=t._private,a=o.rstyle,s=a.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(r=a.srcX,i=a.srcY):"target"===n?(r=a.tgtX,i=a.tgtY):(r=a.midX,i=a.midY);var l=o.arrowBounds=o.arrowBounds||{},u=l[n]=l[n]||{};u.x1=r-s,u.y1=i-s,u.x2=r+s,u.y2=i+s,u.w=u.x2-u.x1,u.h=u.y2-u.y1,Rt(u,1),co(e,u.x1,u.y1,u.x2,u.y2)}}},go=function(e,t,n){if(!t.cy().headless()){var r;r=n?n+"-":"";var i=t._private,o=i.rstyle;if(t.pstyle(r+"label").strValue){var a,s,l,u,c=t.pstyle("text-halign"),d=t.pstyle("text-valign"),h=po(o,"labelWidth",n),p=po(o,"labelHeight",n),f=po(o,"labelX",n),g=po(o,"labelY",n),v=t.pstyle(r+"text-margin-x").pfValue,y=t.pstyle(r+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle(r+"text-rotation"),x=t.pstyle("text-outline-width").pfValue,w=t.pstyle("text-border-width").pfValue/2,E=t.pstyle("text-background-padding").pfValue,_=p,C=h,T=C/2,N=_/2;if(m)a=f-T,s=f+T,l=g-N,u=g+N;else{switch(c.value){case"left":a=f-C,s=f;break;case"center":a=f-T,s=f+T;break;case"right":a=f,s=f+C}switch(d.value){case"top":l=g-_,u=g;break;case"center":l=g-N,u=g+N;break;case"bottom":l=g,u=g+_}}var M=v-Math.max(x,w)-E-2,A=v+Math.max(x,w)+E+2,D=y-Math.max(x,w)-E-2,I=y+Math.max(x,w)+E+2;a+=M,s+=A,l+=D,u+=I;var O=n||"main",P=i.labelBounds,k=P[O]=P[O]||{};k.x1=a,k.y1=l,k.x2=s,k.y2=u,k.w=s-a,k.h=u-l,k.leftPad=M,k.rightPad=A,k.topPad=D,k.botPad=I;var S=m&&"autorotate"===b.strValue,L=null!=b.pfValue&&0!==b.pfValue;if(S||L){var R=S?po(i.rstyle,"labelAngle",n):b.pfValue,B=Math.cos(R),F=Math.sin(R),z=(a+s)/2,j=(l+u)/2;if(!m){switch(c.value){case"left":z=s;break;case"right":z=a}switch(d.value){case"top":j=u;break;case"bottom":j=l}}var V=function(e,t){return{x:(e-=z)*B-(t-=j)*F+z,y:e*F+t*B+j}},G=V(a,l),Y=V(a,u),U=V(s,l),X=V(s,u);a=Math.min(G.x,Y.x,U.x,X.x),s=Math.max(G.x,Y.x,U.x,X.x),l=Math.min(G.y,Y.y,U.y,X.y),u=Math.max(G.y,Y.y,U.y,X.y)}var H=O+"Rot",W=P[H]=P[H]||{};W.x1=a,W.y1=l,W.x2=s,W.y2=u,W.w=s-a,W.h=u-l,co(e,a,l,s,u),co(i.labelBounds.all,a,l,s,u)}return e}},vo=function(e){var t=0,n=function(e){return(e?1:0)<0&&o>0){var a=t.pstyle("outline-offset").value,s=t.pstyle("shape").value,l=o+a,u=(e.w+2*l)/e.w,c=(e.h+2*l)/e.h,d=0;["diamond","pentagon","round-triangle"].includes(s)?(u=(e.w+2.4*l)/e.w,d=-l/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?u=(e.w+2.4*l)/e.w:"star"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.6*l)/e.h,d=-l/3.8):"triangle"===s?(u=(e.w+2.8*l)/e.w,c=(e.h+2.4*l)/e.h,d=-l/1.4):"vee"===s&&(u=(e.w+4.4*l)/e.w,c=(e.h+3.8*l)/e.h,d=.5*-l);var h=e.h*c-e.h,p=e.w*u-e.w;if(Bt(e,[Math.ceil(h/2),Math.ceil(p/2)]),0!==d){var f=(r=d,{x1:(n=e).x1+0,x2:n.x2+0,y1:n.y1+r,y2:n.y2+r,w:n.w,h:n.h});St(e,f)}}}}(h,e)}else if(g&&t.includeEdges)if(c&&!d){var M=e.pstyle("curve-style").strValue;if(n=Math.min(v.srcX,v.midX,v.tgtX),r=Math.max(v.srcX,v.midX,v.tgtX),i=Math.min(v.srcY,v.midY,v.tgtY),o=Math.max(v.srcY,v.midY,v.tgtY),co(h,n-=_,i-=_,r+=_,o+=_),"haystack"===M){var A=v.haystackPts;if(A&&2===A.length){if(n=A[0].x,i=A[0].y,n>(r=A[1].x)){var D=n;n=r,r=D}if(i>(o=A[1].y)){var I=i;i=o,o=I}co(h,n-_,i-_,r+_,o+_)}}else if("bezier"===M||"unbundled-bezier"===M||M.endsWith("segments")||M.endsWith("taxi")){var O;switch(M){case"bezier":case"unbundled-bezier":O=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":O=v.linePts}if(null!=O)for(var P=0;P(r=L.x)){var R=n;n=r,r=R}if((i=S.y)>(o=L.y)){var B=i;i=o,o=B}co(h,n-=_,i-=_,r+=_,o+=_)}if(c&&t.includeEdges&&g&&(fo(h,e,"mid-source"),fo(h,e,"mid-target"),fo(h,e,"source"),fo(h,e,"target")),c&&"yes"===e.pstyle("ghost").value){var F=e.pstyle("ghost-offset-x").pfValue,z=e.pstyle("ghost-offset-y").pfValue;co(h,h.x1+F,h.y1+z,h.x2+F,h.y2+z)}var j=p.bodyBounds=p.bodyBounds||{};Ft(j,h),Bt(j,y),Rt(j,1),c&&(n=h.x1,r=h.x2,i=h.y1,o=h.y2,co(h,n-E,i-E,r+E,o+E));var V=p.overlayBounds=p.overlayBounds||{};Ft(V,h),Bt(V,y),Rt(V,1);var G=p.labelBounds=p.labelBounds||{};null!=G.all?((l=G.all).x1=1/0,l.y1=1/0,l.x2=-1/0,l.y2=-1/0,l.w=0,l.h=0):G.all=kt(),c&&t.includeLabels&&(t.includeMainLabels&&go(h,e,null),g&&(t.includeSourceLabels&&go(h,e,"source"),t.includeTargetLabels&&go(h,e,"target")))}return h.x1=uo(h.x1),h.y1=uo(h.y1),h.x2=uo(h.x2),h.y2=uo(h.y2),h.w=uo(h.x2-h.x1),h.h=uo(h.y2-h.y1),h.w>0&&h.h>0&&b&&(Bt(h,y),Rt(h,1)),h}(e,bo),r.bbCache=n,r.bbCachePosKey=a):n=r.bbCache,!o){var c=e.isNode();n=kt(),(t.includeNodes&&c||t.includeEdges&&!c)&&(t.includeOverlays?ho(n,r.overlayBounds):ho(n,r.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?ho(n,r.labelBounds.all):(t.includeMainLabels&&ho(n,r.labelBounds.mainRot),t.includeSourceLabels&&ho(n,r.labelBounds.sourceRot),t.includeTargetLabels&&ho(n,r.labelBounds.targetRot))),n.w=n.x2-n.x1,n.h=n.y2-n.y1}return n},bo={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},xo=vo(bo),wo=Ke(bo);so.boundingBox=function(e){var t;if(1!==this.length||null==this[0]._private.bbCache||this[0]._private.styleDirty||void 0!==e&&void 0!==e.useCache&&!0!==e.useCache){t=kt();var n=wo(e=e||bo),r=this;if(r.cy().styleEnabled())for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:Ro,t=arguments.length>1?arguments[1]:void 0,n=0;n=0;s--)a(s);return this},Fo.removeAllListeners=function(){return this.removeListener("*")},Fo.emit=Fo.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,w(t)||(t=[t]),function(e,t,n){if("event"!==m(n))if(E(n))t(e,jo(e,n));else for(var r=w(n)?n:n.split(/\s+/),i=0;i1&&!r){var i=this.length-1,o=this[i],a=o._private.data.id;this[i]=void 0,this[e]=o,n.set(a,{ele:o,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&b(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],r=this,i=0;ir&&(r=s,n=a)}return{value:r,ele:n}},min:function(e,t){for(var n,r=1/0,i=this,o=0;o=0&&i1&&void 0!==arguments[1])||arguments[1],n=this[0],r=n.cy();if(r.styleEnabled()&&n){this.cleanStyle();var i=n._private.style[e];return null!=i?i:t?r.style().getDefaultProperty(e):null}},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled())return t?t.pstyle(e).units:void 0},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(E(e)){var o=e;i.applyBypass(this,o,r),this.emitAndNotify("style")}else if(b(e)){if(void 0===t){var a=this[0];return a?i.getStylePropertyValue(a,e):void 0}i.applyBypass(this,e,t,r),this.emitAndNotify("style")}else if(void 0===e){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(void 0===e)for(var o=0;o0&&t.push(c[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)}),"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),da.neighbourhood=da.neighborhood,da.closedNeighbourhood=da.closedNeighborhood,da.openNeighbourhood=da.openNeighborhood,Y(da,{source:Hi((function(e){var t,n=this[0];return n&&(t=n._private.source||n.cy().collection()),t&&e?t.filter(e):t}),"source"),target:Hi((function(e){var t,n=this[0];return n&&(t=n._private.target||n.cy().collection()),t&&e?t.filter(e):t}),"target"),sources:ga({attr:"source"}),targets:ga({attr:"target"})}),Y(da,{edgesWith:Hi(va(),"edgesWith"),edgesTo:Hi(va({thisIsSrc:!0}),"edgesTo")}),Y(da,{connectedEdges:Hi((function(e){for(var t=[],n=0;n0);return o},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),da.componentsOf=da.components;var ma=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var i=new et,o=!1;if(t){if(t.length>0&&E(t[0])&&!N(t[0])){o=!0;for(var a=[],s=new nt,l=0,u=t.length;l0&&void 0!==arguments[0])||arguments[0],r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this,o=i.cy(),a=o._private,s=[],l=[],u=0,c=i.length;u0){for(var B=e.length===i.length?i:new ma(o,e),F=0;F0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this,r=[],i={},o=n._private.cy;function a(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),function(e){for(var t=e._private.edges,n=0;n0&&(e?_.emitAndNotify("remove"):t&&_.emit("remove"));for(var C=0;C=.001?function(t,r){for(var i=0;i<4;++i){var o=h(r,e,n);if(0===o)return r;r-=(d(r,e,n)-t)/o}return r}(t,a):0===l?a:function(t,r,i){var o,a,s=0;do{(o=d(a=r+(i-r)/2,e,n)-t)>0?i=a:r=a}while(Math.abs(o)>1e-7&&++s<10);return a}(t,r,r+i)}(o),t,r)};f.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var g="generateBezier("+[e,t,n,r]+")";return f.toString=function(){return g},f}var Ea=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},o=t(n,.5*r,i),a=t(n,.5*r,o),s=t(n,r,a),l=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),u=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+l*r,n.v=n.v+u*r,n}return function e(t,r,i){var o,a,s,l={x:-1,v:0,tension:null,friction:null},u=[0],c=0,d=1e-4;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i=i||null,l.tension=t,l.friction=r,a=(o=null!==i)?(c=e(t,r))/i*.016:.016;s=n(s||l,a),u.push(1+s.x),c+=16,Math.abs(s.x)>d&&Math.abs(s.v)>d;);return o?function(e){return u[e*(u.length-1)|0]}:c}}(),_a=function(e,t,n,r){var i=wa(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},Ca={linear:function(e,t,n){return e+(t-e)*n},ease:_a(.25,.1,.25,1),"ease-in":_a(.42,0,1,1),"ease-out":_a(0,0,.58,1),"ease-in-out":_a(.42,0,.58,1),"ease-in-sine":_a(.47,0,.745,.715),"ease-out-sine":_a(.39,.575,.565,1),"ease-in-out-sine":_a(.445,.05,.55,.95),"ease-in-quad":_a(.55,.085,.68,.53),"ease-out-quad":_a(.25,.46,.45,.94),"ease-in-out-quad":_a(.455,.03,.515,.955),"ease-in-cubic":_a(.55,.055,.675,.19),"ease-out-cubic":_a(.215,.61,.355,1),"ease-in-out-cubic":_a(.645,.045,.355,1),"ease-in-quart":_a(.895,.03,.685,.22),"ease-out-quart":_a(.165,.84,.44,1),"ease-in-out-quart":_a(.77,0,.175,1),"ease-in-quint":_a(.755,.05,.855,.06),"ease-out-quint":_a(.23,1,.32,1),"ease-in-out-quint":_a(.86,0,.07,1),"ease-in-expo":_a(.95,.05,.795,.035),"ease-out-expo":_a(.19,1,.22,1),"ease-in-out-expo":_a(1,0,0,1),"ease-in-circ":_a(.6,.04,.98,.335),"ease-out-circ":_a(.075,.82,.165,1),"ease-in-out-circ":_a(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Ca.linear;var r=Ea(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":_a};function Ta(e,t,n,r,i){if(1===r)return n;if(t===n)return n;var o=i(t,n,r);return null==e||((e.roundValue||e.color)&&(o=Math.round(o)),void 0!==e.min&&(o=Math.max(o,e.min)),void 0!==e.max&&(o=Math.min(o,e.max))),o}function Na(e,t){return null!=e.pfValue||null!=e.value?null==e.pfValue||null!=t&&"%"===t.type.units?e.value:e.pfValue:e}function Ma(e,t,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=Na(e,i),s=Na(t,i);if(_(a)&&_(s))return Ta(o,a,s,n,r);if(w(a)&&w(s)){for(var l=[],u=0;u0?("spring"===d&&h.push(a.duration),a.easingImpl=Ca[d].apply(null,h)):a.easingImpl=Ca[d]}var p,f=a.easingImpl;if(p=0===a.duration?1:(n-l)/a.duration,a.applying&&(p=a.progress),p<0?p=0:p>1&&(p=1),null==a.delay){var g=a.startPosition,v=a.position;if(v&&i&&!e.locked()){var y={};Da(g.x,v.x)&&(y.x=Ma(g.x,v.x,p,f)),Da(g.y,v.y)&&(y.y=Ma(g.y,v.y,p,f)),e.position(y)}var m=a.startPan,x=a.pan,w=o.pan,E=null!=x&&r;E&&(Da(m.x,x.x)&&(w.x=Ma(m.x,x.x,p,f)),Da(m.y,x.y)&&(w.y=Ma(m.y,x.y,p,f)),e.emit("pan"));var _=a.startZoom,C=a.zoom,T=null!=C&&r;T&&(Da(_,C)&&(o.zoom=Pt(o.minZoom,Ma(_,C,p,f),o.maxZoom)),e.emit("zoom")),(E||T)&&e.emit("viewport");var N=a.style;if(N&&N.length>0&&i){for(var M=0;M=0;t--)(0,e[t])();e.splice(0,e.length)},c=o.length-1;c>=0;c--){var d=o[c],h=d._private;h.stopped?(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.frames)):(h.playing||h.applying)&&(h.playing&&h.applying&&(h.applying=!1),h.started||Ia(0,d,e),Aa(t,d,e,n),h.applying&&(h.applying=!1),u(h.frames),null!=h.step&&h.step(e),d.completed()&&(o.splice(c,1),h.hooked=!1,h.playing=!1,h.started=!1,u(h.completes)),s=!0)}return n||0!==o.length||0!==a.length||r.push(t),s}for(var o=!1,a=0;a0?t.notify("draw",n):t.notify("draw")),n.unmerge(r),t.emit("step")}var Pa={animate:_i.animate(),animation:_i.animation(),animated:_i.animated(),clearQueue:_i.clearQueue(),delay:_i.delay(),delayAnimation:_i.delayAnimation(),stop:_i.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var t=e.renderer();t&&t.beforeRender?t.beforeRender((function(t,n){Oa(n,e)}),t.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&Ee((function(n){Oa(n,e),t()}))}()}}},ka={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return null==r||e!==n.target&&N(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Sa=function(e){return b(e)?new Vi(e):e},La={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Bo(ka,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Sa(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Sa(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},once:function(e,t,n){return this.emitter().one(e,Sa(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};_i.eventAliasesOn(La);var Ra={png:function(e){return e=e||{},this._private.renderer.png(e)},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};Ra.jpeg=Ra.jpg;var Ba={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var n,r=e.name,i=t.extension("layout",r);if(null!=i)return n=b(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(Y({},e,{cy:t,eles:n}));Ge("No such layout `"+r+"` found. Did you forget to import it and `cytoscape.use()` it?")}else Ge("A `name` must be specified to make a layout");else Ge("Layout options must be specified to make a layout")}};Ba.createLayout=Ba.makeLayout=Ba.layout;var Fa={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&r.merge(t)}else if(n.notificationsEnabled){var i=this.renderer();!this.destroyed()&&i&&i.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach((function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)}))}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch((function(){for(var n=Object.keys(e),r=0;r0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach((function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]}))},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};ja.invalidateDimensions=ja.resize;var Va={collection:function(e,t){return b(e)?this.$(e):T(e)?e.collection():w(e)?(t||(t={}),new ma(this,e,t.unique,t.removed)):new ma(this)},nodes:function(e){var t=this.$((function(e){return e.isNode()}));return e?t.filter(e):t},edges:function(e){var t=this.$((function(e){return e.isEdge()}));return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Va.elements=Va.filter=Va.$;var Ga={},Ya="t";Ga.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r0;if(h||d&&p){var f=void 0;h&&p||h?f=u.properties:p&&(f=u.mappedProperties);for(var g=0;g1&&(v=1),s.color){var w=i.valueMin[0],E=i.valueMax[0],C=i.valueMin[1],T=i.valueMax[1],N=i.valueMin[2],M=i.valueMax[2],A=null==i.valueMin[3]?1:i.valueMin[3],D=null==i.valueMax[3]?1:i.valueMax[3],I=[Math.round(w+(E-w)*v),Math.round(C+(T-C)*v),Math.round(N+(M-N)*v),Math.round(A+(D-A)*v)];n={bypass:i.bypass,name:i.name,value:I,strValue:"rgb("+I[0]+", "+I[1]+", "+I[2]+")"}}else{if(!s.number)return!1;var O=i.valueMin+(i.valueMax-i.valueMin)*v;n=this.parse(i.name,O,i.bypass,h)}if(!n)return g(),!1;n.mapping=i,i=n;break;case a.data:for(var P=i.field.split("."),k=d.data,S=0;S0&&o>0){for(var s={},l=!1,u=0;u0?e.delayAnimation(a).play().promise().then(t):t()})).then((function(){return e.animation({style:s,duration:o,easing:e.pstyle("transition-timing-function").value,queue:!1}).play().promise()})).then((function(){n.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1}))}else r.transitioning&&(this.removeBypasses(e,i),e.emitAndNotify("style"),r.transitioning=!1)},Ga.checkTrigger=function(e,t,n,r,i,o){var a=this.properties[t],s=i(a);null!=s&&s(n,r)&&o(a)},Ga.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,(function(e){return e.triggersZOrder}),(function(){i._private.cy.notify("zorder",e)}))},Ga.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,(function(e){return e.triggersBounds}),(function(i){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache(),!i.triggersBoundsOfParallelBeziers||"curve-style"!==t||"bezier"!==n&&"bezier"!==r||e.parallelEdges().forEach((function(e){e.dirtyBoundingBoxCache()})),!i.triggersBoundsOfConnectedEdges||"display"!==t||"none"!==n&&"none"!==r||e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))},Ga.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r)};var Ua={applyBypass:function(e,t,n,r){var i=[];if("*"===t||"**"===t){if(void 0!==n)for(var o=0;ot.length?o.substr(t.length):""}function s(){n=n.length>r.length?n.substr(r.length):""}for(o=o.replace(/[/][*](\s|.)+?[*][/]/g,"");!o.match(/^\s*$/);){var l=o.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){Ue("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+o);break}t=l[0];var u=l[1];if("core"!==u&&new Vi(u).invalid)Ue("Skipping parsing of block: Invalid selector found in string stylesheet: "+u),a();else{var c=l[2],d=!1;n=c;for(var h=[];!n.match(/^\s*$/);){var p=n.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ue("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+c),d=!0;break}r=p[0];var f=p[1],g=p[2];this.properties[f]?i.parse(f,g)?(h.push({name:f,val:g}),s()):(Ue("Skipping property: Invalid property definition in: "+r),s()):(Ue("Skipping property: Invalid property name in: "+r),s())}if(d){a();break}i.selector(u);for(var v=0;v=7&&"d"===t[0]&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var h=s.data;return{name:e,value:u,strValue:""+t,mapped:h,field:u[1],bypass:n}}if(t.length>=10&&"m"===t[0]&&(c=new RegExp(s.mapData.regex).exec(t))){if(n)return!1;if(d.multiple)return!1;var p=s.mapData;if(!d.color&&!d.number)return!1;var f=this.parse(e,c[4]);if(!f||f.mapped)return!1;var g=this.parse(e,c[5]);if(!g||g.mapped)return!1;if(f.pfValue===g.pfValue||f.strValue===g.strValue)return Ue("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+f.strValue+"`"),this.parse(e,f.strValue);if(d.color){var v=f.value,y=g.value;if(!(v[0]!==y[0]||v[1]!==y[1]||v[2]!==y[2]||v[3]!==y[3]&&(null!=v[3]&&1!==v[3]||null!=y[3]&&1!==y[3])))return!1}return{name:e,value:c,strValue:""+t,mapped:p,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:f.value,valueMax:g.value,bypass:n}}}if(d.multiple&&"multiple"!==r){var m;if(m=l?t.split(/\s+/):w(t)?t:[t],d.evenMultiple&&m.length%2!=0)return null;for(var E=[],C=[],T=[],N="",M=!1,A=0;A0?" ":"")+D.strValue}return d.validate&&!d.validate(E,C)?null:d.singleEnum&&M?1===E.length&&b(E[0])?{name:e,value:E[0],strValue:E[0],bypass:n}:null:{name:e,value:E,pfValue:T,strValue:N,bypass:n,units:C}}var I,O,P,S=function(){for(var r=0;rd.max||d.strictMax&&t===d.max))return null;var G={name:e,value:t,strValue:""+t+(L||""),units:L,bypass:n};return d.unitless||"px"!==L&&"em"!==L?G.pfValue=t:G.pfValue="px"!==L&&L?this.getEmSizeInPixels()*t:t,"ms"!==L&&"s"!==L||(G.pfValue="ms"===L?t:1e3*t),"deg"!==L&&"rad"!==L||(G.pfValue="rad"===L?t:(I=t,Math.PI*I/180)),"%"===L&&(G.pfValue=t/100),G}if(d.propList){var Y=[],X=""+t;if("none"===X);else{for(var H=X.split(/\s*,\s*|\s+/),W=0;W255)return;t.push(Math.floor(o))}var a=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(a&&!s)return;var l=n[4];if(void 0!==l){if((l=parseFloat(l))<0||l>1)return;t.push(l)}}return t}(P)||function(e){var t,n,r,i,o,a,s,l;function u(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var c=new RegExp("^"+j+"$").exec(e);if(c){if((n=parseInt(c[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(r=parseFloat(c[2]))<0||r>100)return;if(r/=100,(i=parseFloat(c[3]))<0||i>100)return;if(i/=100,void 0!==(o=c[4])&&((o=parseFloat(o))<0||o>1))return;if(0===r)a=s=l=Math.round(255*i);else{var d=i<.5?i*(1+r):i+r-i*r,h=2*i-d;a=Math.round(255*u(h,d,n+1/3)),s=Math.round(255*u(h,d,n)),l=Math.round(255*u(h,d,n-1/3))}t=[a,s,l,o]}return t}(P);return K?{name:e,value:K,pfValue:K,strValue:"rgb("+K[0]+","+K[1]+","+K[2]+")",bypass:n}:null}if(d.regex||d.regexes){if(d.enums){var Z=S();if(Z)return Z}for(var $=d.regexes?d.regexes:[d.regex],Q=0;Q<$.length;Q++){var J=new RegExp($[Q]).exec(t);if(J)return{name:e,value:d.singleRegexMatchValue?J[1]:J,strValue:""+t,bypass:n}}return null}return d.string?{name:e,value:""+t,strValue:""+t,bypass:n}:d.enums?S():null};var $a=function e(t){if(!(this instanceof e))return new e(t);A(t)?(this._private={cy:t,coreStyle:{}},this.length=0,this.resetToDefault()):Ge("A style must have a core reference")},Qa=$a.prototype;Qa.instanceString=function(){return"style"},Qa.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n0&&l>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:a=(a=(a=Math.min((s-2*t)/n.w,(l-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:a)=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t,n,r=this._private,i=r.pan,o=r.zoom,a=!1;if(r.zoomingEnabled||(a=!0),_(e)?n=e:E(e)&&(n=e.level,null!=e.position?t=wt(e.position,o,i):null!=e.renderedPosition&&(t=e.renderedPosition),null==t||r.panningEnabled||(a=!0)),n=(n=n>r.maxZoom?r.maxZoom:n)t.maxZoom||!t.zoomingEnabled?o=!0:(t.zoom=s,i.push("zoom"))}if(r&&(!o||!e.cancelOnFailedZoom)&&t.panningEnabled){var l=e.pan;_(l.x)&&(t.pan.x=l.x,a=!1),_(l.y)&&(t.pan.y=l.y,a=!1),a||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(b(e)){var n=e;e=this.mutableElements().filter(n)}else T(e)||(e=this.mutableElements());if(0!==e.length){var r=e.boundingBox(),i=this.width(),o=this.height();return{x:(i-(t=void 0===t?this._private.zoom:t)*(r.x1+r.x2))/2,y:(o-t*(r.y1+r.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e,t,n=this._private,r=n.container;return n.sizeCache=n.sizeCache||(r?(e=this.window().getComputedStyle(r),t=function(t){return parseFloat(e.getPropertyValue(t))},{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};es.centre=es.center,es.autolockNodes=es.autolock,es.autoungrabifyNodes=es.autoungrabify;var ts={data:_i.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:_i.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:_i.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:_i.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};ts.attr=ts.data,ts.removeAttr=ts.removeData;var ns=function(e){var t=this,n=(e=Y({},e)).container;n&&!C(n)&&C(n[0])&&(n=n[0]);var r=n?n._cyreg:null;(r=r||{})&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var o=void 0!==h&&void 0!==n&&!e.headless,a=e;a.layout=Y({name:o?"grid":"null"},a.layout),a.renderer=Y({name:o?"canvas":"null"},a.renderer);var s=function(e,t,n){return void 0!==t?t:void 0!==n?n:e},l=this._private={container:n,ready:!1,options:a,elements:new ma(this),listeners:[],aniEles:new ma(this),data:a.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,a.zoomingEnabled),userZoomingEnabled:s(!0,a.userZoomingEnabled),panningEnabled:s(!0,a.panningEnabled),userPanningEnabled:s(!0,a.userPanningEnabled),boxSelectionEnabled:s(!0,a.boxSelectionEnabled),autolock:s(!1,a.autolock,a.autolockNodes),autoungrabify:s(!1,a.autoungrabify,a.autoungrabifyNodes),autounselectify:s(!1,a.autounselectify),styleEnabled:void 0===a.styleEnabled?o:a.styleEnabled,zoom:_(a.zoom)?a.zoom:1,pan:{x:E(a.pan)&&_(a.pan.x)?a.pan.x:0,y:E(a.pan)&&_(a.pan.y)?a.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,a.multiClickDebounceTime)};this.createEmitter(),this.selectionType(a.selectionType),this.zoomRange({min:a.minZoom,max:a.maxZoom}),l.styleEnabled&&t.setStyle([]);var u=Y({},a,a.renderer);t.initRenderer(u),function(e,t){if(e.some(O))return wr.all(e).then(t);t(e)}([a.style,a.elements],(function(e){var n=e[0],o=e[1];l.styleEnabled&&t.style().append(n),function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),null!=e&&(E(e)||w(e))&&t.add(e),t.one("layoutready",(function(e){t.notifications(!0),t.emit(e),t.one("load",n),t.emitAndNotify("load")})).one("layoutstop",(function(){t.one("done",r),t.emit("done")}));var o=Y({},t._private.options.layout);o.eles=t.elements(),t.layout(o).run()}(o,(function(){t.startAnimationLoop(),l.ready=!0,x(a.ready)&&t.on("ready",a.ready);for(var e=0;e0,u=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(T(n.roots))e=n.roots;else if(w(n.roots)){for(var c=[],d=0;d0;){var P=D.shift(),k=A(P,I);if(k)P.outgoers().filter((function(e){return e.isNode()&&i.has(e)})).forEach(O);else if(null===k){Ue("Detected double maximal shift for node `"+P.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}M();var S=0;if(n.avoidOverlap)for(var L=0;L0&&y[0].length<=3?l/2:0),d=2*Math.PI/y[r].length*i;return 0===r&&1===y[0].length&&(c=1),{x:q+c*Math.cos(d),y:K+c*Math.sin(d)}}return{x:q+(i+1-(o+1)/2)*a,y:(r+1)*s}})),this};var us={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function cs(e){this.options=Y({},us,e)}cs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,o=r.nodes().not(":parent");t.sort&&(o=o.sort(t.sort));for(var a,s=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),l=s.x1+s.w/2,u=s.y1+s.h/2,c=(void 0===t.sweep?2*Math.PI-2*Math.PI/o.length:t.sweep)/Math.max(1,o.length-1),d=0,h=0;h1&&t.avoidOverlap){d*=1.75;var v=Math.cos(c)-Math.cos(0),y=Math.sin(c)-Math.sin(0),m=Math.sqrt(d*d/(v*v+y*y));a=Math.max(m,a)}return r.nodes().layoutPositions(this,t,(function(e,n){var r=t.startAngle+n*c*(i?1:-1),o=a*Math.cos(r),s=a*Math.sin(r);return{x:l+o,y:u+s}})),this};var ds,hs={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function ps(e){this.options=Y({},hs,e)}ps.prototype.run=function(){for(var e=this.options,t=e,n=void 0!==t.counterclockwise?!t.counterclockwise:t.clockwise,r=e.cy,i=t.eles,o=i.nodes().not(":parent"),a=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s=a.x1+a.w/2,l=a.y1+a.h/2,u=[],c=0,d=0;d0&&Math.abs(m[0].value-x.value)>=v&&(m=[],y.push(m)),m.push(x)}var w=c+t.minNodeSpacing;if(!t.avoidOverlap){var E=y.length>0&&y[0].length>1,_=(Math.min(a.w,a.h)/2-w)/(y.length+E?1:0);w=Math.min(w,_)}for(var C=0,T=0;T1&&t.avoidOverlap){var D=Math.cos(A)-Math.cos(0),I=Math.sin(A)-Math.sin(0),O=Math.sqrt(w*w/(D*D+I*I));C=Math.max(O,C)}N.r=C,C+=w}if(t.equidistant){for(var P=0,k=0,S=0;S=e.numIter||(Es(r,e),r.temperature=r.temperature*e.coolingFactor,r.temperature=e.animationThreshold&&o(),Ee(t)):(Ss(r,e),s())}();else{for(;u;)u=a(l),l++;Ss(r,e),s()}return this},gs.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},gs.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var vs=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),o=kt(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),a={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o},s=n.eles.components(),l={},u=0;u0)for(a.graphSet.push(E),u=0;ur.count?0:r.graph},ms=function e(t,n,r,i){var o=i.graphSet[r];if(-10)var s=(u=r.nodeOverlap*a)*i/(g=Math.sqrt(i*i+o*o)),l=u*o/g;else{var u,c=Ms(e,i,o),d=Ms(t,-1*i,-1*o),h=d.x-c.x,p=d.y-c.y,f=h*h+p*p,g=Math.sqrt(f);s=(u=(e.nodeRepulsion+t.nodeRepulsion)/f)*h/g,l=u*p/g}e.isLocked||(e.offsetX-=s,e.offsetY-=l),t.isLocked||(t.offsetX+=s,t.offsetY+=l)}},Ns=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else i=t.maxX-e.minX;if(r>0)var o=e.maxY-t.minY;else o=t.maxY-e.minY;return i>=0&&o>=0?Math.sqrt(i*i+o*o):0},Ms=function(e,t,n){var r=e.positionX,i=e.positionY,o=e.height||1,a=e.width||1,s=n/t,l=o/a,u={};return 0===t&&0n?(u.x=r,u.y=i+o/2,u):0t&&-1*l<=s&&s<=l?(u.x=r-a/2,u.y=i-a*n/2/t,u):0=l)?(u.x=r+o*t/2/n,u.y=i+o/2,u):0>n&&(s<=-1*l||s>=l)?(u.x=r-o*t/2/n,u.y=i-o/2,u):u},As=function(e,t){for(var n=0;n1){var f=t.gravity*d/p,g=t.gravity*h/p;c.offsetX+=f,c.offsetY+=g}}}}},Is=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var o=n[r++],a=e.idToIndex[o],s=e.layoutNodes[a],l=s.children;if(0n)var i={x:n*e/r,y:n*t/r};else i={x:e,y:t};return i},ks=function e(t,n){var r=t.parentId;if(null!=r){var i=n.layoutNodes[n.idToIndex[r]],o=!1;return(null==i.maxX||t.maxX+i.padRight>i.maxX)&&(i.maxX=t.maxX+i.padRight,o=!0),(null==i.minX||t.minX-i.padLefti.maxY)&&(i.maxY=t.maxY+i.padBottom,o=!0),(null==i.minY||t.minY-i.padTopf&&(d+=p+t.componentSpacing,c=0,h=0,p=0)}}},Ls={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function Rs(e){this.options=Y({},Ls,e)}Rs.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(":parent");t.sort&&(i=i.sort(t.sort));var o=kt(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(0===o.h||0===o.w)r.nodes().layoutPositions(this,t,(function(e){return{x:o.x1,y:o.y1}}));else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(e){if(null==e)return Math.min(l,u);Math.min(l,u)==l?l=e:u=e},d=function(e){if(null==e)return Math.max(l,u);Math.max(l,u)==l?l=e:u=e},h=t.rows,p=null!=t.cols?t.cols:t.columns;if(null!=h&&null!=p)l=h,u=p;else if(null!=h&&null==p)l=h,u=Math.ceil(a/l);else if(null==h&&null!=p)u=p,l=Math.ceil(a/u);else if(u*l>a){var f=c(),g=d();(f-1)*g>=a?c(f-1):(g-1)*f>=a&&d(g-1)}else for(;u*l=a?d(y+1):c(v+1)}var m=o.w/u,b=o.h/l;if(t.condense&&(m=0,b=0),t.avoidOverlap)for(var x=0;x=u&&(O=0,I++)},k={},S=0;S(r=Ht(e,t,x[w],x[w+1],x[w+2],x[w+3])))return v(n,r),!0}else if("bezier"===o.edgeType||"multibezier"===o.edgeType||"self"===o.edgeType||"compound"===o.edgeType)for(x=o.allpts,w=0;w+5(r=Xt(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5])))return v(n,r),!0;m=m||i.source,b=b||i.target;var E=a.getArrowWidth(l,c),_=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(w=0;w<_.length;w++){var C=_[w],T=s.arrowShapes[n.pstyle(C.name+"-arrow-shape").value],N=n.pstyle("width").pfValue;if(T.roughCollide(e,t,E,C.angle,{x:C.x,y:C.y},N,h)&&T.collide(e,t,E,C.angle,{x:C.x,y:C.y},N,h))return v(n),!0}d&&u.length>0&&(y(m),y(b))}function b(e,t,n){return Qe(e,t,n)}function x(n,r){var i,o=n._private,a=f;i=r?r+"-":"",n.boundingBox();var s=o.labelBounds[r||"main"],l=n.pstyle(i+"label").value;if("yes"===n.pstyle("text-events").strValue&&l){var u=b(o.rscratch,"labelX",r),c=b(o.rscratch,"labelY",r),d=b(o.rscratch,"labelAngle",r),h=n.pstyle(i+"text-margin-x").pfValue,p=n.pstyle(i+"text-margin-y").pfValue,g=s.x1-a-h,y=s.x2+a-h,m=s.y1-a-p,x=s.y2+a-p;if(d){var w=Math.cos(d),E=Math.sin(d),_=function(e,t){return{x:(e-=u)*w-(t-=c)*E+u,y:e*E+t*w+c}},C=_(g,m),T=_(g,x),N=_(y,m),M=_(y,x),A=[C.x+h,C.y+p,N.x+h,N.y+p,M.x+h,M.y+p,T.x+h,T.y+p];if(Wt(e,t,A))return v(n),!0}else if(jt(s,e,t))return v(n),!0}}n&&(l=l.interactive);for(var w=l.length-1;w>=0;w--){var E=l[w];E.isNode()?y(E)||x(E):m(E)||x(E)||x(E,"source")||x(E,"target")}return u},getAllInBox:function(e,t,n,r){for(var i,o,a=this.getCachedZSortedEles().interactive,s=[],l=Math.min(e,n),u=Math.max(e,n),c=Math.min(t,r),d=Math.max(t,r),h=kt({x1:e=l,y1:t=c,x2:n=u,y2:r=d}),p=0;p4&&void 0!==arguments[4])||arguments[4];return 0===r||0===t.radius?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,r,i){var o,a;if(e!==hl?gl(t,e,pl):((a=pl).x=-1*(o=fl).x,a.y=-1*o.y,a.nx=-1*o.nx,a.ny=-1*o.ny,a.ang=o.ang>0?-(Math.PI-o.ang):Math.PI+o.ang),gl(t,n,fl),Qs=pl.nx*fl.ny-pl.ny*fl.nx,Js=pl.nx*fl.nx-pl.ny*-fl.ny,nl=Math.asin(Math.max(-1,Math.min(1,Qs))),Math.abs(nl)<1e-6)return Zs=t.x,$s=t.y,void(il=al=0);el=1,tl=!1,Js<0?nl<0?nl=Math.PI+nl:(nl=Math.PI-nl,el=-1,tl=!0):nl>0&&(el=-1,tl=!0),al=void 0!==t.radius?t.radius:r,rl=nl/2,sl=Math.min(pl.len/2,fl.len/2),i?(ol=Math.abs(Math.cos(rl)*al/Math.sin(rl)))>sl?(ol=sl,il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))):il=al:(ol=Math.min(sl,al),il=Math.abs(ol*Math.sin(rl)/Math.cos(rl))),cl=t.x+fl.nx*ol,dl=t.y+fl.ny*ol,Zs=cl-fl.ny*il*el,$s=dl+fl.nx*il*el,ll=t.x+pl.nx*ol,ul=t.y+pl.ny*ol,hl=t}(e,t,n,r,i),{cx:Zs,cy:$s,radius:il,startX:ll,startY:ul,stopX:cl,stopY:dl,startAngle:pl.ang+Math.PI/2*el,endAngle:fl.ang-Math.PI/2*el,counterClockwise:tl})}var ml={};function bl(e){var t=[];if(null!=e){for(var n=0;n0?Math.max(e-t,0):Math.min(e+t,0)},M=N(C,E),A=N(T,_),D=!1;"auto"===v?g=Math.abs(M)>Math.abs(A)?i:r:v===l||v===s?(g=r,D=!0):v!==o&&v!==a||(g=i,D=!0);var I,O=g===r,P=O?A:M,k=O?T:C,S=Nt(k),L=!1;D&&(m||x)||!(v===s&&k<0||v===l&&k>0||v===o&&k>0||v===a&&k<0)||(P=(S*=-1)*Math.abs(P),L=!0);var R=function(e){return Math.abs(e)=Math.abs(P)},B=R(I=m?(b<0?1+b:b)*P:(b<0?P:0)+b*S),F=R(Math.abs(P)-Math.abs(I));if(!B&&!F||L)if(O){var z=u.y1+I+(f?d/2*S:0),j=u.x1,V=u.x2;n.segpts=[j,z,V,z]}else{var G=u.x1+I+(f?c/2*S:0),Y=u.y1,U=u.y2;n.segpts=[G,Y,G,U]}else if(O){var X=Math.abs(k)<=d/2,H=Math.abs(C)<=h/2;if(X){var W=(u.x1+u.x2)/2,q=u.y1,K=u.y2;n.segpts=[W,q,W,K]}else if(H){var Z=(u.y1+u.y2)/2,$=u.x1,Q=u.x2;n.segpts=[$,Z,Q,Z]}else n.segpts=[u.x1,u.y2]}else{var J=Math.abs(k)<=c/2,ee=Math.abs(T)<=p/2;if(J){var te=(u.y1+u.y2)/2,ne=u.x1,re=u.x2;n.segpts=[ne,te,re,te]}else if(ee){var ie=(u.x1+u.x2)/2,oe=u.y1,ae=u.y2;n.segpts=[ie,oe,ie,ae]}else n.segpts=[u.x2,u.y1]}if(n.isRound){var se=e.pstyle("taxi-radius").value,le="arc-radius"===e.pstyle("radius-type").value[0];n.radii=new Array(n.segpts.length/2).fill(se),n.isArcRadius=new Array(n.segpts.length/2).fill(le)}},ml.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if("bezier"===n.edgeType){var r=t.srcPos,i=t.tgtPos,o=t.srcW,a=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,c=t.tgtShape,d=t.srcCornerRadius,h=t.tgtCornerRadius,p=t.srcRs,f=t.tgtRs,g=!_(n.startX)||!_(n.startY),v=!_(n.arrowStartX)||!_(n.arrowStartY),y=!_(n.endX)||!_(n.endY),m=!_(n.arrowEndX)||!_(n.arrowEndY),b=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,x=Mt({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),w=xh.poolIndex()){var p=d;d=h,h=p}var f=s.srcPos=d.position(),g=s.tgtPos=h.position(),v=s.srcW=d.outerWidth(),y=s.srcH=d.outerHeight(),m=s.tgtW=h.outerWidth(),b=s.tgtH=h.outerHeight(),x=s.srcShape=n.nodeShapes[t.getNodeShape(d)],w=s.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=s.srcCornerRadius="auto"===d.pstyle("corner-radius").value?"auto":d.pstyle("corner-radius").pfValue,C=s.tgtCornerRadius="auto"===h.pstyle("corner-radius").value?"auto":h.pstyle("corner-radius").pfValue,T=s.tgtRs=h._private.rscratch,N=s.srcRs=d._private.rscratch;s.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var M=0;M0){var H=u,W=At(H,_t(t)),q=At(H,_t(X)),K=W;q2&&At(H,{x:X[2],y:X[3]})0){var le=c,ue=At(le,_t(t)),ce=At(le,_t(se)),de=ue;ce2&&At(le,{x:se[2],y:se[3]})=u||m){c={cp:g,segment:y};break}}if(c)break}var b=c.cp,x=c.segment,w=(u-h)/x.length,E=x.t1-x.t0,_=s?x.t0+E*w:x.t1-E*w;_=Pt(0,_,1),t=Ot(b.p0,b.p1,b.p2,_),i=function(e,t,n,r){var i=Pt(0,r-.001,1),o=Pt(0,r+.001,1),a=Ot(e,t,n,i),s=Ot(e,t,n,o);return Tl(a,s)}(b.p0,b.p1,b.p2,_);break;case"straight":case"segments":case"haystack":for(var C,T,N,M,A=0,D=r.allpts.length,I=0;I+3=u));I+=2);var O=(u-T)/C;O=Pt(0,O,1),t=function(e,t,n,r){var i=t.x-e.x,o=t.y-e.y,a=Mt(e,t),s=i/a,l=o/a;return n=null==n?0:n,r=null!=r?r:n*a,{x:e.x+s*r,y:e.y+l*r}}(N,M,O),i=Tl(N,M)}a("labelX",n,t.x),a("labelY",n,t.y),a("labelAutoAngle",n,i)}};u("source"),u("target"),this.applyLabelDimensions(e)}},_l.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,"source"),this.applyPrefixedLabelDimensions(e,"target"))},_l.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=this.calculateLabelDimensions(e,r),o=e.pstyle("line-height").pfValue,a=e.pstyle("text-wrap").strValue,s=Qe(n.rscratch,"labelWrapCachedLines",t)||[],l="wrap"!==a?1:Math.max(s.length,1),u=i.height/l,c=u*o,d=i.width,h=i.height+(l-1)*(o-1)*u;Je(n.rstyle,"labelWidth",t,d),Je(n.rscratch,"labelWidth",t,d),Je(n.rstyle,"labelHeight",t,h),Je(n.rscratch,"labelHeight",t,h),Je(n.rscratch,"labelLineHeight",t,c)},_l.getLabelText=function(e,t){var n=e._private,r=t?t+"-":"",i=e.pstyle(r+"label").strValue,o=e.pstyle("text-transform").value,a=function(e,r){return r?(Je(n.rscratch,e,t,r),r):Qe(n.rscratch,e,t)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=e.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var u=i.split("\n"),c=e.pstyle("text-max-width").pfValue,h="anywhere"===e.pstyle("text-overflow-wrap").value,p=[],f=/[\s\u200b]+|$/g,g=0;gc){var b,x="",w=0,E=d(v.matchAll(f));try{for(E.s();!(b=E.n()).done;){var _=b.value,C=_[0],T=v.substring(w,_.index);w=_.index+C.length;var N=0===x.length?T:x+T+C;this.calculateLabelDimensions(e,N).width<=c?x+=T+C:(x&&p.push(x),x=T+C)}}catch(e){E.e(e)}finally{E.f()}x.match(/^[\s\u200b]+$/)||p.push(x)}else p.push(v)}a("labelWrapCachedLines",p),i=a("labelWrapCachedText",p.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var M=e.pstyle("text-max-width").pfValue,A="",D=!1;if(this.calculateLabelDimensions(e,i).widthM);I++)A+=i[I],I===i.length-1&&(D=!0);return D||(A+="…"),A}return i},_l.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue,n=e.pstyle("text-halign").strValue;if("auto"!==t)return t;if(!e.isNode())return"center";switch(n){case"left":return"right";case"right":return"left";default:return"center"}},_l.calculateLabelDimensions=function(e,t){var n=this,r=n.cy.window().document,i=Oe(t,e._private.labelDimsKey),o=n.labelDimCache||(n.labelDimCache=[]),a=o[i];if(null!=a)return a;var s=e.pstyle("font-style").strValue,l=e.pstyle("font-size").pfValue,u=e.pstyle("font-family").strValue,c=e.pstyle("font-weight").strValue,d=this.labelCalcCanvas,h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=r.createElement("canvas"),h=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute",p.left="-9999px",p.top="-9999px",p.zIndex="-1",p.visibility="hidden",p.pointerEvents="none"}h.font="".concat(s," ").concat(c," ").concat(l,"px ").concat(u);for(var f=0,g=0,v=t.split("\n"),y=0;y1&&void 0!==arguments[1])||arguments[1];if(t.merge(e),n)for(var r=0;r=e.desktopTapThreshold2}var M=i(t);v&&(e.hoverData.tapholdCancelled=!0),n=!0,r(g,["mousemove","vmousemove","tapdrag"],t,{x:c[0],y:c[1]});var A=function(){e.data.bgActivePosistion=void 0,e.hoverData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:c[0],y:c[1]}}),f[4]=1,e.hoverData.selecting=!0,e.redrawHint("select",!0),e.redraw()};if(3===e.hoverData.which){if(v){var D={originalEvent:t,type:"cxtdrag",position:{x:c[0],y:c[1]}};b?b.emit(D):a.emit(D),e.hoverData.cxtDragged=!0,e.hoverData.cxtOver&&g===e.hoverData.cxtOver||(e.hoverData.cxtOver&&e.hoverData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:c[0],y:c[1]}}),e.hoverData.cxtOver=g,g&&g.emit({originalEvent:t,type:"cxtdragover",position:{x:c[0],y:c[1]}}))}}else if(e.hoverData.dragging){if(n=!0,a.panningEnabled()&&a.userPanningEnabled()){var I;if(e.hoverData.justStartedPan){var O=e.hoverData.mdownPos;I={x:(c[0]-O[0])*s,y:(c[1]-O[1])*s},e.hoverData.justStartedPan=!1}else I={x:x[0]*s,y:x[1]*s};a.panBy(I),a.emit("dragpan"),e.hoverData.dragged=!0}c=e.projectIntoViewport(t.clientX,t.clientY)}else if(1!=f[4]||null!=b&&!b.pannable()){if(b&&b.pannable()&&b.active()&&b.unactivate(),b&&b.grabbed()||g==y||(y&&r(y,["mouseout","tapdragout"],t,{x:c[0],y:c[1]}),g&&r(g,["mouseover","tapdragover"],t,{x:c[0],y:c[1]}),e.hoverData.last=g),b)if(v){if(a.boxSelectionEnabled()&&M)b&&b.grabbed()&&(d(w),b.emit("freeon"),w.emit("free"),e.dragData.didDrag&&(b.emit("dragfreeon"),w.emit("dragfree"))),A();else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var P=!e.dragData.didDrag;P&&e.redrawHint("eles",!0),e.dragData.didDrag=!0,e.hoverData.draggingEles||u(w,{inDragLayer:!0});var k={x:0,y:0};if(_(x[0])&&_(x[1])&&(k.x+=x[0],k.y+=x[1],P)){var S=e.hoverData.dragDelta;S&&_(S[0])&&_(S[1])&&(k.x+=S[0],k.y+=S[1])}e.hoverData.draggingEles=!0,w.silentShift(k).emit("position drag"),e.redrawHint("drag",!0),e.redraw()}}else!function(){var t=e.hoverData.dragDelta=e.hoverData.dragDelta||[];0===t.length?(t.push(x[0]),t.push(x[1])):(t[0]+=x[0],t[1]+=x[1])}();n=!0}else v&&(e.hoverData.dragging||!a.boxSelectionEnabled()||!M&&a.panningEnabled()&&a.userPanningEnabled()?!e.hoverData.selecting&&a.panningEnabled()&&a.userPanningEnabled()&&o(b,e.hoverData.downs)&&(e.hoverData.dragging=!0,e.hoverData.justStartedPan=!0,f[4]=0,e.data.bgActivePosistion=_t(h),e.redrawHint("select",!0),e.redraw()):A(),b&&b.pannable()&&b.active()&&b.unactivate());return f[2]=c[0],f[3]=c[1],n?(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),!1):void 0}}),!1),e.registerBinding(t,"mouseup",(function(t){if((1!==e.hoverData.which||1===t.which||!e.hoverData.capture)&&e.hoverData.capture){e.hoverData.capture=!1;var o=e.cy,a=e.projectIntoViewport(t.clientX,t.clientY),s=e.selection,l=e.findNearestElement(a[0],a[1],!0,!1),u=e.dragData.possibleDragElements,c=e.hoverData.down,h=i(t);if(e.data.bgActivePosistion&&(e.redrawHint("select",!0),e.redraw()),e.hoverData.tapholdCancelled=!0,e.data.bgActivePosistion=void 0,c&&c.unactivate(),3===e.hoverData.which){var p={originalEvent:t,type:"cxttapend",position:{x:a[0],y:a[1]}};if(c?c.emit(p):o.emit(p),!e.hoverData.cxtDragged){var f={originalEvent:t,type:"cxttap",position:{x:a[0],y:a[1]}};c?c.emit(f):o.emit(f)}e.hoverData.cxtDragged=!1,e.hoverData.which=null}else if(1===e.hoverData.which){if(r(l,["mouseup","tapend","vmouseup"],t,{x:a[0],y:a[1]}),e.dragData.didDrag||e.hoverData.dragged||e.hoverData.selecting||e.hoverData.isOverThresholdDrag||(r(c,["click","tap","vclick"],t,{x:a[0],y:a[1]}),x=!1,t.timeStamp-w<=o.multiClickDebounceTime()?(b&&clearTimeout(b),x=!0,w=null,r(c,["dblclick","dbltap","vdblclick"],t,{x:a[0],y:a[1]})):(b=setTimeout((function(){x||r(c,["oneclick","onetap","voneclick"],t,{x:a[0],y:a[1]})}),o.multiClickDebounceTime()),w=t.timeStamp)),null!=c||e.dragData.didDrag||e.hoverData.selecting||e.hoverData.dragged||i(t)||(o.$(n).unselect(["tapunselect"]),u.length>0&&e.redrawHint("eles",!0),e.dragData.possibleDragElements=u=o.collection()),l!=c||e.dragData.didDrag||e.hoverData.selecting||null!=l&&l._private.selectable&&(e.hoverData.dragging||("additive"===o.selectionType()||h?l.selected()?l.unselect(["tapunselect"]):l.select(["tapselect"]):h||(o.$(n).unmerge(l).unselect(["tapunselect"]),l.select(["tapselect"]))),e.redrawHint("eles",!0)),e.hoverData.selecting){var g=o.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));e.redrawHint("select",!0),g.length>0&&e.redrawHint("eles",!0),o.emit({type:"boxend",originalEvent:t,position:{x:a[0],y:a[1]}});"additive"===o.selectionType()||h||o.$(n).unmerge(g).unselect(),g.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),e.redraw()}if(e.hoverData.dragging&&(e.hoverData.dragging=!1,e.redrawHint("select",!0),e.redrawHint("eles",!0),e.redraw()),!s[4]){e.redrawHint("drag",!0),e.redrawHint("eles",!0);var v=c&&c.grabbed();d(u),v&&(c.emit("freeon"),u.emit("free"),e.dragData.didDrag&&(c.emit("dragfreeon"),u.emit("dragfree")))}}s[4]=0,e.hoverData.down=null,e.hoverData.cxtStarted=!1,e.hoverData.draggingEles=!1,e.hoverData.selecting=!1,e.hoverData.isOverThresholdDrag=!1,e.dragData.didDrag=!1,e.hoverData.dragged=!1,e.hoverData.dragDelta=[],e.hoverData.mdownPos=null,e.hoverData.mdownGPos=null,e.hoverData.which=null}}),!1);var C,T,N,M,A,D,I,O,P,k,S,L,R,B=function(t){if(!e.scrollingPage){var n=e.cy,r=n.zoom(),i=n.pan(),o=e.projectIntoViewport(t.clientX,t.clientY),a=[o[0]*r+i.x,o[1]*r+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||0!==e.selection[4])t.preventDefault();else if(n.panningEnabled()&&n.userPanningEnabled()&&n.zoomingEnabled()&&n.userZoomingEnabled()){var s;t.preventDefault(),e.data.wheelZooming=!0,clearTimeout(e.data.wheelTimeout),e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=!1,e.redrawHint("eles",!0),e.redraw()}),150),s=null!=t.deltaY?t.deltaY/-250:null!=t.wheelDeltaY?t.wheelDeltaY/1e3:t.wheelDelta/1e3,s*=e.wheelSensitivity,1===t.deltaMode&&(s*=33);var l=n.zoom()*Math.pow(10,s);"gesturechange"===t.type&&(l=e.gestureStartZoom*t.scale),n.zoom({level:l,renderedPosition:{x:a[0],y:a[1]}}),n.emit("gesturechange"===t.type?"pinchzoom":"scrollzoom")}}};e.registerBinding(e.container,"wheel",B,!0),e.registerBinding(t,"scroll",(function(t){e.scrollingPage=!0,clearTimeout(e.scrollingPageTimeout),e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=!1}),250)}),!0),e.registerBinding(e.container,"gesturestart",(function(t){e.gestureStartZoom=e.cy.zoom(),e.hasTouchStarted||t.preventDefault()}),!0),e.registerBinding(e.container,"gesturechange",(function(t){e.hasTouchStarted||B(t)}),!0),e.registerBinding(e.container,"mouseout",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseout",position:{x:n[0],y:n[1]}})}),!1),e.registerBinding(e.container,"mouseover",(function(t){var n=e.projectIntoViewport(t.clientX,t.clientY);e.cy.emit({originalEvent:t,type:"mouseover",position:{x:n[0],y:n[1]}})}),!1);var F,z,j,V,G,Y,U,X=function(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))},H=function(e,t,n,r){return(n-e)*(n-e)+(r-t)*(r-t)};if(e.registerBinding(e.container,"touchstart",F=function(t){if(e.hasTouchStarted=!0,m(t)){p(),e.touchData.capture=!0,e.data.bgActivePosistion=void 0;var n=e.cy,i=e.touchData.now,o=e.touchData.earlier;if(t.touches[0]){var a=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);i[0]=a[0],i[1]=a[1]}if(t.touches[1]&&(a=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),i[2]=a[0],i[3]=a[1]),t.touches[2]&&(a=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),i[4]=a[0],i[5]=a[1]),t.touches[1]){e.touchData.singleTouchMoved=!0,d(e.dragData.touchDragEles);var l=e.findContainerClientCoords();P=l[0],k=l[1],S=l[2],L=l[3],C=t.touches[0].clientX-P,T=t.touches[0].clientY-k,N=t.touches[1].clientX-P,M=t.touches[1].clientY-k,R=0<=C&&C<=S&&0<=N&&N<=S&&0<=T&&T<=L&&0<=M&&M<=L;var h=n.pan(),f=n.zoom();if(A=X(C,T,N,M),D=H(C,T,N,M),O=[((I=[(C+N)/2,(T+M)/2])[0]-h.x)/f,(I[1]-h.y)/f],D<4e4&&!t.touches[2]){var g=e.findNearestElement(i[0],i[1],!0,!0),v=e.findNearestElement(i[2],i[3],!0,!0);return g&&g.isNode()?(g.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=g):v&&v.isNode()?(v.activate().emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start=v):n.emit({originalEvent:t,type:"cxttapstart",position:{x:i[0],y:i[1]}}),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!0,e.touchData.cxtDragged=!1,e.data.bgActivePosistion=void 0,void e.redraw()}}if(t.touches[2])n.boxSelectionEnabled()&&t.preventDefault();else if(t.touches[1]);else if(t.touches[0]){var y=e.findNearestElements(i[0],i[1],!0,!0),b=y[0];if(null!=b&&(b.activate(),e.touchData.start=b,e.touchData.starts=y,e.nodeIsGrabbable(b))){var x=e.dragData.touchDragEles=n.collection(),w=null;e.redrawHint("eles",!0),e.redrawHint("drag",!0),b.selected()?(w=n.$((function(t){return t.selected()&&e.nodeIsGrabbable(t)})),u(w,{addToList:x})):c(b,{addToList:x}),s(b);var E=function(e){return{originalEvent:t,type:e,position:{x:i[0],y:i[1]}}};b.emit(E("grabon")),w?w.forEach((function(e){e.emit(E("grab"))})):b.emit(E("grab"))}r(b,["touchstart","tapstart","vmousedown"],t,{x:i[0],y:i[1]}),null==b&&(e.data.bgActivePosistion={x:a[0],y:a[1]},e.redrawHint("select",!0),e.redraw()),e.touchData.singleTouchMoved=!1,e.touchData.singleTouchStartTime=+new Date,clearTimeout(e.touchData.tapholdTimeout),e.touchData.tapholdTimeout=setTimeout((function(){!1!==e.touchData.singleTouchMoved||e.pinching||e.touchData.selecting||r(e.touchData.start,["taphold"],t,{x:i[0],y:i[1]})}),e.tapholdDuration)}if(t.touches.length>=1){for(var _=e.touchData.startPosition=[null,null,null,null,null,null],B=0;B=e.touchTapThreshold2}if(n&&e.touchData.cxt){t.preventDefault();var w=t.touches[0].clientX-P,E=t.touches[0].clientY-k,I=t.touches[1].clientX-P,S=t.touches[1].clientY-k,L=H(w,E,I,S);if(L/D>=2.25||L>=22500){e.touchData.cxt=!1,e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var B={originalEvent:t,type:"cxttapend",position:{x:s[0],y:s[1]}};e.touchData.start?(e.touchData.start.unactivate().emit(B),e.touchData.start=null):a.emit(B)}}if(n&&e.touchData.cxt){B={originalEvent:t,type:"cxtdrag",position:{x:s[0],y:s[1]}},e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.touchData.start?e.touchData.start.emit(B):a.emit(B),e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxtDragged=!0;var F=e.findNearestElement(s[0],s[1],!0,!0);e.touchData.cxtOver&&F===e.touchData.cxtOver||(e.touchData.cxtOver&&e.touchData.cxtOver.emit({originalEvent:t,type:"cxtdragout",position:{x:s[0],y:s[1]}}),e.touchData.cxtOver=F,F&&F.emit({originalEvent:t,type:"cxtdragover",position:{x:s[0],y:s[1]}}))}else if(n&&t.touches[2]&&a.boxSelectionEnabled())t.preventDefault(),e.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,e.touchData.selecting||a.emit({originalEvent:t,type:"boxstart",position:{x:s[0],y:s[1]}}),e.touchData.selecting=!0,e.touchData.didSelect=!0,i[4]=1,i&&0!==i.length&&void 0!==i[0]?(i[2]=(s[0]+s[2]+s[4])/3,i[3]=(s[1]+s[3]+s[5])/3):(i[0]=(s[0]+s[2]+s[4])/3,i[1]=(s[1]+s[3]+s[5])/3,i[2]=(s[0]+s[2]+s[4])/3+1,i[3]=(s[1]+s[3]+s[5])/3+1),e.redrawHint("select",!0),e.redraw();else if(n&&t.touches[1]&&!e.touchData.didSelect&&a.zoomingEnabled()&&a.panningEnabled()&&a.userZoomingEnabled()&&a.userPanningEnabled()){if(t.preventDefault(),e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),ee=e.dragData.touchDragEles){e.redrawHint("drag",!0);for(var z=0;z0&&!e.hoverData.draggingEles&&!e.swipePanning&&null!=e.data.bgActivePosistion&&(e.data.bgActivePosistion=void 0,e.redrawHint("select",!0),e.redraw())}},!1),e.registerBinding(t,"touchcancel",j=function(t){var n=e.touchData.start;e.touchData.capture=!1,n&&n.unactivate()}),e.registerBinding(t,"touchend",V=function(t){var i=e.touchData.start;if(e.touchData.capture){0===t.touches.length&&(e.touchData.capture=!1),t.preventDefault();var o=e.selection;e.swipePanning=!1,e.hoverData.draggingEles=!1;var a,s=e.cy,l=s.zoom(),u=e.touchData.now,c=e.touchData.earlier;if(t.touches[0]){var h=e.projectIntoViewport(t.touches[0].clientX,t.touches[0].clientY);u[0]=h[0],u[1]=h[1]}if(t.touches[1]&&(h=e.projectIntoViewport(t.touches[1].clientX,t.touches[1].clientY),u[2]=h[0],u[3]=h[1]),t.touches[2]&&(h=e.projectIntoViewport(t.touches[2].clientX,t.touches[2].clientY),u[4]=h[0],u[5]=h[1]),i&&i.unactivate(),e.touchData.cxt){if(a={originalEvent:t,type:"cxttapend",position:{x:u[0],y:u[1]}},i?i.emit(a):s.emit(a),!e.touchData.cxtDragged){var p={originalEvent:t,type:"cxttap",position:{x:u[0],y:u[1]}};i?i.emit(p):s.emit(p)}return e.touchData.start&&(e.touchData.start._private.grabbed=!1),e.touchData.cxt=!1,e.touchData.start=null,void e.redraw()}if(!t.touches[2]&&s.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=!1;var f=s.collection(e.getAllInBox(o[0],o[1],o[2],o[3]));o[0]=void 0,o[1]=void 0,o[2]=void 0,o[3]=void 0,o[4]=0,e.redrawHint("select",!0),s.emit({type:"boxend",originalEvent:t,position:{x:u[0],y:u[1]}}),f.emit("box").stdFilter((function(e){return e.selectable()&&!e.selected()})).select().emit("boxselect"),f.nonempty()&&e.redrawHint("eles",!0),e.redraw()}if(null!=i&&i.unactivate(),t.touches[2])e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);else if(t.touches[1]);else if(t.touches[0]);else if(!t.touches[0]){e.data.bgActivePosistion=void 0,e.redrawHint("select",!0);var g=e.dragData.touchDragEles;if(null!=i){var v=i._private.grabbed;d(g),e.redrawHint("drag",!0),e.redrawHint("eles",!0),v&&(i.emit("freeon"),g.emit("free"),e.dragData.didDrag&&(i.emit("dragfreeon"),g.emit("dragfree"))),r(i,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]}),i.unactivate(),e.touchData.start=null}else{var y=e.findNearestElement(u[0],u[1],!0,!0);r(y,["touchend","tapend","vmouseup","tapdragout"],t,{x:u[0],y:u[1]})}var m=e.touchData.startPosition[0]-u[0],b=m*m,x=e.touchData.startPosition[1]-u[1],w=(b+x*x)*l*l;e.touchData.singleTouchMoved||(i||s.$(":selected").unselect(["tapunselect"]),r(i,["tap","vclick"],t,{x:u[0],y:u[1]}),G=!1,t.timeStamp-U<=s.multiClickDebounceTime()?(Y&&clearTimeout(Y),G=!0,U=null,r(i,["dbltap","vdblclick"],t,{x:u[0],y:u[1]})):(Y=setTimeout((function(){G||r(i,["onetap","voneclick"],t,{x:u[0],y:u[1]})}),s.multiClickDebounceTime()),U=t.timeStamp)),null!=i&&!e.dragData.didDrag&&i._private.selectable&&w2){for(var p=[c[0],c[1]],f=Math.pow(p[0]-e,2)+Math.pow(p[1]-t,2),g=1;g0)return g[0]}return null},p=Object.keys(d),f=0;f0?u:Gt(i,o,e,t,n,r,a,s)},checkPoint:function(e,t,n,r,i,o,a,s){var l=2*(s="auto"===s?sn(r,i):s);if(qt(e,t,this.points,o,a,r,i-l,[0,-1],n))return!0;if(qt(e,t,this.points,o,a,r-l,i,[0,-1],n))return!0;var u=r/2+2*n,c=i/2+2*n;return!!Wt(e,t,[o-u,a-c,o-u,a,o+u,a,o+u,a-c])||!!$t(e,t,l,l,o+r/2-s,a+i/2-s,n)||!!$t(e,t,l,l,o-r/2+s,a+i/2-s,n)}}},registerNodeShapes:function(){var e=this.nodeShapes={},t=this;this.generateEllipse(),this.generatePolygon("triangle",rn(3,0)),this.generateRoundPolygon("round-triangle",rn(3,0)),this.generatePolygon("rectangle",rn(4,0)),e.square=e.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var n=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",n),this.generateRoundPolygon("round-diamond",n),this.generatePolygon("pentagon",rn(5,0)),this.generateRoundPolygon("round-pentagon",rn(5,0)),this.generatePolygon("hexagon",rn(6,0)),this.generateRoundPolygon("round-hexagon",rn(6,0)),this.generatePolygon("heptagon",rn(7,0)),this.generateRoundPolygon("round-heptagon",rn(7,0)),this.generatePolygon("octagon",rn(8,0)),this.generateRoundPolygon("round-octagon",rn(8,0));var r=new Array(20),i=an(5,0),o=an(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s=e.deqFastCost*g)break}else if(i){if(p>=e.deqCost*l||p>=e.deqAvgCost*s)break}else if(f>=e.deqNoDrawCost*Bl)break;var v=e.deq(t,d,c);if(!(v.length>0))break;for(var y=0;y0&&(e.onDeqd(t,u),!i&&e.shouldRedraw(t,u,d,c)&&r())}),i(t))}}},zl=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ze;i(this,e),this.idsByKey=new et,this.keyForId=new et,this.cachesByLvl=new et,this.lvls=[],this.getKey=t,this.doesEleInvalidateKey=n}return a(e,[{key:"getIdsFor",value:function(e){null==e&&Ge("Can not get id list for null key");var t=this.idsByKey,n=this.idsByKey.get(e);return n||(n=new nt,t.set(e,n)),n}},{key:"addIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).add(t)}},{key:"deleteIdForKey",value:function(e,t){null!=e&&this.getIdsFor(e).delete(t)}},{key:"getNumberOfIdsForKey",value:function(e){return null==e?0:this.getIdsFor(e).size}},{key:"updateKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t),r=this.getKey(e);this.deleteIdForKey(n,t),this.addIdForKey(r,t),this.keyForId.set(t,r)}},{key:"deleteKeyMappingFor",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteIdForKey(n,t),this.keyForId.delete(t)}},{key:"keyHasChangedFor",value:function(e){var t=e.id();return this.keyForId.get(t)!==this.getKey(e)}},{key:"isInvalid",value:function(e){return this.keyHasChangedFor(e)||this.doesEleInvalidateKey(e)}},{key:"getCachesAt",value:function(e){var t=this.cachesByLvl,n=this.lvls,r=t.get(e);return r||(r=new et,t.set(e,r),n.push(e)),r}},{key:"getCache",value:function(e,t){return this.getCachesAt(t).get(e)}},{key:"get",value:function(e,t){var n=this.getKey(e),r=this.getCache(n,t);return null!=r&&this.updateKeyMappingFor(e),r}},{key:"getForCachedKey",value:function(e,t){var n=this.keyForId.get(e.id());return this.getCache(n,t)}},{key:"hasCache",value:function(e,t){return this.getCachesAt(t).has(e)}},{key:"has",value:function(e,t){var n=this.getKey(e);return this.hasCache(n,t)}},{key:"setCache",value:function(e,t,n){n.key=e,this.getCachesAt(t).set(e,n)}},{key:"set",value:function(e,t,n){var r=this.getKey(e);this.setCache(r,t,n),this.updateKeyMappingFor(e)}},{key:"deleteCache",value:function(e,t){this.getCachesAt(t).delete(e)}},{key:"delete",value:function(e,t){var n=this.getKey(e);this.deleteCache(n,t)}},{key:"invalidateKey",value:function(e){var t=this;this.lvls.forEach((function(n){return t.deleteCache(e,n)}))}},{key:"invalidate",value:function(e){var t=e.id(),n=this.keyForId.get(t);this.deleteKeyMappingFor(e);var r=this.doesEleInvalidateKey(e);return r&&this.invalidateKey(n),r||0===this.getNumberOfIdsForKey(n)}}]),e}(),jl={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Vl=Ke({getKey:null,doesEleInvalidateKey:ze,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fe,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gl=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var r=Vl(t);Y(n,r),n.lookup=new zl(r.getKey,r.doesEleInvalidateKey),n.setupDequeueing()},Yl=Gl.prototype;Yl.reasons=jl,Yl.getTextureQueue=function(e){var t=this;return t.eleImgCaches=t.eleImgCaches||{},t.eleImgCaches[e]=t.eleImgCaches[e]||[]},Yl.getRetiredTextureQueue=function(e){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[e]=t[e]||[]},Yl.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new st((function(e,t){return t.reqs-e.reqs}))},Yl.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},Yl.getElement=function(e,t,n,r,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!t||0===t.w||0===t.h||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed())return null;if(!o.allowEdgeTxrCaching&&e.isEdge()||!o.allowParentTxrCaching&&e.isParent())return null;if(null==r&&(r=Math.ceil(Tt(s*n))),r<-4)r=-4;else if(s>=7.99||r>3)return null;var u=Math.pow(2,r),c=t.h*u,d=t.w*u,h=a.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,h))return null;var p,f=l.get(e,r);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(p=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var g=o.getTextureQueue(p),v=g[g.length-2],y=function(){return o.recycleTexture(p,d)||o.addTexture(p,d)};v||(v=g[g.length-1]),v||(v=y()),v.width-v.usedWidthr;M--)T=o.getElement(e,t,n,M,jl.downscale);N()}else{var A;if(!x&&!w&&!E)for(var D=r-1;D>=-4;D--){var I=l.get(e,D);if(I){A=I;break}}if(b(A))return o.queueElement(e,r),A;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,e,t,h,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:r,scale:u,width:d,height:c,scaledLabelShown:h},v.usedWidth+=Math.ceil(d+8),v.eleCaches.push(f),l.set(e,r,f),o.checkTextureFullness(v),f},Yl.invalidateElements=function(e){for(var t=0;t=.2*e.width&&this.retireTexture(e)},Yl.checkTextureFullness=function(e){var t=this.getTextureQueue(e.height);e.usedWidth/e.width>.8&&e.fullnessChecks>=10?Ze(t,e):e.fullnessChecks++},Yl.retireTexture=function(e){var t=e.height,n=this.getTextureQueue(t),r=this.lookup;Ze(n,e),e.retired=!0;for(var i=e.eleCaches,o=0;o=t)return o.retired=!1,o.usedWidth=0,o.invalidatedWidth=0,o.fullnessChecks=0,$e(o.eleCaches),o.context.setTransform(1,0,0,1,0,0),o.context.clearRect(0,0,o.width,o.height),Ze(r,o),n.push(o),o}},Yl.queueElement=function(e,t){var n=this.getElementQueue(),r=this.getElementKeyToQueue(),i=this.getKey(e),o=r[i];if(o)o.level=Math.max(o.level,t),o.eles.merge(e),o.reqs++,n.updateItem(o);else{var a={eles:e.spawn().merge(e),level:t,reqs:1,key:i};n.push(a),r[i]=a}},Yl.dequeue=function(e){for(var t=this,n=t.getElementQueue(),r=t.getElementKeyToQueue(),i=[],o=t.lookup,a=0;a<1&&n.size()>0;a++){var s=n.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(r[l]=null,!c){i.push(s);var d=t.getBoundingBox(u);t.getElement(u,d,e,s.level,jl.dequeue)}}return i},Yl.removeFromQueue=function(e){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),r=this.getKey(e),i=n[r];null!=i&&(1===i.eles.length?(i.reqs=Be,t.updateItem(i),t.pop(),n[r]=null):i.eles.unmerge(e))},Yl.onDequeue=function(e){this.onDequeues.push(e)},Yl.offDequeue=function(e){Ze(this.onDequeues,e)},Yl.setupDequeueing=Fl({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n=3.99||n>2)return null;r.validateLayersElesOrdering(n,e);var a,s,l=r.layersByLevel,u=Math.pow(2,n),c=l[n]=l[n]||[];if(r.levelIsComplete(n,e))return c;!function(){var t=function(t){if(r.validateLayersElesOrdering(t,e),r.levelIsComplete(t,e))return s=l[t],!0},i=function(e){if(!s)for(var r=n+e;-4<=r&&r<=2&&!t(r);r+=e);};i(1),i(-1);for(var o=c.length-1;o>=0;o--){var a=c[o];a.invalid&&Ze(c,a)}}();var d=function(t){var i=(t=t||{}).after;!function(){if(!a){a=kt();for(var t=0;t32767||s>32767)return null;if(o*s>16e6)return null;var l=r.makeLayer(a,n);if(null!=i){var d=c.indexOf(i)+1;c.splice(d,0,l)}else(void 0===t.insert||t.insert)&&c.unshift(l);return l};if(r.skipping&&!o)return null;for(var h=null,p=e.length/1,f=!o,g=0;g=p||!Vt(h.bb,v.boundingBox()))&&!(h=d({insert:!0,after:h})))return null;s||f?r.queueLayer(h,v):r.drawEleInLayer(h,v,n,t),h.eles.push(v),m[n]=h}}return s||(f?null:c)},Xl.getEleLevelForLayerLevel=function(e,t){return e},Xl.drawEleInLayer=function(e,t,n,r){var i=this.renderer,o=e.context,a=t.boundingBox();0!==a.w&&0!==a.h&&t.visible()&&(n=this.getEleLevelForLayerLevel(n,r),i.setImgSmoothing(o,!1),i.drawCachedElement(o,t,null,null,n,!0),i.setImgSmoothing(o,!0))},Xl.levelIsComplete=function(e,t){var n=this.layersByLevel[e];if(!n||0===n.length)return!1;for(var r=0,i=0;i0)return!1;if(o.invalid)return!1;r+=o.eles.length}return r===t.length},Xl.validateLayersElesOrdering=function(e,t){var n=this.layersByLevel[e];if(n)for(var r=0;r0){e=!0;break}}return e},Xl.invalidateElements=function(e){var t=this;0!==e.length&&(t.lastInvalidationTime=_e(),0!==e.length&&t.haveLayers()&&t.updateElementsInLayers(e,(function(e,n,r){t.invalidateLayer(e)})))},Xl.invalidateLayer=function(e){if(this.lastInvalidationTime=_e(),!e.invalid){var t=e.level,n=e.eles,r=this.layersByLevel[t];Ze(r,e),e.elesQueue=[],e.invalid=!0,e.replacement&&(e.replacement.invalid=!0);for(var i=0;i3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=t._private.rscratch;if((!o||t.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;n&&(l=n,e.translate(-l.x1,-l.y1));var u=o?t.pstyle("opacity").value:1,c=o?t.pstyle("line-opacity").value:1,d=t.pstyle("curve-style").value,h=t.pstyle("line-style").value,p=t.pstyle("width").pfValue,f=t.pstyle("line-cap").value,g=t.pstyle("line-outline-width").value,v=t.pstyle("line-outline-color").value,y=u*c,m=u*c,b=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;"straight-triangle"===d?(a.eleStrokeStyle(e,t,n),a.drawEdgeTrianglePath(t,e,s.allpts)):(e.lineWidth=p,e.lineCap=f,a.eleStrokeStyle(e,t,n),a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")},x=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;a.drawArrowheads(e,t,n)};if(e.lineJoin="round","yes"===t.pstyle("ghost").value){var w=t.pstyle("ghost-offset-x").pfValue,E=t.pstyle("ghost-offset-y").pfValue,_=t.pstyle("ghost-opacity").value,C=y*_;e.translate(w,E),b(C),x(C),e.translate(-w,-E)}else!function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y;e.lineWidth=p+g,e.lineCap=f,g>0?(a.colorStrokeStyle(e,v[0],v[1],v[2],n),"straight-triangle"===d?a.drawEdgeTrianglePath(t,e,s.allpts):(a.drawEdgePath(t,e,s.allpts,h),e.lineCap="butt")):e.lineCap="butt"}();i&&a.drawEdgeUnderlay(e,t),b(),x(),i&&a.drawEdgeOverlay(e,t),a.drawElementText(e,t,null,r),n&&e.translate(l.x1,l.y1)}}},uu=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var r=n.pstyle("".concat(e,"-opacity")).value;if(0!==r){var i=this,o=i.usePaths(),a=n._private.rscratch,s=2*n.pstyle("".concat(e,"-padding")).pfValue,l=n.pstyle("".concat(e,"-color")).value;t.lineWidth=s,"self"!==a.edgeType||o?t.lineCap="round":t.lineCap="butt",i.colorStrokeStyle(t,l[0],l[1],l[2],r),i.drawEdgePath(n,t,a.allpts,"solid")}}}};lu.drawEdgeOverlay=uu("overlay"),lu.drawEdgeUnderlay=uu("underlay"),lu.drawEdgePath=function(e,t,n,r){var i,o=e._private.rscratch,a=t,s=!1,l=this.usePaths(),u=e.pstyle("line-dash-pattern").pfValue,c=e.pstyle("line-dash-offset").pfValue;if(l){var h=n.join("$");o.pathCacheKey&&o.pathCacheKey===h?(i=t=o.pathCache,s=!0):(i=t=new Path2D,o.pathCacheKey=h,o.pathCache=i)}if(a.setLineDash)switch(r){case"dotted":a.setLineDash([1,1]);break;case"dashed":a.setLineDash(u),a.lineDashOffset=c;break;case"solid":a.setLineDash([])}if(!s&&!o.badLine)switch(t.beginPath&&t.beginPath(),t.moveTo(n[0],n[1]),o.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var p=2;p+35&&void 0!==arguments[5]?arguments[5]:5,a=arguments.length>6?arguments[6]:void 0;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-o,n),e.quadraticCurveTo(t+r,n,t+r,n+o),e.lineTo(t+r,n+i-o),e.quadraticCurveTo(t+r,n+i,t+r-o,n+i),e.lineTo(t+o,n+i),e.quadraticCurveTo(t,n+i,t,n+i-o),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath(),a?e.stroke():e.fill()}du.eleTextBiggerThanMin=function(e,t){if(!t){var n=e.cy().zoom(),r=this.getPixelRatio(),i=Math.ceil(Tt(n*r));t=Math.pow(2,i)}return!(e.pstyle("font-size").pfValue*t5&&void 0!==arguments[5])||arguments[5],a=this;if(null==r){if(o&&!a.eleTextBiggerThanMin(t))return}else if(!1===r)return;if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(t);e.textAlign=l,e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine,c=t.pstyle("label"),d=t.pstyle("source-label"),h=t.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;e.textAlign="center",e.textBaseline="bottom"}var p,f=!n;n&&(p=n,e.translate(-p.x1,-p.y1)),null==i?(a.drawText(e,t,null,f,o),t.isEdge()&&(a.drawText(e,t,"source",f,o),a.drawText(e,t,"target",f,o))):a.drawText(e,t,i,f,o),n&&e.translate(p.x1,p.y1)},du.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var n=0;n2&&void 0!==arguments[2])||arguments[2],r=t.pstyle("font-style").strValue,i=t.pstyle("font-size").pfValue+"px",o=t.pstyle("font-family").strValue,a=t.pstyle("font-weight").strValue,s=n?t.effectiveOpacity()*t.pstyle("text-opacity").value:1,l=t.pstyle("text-outline-opacity").value*s,u=t.pstyle("color").value,c=t.pstyle("text-outline-color").value;e.font=r+" "+a+" "+i+" "+o,e.lineJoin="round",this.colorFillStyle(e,u[0],u[1],u[2],s),this.colorStrokeStyle(e,c[0],c[1],c[2],l)},du.getTextAngle=function(e,t){var n=e._private.rscratch,r=t?t+"-":"",i=e.pstyle(r+"text-rotation"),o=Qe(n,"labelAngle",t);return"autorotate"===i.strValue?e.isEdge()?o:0:"none"===i.strValue?0:i.pfValue},du.drawText=function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=t._private.rscratch,a=i?t.effectiveOpacity():1;if(!i||0!==a&&0!==t.pstyle("text-opacity").value){"main"===n&&(n=null);var s,l,u=Qe(o,"labelX",n),c=Qe(o,"labelY",n),d=this.getLabelText(t,n);if(null!=d&&""!==d&&!isNaN(u)&&!isNaN(c)){this.setupTextStyle(e,t,i);var h,p=n?n+"-":"",f=Qe(o,"labelWidth",n),g=Qe(o,"labelHeight",n),v=t.pstyle(p+"text-margin-x").pfValue,y=t.pstyle(p+"text-margin-y").pfValue,m=t.isEdge(),b=t.pstyle("text-halign").value,x=t.pstyle("text-valign").value;switch(m&&(b="center",x="center"),u+=v,c+=y,0!==(h=r?this.getTextAngle(t,n):0)&&(s=u,l=c,e.translate(s,l),e.rotate(h),u=0,c=0),x){case"top":break;case"center":c+=g/2;break;case"bottom":c+=g}var w=t.pstyle("text-background-opacity").value,E=t.pstyle("text-border-opacity").value,_=t.pstyle("text-border-width").pfValue,C=t.pstyle("text-background-padding").pfValue,T=0===t.pstyle("text-background-shape").strValue.indexOf("round");if(w>0||_>0&&E>0){var N=u-C;switch(b){case"left":N-=f;break;case"center":N-=f/2}var M=c-g-C,A=f+2*C,D=g+2*C;if(w>0){var I=e.fillStyle,O=t.pstyle("text-background-color").value;e.fillStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+w*a+")",T?hu(e,N,M,A,D,2):e.fillRect(N,M,A,D),e.fillStyle=I}if(_>0&&E>0){var P=e.strokeStyle,k=e.lineWidth,S=t.pstyle("text-border-color").value,L=t.pstyle("text-border-style").value;if(e.strokeStyle="rgba("+S[0]+","+S[1]+","+S[2]+","+E*a+")",e.lineWidth=_,e.setLineDash)switch(L){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=_/4,e.setLineDash([]);break;case"solid":e.setLineDash([])}if(T?hu(e,N,M,A,D,2,"stroke"):e.strokeRect(N,M,A,D),"double"===L){var R=_/2;T?hu(e,N+R,M+R,A-2*R,D-2*R,2,"stroke"):e.strokeRect(N+R,M+R,A-2*R,D-2*R)}e.setLineDash&&e.setLineDash([]),e.lineWidth=k,e.strokeStyle=P}}var B=2*t.pstyle("text-outline-width").pfValue;if(B>0&&(e.lineWidth=B),"wrap"===t.pstyle("text-wrap").value){var F=Qe(o,"labelWrapCachedLines",n),z=Qe(o,"labelLineHeight",n),j=f/2,V=this.getLabelJustification(t);switch("auto"===V||("left"===b?"left"===V?u+=-f:"center"===V&&(u+=-j):"center"===b?"left"===V?u+=-j:"right"===V&&(u+=j):"right"===b&&("center"===V?u+=j:"right"===V&&(u+=f))),x){case"top":case"center":case"bottom":c-=(F.length-1)*z}for(var G=0;G0&&e.strokeText(F[G],u,c),e.fillText(F[G],u,c),c+=z}else B>0&&e.strokeText(d,u,c),e.fillText(d,u,c);0!==h&&(e.rotate(-h),e.translate(-s,-l))}}};var pu={drawNode:function(e,t,n){var r,i,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],l=this,u=t._private,c=u.rscratch,d=t.position();if(_(d.x)&&_(d.y)&&(!s||t.visible())){var h,p,f=s?t.effectiveOpacity():1,g=l.usePaths(),v=!1,y=t.padding();r=t.width()+2*y,i=t.height()+2*y,n&&(p=n,e.translate(-p.x1,-p.y1));for(var m=t.pstyle("background-image").value,b=new Array(m.length),x=new Array(m.length),w=0,E=0;E0&&void 0!==arguments[0]?arguments[0]:A;l.eleFillStyle(e,t,n)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R;l.colorStrokeStyle(e,D[0],D[1],D[2],t)},X=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:j;l.colorStrokeStyle(e,F[0],F[1],F[2],t)},H=function(e,t,n,r){var i,o=l.nodePathCache=l.nodePathCache||[],a=Pe("polygon"===n?n+","+r.join(","):n,""+t,""+e,""+G),s=o[a],u=!1;return null!=s?(i=s,u=!0,c.pathCache=i):(i=new Path2D,o[a]=c.pathCache=i),{path:i,cacheHit:u}},W=t.pstyle("shape").strValue,q=t.pstyle("shape-polygon-points").pfValue;if(g){e.translate(d.x,d.y);var K=H(r,i,W,q);h=K.path,v=K.cacheHit}var Z=function(){if(!v){var n=d;g&&(n={x:0,y:0}),l.nodeShapes[l.getNodeShape(t)].draw(h||e,n.x,n.y,r,i,G,c)}g?e.fill(h):e.fill()},$=function(){for(var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=u.backgrounding,o=0,a=0;a0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f;l.hasPie(t)&&(l.drawPie(e,t,o),n&&(g||l.nodeShapes[l.getNodeShape(t)].draw(e,d.x,d.y,r,i,G,c)))},J=function(){var t=(N>0?N:-N)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:f),n=N>0?0:255;0!==N&&(l.colorFillStyle(e,n,n,n,t),g?e.fill(h):e.fill())},ee=function(){if(M>0){if(e.lineWidth=M,e.lineCap=P,e.lineJoin=O,e.setLineDash)switch(I){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(S),e.lineDashOffset=L;break;case"solid":case"double":e.setLineDash([])}if("center"!==k){if(e.save(),e.lineWidth*=2,"inside"===k)g?e.clip(h):e.clip();else{var t=new Path2D;t.rect(-r/2-M,-i/2-M,r+2*M,i+2*M),t.addPath(h),e.clip(t,"evenodd")}g?e.stroke(h):e.stroke(),e.restore()}else g?e.stroke(h):e.stroke();if("double"===I){e.lineWidth=M/3;var n=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",g?e.stroke(h):e.stroke(),e.globalCompositeOperation=n}e.setLineDash&&e.setLineDash([])}},te=function(){if(B>0){if(e.lineWidth=B,e.lineCap="butt",e.setLineDash)switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([])}var n=d;g&&(n={x:0,y:0});var o=l.getNodeShape(t),a=M;"inside"===k&&(a=0),"outside"===k&&(a*=2);var s,u=(r+a+(B+V))/r,c=(i+a+(B+V))/i,h=r*u,p=i*c,f=l.nodeShapes[o].points;if(g&&(s=H(h,p,o,f).path),"ellipse"===o)l.drawEllipsePath(s||e,n.x,n.y,h,p);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(o)){var v=0,y=0,m=0;"round-diamond"===o?v=1.4*(a+V+B):"round-heptagon"===o?(v=1.075*(a+V+B),m=-(a/2+V+B)/35):"round-hexagon"===o?v=1.12*(a+V+B):"round-pentagon"===o?(v=1.13*(a+V+B),m=-(a/2+V+B)/15):"round-tag"===o?(v=1.12*(a+V+B),y=.07*(a/2+B+V)):"round-triangle"===o&&(v=(a+V+B)*(Math.PI/2),m=-(a+V/2+B)/Math.PI),0!==v&&(h=r*(u=(r+v)/r),["round-hexagon","round-tag"].includes(o)||(p=i*(c=(i+v)/i)));for(var b=h/2,x=p/2,w=(G="auto"===G?ln(h,p):G)+(a+B+V)/2,E=new Array(f.length/2),_=new Array(f.length/2),C=0;C0){if(r=r||n.position(),null==i||null==o){var d=n.padding();i=n.width()+2*d,o=n.height()+2*d}this.colorFillStyle(t,l[0],l[1],l[2],s),this.nodeShapes[u].draw(t,r.x,r.y,i+2*a,o+2*a,c),t.fill()}}}};pu.drawNodeOverlay=fu("overlay"),pu.drawNodeUnderlay=fu("underlay"),pu.hasPie=function(e){return(e=e[0])._private.hasPie},pu.drawPie=function(e,t,n,r){t=t[0],r=r||t.position();var i=t.cy().style(),o=t.pstyle("pie-size"),a=r.x,s=r.y,l=t.width(),u=t.height(),c=Math.min(l,u)/2,d=0;this.usePaths()&&(a=0,s=0),"%"===o.units?c*=o.pfValue:void 0!==o.pfValue&&(c=o.pfValue/2);for(var h=1;h<=i.pieBackgroundN;h++){var p=t.pstyle("pie-"+h+"-background-size").value,f=t.pstyle("pie-"+h+"-background-color").value,g=t.pstyle("pie-"+h+"-background-opacity").value*n,v=p/100;v+d>1&&(v=1-d);var y=1.5*Math.PI+2*Math.PI*d,m=y+2*Math.PI*v;0===p||d>=1||d+v>1||(e.beginPath(),e.moveTo(a,s),e.arc(a,s,c,y,m),e.closePath(),this.colorFillStyle(e,f[0],f[1],f[2],g),e.fill(),d+=v)}};for(var gu={getPixelRatio:function(){var e=this.data.contexts[0];if(null!=this.forcedPixelRatio)return this.forcedPixelRatio;var t=this.cy.window(),n=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/n},paintCache:function(e){for(var t,n=this.paintCaches=this.paintCaches||[],r=!0,i=0;ia.minMbLowQualFrames&&(a.motionBlurPxRatio=a.mbPxRBlurry)),a.clearingMotionBlur&&(a.motionBlurPxRatio=1),a.textureDrawLastFrame&&!d&&(c[a.NODE]=!0,c[a.SELECT_BOX]=!0);var m=l.style(),b=l.zoom(),x=void 0!==i?i:b,w=l.pan(),E={x:w.x,y:w.y},_={zoom:b,pan:{x:w.x,y:w.y}},C=a.prevViewport;void 0===C||_.zoom!==C.zoom||_.pan.x!==C.pan.x||_.pan.y!==C.pan.y||g&&!f||(a.motionBlurPxRatio=1),o&&(E=o),x*=s,E.x*=s,E.y*=s;var T=a.getCachedZSortedEles();function N(e,t,n,r,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out",a.colorFillStyle(e,255,255,255,a.motionBlurTransparency),e.fillRect(t,n,r,i),e.globalCompositeOperation=o}function M(e,r){var s,l,c,d;a.clearingMotionBlur||e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]&&e!==u.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]?(s=E,l=x,c=a.canvasWidth,d=a.canvasHeight):(s={x:w.x*p,y:w.y*p},l=b*p,c=a.canvasWidth*p,d=a.canvasHeight*p),e.setTransform(1,0,0,1,0,0),"motionBlur"===r?N(e,0,0,c,d):t||void 0!==r&&!r||e.clearRect(0,0,c,d),n||(e.translate(s.x,s.y),e.scale(l,l)),o&&e.translate(o.x,o.y),i&&e.scale(i,i)}if(d||(a.textureDrawLastFrame=!1),d){if(a.textureDrawLastFrame=!0,!a.textureCache){a.textureCache={},a.textureCache.bb=l.mutableElements().boundingBox(),a.textureCache.texture=a.data.bufferCanvases[a.TEXTURE_BUFFER];var A=a.data.bufferContexts[a.TEXTURE_BUFFER];A.setTransform(1,0,0,1,0,0),A.clearRect(0,0,a.canvasWidth*a.textureMult,a.canvasHeight*a.textureMult),a.render({forcedContext:A,drawOnlyNodeLayer:!0,forcedPxRatio:s*a.textureMult}),(_=a.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:a.canvasWidth,height:a.canvasHeight}).mpan={x:(0-_.pan.x)/_.zoom,y:(0-_.pan.y)/_.zoom}}c[a.DRAG]=!1,c[a.NODE]=!1;var D=u.contexts[a.NODE],I=a.textureCache.texture;_=a.textureCache.viewport,D.setTransform(1,0,0,1,0,0),h?N(D,0,0,_.width,_.height):D.clearRect(0,0,_.width,_.height);var O=m.core("outside-texture-bg-color").value,P=m.core("outside-texture-bg-opacity").value;a.colorFillStyle(D,O[0],O[1],O[2],P),D.fillRect(0,0,_.width,_.height),b=l.zoom(),M(D,!1),D.clearRect(_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s),D.drawImage(I,_.mpan.x,_.mpan.y,_.width/_.zoom/s,_.height/_.zoom/s)}else a.textureOnViewport&&!t&&(a.textureCache=null);var k=l.extent(),S=a.pinching||a.hoverData.dragging||a.swipePanning||a.data.wheelZooming||a.hoverData.draggingEles||a.cy.animated(),L=a.hideEdgesOnViewport&&S,R=[];if(R[a.NODE]=!c[a.NODE]&&h&&!a.clearedForMotionBlur[a.NODE]||a.clearingMotionBlur,R[a.NODE]&&(a.clearedForMotionBlur[a.NODE]=!0),R[a.DRAG]=!c[a.DRAG]&&h&&!a.clearedForMotionBlur[a.DRAG]||a.clearingMotionBlur,R[a.DRAG]&&(a.clearedForMotionBlur[a.DRAG]=!0),c[a.NODE]||n||r||R[a.NODE]){var B=h&&!R[a.NODE]&&1!==p;M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_NODE]:u.contexts[a.NODE]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.nondrag,s,k):a.drawLayeredElements(D,T.nondrag,s,k),a.debug&&a.drawDebugPoints(D,T.nondrag),n||h||(c[a.NODE]=!1)}if(!r&&(c[a.DRAG]||n||R[a.DRAG])&&(B=h&&!R[a.DRAG]&&1!==p,M(D=t||(B?a.data.bufferContexts[a.MOTIONBLUR_BUFFER_DRAG]:u.contexts[a.DRAG]),h&&!B?"motionBlur":void 0),L?a.drawCachedNodes(D,T.drag,s,k):a.drawCachedElements(D,T.drag,s,k),a.debug&&a.drawDebugPoints(D,T.drag),n||h||(c[a.DRAG]=!1)),a.showFps||!r&&c[a.SELECT_BOX]&&!n){if(M(D=t||u.contexts[a.SELECT_BOX]),1==a.selection[4]&&(a.hoverData.selecting||a.touchData.selecting)){b=a.cy.zoom();var F=m.core("selection-box-border-width").value/b;D.lineWidth=F,D.fillStyle="rgba("+m.core("selection-box-color").value[0]+","+m.core("selection-box-color").value[1]+","+m.core("selection-box-color").value[2]+","+m.core("selection-box-opacity").value+")",D.fillRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]),F>0&&(D.strokeStyle="rgba("+m.core("selection-box-border-color").value[0]+","+m.core("selection-box-border-color").value[1]+","+m.core("selection-box-border-color").value[2]+","+m.core("selection-box-opacity").value+")",D.strokeRect(a.selection[0],a.selection[1],a.selection[2]-a.selection[0],a.selection[3]-a.selection[1]))}if(u.bgActivePosistion&&!a.hoverData.selecting){b=a.cy.zoom();var z=u.bgActivePosistion;D.fillStyle="rgba("+m.core("active-bg-color").value[0]+","+m.core("active-bg-color").value[1]+","+m.core("active-bg-color").value[2]+","+m.core("active-bg-opacity").value+")",D.beginPath(),D.arc(z.x,z.y,m.core("active-bg-size").pfValue/b,0,2*Math.PI),D.fill()}var j=a.lastRedrawTime;if(a.showFps&&j){j=Math.round(j);var V=Math.round(1e3/j);D.setTransform(1,0,0,1,0,0),D.fillStyle="rgba(255, 0, 0, 0.75)",D.strokeStyle="rgba(255, 0, 0, 0.75)",D.lineWidth=1,D.fillText("1 frame = "+j+" ms = "+V+" fps",0,20),D.strokeRect(0,30,250,20),D.fillRect(0,30,250*Math.min(V/60,1),20)}n||(c[a.SELECT_BOX]=!1)}if(h&&1!==p){var G=u.contexts[a.NODE],Y=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_NODE],U=u.contexts[a.DRAG],X=a.data.bufferCanvases[a.MOTIONBLUR_BUFFER_DRAG],H=function(e,t,n){e.setTransform(1,0,0,1,0,0),n||!y?e.clearRect(0,0,a.canvasWidth,a.canvasHeight):N(e,0,0,a.canvasWidth,a.canvasHeight);var r=p;e.drawImage(t,0,0,a.canvasWidth*r,a.canvasHeight*r,0,0,a.canvasWidth,a.canvasHeight)};(c[a.NODE]||R[a.NODE])&&(H(G,Y,R[a.NODE]),c[a.NODE]=!1),(c[a.DRAG]||R[a.DRAG])&&(H(U,X,R[a.DRAG]),c[a.DRAG]=!1)}a.prevViewport=_,a.clearingMotionBlur&&(a.clearingMotionBlur=!1,a.motionBlurCleared=!0,a.motionBlur=!0),h&&(a.motionBlurTimeout=setTimeout((function(){a.motionBlurTimeout=null,a.clearedForMotionBlur[a.NODE]=!1,a.clearedForMotionBlur[a.DRAG]=!1,a.motionBlur=!1,a.clearingMotionBlur=!d,a.mbFrames=0,c[a.NODE]=!0,c[a.DRAG]=!0,a.redraw()}),100)),t||l.emit("render")}},vu={drawPolygonPath:function(e,t,n,r,i,o){var a=r/2,s=i/2;e.beginPath&&e.beginPath(),e.moveTo(t+a*o[0],n+s*o[1]);for(var l=1;l0&&o>0){h.clearRect(0,0,i,o),h.globalCompositeOperation="source-over";var p=this.getCachedZSortedEles();if(e.full)h.translate(-n.x1*l,-n.y1*l),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(n.x1*l,n.y1*l);else{var f=t.pan(),g={x:f.x*l,y:f.y*l};l*=t.zoom(),h.translate(g.x,g.y),h.scale(l,l),this.drawElements(h,p),h.scale(1/l,1/l),h.translate(-g.x,-g.y)}e.bg&&(h.globalCompositeOperation="destination-over",h.fillStyle=e.bg,h.rect(0,0,i,o),h.fill())}return d},_u.png=function(e){return Tu(e,this.bufferCanvasImage(e),"image/png")},_u.jpg=function(e){return Tu(e,this.bufferCanvasImage(e),"image/jpeg")};var Nu=Au,Mu=Au.prototype;function Au(e){var t=this,n=t.cy.window().document;t.data={canvases:new Array(Mu.CANVAS_LAYERS),contexts:new Array(Mu.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Mu.CANVAS_LAYERS),bufferCanvases:new Array(Mu.BUFFER_COUNT),bufferContexts:new Array(Mu.CANVAS_LAYERS)};var r="-webkit-tap-highlight-color",i="rgba(0,0,0,0)";t.data.canvasContainer=n.createElement("div");var o=t.data.canvasContainer.style;t.data.canvasContainer.style[r]=i,o.position="relative",o.zIndex="0",o.overflow="hidden";var a=e.cy.container();a.appendChild(t.data.canvasContainer),a.style[r]=i;var s={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};p&&p.userAgent.match(/msie|trident|edge/i)&&(s["-ms-touch-action"]="none",s["touch-action"]="none");for(var l=0;l{e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822:(e,t,n)=>{"use strict";var r=n(6857),i=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?i(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},i={};return r.forEach(e.nodes(),(function o(a){r.has(i,a)||(i[a]=!0,n[a]=!0,r.forEach(e.outEdges(a),(function(e){r.has(n,e.w)?t.push(e):o(e.w)})),delete n[a])})),t}(e);r.forEach(t,(function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))}))},undo:function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}}))}}},135:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,r,o,a){var s={width:0,height:0,rank:a,borderType:t},l=o[t][a-1],u=i.addDummyNode(e,"border",s,n);o[t][a]=u,e.setParent(u,r),l&&e.setEdge(l,u,{weight:1})}e.exports=function(e){r.forEach(e.children(),(function t(n){var i=e.children(n),a=e.node(n);if(i.length&&r.forEach(i,t),r.has(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(var s=a.minRank,l=a.maxRank+1;s{"use strict";var r=n(6857);function i(e){r.forEach(e.nodes(),(function(t){o(e.node(t))})),r.forEach(e.edges(),(function(t){o(e.edge(t))}))}function o(e){var t=e.width;e.width=e.height,e.height=t}function a(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||i(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),(function(t){a(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,a),r.has(n,"y")&&a(n)}))}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),(function(t){s(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)}))}(e),i(e))}}},9859:e=>{function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909:(e,t,n)=>{var r=n(6857),i=n(3988),o=n(8191).Graph;e.exports={debugOrdering:function(e){var t=i.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),(function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)})),r.forEach(e.edges(),(function(e){n.setEdge(e.v,e.w,{},e.name)})),r.forEach(t,(function(e,t){var i="layer"+t;n.setNode(i,{rank:"same"}),r.reduce(e,(function(e,t){return n.setEdge(e,t,{style:"invis"}),t}))})),n}}},8191:(e,t,n)=>{var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031:(e,t,n)=>{var r=n(6857),i=n(8191).Graph,o=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new i,a=0,s=0;r.forEach(e.nodes(),(function(e){n.setNode(e,{v:e,in:0,out:0})})),r.forEach(e.edges(),(function(e){var r=n.edge(e.v,e.w)||0,i=t(e),o=r+i;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=i),a=Math.max(a,n.node(e.w).in+=i)}));var u=r.range(s+a+3).map((function(){return new o})),c=a+1;return r.forEach(n.nodes(),(function(e){l(u,c,n.node(e))})),{graph:n,buckets:u,zeroIdx:c}}(e,t||a),u=function(e,t,n){for(var r,i=[],o=t[t.length-1],a=t[0];e.nodeCount();){for(;r=a.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){i=i.concat(s(e,t,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(u,(function(t){return e.outEdges(t.v,t.w)})),!0)};var a=r.constant(1);function s(e,t,n,i,o){var a=o?[]:void 0;return r.forEach(e.inEdges(i.v),(function(r){var i=e.edge(r),s=e.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,l(t,n,s)})),r.forEach(e.outEdges(i.v),(function(r){var i=e.edge(r),o=r.w,a=e.node(o);a.in-=i,l(t,n,a)})),e.removeNode(i.v),a}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202:(e,t,n)=>{"use strict";var r=n(6857),i=n(6822),o=n(8209),a=n(9361),s=n(3988).normalizeRanks,l=n(2948),u=n(3988).removeEmptyRanks,c=n(6353),d=n(135),h=n(4850),p=n(1453),f=n(3776),g=n(3988),v=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?g.time:g.notime;n("layout",(function(){var t=n(" buildLayoutGraph",(function(){return function(e){var t=new v({multigraph:!0,compound:!0}),n=N(e.graph());return t.setGraph(r.merge({},m,T(n,y),r.pick(n,b))),r.forEach(e.nodes(),(function(n){var i=N(e.node(n));t.setNode(n,r.defaults(T(i,x),w)),t.setParent(n,e.parent(n))})),r.forEach(e.edges(),(function(n){var i=N(e.edge(n));t.setEdge(n,r.merge({},_,T(i,E),r.pick(i,C)))})),t}(e)}));n(" runLayout",(function(){!function(e,t){t(" makeSpaceForEdgeLabels",(function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),(function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(e)})),t(" removeSelfEdges",(function(){!function(e){r.forEach(e.edges(),(function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}}))}(e)})),t(" acyclic",(function(){i.run(e)})),t(" nestingGraph.run",(function(){c.run(e)})),t(" rank",(function(){a(g.asNonCompoundGraph(e))})),t(" injectEdgeLabelProxies",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};g.addDummyNode(e,"edge-proxy",i,"_ep")}}))}(e)})),t(" removeEmptyRanks",(function(){u(e)})),t(" nestingGraph.cleanup",(function(){c.cleanup(e)})),t(" normalizeRanks",(function(){s(e)})),t(" assignRankMinMax",(function(){!function(e){var t=0;r.forEach(e.nodes(),(function(n){var i=e.node(n);i.borderTop&&(i.minRank=e.node(i.borderTop).rank,i.maxRank=e.node(i.borderBottom).rank,t=r.max(t,i.maxRank))})),e.graph().maxRank=t}(e)})),t(" removeEdgeLabelProxies",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))}))}(e)})),t(" normalize.run",(function(){o.run(e)})),t(" parentDummyChains",(function(){l(e)})),t(" addBorderSegments",(function(){d(e)})),t(" order",(function(){p(e)})),t(" insertSelfEdges",(function(){!function(e){var t=g.buildLayerMatrix(e);r.forEach(t,(function(t){var n=0;r.forEach(t,(function(t,i){var o=e.node(t);o.order=i+n,r.forEach(o.selfEdges,(function(t){g.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:i+ ++n,e:t.e,label:t.label},"_se")})),delete o.selfEdges}))}))}(e)})),t(" adjustCoordinateSystem",(function(){h.adjust(e)})),t(" position",(function(){f(e)})),t(" positionSelfEdges",(function(){!function(e){r.forEach(e.nodes(),(function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(e)})),t(" removeBorderNodes",(function(){!function(e){r.forEach(e.nodes(),(function(t){if(e.children(t).length){var n=e.node(t),i=e.node(n.borderTop),o=e.node(n.borderBottom),a=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(e.nodes(),(function(t){"border"===e.node(t).dummy&&e.removeNode(t)}))}(e)})),t(" normalize.undo",(function(){o.undo(e)})),t(" fixupEdgeLabelCoords",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(e)})),t(" undoCoordinateSystem",(function(){h.undo(e)})),t(" translateGraph",(function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=e.graph(),s=a.marginx||0,l=a.marginy||0;function u(e){var r=e.x,a=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-l/2),o=Math.max(o,a+l/2)}r.forEach(e.nodes(),(function(t){u(e.node(t))})),r.forEach(e.edges(),(function(t){var n=e.edge(t);r.has(n,"x")&&u(n)})),t-=s,i-=l,r.forEach(e.nodes(),(function(n){var r=e.node(n);r.x-=t,r.y-=i})),r.forEach(e.edges(),(function(n){var o=e.edge(n);r.forEach(o.points,(function(e){e.x-=t,e.y-=i})),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=i)})),a.width=n-t+s,a.height=o-i+l}(e)})),t(" assignNodeIntersects",(function(){!function(e){r.forEach(e.edges(),(function(t){var n,r,i=e.edge(t),o=e.node(t.v),a=e.node(t.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(e)})),t(" reversePoints",(function(){!function(e){r.forEach(e.edges(),(function(t){var n=e.edge(t);n.reversed&&n.points.reverse()}))}(e)})),t(" acyclic.undo",(function(){i.undo(e)}))}(t,n)})),n(" updateInputGraph",(function(){!function(e,t){r.forEach(e.nodes(),(function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(e.edges(),(function(n){var i=e.edge(n),o=t.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],x=["width","height"],w={width:0,height:0},E=["minlen","weight","width","height","labeloffset"],_={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},C=["labelpos"];function T(e,t){return r.mapValues(r.pick(e,t),Number)}function N(e){var t={};return r.forEach(e,(function(e,n){t[n.toLowerCase()]=e})),t}},6857:(e,t,n)=>{var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(9754),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n,a,s,l,u){var c=e.children(u);if(c.length){var d=i.addBorderNode(e,"_bt"),h=i.addBorderNode(e,"_bb"),p=e.node(u);e.setParent(d,u),p.borderTop=d,e.setParent(h,u),p.borderBottom=h,r.forEach(c,(function(r){o(e,t,n,a,s,l,r);var i=e.node(r),c=i.borderTop?i.borderTop:r,p=i.borderBottom?i.borderBottom:r,f=i.borderTop?a:2*a,g=c!==p?1:s-l[u]+1;e.setEdge(d,c,{weight:f,minlen:g,nestingEdge:!0}),e.setEdge(p,h,{weight:f,minlen:g,nestingEdge:!0})})),e.parent(u)||e.setEdge(t,d,{weight:0,minlen:s+l[u]})}else u!==t&&e.setEdge(t,u,{weight:0,minlen:n})}e.exports={run:function(e){var t=i.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(i,o){var a=e.children(i);a&&a.length&&r.forEach(a,(function(e){n(e,o+1)})),t[i]=o}return r.forEach(e.children(),(function(e){n(e,1)})),t}(e),a=r.max(r.values(n))-1,s=2*a+1;e.graph().nestingRoot=t,r.forEach(e.edges(),(function(t){e.edge(t).minlen*=s}));var l=function(e){return r.reduce(e.edges(),(function(t,n){return t+e.edge(n).weight}),0)}(e)+1;r.forEach(e.children(),(function(r){o(e,t,s,l,a,n,r)})),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),(function(t){e.edge(t).nestingEdge&&e.removeEdge(t)}))}}},8209:(e,t,n)=>{"use strict";var r=n(6857),i=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),(function(t){!function(e,t){var n,r,o,a=t.v,s=e.node(a).rank,l=t.w,u=e.node(l).rank,c=t.name,d=e.edge(t),h=d.labelRank;if(u!==s+1){for(e.removeEdge(t),o=0,++s;s{var r=n(6857);e.exports=function(e,t,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=e.parent(n);s;){if((r=e.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void t.setEdge(a,s);s=r}}))}},3860:(e,t,n)=>{var r=n(6857);e.exports=function(e,t){return r.map(t,(function(t){var n=e.inEdges(t);if(n.length){var i=r.reduce(n,(function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}}),{sum:0,weight:0});return{v:t,barycenter:i.sum/i.weight,weight:i.weight}}return{v:t}}))}},7860:(e,t,n)=>{var r=n(6857),i=n(8191).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(t){return e.node(t)}));return r.forEach(e.nodes(),(function(i){var s=e.node(i),l=e.parent(i);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(a.setNode(i),a.setParent(i,l||o),r.forEach(e[n](i),(function(t){var n=t.v===i?t.w:t.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:e.edge(t).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))})),a}},6639:(e,t,n)=>{"use strict";var r=n(6857);function i(e,t,n){for(var i=r.zipObject(n,r.map(n,(function(e,t){return t}))),o=r.flatten(r.map(t,(function(t){return r.sortBy(r.map(e.outEdges(t),(function(t){return{pos:i[t.w],weight:e.edge(t).weight}})),"pos")})),!0),a=1;a0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;u+=e.weight*n}))),u}e.exports=function(e,t){for(var n=0,r=1;r{"use strict";var r=n(6857),i=n(8918),o=n(6639),a=n(4520),s=n(7860),l=n(4384),u=n(8191).Graph,c=n(3988);function d(e,t,n){return r.map(t,(function(t){return s(e,t,n)}))}function h(e,t){var n=new u;r.forEach(e,(function(e){var i=e.graph().root,o=a(e,i,n,t);r.forEach(o.vs,(function(t,n){e.node(t).order=n})),l(e,n,o.vs)}))}function p(e,t){r.forEach(t,(function(t){r.forEach(t,(function(t,n){e.node(t).order=n}))}))}e.exports=function(e){var t=c.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),a=d(e,r.range(t-1,-1,-1),"outEdges"),s=i(e);p(e,s);for(var l,u=Number.POSITIVE_INFINITY,f=0,g=0;g<4;++f,++g){h(f%2?n:a,f%4>=2),s=c.buildLayerMatrix(e);var v=o(e,s);v{"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),(function(t){return!e.children(t).length})),i=r.max(r.map(n,(function(t){return e.node(t).rank}))),o=r.map(r.range(i+1),(function(){return[]})),a=r.sortBy(n,(function(t){return e.node(t).rank}));return r.forEach(a,(function n(i){if(!r.has(t,i)){t[i]=!0;var a=e.node(i);o[a.rank].push(i),r.forEach(e.successors(i),n)}})),o}},4959:(e,t,n)=>{"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,(function(e,t){var i=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(i.barycenter=e.barycenter,i.weight=e.weight)})),r.forEach(t.edges(),(function(e){var t=n[e.v],i=n[e.w];r.isUndefined(t)||r.isUndefined(i)||(i.indegree++,t.out.push(n[e.w]))})),function(e){var t=[];function n(e){return function(t){var n,i,o,a;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(i=t,o=0,a=0,(n=e).weight&&(o+=n.barycenter*n.weight,a+=n.weight),i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),n.vs=i.vs.concat(n.vs),n.barycenter=o/a,n.weight=a,n.i=Math.min(i.i,n.i),i.merged=!0)}}function i(t){return function(n){n.in.push(t),0==--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(t,(function(e){return!e.merged})),(function(e){return r.pick(e,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(e){return!e.indegree})))}},4520:(e,t,n)=>{var r=n(6857),i=n(3860),o=n(4959),a=n(5169);e.exports=function e(t,n,s,l){var u=t.children(n),c=t.node(n),d=c?c.borderLeft:void 0,h=c?c.borderRight:void 0,p={};d&&(u=r.filter(u,(function(e){return e!==d&&e!==h})));var f=i(t,u);r.forEach(f,(function(n){if(t.children(n.v).length){var i=e(t,n.v,s,l);p[n.v]=i,r.has(i,"barycenter")&&(o=n,a=i,r.isUndefined(o.barycenter)?(o.barycenter=a.barycenter,o.weight=a.weight):(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight))}var o,a}));var g=o(f,s);!function(e,t){r.forEach(e,(function(e){e.vs=r.flatten(e.vs.map((function(e){return t[e]?t[e].vs:e})),!0)}))}(g,p);var v=a(g,l);if(d&&(v.vs=r.flatten([d,v.vs,h],!0),t.predecessors(d).length)){var y=t.node(t.predecessors(d)[0]),m=t.node(t.predecessors(h)[0]);r.has(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+y.order+m.order)/(v.weight+2),v.weight+=2}return v}},5169:(e,t,n)=>{var r=n(6857),i=n(3988);function o(e,t,n){for(var i;t.length&&(i=r.last(t)).i<=n;)t.pop(),e.push(i.vs),n++;return n}e.exports=function(e,t){var n,a=i.partition(e,(function(e){return r.has(e,"barycenter")})),s=a.lhs,l=r.sortBy(a.rhs,(function(e){return-e.i})),u=[],c=0,d=0,h=0;s.sort((n=!!t,function(e,t){return e.barycentert.barycenter?1:n?t.i-e.i:e.i-t.i})),h=o(u,l,h),r.forEach(s,(function(e){h+=e.vs.length,u.push(e.vs),c+=e.barycenter*e.weight,d+=e.weight,h=o(u,l,h)}));var p={vs:r.flatten(u,!0)};return d&&(p.barycenter=c/d,p.weight=d),p}},2948:(e,t,n)=>{var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),(function i(o){var a=n;r.forEach(e.children(o),i),t[o]={low:a,lim:n++}})),t}(e);r.forEach(e.graph().dummyChains,(function(n){for(var r=e.node(n),i=r.edgeObj,o=function(e,t,n,r){var i,o,a=[],s=[],l=Math.min(t[n].low,t[r].low),u=Math.max(t[n].lim,t[r].lim);i=n;do{i=e.parent(i),a.push(i)}while(i&&(t[i].low>l||u>t[i].lim));for(o=i,i=r;(i=e.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(e,t,i.v,i.w),a=o.path,s=o.lca,l=0,u=a[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=a[l])!==s&&e.node(u).maxRank{"use strict";var r=n(6857),i=n(8191).Graph,o=n(3988);function a(e,t){var n={};return r.reduce(t,(function(t,i){var o=0,a=0,s=t.length,u=r.last(i);return r.forEach(i,(function(t,c){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),(function(t){return e.node(t).dummy}))}(e,t),h=d?e.node(d).order:s;(d||t===u)&&(r.forEach(i.slice(a,c+1),(function(t){r.forEach(e.predecessors(t),(function(r){var i=e.node(r),a=i.order;!(as)&&l(n,t,u)}))}))}return r.reduce(t,(function(t,n){var o,a=-1,s=0;return r.forEach(n,(function(r,l){if("border"===e.node(r).dummy){var u=e.predecessors(r);u.length&&(o=e.node(u[0]).order,i(n,s,l,a,o),s=l,a=o)}i(n,s,n.length,o,t.length)})),n})),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function u(e,t,n){if(t>n){var i=t;t=n,n=i}return r.has(e[t],n)}function c(e,t,n,i){var o={},a={},s={};return r.forEach(t,(function(e){r.forEach(e,(function(e,t){o[e]=e,a[e]=e,s[e]=t}))})),r.forEach(t,(function(e){var t=-1;r.forEach(e,(function(e){var l=i(e);if(l.length){l=r.sortBy(l,(function(e){return s[e]}));for(var c=(l.length-1)/2,d=Math.floor(c),h=Math.ceil(c);d<=h;++d){var p=l[d];a[e]===e&&t{"use strict";var r=n(6857),i=n(3988),o=n(9741).positionX;e.exports=function(e){(function(e){var t=i.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,(function(t){var i=r.max(r.map(t,(function(t){return e.node(t).height})));r.forEach(t,(function(t){e.node(t).y=o+i/2})),o+=i+n}))})(e=i.asNonCompoundGraph(e)),r.forEach(o(e),(function(t,n){e.node(n).x=t}))}},8481:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph,o=n(8073).slack;function a(e,t){return r.forEach(e.nodes(),(function n(i){r.forEach(t.nodeEdges(i),(function(r){var a=r.v,s=i===a?r.w:a;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))}))})),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),(function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)}))}function l(e,t,n){r.forEach(e.nodes(),(function(e){t.node(e).rank+=n}))}e.exports=function(e){var t,n,r=new i({directed:!1}),u=e.nodes()[0],c=e.nodeCount();for(r.setNode(u,{});a(r,e){"use strict";var r=n(8073).longestPath,i=n(8481),o=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),i(e)}(e);break;case"longest-path":a(e)}};var a=r},6860:(e,t,n)=>{"use strict";var r=n(6857),i=n(8481),o=n(8073).slack,a=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,u=n(3988).simplify;function c(e){e=u(e),a(e);var t,n=i(e);for(p(n),d(n,e);t=g(n);)y(n,e,t,v(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,(function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=h(e,t,n)}(e,t,n)}))}function h(e,t,n){var i=e.node(n).parent,o=!0,a=t.edge(n,i),s=0;return a||(o=!1,a=t.edge(i,n)),s=a.weight,r.forEach(t.nodeEdges(n),(function(r){var a,l,u=r.v===n,c=u?r.w:r.v;if(c!==i){var d=u===o,h=t.edge(r).weight;if(s+=d?h:-h,a=n,l=c,e.hasEdge(a,l)){var p=e.edge(n,c).cutvalue;s+=d?-p:p}}})),s}function p(e,t){arguments.length<2&&(t=e.nodes()[0]),f(e,{},1,t)}function f(e,t,n,i,o){var a=n,s=e.node(i);return t[i]=!0,r.forEach(e.neighbors(i),(function(o){r.has(t,o)||(n=f(e,t,n,o,i))})),s.low=a,s.lim=n++,o?s.parent=o:delete s.parent,n}function g(e){return r.find(e.edges(),(function(t){return e.edge(t).cutvalue<0}))}function v(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var s=e.node(i),l=e.node(a),u=s,c=!1;s.lim>l.lim&&(u=l,c=!0);var d=r.filter(t.edges(),(function(t){return c===m(0,e.node(t.v),u)&&c!==m(0,e.node(t.w),u)}));return r.minBy(d,(function(e){return o(t,e)}))}function y(e,t,n,i){var o=n.v,a=n.w;e.removeEdge(o,a),e.setEdge(i.v,i.w,{}),p(e),d(e,t),function(e,t){var n=r.find(e.nodes(),(function(e){return!t.node(e).parent})),i=s(e,n);i=i.slice(1),r.forEach(i,(function(n){var r=e.node(n).parent,i=t.edge(n,r),o=!1;i||(i=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?i.minlen:-i.minlen)}))}(e,t)}function m(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=c,c.initLowLimValues=p,c.initCutValues=d,c.calcCutValue=h,c.leaveEdge=g,c.enterEdge=v,c.exchangeEdges=y},8073:(e,t,n)=>{"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),(function n(i){var o=e.node(i);if(r.has(t,i))return o.rank;t[i]=!0;var a=r.min(r.map(e.outEdges(i),(function(t){return n(t.w)-e.edge(t).minlen})));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a}))},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988:(e,t,n)=>{"use strict";var r=n(6857),i=n(8191).Graph;function o(e,t,n,i){var o;do{o=r.uniqueId(i)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function a(e){return r.max(r.map(e.nodes(),(function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n})))}e.exports={addDummyNode:o,simplify:function(e){var t=(new i).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),t},asNonCompoundGraph:function(e){var t=new i({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),(function(n){e.children(n).length||t.setNode(n,e.node(n))})),r.forEach(e.edges(),(function(n){t.setEdge(n,e.edge(n))})),t},successorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.outEdges(t),(function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),(function(t){var n={};return r.forEach(e.inEdges(t),(function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight})),n}));return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,i=e.x,o=e.y,a=t.x-i,s=t.y-o,l=e.width/2,u=e.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(a)*u?(s<0&&(u=-u),n=u*a/s,r=u):(a<0&&(l=-l),n=l,r=l*s/a),{x:i+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(a(e)+1),(function(){return[]}));return r.forEach(e.nodes(),(function(n){var i=e.node(n),o=i.rank;r.isUndefined(o)||(t[o][i.order]=n)})),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank})));r.forEach(e.nodes(),(function(n){var i=e.node(n);r.has(i,"rank")&&(i.rank-=t)}))},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),(function(t){return e.node(t).rank}))),n=[];r.forEach(e.nodes(),(function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=e.graph().nodeRankFactor;r.forEach(n,(function(t,n){r.isUndefined(t)&&n%o!=0?--i:i&&r.forEach(t,(function(t){e.node(t).rank+=i}))}))},addBorderNode:function(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),o(e,"border",i,t)},maxRank:a,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,(function(e){t(e)?n.lhs.push(e):n.rhs.push(e)})),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038:e=>{e.exports="0.8.5"},8362:(e,t,n)=>{var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619:(e,t,n)=>{var r=n(117);e.exports=function(e){var t,n={},i=[];function o(i){r.has(n,i)||(n[i]=!0,t.push(i),r.each(e.successors(i),o),r.each(e.predecessors(i),o))}return r.each(e.nodes(),(function(e){t=[],o(e),t.length&&i.push(t)})),i}},9276:(e,t,n)=>{var r=n(117);function i(e,t,n,o,a,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(a(t),(function(t){i(e,t,n,o,a,s)})),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),a=[],s={};return r.each(t,(function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);i(e,t,"post"===n,s,o,a)})),a}},4919:(e,t,n)=>{var r=n(8905),i=n(117);e.exports=function(e,t,n){return i.transform(e.nodes(),(function(i,o){i[o]=r(e,o,t,n)}),{})}},8905:(e,t,n)=>{var r=n(117),i=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,a,s={},l=new i,u=function(e){var t=e.v!==o?e.v:e.w,r=s[t],i=n(e),u=a.distance+i;if(i<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+i);u0&&(o=l.removeMin(),(a=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(u);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6678:(e,t,n)=>{var r=n(117),i=n(6291);e.exports=function(e){return r.filter(i(e),(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])}))}},3590:(e,t,n)=>{var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},i=e.nodes();return i.forEach((function(e){r[e]={},r[e][e]={distance:0},i.forEach((function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})})),n(e).forEach((function(n){var i=n.v===e?n.w:n.v,o=t(n);r[e][i]={distance:o,predecessor:e}}))})),i.forEach((function(e){var t=r[e];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[e],i=t[n],a=o[n],s=r.distance+i.distance;s{e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(9888)}},498:(e,t,n)=>{var r=n(9888);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016:(e,t,n)=>{var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423:(e,t,n)=>{var r=n(117),i=n(6454),o=n(1737);e.exports=function(e,t){var n,a=new i,s={},l=new o;function u(e){var r=e.v===n?e.w:e.v,i=l.priority(r);if(void 0!==i){var o=t(e);o0;){if(n=l.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(c)throw new Error("Input graph is not connected: "+e);c=!0}e.nodeEdges(n).forEach(u)}return a}},6291:(e,t,n)=>{var r=n(117);e.exports=function(e){var t=0,n=[],i={},o=[];function a(s){var l=i[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach((function(e){r.has(i,e)?i[e].onStack&&(l.lowlink=Math.min(l.lowlink,i[e].index)):(a(e),l.lowlink=Math.min(l.lowlink,i[e].lowlink))})),l.lowlink===l.index){var u,c=[];do{u=n.pop(),i[u].onStack=!1,c.push(u)}while(s!==u);o.push(c)}}return e.nodes().forEach((function(e){r.has(i,e)||a(e)})),o}},9888:(e,t,n)=>{var r=n(117);function i(e){var t={},n={},i=[];if(r.each(e.sinks(),(function a(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),a),delete n[s],i.push(s))})),r.size(t)!==e.nodeCount())throw new o;return i}function o(){}e.exports=i,i.CycleException=o,o.prototype=new Error},1737:(e,t,n)=>{var r=n(117);function i(){this._arr=[],this._keyIndices={}}e.exports=i,i.prototype.size=function(){return this._arr.length},i.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},i.prototype.has=function(e){return r.has(this._keyIndices,e)},i.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},i.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},i.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var i=this._arr,o=i.length;return n[e]=o,i.push({key:e,priority:t}),this._decrease(o),!0}return!1},i.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},i.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},i.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,i=e;n>1].priority{"use strict";var r=n(117);e.exports=s;var i="\0",o="\0",a="";function s(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[o]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function l(e,t){e[t]?e[t]++:e[t]=1}function u(e,t){--e[t]||delete e[t]}function c(e,t,n,o){var s=""+t,l=""+n;if(!e&&s>l){var u=s;s=l,l=u}return s+a+l+a+(r.isUndefined(o)?i:o)}function d(e,t){return c(e,t.v,t.w,t.name)}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(e){return this._label=e,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return r.keys(this._nodes)},s.prototype.sources=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._in[t])}))},s.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),(function(t){return r.isEmpty(e._out[t])}))},s.prototype.setNodes=function(e,t){var n=arguments,i=this;return r.each(e,(function(e){n.length>1?i.setNode(e,t):i.setNode(e)})),this},s.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=o,this._children[e]={},this._children[o][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},s.prototype.node=function(e){return this._nodes[e]},s.prototype.hasNode=function(e){return r.has(this._nodes,e)},s.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),(function(e){t.setParent(e)})),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},s.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=o;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},s.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},s.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==o)return t}},s.prototype.children=function(e){if(r.isUndefined(e)&&(e=o),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===o)return this.nodes();if(this.hasNode(e))return[]}},s.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},s.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},s.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},s.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},s.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,(function(n,r){e(r)&&t.setNode(r,n)})),r.each(this._edgeObjs,(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))}));var i={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(i[e]=r,r):r in i?i[r]:o(r)}return this._isCompound&&r.each(t.nodes(),(function(e){t.setParent(e,o(e))})),t},s.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return r.values(this._edgeObjs)},s.prototype.setPath=function(e,t){var n=this,i=arguments;return r.reduce(e,(function(e,r){return i.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r})),this},s.prototype.setEdge=function(){var e,t,n,i,o=!1,a=arguments[0];"object"==typeof a&&null!==a&&"v"in a?(e=a.v,t=a.w,n=a.name,2===arguments.length&&(i=arguments[1],o=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var s=c(this._isDirected,e,t,n);if(r.has(this._edgeLabels,s))return o&&(this._edgeLabels[s]=i),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[s]=u,l(this._preds[t],e),l(this._sucs[e],t),this._in[t][s]=u,this._out[e][s]=u,this._edgeCount++,this},s.prototype.edge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return this._edgeLabels[r]},s.prototype.hasEdge=function(e,t,n){var i=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n);return r.has(this._edgeLabels,i)},s.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?d(this._isDirected,arguments[0]):c(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],u(this._preds[t],e),u(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},s.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.v===t})):i}},s.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var i=r.values(n);return t?r.filter(i,(function(e){return e.w===t})):i}},s.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166:(e,t,n)=>{e.exports={Graph:n(6454),version:n(4458)}},7494:(e,t,n)=>{var r=n(117),i=n(6454);function o(e){return r.map(e.nodes(),(function(t){var n=e.node(t),i=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(i)||(o.parent=i),o}))}function a(e){return r.map(e.edges(),(function(t){var n=e.edge(t),i={v:t.v,w:t.w};return r.isUndefined(t.name)||(i.name=t.name),r.isUndefined(n)||(i.value=n),i}))}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:a(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new i(e.options).setGraph(e.value);return r.each(e.nodes,(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)})),r.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),t}}},117:(e,t,n)=>{var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458:e=>{e.exports="2.1.8"},3143:function(e){var t;t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){"use strict";function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(8),o=n(9);function a(e,t,n){r.call(this,n),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=n,this.bendpoints=[],this.source=e,this.target=t}for(var s in a.prototype=Object.create(r.prototype),r)a[s]=r[s];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(e){if(this.source===e)return this.target;if(this.target===e)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(e,t){for(var n=this.getOtherEnd(e),r=t.getGraphManager().getRoot();;){if(n.getOwner()==t)return n;if(n.getOwner()==r)break;n=n.getOwner().getParent()}return null},a.prototype.updateLength=function(){var e=new Array(4);this.isOverlapingSourceAndTarget=i.getIntersection(this.target.getRect(),this.source.getRect(),e),this.isOverlapingSourceAndTarget||(this.lengthX=e[0]-e[2],this.lengthY=e[1]-e[3],Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=o.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=o.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},e.exports=a},function(e,t,n){"use strict";e.exports=function(e){this.vGraphObject=e}},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(13),a=n(0),s=n(16),l=n(5);function u(e,t,n,a){null==n&&null==a&&(a=t),r.call(this,a),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=i.MIN_VALUE,this.inclusionTreeDepth=i.MAX_VALUE,this.vGraphObject=a,this.edges=[],this.graphManager=e,this.rect=null!=n&&null!=t?new o(t.x,t.y,n.width,n.height):new o}for(var c in u.prototype=Object.create(r.prototype),r)u[c]=r[c];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(e){this.rect.width=e},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(e){this.rect.height=e},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(e,t){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=t.width,this.rect.height=t.height},u.prototype.setCenter=function(e,t){this.rect.x=e-this.rect.width/2,this.rect.y=t-this.rect.height/2},u.prototype.setLocation=function(e,t){this.rect.x=e,this.rect.y=t},u.prototype.moveBy=function(e,t){this.rect.x+=e,this.rect.y+=t},u.prototype.getEdgeListToNode=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.target==e){if(r.source!=n)throw"Incorrect edge source!";t.push(r)}})),t},u.prototype.getEdgesBetween=function(e){var t=[],n=this;return n.edges.forEach((function(r){if(r.source!=n&&r.target!=n)throw"Incorrect edge source and/or target";r.target!=e&&r.source!=e||t.push(r)})),t},u.prototype.getNeighborsList=function(){var e=new Set,t=this;return t.edges.forEach((function(n){if(n.source==t)e.add(n.target);else{if(n.target!=t)throw"Incorrect incidency!";e.add(n.source)}})),e},u.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var t=this.child.getNodes(),n=0;nt?(this.rect.x-=(this.labelWidth-t)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(t+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(n+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>n?(this.rect.y-=(this.labelHeight-n)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(n+this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==i.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(e){var t=this.rect.x;t>a.WORLD_BOUNDARY?t=a.WORLD_BOUNDARY:t<-a.WORLD_BOUNDARY&&(t=-a.WORLD_BOUNDARY);var n=this.rect.y;n>a.WORLD_BOUNDARY?n=a.WORLD_BOUNDARY:n<-a.WORLD_BOUNDARY&&(n=-a.WORLD_BOUNDARY);var r=new l(t,n),i=e.inverseTransformPoint(r);this.setLocation(i.x,i.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},e.exports=u},function(e,t,n){"use strict";var r=n(0);function i(){}for(var o in r)i[o]=r[o];i.MAX_ITERATIONS=2500,i.DEFAULT_EDGE_LENGTH=50,i.DEFAULT_SPRING_STRENGTH=.45,i.DEFAULT_REPULSION_STRENGTH=4500,i.DEFAULT_GRAVITY_STRENGTH=.4,i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,i.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,i.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,i.COOLING_ADAPTATION_FACTOR=.33,i.ADAPTATION_LOWER_NODE_LIMIT=1e3,i.ADAPTATION_UPPER_NODE_LIMIT=5e3,i.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,i.MAX_NODE_DISPLACEMENT=3*i.MAX_NODE_DISPLACEMENT_INCREMENTAL,i.MIN_REPULSION_DIST=i.DEFAULT_EDGE_LENGTH/10,i.CONVERGENCE_CHECK_PERIOD=100,i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,i.MIN_EDGE_LENGTH=1,i.GRID_CALCULATION_CHECK_PERIOD=10,e.exports=i},function(e,t,n){"use strict";function r(e,t){null==e&&null==t?(this.x=0,this.y=0):(this.x=e,this.y=t)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(e){this.x=e},r.prototype.setY=function(e){this.y=e},r.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},e.exports=r},function(e,t,n){"use strict";var r=n(2),i=n(10),o=n(0),a=n(7),s=n(3),l=n(1),u=n(13),c=n(12),d=n(11);function h(e,t,n){r.call(this,n),this.estimatedSize=i.MIN_VALUE,this.margin=o.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=e,null!=t&&t instanceof a?this.graphManager=t:null!=t&&t instanceof Layout&&(this.graphManager=t.graphManager)}for(var p in h.prototype=Object.create(r.prototype),r)h[p]=r[p];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(e,t,n){if(null==t&&null==n){var r=e;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(r)>-1)throw"Node already in graph!";return r.owner=this,this.getNodes().push(r),r}var i=e;if(!(this.getNodes().indexOf(t)>-1&&this.getNodes().indexOf(n)>-1))throw"Source or target not in graph!";if(t.owner!=n.owner||t.owner!=this)throw"Both owners must be this graph!";return t.owner!=n.owner?null:(i.source=t,i.target=n,i.isInterGraph=!1,this.getEdges().push(i),t.edges.push(i),n!=t&&n.edges.push(i),i)},h.prototype.remove=function(e){var t=e;if(e instanceof s){if(null==t)throw"Node is null!";if(null==t.owner||t.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var n=t.edges.slice(),r=n.length,i=0;i-1&&c>-1))throw"Source and/or target doesn't know this edge!";if(o.source.edges.splice(u,1),o.target!=o.source&&o.target.edges.splice(c,1),-1==(a=o.source.owner.getEdges().indexOf(o)))throw"Not in owner's edge list!";o.source.owner.getEdges().splice(a,1)}},h.prototype.updateLeftTop=function(){for(var e,t,n,r=i.MAX_VALUE,o=i.MAX_VALUE,a=this.getNodes(),s=a.length,l=0;l(e=u.getTop())&&(r=e),o>(t=u.getLeft())&&(o=t)}return r==i.MAX_VALUE?null:(n=null!=a[0].getParent().paddingLeft?a[0].getParent().paddingLeft:this.margin,this.left=o-n,this.top=r-n,new c(this.left,this.top))},h.prototype.updateBounds=function(e){for(var t,n,r,o,a,s=i.MAX_VALUE,l=-i.MAX_VALUE,c=i.MAX_VALUE,d=-i.MAX_VALUE,h=this.nodes,p=h.length,f=0;f(t=g.getLeft())&&(s=t),l<(n=g.getRight())&&(l=n),c>(r=g.getTop())&&(c=r),d<(o=g.getBottom())&&(d=o)}var v=new u(s,c,l-s,d-c);s==i.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),a=null!=h[0].getParent().paddingLeft?h[0].getParent().paddingLeft:this.margin,this.left=v.x-a,this.right=v.x+v.width+a,this.top=v.y-a,this.bottom=v.y+v.height+a},h.calculateBounds=function(e){for(var t,n,r,o,a=i.MAX_VALUE,s=-i.MAX_VALUE,l=i.MAX_VALUE,c=-i.MAX_VALUE,d=e.length,h=0;h(t=p.getLeft())&&(a=t),s<(n=p.getRight())&&(s=n),l>(r=p.getTop())&&(l=r),c<(o=p.getBottom())&&(c=o)}return new u(a,l,s-a,c-l)},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==i.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var e=0,t=this.nodes,n=t.length,r=0;r=this.nodes.length){var l=0;i.forEach((function(t){t.owner==e&&l++})),l==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},e.exports=h},function(e,t,n){"use strict";var r,i=n(1);function o(e){r=n(6),this.layout=e,this.graphs=[],this.edges=[]}o.prototype.addRoot=function(){var e=this.layout.newGraph(),t=this.layout.newNode(null),n=this.add(e,t);return this.setRootGraph(n),this.rootGraph},o.prototype.add=function(e,t,n,r,i){if(null==n&&null==r&&null==i){if(null==e)throw"Graph is null!";if(null==t)throw"Parent node is null!";if(this.graphs.indexOf(e)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(e),null!=e.parent)throw"Already has a parent!";if(null!=t.child)throw"Already has a child!";return e.parent=t,t.child=e,e}i=n,n=e;var o=(r=t).getOwner(),a=i.getOwner();if(null==o||o.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==a||a.getGraphManager()!=this)throw"Target not in this graph mgr!";if(o==a)return n.isInterGraph=!1,o.add(n,r,i);if(n.isInterGraph=!0,n.source=r,n.target=i,this.edges.indexOf(n)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(n),null==n.source||null==n.target)throw"Edge source and/or target is null!";if(-1!=n.source.edges.indexOf(n)||-1!=n.target.edges.indexOf(n))throw"Edge already in source and/or target incidency list!";return n.source.edges.push(n),n.target.edges.push(n),n},o.prototype.remove=function(e){if(e instanceof r){var t=e;if(t.getGraphManager()!=this)throw"Graph not in this graph mgr";if(t!=this.rootGraph&&(null==t.parent||t.parent.graphManager!=this))throw"Invalid parent node!";for(var n,o=[],a=(o=o.concat(t.getEdges())).length,s=0;s=t.getRight()?n[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight()):t.getX()<=e.getX()&&t.getRight()>=e.getRight()&&(n[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())),e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()?n[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom()):t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()&&(n[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom()));var o=Math.abs((t.getCenterY()-e.getCenterY())/(t.getCenterX()-e.getCenterX()));t.getCenterY()===e.getCenterY()&&t.getCenterX()===e.getCenterX()&&(o=1);var a=o*n[0],s=n[1]/o;n[0]a)return n[0]=r,n[1]=l,n[2]=o,n[3]=b,!1;if(io)return n[0]=s,n[1]=i,n[2]=y,n[3]=a,!1;if(ro?(n[0]=c,n[1]=d,_=!0):(n[0]=u,n[1]=l,_=!0):T===M&&(r>o?(n[0]=s,n[1]=l,_=!0):(n[0]=h,n[1]=d,_=!0)),-N===M?o>r?(n[2]=m,n[3]=b,C=!0):(n[2]=y,n[3]=v,C=!0):N===M&&(o>r?(n[2]=g,n[3]=v,C=!0):(n[2]=x,n[3]=b,C=!0)),_&&C)return!1;if(r>o?i>a?(A=this.getCardinalDirection(T,M,4),D=this.getCardinalDirection(N,M,2)):(A=this.getCardinalDirection(-T,M,3),D=this.getCardinalDirection(-N,M,1)):i>a?(A=this.getCardinalDirection(-T,M,1),D=this.getCardinalDirection(-N,M,3)):(A=this.getCardinalDirection(T,M,2),D=this.getCardinalDirection(N,M,4)),!_)switch(A){case 1:O=l,I=r+-f/M,n[0]=I,n[1]=O;break;case 2:I=h,O=i+p*M,n[0]=I,n[1]=O;break;case 3:O=d,I=r+f/M,n[0]=I,n[1]=O;break;case 4:I=c,O=i+-p*M,n[0]=I,n[1]=O}if(!C)switch(D){case 1:k=v,P=o+-E/M,n[2]=P,n[3]=k;break;case 2:P=x,k=a+w*M,n[2]=P,n[3]=k;break;case 3:k=b,P=o+E/M,n[2]=P,n[3]=k;break;case 4:P=m,k=a+-w*M,n[2]=P,n[3]=k}}return!1},i.getCardinalDirection=function(e,t,n){return e>t?n:1+n%4},i.getIntersection=function(e,t,n,i){if(null==i)return this.getIntersection2(e,t,n);var o,a,s,l,u,c,d,h=e.x,p=e.y,f=t.x,g=t.y,v=n.x,y=n.y,m=i.x,b=i.y;return 0==(d=(o=g-p)*(l=v-m)-(a=b-y)*(s=h-f))?null:new r((s*(c=m*y-v*b)-l*(u=f*p-h*g))/d,(a*u-o*c)/d)},i.angleOfVector=function(e,t,n,r){var i=void 0;return e!==n?(i=Math.atan((r-t)/(n-e)),n=0){var c=(-l+Math.sqrt(l*l-4*s*u))/(2*s),d=(-l-Math.sqrt(l*l-4*s*u))/(2*s);return c>=0&&c<=1?[c]:d>=0&&d<=1?[d]:null}return null},i.HALF_PI=.5*Math.PI,i.ONE_AND_HALF_PI=1.5*Math.PI,i.TWO_PI=2*Math.PI,i.THREE_PI=3*Math.PI,e.exports=i},function(e,t,n){"use strict";function r(){}r.sign=function(e){return e>0?1:e<0?-1:0},r.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},r.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},e.exports=r},function(e,t,n){"use strict";function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&t;){for(s.push(u[0]);s.length>0&&t;){var c=s[0];s.splice(0,1),a.add(c);var d=c.getEdges();for(o=0;o-1&&u.splice(g,1)}a=new Set,l=new Map}else e=[]}return e},h.prototype.createDummyNodesForBendpoints=function(e){for(var t=[],n=e.source,r=this.graphManager.calcLowestCommonAncestor(e.source,e.target),i=0;i0){for(var i=this.edgeToDummyNodes.get(n),o=0;o=0&&t.splice(d,1),c.getNeighborsList().forEach((function(e){if(n.indexOf(e)<0){var t=r.get(e)-1;1==t&&l.push(e),r.set(e,t)}}))}n=n.concat(l),1!=t.length&&2!=t.length||(i=!0,o=t[0])}return o},h.prototype.setGraphManager=function(e){this.graphManager=e},e.exports=h},function(e,t,n){"use strict";function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=1e4*Math.sin(r.seed++),r.x-Math.floor(r.x)},e.exports=r},function(e,t,n){"use strict";var r=n(5);function i(e,t){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}i.prototype.getWorldOrgX=function(){return this.lworldOrgX},i.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},i.prototype.getWorldOrgY=function(){return this.lworldOrgY},i.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},i.prototype.getWorldExtX=function(){return this.lworldExtX},i.prototype.setWorldExtX=function(e){this.lworldExtX=e},i.prototype.getWorldExtY=function(){return this.lworldExtY},i.prototype.setWorldExtY=function(e){this.lworldExtY=e},i.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},i.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},i.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},i.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},i.prototype.getDeviceExtX=function(){return this.ldeviceExtX},i.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},i.prototype.getDeviceExtY=function(){return this.ldeviceExtY},i.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},i.prototype.transformX=function(e){var t=0,n=this.lworldExtX;return 0!=n&&(t=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/n),t},i.prototype.transformY=function(e){var t=0,n=this.lworldExtY;return 0!=n&&(t=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/n),t},i.prototype.inverseTransformX=function(e){var t=0,n=this.ldeviceExtX;return 0!=n&&(t=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/n),t},i.prototype.inverseTransformY=function(e){var t=0,n=this.ldeviceExtY;return 0!=n&&(t=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/n),t},i.prototype.inverseTransformPoint=function(e){return new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y))},e.exports=i},function(e,t,n){"use strict";var r=n(15),i=n(4),o=n(0),a=n(8),s=n(9);function l(){r.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}for(var u in l.prototype=Object.create(r.prototype),r)l[u]=r[u];l.prototype.initParameters=function(){r.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},l.prototype.calcIdealEdgeLengths=function(){for(var e,t,n,r,a,s,l,u=this.getGraphManager().getAllEdges(),c=0;ci.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(e-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},l.prototype.calcSpringForces=function(){for(var e,t=this.getAllEdges(),n=0;n0&&void 0!==arguments[0])||arguments[0],s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&a&&this.updateGrid(),o=new Set,e=0;e(l=t.getEstimatedSize()*this.gravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i,e.gravitationForceY=-this.gravityConstant*o):(a>(l=t.getEstimatedSize()*this.compoundGravityRangeFactor)||s>l)&&(e.gravitationForceX=-this.gravityConstant*i*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant)},l.prototype.isConverged=function(){var e,t=!1;return this.totalIterations>this.maxIterations/3&&(t=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement=s.length||u>=s[0].length))for(var c=0;ce}}]),e}();e.exports=o},function(e,t,n){"use strict";function r(){}r.svd=function(e){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=e.length,this.n=e[0].length;var t=Math.min(this.m,this.n);this.s=function(e){for(var t=[];e-- >0;)t.push(0);return t}(Math.min(this.m+1,this.n)),this.U=function e(t){if(0==t.length)return 0;for(var n=[],r=0;r0;)t.push(0);return t}(this.n),a=function(e){for(var t=[];e-- >0;)t.push(0);return t}(this.m),s=Math.min(this.m-1,this.n),l=Math.max(0,Math.min(this.n-2,this.m)),u=0;u=0;D--)if(0!==this.s[D]){for(var I=D+1;I=0;B--){if(function(e,t){return e&&t}(B0;){var H=void 0,W=void 0;for(H=N-2;H>=-1&&-1!==H;H--)if(Math.abs(o[H])<=X+U*(Math.abs(this.s[H])+Math.abs(this.s[H+1]))){o[H]=0;break}if(H===N-2)W=4;else{var q=void 0;for(q=N-1;q>=H&&q!==H;q--){var K=(q!==N?Math.abs(o[q]):0)+(q!==H+1?Math.abs(o[q-1]):0);if(Math.abs(this.s[q])<=X+U*K){this.s[q]=0;break}}q===H?W=3:q===N-1?W=1:(W=2,H=q)}switch(H++,W){case 1:var Z=o[N-2];o[N-2]=0;for(var $=N-2;$>=H;$--){var Q=r.hypot(this.s[$],Z),J=this.s[$]/Q,ee=Z/Q;this.s[$]=Q,$!==H&&(Z=-ee*o[$-1],o[$-1]=J*o[$-1]);for(var te=0;te=this.s[H+1]);){var Ne=this.s[H];if(this.s[H]=this.s[H+1],this.s[H+1]=Ne,HMath.abs(t)?(n=t/e,n=Math.abs(e)*Math.sqrt(1+n*n)):0!=t?(n=e/t,n=Math.abs(t)*Math.sqrt(1+n*n)):n=0,n},e.exports=r},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sequence1=t,this.sequence2=n,this.match_score=r,this.mismatch_penalty=i,this.gap_penalty=o,this.iMax=t.length+1,this.jMax=n.length+1,this.grid=new Array(this.iMax);for(var a=0;a=0;n--){var r=this.listeners[n];r.event===e&&r.callback===t&&this.listeners.splice(n,1)}},i.emit=function(e,t){for(var n=0;n{var r=n(6110)(n(9325),"DataView");e.exports=r},1549:(e,t,n)=>{var r=n(2032),i=n(3862),o=n(6721),a=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(3702),i=n(80),o=n(4739),a=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Map");e.exports=r},3661:(e,t,n)=>{var r=n(3040),i=n(7670),o=n(289),a=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t{var r=n(6110)(n(9325),"Promise");e.exports=r},6545:(e,t,n)=>{var r=n(6110)(n(9325),"Set");e.exports=r},8859:(e,t,n)=>{var r=n(3661),i=n(1380),o=n(1459);function a(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t{var r=n(79),i=n(1420),o=n(938),a=n(3605),s=n(9817),l=n(945);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=i,u.prototype.delete=o,u.prototype.get=a,u.prototype.has=s,u.prototype.set=l,e.exports=u},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},7828:(e,t,n)=>{var r=n(9325).Uint8Array;e.exports=r},8303:(e,t,n)=>{var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033:e=>{e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n{var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905:e=>{e.exports=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r{var r=n(8096),i=n(2428),o=n(6449),a=n(3656),s=n(361),l=n(7167),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),c=!n&&i(e),d=!n&&!c&&a(e),h=!n&&!c&&!d&&l(e),p=n||c||d||h,f=p?r(e.length,String):[],g=f.length;for(var v in e)!t&&!u.call(e,v)||p&&("length"==v||d&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,g))||f.push(v);return f}},4932:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n{e.exports=function(e,t){for(var n=-1,r=t.length,i=e.length;++n{e.exports=function(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n{var r=n(7237)("length");e.exports=r},7805:(e,t,n)=>{var r=n(3360),i=n(5288);e.exports=function(e,t,n){(void 0!==n&&!i(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547:(e,t,n)=>{var r=n(3360),i=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var a=e[t];o.call(e,t)&&i(a,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025:(e,t,n)=>{var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733:(e,t,n)=>{var r=n(1791),i=n(5950);e.exports=function(e,t){return e&&r(t,i(t),e)}},3838:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e,t){return e&&r(t,i(t),e)}},3360:(e,t,n)=>{var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999:(e,t,n)=>{var r=n(7217),i=n(3729),o=n(6547),a=n(4733),s=n(3838),l=n(3290),u=n(3007),c=n(2271),d=n(8948),h=n(2),p=n(3349),f=n(5861),g=n(6189),v=n(7199),y=n(5529),m=n(6449),b=n(3656),x=n(7730),w=n(3805),E=n(8440),_=n(5950),C=n(7241),T="[object Arguments]",N="[object Function]",M="[object Object]",A={};A[T]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[M]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[N]=A["[object WeakMap]"]=!1,e.exports=function e(t,n,D,I,O,P){var k,S=1&n,L=2&n,R=4&n;if(D&&(k=O?D(t,I,O,P):D(t)),void 0!==k)return k;if(!w(t))return t;var B=m(t);if(B){if(k=g(t),!S)return u(t,k)}else{var F=f(t),z=F==N||"[object GeneratorFunction]"==F;if(b(t))return l(t,S);if(F==M||F==T||z&&!O){if(k=L||z?{}:y(t),!S)return L?d(t,s(k,t)):c(t,a(k,t))}else{if(!A[F])return O?t:{};k=v(t,F,S)}}P||(P=new r);var j=P.get(t);if(j)return j;P.set(t,k),E(t)?t.forEach((function(r){k.add(e(r,n,D,r,t,P))})):x(t)&&t.forEach((function(r,i){k.set(i,e(r,n,D,i,t,P))}));var V=B?void 0:(R?L?p:h:L?C:_)(t);return i(V||t,(function(r,i){V&&(r=t[i=r]),o(k,i,e(r,n,D,i,t,P))})),k}},9344:(e,t,n)=>{var r=n(3805),i=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(i)return i(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909:(e,t,n)=>{var r=n(641),i=n(8329)(r);e.exports=i},3599:(e,t,n)=>{var r=n(4394);e.exports=function(e,t,n){for(var i=-1,o=e.length;++i{var r=n(909);e.exports=function(e,t){var n=[];return r(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}},2523:e=>{e.exports=function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o{var r=n(4528),i=n(5891);e.exports=function e(t,n,o,a,s){var l=-1,u=t.length;for(o||(o=i),s||(s=[]);++l0&&o(c)?n>1?e(c,n-1,o,a,s):r(s,c):a||(s[s.length]=c)}return s}},6649:(e,t,n)=>{var r=n(3221)();e.exports=r},641:(e,t,n)=>{var r=n(6649),i=n(5950);e.exports=function(e,t){return e&&r(e,t,i)}},7422:(e,t,n)=>{var r=n(1769),i=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n{var r=n(4528),i=n(6449);e.exports=function(e,t,n){var o=t(e);return i(e)?o:r(o,n(e))}},2552:(e,t,n)=>{var r=n(1873),i=n(659),o=n(9350),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},3335:e=>{e.exports=function(e,t){return e>t}},426:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},6131:(e,t,n)=>{var r=n(2523),i=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,i,n)}},7534:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return i(e)&&"[object Arguments]"==r(e)}},270:(e,t,n)=>{var r=n(7068),i=n(346);e.exports=function e(t,n,o,a,s){return t===n||(null==t||null==n||!i(t)&&!i(n)?t!=t&&n!=n:r(t,n,o,a,e,s))}},7068:(e,t,n)=>{var r=n(7217),i=n(5911),o=n(1986),a=n(689),s=n(5861),l=n(6449),u=n(3656),c=n(7167),d="[object Arguments]",h="[object Array]",p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,g,v,y){var m=l(e),b=l(t),x=m?h:s(e),w=b?h:s(t),E=(x=x==d?p:x)==p,_=(w=w==d?p:w)==p,C=x==w;if(C&&u(e)){if(!u(t))return!1;m=!0,E=!1}if(C&&!E)return y||(y=new r),m||c(e)?i(e,t,n,g,v,y):o(e,t,x,n,g,v,y);if(!(1&n)){var T=E&&f.call(e,"__wrapped__"),N=_&&f.call(t,"__wrapped__");if(T||N){var M=T?e.value():e,A=N?t.value():t;return y||(y=new r),v(M,A,n,g,y)}}return!!C&&(y||(y=new r),a(e,t,n,g,v,y))}},9172:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Map]"==r(e)}},1799:(e,t,n)=>{var r=n(7217),i=n(270);e.exports=function(e,t,n,o){var a=n.length,s=a,l=!o;if(null==e)return!s;for(e=Object(e);a--;){var u=n[a];if(l&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++a{e.exports=function(e){return e!=e}},5083:(e,t,n)=>{var r=n(1882),i=n(7296),o=n(3805),a=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,h=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(r(e)?h:s).test(a(e))}},6038:(e,t,n)=>{var r=n(5861),i=n(346);e.exports=function(e){return i(e)&&"[object Set]"==r(e)}},4901:(e,t,n)=>{var r=n(2552),i=n(294),o=n(346),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[r(e)]}},5389:(e,t,n)=>{var r=n(3663),i=n(7978),o=n(3488),a=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):r(e):s(e)}},8984:(e,t,n)=>{var r=n(5527),i=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return i(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903:(e,t,n)=>{var r=n(3805),i=n(5527),o=n(181),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=i(e),n=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&n.push(s);return n}},6176:e=>{e.exports=function(e,t){return e{var r=n(909),i=n(4894);e.exports=function(e,t){var n=-1,o=i(e)?Array(e.length):[];return r(e,(function(e,r,i){o[++n]=t(e,r,i)})),o}},3663:(e,t,n)=>{var r=n(1799),i=n(776),o=n(7197);e.exports=function(e){var t=i(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978:(e,t,n)=>{var r=n(270),i=n(8156),o=n(631),a=n(8586),s=n(756),l=n(7197),u=n(7797);e.exports=function(e,t){return a(e)&&s(t)?l(u(e),t):function(n){var a=i(n,e);return void 0===a&&a===t?o(n,e):r(t,a,3)}}},5250:(e,t,n)=>{var r=n(7217),i=n(7805),o=n(6649),a=n(2824),s=n(3805),l=n(7241),u=n(4974);e.exports=function e(t,n,c,d,h){t!==n&&o(n,(function(o,l){if(h||(h=new r),s(o))a(t,n,l,c,e,d,h);else{var p=d?d(u(t,l),o,l+"",t,n,h):void 0;void 0===p&&(p=o),i(t,l,p)}}),l)}},2824:(e,t,n)=>{var r=n(7805),i=n(3290),o=n(1961),a=n(3007),s=n(5529),l=n(2428),u=n(6449),c=n(3693),d=n(3656),h=n(1882),p=n(3805),f=n(1331),g=n(7167),v=n(4974),y=n(9884);e.exports=function(e,t,n,m,b,x,w){var E=v(e,n),_=v(t,n),C=w.get(_);if(C)r(e,n,C);else{var T=x?x(E,_,n+"",e,t,w):void 0,N=void 0===T;if(N){var M=u(_),A=!M&&d(_),D=!M&&!A&&g(_);T=_,M||A||D?u(E)?T=E:c(E)?T=a(E):A?(N=!1,T=i(_,!0)):D?(N=!1,T=o(_,!0)):T=[]:f(_)||l(_)?(T=E,l(E)?T=y(E):p(E)&&!h(E)||(T=s(_))):N=!1}N&&(w.set(_,T),b(T,_,m,x,w),w.delete(_)),r(e,n,T)}}},6155:(e,t,n)=>{var r=n(4932),i=n(7422),o=n(5389),a=n(5128),s=n(3937),l=n(7301),u=n(3714),c=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,(function(e){return d(e)?function(t){return i(t,1===e.length?e[0]:e)}:e})):[c];var h=-1;t=r(t,l(o));var p=a(e,(function(e,n,i){return{criteria:r(t,(function(t){return t(e)})),index:++h,value:e}}));return s(p,(function(e,t){return u(e,t,n)}))}},6001:(e,t,n)=>{var r=n(7420),i=n(631);e.exports=function(e,t){return r(e,t,(function(t,n){return i(e,n)}))}},7420:(e,t,n)=>{var r=n(7422),i=n(3170),o=n(1769);e.exports=function(e,t,n){for(var a=-1,s=t.length,l={};++a{e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255:(e,t,n)=>{var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151:e=>{var t=Math.ceil,n=Math.max;e.exports=function(e,r,i,o){for(var a=-1,s=n(t((r-e)/(i||1)),0),l=Array(s);s--;)l[o?s:++a]=e,e+=i;return l}},5558:e=>{e.exports=function(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}},9302:(e,t,n)=>{var r=n(3488),i=n(6757),o=n(2865);e.exports=function(e,t){return o(i(e,t,r),e+"")}},3170:(e,t,n)=>{var r=n(6547),i=n(1769),o=n(361),a=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!a(e))return e;for(var u=-1,c=(t=i(t,e)).length,d=c-1,h=e;null!=h&&++u{var r=n(7334),i=n(3243),o=n(3488),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=a},3937:e=>{e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n{var r=n(1873),i=n(4932),o=n(6449),a=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return i(t,e)+"";if(a(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},7301:e=>{e.exports=function(e){return function(t){return e(t)}}},5765:(e,t,n)=>{var r=n(8859),i=n(5325),o=n(9905),a=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var u=-1,c=i,d=e.length,h=!0,p=[],f=p;if(n)h=!1,c=o;else if(d>=200){var g=t?null:s(e);if(g)return l(g);h=!1,c=a,f=new r}else f=t?[]:p;e:for(;++u{var r=n(4932);e.exports=function(e,t){return r(t,(function(t){return e[t]}))}},1234:e=>{e.exports=function(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r{e.exports=function(e,t){return e.has(t)}},4066:(e,t,n)=>{var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769:(e,t,n)=>{var r=n(6449),i=n(8586),o=n(1802),a=n(3222);e.exports=function(e,t){return r(e)?e:i(e,t)?[e]:o(a(e))}},9653:(e,t,n)=>{var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i?r.Buffer:void 0,s=a?a.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201:e=>{var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736:(e,t,n)=>{var r=n(1873),i=r?r.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961:(e,t,n)=>{var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730:(e,t,n)=>{var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,i=null===e,o=e==e,a=r(e),s=void 0!==t,l=null===t,u=t==t,c=r(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||i&&s&&u||!n&&u||!o)return 1;if(!i&&!a&&!c&&e{var r=n(3730);e.exports=function(e,t,n){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,l=n.length;++i=l?u:u*("desc"==n[i]?-1:1)}return e.index-t.index}},3007:e=>{e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n{var r=n(6547),i=n(3360);e.exports=function(e,t,n,o){var a=!n;n||(n={});for(var s=-1,l=t.length;++s{var r=n(1791),i=n(4664);e.exports=function(e,t){return r(e,i(e),t)}},8948:(e,t,n)=>{var r=n(1791),i=n(6375);e.exports=function(e,t){return r(e,i(e),t)}},5481:(e,t,n)=>{var r=n(9325)["__core-js_shared__"];e.exports=r},999:(e,t,n)=>{var r=n(9302),i=n(6800);e.exports=function(e){return r((function(t,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++r{var r=n(4894);e.exports=function(e,t){return function(n,i){if(null==n)return n;if(!r(n))return e(n,i);for(var o=n.length,a=t?o:-1,s=Object(n);(t?a--:++a{e.exports=function(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}},2006:(e,t,n)=>{var r=n(5389),i=n(4894),o=n(5950);e.exports=function(e){return function(t,n,a){var s=Object(t);if(!i(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var u=e(t,n,a);return u>-1?s[l?t[u]:u]:void 0}}},5508:(e,t,n)=>{var r=n(6151),i=n(6800),o=n(7400);e.exports=function(e){return function(t,n,a){return a&&"number"!=typeof a&&i(t,n,a)&&(n=a=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),a=void 0===a?t{var r=n(6545),i=n(3950),o=n(4247),a=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:i;e.exports=a},3243:(e,t,n)=>{var r=n(6110),i=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},5911:(e,t,n)=>{var r=n(8859),i=n(4248),o=n(9219);e.exports=function(e,t,n,a,s,l){var u=1&n,c=e.length,d=t.length;if(c!=d&&!(u&&d>c))return!1;var h=l.get(e),p=l.get(t);if(h&&p)return h==t&&p==e;var f=-1,g=!0,v=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++f{var r=n(1873),i=n(7828),o=n(5288),a=n(5911),s=n(317),l=n(4247),u=r?r.prototype:void 0,c=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,d,h){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new i(e),new i(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var p=s;case"[object Set]":var f=1&r;if(p||(p=l),e.size!=t.size&&!f)return!1;var g=h.get(e);if(g)return g==t;r|=2,h.set(e,t);var v=a(p(e),p(t),r,u,d,h);return h.delete(e),v;case"[object Symbol]":if(c)return c.call(e)==c.call(t)}return!1}},689:(e,t,n)=>{var r=n(2),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,a,s){var l=1&n,u=r(e),c=u.length;if(c!=r(t).length&&!l)return!1;for(var d=c;d--;){var h=u[d];if(!(l?h in t:i.call(t,h)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var v=l;++d{var r=n(5970),i=n(6757),o=n(2865);e.exports=function(e){return o(i(e,void 0,r),e+"")}},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},2:(e,t,n)=>{var r=n(2199),i=n(4664),o=n(5950);e.exports=function(e){return r(e,o,i)}},3349:(e,t,n)=>{var r=n(2199),i=n(6375),o=n(7241);e.exports=function(e){return r(e,o,i)}},2651:(e,t,n)=>{var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776:(e,t,n)=>{var r=n(756),i=n(5950);e.exports=function(e){for(var t=i(e),n=t.length;n--;){var o=t[n],a=e[o];t[n]=[o,a,r(a)]}return t}},6110:(e,t,n)=>{var r=n(5083),i=n(392);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},8879:(e,t,n)=>{var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var i=a.call(e);return r&&(t?e[s]=n:delete e[s]),i}},4664:(e,t,n)=>{var r=n(9770),i=n(3345),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,s=a?function(e){return null==e?[]:(e=Object(e),r(a(e),(function(t){return o.call(e,t)})))}:i;e.exports=s},6375:(e,t,n)=>{var r=n(4528),i=n(8879),o=n(4664),a=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:a;e.exports=s},5861:(e,t,n)=>{var r=n(5580),i=n(8223),o=n(2804),a=n(6545),s=n(8303),l=n(2552),u=n(7473),c="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",g=u(r),v=u(i),y=u(o),m=u(a),b=u(s),x=l;(r&&x(new r(new ArrayBuffer(1)))!=f||i&&x(new i)!=c||o&&x(o.resolve())!=d||a&&x(new a)!=h||s&&x(new s)!=p)&&(x=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case g:return f;case v:return c;case y:return d;case m:return h;case b:return p}return t}),e.exports=x},392:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},9326:(e,t,n)=>{var r=n(1769),i=n(2428),o=n(6449),a=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var u=-1,c=(t=r(t,e)).length,d=!1;++u{var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032:(e,t,n)=>{var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return i.call(t,e)?t[e]:void 0}},2749:(e,t,n)=>{var r=n(1042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:i.call(t,e)}},5749:(e,t,n)=>{var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199:(e,t,n)=>{var r=n(9653),i=n(6169),o=n(3201),a=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return i(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return a(e)}}},5529:(e,t,n)=>{var r=n(9344),i=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(i(e))}},5891:(e,t,n)=>{var r=n(1873),i=n(2428),o=n(6449),a=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||i(e)||!!(a&&e&&e[a])}},361:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e{var r=n(5288),i=n(4894),o=n(361),a=n(3805);e.exports=function(e,t,n){if(!a(n))return!1;var s=typeof t;return!!("number"==s?i(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586:(e,t,n)=>{var r=n(6449),i=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296:(e,t,n)=>{var r,i=n(5481),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756:(e,t,n)=>{var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702:e=>{e.exports=function(){this.__data__=[],this.size=0}},80:(e,t,n)=>{var r=n(6025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():i.call(t,n,1),--this.size,0))}},4739:(e,t,n)=>{var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655:(e,t,n)=>{var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175:(e,t,n)=>{var r=n(6025);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},3040:(e,t,n)=>{var r=n(1549),i=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},7670:(e,t,n)=>{var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509:(e,t,n)=>{var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949:(e,t,n)=>{var r=n(2651);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},317:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},7197:e=>{e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224:(e,t,n)=>{var r=n(104);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},1042:(e,t,n)=>{var r=n(6110)(Object,"create");e.exports=r},3650:(e,t,n)=>{var r=n(4335)(Object.keys,Object);e.exports=r},181:e=>{e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009:(e,t,n)=>{e=n.nmd(e);var r=n(4840),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},6757:(e,t,n)=>{var r=n(1033),i=Math.max;e.exports=function(e,t,n){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),l=Array(s);++a{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},4974:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459:e=>{e.exports=function(e){return this.__data__.has(e)}},4247:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},2865:(e,t,n)=>{var r=n(9570),i=n(1811)(r);e.exports=i},1811:e=>{var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var i=t(),o=16-(i-r);if(r=i,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420:(e,t,n)=>{var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605:e=>{e.exports=function(e){return this.__data__.get(e)}},9817:e=>{e.exports=function(e){return this.__data__.has(e)}},945:(e,t,n)=>{var r=n(79),i=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},6959:e=>{e.exports=function(e,t,n){for(var r=n-1,i=e.length;++r{var r=n(9811),i=n(9698),o=n(7927);e.exports=function(e){return i(e)?o(e):r(e)}},1802:(e,t,n)=>{var r=n(2224),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,a=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,n,r,i){t.push(r?i.replace(o,"$1"):n||e)})),t}));e.exports=a},7797:(e,t,n)=>{var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927:e=>{var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",i="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",a="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+i+")?",u="[\\ufe0e\\ufe0f]?",c=u+l+"(?:\\u200d(?:"+[o,a,s].join("|")+")"+u+l+")*",d="(?:"+[o+r+"?",r,a,s,n].join("|")+")",h=RegExp(i+"(?="+i+")|"+d+c,"g");e.exports=function(e){for(var t=h.lastIndex=0;h.test(e);)++t;return t}},2629:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,4)}},8055:(e,t,n)=>{var r=n(9999);e.exports=function(e){return r(e,5)}},7334:e=>{e.exports=function(e){return function(){return e}}},4684:(e,t,n)=>{var r=n(9302),i=n(5288),o=n(6800),a=n(7241),s=Object.prototype,l=s.hasOwnProperty,u=r((function(e,t){e=Object(e);var n=-1,r=t.length,u=r>2?t[2]:void 0;for(u&&o(t[0],t[1],u)&&(r=1);++n{e.exports=n(9754)},5288:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},7612:(e,t,n)=>{var r=n(9770),i=n(6574),o=n(5389),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t,3))}},7309:(e,t,n)=>{var r=n(2006)(n(4713));e.exports=r},4713:(e,t,n)=>{var r=n(2523),i=n(5389),o=n(1489),a=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=a(s+l,0)),r(e,i(t,3),l)}},5970:(e,t,n)=>{var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},9754:(e,t,n)=>{var r=n(3729),i=n(909),o=n(4066),a=n(6449);e.exports=function(e,t){return(a(e)?r:i)(e,o(t))}},2420:(e,t,n)=>{var r=n(6649),i=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,i(t),o)}},8156:(e,t,n)=>{var r=n(7422);e.exports=function(e,t,n){var i=null==e?void 0:r(e,t);return void 0===i?n:i}},1448:(e,t,n)=>{var r=n(426),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},631:(e,t,n)=>{var r=n(8077),i=n(9326);e.exports=function(e,t){return null!=e&&i(e,t,r)}},3488:e=>{e.exports=function(e){return e}},2428:(e,t,n)=>{var r=n(7534),i=n(346),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449:e=>{var t=Array.isArray;e.exports=t},4894:(e,t,n)=>{var r=n(1882),i=n(294);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},3693:(e,t,n)=>{var r=n(4894),i=n(346);e.exports=function(e){return i(e)&&r(e)}},3656:(e,t,n)=>{e=n.nmd(e);var r=n(9325),i=n(9935),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},2193:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(2428),a=n(6449),s=n(4894),l=n(3656),u=n(5527),c=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1882:(e,t,n)=>{var r=n(2552),i=n(3805);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730:(e,t,n)=>{var r=n(9172),i=n(7301),o=n(6009),a=o&&o.isMap,s=a?i(a):r;e.exports=s},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},1331:(e,t,n)=>{var r=n(2552),i=n(8879),o=n(346),a=Function.prototype,s=Object.prototype,l=a.toString,u=s.hasOwnProperty,c=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=i(e);if(null===t)return!0;var n=u.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==c}},8440:(e,t,n)=>{var r=n(6038),i=n(7301),o=n(6009),a=o&&o.isSet,s=a?i(a):r;e.exports=s},5015:(e,t,n)=>{var r=n(2552),i=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!i(e)&&o(e)&&"[object String]"==r(e)}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7167:(e,t,n)=>{var r=n(4901),i=n(7301),o=n(6009),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},2216:e=>{e.exports=function(e){return void 0===e}},5950:(e,t,n)=>{var r=n(695),i=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):i(e)}},7241:(e,t,n)=>{var r=n(695),i=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):i(e)}},8090:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378:(e,t,n)=>{var r=n(4932),i=n(5389),o=n(5128),a=n(6449);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},3916:(e,t,n)=>{var r=n(3360),i=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),i(e,(function(e,i,o){r(n,i,t(e,i,o))})),n}},4506:(e,t,n)=>{var r=n(3599),i=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},104:(e,t,n)=>{var r=n(3661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(i.Cache||r),n}i.Cache=r,e.exports=i},5364:(e,t,n)=>{var r=n(5250),i=n(999)((function(e,t,n){r(e,t,n)}));e.exports=i},1684:(e,t,n)=>{var r=n(3599),i=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,i):void 0}},6533:(e,t,n)=>{var r=n(3599),i=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,i(t,2),o):void 0}},3950:e=>{e.exports=function(){}},124:(e,t,n)=>{var r=n(9325);e.exports=function(){return r.Date.now()}},4383:(e,t,n)=>{var r=n(6001),i=n(8816)((function(e,t){return null==e?{}:r(e,t)}));e.exports=i},583:(e,t,n)=>{var r=n(7237),i=n(7255),o=n(8586),a=n(7797);e.exports=function(e){return o(e)?r(a(e)):i(e)}},3181:(e,t,n)=>{var r=n(5508)();e.exports=r},860:(e,t,n)=>{var r=n(882),i=n(909),o=n(5389),a=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:a,u=arguments.length<3;return l(e,o(t,4),n,u,i)}},7091:(e,t,n)=>{var r=n(8984),i=n(5861),o=n(4894),a=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return a(e)?s(e):e.length;var t=i(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},3031:(e,t,n)=>{var r=n(3120),i=n(6155),o=n(9302),a=n(6800),s=o((function(e,t){if(null==e)return[];var n=t.length;return n>1&&a(e,t[0],t[1])?t=[]:n>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),i(e,r(t,1),[])}));e.exports=s},3345:e=>{e.exports=function(){return[]}},9935:e=>{e.exports=function(){return!1}},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),o=n(4394),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?u(e.slice(2),n?2:8):a.test(e)?NaN:+e}},9884:(e,t,n)=>{var r=n(1791),i=n(7241);e.exports=function(e){return r(e,i(e))}},3222:(e,t,n)=>{var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752:(e,t,n)=>{var r=n(3729),i=n(9344),o=n(641),a=n(5389),s=n(8879),l=n(6449),u=n(3656),c=n(1882),d=n(3805),h=n(7167);e.exports=function(e,t,n){var p=l(e),f=p||u(e)||h(e);if(t=a(t,4),null==n){var g=e&&e.constructor;n=f?p?new g:[]:d(e)&&c(g)?i(s(e)):{}}return(f?r:o)(e,(function(e,r,i){return t(n,e,r,i)})),n}},299:(e,t,n)=>{var r=n(3120),i=n(9302),o=n(5765),a=n(3693),s=i((function(e){return o(r(e,1,a,!0))}));e.exports=s},7200:(e,t,n)=>{var r=n(3222),i=0;e.exports=function(e){var t=++i;return r(e)+t}},5880:(e,t,n)=>{var r=n(514),i=n(5950);e.exports=function(e){return null==e?[]:r(e,i(e))}},7248:(e,t,n)=>{var r=n(6547),i=n(1234);e.exports=function(e,t){return i(e||[],t||[],r)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n(4497)})())); \ No newline at end of file diff --git a/package.json b/package.json index 35ce609..613aac8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nr-cytoscape-expand-collapse", - "version": "1.0.2", + "version": "1.0.3", "description": "This extension provides an interface to expand-collapse nodes", "main": "./src/index.js", "spm": { diff --git a/src/index.js b/src/index.js index 68c47a3..b3450c7 100644 --- a/src/index.js +++ b/src/index.js @@ -107,8 +107,11 @@ // collapse given eles extend options with given param api.collapse = async function (_eles, opts) { var eles = this.collapsibleNodes(_eles); + var options = getScratch(cy, "options"); + var tempOptions = extendOptions(options, opts); + evalOptions(tempOptions); - if (opts?.isGroupBy) { + if (tempOptions?.isGroupBy) { // Get the support cytoscape instance var supportCy = getSupportCy(cy); @@ -155,10 +158,6 @@ } } - var options = getScratch(cy, "options"); - var tempOptions = extendOptions(options, opts); - evalOptions(tempOptions); - return expandCollapseUtilities.collapseGivenNodes(eles, tempOptions); }; @@ -178,7 +177,11 @@ // expand given eles extend options with given param api.expand = async function (_eles, opts) { - if (opts?.isGroupBy) { + var options = getScratch(cy, "options"); + var tempOptions = extendOptions(options, opts); + evalOptions(tempOptions); + + if (tempOptions?.isGroupBy) { // Get the support cytoscape instance var supportCy = getSupportCy(cy); @@ -221,10 +224,6 @@ } var eles = this.expandableNodes(_eles); - var options = getScratch(cy, "options"); - var tempOptions = extendOptions(options, opts); - evalOptions(tempOptions); - return expandCollapseUtilities.expandGivenNodes(eles, tempOptions); };