window["dash_cytoscape"] = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./src/lib/extra_index.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/cose-base/cose-base.js": /*!*********************************************!*\ !*** ./node_modules/cose-base/cose-base.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(/*! layout-base */ \"./node_modules/layout-base/layout-base.js\"));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 7);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;\n\nfunction CoSEConstants() {}\n\n//CoSEConstants inherits static props in FDLayoutConstants\nfor (var prop in FDLayoutConstants) {\n CoSEConstants[prop] = FDLayoutConstants[prop];\n}\n\nCoSEConstants.DEFAULT_USE_MULTI_LEVEL_SCALING = false;\nCoSEConstants.DEFAULT_RADIAL_SEPARATION = FDLayoutConstants.DEFAULT_EDGE_LENGTH;\nCoSEConstants.DEFAULT_COMPONENT_SEPERATION = 60;\nCoSEConstants.TILE = true;\nCoSEConstants.TILING_PADDING_VERTICAL = 10;\nCoSEConstants.TILING_PADDING_HORIZONTAL = 10;\nCoSEConstants.TREE_REDUCTION_ON_INCREMENTAL = false; // make this true when cose is used incrementally as a part of other non-incremental layout\n\nmodule.exports = CoSEConstants;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutEdge = __webpack_require__(0).FDLayoutEdge;\n\nfunction CoSEEdge(source, target, vEdge) {\n FDLayoutEdge.call(this, source, target, vEdge);\n}\n\nCoSEEdge.prototype = Object.create(FDLayoutEdge.prototype);\nfor (var prop in FDLayoutEdge) {\n CoSEEdge[prop] = FDLayoutEdge[prop];\n}\n\nmodule.exports = CoSEEdge;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraph = __webpack_require__(0).LGraph;\n\nfunction CoSEGraph(parent, graphMgr, vGraph) {\n LGraph.call(this, parent, graphMgr, vGraph);\n}\n\nCoSEGraph.prototype = Object.create(LGraph.prototype);\nfor (var prop in LGraph) {\n CoSEGraph[prop] = LGraph[prop];\n}\n\nmodule.exports = CoSEGraph;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraphManager = __webpack_require__(0).LGraphManager;\n\nfunction CoSEGraphManager(layout) {\n LGraphManager.call(this, layout);\n}\n\nCoSEGraphManager.prototype = Object.create(LGraphManager.prototype);\nfor (var prop in LGraphManager) {\n CoSEGraphManager[prop] = LGraphManager[prop];\n}\n\nmodule.exports = CoSEGraphManager;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayoutNode = __webpack_require__(0).FDLayoutNode;\nvar IMath = __webpack_require__(0).IMath;\n\nfunction CoSENode(gm, loc, size, vNode) {\n FDLayoutNode.call(this, gm, loc, size, vNode);\n}\n\nCoSENode.prototype = Object.create(FDLayoutNode.prototype);\nfor (var prop in FDLayoutNode) {\n CoSENode[prop] = FDLayoutNode[prop];\n}\n\nCoSENode.prototype.move = function () {\n var layout = this.graphManager.getLayout();\n this.displacementX = layout.coolingFactor * (this.springForceX + this.repulsionForceX + this.gravitationForceX) / this.noOfChildren;\n this.displacementY = layout.coolingFactor * (this.springForceY + this.repulsionForceY + this.gravitationForceY) / this.noOfChildren;\n\n if (Math.abs(this.displacementX) > layout.coolingFactor * layout.maxNodeDisplacement) {\n this.displacementX = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementX);\n }\n\n if (Math.abs(this.displacementY) > layout.coolingFactor * layout.maxNodeDisplacement) {\n this.displacementY = layout.coolingFactor * layout.maxNodeDisplacement * IMath.sign(this.displacementY);\n }\n\n // a simple node, just move it\n if (this.child == null) {\n this.moveBy(this.displacementX, this.displacementY);\n }\n // an empty compound node, again just move it\n else if (this.child.getNodes().length == 0) {\n this.moveBy(this.displacementX, this.displacementY);\n }\n // non-empty compound node, propogate movement to children as well\n else {\n this.propogateDisplacementToChildren(this.displacementX, this.displacementY);\n }\n\n layout.totalDisplacement += Math.abs(this.displacementX) + Math.abs(this.displacementY);\n\n this.springForceX = 0;\n this.springForceY = 0;\n this.repulsionForceX = 0;\n this.repulsionForceY = 0;\n this.gravitationForceX = 0;\n this.gravitationForceY = 0;\n this.displacementX = 0;\n this.displacementY = 0;\n};\n\nCoSENode.prototype.propogateDisplacementToChildren = function (dX, dY) {\n var nodes = this.getChild().getNodes();\n var node;\n for (var i = 0; i < nodes.length; i++) {\n node = nodes[i];\n if (node.getChild() == null) {\n node.moveBy(dX, dY);\n node.displacementX += dX;\n node.displacementY += dY;\n } else {\n node.propogateDisplacementToChildren(dX, dY);\n }\n }\n};\n\nCoSENode.prototype.setPred1 = function (pred1) {\n this.pred1 = pred1;\n};\n\nCoSENode.prototype.getPred1 = function () {\n return pred1;\n};\n\nCoSENode.prototype.getPred2 = function () {\n return pred2;\n};\n\nCoSENode.prototype.setNext = function (next) {\n this.next = next;\n};\n\nCoSENode.prototype.getNext = function () {\n return next;\n};\n\nCoSENode.prototype.setProcessed = function (processed) {\n this.processed = processed;\n};\n\nCoSENode.prototype.isProcessed = function () {\n return processed;\n};\n\nmodule.exports = CoSENode;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar FDLayout = __webpack_require__(0).FDLayout;\nvar CoSEGraphManager = __webpack_require__(4);\nvar CoSEGraph = __webpack_require__(3);\nvar CoSENode = __webpack_require__(5);\nvar CoSEEdge = __webpack_require__(2);\nvar CoSEConstants = __webpack_require__(1);\nvar FDLayoutConstants = __webpack_require__(0).FDLayoutConstants;\nvar LayoutConstants = __webpack_require__(0).LayoutConstants;\nvar Point = __webpack_require__(0).Point;\nvar PointD = __webpack_require__(0).PointD;\nvar Layout = __webpack_require__(0).Layout;\nvar Integer = __webpack_require__(0).Integer;\nvar IGeometry = __webpack_require__(0).IGeometry;\nvar LGraph = __webpack_require__(0).LGraph;\nvar Transform = __webpack_require__(0).Transform;\n\nfunction CoSELayout() {\n FDLayout.call(this);\n\n this.toBeTiled = {}; // Memorize if a node is to be tiled or is tiled\n}\n\nCoSELayout.prototype = Object.create(FDLayout.prototype);\n\nfor (var prop in FDLayout) {\n CoSELayout[prop] = FDLayout[prop];\n}\n\nCoSELayout.prototype.newGraphManager = function () {\n var gm = new CoSEGraphManager(this);\n this.graphManager = gm;\n return gm;\n};\n\nCoSELayout.prototype.newGraph = function (vGraph) {\n return new CoSEGraph(null, this.graphManager, vGraph);\n};\n\nCoSELayout.prototype.newNode = function (vNode) {\n return new CoSENode(this.graphManager, vNode);\n};\n\nCoSELayout.prototype.newEdge = function (vEdge) {\n return new CoSEEdge(null, null, vEdge);\n};\n\nCoSELayout.prototype.initParameters = function () {\n FDLayout.prototype.initParameters.call(this, arguments);\n if (!this.isSubLayout) {\n if (CoSEConstants.DEFAULT_EDGE_LENGTH < 10) {\n this.idealEdgeLength = 10;\n } else {\n this.idealEdgeLength = CoSEConstants.DEFAULT_EDGE_LENGTH;\n }\n\n this.useSmartIdealEdgeLengthCalculation = CoSEConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;\n this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;\n this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;\n this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;\n this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;\n this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;\n this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;\n\n // variables for tree reduction support\n this.prunedNodesAll = [];\n this.growTreeIterations = 0;\n this.afterGrowthIterations = 0;\n this.isTreeGrowing = false;\n this.isGrowthFinished = false;\n\n // variables for cooling\n this.coolingCycle = 0;\n this.maxCoolingCycle = this.maxIterations / FDLayoutConstants.CONVERGENCE_CHECK_PERIOD;\n this.finalTemperature = FDLayoutConstants.CONVERGENCE_CHECK_PERIOD / this.maxIterations;\n this.coolingAdjuster = 1;\n }\n};\n\nCoSELayout.prototype.layout = function () {\n var createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;\n if (createBendsAsNeeded) {\n this.createBendpoints();\n this.graphManager.resetAllEdges();\n }\n\n this.level = 0;\n return this.classicLayout();\n};\n\nCoSELayout.prototype.classicLayout = function () {\n this.nodesWithGravity = this.calculateNodesToApplyGravitationTo();\n this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);\n this.calcNoOfChildrenForAllNodes();\n this.graphManager.calcLowestCommonAncestors();\n this.graphManager.calcInclusionTreeDepths();\n this.graphManager.getRoot().calcEstimatedSize();\n this.calcIdealEdgeLengths();\n\n if (!this.incremental) {\n var forest = this.getFlatForest();\n\n // The graph associated with this layout is flat and a forest\n if (forest.length > 0) {\n this.positionNodesRadially(forest);\n }\n // The graph associated with this layout is not flat or a forest\n else {\n // Reduce the trees when incremental mode is not enabled and graph is not a forest \n this.reduceTrees();\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n\n this.positionNodesRandomly();\n }\n } else {\n if (CoSEConstants.TREE_REDUCTION_ON_INCREMENTAL) {\n // Reduce the trees in incremental mode if only this constant is set to true \n this.reduceTrees();\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n }\n }\n\n this.initSpringEmbedder();\n this.runSpringEmbedder();\n\n return true;\n};\n\nCoSELayout.prototype.tick = function () {\n this.totalIterations++;\n\n if (this.totalIterations === this.maxIterations && !this.isTreeGrowing && !this.isGrowthFinished) {\n if (this.prunedNodesAll.length > 0) {\n this.isTreeGrowing = true;\n } else {\n return true;\n }\n }\n\n if (this.totalIterations % FDLayoutConstants.CONVERGENCE_CHECK_PERIOD == 0 && !this.isTreeGrowing && !this.isGrowthFinished) {\n if (this.isConverged()) {\n if (this.prunedNodesAll.length > 0) {\n this.isTreeGrowing = true;\n } else {\n return true;\n }\n }\n\n this.coolingCycle++;\n\n if (this.layoutQuality == 0) {\n // quality - \"draft\"\n this.coolingAdjuster = this.coolingCycle;\n } else if (this.layoutQuality == 1) {\n // quality - \"default\"\n this.coolingAdjuster = this.coolingCycle / 3;\n }\n\n // cooling schedule is based on http://www.btluke.com/simanf1.html -> cooling schedule 3\n 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);\n this.animationPeriod = Math.ceil(this.initialAnimationPeriod * Math.sqrt(this.coolingFactor));\n }\n // Operations while tree is growing again \n if (this.isTreeGrowing) {\n if (this.growTreeIterations % 10 == 0) {\n if (this.prunedNodesAll.length > 0) {\n this.graphManager.updateBounds();\n this.updateGrid();\n this.growTree(this.prunedNodesAll);\n // Update nodes that gravity will be applied\n this.graphManager.resetAllNodesToApplyGravitation();\n var allNodes = new Set(this.getAllNodes());\n var intersection = this.nodesWithGravity.filter(function (x) {\n return allNodes.has(x);\n });\n this.graphManager.setAllNodesToApplyGravitation(intersection);\n\n this.graphManager.updateBounds();\n this.updateGrid();\n this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;\n } else {\n this.isTreeGrowing = false;\n this.isGrowthFinished = true;\n }\n }\n this.growTreeIterations++;\n }\n // Operations after growth is finished\n if (this.isGrowthFinished) {\n if (this.isConverged()) {\n return true;\n }\n if (this.afterGrowthIterations % 10 == 0) {\n this.graphManager.updateBounds();\n this.updateGrid();\n }\n this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL * ((100 - this.afterGrowthIterations) / 100);\n this.afterGrowthIterations++;\n }\n\n var gridUpdateAllowed = !this.isTreeGrowing && !this.isGrowthFinished;\n var forceToNodeSurroundingUpdate = this.growTreeIterations % 10 == 1 && this.isTreeGrowing || this.afterGrowthIterations % 10 == 1 && this.isGrowthFinished;\n\n this.totalDisplacement = 0;\n this.graphManager.updateBounds();\n this.calcSpringForces();\n this.calcRepulsionForces(gridUpdateAllowed, forceToNodeSurroundingUpdate);\n this.calcGravitationalForces();\n this.moveNodes();\n this.animate();\n\n return false; // Layout is not ended yet return false\n};\n\nCoSELayout.prototype.getPositionsData = function () {\n var allNodes = this.graphManager.getAllNodes();\n var pData = {};\n for (var i = 0; i < allNodes.length; i++) {\n var rect = allNodes[i].rect;\n var id = allNodes[i].id;\n pData[id] = {\n id: id,\n x: rect.getCenterX(),\n y: rect.getCenterY(),\n w: rect.width,\n h: rect.height\n };\n }\n\n return pData;\n};\n\nCoSELayout.prototype.runSpringEmbedder = function () {\n this.initialAnimationPeriod = 25;\n this.animationPeriod = this.initialAnimationPeriod;\n var layoutEnded = false;\n\n // If aminate option is 'during' signal that layout is supposed to start iterating\n if (FDLayoutConstants.ANIMATE === 'during') {\n this.emit('layoutstarted');\n } else {\n // If aminate option is 'during' tick() function will be called on index.js\n while (!layoutEnded) {\n layoutEnded = this.tick();\n }\n\n this.graphManager.updateBounds();\n }\n};\n\nCoSELayout.prototype.calculateNodesToApplyGravitationTo = function () {\n var nodeList = [];\n var graph;\n\n var graphs = this.graphManager.getGraphs();\n var size = graphs.length;\n var i;\n for (i = 0; i < size; i++) {\n graph = graphs[i];\n\n graph.updateConnected();\n\n if (!graph.isConnected) {\n nodeList = nodeList.concat(graph.getNodes());\n }\n }\n\n return nodeList;\n};\n\nCoSELayout.prototype.createBendpoints = function () {\n var edges = [];\n edges = edges.concat(this.graphManager.getAllEdges());\n var visited = new Set();\n var i;\n for (i = 0; i < edges.length; i++) {\n var edge = edges[i];\n\n if (!visited.has(edge)) {\n var source = edge.getSource();\n var target = edge.getTarget();\n\n if (source == target) {\n edge.getBendpoints().push(new PointD());\n edge.getBendpoints().push(new PointD());\n this.createDummyNodesForBendpoints(edge);\n visited.add(edge);\n } else {\n var edgeList = [];\n\n edgeList = edgeList.concat(source.getEdgeListToNode(target));\n edgeList = edgeList.concat(target.getEdgeListToNode(source));\n\n if (!visited.has(edgeList[0])) {\n if (edgeList.length > 1) {\n var k;\n for (k = 0; k < edgeList.length; k++) {\n var multiEdge = edgeList[k];\n multiEdge.getBendpoints().push(new PointD());\n this.createDummyNodesForBendpoints(multiEdge);\n }\n }\n edgeList.forEach(function (edge) {\n visited.add(edge);\n });\n }\n }\n }\n\n if (visited.size == edges.length) {\n break;\n }\n }\n};\n\nCoSELayout.prototype.positionNodesRadially = function (forest) {\n // We tile the trees to a grid row by row; first tree starts at (0,0)\n var currentStartingPoint = new Point(0, 0);\n var numberOfColumns = Math.ceil(Math.sqrt(forest.length));\n var height = 0;\n var currentY = 0;\n var currentX = 0;\n var point = new PointD(0, 0);\n\n for (var i = 0; i < forest.length; i++) {\n if (i % numberOfColumns == 0) {\n // Start of a new row, make the x coordinate 0, increment the\n // y coordinate with the max height of the previous row\n currentX = 0;\n currentY = height;\n\n if (i != 0) {\n currentY += CoSEConstants.DEFAULT_COMPONENT_SEPERATION;\n }\n\n height = 0;\n }\n\n var tree = forest[i];\n\n // Find the center of the tree\n var centerNode = Layout.findCenterOfTree(tree);\n\n // Set the staring point of the next tree\n currentStartingPoint.x = currentX;\n currentStartingPoint.y = currentY;\n\n // Do a radial layout starting with the center\n point = CoSELayout.radialLayout(tree, centerNode, currentStartingPoint);\n\n if (point.y > height) {\n height = Math.floor(point.y);\n }\n\n currentX = Math.floor(point.x + CoSEConstants.DEFAULT_COMPONENT_SEPERATION);\n }\n\n this.transform(new PointD(LayoutConstants.WORLD_CENTER_X - point.x / 2, LayoutConstants.WORLD_CENTER_Y - point.y / 2));\n};\n\nCoSELayout.radialLayout = function (tree, centerNode, startingPoint) {\n var radialSep = Math.max(this.maxDiagonalInTree(tree), CoSEConstants.DEFAULT_RADIAL_SEPARATION);\n CoSELayout.branchRadialLayout(centerNode, null, 0, 359, 0, radialSep);\n var bounds = LGraph.calculateBounds(tree);\n\n var transform = new Transform();\n transform.setDeviceOrgX(bounds.getMinX());\n transform.setDeviceOrgY(bounds.getMinY());\n transform.setWorldOrgX(startingPoint.x);\n transform.setWorldOrgY(startingPoint.y);\n\n for (var i = 0; i < tree.length; i++) {\n var node = tree[i];\n node.transform(transform);\n }\n\n var bottomRight = new PointD(bounds.getMaxX(), bounds.getMaxY());\n\n return transform.inverseTransformPoint(bottomRight);\n};\n\nCoSELayout.branchRadialLayout = function (node, parentOfNode, startAngle, endAngle, distance, radialSeparation) {\n // First, position this node by finding its angle.\n var halfInterval = (endAngle - startAngle + 1) / 2;\n\n if (halfInterval < 0) {\n halfInterval += 180;\n }\n\n var nodeAngle = (halfInterval + startAngle) % 360;\n var teta = nodeAngle * IGeometry.TWO_PI / 360;\n\n // Make polar to java cordinate conversion.\n var cos_teta = Math.cos(teta);\n var x_ = distance * Math.cos(teta);\n var y_ = distance * Math.sin(teta);\n\n node.setCenter(x_, y_);\n\n // Traverse all neighbors of this node and recursively call this\n // function.\n var neighborEdges = [];\n neighborEdges = neighborEdges.concat(node.getEdges());\n var childCount = neighborEdges.length;\n\n if (parentOfNode != null) {\n childCount--;\n }\n\n var branchCount = 0;\n\n var incEdgesCount = neighborEdges.length;\n var startIndex;\n\n var edges = node.getEdgesBetween(parentOfNode);\n\n // If there are multiple edges, prune them until there remains only one\n // edge.\n while (edges.length > 1) {\n //neighborEdges.remove(edges.remove(0));\n var temp = edges[0];\n edges.splice(0, 1);\n var index = neighborEdges.indexOf(temp);\n if (index >= 0) {\n neighborEdges.splice(index, 1);\n }\n incEdgesCount--;\n childCount--;\n }\n\n if (parentOfNode != null) {\n //assert edges.length == 1;\n startIndex = (neighborEdges.indexOf(edges[0]) + 1) % incEdgesCount;\n } else {\n startIndex = 0;\n }\n\n var stepAngle = Math.abs(endAngle - startAngle) / childCount;\n\n for (var i = startIndex; branchCount != childCount; i = ++i % incEdgesCount) {\n var currentNeighbor = neighborEdges[i].getOtherEnd(node);\n\n // Don't back traverse to root node in current tree.\n if (currentNeighbor == parentOfNode) {\n continue;\n }\n\n var childStartAngle = (startAngle + branchCount * stepAngle) % 360;\n var childEndAngle = (childStartAngle + stepAngle) % 360;\n\n CoSELayout.branchRadialLayout(currentNeighbor, node, childStartAngle, childEndAngle, distance + radialSeparation, radialSeparation);\n\n branchCount++;\n }\n};\n\nCoSELayout.maxDiagonalInTree = function (tree) {\n var maxDiagonal = Integer.MIN_VALUE;\n\n for (var i = 0; i < tree.length; i++) {\n var node = tree[i];\n var diagonal = node.getDiagonal();\n\n if (diagonal > maxDiagonal) {\n maxDiagonal = diagonal;\n }\n }\n\n return maxDiagonal;\n};\n\nCoSELayout.prototype.calcRepulsionRange = function () {\n // formula is 2 x (level + 1) x idealEdgeLength\n return 2 * (this.level + 1) * this.idealEdgeLength;\n};\n\n// Tiling methods\n\n// Group zero degree members whose parents are not to be tiled, create dummy parents where needed and fill memberGroups by their dummp parent id's\nCoSELayout.prototype.groupZeroDegreeMembers = function () {\n var self = this;\n // array of [parent_id x oneDegreeNode_id]\n var tempMemberGroups = {}; // A temporary map of parent node and its zero degree members\n this.memberGroups = {}; // A map of dummy parent node and its zero degree members whose parents are not to be tiled\n this.idToDummyNode = {}; // A map of id to dummy node \n\n var zeroDegree = []; // List of zero degree nodes whose parents are not to be tiled\n var allNodes = this.graphManager.getAllNodes();\n\n // Fill zero degree list\n for (var i = 0; i < allNodes.length; i++) {\n var node = allNodes[i];\n var parent = node.getParent();\n // If a node has zero degree and its parent is not to be tiled if exists add that node to zeroDegres list\n if (this.getNodeDegreeWithChildren(node) === 0 && (parent.id == undefined || !this.getToBeTiled(parent))) {\n zeroDegree.push(node);\n }\n }\n\n // Create a map of parent node and its zero degree members\n for (var i = 0; i < zeroDegree.length; i++) {\n var node = zeroDegree[i]; // Zero degree node itself\n var p_id = node.getParent().id; // Parent id\n\n if (typeof tempMemberGroups[p_id] === \"undefined\") tempMemberGroups[p_id] = [];\n\n tempMemberGroups[p_id] = tempMemberGroups[p_id].concat(node); // Push node to the list belongs to its parent in tempMemberGroups\n }\n\n // If there are at least two nodes at a level, create a dummy compound for them\n Object.keys(tempMemberGroups).forEach(function (p_id) {\n if (tempMemberGroups[p_id].length > 1) {\n var dummyCompoundId = \"DummyCompound_\" + p_id; // The id of dummy compound which will be created soon\n self.memberGroups[dummyCompoundId] = tempMemberGroups[p_id]; // Add dummy compound to memberGroups\n\n var parent = tempMemberGroups[p_id][0].getParent(); // The parent of zero degree nodes will be the parent of new dummy compound\n\n // Create a dummy compound with calculated id\n var dummyCompound = new CoSENode(self.graphManager);\n dummyCompound.id = dummyCompoundId;\n dummyCompound.paddingLeft = parent.paddingLeft || 0;\n dummyCompound.paddingRight = parent.paddingRight || 0;\n dummyCompound.paddingBottom = parent.paddingBottom || 0;\n dummyCompound.paddingTop = parent.paddingTop || 0;\n\n self.idToDummyNode[dummyCompoundId] = dummyCompound;\n\n var dummyParentGraph = self.getGraphManager().add(self.newGraph(), dummyCompound);\n var parentGraph = parent.getChild();\n\n // Add dummy compound to parent the graph\n parentGraph.add(dummyCompound);\n\n // For each zero degree node in this level remove it from its parent graph and add it to the graph of dummy parent\n for (var i = 0; i < tempMemberGroups[p_id].length; i++) {\n var node = tempMemberGroups[p_id][i];\n\n parentGraph.remove(node);\n dummyParentGraph.add(node);\n }\n }\n });\n};\n\nCoSELayout.prototype.clearCompounds = function () {\n var childGraphMap = {};\n var idToNode = {};\n\n // Get compound ordering by finding the inner one first\n this.performDFSOnCompounds();\n\n for (var i = 0; i < this.compoundOrder.length; i++) {\n\n idToNode[this.compoundOrder[i].id] = this.compoundOrder[i];\n childGraphMap[this.compoundOrder[i].id] = [].concat(this.compoundOrder[i].getChild().getNodes());\n\n // Remove children of compounds\n this.graphManager.remove(this.compoundOrder[i].getChild());\n this.compoundOrder[i].child = null;\n }\n\n this.graphManager.resetAllNodes();\n\n // Tile the removed children\n this.tileCompoundMembers(childGraphMap, idToNode);\n};\n\nCoSELayout.prototype.clearZeroDegreeMembers = function () {\n var self = this;\n var tiledZeroDegreePack = this.tiledZeroDegreePack = [];\n\n Object.keys(this.memberGroups).forEach(function (id) {\n var compoundNode = self.idToDummyNode[id]; // Get the dummy compound\n\n tiledZeroDegreePack[id] = self.tileNodes(self.memberGroups[id], compoundNode.paddingLeft + compoundNode.paddingRight);\n\n // Set the width and height of the dummy compound as calculated\n compoundNode.rect.width = tiledZeroDegreePack[id].width;\n compoundNode.rect.height = tiledZeroDegreePack[id].height;\n });\n};\n\nCoSELayout.prototype.repopulateCompounds = function () {\n for (var i = this.compoundOrder.length - 1; i >= 0; i--) {\n var lCompoundNode = this.compoundOrder[i];\n var id = lCompoundNode.id;\n var horizontalMargin = lCompoundNode.paddingLeft;\n var verticalMargin = lCompoundNode.paddingTop;\n\n this.adjustLocations(this.tiledMemberPack[id], lCompoundNode.rect.x, lCompoundNode.rect.y, horizontalMargin, verticalMargin);\n }\n};\n\nCoSELayout.prototype.repopulateZeroDegreeMembers = function () {\n var self = this;\n var tiledPack = this.tiledZeroDegreePack;\n\n Object.keys(tiledPack).forEach(function (id) {\n var compoundNode = self.idToDummyNode[id]; // Get the dummy compound by its id\n var horizontalMargin = compoundNode.paddingLeft;\n var verticalMargin = compoundNode.paddingTop;\n\n // Adjust the positions of nodes wrt its compound\n self.adjustLocations(tiledPack[id], compoundNode.rect.x, compoundNode.rect.y, horizontalMargin, verticalMargin);\n });\n};\n\nCoSELayout.prototype.getToBeTiled = function (node) {\n var id = node.id;\n //firstly check the previous results\n if (this.toBeTiled[id] != null) {\n return this.toBeTiled[id];\n }\n\n //only compound nodes are to be tiled\n var childGraph = node.getChild();\n if (childGraph == null) {\n this.toBeTiled[id] = false;\n return false;\n }\n\n var children = childGraph.getNodes(); // Get the children nodes\n\n //a compound node is not to be tiled if all of its compound children are not to be tiled\n for (var i = 0; i < children.length; i++) {\n var theChild = children[i];\n\n if (this.getNodeDegree(theChild) > 0) {\n this.toBeTiled[id] = false;\n return false;\n }\n\n //pass the children not having the compound structure\n if (theChild.getChild() == null) {\n this.toBeTiled[theChild.id] = false;\n continue;\n }\n\n if (!this.getToBeTiled(theChild)) {\n this.toBeTiled[id] = false;\n return false;\n }\n }\n this.toBeTiled[id] = true;\n return true;\n};\n\n// Get degree of a node depending of its edges and independent of its children\nCoSELayout.prototype.getNodeDegree = function (node) {\n var id = node.id;\n var edges = node.getEdges();\n var degree = 0;\n\n // For the edges connected\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n if (edge.getSource().id !== edge.getTarget().id) {\n degree = degree + 1;\n }\n }\n return degree;\n};\n\n// Get degree of a node with its children\nCoSELayout.prototype.getNodeDegreeWithChildren = function (node) {\n var degree = this.getNodeDegree(node);\n if (node.getChild() == null) {\n return degree;\n }\n var children = node.getChild().getNodes();\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n degree += this.getNodeDegreeWithChildren(child);\n }\n return degree;\n};\n\nCoSELayout.prototype.performDFSOnCompounds = function () {\n this.compoundOrder = [];\n this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes());\n};\n\nCoSELayout.prototype.fillCompexOrderByDFS = function (children) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.getChild() != null) {\n this.fillCompexOrderByDFS(child.getChild().getNodes());\n }\n if (this.getToBeTiled(child)) {\n this.compoundOrder.push(child);\n }\n }\n};\n\n/**\n* This method places each zero degree member wrt given (x,y) coordinates (top left).\n*/\nCoSELayout.prototype.adjustLocations = function (organization, x, y, compoundHorizontalMargin, compoundVerticalMargin) {\n x += compoundHorizontalMargin;\n y += compoundVerticalMargin;\n\n var left = x;\n\n for (var i = 0; i < organization.rows.length; i++) {\n var row = organization.rows[i];\n x = left;\n var maxHeight = 0;\n\n for (var j = 0; j < row.length; j++) {\n var lnode = row[j];\n\n lnode.rect.x = x; // + lnode.rect.width / 2;\n lnode.rect.y = y; // + lnode.rect.height / 2;\n\n x += lnode.rect.width + organization.horizontalPadding;\n\n if (lnode.rect.height > maxHeight) maxHeight = lnode.rect.height;\n }\n\n y += maxHeight + organization.verticalPadding;\n }\n};\n\nCoSELayout.prototype.tileCompoundMembers = function (childGraphMap, idToNode) {\n var self = this;\n this.tiledMemberPack = [];\n\n Object.keys(childGraphMap).forEach(function (id) {\n // Get the compound node\n var compoundNode = idToNode[id];\n\n self.tiledMemberPack[id] = self.tileNodes(childGraphMap[id], compoundNode.paddingLeft + compoundNode.paddingRight);\n\n compoundNode.rect.width = self.tiledMemberPack[id].width;\n compoundNode.rect.height = self.tiledMemberPack[id].height;\n });\n};\n\nCoSELayout.prototype.tileNodes = function (nodes, minWidth) {\n var verticalPadding = CoSEConstants.TILING_PADDING_VERTICAL;\n var horizontalPadding = CoSEConstants.TILING_PADDING_HORIZONTAL;\n var organization = {\n rows: [],\n rowWidth: [],\n rowHeight: [],\n width: 0,\n height: minWidth, // assume minHeight equals to minWidth\n verticalPadding: verticalPadding,\n horizontalPadding: horizontalPadding\n };\n\n // Sort the nodes in ascending order of their areas\n nodes.sort(function (n1, n2) {\n if (n1.rect.width * n1.rect.height > n2.rect.width * n2.rect.height) return -1;\n if (n1.rect.width * n1.rect.height < n2.rect.width * n2.rect.height) return 1;\n return 0;\n });\n\n // Create the organization -> tile members\n for (var i = 0; i < nodes.length; i++) {\n var lNode = nodes[i];\n\n if (organization.rows.length == 0) {\n this.insertNodeToRow(organization, lNode, 0, minWidth);\n } else if (this.canAddHorizontal(organization, lNode.rect.width, lNode.rect.height)) {\n this.insertNodeToRow(organization, lNode, this.getShortestRowIndex(organization), minWidth);\n } else {\n this.insertNodeToRow(organization, lNode, organization.rows.length, minWidth);\n }\n\n this.shiftToLastRow(organization);\n }\n\n return organization;\n};\n\nCoSELayout.prototype.insertNodeToRow = function (organization, node, rowIndex, minWidth) {\n var minCompoundSize = minWidth;\n\n // Add new row if needed\n if (rowIndex == organization.rows.length) {\n var secondDimension = [];\n\n organization.rows.push(secondDimension);\n organization.rowWidth.push(minCompoundSize);\n organization.rowHeight.push(0);\n }\n\n // Update row width\n var w = organization.rowWidth[rowIndex] + node.rect.width;\n\n if (organization.rows[rowIndex].length > 0) {\n w += organization.horizontalPadding;\n }\n\n organization.rowWidth[rowIndex] = w;\n // Update compound width\n if (organization.width < w) {\n organization.width = w;\n }\n\n // Update height\n var h = node.rect.height;\n if (rowIndex > 0) h += organization.verticalPadding;\n\n var extraHeight = 0;\n if (h > organization.rowHeight[rowIndex]) {\n extraHeight = organization.rowHeight[rowIndex];\n organization.rowHeight[rowIndex] = h;\n extraHeight = organization.rowHeight[rowIndex] - extraHeight;\n }\n\n organization.height += extraHeight;\n\n // Insert node\n organization.rows[rowIndex].push(node);\n};\n\n//Scans the rows of an organization and returns the one with the min width\nCoSELayout.prototype.getShortestRowIndex = function (organization) {\n var r = -1;\n var min = Number.MAX_VALUE;\n\n for (var i = 0; i < organization.rows.length; i++) {\n if (organization.rowWidth[i] < min) {\n r = i;\n min = organization.rowWidth[i];\n }\n }\n return r;\n};\n\n//Scans the rows of an organization and returns the one with the max width\nCoSELayout.prototype.getLongestRowIndex = function (organization) {\n var r = -1;\n var max = Number.MIN_VALUE;\n\n for (var i = 0; i < organization.rows.length; i++) {\n\n if (organization.rowWidth[i] > max) {\n r = i;\n max = organization.rowWidth[i];\n }\n }\n\n return r;\n};\n\n/**\n* This method checks whether adding extra width to the organization violates\n* the aspect ratio(1) or not.\n*/\nCoSELayout.prototype.canAddHorizontal = function (organization, extraWidth, extraHeight) {\n\n var sri = this.getShortestRowIndex(organization);\n\n if (sri < 0) {\n return true;\n }\n\n var min = organization.rowWidth[sri];\n\n if (min + organization.horizontalPadding + extraWidth <= organization.width) return true;\n\n var hDiff = 0;\n\n // Adding to an existing row\n if (organization.rowHeight[sri] < extraHeight) {\n if (sri > 0) hDiff = extraHeight + organization.verticalPadding - organization.rowHeight[sri];\n }\n\n var add_to_row_ratio;\n if (organization.width - min >= extraWidth + organization.horizontalPadding) {\n add_to_row_ratio = (organization.height + hDiff) / (min + extraWidth + organization.horizontalPadding);\n } else {\n add_to_row_ratio = (organization.height + hDiff) / organization.width;\n }\n\n // Adding a new row for this node\n hDiff = extraHeight + organization.verticalPadding;\n var add_new_row_ratio;\n if (organization.width < extraWidth) {\n add_new_row_ratio = (organization.height + hDiff) / extraWidth;\n } else {\n add_new_row_ratio = (organization.height + hDiff) / organization.width;\n }\n\n if (add_new_row_ratio < 1) add_new_row_ratio = 1 / add_new_row_ratio;\n\n if (add_to_row_ratio < 1) add_to_row_ratio = 1 / add_to_row_ratio;\n\n return add_to_row_ratio < add_new_row_ratio;\n};\n\n//If moving the last node from the longest row and adding it to the last\n//row makes the bounding box smaller, do it.\nCoSELayout.prototype.shiftToLastRow = function (organization) {\n var longest = this.getLongestRowIndex(organization);\n var last = organization.rowWidth.length - 1;\n var row = organization.rows[longest];\n var node = row[row.length - 1];\n\n var diff = node.width + organization.horizontalPadding;\n\n // Check if there is enough space on the last row\n if (organization.width - organization.rowWidth[last] > diff && longest != last) {\n // Remove the last element of the longest row\n row.splice(-1, 1);\n\n // Push it to the last row\n organization.rows[last].push(node);\n\n organization.rowWidth[longest] = organization.rowWidth[longest] - diff;\n organization.rowWidth[last] = organization.rowWidth[last] + diff;\n organization.width = organization.rowWidth[instance.getLongestRowIndex(organization)];\n\n // Update heights of the organization\n var maxHeight = Number.MIN_VALUE;\n for (var i = 0; i < row.length; i++) {\n if (row[i].height > maxHeight) maxHeight = row[i].height;\n }\n if (longest > 0) maxHeight += organization.verticalPadding;\n\n var prevTotal = organization.rowHeight[longest] + organization.rowHeight[last];\n\n organization.rowHeight[longest] = maxHeight;\n if (organization.rowHeight[last] < node.height + organization.verticalPadding) organization.rowHeight[last] = node.height + organization.verticalPadding;\n\n var finalTotal = organization.rowHeight[longest] + organization.rowHeight[last];\n organization.height += finalTotal - prevTotal;\n\n this.shiftToLastRow(organization);\n }\n};\n\nCoSELayout.prototype.tilingPreLayout = function () {\n if (CoSEConstants.TILE) {\n // Find zero degree nodes and create a compound for each level\n this.groupZeroDegreeMembers();\n // Tile and clear children of each compound\n this.clearCompounds();\n // Separately tile and clear zero degree nodes for each level\n this.clearZeroDegreeMembers();\n }\n};\n\nCoSELayout.prototype.tilingPostLayout = function () {\n if (CoSEConstants.TILE) {\n this.repopulateZeroDegreeMembers();\n this.repopulateCompounds();\n }\n};\n\n// -----------------------------------------------------------------------------\n// Section: Tree Reduction methods\n// -----------------------------------------------------------------------------\n// Reduce trees \nCoSELayout.prototype.reduceTrees = function () {\n var prunedNodesAll = [];\n var containsLeaf = true;\n var node;\n\n while (containsLeaf) {\n var allNodes = this.graphManager.getAllNodes();\n var prunedNodesInStepTemp = [];\n containsLeaf = false;\n\n for (var i = 0; i < allNodes.length; i++) {\n node = allNodes[i];\n if (node.getEdges().length == 1 && !node.getEdges()[0].isInterGraph && node.getChild() == null) {\n prunedNodesInStepTemp.push([node, node.getEdges()[0], node.getOwner()]);\n containsLeaf = true;\n }\n }\n if (containsLeaf == true) {\n var prunedNodesInStep = [];\n for (var j = 0; j < prunedNodesInStepTemp.length; j++) {\n if (prunedNodesInStepTemp[j][0].getEdges().length == 1) {\n prunedNodesInStep.push(prunedNodesInStepTemp[j]);\n prunedNodesInStepTemp[j][0].getOwner().remove(prunedNodesInStepTemp[j][0]);\n }\n }\n prunedNodesAll.push(prunedNodesInStep);\n this.graphManager.resetAllNodes();\n this.graphManager.resetAllEdges();\n }\n }\n this.prunedNodesAll = prunedNodesAll;\n};\n\n// Grow tree one step \nCoSELayout.prototype.growTree = function (prunedNodesAll) {\n var lengthOfPrunedNodesInStep = prunedNodesAll.length;\n var prunedNodesInStep = prunedNodesAll[lengthOfPrunedNodesInStep - 1];\n\n var nodeData;\n for (var i = 0; i < prunedNodesInStep.length; i++) {\n nodeData = prunedNodesInStep[i];\n\n this.findPlaceforPrunedNode(nodeData);\n\n nodeData[2].add(nodeData[0]);\n nodeData[2].add(nodeData[1], nodeData[1].source, nodeData[1].target);\n }\n\n prunedNodesAll.splice(prunedNodesAll.length - 1, 1);\n this.graphManager.resetAllNodes();\n this.graphManager.resetAllEdges();\n};\n\n// Find an appropriate position to replace pruned node, this method can be improved\nCoSELayout.prototype.findPlaceforPrunedNode = function (nodeData) {\n\n var gridForPrunedNode;\n var nodeToConnect;\n var prunedNode = nodeData[0];\n if (prunedNode == nodeData[1].source) {\n nodeToConnect = nodeData[1].target;\n } else {\n nodeToConnect = nodeData[1].source;\n }\n var startGridX = nodeToConnect.startX;\n var finishGridX = nodeToConnect.finishX;\n var startGridY = nodeToConnect.startY;\n var finishGridY = nodeToConnect.finishY;\n\n var upNodeCount = 0;\n var downNodeCount = 0;\n var rightNodeCount = 0;\n var leftNodeCount = 0;\n var controlRegions = [upNodeCount, rightNodeCount, downNodeCount, leftNodeCount];\n\n if (startGridY > 0) {\n for (var i = startGridX; i <= finishGridX; i++) {\n controlRegions[0] += this.grid[i][startGridY - 1].length + this.grid[i][startGridY].length - 1;\n }\n }\n if (finishGridX < this.grid.length - 1) {\n for (var i = startGridY; i <= finishGridY; i++) {\n controlRegions[1] += this.grid[finishGridX + 1][i].length + this.grid[finishGridX][i].length - 1;\n }\n }\n if (finishGridY < this.grid[0].length - 1) {\n for (var i = startGridX; i <= finishGridX; i++) {\n controlRegions[2] += this.grid[i][finishGridY + 1].length + this.grid[i][finishGridY].length - 1;\n }\n }\n if (startGridX > 0) {\n for (var i = startGridY; i <= finishGridY; i++) {\n controlRegions[3] += this.grid[startGridX - 1][i].length + this.grid[startGridX][i].length - 1;\n }\n }\n var min = Integer.MAX_VALUE;\n var minCount;\n var minIndex;\n for (var j = 0; j < controlRegions.length; j++) {\n if (controlRegions[j] < min) {\n min = controlRegions[j];\n minCount = 1;\n minIndex = j;\n } else if (controlRegions[j] == min) {\n minCount++;\n }\n }\n\n if (minCount == 3 && min == 0) {\n if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[2] == 0) {\n gridForPrunedNode = 1;\n } else if (controlRegions[0] == 0 && controlRegions[1] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 0;\n } else if (controlRegions[0] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 3;\n } else if (controlRegions[1] == 0 && controlRegions[2] == 0 && controlRegions[3] == 0) {\n gridForPrunedNode = 2;\n }\n } else if (minCount == 2 && min == 0) {\n var random = Math.floor(Math.random() * 2);\n if (controlRegions[0] == 0 && controlRegions[1] == 0) {\n ;\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 1;\n }\n } else if (controlRegions[0] == 0 && controlRegions[2] == 0) {\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 2;\n }\n } else if (controlRegions[0] == 0 && controlRegions[3] == 0) {\n if (random == 0) {\n gridForPrunedNode = 0;\n } else {\n gridForPrunedNode = 3;\n }\n } else if (controlRegions[1] == 0 && controlRegions[2] == 0) {\n if (random == 0) {\n gridForPrunedNode = 1;\n } else {\n gridForPrunedNode = 2;\n }\n } else if (controlRegions[1] == 0 && controlRegions[3] == 0) {\n if (random == 0) {\n gridForPrunedNode = 1;\n } else {\n gridForPrunedNode = 3;\n }\n } else {\n if (random == 0) {\n gridForPrunedNode = 2;\n } else {\n gridForPrunedNode = 3;\n }\n }\n } else if (minCount == 4 && min == 0) {\n var random = Math.floor(Math.random() * 4);\n gridForPrunedNode = random;\n } else {\n gridForPrunedNode = minIndex;\n }\n\n if (gridForPrunedNode == 0) {\n prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() - nodeToConnect.getHeight() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getHeight() / 2);\n } else if (gridForPrunedNode == 1) {\n prunedNode.setCenter(nodeToConnect.getCenterX() + nodeToConnect.getWidth() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getWidth() / 2, nodeToConnect.getCenterY());\n } else if (gridForPrunedNode == 2) {\n prunedNode.setCenter(nodeToConnect.getCenterX(), nodeToConnect.getCenterY() + nodeToConnect.getHeight() / 2 + FDLayoutConstants.DEFAULT_EDGE_LENGTH + prunedNode.getHeight() / 2);\n } else {\n prunedNode.setCenter(nodeToConnect.getCenterX() - nodeToConnect.getWidth() / 2 - FDLayoutConstants.DEFAULT_EDGE_LENGTH - prunedNode.getWidth() / 2, nodeToConnect.getCenterY());\n }\n};\n\nmodule.exports = CoSELayout;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar coseBase = {};\n\ncoseBase.layoutBase = __webpack_require__(0);\ncoseBase.CoSEConstants = __webpack_require__(1);\ncoseBase.CoSEEdge = __webpack_require__(2);\ncoseBase.CoSEGraph = __webpack_require__(3);\ncoseBase.CoSEGraphManager = __webpack_require__(4);\ncoseBase.CoSELayout = __webpack_require__(6);\ncoseBase.CoSENode = __webpack_require__(5);\n\nmodule.exports = coseBase;\n\n/***/ })\n/******/ ]);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9jb3NlLWJhc2UvY29zZS1iYXNlLmpzPzU3NTIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQSxJQUFJLElBQXlEO0FBQzdELDJCQUEyQixtQkFBTyxDQUFDLDhEQUFhO0FBQ2hELE1BQU0sRUFLMkM7QUFDakQsQ0FBQztBQUNELG9DQUFvQztBQUNwQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsbURBQW1ELGNBQWM7QUFDakU7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGFBQWE7QUFDYjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxtQ0FBbUMsMEJBQTBCLEVBQUU7QUFDL0QseUNBQXlDLGVBQWU7QUFDeEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDh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KioqLyB9KSxcbi8qIDcgKi9cbi8qKiovIChmdW5jdGlvbihtb2R1bGUsIGV4cG9ydHMsIF9fd2VicGFja19yZXF1aXJlX18pIHtcblxuXCJ1c2Ugc3RyaWN0XCI7XG5cblxudmFyIGNvc2VCYXNlID0ge307XG5cbmNvc2VCYXNlLmxheW91dEJhc2UgPSBfX3dlYnBhY2tfcmVxdWlyZV9fKDApO1xuY29zZUJhc2UuQ29TRUNvbnN0YW50cyA9IF9fd2VicGFja19yZXF1aXJlX18oMSk7XG5jb3NlQmFzZS5Db1NFRWRnZSA9IF9fd2VicGFja19yZXF1aXJlX18oMik7XG5jb3NlQmFzZS5Db1NFR3JhcGggPSBfX3dlYnBhY2tfcmVxdWlyZV9fKDMpO1xuY29zZUJhc2UuQ29TRUdyYXBoTWFuYWdlciA9IF9fd2VicGFja19yZXF1aXJlX18oNCk7XG5jb3NlQmFzZS5Db1NFTGF5b3V0ID0gX193ZWJwYWNrX3JlcXVpcmVfXyg2KTtcbmNvc2VCYXNlLkNvU0VOb2RlID0gX193ZWJwYWNrX3JlcXVpcmVfXyg1KTtcblxubW9kdWxlLmV4cG9ydHMgPSBjb3NlQmFzZTtcblxuLyoqKi8gfSlcbi8qKioqKiovIF0pO1xufSk7Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/cose-base/cose-base.js\n"); /***/ }), /***/ "./node_modules/cytoscape-cola/cytoscape-cola.js": /*!*******************************************************!*\ !*** ./node_modules/cytoscape-cola/cytoscape-cola.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(/*! webcola */ \"./node_modules/webcola/dist/index.js\"));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_5__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar assign = __webpack_require__(1);\nvar defaults = __webpack_require__(2);\nvar cola = __webpack_require__(5) || (typeof window !== 'undefined' ? window.cola : null);\nvar raf = __webpack_require__(4);\nvar isString = function isString(o) {\n return (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === _typeof('');\n};\nvar isNumber = function isNumber(o) {\n return (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === _typeof(0);\n};\nvar isObject = function isObject(o) {\n return o != null && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === _typeof({});\n};\nvar isFunction = function isFunction(o) {\n return o != null && (typeof o === 'undefined' ? 'undefined' : _typeof(o)) === _typeof(function () {});\n};\nvar nop = function nop() {};\n\nvar getOptVal = function getOptVal(val, ele) {\n if (isFunction(val)) {\n var fn = val;\n return fn.apply(ele, [ele]);\n } else {\n return val;\n }\n};\n\n// constructor\n// options : object containing layout options\nfunction ColaLayout(options) {\n this.options = assign({}, defaults, options);\n}\n\n// runs the layout\nColaLayout.prototype.run = function () {\n var layout = this;\n var options = this.options;\n\n layout.manuallyStopped = false;\n\n var cy = options.cy; // cy is automatically populated for us in the constructor\n var eles = options.eles;\n var nodes = eles.nodes();\n var edges = eles.edges();\n var ready = false;\n\n var isParent = function isParent(ele) {\n return ele.isParent();\n };\n\n var parentNodes = nodes.filter(isParent);\n\n var nonparentNodes = nodes.subtract(parentNodes);\n\n var bb = options.boundingBox || { x1: 0, y1: 0, w: cy.width(), h: cy.height() };\n if (bb.x2 === undefined) {\n bb.x2 = bb.x1 + bb.w;\n }\n if (bb.w === undefined) {\n bb.w = bb.x2 - bb.x1;\n }\n if (bb.y2 === undefined) {\n bb.y2 = bb.y1 + bb.h;\n }\n if (bb.h === undefined) {\n bb.h = bb.y2 - bb.y1;\n }\n\n var updateNodePositions = function updateNodePositions() {\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var dimensions = node.layoutDimensions(options);\n var scratch = node.scratch('cola');\n\n // update node dims\n if (!scratch.updatedDims) {\n var padding = getOptVal(options.nodeSpacing, node);\n\n scratch.width = dimensions.w + 2 * padding;\n scratch.height = dimensions.h + 2 * padding;\n }\n }\n\n nodes.positions(function (node) {\n var scratch = node.scratch().cola;\n var retPos = void 0;\n\n if (!node.grabbed() && nonparentNodes.contains(node)) {\n retPos = {\n x: bb.x1 + scratch.x,\n y: bb.y1 + scratch.y\n };\n\n if (!isNumber(retPos.x) || !isNumber(retPos.y)) {\n retPos = undefined;\n }\n }\n\n return retPos;\n });\n\n nodes.updateCompoundBounds(); // because the way this layout sets positions is buggy for some reason; ref #878\n\n if (!ready) {\n onReady();\n ready = true;\n }\n\n if (options.fit) {\n cy.fit(options.padding);\n }\n };\n\n var onDone = function onDone() {\n if (options.ungrabifyWhileSimulating) {\n grabbableNodes.grabify();\n }\n\n cy.off('destroy', destroyHandler);\n\n nodes.off('grab free position', grabHandler);\n nodes.off('lock unlock', lockHandler);\n\n // trigger layoutstop when the layout stops (e.g. finishes)\n layout.one('layoutstop', options.stop);\n layout.trigger({ type: 'layoutstop', layout: layout });\n };\n\n var onReady = function onReady() {\n // trigger layoutready when each node has had its position set at least once\n layout.one('layoutready', options.ready);\n layout.trigger({ type: 'layoutready', layout: layout });\n };\n\n var ticksPerFrame = options.refresh;\n\n if (options.refresh < 0) {\n ticksPerFrame = 1;\n } else {\n ticksPerFrame = Math.max(1, ticksPerFrame); // at least 1\n }\n\n var adaptor = layout.adaptor = cola.adaptor({\n trigger: function trigger(e) {\n // on sim event\n var TICK = cola.EventType ? cola.EventType.tick : null;\n var END = cola.EventType ? cola.EventType.end : null;\n\n switch (e.type) {\n case 'tick':\n case TICK:\n if (options.animate) {\n updateNodePositions();\n }\n break;\n\n case 'end':\n case END:\n updateNodePositions();\n if (!options.infinite) {\n onDone();\n }\n break;\n }\n },\n\n kick: function kick() {\n // kick off the simulation\n //let skip = 0;\n\n var firstTick = true;\n\n var inftick = function inftick() {\n if (layout.manuallyStopped) {\n onDone();\n\n return true;\n }\n\n var ret = adaptor.tick();\n\n if (!options.infinite && !firstTick) {\n adaptor.convergenceThreshold(options.convergenceThreshold);\n }\n\n firstTick = false;\n\n if (ret && options.infinite) {\n // resume layout if done\n adaptor.resume(); // resume => new kick\n }\n\n return ret; // allow regular finish b/c of new kick\n };\n\n var multitick = function multitick() {\n // multiple ticks in a row\n var ret = void 0;\n\n for (var i = 0; i < ticksPerFrame && !ret; i++) {\n ret = ret || inftick(); // pick up true ret vals => sim done\n }\n\n return ret;\n };\n\n if (options.animate) {\n var frame = function frame() {\n if (multitick()) {\n return;\n }\n\n raf(frame);\n };\n\n raf(frame);\n } else {\n while (!inftick()) {\n // keep going...\n }\n }\n },\n\n on: nop, // dummy; not needed\n\n drag: nop // not needed for our case\n });\n layout.adaptor = adaptor;\n\n // if set no grabbing during layout\n var grabbableNodes = nodes.filter(':grabbable');\n if (options.ungrabifyWhileSimulating) {\n grabbableNodes.ungrabify();\n }\n\n var destroyHandler = void 0;\n cy.one('destroy', destroyHandler = function destroyHandler() {\n layout.stop();\n });\n\n // handle node dragging\n var grabHandler = void 0;\n nodes.on('grab free position', grabHandler = function grabHandler(e) {\n var node = this;\n var scrCola = node.scratch().cola;\n var pos = node.position();\n var nodeIsTarget = e.cyTarget === node || e.target === node;\n\n if (!nodeIsTarget) {\n return;\n }\n\n switch (e.type) {\n case 'grab':\n adaptor.dragstart(scrCola);\n break;\n case 'free':\n adaptor.dragend(scrCola);\n break;\n case 'position':\n // only update when different (i.e. manual .position() call or drag) so we don't loop needlessly\n if (scrCola.px !== pos.x - bb.x1 || scrCola.py !== pos.y - bb.y1) {\n scrCola.px = pos.x - bb.x1;\n scrCola.py = pos.y - bb.y1;\n }\n break;\n }\n });\n\n var lockHandler = void 0;\n nodes.on('lock unlock', lockHandler = function lockHandler() {\n var node = this;\n var scrCola = node.scratch().cola;\n\n scrCola.fixed = node.locked();\n\n if (node.locked()) {\n adaptor.dragstart(scrCola);\n } else {\n adaptor.dragend(scrCola);\n }\n });\n\n // add nodes to cola\n adaptor.nodes(nonparentNodes.map(function (node, i) {\n var padding = getOptVal(options.nodeSpacing, node);\n var pos = node.position();\n var dimensions = node.layoutDimensions(options);\n\n var struct = node.scratch().cola = {\n x: options.randomize || pos.x === undefined ? Math.round(Math.random() * bb.w) : pos.x,\n y: options.randomize || pos.y === undefined ? Math.round(Math.random() * bb.h) : pos.y,\n width: dimensions.w + 2 * padding,\n height: dimensions.h + 2 * padding,\n index: i,\n fixed: node.locked()\n };\n\n return struct;\n }));\n\n // the constraints to be added on nodes\n var constraints = [];\n\n if (options.alignment) {\n // then set alignment constraints\n\n var offsetsX = [];\n var offsetsY = [];\n\n nonparentNodes.forEach(function (node) {\n var align = getOptVal(options.alignment, node);\n var scrCola = node.scratch().cola;\n var index = scrCola.index;\n\n if (!align) {\n return;\n }\n\n if (align.x != null) {\n offsetsX.push({\n node: index,\n offset: align.x\n });\n }\n\n if (align.y != null) {\n offsetsY.push({\n node: index,\n offset: align.y\n });\n }\n });\n\n if (offsetsX.length > 0) {\n constraints.push({\n type: 'alignment',\n axis: 'x',\n offsets: offsetsX\n });\n }\n\n if (offsetsY.length > 0) {\n constraints.push({\n type: 'alignment',\n axis: 'y',\n offsets: offsetsY\n });\n }\n }\n\n // if gapInequalities variable is set add each inequality constraint to list of constraints\n if (options.gapInequalities) {\n options.gapInequalities.forEach(function (inequality) {\n\n // for the constraints to be passed to cola layout adaptor use indices of nodes,\n // not the nodes themselves\n var leftIndex = inequality.left.scratch().cola.index;\n var rightIndex = inequality.right.scratch().cola.index;\n\n constraints.push({\n axis: inequality.axis,\n left: leftIndex,\n right: rightIndex,\n gap: inequality.gap,\n equality: inequality.equality\n });\n });\n }\n\n // add constraints if any\n if (constraints.length > 0) {\n adaptor.constraints(constraints);\n }\n\n // add compound nodes to cola\n adaptor.groups(parentNodes.map(function (node, i) {\n // add basic group incl leaf nodes\n var optPadding = getOptVal(options.nodeSpacing, node);\n var getPadding = function getPadding(d) {\n return parseFloat(node.style('padding-' + d));\n };\n\n var pleft = getPadding('left') + optPadding;\n var pright = getPadding('right') + optPadding;\n var ptop = getPadding('top') + optPadding;\n var pbottom = getPadding('bottom') + optPadding;\n\n node.scratch().cola = {\n index: i,\n\n padding: Math.max(pleft, pright, ptop, pbottom),\n\n // leaves should only contain direct descendants (children),\n // not the leaves of nested compound nodes or any nodes that are compounds themselves\n leaves: node.children().intersection(nonparentNodes).map(function (child) {\n return child[0].scratch().cola.index;\n }),\n\n fixed: node.locked()\n };\n\n return node;\n }).map(function (node) {\n // add subgroups\n node.scratch().cola.groups = node.children().intersection(parentNodes).map(function (child) {\n return child.scratch().cola.index;\n });\n\n return node.scratch().cola;\n }));\n\n // get the edge length setting mechanism\n var length = void 0;\n var lengthFnName = void 0;\n if (options.edgeLength != null) {\n length = options.edgeLength;\n lengthFnName = 'linkDistance';\n } else if (options.edgeSymDiffLength != null) {\n length = options.edgeSymDiffLength;\n lengthFnName = 'symmetricDiffLinkLengths';\n } else if (options.edgeJaccardLength != null) {\n length = options.edgeJaccardLength;\n lengthFnName = 'jaccardLinkLengths';\n } else {\n length = 100;\n lengthFnName = 'linkDistance';\n }\n\n var lengthGetter = function lengthGetter(link) {\n return link.calcLength;\n };\n\n // add the edges to cola\n adaptor.links(edges.stdFilter(function (edge) {\n return nonparentNodes.contains(edge.source()) && nonparentNodes.contains(edge.target());\n }).map(function (edge) {\n var c = edge.scratch().cola = {\n source: edge.source()[0].scratch().cola.index,\n target: edge.target()[0].scratch().cola.index\n };\n\n if (length != null) {\n c.calcLength = getOptVal(length, edge);\n }\n\n return c;\n }));\n\n adaptor.size([bb.w, bb.h]);\n\n if (length != null) {\n adaptor[lengthFnName](lengthGetter);\n }\n\n // set the flow of cola\n if (options.flow) {\n var flow = void 0;\n var defAxis = 'y';\n var defMinSep = 50;\n\n if (isString(options.flow)) {\n flow = {\n axis: options.flow,\n minSeparation: defMinSep\n };\n } else if (isNumber(options.flow)) {\n flow = {\n axis: defAxis,\n minSeparation: options.flow\n };\n } else if (isObject(options.flow)) {\n flow = options.flow;\n\n flow.axis = flow.axis || defAxis;\n flow.minSeparation = flow.minSeparation != null ? flow.minSeparation : defMinSep;\n } else {\n // e.g. options.flow: true\n flow = {\n axis: defAxis,\n minSeparation: defMinSep\n };\n }\n\n adaptor.flowLayout(flow.axis, flow.minSeparation);\n }\n\n layout.trigger({ type: 'layoutstart', layout: layout });\n\n adaptor.avoidOverlaps(options.avoidOverlap).handleDisconnected(options.handleDisconnected).start(options.unconstrIter, options.userConstIter, options.allConstIter);\n\n if (!options.infinite) {\n setTimeout(function () {\n if (!layout.manuallyStopped) {\n adaptor.stop();\n }\n }, options.maxSimulationTime);\n }\n\n return this; // chaining\n};\n\n// called on continuous layouts to stop them before they finish\nColaLayout.prototype.stop = function () {\n if (this.adaptor) {\n this.manuallyStopped = true;\n this.adaptor.stop();\n }\n\n return this; // chaining\n};\n\nmodule.exports = ColaLayout;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// Simple, internal Object.assign() polyfill for options objects etc.\n\nmodule.exports = Object.assign != null ? Object.assign.bind(Object) : function (tgt) {\n for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n srcs[_key - 1] = arguments[_key];\n }\n\n srcs.filter(function (src) {\n return src != null;\n }).forEach(function (src) {\n Object.keys(src).forEach(function (k) {\n return tgt[k] = src[k];\n });\n });\n\n return tgt;\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// default layout options\nvar defaults = {\n animate: true, // whether to show the layout as it's running\n refresh: 1, // number of ticks per frame; higher is faster but more jerky\n maxSimulationTime: 4000, // max length in ms to run the layout\n ungrabifyWhileSimulating: false, // so you can't drag nodes during layout\n fit: true, // on every layout reposition of nodes, fit the viewport\n padding: 30, // padding around the simulation\n boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n nodeDimensionsIncludeLabels: false, // whether labels should be included in determining the space used by a node\n\n // layout event callbacks\n ready: function ready() {}, // on layoutready\n stop: function stop() {}, // on layoutstop\n\n // positioning options\n randomize: false, // use random node positions at beginning of layout\n avoidOverlap: true, // if true, prevents overlap of node bounding boxes\n handleDisconnected: true, // if true, avoids disconnected components from overlapping\n convergenceThreshold: 0.01, // when the alpha value (system energy) falls below this value, the layout stops\n nodeSpacing: function nodeSpacing(node) {\n return 10;\n }, // extra spacing around nodes\n flow: undefined, // use DAG/tree flow layout if specified, e.g. { axis: 'y', minSeparation: 30 }\n alignment: undefined, // relative alignment constraints on nodes, e.g. function( node ){ return { x: 0, y: 1 } }\n gapInequalities: undefined, // list of inequality constraints for the gap between the nodes, e.g. [{\"axis\":\"y\", \"left\":node1, \"right\":node2, \"gap\":25}]\n\n // different methods of specifying edge length\n // each can be a constant numerical value or a function like `function( edge ){ return 2; }`\n edgeLength: undefined, // sets edge length directly in simulation\n edgeSymDiffLength: undefined, // symmetric diff edge length in simulation\n edgeJaccardLength: undefined, // jaccard edge length in simulation\n\n // iterations of cola algorithm; uses default values on undefined\n unconstrIter: undefined, // unconstrained initial layout iterations\n userConstIter: undefined, // initial layout iterations with user-specified constraints\n allConstIter: undefined, // initial layout iterations with all constraints including non-overlap\n\n // infinite layout options\n infinite: false // overrides all other options for a forces-all-the-time mode\n};\n\nmodule.exports = defaults;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar impl = __webpack_require__(0);\n\n// registers the extension on a cytoscape lib ref\nvar register = function register(cytoscape) {\n if (!cytoscape) {\n return;\n } // can't register if cytoscape unspecified\n\n cytoscape('layout', 'cola', impl); // register with cytoscape.js\n};\n\nif (typeof cytoscape !== 'undefined') {\n // expose to global cytoscape (i.e. window.cytoscape)\n register(cytoscape);\n}\n\nmodule.exports = register;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar raf = void 0;\n\nif ((typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) !== ( true ? \"undefined\" : undefined)) {\n raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (fn) {\n return setTimeout(fn, 16);\n };\n} else {\n // if not available, all you get is immediate calls\n raf = function raf(cb) {\n cb();\n };\n}\n\nmodule.exports = raf;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_5__;\n\n/***/ })\n/******/ ]);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9jeXRvc2NhcGUtY29sYS9jeXRvc2NhcGUtY29sYS5qcz8yMzNjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0EsSUFBSSxJQUF5RDtBQUM3RCwyQkFBMkIsbUJBQU8sQ0FBQyxxREFBUztBQUM1QyxNQUFNLEVBSzZDO0FBQ25ELENBQUM7QUFDRCxvQ0FBb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xuICAgICAgICAgIH1cbiAgICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9LFxuXG4gICAga2ljazogZnVuY3Rpb24ga2ljaygpIHtcbiAgICAgIC8vIGtpY2sgb2ZmIHRoZSBzaW11bGF0aW9uXG4gICAgICAvL2xldCBza2lwID0gMDtcblxuICAgICAgdmFyIGZpcnN0VGljayA9IHRydWU7XG5cbiAgICAgIHZhciBpbmZ0aWNrID0gZnVuY3Rpb24gaW5mdGljaygpIHtcbiAgICAgICAgaWYgKGxheW91dC5tYW51YWxseVN0b3BwZWQpIHtcbiAgICAgICAgICBvbkRvbmUoKTtcblxuICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHJldCA9IGFkYXB0b3IudGljaygpO1xuXG4gICAgICAgIGlmICghb3B0aW9ucy5pbmZpbml0ZSAmJiAhZmlyc3RUaWNrKSB7XG4gICAgICAgICAgYWRhcHRvci5jb252ZXJnZW5jZVRocmVzaG9sZChvcHRpb25zLmNvbnZlcmdlbmNlVGhyZXNob2xkKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZpcnN0VGljayA9IGZhbHNlO1xuXG4gICAgICAgIGlmIChyZXQgJiYgb3B0aW9ucy5pbmZpbml0ZSkge1xuICAgICAgICAgIC8vIHJlc3VtZSBsYXlvdXQgaWYgZG9uZVxuICAgICAgICAgIGFkYXB0b3IucmVzdW1lKCk7IC8vIHJlc3VtZSA9PiBuZXcga2lja1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHJldDsgLy8gYWxsb3cgcmVndWxhciBmaW5pc2ggYi9jIG9mIG5ldyBraWNrXG4gICAgICB9O1xuXG4gICAgICB2YXIgbXVsdGl0aWNrID0gZnVuY3Rpb24gbXVsdGl0aWNrKCkge1xuICAgICAgICAvLyBtdWx0aXBsZSB0aWNrcyBpbiBhIHJvd1xuICAgICAgICB2YXIgcmV0ID0gdm9pZCAwO1xuXG4gICAgICAgIGZvciAodmFyIG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AgfSk7XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBpZiAob2Zmc2V0c1gubGVuZ3RoID4gMCkge1xuICAgICAgY29uc3RyYWludHMucHVzaCh7XG4gICAgICAgIHR5cGU6ICdhbGlnbm1lbnQnLFxuICAgICAgICBheGlzOiAneCcsXG4gICAgICAgIG9mZnNldHM6IG9mZnNldHNYXG4gICAgICB9KTtcbiAgICB9XG5cbiAgICBpZiAob2Zmc2V0c1kubGVuZ3RoID4gMCkge1xuICAgICAgY29uc3RyYWludHMucHVzaCh7XG4gICAgICAgIHR5cGU6ICdhbGlnbm1lbnQnLFxuICAgICAgICBheGlzOiAneScsXG4gICAgICAgIG9mZnNldHM6IG9mZnNldHNZXG4gICAgICB9KTtcbiAgICB9XG4gIH1cblxuICAvLyBpZiBnYXBJbmVxdWFsaXRpZXMgdmFyaWFibGUgaXMgc2V0IGFkZCBlYWNoIGluZXF1YWxpdHkgY29uc3RyYWludCB0byBsaXN0IG9mIGNvbnN0cmFpbnRzXG4gIGlmIChvcHRpb25zLmdhcEluZXF1YWxpdGllcykge1xuICAgIG9wdGlvbnMuZ2FwSW5lcXVhbGl0aWVzLmZvckVhY2goZnVuY3Rpb24gKGluZXF1YWxpdHkpIHtcblxuICAgICAgLy8gZm9yIHRoZSBjb25zdHJhaW50cyB0byBiZSBwYXNzZWQgdG8gY29sYSBsYXlvdXQgYWRhcHRvciB1c2UgaW5kaWNlcyBvZiBub2RlcyxcbiAgICAgIC8vIG5vdCB0aGUgbm9kZXMgdGhlbXNlbHZlc1xuICAgICAgdmFyIGxlZnRJbmRleCA9IGluZXF1YWxpdHkubGVmdC5zY3JhdGNoKCkuY29sYS5pbmRleDtcbiAgICAgIHZhciByaWdodEluZGV4ID0gaW5lcXVhbGl0eS5yaWdodC5zY3JhdGNoKCkuY29sYS5pbmRleDtcblxuICAgICAgY29uc3RyYWludHMucHVzaCh7XG4gICAgICAgIGF4aXM6IGluZXF1YWxpdHkuYXhpcyxcbiAgICAgICAgbG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xufSk7Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/cytoscape-cola/cytoscape-cola.js\n"); /***/ }), /***/ "./node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js": /*!***********************************************************************!*\ !*** ./node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js ***! \***********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(/*! cose-base */ \"./node_modules/cose-base/cose-base.js\"));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_0__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_0__;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LayoutConstants = __webpack_require__(0).layoutBase.LayoutConstants;\nvar FDLayoutConstants = __webpack_require__(0).layoutBase.FDLayoutConstants;\nvar CoSEConstants = __webpack_require__(0).CoSEConstants;\nvar CoSELayout = __webpack_require__(0).CoSELayout;\nvar CoSENode = __webpack_require__(0).CoSENode;\nvar PointD = __webpack_require__(0).layoutBase.PointD;\nvar DimensionD = __webpack_require__(0).layoutBase.DimensionD;\n\nvar defaults = {\n // Called on `layoutready`\n ready: function ready() {},\n // Called on `layoutstop`\n stop: function stop() {},\n // 'draft', 'default' or 'proof\" \n // - 'draft' fast cooling rate \n // - 'default' moderate cooling rate \n // - \"proof\" slow cooling rate\n quality: 'default',\n // include labels in node dimensions\n nodeDimensionsIncludeLabels: false,\n // number of ticks per frame; higher is faster but more jerky\n refresh: 30,\n // Whether to fit the network view after when done\n fit: true,\n // Padding on fit\n padding: 10,\n // Whether to enable incremental mode\n randomize: true,\n // Node repulsion (non overlapping) multiplier\n nodeRepulsion: 4500,\n // Ideal edge (non nested) length\n idealEdgeLength: 50,\n // Divisor to compute edge forces\n edgeElasticity: 0.45,\n // Nesting factor (multiplier) to compute ideal edge length for nested edges\n nestingFactor: 0.1,\n // Gravity force (constant)\n gravity: 0.25,\n // Maximum number of iterations to perform\n numIter: 2500,\n // For enabling tiling\n tile: true,\n // Type of layout animation. The option set is {'during', 'end', false}\n animate: 'end',\n // Duration for animate:end\n animationDuration: 500,\n // Represents the amount of the vertical space to put between the zero degree members during the tiling operation(can also be a function)\n tilingPaddingVertical: 10,\n // Represents the amount of the horizontal space to put between the zero degree members during the tiling operation(can also be a function)\n tilingPaddingHorizontal: 10,\n // Gravity range (constant) for compounds\n gravityRangeCompound: 1.5,\n // Gravity force (constant) for compounds\n gravityCompound: 1.0,\n // Gravity range (constant)\n gravityRange: 3.8,\n // Initial cooling factor for incremental layout\n initialEnergyOnIncremental: 0.5\n};\n\nfunction extend(defaults, options) {\n var obj = {};\n\n for (var i in defaults) {\n obj[i] = defaults[i];\n }\n\n for (var i in options) {\n obj[i] = options[i];\n }\n\n return obj;\n};\n\nfunction _CoSELayout(_options) {\n this.options = extend(defaults, _options);\n getUserOptions(this.options);\n}\n\nvar getUserOptions = function getUserOptions(options) {\n if (options.nodeRepulsion != null) CoSEConstants.DEFAULT_REPULSION_STRENGTH = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH = options.nodeRepulsion;\n if (options.idealEdgeLength != null) CoSEConstants.DEFAULT_EDGE_LENGTH = FDLayoutConstants.DEFAULT_EDGE_LENGTH = options.idealEdgeLength;\n if (options.edgeElasticity != null) CoSEConstants.DEFAULT_SPRING_STRENGTH = FDLayoutConstants.DEFAULT_SPRING_STRENGTH = options.edgeElasticity;\n if (options.nestingFactor != null) CoSEConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = options.nestingFactor;\n if (options.gravity != null) CoSEConstants.DEFAULT_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = options.gravity;\n if (options.numIter != null) CoSEConstants.MAX_ITERATIONS = FDLayoutConstants.MAX_ITERATIONS = options.numIter;\n if (options.gravityRange != null) CoSEConstants.DEFAULT_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = options.gravityRange;\n if (options.gravityCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = options.gravityCompound;\n if (options.gravityRangeCompound != null) CoSEConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = options.gravityRangeCompound;\n if (options.initialEnergyOnIncremental != null) CoSEConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = options.initialEnergyOnIncremental;\n\n if (options.quality == 'draft') LayoutConstants.QUALITY = 0;else if (options.quality == 'proof') LayoutConstants.QUALITY = 2;else LayoutConstants.QUALITY = 1;\n\n CoSEConstants.NODE_DIMENSIONS_INCLUDE_LABELS = FDLayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS = options.nodeDimensionsIncludeLabels;\n CoSEConstants.DEFAULT_INCREMENTAL = FDLayoutConstants.DEFAULT_INCREMENTAL = LayoutConstants.DEFAULT_INCREMENTAL = !options.randomize;\n CoSEConstants.ANIMATE = FDLayoutConstants.ANIMATE = LayoutConstants.ANIMATE = options.animate;\n CoSEConstants.TILE = options.tile;\n CoSEConstants.TILING_PADDING_VERTICAL = typeof options.tilingPaddingVertical === 'function' ? options.tilingPaddingVertical.call() : options.tilingPaddingVertical;\n CoSEConstants.TILING_PADDING_HORIZONTAL = typeof options.tilingPaddingHorizontal === 'function' ? options.tilingPaddingHorizontal.call() : options.tilingPaddingHorizontal;\n};\n\n_CoSELayout.prototype.run = function () {\n var ready;\n var frameId;\n var options = this.options;\n var idToLNode = this.idToLNode = {};\n var layout = this.layout = new CoSELayout();\n var self = this;\n\n self.stopped = false;\n\n this.cy = this.options.cy;\n\n this.cy.trigger({ type: 'layoutstart', layout: this });\n\n var gm = layout.newGraphManager();\n this.gm = gm;\n\n var nodes = this.options.eles.nodes();\n var edges = this.options.eles.edges();\n\n this.root = gm.addRoot();\n this.processChildrenList(this.root, this.getTopMostNodes(nodes), layout);\n\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n var sourceNode = this.idToLNode[edge.data(\"source\")];\n var targetNode = this.idToLNode[edge.data(\"target\")];\n if (sourceNode !== targetNode && sourceNode.getEdgesBetween(targetNode).length == 0) {\n var e1 = gm.add(layout.newEdge(), sourceNode, targetNode);\n e1.id = edge.id();\n }\n }\n\n var getPositions = function getPositions(ele, i) {\n if (typeof ele === \"number\") {\n ele = i;\n }\n var theId = ele.data('id');\n var lNode = self.idToLNode[theId];\n\n return {\n x: lNode.getRect().getCenterX(),\n y: lNode.getRect().getCenterY()\n };\n };\n\n /*\n * Reposition nodes in iterations animatedly\n */\n var iterateAnimated = function iterateAnimated() {\n // Thigs to perform after nodes are repositioned on screen\n var afterReposition = function afterReposition() {\n if (options.fit) {\n options.cy.fit(options.eles, options.padding);\n }\n\n if (!ready) {\n ready = true;\n self.cy.one('layoutready', options.ready);\n self.cy.trigger({ type: 'layoutready', layout: self });\n }\n };\n\n var ticksPerFrame = self.options.refresh;\n var isDone;\n\n for (var i = 0; i < ticksPerFrame && !isDone; i++) {\n isDone = self.stopped || self.layout.tick();\n }\n\n // If layout is done\n if (isDone) {\n // If the layout is not a sublayout and it is successful perform post layout.\n if (layout.checkLayoutSuccess() && !layout.isSubLayout) {\n layout.doPostLayout();\n }\n\n // If layout has a tilingPostLayout function property call it.\n if (layout.tilingPostLayout) {\n layout.tilingPostLayout();\n }\n\n layout.isLayoutFinished = true;\n\n self.options.eles.nodes().positions(getPositions);\n\n afterReposition();\n\n // trigger layoutstop when the layout stops (e.g. finishes)\n self.cy.one('layoutstop', self.options.stop);\n self.cy.trigger({ type: 'layoutstop', layout: self });\n\n if (frameId) {\n cancelAnimationFrame(frameId);\n }\n\n ready = false;\n return;\n }\n\n var animationData = self.layout.getPositionsData(); // Get positions of layout nodes note that all nodes may not be layout nodes because of tiling\n\n // Position nodes, for the nodes whose id does not included in data (because they are removed from their parents and included in dummy compounds)\n // use position of their ancestors or dummy ancestors\n options.eles.nodes().positions(function (ele, i) {\n if (typeof ele === \"number\") {\n ele = i;\n }\n // If ele is a compound node, then its position will be defined by its children\n if (!ele.isParent()) {\n var theId = ele.id();\n var pNode = animationData[theId];\n var temp = ele;\n // If pNode is undefined search until finding position data of its first ancestor (It may be dummy as well)\n while (pNode == null) {\n pNode = animationData[temp.data('parent')] || animationData['DummyCompound_' + temp.data('parent')];\n animationData[theId] = pNode;\n temp = temp.parent()[0];\n if (temp == undefined) {\n break;\n }\n }\n if (pNode != null) {\n return {\n x: pNode.x,\n y: pNode.y\n };\n } else {\n return {\n x: ele.position('x'),\n y: ele.position('y')\n };\n }\n }\n });\n\n afterReposition();\n\n frameId = requestAnimationFrame(iterateAnimated);\n };\n\n /*\n * Listen 'layoutstarted' event and start animated iteration if animate option is 'during'\n */\n layout.addListener('layoutstarted', function () {\n if (self.options.animate === 'during') {\n frameId = requestAnimationFrame(iterateAnimated);\n }\n });\n\n layout.runLayout(); // Run cose layout\n\n /*\n * If animate option is not 'during' ('end' or false) perform these here (If it is 'during' similar things are already performed)\n */\n if (this.options.animate !== \"during\") {\n self.options.eles.nodes().not(\":parent\").layoutPositions(self, self.options, getPositions); // Use layout positions to reposition the nodes it considers the options parameter\n ready = false;\n }\n\n return this; // chaining\n};\n\n//Get the top most ones of a list of nodes\n_CoSELayout.prototype.getTopMostNodes = function (nodes) {\n var nodesMap = {};\n for (var i = 0; i < nodes.length; i++) {\n nodesMap[nodes[i].id()] = true;\n }\n var roots = nodes.filter(function (ele, i) {\n if (typeof ele === \"number\") {\n ele = i;\n }\n var parent = ele.parent()[0];\n while (parent != null) {\n if (nodesMap[parent.id()]) {\n return false;\n }\n parent = parent.parent()[0];\n }\n return true;\n });\n\n return roots;\n};\n\n_CoSELayout.prototype.processChildrenList = function (parent, children, layout) {\n var size = children.length;\n for (var i = 0; i < size; i++) {\n var theChild = children[i];\n var children_of_children = theChild.children();\n var theNode;\n\n var dimensions = theChild.layoutDimensions({\n nodeDimensionsIncludeLabels: this.options.nodeDimensionsIncludeLabels\n });\n\n if (theChild.outerWidth() != null && theChild.outerHeight() != null) {\n theNode = parent.add(new CoSENode(layout.graphManager, new PointD(theChild.position('x') - dimensions.w / 2, theChild.position('y') - dimensions.h / 2), new DimensionD(parseFloat(dimensions.w), parseFloat(dimensions.h))));\n } else {\n theNode = parent.add(new CoSENode(this.graphManager));\n }\n // Attach id to the layout node\n theNode.id = theChild.data(\"id\");\n // Attach the paddings of cy node to layout node\n theNode.paddingLeft = parseInt(theChild.css('padding'));\n theNode.paddingTop = parseInt(theChild.css('padding'));\n theNode.paddingRight = parseInt(theChild.css('padding'));\n theNode.paddingBottom = parseInt(theChild.css('padding'));\n\n //Attach the label properties to compound if labels will be included in node dimensions \n if (this.options.nodeDimensionsIncludeLabels) {\n if (theChild.isParent()) {\n var labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false }).w;\n var labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false }).h;\n var labelPos = theChild.css(\"text-halign\");\n theNode.labelWidth = labelWidth;\n theNode.labelHeight = labelHeight;\n theNode.labelPos = labelPos;\n }\n }\n\n // Map the layout node\n this.idToLNode[theChild.data(\"id\")] = theNode;\n\n if (isNaN(theNode.rect.x)) {\n theNode.rect.x = 0;\n }\n\n if (isNaN(theNode.rect.y)) {\n theNode.rect.y = 0;\n }\n\n if (children_of_children != null && children_of_children.length > 0) {\n var theNewGraph;\n theNewGraph = layout.getGraphManager().add(layout.newGraph(), theNode);\n this.processChildrenList(theNewGraph, children_of_children, layout);\n }\n }\n};\n\n/**\n * @brief : called on continuous layouts to stop them before they finish\n */\n_CoSELayout.prototype.stop = function () {\n this.stopped = true;\n\n return this; // chaining\n};\n\nvar register = function register(cytoscape) {\n // var Layout = getLayout( cytoscape );\n\n cytoscape('layout', 'cose-bilkent', _CoSELayout);\n};\n\n// auto reg for globals\nif (typeof cytoscape !== 'undefined') {\n register(cytoscape);\n}\n\nmodule.exports = register;\n\n/***/ })\n/******/ ]);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9jeXRvc2NhcGUtY29zZS1iaWxrZW50L2N5dG9zY2FwZS1jb3NlLWJpbGtlbnQuanM/ZjgxYSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBLElBQUksSUFBeUQ7QUFDN0QsMkJBQTJCLG1CQUFPLENBQUMsd0RBQVc7QUFDOUMsTUFBTSxFQUtxRDtBQUMzRCxDQUFDO0FBQ0Qsb0NBQW9DO0FBQ3BDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxtREFBbUQsY0FBYztB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VuZ3RoID4gMCkge1xuICAgICAgdmFyIHRoZU5ld0dyYXBoO1xuICAgICAgdGhlTmV3R3JhcGggPSBsYXlvdXQuZ2V0R3JhcGhNYW5hZ2VyKCkuYWRkKGxheW91dC5uZXdHcmFwaCgpLCB0aGVOb2RlKTtcbiAgICAgIHRoaXMucHJvY2Vzc0NoaWxkcmVuTGlzdCh0aGVOZXdHcmFwaCwgY2hpbGRyZW5fb2ZfY2hpbGRyZW4sIGxheW91dCk7XG4gICAgfVxuICB9XG59O1xuXG4vKipcbiAqIEBicmllZiA6IGNhbGxlZCBvbiBjb250aW51b3VzIGxheW91dHMgdG8gc3RvcCB0aGVtIGJlZm9yZSB0aGV5IGZpbmlzaFxuICovXG5fQ29TRUxheW91dC5wcm90b3R5cGUuc3RvcCA9IGZ1bmN0aW9uICgpIHtcbiAgdGhpcy5zdG9wcGVkID0gdHJ1ZTtcblxuICByZXR1cm4gdGhpczsgLy8gY2hhaW5pbmdcbn07XG5cbnZhciByZWdpc3RlciA9IGZ1bmN0aW9uIHJlZ2lzdGVyKGN5dG9zY2FwZSkge1xuICAvLyAgdmFyIExheW91dCA9IGdldExheW91dCggY3l0b3NjYXBlICk7XG5cbiAgY3l0b3NjYXBlKCdsYXlvdXQnLCAnY29zZS1iaWxrZW50JywgX0NvU0VMYXlvdXQpO1xufTtcblxuLy8gYXV0byByZWcgZm9yIGdsb2JhbHNcbmlmICh0eXBlb2YgY3l0b3NjYXBlICE9PSAndW5kZWZpbmVkJykge1xuICByZWdpc3RlcihjeXRvc2NhcGUpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHJlZ2lzdGVyO1xuXG4vKioqLyB9KVxuLyoqKioqKi8gXSk7XG59KTsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/cytoscape-cose-bilkent/cytoscape-cose-bilkent.js\n"); /***/ }), /***/ "./node_modules/cytoscape-dagre/cytoscape-dagre.js": /*!*********************************************************!*\ !*** ./node_modules/cytoscape-dagre/cytoscape-dagre.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(/*! dagre */ \"./node_modules/dagre/index.js\"));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_4__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar isFunction = function isFunction(o) {\n return typeof o === 'function';\n};\nvar defaults = __webpack_require__(2);\nvar assign = __webpack_require__(1);\nvar dagre = __webpack_require__(4);\n\n// constructor\n// options : object containing layout options\nfunction DagreLayout(options) {\n this.options = assign({}, defaults, options);\n}\n\n// runs the layout\nDagreLayout.prototype.run = function () {\n var options = this.options;\n var layout = this;\n\n var cy = options.cy; // cy is automatically populated for us in the constructor\n var eles = options.eles;\n\n var getVal = function getVal(ele, val) {\n return isFunction(val) ? val.apply(ele, [ele]) : val;\n };\n\n var bb = options.boundingBox || { x1: 0, y1: 0, w: cy.width(), h: cy.height() };\n if (bb.x2 === undefined) {\n bb.x2 = bb.x1 + bb.w;\n }\n if (bb.w === undefined) {\n bb.w = bb.x2 - bb.x1;\n }\n if (bb.y2 === undefined) {\n bb.y2 = bb.y1 + bb.h;\n }\n if (bb.h === undefined) {\n bb.h = bb.y2 - bb.y1;\n }\n\n var g = new dagre.graphlib.Graph({\n multigraph: true,\n compound: true\n });\n\n var gObj = {};\n var setGObj = function setGObj(name, val) {\n if (val != null) {\n gObj[name] = val;\n }\n };\n\n setGObj('nodesep', options.nodeSep);\n setGObj('edgesep', options.edgeSep);\n setGObj('ranksep', options.rankSep);\n setGObj('rankdir', options.rankDir);\n setGObj('ranker', options.ranker);\n\n g.setGraph(gObj);\n\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n g.setDefaultNodeLabel(function () {\n return {};\n });\n\n // add nodes to dagre\n var nodes = eles.nodes();\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var nbb = node.layoutDimensions(options);\n\n g.setNode(node.id(), {\n width: nbb.w,\n height: nbb.h,\n name: node.id()\n });\n\n // console.log( g.node(node.id()) );\n }\n\n // set compound parents\n for (var _i = 0; _i < nodes.length; _i++) {\n var _node = nodes[_i];\n\n if (_node.isChild()) {\n g.setParent(_node.id(), _node.parent().id());\n }\n }\n\n // add edges to dagre\n var edges = eles.edges().stdFilter(function (edge) {\n return !edge.source().isParent() && !edge.target().isParent(); // dagre can't handle edges on compound nodes\n });\n for (var _i2 = 0; _i2 < edges.length; _i2++) {\n var edge = edges[_i2];\n\n g.setEdge(edge.source().id(), edge.target().id(), {\n minlen: getVal(edge, options.minLen),\n weight: getVal(edge, options.edgeWeight),\n name: edge.id()\n }, edge.id());\n\n // console.log( g.edge(edge.source().id(), edge.target().id(), edge.id()) );\n }\n\n dagre.layout(g);\n\n var gNodeIds = g.nodes();\n for (var _i3 = 0; _i3 < gNodeIds.length; _i3++) {\n var id = gNodeIds[_i3];\n var n = g.node(id);\n\n cy.getElementById(id).scratch().dagre = n;\n }\n\n var dagreBB = void 0;\n\n if (options.boundingBox) {\n dagreBB = { x1: Infinity, x2: -Infinity, y1: Infinity, y2: -Infinity };\n nodes.forEach(function (node) {\n var dModel = node.scratch().dagre;\n\n dagreBB.x1 = Math.min(dagreBB.x1, dModel.x);\n dagreBB.x2 = Math.max(dagreBB.x2, dModel.x);\n\n dagreBB.y1 = Math.min(dagreBB.y1, dModel.y);\n dagreBB.y2 = Math.max(dagreBB.y2, dModel.y);\n });\n\n dagreBB.w = dagreBB.x2 - dagreBB.x1;\n dagreBB.h = dagreBB.y2 - dagreBB.y1;\n } else {\n dagreBB = bb;\n }\n\n var constrainPos = function constrainPos(p) {\n if (options.boundingBox) {\n var xPct = dagreBB.w === 0 ? 0 : (p.x - dagreBB.x1) / dagreBB.w;\n var yPct = dagreBB.h === 0 ? 0 : (p.y - dagreBB.y1) / dagreBB.h;\n\n return {\n x: bb.x1 + xPct * bb.w,\n y: bb.y1 + yPct * bb.h\n };\n } else {\n return p;\n }\n };\n\n nodes.layoutPositions(layout, options, function (ele) {\n ele = (typeof ele === 'undefined' ? 'undefined' : _typeof(ele)) === \"object\" ? ele : this;\n var dModel = ele.scratch().dagre;\n\n return constrainPos({\n x: dModel.x,\n y: dModel.y\n });\n });\n\n return this; // chaining\n};\n\nmodule.exports = DagreLayout;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// Simple, internal Object.assign() polyfill for options objects etc.\n\nmodule.exports = Object.assign != null ? Object.assign.bind(Object) : function (tgt) {\n for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n srcs[_key - 1] = arguments[_key];\n }\n\n srcs.forEach(function (src) {\n Object.keys(src).forEach(function (k) {\n return tgt[k] = src[k];\n });\n });\n\n return tgt;\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar defaults = {\n // dagre algo options, uses default value on undefined\n nodeSep: undefined, // the separation between adjacent nodes in the same rank\n edgeSep: undefined, // the separation between adjacent edges in the same rank\n rankSep: undefined, // the separation between adjacent nodes in the same rank\n rankDir: undefined, // 'TB' for top to bottom flow, 'LR' for left to right,\n ranker: undefined, // Type of algorithm to assigns a rank to each node in the input graph.\n // Possible values: network-simplex, tight-tree or longest-path\n minLen: function minLen(edge) {\n return 1;\n }, // number of ranks to keep between the source and target of the edge\n edgeWeight: function edgeWeight(edge) {\n return 1;\n }, // higher weight edges are generally made shorter and straighter than lower weight edges\n\n // general layout options\n fit: true, // whether to fit to viewport\n padding: 30, // fit padding\n spacingFactor: undefined, // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n nodeDimensionsIncludeLabels: false, // whether labels should be included in determining the space used by a node\n animate: false, // whether to transition the node positions\n animateFilter: function animateFilter(node, i) {\n return true;\n }, // whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions\n animationDuration: 500, // duration of animation in ms if enabled\n animationEasing: undefined, // easing of animation if enabled\n boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n transform: function transform(node, pos) {\n return pos;\n }, // a function that applies a transform to the final node position\n ready: function ready() {}, // on layoutready\n stop: function stop() {} // on layoutstop\n};\n\nmodule.exports = defaults;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar impl = __webpack_require__(0);\n\n// registers the extension on a cytoscape lib ref\nvar register = function register(cytoscape) {\n if (!cytoscape) {\n return;\n } // can't register if cytoscape unspecified\n\n cytoscape('layout', 'dagre', impl); // register with cytoscape.js\n};\n\nif (typeof cytoscape !== 'undefined') {\n // expose to global cytoscape (i.e. window.cytoscape)\n register(cytoscape);\n}\n\nmodule.exports = register;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ })\n/******/ ]);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9jeXRvc2NhcGUtZGFncmUvY3l0b3NjYXBlLWRhZ3JlLmpzP2IxN2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V4cG9zZSB0byBnbG9iYWwgY3l0b3NjYXBlIChpLmUuIHdpbmRvdy5jeXRvc2NhcGUpXG4gIHJlZ2lzdGVyKGN5dG9zY2FwZSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gcmVnaXN0ZXI7XG5cbi8qKiovIH0pLFxuLyogNCAqL1xuLyoqKi8gKGZ1bmN0aW9uKG1vZHVsZSwgZXhwb3J0cykge1xuXG5tb2R1bGUuZXhwb3J0cyA9IF9fV0VCUEFDS19FWFRFUk5BTF9NT0RVTEVfNF9fO1xuXG4vKioqLyB9KVxuLyoqKioqKi8gXSk7XG59KTsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/cytoscape-dagre/cytoscape-dagre.js\n"); /***/ }), /***/ "./node_modules/cytoscape-euler/cytoscape-euler.js": /*!*********************************************************!*\ !*** ./node_modules/cytoscape-euler/cytoscape-euler.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse {}\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 11);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = Object.assign != null ? Object.assign.bind(Object) : function (tgt) {\n for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n srcs[_key - 1] = arguments[_key];\n }\n\n srcs.forEach(function (src) {\n Object.keys(src).forEach(function (k) {\n return tgt[k] = src[k];\n });\n });\n\n return tgt;\n};\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar assign = __webpack_require__(0);\n\nvar defaults = Object.freeze({\n source: null,\n target: null,\n length: 80,\n coeff: 0.0002,\n weight: 1\n});\n\nfunction makeSpring(spring) {\n return assign({}, defaults, spring);\n}\n\nfunction applySpring(spring) {\n var body1 = spring.source,\n body2 = spring.target,\n length = spring.length < 0 ? defaults.length : spring.length,\n dx = body2.pos.x - body1.pos.x,\n dy = body2.pos.y - body1.pos.y,\n r = Math.sqrt(dx * dx + dy * dy);\n\n if (r === 0) {\n dx = (Math.random() - 0.5) / 50;\n dy = (Math.random() - 0.5) / 50;\n r = Math.sqrt(dx * dx + dy * dy);\n }\n\n var d = r - length;\n var coeff = (!spring.coeff || spring.coeff < 0 ? defaults.springCoeff : spring.coeff) * d / r * spring.weight;\n\n body1.force.x += coeff * dx;\n body1.force.y += coeff * dy;\n\n body2.force.x -= coeff * dx;\n body2.force.y -= coeff * dy;\n}\n\nmodule.exports = { makeSpring: makeSpring, applySpring: applySpring };\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\nThe implementation of the Euler layout algorithm\n*/\n\nvar Layout = __webpack_require__(13);\nvar assign = __webpack_require__(0);\nvar defaults = __webpack_require__(4);\n\nvar _require = __webpack_require__(10),\n _tick = _require.tick;\n\nvar _require2 = __webpack_require__(7),\n makeQuadtree = _require2.makeQuadtree;\n\nvar _require3 = __webpack_require__(3),\n makeBody = _require3.makeBody;\n\nvar _require4 = __webpack_require__(1),\n makeSpring = _require4.makeSpring;\n\nvar isFn = function isFn(fn) {\n return typeof fn === 'function';\n};\nvar isParent = function isParent(n) {\n return n.isParent();\n};\nvar notIsParent = function notIsParent(n) {\n return !isParent(n);\n};\nvar isLocked = function isLocked(n) {\n return n.locked();\n};\nvar notIsLocked = function notIsLocked(n) {\n return !isLocked(n);\n};\nvar isParentEdge = function isParentEdge(e) {\n return isParent(e.source()) || isParent(e.target());\n};\nvar notIsParentEdge = function notIsParentEdge(e) {\n return !isParentEdge(e);\n};\nvar getBody = function getBody(n) {\n return n.scratch('euler').body;\n};\nvar getNonParentDescendants = function getNonParentDescendants(n) {\n return isParent(n) ? n.descendants().filter(notIsParent) : n;\n};\n\nvar getScratch = function getScratch(el) {\n var scratch = el.scratch('euler');\n\n if (!scratch) {\n scratch = {};\n\n el.scratch('euler', scratch);\n }\n\n return scratch;\n};\n\nvar optFn = function optFn(opt, ele) {\n if (isFn(opt)) {\n return opt(ele);\n } else {\n return opt;\n }\n};\n\nvar Euler = function (_Layout) {\n _inherits(Euler, _Layout);\n\n function Euler(options) {\n _classCallCheck(this, Euler);\n\n return _possibleConstructorReturn(this, (Euler.__proto__ || Object.getPrototypeOf(Euler)).call(this, assign({}, defaults, options)));\n }\n\n _createClass(Euler, [{\n key: 'prerun',\n value: function prerun(state) {\n var s = state;\n\n s.quadtree = makeQuadtree();\n\n var bodies = s.bodies = [];\n\n // regular nodes\n s.nodes.filter(function (n) {\n return notIsParent(n);\n }).forEach(function (n) {\n var scratch = getScratch(n);\n\n var body = makeBody({\n pos: { x: scratch.x, y: scratch.y },\n mass: optFn(s.mass, n),\n locked: scratch.locked\n });\n\n body._cyNode = n;\n\n scratch.body = body;\n\n body._scratch = scratch;\n\n bodies.push(body);\n });\n\n var springs = s.springs = [];\n\n // regular edge springs\n s.edges.filter(notIsParentEdge).forEach(function (e) {\n var spring = makeSpring({\n source: getBody(e.source()),\n target: getBody(e.target()),\n length: optFn(s.springLength, e),\n coeff: optFn(s.springCoeff, e)\n });\n\n spring._cyEdge = e;\n\n var scratch = getScratch(e);\n\n spring._scratch = scratch;\n\n scratch.spring = spring;\n\n springs.push(spring);\n });\n\n // compound edge springs\n s.edges.filter(isParentEdge).forEach(function (e) {\n var sources = getNonParentDescendants(e.source());\n var targets = getNonParentDescendants(e.target());\n\n // just add one spring for perf\n sources = [sources[0]];\n targets = [targets[0]];\n\n sources.forEach(function (src) {\n targets.forEach(function (tgt) {\n springs.push(makeSpring({\n source: getBody(src),\n target: getBody(tgt),\n length: optFn(s.springLength, e),\n coeff: optFn(s.springCoeff, e)\n }));\n });\n });\n });\n }\n }, {\n key: 'tick',\n value: function tick(state) {\n var movement = _tick(state);\n\n var isDone = movement <= state.movementThreshold;\n\n return isDone;\n }\n }]);\n\n return Euler;\n}(Layout);\n\nmodule.exports = Euler;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar defaults = Object.freeze({\n pos: { x: 0, y: 0 },\n prevPos: { x: 0, y: 0 },\n force: { x: 0, y: 0 },\n velocity: { x: 0, y: 0 },\n mass: 1\n});\n\nvar copyVec = function copyVec(v) {\n return { x: v.x, y: v.y };\n};\nvar getValue = function getValue(val, def) {\n return val != null ? val : def;\n};\nvar getVec = function getVec(vec, def) {\n return copyVec(getValue(vec, def));\n};\n\nfunction makeBody(opts) {\n var b = {};\n\n b.pos = getVec(opts.pos, defaults.pos);\n b.prevPos = getVec(opts.prevPos, b.pos);\n b.force = getVec(opts.force, defaults.force);\n b.velocity = getVec(opts.velocity, defaults.velocity);\n b.mass = opts.mass != null ? opts.mass : defaults.mass;\n b.locked = opts.locked;\n\n return b;\n}\n\nmodule.exports = { makeBody: makeBody };\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar defaults = Object.freeze({\n // The ideal legth of a spring\n // - This acts as a hint for the edge length\n // - The edge length can be longer or shorter if the forces are set to extreme values\n springLength: function springLength(edge) {\n return 80;\n },\n\n // Hooke's law coefficient\n // - The value ranges on [0, 1]\n // - Lower values give looser springs\n // - Higher values give tighter springs\n springCoeff: function springCoeff(edge) {\n return 0.0008;\n },\n\n // The mass of the node in the physics simulation\n // - The mass affects the gravity node repulsion/attraction\n mass: function mass(node) {\n return 4;\n },\n\n // Coulomb's law coefficient\n // - Makes the nodes repel each other for negative values\n // - Makes the nodes attract each other for positive values\n gravity: -1.2,\n\n // A force that pulls nodes towards the origin (0, 0)\n // Higher values keep the components less spread out\n pull: 0.001,\n\n // Theta coefficient from Barnes-Hut simulation\n // - Value ranges on [0, 1]\n // - Performance is better with smaller values\n // - Very small values may not create enough force to give a good result\n theta: 0.666,\n\n // Friction / drag coefficient to make the system stabilise over time\n dragCoeff: 0.02,\n\n // When the total of the squared position deltas is less than this value, the simulation ends\n movementThreshold: 1,\n\n // The amount of time passed per tick\n // - Larger values result in faster runtimes but might spread things out too far\n // - Smaller values produce more accurate results\n timeStep: 20\n});\n\nmodule.exports = defaults;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar defaultCoeff = 0.02;\n\nfunction applyDrag(body, manualDragCoeff) {\n var dragCoeff = void 0;\n\n if (manualDragCoeff != null) {\n dragCoeff = manualDragCoeff;\n } else if (body.dragCoeff != null) {\n dragCoeff = body.dragCoeff;\n } else {\n dragCoeff = defaultCoeff;\n }\n\n body.force.x -= dragCoeff * body.velocity.x;\n body.force.y -= dragCoeff * body.velocity.y;\n}\n\nmodule.exports = { applyDrag: applyDrag };\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// use euler method for force integration http://en.wikipedia.org/wiki/Euler_method\n// return sum of squared position deltas\nfunction integrate(bodies, timeStep) {\n var dx = 0,\n tx = 0,\n dy = 0,\n ty = 0,\n i,\n max = bodies.length;\n\n if (max === 0) {\n return 0;\n }\n\n for (i = 0; i < max; ++i) {\n var body = bodies[i],\n coeff = timeStep / body.mass;\n\n if (body.grabbed) {\n continue;\n }\n\n if (body.locked) {\n body.velocity.x = 0;\n body.velocity.y = 0;\n } else {\n body.velocity.x += coeff * body.force.x;\n body.velocity.y += coeff * body.force.y;\n }\n\n var vx = body.velocity.x,\n vy = body.velocity.y,\n v = Math.sqrt(vx * vx + vy * vy);\n\n if (v > 1) {\n body.velocity.x = vx / v;\n body.velocity.y = vy / v;\n }\n\n dx = timeStep * body.velocity.x;\n dy = timeStep * body.velocity.y;\n\n body.pos.x += dx;\n body.pos.y += dy;\n\n tx += Math.abs(dx);ty += Math.abs(dy);\n }\n\n return (tx * tx + ty * ty) / max;\n}\n\nmodule.exports = { integrate: integrate };\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// impl of barnes hut\n// http://www.eecs.berkeley.edu/~demmel/cs267/lecture26/lecture26.html\n// http://en.wikipedia.org/wiki/Barnes%E2%80%93Hut_simulation\n\nvar Node = __webpack_require__(9);\nvar InsertStack = __webpack_require__(8);\n\nvar resetVec = function resetVec(v) {\n v.x = 0;v.y = 0;\n};\n\nvar isSamePosition = function isSamePosition(p1, p2) {\n var threshold = 1e-8;\n var dx = Math.abs(p1.x - p2.x);\n var dy = Math.abs(p1.y - p2.y);\n\n return dx < threshold && dy < threshold;\n};\n\nfunction makeQuadtree() {\n var updateQueue = [],\n insertStack = new InsertStack(),\n nodesCache = [],\n currentInCache = 0,\n root = newNode();\n\n function newNode() {\n // To avoid pressure on GC we reuse nodes.\n var node = nodesCache[currentInCache];\n if (node) {\n node.quad0 = null;\n node.quad1 = null;\n node.quad2 = null;\n node.quad3 = null;\n node.body = null;\n node.mass = node.massX = node.massY = 0;\n node.left = node.right = node.top = node.bottom = 0;\n } else {\n node = new Node();\n nodesCache[currentInCache] = node;\n }\n\n ++currentInCache;\n return node;\n }\n\n function update(sourceBody, gravity, theta, pull) {\n var queue = updateQueue,\n v = void 0,\n dx = void 0,\n dy = void 0,\n r = void 0,\n fx = 0,\n fy = 0,\n queueLength = 1,\n shiftIdx = 0,\n pushIdx = 1;\n\n queue[0] = root;\n\n resetVec(sourceBody.force);\n\n var px = -sourceBody.pos.x;\n var py = -sourceBody.pos.y;\n var pr = Math.sqrt(px * px + py * py);\n var pv = sourceBody.mass * pull / pr;\n\n fx += pv * px;\n fy += pv * py;\n\n while (queueLength) {\n var node = queue[shiftIdx],\n body = node.body;\n\n queueLength -= 1;\n shiftIdx += 1;\n var differentBody = body !== sourceBody;\n if (body && differentBody) {\n // If the current node is a leaf node (and it is not source body),\n // calculate the force exerted by the current node on body, and add this\n // amount to body's net force.\n dx = body.pos.x - sourceBody.pos.x;\n dy = body.pos.y - sourceBody.pos.y;\n r = Math.sqrt(dx * dx + dy * dy);\n\n if (r === 0) {\n // Poor man's protection against zero distance.\n dx = (Math.random() - 0.5) / 50;\n dy = (Math.random() - 0.5) / 50;\n r = Math.sqrt(dx * dx + dy * dy);\n }\n\n // This is standard gravition force calculation but we divide\n // by r^3 to save two operations when normalizing force vector.\n v = gravity * body.mass * sourceBody.mass / (r * r * r);\n fx += v * dx;\n fy += v * dy;\n } else if (differentBody) {\n // Otherwise, calculate the ratio s / r, where s is the width of the region\n // represented by the internal node, and r is the distance between the body\n // and the node's center-of-mass\n dx = node.massX / node.mass - sourceBody.pos.x;\n dy = node.massY / node.mass - sourceBody.pos.y;\n r = Math.sqrt(dx * dx + dy * dy);\n\n if (r === 0) {\n // Sorry about code duplucation. I don't want to create many functions\n // right away. Just want to see performance first.\n dx = (Math.random() - 0.5) / 50;\n dy = (Math.random() - 0.5) / 50;\n r = Math.sqrt(dx * dx + dy * dy);\n }\n // If s / r < θ, treat this internal node as a single body, and calculate the\n // force it exerts on sourceBody, and add this amount to sourceBody's net force.\n if ((node.right - node.left) / r < theta) {\n // in the if statement above we consider node's width only\n // because the region was squarified during tree creation.\n // Thus there is no difference between using width or height.\n v = gravity * node.mass * sourceBody.mass / (r * r * r);\n fx += v * dx;\n fy += v * dy;\n } else {\n // Otherwise, run the procedure recursively on each of the current node's children.\n\n // I intentionally unfolded this loop, to save several CPU cycles.\n if (node.quad0) {\n queue[pushIdx] = node.quad0;\n queueLength += 1;\n pushIdx += 1;\n }\n if (node.quad1) {\n queue[pushIdx] = node.quad1;\n queueLength += 1;\n pushIdx += 1;\n }\n if (node.quad2) {\n queue[pushIdx] = node.quad2;\n queueLength += 1;\n pushIdx += 1;\n }\n if (node.quad3) {\n queue[pushIdx] = node.quad3;\n queueLength += 1;\n pushIdx += 1;\n }\n }\n }\n }\n\n sourceBody.force.x += fx;\n sourceBody.force.y += fy;\n }\n\n function insertBodies(bodies) {\n if (bodies.length === 0) {\n return;\n }\n\n var x1 = Number.MAX_VALUE,\n y1 = Number.MAX_VALUE,\n x2 = Number.MIN_VALUE,\n y2 = Number.MIN_VALUE,\n i = void 0,\n max = bodies.length;\n\n // To reduce quad tree depth we are looking for exact bounding box of all particles.\n i = max;\n while (i--) {\n var x = bodies[i].pos.x;\n var y = bodies[i].pos.y;\n if (x < x1) {\n x1 = x;\n }\n if (x > x2) {\n x2 = x;\n }\n if (y < y1) {\n y1 = y;\n }\n if (y > y2) {\n y2 = y;\n }\n }\n\n // Squarify the bounds.\n var dx = x2 - x1,\n dy = y2 - y1;\n if (dx > dy) {\n y2 = y1 + dx;\n } else {\n x2 = x1 + dy;\n }\n\n currentInCache = 0;\n root = newNode();\n root.left = x1;\n root.right = x2;\n root.top = y1;\n root.bottom = y2;\n\n i = max - 1;\n if (i >= 0) {\n root.body = bodies[i];\n }\n while (i--) {\n insert(bodies[i], root);\n }\n }\n\n function insert(newBody) {\n insertStack.reset();\n insertStack.push(root, newBody);\n\n while (!insertStack.isEmpty()) {\n var stackItem = insertStack.pop(),\n node = stackItem.node,\n body = stackItem.body;\n\n if (!node.body) {\n // This is internal node. Update the total mass of the node and center-of-mass.\n var x = body.pos.x;\n var y = body.pos.y;\n node.mass = node.mass + body.mass;\n node.massX = node.massX + body.mass * x;\n node.massY = node.massY + body.mass * y;\n\n // Recursively insert the body in the appropriate quadrant.\n // But first find the appropriate quadrant.\n var quadIdx = 0,\n // Assume we are in the 0's quad.\n left = node.left,\n right = (node.right + left) / 2,\n top = node.top,\n bottom = (node.bottom + top) / 2;\n\n if (x > right) {\n // somewhere in the eastern part.\n quadIdx = quadIdx + 1;\n left = right;\n right = node.right;\n }\n if (y > bottom) {\n // and in south.\n quadIdx = quadIdx + 2;\n top = bottom;\n bottom = node.bottom;\n }\n\n var child = getChild(node, quadIdx);\n if (!child) {\n // The node is internal but this quadrant is not taken. Add\n // subnode to it.\n child = newNode();\n child.left = left;\n child.top = top;\n child.right = right;\n child.bottom = bottom;\n child.body = body;\n\n setChild(node, quadIdx, child);\n } else {\n // continue searching in this quadrant.\n insertStack.push(child, body);\n }\n } else {\n // We are trying to add to the leaf node.\n // We have to convert current leaf into internal node\n // and continue adding two nodes.\n var oldBody = node.body;\n node.body = null; // internal nodes do not cary bodies\n\n if (isSamePosition(oldBody.pos, body.pos)) {\n // Prevent infinite subdivision by bumping one node\n // anywhere in this quadrant\n var retriesCount = 3;\n do {\n var offset = Math.random();\n var dx = (node.right - node.left) * offset;\n var dy = (node.bottom - node.top) * offset;\n\n oldBody.pos.x = node.left + dx;\n oldBody.pos.y = node.top + dy;\n retriesCount -= 1;\n // Make sure we don't bump it out of the box. If we do, next iteration should fix it\n } while (retriesCount > 0 && isSamePosition(oldBody.pos, body.pos));\n\n if (retriesCount === 0 && isSamePosition(oldBody.pos, body.pos)) {\n // This is very bad, we ran out of precision.\n // if we do not return from the method we'll get into\n // infinite loop here. So we sacrifice correctness of layout, and keep the app running\n // Next layout iteration should get larger bounding box in the first step and fix this\n return;\n }\n }\n // Next iteration should subdivide node further.\n insertStack.push(node, oldBody);\n insertStack.push(node, body);\n }\n }\n }\n\n return {\n insertBodies: insertBodies,\n updateBodyForce: update\n };\n}\n\nfunction getChild(node, idx) {\n if (idx === 0) return node.quad0;\n if (idx === 1) return node.quad1;\n if (idx === 2) return node.quad2;\n if (idx === 3) return node.quad3;\n return null;\n}\n\nfunction setChild(node, idx, child) {\n if (idx === 0) node.quad0 = child;else if (idx === 1) node.quad1 = child;else if (idx === 2) node.quad2 = child;else if (idx === 3) node.quad3 = child;\n}\n\nmodule.exports = { makeQuadtree: makeQuadtree };\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = InsertStack;\n\n/**\n * Our implmentation of QuadTree is non-recursive to avoid GC hit\n * This data structure represent stack of elements\n * which we are trying to insert into quad tree.\n */\nfunction InsertStack() {\n this.stack = [];\n this.popIdx = 0;\n}\n\nInsertStack.prototype = {\n isEmpty: function isEmpty() {\n return this.popIdx === 0;\n },\n push: function push(node, body) {\n var item = this.stack[this.popIdx];\n if (!item) {\n // we are trying to avoid memory pressue: create new element\n // only when absolutely necessary\n this.stack[this.popIdx] = new InsertStackElement(node, body);\n } else {\n item.node = node;\n item.body = body;\n }\n ++this.popIdx;\n },\n pop: function pop() {\n if (this.popIdx > 0) {\n return this.stack[--this.popIdx];\n }\n },\n reset: function reset() {\n this.popIdx = 0;\n }\n};\n\nfunction InsertStackElement(node, body) {\n this.node = node; // QuadTree node\n this.body = body; // physical body which needs to be inserted to node\n}\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Internal data structure to represent 2D QuadTree node\n */\nmodule.exports = function Node() {\n // body stored inside this node. In quad tree only leaf nodes (by construction)\n // contain boides:\n this.body = null;\n\n // Child nodes are stored in quads. Each quad is presented by number:\n // 0 | 1\n // -----\n // 2 | 3\n this.quad0 = null;\n this.quad1 = null;\n this.quad2 = null;\n this.quad3 = null;\n\n // Total mass of current node\n this.mass = 0;\n\n // Center of mass coordinates\n this.massX = 0;\n this.massY = 0;\n\n // bounding box coordinates\n this.left = 0;\n this.top = 0;\n this.bottom = 0;\n this.right = 0;\n};\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _require = __webpack_require__(6),\n integrate = _require.integrate;\n\nvar _require2 = __webpack_require__(5),\n applyDrag = _require2.applyDrag;\n\nvar _require3 = __webpack_require__(1),\n applySpring = _require3.applySpring;\n\nfunction tick(_ref) {\n var bodies = _ref.bodies,\n springs = _ref.springs,\n quadtree = _ref.quadtree,\n timeStep = _ref.timeStep,\n gravity = _ref.gravity,\n theta = _ref.theta,\n dragCoeff = _ref.dragCoeff,\n pull = _ref.pull;\n\n // update body from scratch in case of any changes\n bodies.forEach(function (body) {\n var p = body._scratch;\n\n if (!p) {\n return;\n }\n\n body.locked = p.locked;\n body.grabbed = p.grabbed;\n body.pos.x = p.x;\n body.pos.y = p.y;\n });\n\n quadtree.insertBodies(bodies);\n\n for (var i = 0; i < bodies.length; i++) {\n var body = bodies[i];\n\n quadtree.updateBodyForce(body, gravity, theta, pull);\n applyDrag(body, dragCoeff);\n }\n\n for (var _i = 0; _i < springs.length; _i++) {\n var spring = springs[_i];\n\n applySpring(spring);\n }\n\n var movement = integrate(bodies, timeStep);\n\n // update scratch positions from body positions\n bodies.forEach(function (body) {\n var p = body._scratch;\n\n if (!p) {\n return;\n }\n\n p.x = body.pos.x;\n p.y = body.pos.y;\n });\n\n return movement;\n}\n\nmodule.exports = { tick: tick };\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar Euler = __webpack_require__(2);\n\n// registers the extension on a cytoscape lib ref\nvar register = function register(cytoscape) {\n if (!cytoscape) {\n return;\n } // can't register if cytoscape unspecified\n\n cytoscape('layout', 'euler', Euler); // register with cytoscape.js\n};\n\nif (typeof cytoscape !== 'undefined') {\n // expose to global cytoscape (i.e. window.cytoscape)\n register(cytoscape);\n}\n\nmodule.exports = register;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// general default options for force-directed layout\n\nmodule.exports = Object.freeze({\n animate: true, // whether to show the layout as it's running; special 'end' value makes the layout animate like a discrete layout\n refresh: 10, // number of ticks per frame; higher is faster but more jerky\n maxIterations: 1000, // max iterations before the layout will bail out\n maxSimulationTime: 4000, // max length in ms to run the layout\n ungrabifyWhileSimulating: false, // so you can't drag nodes during layout\n fit: true, // on every layout reposition of nodes, fit the viewport\n padding: 30, // padding around the simulation\n boundingBox: undefined, // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n\n // layout event callbacks\n ready: function ready() {}, // on layoutready\n stop: function stop() {}, // on layoutstop\n\n // positioning options\n randomize: false, // use random node positions at beginning of layout\n\n // infinite layout options\n infinite: false // overrides all other options for a forces-all-the-time mode\n});\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\nA generic continuous layout class\n*/\n\nvar assign = __webpack_require__(0);\nvar defaults = __webpack_require__(12);\nvar makeBoundingBox = __webpack_require__(14);\n\nvar _require = __webpack_require__(15),\n setInitialPositionState = _require.setInitialPositionState,\n refreshPositions = _require.refreshPositions,\n getNodePositionData = _require.getNodePositionData;\n\nvar _require2 = __webpack_require__(16),\n multitick = _require2.multitick;\n\nvar Layout = function () {\n function Layout(options) {\n _classCallCheck(this, Layout);\n\n var o = this.options = assign({}, defaults, options);\n\n var s = this.state = assign({}, o, {\n layout: this,\n nodes: o.eles.nodes(),\n edges: o.eles.edges(),\n tickIndex: 0,\n firstUpdate: true\n });\n\n s.animateEnd = o.animate && o.animate === 'end';\n s.animateContinuously = o.animate && !s.animateEnd;\n }\n\n _createClass(Layout, [{\n key: 'run',\n value: function run() {\n var l = this;\n var s = this.state;\n\n s.tickIndex = 0;\n s.firstUpdate = true;\n s.startTime = Date.now();\n s.running = true;\n\n s.currentBoundingBox = makeBoundingBox(s.boundingBox, s.cy);\n\n if (s.ready) {\n l.one('ready', s.ready);\n }\n if (s.stop) {\n l.one('stop', s.stop);\n }\n\n s.nodes.forEach(function (n) {\n return setInitialPositionState(n, s);\n });\n\n l.prerun(s);\n\n if (s.animateContinuously) {\n var ungrabify = function ungrabify(node) {\n if (!s.ungrabifyWhileSimulating) {\n return;\n }\n\n var grabbable = getNodePositionData(node, s).grabbable = node.grabbable();\n\n if (grabbable) {\n node.ungrabify();\n }\n };\n\n var regrabify = function regrabify(node) {\n if (!s.ungrabifyWhileSimulating) {\n return;\n }\n\n var grabbable = getNodePositionData(node, s).grabbable;\n\n if (grabbable) {\n node.grabify();\n }\n };\n\n var updateGrabState = function updateGrabState(node) {\n return getNodePositionData(node, s).grabbed = node.grabbed();\n };\n\n var onGrab = function onGrab(_ref) {\n var target = _ref.target;\n\n updateGrabState(target);\n };\n\n var onFree = onGrab;\n\n var onDrag = function onDrag(_ref2) {\n var target = _ref2.target;\n\n var p = getNodePositionData(target, s);\n var tp = target.position();\n\n p.x = tp.x;\n p.y = tp.y;\n };\n\n var listenToGrab = function listenToGrab(node) {\n node.on('grab', onGrab);\n node.on('free', onFree);\n node.on('drag', onDrag);\n };\n\n var unlistenToGrab = function unlistenToGrab(node) {\n node.removeListener('grab', onGrab);\n node.removeListener('free', onFree);\n node.removeListener('drag', onDrag);\n };\n\n var fit = function fit() {\n if (s.fit && s.animateContinuously) {\n s.cy.fit(s.padding);\n }\n };\n\n var onNotDone = function onNotDone() {\n refreshPositions(s.nodes, s);\n fit();\n\n requestAnimationFrame(_frame);\n };\n\n var _frame = function _frame() {\n multitick(s, onNotDone, _onDone);\n };\n\n var _onDone = function _onDone() {\n refreshPositions(s.nodes, s);\n fit();\n\n s.nodes.forEach(function (n) {\n regrabify(n);\n unlistenToGrab(n);\n });\n\n s.running = false;\n\n l.emit('layoutstop');\n };\n\n l.emit('layoutstart');\n\n s.nodes.forEach(function (n) {\n ungrabify(n);\n listenToGrab(n);\n });\n\n _frame(); // kick off\n } else {\n var done = false;\n var _onNotDone = function _onNotDone() {};\n var _onDone2 = function _onDone2() {\n return done = true;\n };\n\n while (!done) {\n multitick(s, _onNotDone, _onDone2);\n }\n\n s.eles.layoutPositions(this, s, function (node) {\n var pd = getNodePositionData(node, s);\n\n return { x: pd.x, y: pd.y };\n });\n }\n\n l.postrun(s);\n\n return this; // chaining\n }\n }, {\n key: 'prerun',\n value: function prerun() {}\n }, {\n key: 'postrun',\n value: function postrun() {}\n }, {\n key: 'tick',\n value: function tick() {}\n }, {\n key: 'stop',\n value: function stop() {\n this.state.running = false;\n\n return this; // chaining\n }\n }, {\n key: 'destroy',\n value: function destroy() {\n return this; // chaining\n }\n }]);\n\n return Layout;\n}();\n\nmodule.exports = Layout;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = function (bb, cy) {\n if (bb == null) {\n bb = { x1: 0, y1: 0, w: cy.width(), h: cy.height() };\n } else {\n // copy\n bb = { x1: bb.x1, x2: bb.x2, y1: bb.y1, y2: bb.y2, w: bb.w, h: bb.h };\n }\n\n if (bb.x2 == null) {\n bb.x2 = bb.x1 + bb.w;\n }\n if (bb.w == null) {\n bb.w = bb.x2 - bb.x1;\n }\n if (bb.y2 == null) {\n bb.y2 = bb.y1 + bb.h;\n }\n if (bb.h == null) {\n bb.h = bb.y2 - bb.y1;\n }\n\n return bb;\n};\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar assign = __webpack_require__(0);\n\nvar setInitialPositionState = function setInitialPositionState(node, state) {\n var p = node.position();\n var bb = state.currentBoundingBox;\n var scratch = node.scratch(state.name);\n\n if (scratch == null) {\n scratch = {};\n\n node.scratch(state.name, scratch);\n }\n\n assign(scratch, state.randomize ? {\n x: bb.x1 + Math.random() * bb.w,\n y: bb.y1 + Math.random() * bb.h\n } : {\n x: p.x,\n y: p.y\n });\n\n scratch.locked = node.locked();\n};\n\nvar getNodePositionData = function getNodePositionData(node, state) {\n return node.scratch(state.name);\n};\n\nvar refreshPositions = function refreshPositions(nodes, state) {\n nodes.positions(function (node) {\n var scratch = node.scratch(state.name);\n\n return {\n x: scratch.x,\n y: scratch.y\n };\n });\n};\n\nmodule.exports = { setInitialPositionState: setInitialPositionState, getNodePositionData: getNodePositionData, refreshPositions: refreshPositions };\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar nop = function nop() {};\n\nvar tick = function tick(state) {\n var s = state;\n var l = state.layout;\n\n var tickIndicatesDone = l.tick(s);\n\n if (s.firstUpdate) {\n if (s.animateContinuously) {\n // indicate the initial positions have been set\n s.layout.emit('layoutready');\n }\n s.firstUpdate = false;\n }\n\n s.tickIndex++;\n\n var duration = Date.now() - s.startTime;\n\n return !s.infinite && (tickIndicatesDone || s.tickIndex >= s.maxIterations || duration >= s.maxSimulationTime);\n};\n\nvar multitick = function multitick(state) {\n var onNotDone = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : nop;\n var onDone = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : nop;\n\n var done = false;\n var s = state;\n\n for (var i = 0; i < s.refresh; i++) {\n done = !s.running || tick(s);\n\n if (done) {\n break;\n }\n }\n\n if (!done) {\n onNotDone();\n } else {\n onDone();\n }\n};\n\nmodule.exports = { tick: tick, multitick: multitick };\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCA2MGFhNzhlOTI4NDc1MThmZDBmMyIsIndlYnBhY2s6Ly8vLi9zcmMvYXNzaWduLmpzIiwid2VicGFjazovLy8uL3NyYy9ldWxlci9zcHJpbmcuanMiLCJ3ZWJwYWNrOi8vLy4vc3JjL2V1bGVyL2luZGV4LmpzIiwid2VicGFjazovLy8uL3NyYy9ldWxlci9ib2R5LmpzIiwid2VicGFjazovLy8uL3NyYy9ldWxlci9kZWZhdWx0cy5qcyIsIndlYnBhY2s6Ly8vLi9zcmMvZXVsZXIvZHJhZy5qcyIsIndlYnBhY2s6Ly8vLi9zcmMvZXVsZXIvaW50ZWdyYXRlLmpzIiwid2VicGFjazovLy8uL3NyYy9ldWxlci9xdWFkdHJlZS9pbmRleC5qcyIsIndlYnBhY2s6Ly8vLi9zcmMvZXVsZXIvcXVhZHRyZWUvaW5zZXJ0U3RhY2suanMiLCJ3ZWJwYWNrOi8vLy4vc3JjL2V1bGVyL3F1YWR0cmVlL25vZGUuanMiLCJ3ZWJwYWNrOi8vLy4vc3JjL2V1bGVyL3RpY2suanMiLCJ3ZWJwYWNrOi8vLy4vc3JjL2luZGV4LmpzIiwid2VicGFjazovLy8uL3NyYy9sYXlvdXQvZGVmYXVsdHMuanM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cik7XG4gICAgICAgICAgZnggKz0gdiAqIGR4O1xuICAgICAgICAgIGZ5ICs9IHYgKiBkeTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBPdGhlcndpc2UsIHJ1biB0aGUgcHJvY2VkdXJlIHJlY3Vyc2l2ZWx5IG9uIGVhY2ggb2YgdGhlIGN1cnJlbnQgbm9kZSdzIGNoaWxkcmVuLlxuXG4gICAgICAgICAgLy8gSSBpbnRlbnRpb25hbGx5IHVuZm9sZGVkIHRoaXMgbG9vcCwgdG8gc2F2ZSBzZXZlcmFsIENQVSBjeWNsZXMuXG4gICAgICAgICAgaWYgKG5vZGUucXVhZDApIHtcbiAgICAgICAgICAgIHF1ZXVlW3B1c2hJZHhdID0gbm9kZS5xdWFkMDtcbiAgICAgICAgICAgIHF1ZXVlTGVuZ3RoICs9IDE7XG4gICAgICAgICAgICBwdXNoSWR4ICs9IDE7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChub2RlLnF1YWQxKSB7XG4gICAgICAgICAgICBxdWV1ZVtwdXNoSWR4XSA9IG5vZGUucXVhZDE7XG4gICAgICAgICAgICBxdWV1ZUxlbmd0aCArPSAxO1xuICAgICAgICAgICAgcHVzaElkeCArPSAxO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAobm9kZS5xdWFkMikge1xuICAgICAgICAgICAgcXVldWVbcHVzaElkeF0gPSBub2RlLnF1YWQyO1xuICAgICAgICAgICAgcXVldWVMZW5ndGggKz0gMTtcbiAgICAgICAgICAgIHB1c2hJZHggKz0gMTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKG5vZGUucXVhZDMpIHtcbiAgICAgICAgICAgIHF1ZXVlW3B1c2hJZHhdID0gbm9kZS5xdWFkMztcbiAgICAgICAgICAgIHF1ZXVlTGVuZ3RoICs9IDE7XG4gICAgICAgICAgICBwdXNoSWR4ICs9IDE7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuXG4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XZpdHkgKiBub2RlLm1hc3MgKiBzb3VyY2VCb2R5Lm1hc3MgLyAociAqIHIgKiByKTtcbiAgICAgICAgICBmeCArPSB2ICogZHg7XG4gICAgICAgICAgZnkgKz0gdiAqIGR5O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIE90aGVyd2lzZSwgcnVuIHRoZSBwcm9jZWR1cmUgcmVjdXJzaXZlbHkgb24gZWFjaCBvZiB0aGUgY3VycmVudCBub2RlJ3MgY2hpbGRyZW4uXG5cbiAgICAgICAgICAvLyBJIGludGVudGlvbmFsbHkgdW5mb2xkZWQgdGhpcyBsb29wLCB0byBzYXZlIHNldmVyYWwgQ1BVIGN5Y2xlcy5cbiAgICAgICAgICBpZiAobm9kZS5xdWFkMCkge1xuICAgICAgICAgICAgcXVldWVbcHVzaElkeF0gPSBub2RlLnF1YWQwO1xuICAgICAgICAgICAgcXVldWVMZW5ndGggKz0gMTtcbiAgICAgICAgICAgIHB1c2hJZHggKz0gMTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKG5vZGUucXVhZDEpIHtcbiAgICAgICAgICAgIHF1ZXVlW3B1c2hJZHhdID0gbm9kZS5xdWFkMTtcbiAgICAgICAgICAgIHF1ZXVlTGVuZ3RoICs9IDE7XG4gICAgICAgICAgICBwdXNoSWR4ICs9IDE7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChub2RlLnF1YWQyKSB7XG4gICAgICAgICAgICBxdWV1ZVtwdXNoSWR4XSA9IG5vZGUucXVhZDI7XG4gICAgICAgICAgICBxdWV1ZUxlbmd0aCArPSAxO1xuICAgICAgICAgICAgcHVzaElkeCArPSAxO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAobm9kZS5xdWFkMykge1xuICAgICAgICAgICAgcXVldWVbcHVzaElkeF0gPSBub2RlLnF1YWQzO1xuICAgICAgICAgICAgcXVldWVMZW5ndGggKz0gMTtcbiAgICAgICAgICAgIHB1c2hJZHggKz0gMTtcbiAgICAg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0gbm9kZS5tYXNzWCArIGJvZHkubWFzcyAqIHg7XG4gICAgICAgIG5vZGUubWFzc1kgPSBub2RlLm1hc3NZICsgYm9keS5tYXNzICogeTtcblxuICAgICAgICAvLyBSZWN1cnNpdmVseSBpbnNlcnQgdGhlIGJvZHkgaW4gdGhlIGFwcHJvcHJpYXRlIHF1YWRyYW50LlxuICAgICAgICAvLyBCdXQgZmlyc3QgZmluZCB0aGUgYXBwcm9wcmlhdGUgcXVhZHJhbnQuXG4gICAgICAgIHZhciBxdWFkSWR4ID0gMCxcbiAgICAgICAgICAgIC8vIEFzc3VtZSB3ZSBhcmUgaW4gdGhlIDAncyBxdWFkLlxuICAgICAgICBsZWZ0ID0gbm9kZS5sZWZ0LFxuICAgICAgICAgICAgcmlnaHQgPSAobm9kZS5yaWdodCArIGxlZnQpIC8gMixcbiAgICAgICAgICAgIHRvcCA9IG5vZGUudG9wLFxuICAgICAgICAgICAgYm90dG9tID0gKG5vZGUuYm90dG9tICsgdG9wKSAvIDI7XG5cbiAgICAgICAgaWYgKHggPiByaWdodCkge1xuICAgICAgICAgIC8vIHNvbWV3aGVyZSBpbiB0aGUgZWFzdGVybiBwYXJ0LlxuICAgICAgICAgIHF1YWRJZHggPSBxdWFkSWR4ICsgMTtcbiAgICAgICAgICBsZWZ0ID0gcmlnaHQ7XG4gICAgICAgICAgcmlnaHQgPSBub2RlLnJpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIGlmICh5ID4gYm90dG9tKSB7XG4gICAgICAgICAgLy8gYW5kIGluIHNvdXRoLlxuICAgICAgICAgIHF1YWRJZHggPSBxdWFkSWR4ICsgMjtcbiAgICAgICAgICB0b3AgPSBib3R0b207XG4gICAgICAgICAgYm90dG9tID0gbm9kZS5ib3R0b207XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgY2hpbGQgPSBnZXRDaGlsZChub2RlLCBxdWFkSWR4KTtcbiAgICAgICAgaWYgKCFjaGlsZCkge1xuICAgICAgICAgIC8vIFRoZSBub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b25EcmFnKTtcbiAgICAgICAgfTtcblxuICAgICAgICB2YXIgdW5saXN0ZW5Ub0dyYWIgPSBmdW5jdGlvbiB1bmxpc3RlblRvR3JhYihub2RlKSB7XG4gICAgICAgICAgbm9kZS5yZW1vdmVMaXN0ZW5lcignZ3JhYicsIG9uR3JhYik7XG4gICAgICAgICAgbm9kZS5yZW1vdmVMaXN0ZW5lcignZnJlZScsIG9uRnJlZSk7XG4gICAgICAgICAgbm9kZS5yZW1vdmVMaXN0ZW5lcignZHJhZycsIG9uRHJhZyk7XG4gICAgICAgIH07XG5cbiAgICAgICAgdmFyIGZpdCA9IGZ1bmN0aW9uIGZpdCgpIHtcbiAgICAgICAgICBpZiAocy5maXQgJiYgcy5hbmltYXRlQ29udGludW91c2x5KSB7XG4gICAgICAgICAgICBzLmN5LmZpdChzLnBhZGRpbmcpO1xuICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICB2YXIgb25Ob3REb25lID0gZnVuY3Rpb24gb25Ob3REb25lKCkge1xuICAgICAgICAgIHJlZnJlc2hQb3NpdGlvbnMocy5ub2Rlcywgcyk7XG4gICAgICAgICAgZml0KCk7XG5cbiAgICAgICAgICByZXF1ZXN0QW5pbWF0aW9uRnJhbWUoX2ZyYW1lKTtcbiAgICAgICAgfTtcblxuICAgICAgICB2YXIgX2ZyYW1lID0gZnVuY3Rpb24gX2ZyYW1lKCkge1xuICAgICAgICAgIG11bHRpdGljayhzLCBvbk5vdERvbmUsIF9vbkRvbmUpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHZhciBfb25Eb25lID0gZnVuY3Rpb24gX29uRG9uZSgpIHtcbiAgICAgICAgICByZWZyZXNoUG9zaXRpb25zKHMubm9kZXMsIHMpO1xuICAgICAgICAgIGZpdCgpO1xuXG4gICAgICAgICAgcy5ub2Rlcy5mb3JFYWNoKGZ1bmN0aW9uIChuKSB7XG4gICAgICAgICAgICByZWdyYWJpZnkobik7XG4gICAgICAgICAgICB1bmxpc3RlblRvR3JhYihuKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHMucnVubmluZyA9IGZhbHNlO1xuXG4gICAgICAgICAgbC5lbWl0KCdsYXlvdXRzdG9wJyk7XG4gICAgICAgIH07XG5cbiAgICAgICAgbC5lbWl0KCdsYXlvdXRzdGFydCcpO1xuXG4gICAgICAgIHMubm9kZXMuZm9yRWFjaChmdW5jdGlvbiAobikge1xuICAgICAgICAgIHVuZ3JhYmlmeShuKTtcbiAgICAgICAgICBsaXN0ZW5Ub0dyYWIobik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIF9mcmFtZSgpOyAvLyBraWNrIG9mZlxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgdmFyIGRvbmUgPSBmYWxzZTtcbiAgICAgICAgdmFyIF9vbk5vdERvbmUgPSBmdW5jdGlvbiBfb25Ob3REb25lKCkge307XG4gICAgICAgIHZhciBfb25Eb25lMiA9IGZ1bmN0aW9uIF9vbkRvbmUyKCkge1xuICAgICAgICAgIHJldHVybiBkb25lID0gdHJ1ZTtcbiAgICAgICAgfTtcblxuICAgICAgICB3aGlsZSAoIWRvbmUpIHtcbiAgICAgICAgICBtdWx0aXRpY2socywgX29uTm90RG9uZSwgX29uRG9uZTIpO1xuICAgICAgICB9XG5cbiAgICAgICAgcy5lbGVzLmxheW91dFBvc2l0aW9ucyh0aGlzLCBzLCBmdW5jdGlvbiAobm9kZSkge1xuICAgICAgICAgIHZhciBwZCA9IGdldE5vZGVQb3NpdGlvbkRhdGEobm9kZSwgcyk7XG5cbiAgICAgICAgICByZXR1cm4geyB4OiBwZC54LCB5OiBwZC55IH07XG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICBsLnBvc3RydW4ocyk7XG5cbiAgICAgIHJldHVybiB0aGlzOyAvLyBjaGFpbmluZ1xuICAgIH1cbiAgfSwge1xuICAgIGtleTogJ3ByZXJ1bicsXG4gICAgdmFsdWU6IGZ1bmN0aW9uIHByZXJ1bigpIHt9XG4gIH0sI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WdQU0J1YjNBc0lHOXVSRzl1WlNBOUlHNXZjQ0FwZTF4dUlDQnNaWFFnWkc5dVpTQTlJR1poYkhObE8xeHVJQ0JzWlhRZ2N5QTlJSE4wWVhSbE8xeHVYRzRnSUdadmNpZ2diR1YwSUdrZ1BTQXdPeUJwSUR3Z2N5NXlaV1p5WlhOb095QnBLeXNnS1h0Y2JpQWdJQ0JrYjI1bElEMGdJWE11Y25WdWJtbHVaeUI4ZkNCMGFXTnJLQ0J6SUNrN1hHNWNiaUFnSUNCcFppZ2daRzl1WlNBcGV5QmljbVZoYXpzZ2ZWeHVJQ0I5WEc1Y2JpQWdhV1lvSUNGa2IyNWxJQ2w3WEc0Z0lDQWdiMjVPYjNSRWIyNWxLQ2s3WEc0Z0lIMGdaV3h6WlNCN1hHNGdJQ0FnYjI1RWIyNWxLQ2s3WEc0Z0lIMWNibjA3WEc1Y2JtMXZaSFZzWlM1bGVIQnZjblJ6SUQwZ2V5QjBhV05yTENCdGRXeDBhWFJwWTJzZ2ZUdGNibHh1WEc1Y2JpOHZJRmRGUWxCQlEwc2dSazlQVkVWU0lDOHZYRzR2THlBdUwzTnlZeTlzWVhsdmRYUXZkR2xqYXk1cWN5SmRMQ0p6YjNWeVkyVlNiMjkwSWpvaUluMD0iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/cytoscape-euler/cytoscape-euler.js\n"); /***/ }), /***/ "./node_modules/cytoscape-klay/cytoscape-klay.js": /*!*******************************************************!*\ !*** ./node_modules/cytoscape-klay/cytoscape-klay.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(/*! klayjs */ \"./node_modules/klayjs/klay.js\"));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_4__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar klay = __webpack_require__(4);\nvar assign = __webpack_require__(1);\nvar defaults = __webpack_require__(2);\n\nvar klayNSLookup = {\n 'addUnnecessaryBendpoints': 'de.cau.cs.kieler.klay.layered.unnecessaryBendpoints',\n 'alignment': 'de.cau.cs.kieler.alignment',\n 'aspectRatio': 'de.cau.cs.kieler.aspectRatio',\n 'borderSpacing': 'borderSpacing',\n 'compactComponents': 'de.cau.cs.kieler.klay.layered.components.compact',\n 'compactionStrategy': 'de.cau.cs.kieler.klay.layered.nodeplace.compactionStrategy',\n 'contentAlignment': 'de.cau.cs.kieler.klay.layered.contentAlignment',\n 'crossingMinimization': 'de.cau.cs.kieler.klay.layered.crossMin',\n 'cycleBreaking': 'de.cau.cs.kieler.klay.layered.cycleBreaking',\n 'debugMode': 'de.cau.cs.kieler.debugMode',\n 'direction': 'de.cau.cs.kieler.direction',\n 'edgeLabelSideSelection': 'de.cau.cs.kieler.klay.layered.edgeLabelSideSelection',\n // 'de.cau.cs.kieler.klay.layered.edgeNodeSpacingFactor': options.edgeNodeSpacingFactor,\n 'edgeRouting': 'de.cau.cs.kieler.edgeRouting',\n 'edgeSpacingFactor': 'de.cau.cs.kieler.klay.layered.edgeSpacingFactor',\n 'feedbackEdges': 'de.cau.cs.kieler.klay.layered.feedBackEdges',\n 'fixedAlignment': 'de.cau.cs.kieler.klay.layered.fixedAlignment',\n 'greedySwitchCrossingMinimization': 'de.cau.cs.kieler.klay.layered.greedySwitch',\n 'hierarchyHandling': 'de.cau.cs.kieler.hierarchyHandling',\n 'inLayerSpacingFactor': 'de.cau.cs.kieler.klay.layered.inLayerSpacingFactor',\n 'interactiveReferencePoint': 'de.cau.cs.kieler.klay.layered.interactiveReferencePoint',\n 'layerConstraint': 'de.cau.cs.kieler.klay.layered.layerConstraint',\n 'layoutHierarchy': 'de.cau.cs.kieler.layoutHierarchy',\n 'linearSegmentsDeflectionDampening': 'de.cau.cs.kieler.klay.layered.linearSegmentsDeflectionDampening',\n 'mergeEdges': 'de.cau.cs.kieler.klay.layered.mergeEdges',\n 'mergeHierarchyCrossingEdges': 'de.cau.cs.kieler.klay.layered.mergeHierarchyEdges',\n 'noLayout': 'de.cau.cs.kieler.noLayout',\n 'nodeLabelPlacement': 'de.cau.cs.kieler.nodeLabelPlacement',\n 'nodeLayering': 'de.cau.cs.kieler.klay.layered.nodeLayering',\n 'nodePlacement': 'de.cau.cs.kieler.klay.layered.nodePlace',\n 'portAlignment': 'de.cau.cs.kieler.portAlignment',\n 'portAlignmentEastern': 'de.cau.cs.kieler.portAlignment.east',\n 'portAlignmentNorth': 'de.cau.cs.kieler.portAlignment.north',\n 'portAlignmentSouth': 'de.cau.cs.kieler.portAlignment.south',\n 'portAlignmentWest': 'de.cau.cs.kieler.portAlignment.west',\n 'portConstraints': 'de.cau.cs.kieler.portConstraints',\n 'portLabelPlacement': 'de.cau.cs.kieler.portLabelPlacement',\n 'portOffset': 'de.cau.cs.kieler.offset',\n 'portSide': 'de.cau.cs.kieler.portSide',\n 'portSpacing': 'de.cau.cs.kieler.portSpacing',\n 'postCompaction': 'de.cau.cs.kieler.klay.layered.postCompaction',\n 'priority': 'de.cau.cs.kieler.priority',\n 'randomizationSeed': 'de.cau.cs.kieler.randomSeed',\n 'routeSelfLoopInside': 'de.cau.cs.kieler.selfLoopInside',\n 'separateConnectedComponents': 'de.cau.cs.kieler.separateConnComp',\n 'sizeConstraint': 'de.cau.cs.kieler.sizeConstraint',\n 'sizeOptions': 'de.cau.cs.kieler.sizeOptions',\n 'spacing': 'de.cau.cs.kieler.spacing',\n 'splineSelfLoopPlacement': 'de.cau.cs.kieler.klay.layered.splines.selfLoopPlacement',\n 'thoroughness': 'de.cau.cs.kieler.klay.layered.thoroughness',\n 'wideNodesOnMultipleLayers': 'de.cau.cs.kieler.klay.layered.wideNodesOnMultipleLayers'\n};\n\nvar mapToKlayNS = function mapToKlayNS(klayOpts) {\n var keys = Object.keys(klayOpts);\n var ret = {};\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var nsKey = klayNSLookup[key];\n var val = klayOpts[key];\n\n ret[nsKey] = val;\n }\n\n return ret;\n};\n\nvar klayOverrides = {\n interactiveReferencePoint: 'CENTER' // Determines which point of a node is considered by interactive layout phases.\n};\n\nvar getPos = function getPos(ele) {\n var parent = ele.parent();\n var k = ele.scratch('klay');\n var p = {\n x: k.x,\n y: k.y\n };\n\n if (parent.nonempty()) {\n var kp = parent.scratch('klay');\n\n p.x += kp.x;\n p.y += kp.y;\n }\n\n return p;\n};\n\nvar makeNode = function makeNode(node, options) {\n var dims = node.layoutDimensions(options);\n var padding = node.numericStyle('padding');\n\n var k = {\n _cyEle: node,\n id: node.id(),\n padding: {\n top: padding,\n left: padding,\n bottom: padding,\n right: padding\n }\n };\n\n if (!node.isParent()) {\n k.width = dims.w;\n k.height = dims.h;\n }\n\n node.scratch('klay', k);\n\n return k;\n};\n\nvar makeEdge = function makeEdge(edge, options) {\n var k = {\n _cyEle: edge,\n id: edge.id(),\n source: edge.data('source'),\n target: edge.data('target'),\n properties: {}\n };\n\n var priority = options.priority(edge);\n\n if (priority != null) {\n k.properties.priority = priority;\n }\n\n edge.scratch('klay', k);\n\n return k;\n};\n\nvar makeGraph = function makeGraph(nodes, edges, options) {\n var klayNodes = [];\n var klayEdges = [];\n var klayEleLookup = {};\n var graph = {\n id: 'root',\n children: [],\n edges: []\n };\n\n // map all nodes\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n var k = makeNode(n, options);\n\n klayNodes.push(k);\n\n klayEleLookup[n.id()] = k;\n }\n\n // map all edges\n for (var _i = 0; _i < edges.length; _i++) {\n var e = edges[_i];\n var _k = makeEdge(e, options);\n\n klayEdges.push(_k);\n\n klayEleLookup[e.id()] = _k;\n }\n\n // make hierarchy\n for (var _i2 = 0; _i2 < klayNodes.length; _i2++) {\n var _k2 = klayNodes[_i2];\n var _n = _k2._cyEle;\n\n if (!_n.isChild()) {\n graph.children.push(_k2);\n } else {\n var parent = _n.parent();\n var parentK = klayEleLookup[parent.id()];\n\n var children = parentK.children = parentK.children || [];\n\n children.push(_k2);\n }\n }\n\n for (var _i3 = 0; _i3 < klayEdges.length; _i3++) {\n var _k3 = klayEdges[_i3];\n var _e = _k3._cyEle;\n var parentSrc = _e.source().parent();\n var parentTgt = _e.target().parent();\n\n // put all edges in the top level for now\n // TODO does this cause issues in certain edgecases?\n if (false) { var kp; } else {\n graph.edges.push(_k3);\n }\n }\n\n return graph;\n};\n\nfunction Layout(options) {\n var klayOptions = options.klay;\n\n this.options = assign({}, defaults, options);\n\n this.options.klay = assign({}, defaults.klay, klayOptions, klayOverrides);\n}\n\nLayout.prototype.run = function () {\n var layout = this;\n var options = this.options;\n\n var eles = options.eles;\n var nodes = eles.nodes();\n var edges = eles.edges();\n\n var graph = makeGraph(nodes, edges, options);\n\n klay.layout({\n graph: graph,\n options: mapToKlayNS(options.klay),\n success: function success() {},\n error: function error(_error) {\n throw _error;\n }\n });\n\n nodes.filter(function (n) {\n return !n.isParent();\n }).layoutPositions(layout, options, getPos);\n\n return this;\n};\n\nLayout.prototype.stop = function () {\n return this; // chaining\n};\n\nLayout.prototype.destroy = function () {\n return this; // chaining\n};\n\nmodule.exports = Layout;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// Simple, internal Object.assign() polyfill for options objects etc.\n\nmodule.exports = Object.assign != null ? Object.assign.bind(Object) : function (tgt) {\n for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n srcs[_key - 1] = arguments[_key];\n }\n\n srcs.filter(function (src) {\n return src != null;\n }).forEach(function (src) {\n Object.keys(src).forEach(function (k) {\n return tgt[k] = src[k];\n });\n });\n\n return tgt;\n};\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar defaults = {\n nodeDimensionsIncludeLabels: false, // Boolean which changes whether label dimensions are included when calculating node dimensions\n fit: true, // Whether to fit\n padding: 20, // Padding on fit\n animate: false, // Whether to transition the node positions\n animateFilter: function animateFilter(node, i) {\n return true;\n }, // Whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions\n animationDuration: 500, // Duration of animation in ms if enabled\n animationEasing: undefined, // Easing of animation if enabled\n transform: function transform(node, pos) {\n return pos;\n }, // A function that applies a transform to the final node position\n ready: undefined, // Callback on layoutready\n stop: undefined, // Callback on layoutstop\n klay: {\n // Following descriptions taken from http://layout.rtsys.informatik.uni-kiel.de:9444/Providedlayout.html?algorithm=de.cau.cs.kieler.klay.layered\n addUnnecessaryBendpoints: false, // Adds bend points even if an edge does not change direction.\n aspectRatio: 1.6, // The aimed aspect ratio of the drawing, that is the quotient of width by height\n borderSpacing: 20, // Minimal amount of space to be left to the border\n compactComponents: false, // Tries to further compact components (disconnected sub-graphs).\n crossingMinimization: 'LAYER_SWEEP', // Strategy for crossing minimization.\n /* LAYER_SWEEP The layer sweep algorithm iterates multiple times over the layers, trying to find node orderings that minimize the number of crossings. The algorithm uses randomization to increase the odds of finding a good result. To improve its results, consider increasing the Thoroughness option, which influences the number of iterations done. The Randomization seed also influences results.\n INTERACTIVE Orders the nodes of each layer by comparing their positions before the layout algorithm was started. The idea is that the relative order of nodes as it was before layout was applied is not changed. This of course requires valid positions for all nodes to have been set on the input graph before calling the layout algorithm. The interactive layer sweep algorithm uses the Interactive Reference Point option to determine which reference point of nodes are used to compare positions. */\n cycleBreaking: 'GREEDY', // Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles. Reversed edges will end up pointing to the opposite direction of regular edges (that is, reversed edges will point left if edges usually point right).\n /* GREEDY This algorithm reverses edges greedily. The algorithm tries to avoid edges that have the Priority property set.\n INTERACTIVE The interactive algorithm tries to reverse edges that already pointed leftwards in the input graph. This requires node and port coordinates to have been set to sensible values.*/\n direction: 'UNDEFINED', // Overall direction of edges: horizontal (right / left) or vertical (down / up)\n /* UNDEFINED, RIGHT, LEFT, DOWN, UP */\n edgeRouting: 'ORTHOGONAL', // Defines how edges are routed (POLYLINE, ORTHOGONAL, SPLINES)\n edgeSpacingFactor: 0.5, // Factor by which the object spacing is multiplied to arrive at the minimal spacing between edges.\n feedbackEdges: false, // Whether feedback edges should be highlighted by routing around the nodes.\n fixedAlignment: 'NONE', // Tells the BK node placer to use a certain alignment instead of taking the optimal result. This option should usually be left alone.\n /* NONE Chooses the smallest layout from the four possible candidates.\n LEFTUP Chooses the left-up candidate from the four possible candidates.\n RIGHTUP Chooses the right-up candidate from the four possible candidates.\n LEFTDOWN Chooses the left-down candidate from the four possible candidates.\n RIGHTDOWN Chooses the right-down candidate from the four possible candidates.\n BALANCED Creates a balanced layout from the four possible candidates. */\n inLayerSpacingFactor: 1.0, // Factor by which the usual spacing is multiplied to determine the in-layer spacing between objects.\n layoutHierarchy: false, // Whether the selected layouter should consider the full hierarchy\n linearSegmentsDeflectionDampening: 0.3, // Dampens the movement of nodes to keep the diagram from getting too large.\n mergeEdges: false, // Edges that have no ports are merged so they touch the connected nodes at the same points.\n mergeHierarchyCrossingEdges: true, // If hierarchical layout is active, hierarchy-crossing edges use as few hierarchical ports as possible.\n nodeLayering: 'NETWORK_SIMPLEX', // Strategy for node layering.\n /* NETWORK_SIMPLEX This algorithm tries to minimize the length of edges. This is the most computationally intensive algorithm. The number of iterations after which it aborts if it hasn't found a result yet can be set with the Maximal Iterations option.\n LONGEST_PATH A very simple algorithm that distributes nodes along their longest path to a sink node.\n INTERACTIVE Distributes the nodes into layers by comparing their positions before the layout algorithm was started. The idea is that the relative horizontal order of nodes as it was before layout was applied is not changed. This of course requires valid positions for all nodes to have been set on the input graph before calling the layout algorithm. The interactive node layering algorithm uses the Interactive Reference Point option to determine which reference point of nodes are used to compare positions. */\n nodePlacement: 'BRANDES_KOEPF', // Strategy for Node Placement\n /* BRANDES_KOEPF Minimizes the number of edge bends at the expense of diagram size: diagrams drawn with this algorithm are usually higher than diagrams drawn with other algorithms.\n LINEAR_SEGMENTS Computes a balanced placement.\n INTERACTIVE Tries to keep the preset y coordinates of nodes from the original layout. For dummy nodes, a guess is made to infer their coordinates. Requires the other interactive phase implementations to have run as well.\n SIMPLE Minimizes the area at the expense of... well, pretty much everything else. */\n randomizationSeed: 1, // Seed used for pseudo-random number generators to control the layout algorithm; 0 means a new seed is generated\n routeSelfLoopInside: false, // Whether a self-loop is routed around or inside its node.\n separateConnectedComponents: true, // Whether each connected component should be processed separately\n spacing: 20, // Overall setting for the minimal amount of space to be left between objects\n thoroughness: 7 // How much effort should be spent to produce a nice layout..\n },\n priority: function priority(edge) {\n return null;\n } // Edges with a non-nil value are skipped when geedy edge cycle breaking is enabled\n};\n\nmodule.exports = defaults;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar impl = __webpack_require__(0);\n\n// registers the extension on a cytoscape lib ref\nvar register = function register(cytoscape) {\n if (!cytoscape) {\n return;\n } // can't register if cytoscape unspecified\n\n cytoscape('layout', 'klay', impl); // register with cytoscape.js\n};\n\nif (typeof cytoscape !== 'undefined') {\n // expose to global cytoscape (i.e. window.cytoscape)\n register(cytoscape);\n}\n\nmodule.exports = register;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ })\n/******/ ]);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9jeXRvc2NhcGUta2xheS9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fX1dFQlBBQ0tfRVhURVJOQUxfTU9EVUxFXzRfXztcblxuLyoqKi8gfSlcbi8qKioqKiovIF0pO1xufSk7Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/cytoscape-klay/cytoscape-klay.js\n"); /***/ }), /***/ "./node_modules/cytoscape-spread/cytoscape-spread.js": /*!***********************************************************!*\ !*** ./node_modules/cytoscape-spread/cytoscape-spread.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory(__webpack_require__(/*! weaverjs */ \"./node_modules/weaverjs/dist/weaver.js\"));\n\telse {}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar Thread = __webpack_require__(3).Thread;\n\nvar Voronoi = __webpack_require__(2);\n\nvar defaults = {\n animate: true, // Whether to show the layout as it's running\n ready: undefined, // Callback on layoutready\n stop: undefined, // Callback on layoutstop\n fit: true, // Reset viewport to fit default simulationBounds\n minDist: 20, // Minimum distance between nodes\n padding: 20, // Padding\n expandingFactor: -1.0, // If the network does not satisfy the minDist\n // criterium then it expands the network of this amount\n // If it is set to -1.0 the amount of expansion is automatically\n // calculated based on the minDist, the aspect ratio and the\n // number of nodes\n prelayout: { name: 'cose' }, // Layout options for the first phase\n maxExpandIterations: 4, // Maximum number of expanding iterations\n boundingBox: undefined, // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n randomize: false // Uses random initial node positions on true\n};\n\nfunction SpreadLayout( options ) {\n var opts = this.options = {};\n for( var i in defaults ){ opts[i] = defaults[i]; }\n for( var i in options ){ opts[i] = options[i]; }\n}\n\nSpreadLayout.prototype.run = function() {\n\n var layout = this;\n var options = this.options;\n var cy = options.cy;\n\n var bb = options.boundingBox || { x1: 0, y1: 0, w: cy.width(), h: cy.height() };\n if( bb.x2 === undefined ){ bb.x2 = bb.x1 + bb.w; }\n if( bb.w === undefined ){ bb.w = bb.x2 - bb.x1; }\n if( bb.y2 === undefined ){ bb.y2 = bb.y1 + bb.h; }\n if( bb.h === undefined ){ bb.h = bb.y2 - bb.y1; }\n\n var nodes = cy.nodes();\n var edges = cy.edges();\n var cWidth = cy.width();\n var cHeight = cy.height();\n var simulationBounds = bb;\n var padding = options.padding;\n var simBBFactor = Math.max( 1, Math.log(nodes.length) * 0.8 );\n\n if( nodes.length < 100 ){\n simBBFactor /= 2;\n }\n\n layout.trigger( {\n type: 'layoutstart',\n layout: layout\n } );\n\n var simBB = {\n x1: 0,\n y1: 0,\n x2: cWidth * simBBFactor,\n y2: cHeight * simBBFactor\n };\n\n if( simulationBounds ) {\n simBB.x1 = simulationBounds.x1;\n simBB.y1 = simulationBounds.y1;\n simBB.x2 = simulationBounds.x2;\n simBB.y2 = simulationBounds.y2;\n }\n\n simBB.x1 += padding;\n simBB.y1 += padding;\n simBB.x2 -= padding;\n simBB.y2 -= padding;\n\n var width = simBB.x2 - simBB.x1;\n var height = simBB.y2 - simBB.y1;\n\n // Get start time\n var startTime = Date.now();\n\n // layout doesn't work with just 1 node\n if( nodes.size() <= 1 ) {\n nodes.positions( {\n x: Math.round( ( simBB.x1 + simBB.x2 ) / 2 ),\n y: Math.round( ( simBB.y1 + simBB.y2 ) / 2 )\n } );\n\n if( options.fit ) {\n cy.fit( options.padding );\n }\n\n // Get end time\n var endTime = Date.now();\n console.info( \"Layout on \" + nodes.size() + \" nodes took \" + ( endTime - startTime ) + \" ms\" );\n\n layout.one( \"layoutready\", options.ready );\n layout.trigger( \"layoutready\" );\n\n layout.one( \"layoutstop\", options.stop );\n layout.trigger( \"layoutstop\" );\n\n return;\n }\n\n // First I need to create the data structure to pass to the worker\n var pData = {\n 'width': width,\n 'height': height,\n 'minDist': options.minDist,\n 'expFact': options.expandingFactor,\n 'expIt': 0,\n 'maxExpIt': options.maxExpandIterations,\n 'vertices': [],\n 'edges': [],\n 'startTime': startTime\n };\n\n for(var i = nodes.length - 1; i >= 0 ; i--) {\n var nodeId = nodes[i].id();\n var pos = nodes[i].position();\n\n if( options.randomize ){\n pos = {\n x: Math.round( simBB.x1 + (simBB.x2 - simBB.x1) * Math.random() ),\n y: Math.round( simBB.y1 + (simBB.y2 - simBB.y1) * Math.random() )\n };\n }\n\n pData[ 'vertices' ].push( {\n id: nodeId,\n x: pos.x,\n y: pos.y\n } );\n };\n\n for(var i = edges.length - 1; i >= 0; i--) {\n var srcNodeId = edges[i].source().id();\n var tgtNodeId = edges[i].target().id();\n pData[ 'edges' ].push( {\n src: srcNodeId,\n tgt: tgtNodeId\n } );\n };\n\n //Decleration\n var t1 = layout.thread;\n\n // reuse old thread if possible\n if( !t1 || t1.stopped() ){\n t1 = layout.thread = Thread();\n\n // And to add the required scripts\n t1.require( Voronoi, 'Voronoi' );\n }\n\n function setPositions( pData ){ //console.log('set posns')\n // First we retrieve the important data\n // var expandIteration = pData[ 'expIt' ];\n var dataVertices = pData[ 'vertices' ];\n var vertices = [];\n for( var i = 0; i < dataVertices.length; ++i ) {\n var dv = dataVertices[ i ];\n vertices[ dv.id ] = {\n x: dv.x,\n y: dv.y\n };\n }\n /*\n * FINALLY:\n *\n * We position the nodes based on the calculation\n */\n nodes.positions(\n function( node, i ) {\n // Perform 2.x and 1.x backwards compatibility check\n if( typeof node === \"number\" ){\n node = i;\n }\n var id = node.id()\n var vertex = vertices[ id ];\n\n return {\n x: Math.round( simBB.x1 + vertex.x ),\n y: Math.round( simBB.y1 + vertex.y )\n };\n } );\n\n if( options.fit ) {\n cy.fit( options.padding );\n }\n }\n\n var didLayoutReady = false;\n t1.on('message', function(e){\n var pData = e.message; //console.log('message', e)\n\n if( !options.animate ){\n return;\n }\n\n setPositions( pData );\n\n if( !didLayoutReady ){\n layout.trigger( \"layoutready\" );\n\n didLayoutReady = true;\n }\n });\n\n layout.one( \"layoutready\", options.ready );\n\n if( options.prelayout ){\n var prelayout = cy.makeLayout( options.prelayout );\n var promise = prelayout.promiseOn('layoutstop');\n\n promise.then( runVoronoi );\n\n prelayout.run();\n } else {\n runVoronoi();\n }\n\n function runVoronoi(){\n t1.pass( pData ).run( function( pData ) {\n\n function cellCentroid( cell ) {\n var hes = cell.halfedges;\n var area = 0,\n x = 0,\n y = 0;\n var p1, p2, f;\n\n for( var i = 0; i < hes.length; ++i ) {\n p1 = hes[ i ].getEndpoint();\n p2 = hes[ i ].getStartpoint();\n\n area += p1.x * p2.y;\n area -= p1.y * p2.x;\n\n f = p1.x * p2.y - p2.x * p1.y;\n x += ( p1.x + p2.x ) * f;\n y += ( p1.y + p2.y ) * f;\n }\n\n area /= 2;\n f = area * 6;\n return {\n x: x / f,\n y: y / f\n };\n }\n\n function sitesDistance( ls, rs ) {\n var dx = ls.x - rs.x;\n var dy = ls.y - rs.y;\n return Math.sqrt( dx * dx + dy * dy );\n }\n\n Voronoi = _ref_('Voronoi');\n\n // I need to retrieve the important data\n var lWidth = pData[ 'width' ];\n var lHeight = pData[ 'height' ];\n var lMinDist = pData[ 'minDist' ];\n var lExpFact = pData[ 'expFact' ];\n var lMaxExpIt = pData[ 'maxExpIt' ];\n\n // Prepare the data to output\n var savePositions = function(){\n pData[ 'width' ] = lWidth;\n pData[ 'height' ] = lHeight;\n pData[ 'expIt' ] = expandIteration;\n pData[ 'expFact' ] = lExpFact;\n\n pData[ 'vertices' ] = [];\n for( var i = 0; i < fv.length; ++i ) {\n pData[ 'vertices' ].push( {\n id: fv[ i ].label,\n x: fv[ i ].x,\n y: fv[ i ].y\n } );\n }\n };\n\n var messagePositions = function(){\n broadcast( pData );\n };\n\n var dataVertices = pData[ 'vertices' ];\n var dataEdges = pData[ 'edges' ];\n\n var x1 = Infinity;\n var x2 = -Infinity;\n var y1 = Infinity;\n var y2 = -Infinity;\n\n dataVertices.forEach(function(v){\n x1 = Math.min( v.x, x1 );\n x2 = Math.max( v.x, x2 );\n y1 = Math.min( v.y, y1 );\n y2 = Math.max( v.y, y2 );\n });\n\n var scale = function(x, minX, maxX, scaledMinX, scaledMaxX){\n var p = (x - minX) / (maxX - minX);\n\n if( isNaN(p) ){\n p = Math.random();\n }\n\n return scaledMinX + (scaledMaxX - scaledMinX) * p;\n };\n\n // NB Voronoi expects all nodes to be on { x in [0, lWidth], y in [0, lHeight] }\n var fv = dataVertices.map(function(v){\n return {\n label: v.id,\n x: scale( v.x, x1, x2, 0, lWidth ),\n y: scale( v.y, y1, y2, 0, lHeight )\n };\n });\n\n savePositions();\n messagePositions();\n\n if( lMaxExpIt <= 0 ){\n return pData;\n }\n\n /*\n * SECOND STEP: Tiding up of the graph.\n *\n * We use the method described by Gansner and North, based on Voronoi\n * diagrams.\n *\n * Ref: doi:10.1007/3-540-37623-2_28\n */\n\n // We calculate the Voronoi diagram dor the position of the nodes\n var voronoi = new Voronoi();\n var bbox = {\n xl: 0,\n xr: lWidth,\n yt: 0,\n yb: lHeight\n };\n var vSites = [];\n for( var i = 0; i < fv.length; ++i ) {\n vSites[ fv[ i ].label ] = fv[ i ];\n }\n\n function checkMinDist( ee ) {\n var infractions = 0;\n // Then we check if the minimum distance is satisfied\n for( var eei = 0; eei < ee.length; ++eei ) {\n var e = ee[ eei ];\n if( ( e.lSite != null ) && ( e.rSite != null ) && sitesDistance( e.lSite, e.rSite ) < lMinDist ) {\n ++infractions;\n }\n }\n return infractions;\n }\n\n var diagram = voronoi.compute( fv, bbox );\n\n // Then we reposition the nodes at the centroid of their Voronoi cells\n var cells = diagram.cells;\n for( var i = 0; i < cells.length; ++i ) {\n var cell = cells[ i ];\n var site = cell.site;\n var centroid = cellCentroid( cell );\n var currv = vSites[ site.label ];\n currv.x = centroid.x;\n currv.y = centroid.y;\n }\n\n if( lExpFact < 0.0 ) {\n // Calculates the expanding factor\n lExpFact = Math.max( 0.05, Math.min( 0.10, lMinDist / Math.sqrt( ( lWidth * lHeight ) / fv.length ) * 0.5 ) );\n //console.info(\"Expanding factor is \" + (options.expandingFactor * 100.0) + \"%\");\n }\n\n var prevInfractions = checkMinDist( diagram.edges );\n //console.info(\"Initial infractions \" + prevInfractions);\n\n var bStop = ( prevInfractions <= 0 ) || lMaxExpIt <= 0;\n\n var voronoiIteration = 0;\n var expandIteration = 0;\n\n // var initWidth = lWidth;\n\n while( !bStop ) {\n ++voronoiIteration;\n for( var it = 0; it <= 4; ++it ) {\n voronoi.recycle( diagram );\n diagram = voronoi.compute( fv, bbox );\n\n // Then we reposition the nodes at the centroid of their Voronoi cells\n // cells = diagram.cells;\n for( var i = 0; i < cells.length; ++i ) {\n var cell = cells[ i ];\n var site = cell.site;\n var centroid = cellCentroid( cell );\n var currv = vSites[ site.label ];\n currv.x = centroid.x;\n currv.y = centroid.y;\n }\n }\n\n var currInfractions = checkMinDist( diagram.edges );\n //console.info(\"Current infractions \" + currInfractions);\n\n if( currInfractions <= 0 ) {\n bStop = true;\n } else {\n if( currInfractions >= prevInfractions || voronoiIteration >= 4 ) {\n if( expandIteration >= lMaxExpIt ) {\n bStop = true;\n } else {\n lWidth += lWidth * lExpFact;\n lHeight += lHeight * lExpFact;\n bbox = {\n xl: 0,\n xr: lWidth,\n yt: 0,\n yb: lHeight\n };\n ++expandIteration;\n voronoiIteration = 0;\n //console.info(\"Expanded to (\"+width+\",\"+height+\")\");\n }\n }\n }\n prevInfractions = currInfractions;\n\n savePositions();\n messagePositions();\n }\n\n savePositions();\n return pData;\n\n } ).then( function( pData ) {\n // var expandIteration = pData[ 'expIt' ];\n var dataVertices = pData[ 'vertices' ];\n\n setPositions( pData );\n\n // Get end time\n var startTime = pData[ 'startTime' ];\n var endTime = new Date();\n console.info( \"Layout on \" + dataVertices.length + \" nodes took \" + ( endTime - startTime ) + \" ms\" );\n\n layout.one( \"layoutstop\", options.stop );\n\n if( !options.animate ){\n layout.trigger( \"layoutready\" );\n }\n\n layout.trigger( \"layoutstop\" );\n\n t1.stop();\n } );\n }\n\n\n return this;\n}; // run\n\nSpreadLayout.prototype.stop = function(){\n if( this.thread ){\n this.thread.stop();\n }\n\n this.trigger('layoutstop');\n};\n\nSpreadLayout.prototype.destroy = function(){\n if( this.thread ){\n this.thread.stop();\n }\n};\n\nmodule.exports = SpreadLayout;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n// registers the extension on a cytoscape lib ref\nvar Layout = __webpack_require__(0);\n\nvar register = function( cytoscape ){\n cytoscape('layout', 'spread', Layout);\n};\n\nif( typeof cytoscape !== 'undefined' ){ // expose to global cytoscape (i.e. window.cytoscape)\n register( cytoscape );\n}\n\nmodule.exports = register;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n/*!\nCopyright (C) 2010-2013 Raymond Hill: https://github.com/gorhill/Javascript-Voronoi\nMIT License: See https://github.com/gorhill/Javascript-Voronoi/LICENSE.md\n*/\n/*\nAuthor: Raymond Hill (rhill@raymondhill.net)\nContributor: Jesse Morgan (morgajel@gmail.com)\nFile: rhill-voronoi-core.js\nVersion: 0.98\nDate: January 21, 2013\nDescription: This is my personal Javascript implementation of\nSteven Fortune's algorithm to compute Voronoi diagrams.\n\nLicense: See https://github.com/gorhill/Javascript-Voronoi/LICENSE.md\nCredits: See https://github.com/gorhill/Javascript-Voronoi/CREDITS.md\nHistory: See https://github.com/gorhill/Javascript-Voronoi/CHANGELOG.md\n\n## Usage:\n\n var sites = [{x:300,y:300}, {x:100,y:100}, {x:200,y:500}, {x:250,y:450}, {x:600,y:150}];\n // xl, xr means x left, x right\n // yt, yb means y top, y bottom\n var bbox = {xl:0, xr:800, yt:0, yb:600};\n var voronoi = new Voronoi();\n // pass an object which exhibits xl, xr, yt, yb properties. The bounding\n // box will be used to connect unbound edges, and to close open cells\n result = voronoi.compute(sites, bbox);\n // render, further analyze, etc.\n\nReturn value:\n An object with the following properties:\n\n result.vertices = an array of unordered, unique Voronoi.Vertex objects making\n up the Voronoi diagram.\n result.edges = an array of unordered, unique Voronoi.Edge objects making up\n the Voronoi diagram.\n result.cells = an array of Voronoi.Cell object making up the Voronoi diagram.\n A Cell object might have an empty array of halfedges, meaning no Voronoi\n cell could be computed for a particular cell.\n result.execTime = the time it took to compute the Voronoi diagram, in\n milliseconds.\n\nVoronoi.Vertex object:\n x: The x position of the vertex.\n y: The y position of the vertex.\n\nVoronoi.Edge object:\n lSite: the Voronoi site object at the left of this Voronoi.Edge object.\n rSite: the Voronoi site object at the right of this Voronoi.Edge object (can\n be null).\n va: an object with an 'x' and a 'y' property defining the start point\n (relative to the Voronoi site on the left) of this Voronoi.Edge object.\n vb: an object with an 'x' and a 'y' property defining the end point\n (relative to Voronoi site on the left) of this Voronoi.Edge object.\n\n For edges which are used to close open cells (using the supplied bounding\n box), the rSite property will be null.\n\nVoronoi.Cell object:\n site: the Voronoi site object associated with the Voronoi cell.\n halfedges: an array of Voronoi.Halfedge objects, ordered counterclockwise,\n defining the polygon for this Voronoi cell.\n\nVoronoi.Halfedge object:\n site: the Voronoi site object owning this Voronoi.Halfedge object.\n edge: a reference to the unique Voronoi.Edge object underlying this\n Voronoi.Halfedge object.\n getStartpoint(): a method returning an object with an 'x' and a 'y' property\n for the start point of this halfedge. Keep in mind halfedges are always\n countercockwise.\n getEndpoint(): a method returning an object with an 'x' and a 'y' property\n for the end point of this halfedge. Keep in mind halfedges are always\n countercockwise.\n\nTODO: Identify opportunities for performance improvement.\n\nTODO: Let the user close the Voronoi cells, do not do it automatically. Not only let\n him close the cells, but also allow him to close more than once using a different\n bounding box for the same Voronoi diagram.\n*/\n\n/*global Math */\n\n// ---------------------------------------------------------------------------\n\nfunction Voronoi() {\n this.vertices = null;\n this.edges = null;\n this.cells = null;\n this.toRecycle = null;\n this.beachsectionJunkyard = [];\n this.circleEventJunkyard = [];\n this.vertexJunkyard = [];\n this.edgeJunkyard = [];\n this.cellJunkyard = [];\n }\n\n// ---------------------------------------------------------------------------\n\nVoronoi.prototype.reset = function() {\n if (!this.beachline) {\n this.beachline = new this.RBTree();\n }\n // Move leftover beachsections to the beachsection junkyard.\n if (this.beachline.root) {\n var beachsection = this.beachline.getFirst(this.beachline.root);\n while (beachsection) {\n this.beachsectionJunkyard.push(beachsection); // mark for reuse\n beachsection = beachsection.rbNext;\n }\n }\n this.beachline.root = null;\n if (!this.circleEvents) {\n this.circleEvents = new this.RBTree();\n }\n this.circleEvents.root = this.firstCircleEvent = null;\n this.vertices = [];\n this.edges = [];\n this.cells = [];\n };\n\nVoronoi.prototype.sqrt = function(n){ return Math.sqrt(n); };\nVoronoi.prototype.abs = function(n){ return Math.abs(n); };\nVoronoi.prototype.ε = Voronoi.ε = 1e-9;\nVoronoi.prototype.invε = Voronoi.invε = 1.0 / Voronoi.ε;\nVoronoi.prototype.equalWithEpsilon = function(a,b){return this.abs(a-b)<1e-9;};\nVoronoi.prototype.greaterThanWithEpsilon = function(a,b){return a-b>1e-9;};\nVoronoi.prototype.greaterThanOrEqualWithEpsilon = function(a,b){return b-a<1e-9;};\nVoronoi.prototype.lessThanWithEpsilon = function(a,b){return b-a>1e-9;};\nVoronoi.prototype.lessThanOrEqualWithEpsilon = function(a,b){return a-b<1e-9;};\n\n// ---------------------------------------------------------------------------\n// Red-Black tree code (based on C version of \"rbtree\" by Franck Bui-Huu\n// https://github.com/fbuihuu/libtree/blob/master/rb.c\n\nVoronoi.prototype.RBTree = function() {\n this.root = null;\n };\n\nVoronoi.prototype.RBTree.prototype.rbInsertSuccessor = function(node, successor) {\n var parent;\n if (node) {\n // >>> rhill 2011-05-27: Performance: cache previous/next nodes\n successor.rbPrevious = node;\n successor.rbNext = node.rbNext;\n if (node.rbNext) {\n node.rbNext.rbPrevious = successor;\n }\n node.rbNext = successor;\n // <<<\n if (node.rbRight) {\n // in-place expansion of node.rbRight.getFirst();\n node = node.rbRight;\n while (node.rbLeft) {node = node.rbLeft;}\n node.rbLeft = successor;\n }\n else {\n node.rbRight = successor;\n }\n parent = node;\n }\n // rhill 2011-06-07: if node is null, successor must be inserted\n // to the left-most part of the tree\n else if (this.root) {\n node = this.getFirst(this.root);\n // >>> Performance: cache previous/next nodes\n successor.rbPrevious = null;\n successor.rbNext = node;\n node.rbPrevious = successor;\n // <<<\n node.rbLeft = successor;\n parent = node;\n }\n else {\n // >>> Performance: cache previous/next nodes\n successor.rbPrevious = successor.rbNext = null;\n // <<<\n this.root = successor;\n parent = null;\n }\n successor.rbLeft = successor.rbRight = null;\n successor.rbParent = parent;\n successor.rbRed = true;\n // Fixup the modified tree by recoloring nodes and performing\n // rotations (2 at most) hence the red-black tree properties are\n // preserved.\n var grandpa, uncle;\n node = successor;\n while (parent && parent.rbRed) {\n grandpa = parent.rbParent;\n if (parent === grandpa.rbLeft) {\n uncle = grandpa.rbRight;\n if (uncle && uncle.rbRed) {\n parent.rbRed = uncle.rbRed = false;\n grandpa.rbRed = true;\n node = grandpa;\n }\n else {\n if (node === parent.rbRight) {\n this.rbRotateLeft(parent);\n node = parent;\n parent = node.rbParent;\n }\n parent.rbRed = false;\n grandpa.rbRed = true;\n this.rbRotateRight(grandpa);\n }\n }\n else {\n uncle = grandpa.rbLeft;\n if (uncle && uncle.rbRed) {\n parent.rbRed = uncle.rbRed = false;\n grandpa.rbRed = true;\n node = grandpa;\n }\n else {\n if (node === parent.rbLeft) {\n this.rbRotateRight(parent);\n node = parent;\n parent = node.rbParent;\n }\n parent.rbRed = false;\n grandpa.rbRed = true;\n this.rbRotateLeft(grandpa);\n }\n }\n parent = node.rbParent;\n }\n this.root.rbRed = false;\n };\n\nVoronoi.prototype.RBTree.prototype.rbRemoveNode = function(node) {\n // >>> rhill 2011-05-27: Performance: cache previous/next nodes\n if (node.rbNext) {\n node.rbNext.rbPrevious = node.rbPrevious;\n }\n if (node.rbPrevious) {\n node.rbPrevious.rbNext = node.rbNext;\n }\n node.rbNext = node.rbPrevious = null;\n // <<<\n var parent = node.rbParent,\n left = node.rbLeft,\n right = node.rbRight,\n next;\n if (!left) {\n next = right;\n }\n else if (!right) {\n next = left;\n }\n else {\n next = this.getFirst(right);\n }\n if (parent) {\n if (parent.rbLeft === node) {\n parent.rbLeft = next;\n }\n else {\n parent.rbRight = next;\n }\n }\n else {\n this.root = next;\n }\n // enforce red-black rules\n var isRed;\n if (left && right) {\n isRed = next.rbRed;\n next.rbRed = node.rbRed;\n next.rbLeft = left;\n left.rbParent = next;\n if (next !== right) {\n parent = next.rbParent;\n next.rbParent = node.rbParent;\n node = next.rbRight;\n parent.rbLeft = node;\n next.rbRight = right;\n right.rbParent = next;\n }\n else {\n next.rbParent = parent;\n parent = next;\n node = next.rbRight;\n }\n }\n else {\n isRed = node.rbRed;\n node = next;\n }\n // 'node' is now the sole successor's child and 'parent' its\n // new parent (since the successor can have been moved)\n if (node) {\n node.rbParent = parent;\n }\n // the 'easy' cases\n if (isRed) {return;}\n if (node && node.rbRed) {\n node.rbRed = false;\n return;\n }\n // the other cases\n var sibling;\n do {\n if (node === this.root) {\n break;\n }\n if (node === parent.rbLeft) {\n sibling = parent.rbRight;\n if (sibling.rbRed) {\n sibling.rbRed = false;\n parent.rbRed = true;\n this.rbRotateLeft(parent);\n sibling = parent.rbRight;\n }\n if ((sibling.rbLeft && sibling.rbLeft.rbRed) || (sibling.rbRight && sibling.rbRight.rbRed)) {\n if (!sibling.rbRight || !sibling.rbRight.rbRed) {\n sibling.rbLeft.rbRed = false;\n sibling.rbRed = true;\n this.rbRotateRight(sibling);\n sibling = parent.rbRight;\n }\n sibling.rbRed = parent.rbRed;\n parent.rbRed = sibling.rbRight.rbRed = false;\n this.rbRotateLeft(parent);\n node = this.root;\n break;\n }\n }\n else {\n sibling = parent.rbLeft;\n if (sibling.rbRed) {\n sibling.rbRed = false;\n parent.rbRed = true;\n this.rbRotateRight(parent);\n sibling = parent.rbLeft;\n }\n if ((sibling.rbLeft && sibling.rbLeft.rbRed) || (sibling.rbRight && sibling.rbRight.rbRed)) {\n if (!sibling.rbLeft || !sibling.rbLeft.rbRed) {\n sibling.rbRight.rbRed = false;\n sibling.rbRed = true;\n this.rbRotateLeft(sibling);\n sibling = parent.rbLeft;\n }\n sibling.rbRed = parent.rbRed;\n parent.rbRed = sibling.rbLeft.rbRed = false;\n this.rbRotateRight(parent);\n node = this.root;\n break;\n }\n }\n sibling.rbRed = true;\n node = parent;\n parent = parent.rbParent;\n } while (!node.rbRed);\n if (node) {node.rbRed = false;}\n };\n\nVoronoi.prototype.RBTree.prototype.rbRotateLeft = function(node) {\n var p = node,\n q = node.rbRight, // can't be null\n parent = p.rbParent;\n if (parent) {\n if (parent.rbLeft === p) {\n parent.rbLeft = q;\n }\n else {\n parent.rbRight = q;\n }\n }\n else {\n this.root = q;\n }\n q.rbParent = parent;\n p.rbParent = q;\n p.rbRight = q.rbLeft;\n if (p.rbRight) {\n p.rbRight.rbParent = p;\n }\n q.rbLeft = p;\n };\n\nVoronoi.prototype.RBTree.prototype.rbRotateRight = function(node) {\n var p = node,\n q = node.rbLeft, // can't be null\n parent = p.rbParent;\n if (parent) {\n if (parent.rbLeft === p) {\n parent.rbLeft = q;\n }\n else {\n parent.rbRight = q;\n }\n }\n else {\n this.root = q;\n }\n q.rbParent = parent;\n p.rbParent = q;\n p.rbLeft = q.rbRight;\n if (p.rbLeft) {\n p.rbLeft.rbParent = p;\n }\n q.rbRight = p;\n };\n\nVoronoi.prototype.RBTree.prototype.getFirst = function(node) {\n while (node.rbLeft) {\n node = node.rbLeft;\n }\n return node;\n };\n\nVoronoi.prototype.RBTree.prototype.getLast = function(node) {\n while (node.rbRight) {\n node = node.rbRight;\n }\n return node;\n };\n\n// ---------------------------------------------------------------------------\n// Diagram methods\n\nVoronoi.prototype.Diagram = function(site) {\n this.site = site;\n };\n\n// ---------------------------------------------------------------------------\n// Cell methods\n\nVoronoi.prototype.Cell = function(site) {\n this.site = site;\n this.halfedges = [];\n this.closeMe = false;\n };\n\nVoronoi.prototype.Cell.prototype.init = function(site) {\n this.site = site;\n this.halfedges = [];\n this.closeMe = false;\n return this;\n };\n\nVoronoi.prototype.createCell = function(site) {\n var cell = this.cellJunkyard.pop();\n if ( cell ) {\n return cell.init(site);\n }\n return new this.Cell(site);\n };\n\nVoronoi.prototype.Cell.prototype.prepareHalfedges = function() {\n var halfedges = this.halfedges,\n iHalfedge = halfedges.length,\n edge;\n // get rid of unused halfedges\n // rhill 2011-05-27: Keep it simple, no point here in trying\n // to be fancy: dangling edges are a typically a minority.\n while (iHalfedge--) {\n edge = halfedges[iHalfedge].edge;\n if (!edge.vb || !edge.va) {\n halfedges.splice(iHalfedge,1);\n }\n }\n\n // rhill 2011-05-26: I tried to use a binary search at insertion\n // time to keep the array sorted on-the-fly (in Cell.addHalfedge()).\n // There was no real benefits in doing so, performance on\n // Firefox 3.6 was improved marginally, while performance on\n // Opera 11 was penalized marginally.\n halfedges.sort(function(a,b){return b.angle-a.angle;});\n return halfedges.length;\n };\n\n// Return a list of the neighbor Ids\nVoronoi.prototype.Cell.prototype.getNeighborIds = function() {\n var neighbors = [],\n iHalfedge = this.halfedges.length,\n edge;\n while (iHalfedge--){\n edge = this.halfedges[iHalfedge].edge;\n if (edge.lSite !== null && edge.lSite.voronoiId != this.site.voronoiId) {\n neighbors.push(edge.lSite.voronoiId);\n }\n else if (edge.rSite !== null && edge.rSite.voronoiId != this.site.voronoiId){\n neighbors.push(edge.rSite.voronoiId);\n }\n }\n return neighbors;\n };\n\n// Compute bounding box\n//\nVoronoi.prototype.Cell.prototype.getBbox = function() {\n var halfedges = this.halfedges,\n iHalfedge = halfedges.length,\n xmin = Infinity,\n ymin = Infinity,\n xmax = -Infinity,\n ymax = -Infinity,\n v, vx, vy;\n while (iHalfedge--) {\n v = halfedges[iHalfedge].getStartpoint();\n vx = v.x;\n vy = v.y;\n if (vx < xmin) {xmin = vx;}\n if (vy < ymin) {ymin = vy;}\n if (vx > xmax) {xmax = vx;}\n if (vy > ymax) {ymax = vy;}\n // we dont need to take into account end point,\n // since each end point matches a start point\n }\n return {\n x: xmin,\n y: ymin,\n width: xmax-xmin,\n height: ymax-ymin\n };\n };\n\n// Return whether a point is inside, on, or outside the cell:\n// -1: point is outside the perimeter of the cell\n// 0: point is on the perimeter of the cell\n// 1: point is inside the perimeter of the cell\n//\nVoronoi.prototype.Cell.prototype.pointIntersection = function(x, y) {\n // Check if point in polygon. Since all polygons of a Voronoi\n // diagram are convex, then:\n // http://paulbourke.net/geometry/polygonmesh/\n // Solution 3 (2D):\n // \"If the polygon is convex then one can consider the polygon\n // \"as a 'path' from the first vertex. A point is on the interior\n // \"of this polygons if it is always on the same side of all the\n // \"line segments making up the path. ...\n // \"(y - y0) (x1 - x0) - (x - x0) (y1 - y0)\n // \"if it is less than 0 then P is to the right of the line segment,\n // \"if greater than 0 it is to the left, if equal to 0 then it lies\n // \"on the line segment\"\n var halfedges = this.halfedges,\n iHalfedge = halfedges.length,\n halfedge,\n p0, p1, r;\n while (iHalfedge--) {\n halfedge = halfedges[iHalfedge];\n p0 = halfedge.getStartpoint();\n p1 = halfedge.getEndpoint();\n r = (y-p0.y)*(p1.x-p0.x)-(x-p0.x)*(p1.y-p0.y);\n if (!r) {\n return 0;\n }\n if (r > 0) {\n return -1;\n }\n }\n return 1;\n };\n\n// ---------------------------------------------------------------------------\n// Edge methods\n//\n\nVoronoi.prototype.Vertex = function(x, y) {\n this.x = x;\n this.y = y;\n };\n\nVoronoi.prototype.Edge = function(lSite, rSite) {\n this.lSite = lSite;\n this.rSite = rSite;\n this.va = this.vb = null;\n };\n\nVoronoi.prototype.Halfedge = function(edge, lSite, rSite) {\n this.site = lSite;\n this.edge = edge;\n // 'angle' is a value to be used for properly sorting the\n // halfsegments counterclockwise. By convention, we will\n // use the angle of the line defined by the 'site to the left'\n // to the 'site to the right'.\n // However, border edges have no 'site to the right': thus we\n // use the angle of line perpendicular to the halfsegment (the\n // edge should have both end points defined in such case.)\n if (rSite) {\n this.angle = Math.atan2(rSite.y-lSite.y, rSite.x-lSite.x);\n }\n else {\n var va = edge.va,\n vb = edge.vb;\n // rhill 2011-05-31: used to call getStartpoint()/getEndpoint(),\n // but for performance purpose, these are expanded in place here.\n this.angle = edge.lSite === lSite ?\n Math.atan2(vb.x-va.x, va.y-vb.y) :\n Math.atan2(va.x-vb.x, vb.y-va.y);\n }\n };\n\nVoronoi.prototype.createHalfedge = function(edge, lSite, rSite) {\n return new this.Halfedge(edge, lSite, rSite);\n };\n\nVoronoi.prototype.Halfedge.prototype.getStartpoint = function() {\n return this.edge.lSite === this.site ? this.edge.va : this.edge.vb;\n };\n\nVoronoi.prototype.Halfedge.prototype.getEndpoint = function() {\n return this.edge.lSite === this.site ? this.edge.vb : this.edge.va;\n };\n\n\n\n// this create and add a vertex to the internal collection\n\nVoronoi.prototype.createVertex = function(x, y) {\n var v = this.vertexJunkyard.pop();\n if ( !v ) {\n v = new this.Vertex(x, y);\n }\n else {\n v.x = x;\n v.y = y;\n }\n this.vertices.push(v);\n return v;\n };\n\n// this create and add an edge to internal collection, and also create\n// two halfedges which are added to each site's counterclockwise array\n// of halfedges.\n\nVoronoi.prototype.createEdge = function(lSite, rSite, va, vb) {\n var edge = this.edgeJunkyard.pop();\n if ( !edge ) {\n edge = new this.Edge(lSite, rSite);\n }\n else {\n edge.lSite = lSite;\n edge.rSite = rSite;\n edge.va = edge.vb = null;\n }\n\n this.edges.push(edge);\n if (va) {\n this.setEdgeStartpoint(edge, lSite, rSite, va);\n }\n if (vb) {\n this.setEdgeEndpoint(edge, lSite, rSite, vb);\n }\n this.cells[lSite.voronoiId].halfedges.push(this.createHalfedge(edge, lSite, rSite));\n this.cells[rSite.voronoiId].halfedges.push(this.createHalfedge(edge, rSite, lSite));\n return edge;\n };\n\nVoronoi.prototype.createBorderEdge = function(lSite, va, vb) {\n var edge = this.edgeJunkyard.pop();\n if ( !edge ) {\n edge = new this.Edge(lSite, null);\n }\n else {\n edge.lSite = lSite;\n edge.rSite = null;\n }\n edge.va = va;\n edge.vb = vb;\n this.edges.push(edge);\n return edge;\n };\n\nVoronoi.prototype.setEdgeStartpoint = function(edge, lSite, rSite, vertex) {\n if (!edge.va && !edge.vb) {\n edge.va = vertex;\n edge.lSite = lSite;\n edge.rSite = rSite;\n }\n else if (edge.lSite === rSite) {\n edge.vb = vertex;\n }\n else {\n edge.va = vertex;\n }\n };\n\nVoronoi.prototype.setEdgeEndpoint = function(edge, lSite, rSite, vertex) {\n this.setEdgeStartpoint(edge, rSite, lSite, vertex);\n };\n\n// ---------------------------------------------------------------------------\n// Beachline methods\n\n// rhill 2011-06-07: For some reasons, performance suffers significantly\n// when instanciating a literal object instead of an empty ctor\nVoronoi.prototype.Beachsection = function() {\n };\n\n// rhill 2011-06-02: A lot of Beachsection instanciations\n// occur during the computation of the Voronoi diagram,\n// somewhere between the number of sites and twice the\n// number of sites, while the number of Beachsections on the\n// beachline at any given time is comparatively low. For this\n// reason, we reuse already created Beachsections, in order\n// to avoid new memory allocation. This resulted in a measurable\n// performance gain.\n\nVoronoi.prototype.createBeachsection = function(site) {\n var beachsection = this.beachsectionJunkyard.pop();\n if (!beachsection) {\n beachsection = new this.Beachsection();\n }\n beachsection.site = site;\n return beachsection;\n };\n\n// calculate the left break point of a particular beach section,\n// given a particular sweep line\nVoronoi.prototype.leftBreakPoint = function(arc, directrix) {\n // http://en.wikipedia.org/wiki/Parabola\n // http://en.wikipedia.org/wiki/Quadratic_equation\n // h1 = x1,\n // k1 = (y1+directrix)/2,\n // h2 = x2,\n // k2 = (y2+directrix)/2,\n // p1 = k1-directrix,\n // a1 = 1/(4*p1),\n // b1 = -h1/(2*p1),\n // c1 = h1*h1/(4*p1)+k1,\n // p2 = k2-directrix,\n // a2 = 1/(4*p2),\n // b2 = -h2/(2*p2),\n // c2 = h2*h2/(4*p2)+k2,\n // x = (-(b2-b1) + Math.sqrt((b2-b1)*(b2-b1) - 4*(a2-a1)*(c2-c1))) / (2*(a2-a1))\n // When x1 become the x-origin:\n // h1 = 0,\n // k1 = (y1+directrix)/2,\n // h2 = x2-x1,\n // k2 = (y2+directrix)/2,\n // p1 = k1-directrix,\n // a1 = 1/(4*p1),\n // b1 = 0,\n // c1 = k1,\n // p2 = k2-directrix,\n // a2 = 1/(4*p2),\n // b2 = -h2/(2*p2),\n // c2 = h2*h2/(4*p2)+k2,\n // x = (-b2 + Math.sqrt(b2*b2 - 4*(a2-a1)*(c2-k1))) / (2*(a2-a1)) + x1\n\n // change code below at your own risk: care has been taken to\n // reduce errors due to computers' finite arithmetic precision.\n // Maybe can still be improved, will see if any more of this\n // kind of errors pop up again.\n var site = arc.site,\n rfocx = site.x,\n rfocy = site.y,\n pby2 = rfocy-directrix;\n // parabola in degenerate case where focus is on directrix\n if (!pby2) {\n return rfocx;\n }\n var lArc = arc.rbPrevious;\n if (!lArc) {\n return -Infinity;\n }\n site = lArc.site;\n var lfocx = site.x,\n lfocy = site.y,\n plby2 = lfocy-directrix;\n // parabola in degenerate case where focus is on directrix\n if (!plby2) {\n return lfocx;\n }\n var hl = lfocx-rfocx,\n aby2 = 1/pby2-1/plby2,\n b = hl/plby2;\n if (aby2) {\n return (-b+this.sqrt(b*b-2*aby2*(hl*hl/(-2*plby2)-lfocy+plby2/2+rfocy-pby2/2)))/aby2+rfocx;\n }\n // both parabolas have same distance to directrix, thus break point is midway\n return (rfocx+lfocx)/2;\n };\n\n// calculate the right break point of a particular beach section,\n// given a particular directrix\nVoronoi.prototype.rightBreakPoint = function(arc, directrix) {\n var rArc = arc.rbNext;\n if (rArc) {\n return this.leftBreakPoint(rArc, directrix);\n }\n var site = arc.site;\n return site.y === directrix ? site.x : Infinity;\n };\n\nVoronoi.prototype.detachBeachsection = function(beachsection) {\n this.detachCircleEvent(beachsection); // detach potentially attached circle event\n this.beachline.rbRemoveNode(beachsection); // remove from RB-tree\n this.beachsectionJunkyard.push(beachsection); // mark for reuse\n };\n\nVoronoi.prototype.removeBeachsection = function(beachsection) {\n var circle = beachsection.circleEvent,\n x = circle.x,\n y = circle.ycenter,\n vertex = this.createVertex(x, y),\n previous = beachsection.rbPrevious,\n next = beachsection.rbNext,\n disappearingTransitions = [beachsection],\n abs_fn = Math.abs;\n\n // remove collapsed beachsection from beachline\n this.detachBeachsection(beachsection);\n\n // there could be more than one empty arc at the deletion point, this\n // happens when more than two edges are linked by the same vertex,\n // so we will collect all those edges by looking up both sides of\n // the deletion point.\n // by the way, there is *always* a predecessor/successor to any collapsed\n // beach section, it's just impossible to have a collapsing first/last\n // beach sections on the beachline, since they obviously are unconstrained\n // on their left/right side.\n\n // look left\n var lArc = previous;\n while (lArc.circleEvent && abs_fn(x-lArc.circleEvent.x)<1e-9 && abs_fn(y-lArc.circleEvent.ycenter)<1e-9) {\n previous = lArc.rbPrevious;\n disappearingTransitions.unshift(lArc);\n this.detachBeachsection(lArc); // mark for reuse\n lArc = previous;\n }\n // even though it is not disappearing, I will also add the beach section\n // immediately to the left of the left-most collapsed beach section, for\n // convenience, since we need to refer to it later as this beach section\n // is the 'left' site of an edge for which a start point is set.\n disappearingTransitions.unshift(lArc);\n this.detachCircleEvent(lArc);\n\n // look right\n var rArc = next;\n while (rArc.circleEvent && abs_fn(x-rArc.circleEvent.x)<1e-9 && abs_fn(y-rArc.circleEvent.ycenter)<1e-9) {\n next = rArc.rbNext;\n disappearingTransitions.push(rArc);\n this.detachBeachsection(rArc); // mark for reuse\n rArc = next;\n }\n // we also have to add the beach section immediately to the right of the\n // right-most collapsed beach section, since there is also a disappearing\n // transition representing an edge's start point on its left.\n disappearingTransitions.push(rArc);\n this.detachCircleEvent(rArc);\n\n // walk through all the disappearing transitions between beach sections and\n // set the start point of their (implied) edge.\n var nArcs = disappearingTransitions.length,\n iArc;\n for (iArc=1; iArc falls somewhere before the left edge of the beachsection\n if (dxl > 1e-9) {\n // this case should never happen\n // if (!node.rbLeft) {\n // rArc = node.rbLeft;\n // break;\n // }\n node = node.rbLeft;\n }\n else {\n dxr = x-this.rightBreakPoint(node,directrix);\n // x greaterThanWithEpsilon xr => falls somewhere after the right edge of the beachsection\n if (dxr > 1e-9) {\n if (!node.rbRight) {\n lArc = node;\n break;\n }\n node = node.rbRight;\n }\n else {\n // x equalWithEpsilon xl => falls exactly on the left edge of the beachsection\n if (dxl > -1e-9) {\n lArc = node.rbPrevious;\n rArc = node;\n }\n // x equalWithEpsilon xr => falls exactly on the right edge of the beachsection\n else if (dxr > -1e-9) {\n lArc = node;\n rArc = node.rbNext;\n }\n // falls exactly somewhere in the middle of the beachsection\n else {\n lArc = rArc = node;\n }\n break;\n }\n }\n }\n // at this point, keep in mind that lArc and/or rArc could be\n // undefined or null.\n\n // create a new beach section object for the site and add it to RB-tree\n var newArc = this.createBeachsection(site);\n this.beachline.rbInsertSuccessor(lArc, newArc);\n\n // cases:\n //\n\n // [null,null]\n // least likely case: new beach section is the first beach section on the\n // beachline.\n // This case means:\n // no new transition appears\n // no collapsing beach section\n // new beachsection become root of the RB-tree\n if (!lArc && !rArc) {\n return;\n }\n\n // [lArc,rArc] where lArc == rArc\n // most likely case: new beach section split an existing beach\n // section.\n // This case means:\n // one new transition appears\n // the left and right beach section might be collapsing as a result\n // two new nodes added to the RB-tree\n if (lArc === rArc) {\n // invalidate circle event of split beach section\n this.detachCircleEvent(lArc);\n\n // split the beach section into two separate beach sections\n rArc = this.createBeachsection(lArc.site);\n this.beachline.rbInsertSuccessor(newArc, rArc);\n\n // since we have a new transition between two beach sections,\n // a new edge is born\n newArc.edge = rArc.edge = this.createEdge(lArc.site, newArc.site);\n\n // check whether the left and right beach sections are collapsing\n // and if so create circle events, to be notified when the point of\n // collapse is reached.\n this.attachCircleEvent(lArc);\n this.attachCircleEvent(rArc);\n return;\n }\n\n // [lArc,null]\n // even less likely case: new beach section is the *last* beach section\n // on the beachline -- this can happen *only* if *all* the previous beach\n // sections currently on the beachline share the same y value as\n // the new beach section.\n // This case means:\n // one new transition appears\n // no collapsing beach section as a result\n // new beach section become right-most node of the RB-tree\n if (lArc && !rArc) {\n newArc.edge = this.createEdge(lArc.site,newArc.site);\n return;\n }\n\n // [null,rArc]\n // impossible case: because sites are strictly processed from top to bottom,\n // and left to right, which guarantees that there will always be a beach section\n // on the left -- except of course when there are no beach section at all on\n // the beach line, which case was handled above.\n // rhill 2011-06-02: No point testing in non-debug version\n //if (!lArc && rArc) {\n // throw \"Voronoi.addBeachsection(): What is this I don't even\";\n // }\n\n // [lArc,rArc] where lArc != rArc\n // somewhat less likely case: new beach section falls *exactly* in between two\n // existing beach sections\n // This case means:\n // one transition disappears\n // two new transitions appear\n // the left and right beach section might be collapsing as a result\n // only one new node added to the RB-tree\n if (lArc !== rArc) {\n // invalidate circle events of left and right sites\n this.detachCircleEvent(lArc);\n this.detachCircleEvent(rArc);\n\n // an existing transition disappears, meaning a vertex is defined at\n // the disappearance point.\n // since the disappearance is caused by the new beachsection, the\n // vertex is at the center of the circumscribed circle of the left,\n // new and right beachsections.\n // http://mathforum.org/library/drmath/view/55002.html\n // Except that I bring the origin at A to simplify\n // calculation\n var lSite = lArc.site,\n ax = lSite.x,\n ay = lSite.y,\n bx=site.x-ax,\n by=site.y-ay,\n rSite = rArc.site,\n cx=rSite.x-ax,\n cy=rSite.y-ay,\n d=2*(bx*cy-by*cx),\n hb=bx*bx+by*by,\n hc=cx*cx+cy*cy,\n vertex = this.createVertex((cy*hb-by*hc)/d+ax, (bx*hc-cx*hb)/d+ay);\n\n // one transition disappear\n this.setEdgeStartpoint(rArc.edge, lSite, rSite, vertex);\n\n // two new transitions appear at the new vertex location\n newArc.edge = this.createEdge(lSite, site, undefined, vertex);\n rArc.edge = this.createEdge(site, rSite, undefined, vertex);\n\n // check whether the left and right beach sections are collapsing\n // and if so create circle events, to handle the point of collapse.\n this.attachCircleEvent(lArc);\n this.attachCircleEvent(rArc);\n return;\n }\n };\n\n// ---------------------------------------------------------------------------\n// Circle event methods\n\n// rhill 2011-06-07: For some reasons, performance suffers significantly\n// when instanciating a literal object instead of an empty ctor\nVoronoi.prototype.CircleEvent = function() {\n // rhill 2013-10-12: it helps to state exactly what we are at ctor time.\n this.arc = null;\n this.rbLeft = null;\n this.rbNext = null;\n this.rbParent = null;\n this.rbPrevious = null;\n this.rbRed = false;\n this.rbRight = null;\n this.site = null;\n this.x = this.y = this.ycenter = 0;\n };\n\nVoronoi.prototype.attachCircleEvent = function(arc) {\n var lArc = arc.rbPrevious,\n rArc = arc.rbNext;\n if (!lArc || !rArc) {return;} // does that ever happen?\n var lSite = lArc.site,\n cSite = arc.site,\n rSite = rArc.site;\n\n // If site of left beachsection is same as site of\n // right beachsection, there can't be convergence\n if (lSite===rSite) {return;}\n\n // Find the circumscribed circle for the three sites associated\n // with the beachsection triplet.\n // rhill 2011-05-26: It is more efficient to calculate in-place\n // rather than getting the resulting circumscribed circle from an\n // object returned by calling Voronoi.circumcircle()\n // http://mathforum.org/library/drmath/view/55002.html\n // Except that I bring the origin at cSite to simplify calculations.\n // The bottom-most part of the circumcircle is our Fortune 'circle\n // event', and its center is a vertex potentially part of the final\n // Voronoi diagram.\n var bx = cSite.x,\n by = cSite.y,\n ax = lSite.x-bx,\n ay = lSite.y-by,\n cx = rSite.x-bx,\n cy = rSite.y-by;\n\n // If points l->c->r are clockwise, then center beach section does not\n // collapse, hence it can't end up as a vertex (we reuse 'd' here, which\n // sign is reverse of the orientation, hence we reverse the test.\n // http://en.wikipedia.org/wiki/Curve_orientation#Orientation_of_a_simple_polygon\n // rhill 2011-05-21: Nasty finite precision error which caused circumcircle() to\n // return infinites: 1e-12 seems to fix the problem.\n var d = 2*(ax*cy-ay*cx);\n if (d >= -2e-12){return;}\n\n var ha = ax*ax+ay*ay,\n hc = cx*cx+cy*cy,\n x = (cy*ha-ay*hc)/d,\n y = (ax*hc-cx*ha)/d,\n ycenter = y+by;\n\n // Important: ybottom should always be under or at sweep, so no need\n // to waste CPU cycles by checking\n\n // recycle circle event object if possible\n var circleEvent = this.circleEventJunkyard.pop();\n if (!circleEvent) {\n circleEvent = new this.CircleEvent();\n }\n circleEvent.arc = arc;\n circleEvent.site = cSite;\n circleEvent.x = x+bx;\n circleEvent.y = ycenter+this.sqrt(x*x+y*y); // y bottom\n circleEvent.ycenter = ycenter;\n arc.circleEvent = circleEvent;\n\n // find insertion point in RB-tree: circle events are ordered from\n // smallest to largest\n var predecessor = null,\n node = this.circleEvents.root;\n while (node) {\n if (circleEvent.y < node.y || (circleEvent.y === node.y && circleEvent.x <= node.x)) {\n if (node.rbLeft) {\n node = node.rbLeft;\n }\n else {\n predecessor = node.rbPrevious;\n break;\n }\n }\n else {\n if (node.rbRight) {\n node = node.rbRight;\n }\n else {\n predecessor = node;\n break;\n }\n }\n }\n this.circleEvents.rbInsertSuccessor(predecessor, circleEvent);\n if (!predecessor) {\n this.firstCircleEvent = circleEvent;\n }\n };\n\nVoronoi.prototype.detachCircleEvent = function(arc) {\n var circleEvent = arc.circleEvent;\n if (circleEvent) {\n if (!circleEvent.rbPrevious) {\n this.firstCircleEvent = circleEvent.rbNext;\n }\n this.circleEvents.rbRemoveNode(circleEvent); // remove from RB-tree\n this.circleEventJunkyard.push(circleEvent);\n arc.circleEvent = null;\n }\n };\n\n// ---------------------------------------------------------------------------\n// Diagram completion methods\n\n// connect dangling edges (not if a cursory test tells us\n// it is not going to be visible.\n// return value:\n// false: the dangling endpoint couldn't be connected\n// true: the dangling endpoint could be connected\nVoronoi.prototype.connectEdge = function(edge, bbox) {\n // skip if end point already connected\n var vb = edge.vb;\n if (!!vb) {return true;}\n\n // make local copy for performance purpose\n var va = edge.va,\n xl = bbox.xl,\n xr = bbox.xr,\n yt = bbox.yt,\n yb = bbox.yb,\n lSite = edge.lSite,\n rSite = edge.rSite,\n lx = lSite.x,\n ly = lSite.y,\n rx = rSite.x,\n ry = rSite.y,\n fx = (lx+rx)/2,\n fy = (ly+ry)/2,\n fm, fb;\n\n // if we reach here, this means cells which use this edge will need\n // to be closed, whether because the edge was removed, or because it\n // was connected to the bounding box.\n this.cells[lSite.voronoiId].closeMe = true;\n this.cells[rSite.voronoiId].closeMe = true;\n\n // get the line equation of the bisector if line is not vertical\n if (ry !== ly) {\n fm = (lx-rx)/(ry-ly);\n fb = fy-fm*fx;\n }\n\n // remember, direction of line (relative to left site):\n // upward: left.x < right.x\n // downward: left.x > right.x\n // horizontal: left.x == right.x\n // upward: left.x < right.x\n // rightward: left.y < right.y\n // leftward: left.y > right.y\n // vertical: left.y == right.y\n\n // depending on the direction, find the best side of the\n // bounding box to use to determine a reasonable start point\n\n // rhill 2013-12-02:\n // While at it, since we have the values which define the line,\n // clip the end of va if it is outside the bbox.\n // https://github.com/gorhill/Javascript-Voronoi/issues/15\n // TODO: Do all the clipping here rather than rely on Liang-Barsky\n // which does not do well sometimes due to loss of arithmetic\n // precision. The code here doesn't degrade if one of the vertex is\n // at a huge distance.\n\n // special case: vertical line\n if (fm === undefined) {\n // doesn't intersect with viewport\n if (fx < xl || fx >= xr) {return false;}\n // downward\n if (lx > rx) {\n if (!va || va.y < yt) {\n va = this.createVertex(fx, yt);\n }\n else if (va.y >= yb) {\n return false;\n }\n vb = this.createVertex(fx, yb);\n }\n // upward\n else {\n if (!va || va.y > yb) {\n va = this.createVertex(fx, yb);\n }\n else if (va.y < yt) {\n return false;\n }\n vb = this.createVertex(fx, yt);\n }\n }\n // closer to vertical than horizontal, connect start point to the\n // top or bottom side of the bounding box\n else if (fm < -1 || fm > 1) {\n // downward\n if (lx > rx) {\n if (!va || va.y < yt) {\n va = this.createVertex((yt-fb)/fm, yt);\n }\n else if (va.y >= yb) {\n return false;\n }\n vb = this.createVertex((yb-fb)/fm, yb);\n }\n // upward\n else {\n if (!va || va.y > yb) {\n va = this.createVertex((yb-fb)/fm, yb);\n }\n else if (va.y < yt) {\n return false;\n }\n vb = this.createVertex((yt-fb)/fm, yt);\n }\n }\n // closer to horizontal than vertical, connect start point to the\n // left or right side of the bounding box\n else {\n // rightward\n if (ly < ry) {\n if (!va || va.x < xl) {\n va = this.createVertex(xl, fm*xl+fb);\n }\n else if (va.x >= xr) {\n return false;\n }\n vb = this.createVertex(xr, fm*xr+fb);\n }\n // leftward\n else {\n if (!va || va.x > xr) {\n va = this.createVertex(xr, fm*xr+fb);\n }\n else if (va.x < xl) {\n return false;\n }\n vb = this.createVertex(xl, fm*xl+fb);\n }\n }\n edge.va = va;\n edge.vb = vb;\n\n return true;\n };\n\n// line-clipping code taken from:\n// Liang-Barsky function by Daniel White\n// http://www.skytopia.com/project/articles/compsci/clipping.html\n// Thanks!\n// A bit modified to minimize code paths\nVoronoi.prototype.clipEdge = function(edge, bbox) {\n var ax = edge.va.x,\n ay = edge.va.y,\n bx = edge.vb.x,\n by = edge.vb.y,\n t0 = 0,\n t1 = 1,\n dx = bx-ax,\n dy = by-ay;\n // left\n var q = ax-bbox.xl;\n if (dx===0 && q<0) {return false;}\n var r = -q/dx;\n if (dx<0) {\n if (r0) {\n if (r>t1) {return false;}\n if (r>t0) {t0=r;}\n }\n // right\n q = bbox.xr-ax;\n if (dx===0 && q<0) {return false;}\n r = q/dx;\n if (dx<0) {\n if (r>t1) {return false;}\n if (r>t0) {t0=r;}\n }\n else if (dx>0) {\n if (r0) {\n if (r>t1) {return false;}\n if (r>t0) {t0=r;}\n }\n // bottom\n q = bbox.yb-ay;\n if (dy===0 && q<0) {return false;}\n r = q/dy;\n if (dy<0) {\n if (r>t1) {return false;}\n if (r>t0) {t0=r;}\n }\n else if (dy>0) {\n if (r 0, va needs to change\n // rhill 2011-06-03: we need to create a new vertex rather\n // than modifying the existing one, since the existing\n // one is likely shared with at least another edge\n if (t0 > 0) {\n edge.va = this.createVertex(ax+t0*dx, ay+t0*dy);\n }\n\n // if t1 < 1, vb needs to change\n // rhill 2011-06-03: we need to create a new vertex rather\n // than modifying the existing one, since the existing\n // one is likely shared with at least another edge\n if (t1 < 1) {\n edge.vb = this.createVertex(ax+t1*dx, ay+t1*dy);\n }\n\n // va and/or vb were clipped, thus we will need to close\n // cells which use this edge.\n if ( t0 > 0 || t1 < 1 ) {\n this.cells[edge.lSite.voronoiId].closeMe = true;\n this.cells[edge.rSite.voronoiId].closeMe = true;\n }\n\n return true;\n };\n\n// Connect/cut edges at bounding box\nVoronoi.prototype.clipEdges = function(bbox) {\n // connect all dangling edges to bounding box\n // or get rid of them if it can't be done\n var edges = this.edges,\n iEdge = edges.length,\n edge,\n abs_fn = Math.abs;\n\n // iterate backward so we can splice safely\n while (iEdge--) {\n edge = edges[iEdge];\n // edge is removed if:\n // it is wholly outside the bounding box\n // it is looking more like a point than a line\n if (!this.connectEdge(edge, bbox) ||\n !this.clipEdge(edge, bbox) ||\n (abs_fn(edge.va.x-edge.vb.x)<1e-9 && abs_fn(edge.va.y-edge.vb.y)<1e-9)) {\n edge.va = edge.vb = null;\n edges.splice(iEdge,1);\n }\n }\n };\n\n// Close the cells.\n// The cells are bound by the supplied bounding box.\n// Each cell refers to its associated site, and a list\n// of halfedges ordered counterclockwise.\nVoronoi.prototype.closeCells = function(bbox) {\n var xl = bbox.xl,\n xr = bbox.xr,\n yt = bbox.yt,\n yb = bbox.yb,\n cells = this.cells,\n iCell = cells.length,\n cell,\n iLeft,\n halfedges, nHalfedges,\n edge,\n va, vb, vz,\n lastBorderSegment,\n abs_fn = Math.abs;\n\n while (iCell--) {\n cell = cells[iCell];\n // prune, order halfedges counterclockwise, then add missing ones\n // required to close cells\n if (!cell.prepareHalfedges()) {\n continue;\n }\n if (!cell.closeMe) {\n continue;\n }\n // find first 'unclosed' point.\n // an 'unclosed' point will be the end point of a halfedge which\n // does not match the start point of the following halfedge\n halfedges = cell.halfedges;\n nHalfedges = halfedges.length;\n // special case: only one site, in which case, the viewport is the cell\n // ...\n\n // all other cases\n iLeft = 0;\n while (iLeft < nHalfedges) {\n va = halfedges[iLeft].getEndpoint();\n vz = halfedges[(iLeft+1) % nHalfedges].getStartpoint();\n // if end point is not equal to start point, we need to add the missing\n // halfedge(s) up to vz\n if (abs_fn(va.x-vz.x)>=1e-9 || abs_fn(va.y-vz.y)>=1e-9) {\n\n // rhill 2013-12-02:\n // \"Holes\" in the halfedges are not necessarily always adjacent.\n // https://github.com/gorhill/Javascript-Voronoi/issues/16\n\n // find entry point:\n switch (true) {\n\n // walk downward along left side\n case this.equalWithEpsilon(va.x,xl) && this.lessThanWithEpsilon(va.y,yb):\n lastBorderSegment = this.equalWithEpsilon(vz.x,xl);\n vb = this.createVertex(xl, lastBorderSegment ? vz.y : yb);\n edge = this.createBorderEdge(cell.site, va, vb);\n iLeft++;\n halfedges.splice(iLeft, 0, this.createHalfedge(edge, cell.site, null));\n nHalfedges++;\n if ( lastBorderSegment ) { break; }\n va = vb;\n // fall through\n\n // walk rightward along bottom side\n case this.equalWithEpsilon(va.y,yb) && this.lessThanWithEpsilon(va.x,xr):\n lastBorderSegment = this.equalWithEpsilon(vz.y,yb);\n vb = this.createVertex(lastBorderSegment ? vz.x : xr, yb);\n edge = this.createBorderEdge(cell.site, va, vb);\n iLeft++;\n halfedges.splice(iLeft, 0, this.createHalfedge(edge, cell.site, null));\n nHalfedges++;\n if ( lastBorderSegment ) { break; }\n va = vb;\n // fall through\n\n // walk upward along right side\n case this.equalWithEpsilon(va.x,xr) && this.greaterThanWithEpsilon(va.y,yt):\n lastBorderSegment = this.equalWithEpsilon(vz.x,xr);\n vb = this.createVertex(xr, lastBorderSegment ? vz.y : yt);\n edge = this.createBorderEdge(cell.site, va, vb);\n iLeft++;\n halfedges.splice(iLeft, 0, this.createHalfedge(edge, cell.site, null));\n nHalfedges++;\n if ( lastBorderSegment ) { break; }\n va = vb;\n // fall through\n\n // walk leftward along top side\n case this.equalWithEpsilon(va.y,yt) && this.greaterThanWithEpsilon(va.x,xl):\n lastBorderSegment = this.equalWithEpsilon(vz.y,yt);\n vb = this.createVertex(lastBorderSegment ? vz.x : xl, yt);\n edge = this.createBorderEdge(cell.site, va, vb);\n iLeft++;\n halfedges.splice(iLeft, 0, this.createHalfedge(edge, cell.site, null));\n nHalfedges++;\n if ( lastBorderSegment ) { break; }\n va = vb;\n // fall through\n\n // walk downward along left side\n lastBorderSegment = this.equalWithEpsilon(vz.x,xl);\n vb = this.createVertex(xl, lastBorderSegment ? vz.y : yb);\n edge = this.createBorderEdge(cell.site, va, vb);\n iLeft++;\n halfedges.splice(iLeft, 0, this.createHalfedge(edge, cell.site, null));\n nHalfedges++;\n if ( lastBorderSegment ) { break; }\n va = vb;\n // fall through\n\n // walk rightward along bottom side\n lastBorderSegment = this.equalWithEpsilon(vz.y,yb);\n vb = this.createVertex(lastBorderSegment ? vz.x : xr, yb);\n edge = this.createBorderEdge(cell.site, va, vb);\n iLeft++;\n halfedges.splice(iLeft, 0, this.createHalfedge(edge, cell.site, null));\n nHalfedges++;\n if ( lastBorderSegment ) { break; }\n va = vb;\n // fall through\n\n // walk upward along right side\n lastBorderSegment = this.equalWithEpsilon(vz.x,xr);\n vb = this.createVertex(xr, lastBorderSegment ? vz.y : yt);\n edge = this.createBorderEdge(cell.site, va, vb);\n iLeft++;\n halfedges.splice(iLeft, 0, this.createHalfedge(edge, cell.site, null));\n nHalfedges++;\n if ( lastBorderSegment ) { break; }\n // fall through\n\n default:\n throw \"Voronoi.closeCells() > this makes no sense!\";\n }\n }\n iLeft++;\n }\n cell.closeMe = false;\n }\n };\n\n// ---------------------------------------------------------------------------\n// Debugging helper\n/*\nVoronoi.prototype.dumpBeachline = function(y) {\n console.log('Voronoi.dumpBeachline(%f) > Beachsections, from left to right:', y);\n if ( !this.beachline ) {\n console.log(' None');\n }\n else {\n var bs = this.beachline.getFirst(this.beachline.root);\n while ( bs ) {\n console.log(' site %d: xl: %f, xr: %f', bs.site.voronoiId, this.leftBreakPoint(bs, y), this.rightBreakPoint(bs, y));\n bs = bs.rbNext;\n }\n }\n };\n*/\n\n// ---------------------------------------------------------------------------\n// Helper: Quantize sites\n\n// rhill 2013-10-12:\n// This is to solve https://github.com/gorhill/Javascript-Voronoi/issues/15\n// Since not all users will end up using the kind of coord values which would\n// cause the issue to arise, I chose to let the user decide whether or not\n// he should sanitize his coord values through this helper. This way, for\n// those users who uses coord values which are known to be fine, no overhead is\n// added.\n\nVoronoi.prototype.quantizeSites = function(sites) {\n var ε = this.ε,\n n = sites.length,\n site;\n while ( n-- ) {\n site = sites[n];\n site.x = Math.floor(site.x / ε) * ε;\n site.y = Math.floor(site.y / ε) * ε;\n }\n };\n\n// ---------------------------------------------------------------------------\n// Helper: Recycle diagram: all vertex, edge and cell objects are\n// \"surrendered\" to the Voronoi object for reuse.\n// TODO: rhill-voronoi-core v2: more performance to be gained\n// when I change the semantic of what is returned.\n\nVoronoi.prototype.recycle = function(diagram) {\n if ( diagram ) {\n if ( diagram instanceof this.Diagram ) {\n this.toRecycle = diagram;\n }\n else {\n throw 'Voronoi.recycleDiagram() > Need a Diagram object.';\n }\n }\n };\n\n// ---------------------------------------------------------------------------\n// Top-level Fortune loop\n\n// rhill 2011-05-19:\n// Voronoi sites are kept client-side now, to allow\n// user to freely modify content. At compute time,\n// *references* to sites are copied locally.\n\nVoronoi.prototype.compute = function(sites, bbox) {\n // to measure execution time\n var startTime = new Date();\n\n // init internal state\n this.reset();\n\n // any diagram data available for recycling?\n // I do that here so that this is included in execution time\n if ( this.toRecycle ) {\n this.vertexJunkyard = this.vertexJunkyard.concat(this.toRecycle.vertices);\n this.edgeJunkyard = this.edgeJunkyard.concat(this.toRecycle.edges);\n this.cellJunkyard = this.cellJunkyard.concat(this.toRecycle.cells);\n this.toRecycle = null;\n }\n\n // Initialize site event queue\n var siteEvents = sites.slice(0);\n siteEvents.sort(function(a,b){\n var r = b.y - a.y;\n if (r) {return r;}\n return b.x - a.x;\n });\n\n // process queue\n var site = siteEvents.pop(),\n siteid = 0,\n xsitex, // to avoid duplicate sites\n xsitey,\n cells = this.cells,\n circle;\n\n // main loop\n for (;;) {\n // we need to figure whether we handle a site or circle event\n // for this we find out if there is a site event and it is\n // 'earlier' than the circle event\n circle = this.firstCircleEvent;\n\n // add beach section\n if (site && (!circle || site.y < circle.y || (site.y === circle.y && site.x < circle.x))) {\n // only if site is not a duplicate\n if (site.x !== xsitex || site.y !== xsitey) {\n // first create cell for new site\n cells[siteid] = this.createCell(site);\n site.voronoiId = siteid++;\n // then create a beachsection for that site\n this.addBeachsection(site);\n // remember last site coords to detect duplicate\n xsitey = site.y;\n xsitex = site.x;\n }\n site = siteEvents.pop();\n }\n\n // remove beach section\n else if (circle) {\n this.removeBeachsection(circle.arc);\n }\n\n // all done, quit\n else {\n break;\n }\n }\n\n // wrapping-up:\n // connect dangling edges to bounding box\n // cut edges as per bounding box\n // discard edges completely outside bounding box\n // discard edges which are point-like\n this.clipEdges(bbox);\n\n // add missing edges in order to close opened cells\n this.closeCells(bbox);\n\n // to measure execution time\n var stopTime = new Date();\n\n // prepare return values\n var diagram = new this.Diagram();\n diagram.cells = this.cells;\n diagram.edges = this.edges;\n diagram.vertices = this.vertices;\n diagram.execTime = stopTime.getTime()-startTime.getTime();\n\n // clean up\n this.reset();\n\n return diagram;\n };\n\nmodule.exports = Voronoi;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\nmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ })\n/******/ ]);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9jeXRvc2NhcGUtc3ByZWFkL2N5dG9zY2FwZS1zcHJlYWQuanM/Njg4MiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBLElBQUksSUFBeUQ7QUFDN0QsMkJBQTJCLG1CQUFPLENBQUMsd0RBQVU7QUFDN0MsTUFBTSxFQUs4QztBQUNwRCxDQUFDO0FBQ0Qsb0NBQW9DO0FBQ3BDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQT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CBmdW5jdGlvbiggcERhdGEgKSB7XG5cbiAgICAgIGZ1bmN0aW9uIGNlbGxDZW50cm9pZCggY2VsbCApIHtcbiAgICAgICAgdmFyIGhlcyA9IGNlbGwuaGFsZmVkZ2VzO1xuICAgICAgICB2YXIgYXJlYSA9IDAsXG4gICAgICAgICAgeCA9IDAsXG4gICAgICAgICAgeSA9IDA7XG4gICAgICAgIHZhciBwMSwgcDIsIGY7XG5cbiAgICAgICAgZm9yKCB2YXIgaSA9IDA7IGkgPCBoZXMubGVuZ3RoOyArK2kgKSB7XG4gICAgICAgICAgcDEgPSBoZXNbIGkgXS5nZXRFbmRwb2ludCgpO1xuICAgICAgICAgIHAyID0gaGVzWyBpIF0uZ2V0U3RhcnRwb2ludCgpO1xuXG4gICAgICAgICAgYXJlYSArPSBwMS54ICogcDIueTtcbiAgICAgICAgICBhcmVhIC09IHAxLnkgKiBwMi54O1xuXG4gICAgICAgICAgZiA9IHAxLnggKiBwMi55IC0gcDIueCAqIHAxLnk7XG4gICAgICAgICAgeCArPSAoIHAxLnggKyBwMi54ICkgKiBmO1xuICAgICAgICAgIHkgKz0gKCBwMS55ICsgcDIueSApICogZjtcbiAgICAgICAgfVxuXG4gICAgICAgIGFyZWEgLz0gMjtcbiAgICAgICAgZiA9IGFyZWEgKiA2O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHg6IHggLyBmLFxuICAgICAgICAgIHk6IHkgLyBmXG4gICAgICAgIH07XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIHNpdGVzRGlzdGFuY2UoIGxzLCBycyApIHtcbiAgICAgICAgdmFyIGR4ID0gbHMueCAtIHJzLng7XG4gICAgICAgIHZhciBkeSA9IGxzLnkgLSBycy55O1xuICAgICAgICByZXR1cm4gTWF0aC5zcXJ0KCBkeCAqIGR4ICsgZHkgKiBkeSApO1xuICAgICAgfVxuXG4gICAgICBWb3Jvbm9pID0gX3JlZl8oJ1Zvcm9ub2knKTtcblxuICAgICAgLy8gS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q7XG4gICAgICAgICAgICAgIGJib3ggPSB7XG4gICAgICAgICAgICAgICAgeGw6IDAsXG4gICAgICAgICAgICAgICAgeHI6IGxXaWR0aCxcbiAgICAgICAgICAgICAgICB5dDogMCxcbiAgICAgICAgICAgICAgICB5YjogbEhlaWdodFxuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICArK2V4cGFuZEl0ZXJhdGlvbjtcbiAgICAgICAgICAgICAgdm9yb25vaUl0ZXJhdGlvbiA9IDA7XG4gICAgICAgICAgICAgIC8vY29uc29sZS5pbmZvKFwiRXhwYW5kZWQgdG8gKFwiK3dpZHRoK1wiLFwiK2hlaWdodCtcIilcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHByZXZJbmZyYWN0aW9ucyA9IGN1cnJJbmZyYWN0aW9ucztcblxuICAgICAgICBzYXZlUG9zaXRpb25zKCk7XG4gICAgICAgIG1lc3NhZ2VQb3NpdGlvbnMoKTtcbiAgICAgIH1cblxuICAgICAgc2F2ZVBvc2l0aW9ucygpO1xuICAgICAgcmV0dXJuIHBEYXRhO1xuXG4gICAgfSApLnRoZW4oIGZ1bmN0aW9uKCBwRGF0YSApIHtcbiAgICAgIC8vIHZhciBleHBhbmRJdGVyYXRpb24gPSBwRGF0YVsgJ2V4cEl0JyBdO1xuICAgICAgdmFyIGRhdGFWZXJ0aWNlcyA9IHBEYXRhWyAndmVydGljZXMnIF07XG5cbiAgICAgIHNldFBvc2l0aW9ucyggcERhdGEgKTtcblxuICAgICAgLy8gR2V0IGVuZCB0aW1lXG4gICAgICB2YXIgc3RhcnRUaW1lID0gcERhdGFbICdzdGFydFRpbWUnIF07XG4gICAgICB2YXIgZW5kVGltZSA9IG5ldyBEYXRlKCk7XG4gICAgICBjb25zb2xlLmluZm8oIFwiTGF5b3V0IG9uIFwiICsgZGF0YVZlcnRpY2VzLmxlbmd0aCArIFwiIG5vZGVzIHRvb2sgXCIgKyAoIGVuZFRpbWUg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ID0gbm9kZS5yYlBhcmVudDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHBhcmVudC5yYlJlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIGdyYW5kcGEucmJSZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRoaXMucmJSb3RhdGVSaWdodChncmFuZHBhKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgdW5jbGUgPSBncmFuZHBhLnJiTGVmdDtcbiAgICAgICAgICAgIGlmICh1bmNsZSAmJiB1bmNsZS5yYlJlZCkge1xuICAgICAgICAgICAgICAgIHBhcmVudC5yYlJlZCA9IHVuY2xlLnJiUmVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgZ3JhbmRwYS5yYlJlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgbm9kZSA9IGdyYW5kcGE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKG5vZGUgPT09IHBhcmVudC5yYkxlZnQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yYlJvdGF0ZVJpZ2h0KHBhcmVudCk7XG4gICAgICAgICAgICAgICAgICAgIG5vZGUgPSBwYXJlbnQ7XG4gICAgICAgICAgICAgICAgICAgIHBhcmVudCA9IG5vZGUucmJQYXJlbnQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwYXJlbnQucmJSZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBncmFuZHBhLnJiUmVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0aGlzLnJiUm90YXRlTGVmdChncmFuZHBhKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIHBhcmVudCA9IG5vZGUucmJQYXJlbnQ7XG4gICAgICAgIH1cbiAgICB0aGlzLnJvb3Quc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gICAgfVxuICAgICAgICB9XG4gICAgZWxzZSB7XG4gICAgICAgIHRoaXMucm9vdCA9IG5leHQ7XG4gICAgICAgIH1cbiAgICAvLyBlbmZvcmNlIHJlZC1ibGFjayBydWxlc1xuICAgIHZhciBpc1JlZDtcbiAgICBpZiAobGVmdCAmJiByaWdodCkge1xuICAgICAgICBpc1JlZCA9IG5leHQucmJSZWQ7XG4gICAgICAgIG5leHQucmJSZWQgPSBub2RlLnJiUmVkO1xuICAgICAgICBuZXh0LnJiTGVmdCA9IGxlZnQ7XG4gICAgICAgIGxlZnQucmJQYXJlbnQgPSBuZXh0O1xuICAgICAgICBpZiAobmV4dCAhPT0gcmlnaHQpIHtcbiAgICAgICAgICAgIHBhcmVudCA9IG5leHQucmJQYXJlbnQ7XG4gICAgICAgICAgICBuZXh0LnJiUGFyZW50ID0gbm9kZS5yYlBhcmVudDtcbiAgICAgICAgICAgIG5vZGUgPSBuZXh0LnJiUmlnaHQ7XG4gICAgICAgICAgICBwYXJlbnQucmJMZWZ0ID0gbm9kZTtcbiAgICAgICAgICAgIG5leHQucmJSaWdodCA9IHJpZ2h0O1xuICAgICAgICAgICAgcmlnaHQucmJQYXJlbnQgPSBuZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIG5leHQucmJQYXJlbnQgPSBwYXJlbnQ7XG4gICAgICAgICAgICBwYXJlbnQgPSBuZXh0O1xuICAgICAgICAgICAgbm9kZSA9IG5leHQucmJSaWdodDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIGVsc2Uge1xuICAgICAgICBpc1JlZCA9IG5vZGUucmJSZWQ7XG4gICAgICAgIG5vZGUgPSBuZXh0O1xuICAgICAgICB9XG4gICAgLy8gJ25vZGUnIGlzIG5vdyB0aGUgc29sZSBzdWNjZXNzb3IncyBjaGlsZCBhbmQgJ3BhcmVudCcgaXRzXG4gICAgLy8gbmV3IHBhcmVudCAoc2luY2UgdGhlIHN1Y2Nlc3NvciBjYW4gaGF2ZSBiZWVuIG1vdmVkKVxuICAgIGlmIChub2RlKSB7XG4gICAgICAgIG5vZGUucmJQYXJlbnQgPSBwYXJlbnQ7XG4gICAgICAgIH1cbiAgICAvLyB0aGUgJ2Vhc3knIGNhc2VzXG4gICAgaWYgKGlzUmVkKSB7cmV0dXJuO31cbiAgICBpZiAobm9kZSAmJiBub2RlLnJiUmVkKSB7XG4gICAgICAgIG5vZGUucmJSZWQgPSBmYWxzZTtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgLy8gdGhlIG90aGVyIGNhc2VzXG4gICAgdmFyIHNpYmxpbmc7XG4gICAgZG8ge1xuICAgICAgICBpZiAobm9kZSA9PT0gdGhpcy5yb290KSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgaWYgKG5vZGUgPT09IHBhcmVudC5yYkxlZnQpIHtcbiAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQucmJSaWdodDtcbiAgICAgICAgICAgIGlmIChzaWJsaW5nLnJiUmVkKSB7XG4gICAgICAgICAgICAgICAgc2libGluZy5yYlJlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHBhcmVudC5yYlJlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy5yYlJvdGF0ZUxlZnQocGFyZW50KTtcbiAgICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LnJiUmlnaHQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKChzaWJsaW5nLnJiTGVmdCAmJiBzaWJsaW5nLnJiTGVmdC5yYlJlZCkgfHwgKHNpYmxpbmcucmJSaWdodCAmJiBzaWJsaW5nLnJiUmlnaHQucmJSZWQpKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFzaWJsaW5nLnJiUmlnaHQgfHwgIXNpYmxpbmcucmJSaWdodC5yYlJlZCkge1xuICAgICAgICAgICAgICAgICAgICBzaWJsaW5nLnJiTGVmdC5yYlJlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBzaWJsaW5nLnJiUmVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yYlJvdGF0ZVJpZ2h0KHNpYmxpbmcpO1xuICAgICAgICAgICAgICAgICAgICBzaWJsaW5nID0gcGFyZW50LnJiUmlnaHQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBzaWJsaW5nLnJiUmVkID0gcGFyZW50LnJiUmVkO1xuICAgICAgICAgICAgICAgIHBhcmVudC5yYlJlZCA9IHNpYmxpbmcucmJSaWdodC5yYlJlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHRoaXMucmJSb3RhdGVMZWZ0KHBhcmVudCk7XG4gICAgICAgICAgICAgICAgbm9kZSA9IHRoaXMucm9vdDtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgc2libGluZyA9IHBhcmVudC5yYkxlZnQ7XG4gICAgICAgICAgICBpZiAoc2libGluZy5yYlJlZCkge1xuICAgICAgICAgICAgICAgIHNpYmxpbmcucmJSZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICBwYXJlbnQucmJSZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHRoaXMucmJSb3RhdGVSaWdodChwYXJlbnQpO1xuICAgICAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQucmJMZWZ0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgoc2libGluZy5yYkxlZnQgJiYgc2libGluZy5yYkxlZnQucmJSZWQpIHx8IChzaWJsaW5nLnJiUmlnaHQgJiYgc2libGluZy5yYlJpZ2h0LnJiUmVkKSkge1xuICAgICAgICAgICAgICAgIGlmICghc2libGluZy5yYkxlZnQgfHwgIXNpYmxpbmcucmJMZWZ0LnJiUmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHNpYmxpbmcucmJSaWdodC5yYlJlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBzaWJsaW5nLnJiUmVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yYlJvdGF0ZUxlZnQoc2libGluZyk7XG4gICAgICAgICAgICAgICAgICAgIHNpYmxpbmcgPSBwYXJlbnQucmJMZWZ0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgc2libGluZy5yYlJlZCA9IHBhcmVudC5yYlJlZDtcbiAgICAgICAgICAgICAgICBwYXJlbnQucmJSZWQgPSBzaWJsaW5nLnJiTGVmdC5yYlJlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHRoaXMucmJSb3RhdGVSaWdodChwYXJlbnQpO1xuICAgICAgICAgICAgICAgIG5vZGUgPSB0aGlzLnJvb3Q7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICBzaWJsaW5nLnJiUmVkID0gdHJ1ZTtcbiAgICAgICAgbm9kZSA9IHBhcmVudDtcbiAgICAgICAgcGFyZW50ID0gcGFyZW50LnJiUGFyZW50O1xuICAgIH0gd2hpbGUgKCFub2RlLnJiUmVkKTtcbiAgICBpZiAobm9kZSkge25vZGUucmJSZWQgPSBmYWxzZTt9XG4gICAgfTtcblxuVm9yb25vaS5wcm90b3R5cGUuUkJUcmVlLnByb3RvdHlwZS5yYlJvdGF0ZUxlZnQgPSBmdW5jdGlvbihub2RlKSB7XG4gICAgdmFyIHAgPSBub2RlLFxuICAgICAgICBxID0gbm9kZS5yYlJpZ2h0LCAvLyBjYW4ndCBiZSBudWxsXG4gICAgICAgIHBhcmVudCA9IHAucmJQYXJlbnQ7XG4gICAgaWYgKHBhcmVudCkge1xuICAgICAgICBpZiAocGFyZW50LnJiTGVmdCA9PT0gcCkge1xuICAgICAgICAgICAgcGF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W5vZGUucmJSaWdodCkge1xuICAgICAgICAgICAgICAgICAgICBsQXJjID0gbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBub2RlID0gbm9kZS5yYlJpZ2h0O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIHggZXF1YWxXaXRoRXBzaWxvbiB4bCA9PiBmYWxscyBleGFjdGx5IG9uIHRoZSBsZWZ0IGVkZ2Ugb2YgdGhlIGJlYWNoc2VjdGlvblxuICAgICAgICAgICAgICAgIGlmIChkeGwgPiAtMWUtOSkge1xuICAgICAgICAgICAgICAgICAgICBsQXJjID0gbm9kZS5yYlByZXZpb3VzO1xuICAgICAgICAgICAgICAgICAgICByQXJjID0gbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIHggZXF1YWxXaXRoRXBzaWxvbiB4ciA9PiBmYWxscyBleGFjdGx5IG9uIHRoZSByaWdodCBlZGdlIG9mIHRoZSBiZWFjaHNlY3Rpb25cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChkeHIgPiAtMWUtOSkge1xuICAgICAgICAgICAgICAgICAgICBsQXJjID0gbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgckFyYyA9IG5vZGUucmJOZXh0O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgLy8gZmFsbHMgZXhhY3RseSBzb21ld2hlcmUgaW4gdGhlIG1pZGRsZSBvZiB0aGUgYmVhY2hzZWN0aW9uXG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGxBcmMgPSByQXJjID0gbm9kZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxu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ICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHByZWRlY2Vzc29yID0gbm9kZS5yYlByZXZpb3VzO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBpZiAobm9kZS5yYlJpZ2h0KSB7XG4gICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUucmJSaWdodDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBwcmVkZWNlc3NvciA9IG5vZGU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgdGhpcy5jaXJjbGVFdmVudHMucmJJbnNlcnRTdWNjZXNzb3IocHJlZGVjZXNzb3IsIGNpcmNsZUV2ZW50KTtcbiAgICBpZiAoIXByZWRlY2Vzc29yKSB7XG4gICAgICAgIHRoaXMuZmlyc3RDaXJjbGVFdmVudCA9IGNpcmNsZUV2ZW50O1xuICAgICAgICB9XG4gICAgfTtcblxuVm9yb25vaS5wcm90b3R5cGUuZGV0YWNoQ2lyY2xlRXZlbnQgPSBmdW5jdGlvbihhcmMpIHtcbiAgICB2YXIgY2lyY2xlRXZlbnQgPSBhcmMuY2lyY2xlRXZlbnQ7XG4gICAgaWYgKGNpcmNsZUV2ZW50KSB7XG4gICAgICAgIGlmICghY2lyY2xlRXZlbnQucmJQcmV2aW91cykge1xuICAgICAgICAgICAgdGhpcy5maXJzdENpcmNsZUV2ZW50ID0gY2lyY2xlRXZlbnQucmJOZXh0O1xuICAgICAgICAgICAgfVxuICAgICAgICB0aGlzLmNpcmNsZUV2ZW50cy5yYlJlbW92ZU5vZGUoY2lyY2xlRXZlbnQpOyAvLyByZW1vdmUgZnJvbSBSQi10cmVlXG4gICAgICAgIHRoaXMuY2lyY2xlRXZlbnRKdW5re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wgfHwgZnggPj0geHIpIHtyZXR1cm4gZmFsc2U7fVxuICAgICAgICAvLyBkb3dud2FyZFxuICAgICAgICBpZiAobHggPiByeCkge1xuICAgICAgICAgICAgaWYgKCF2YSB8fCB2YS55IDwgeXQpIHtcbiAgICAgICAgICAgICAgICB2YSA9IHRoaXMuY3JlYXRlVmVydGV4KGZ4LCB5dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodmEueSA+PSB5Yikge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB2YiA9IHRoaXMuY3JlYXRlVmVydGV4KGZ4LCB5Yik7XG4gICAgICAgICAgICB9XG4gICAgICAgIC8vIHVwd2FyZFxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmICghdmEgfHwgdmEueSA+IHliKSB7XG4gICAgICAgICAgICAgICAgdmEgPSB0aGlzLmNyZWF0ZVZlcnRleChmeCwgeWIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHZhLnkgPCB5dCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB2YiA9IHRoaXMuY3JlYXRlVmVydGV4KGZ4LCB5dCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAvLyBjbG9zZXIgdG8gdmVydGljYWwgdGhhbiBob3Jpem9udGFsLCBjb25uZWN0IHN0YXJ0IHBvaW50IHRvIHRoZVxuICAgIC8vIHRvcCBvciBib3R0b20gc2lkZSBvZiB0aGUgYm91bmRpbmcgYm94XG4gICAgZWxzZSBpZiAoZm0gPCAtMSB8fCBmbSA+IDEpIHtcbiAgICAgICAgLy8gZG93bndhcmRcbiAgICAgICAgaWYgKGx4ID4gcngpIHtcbiAgICAgICAgICAgIGlmICghdmEgfHwgdmEueSA8IHl0KSB7XG4gICAgICAgICAgICAgICAgdmEgPSB0aGlzLmNyZWF0ZVZlcnRleCgoeXQtZmIpL2ZtLCB5dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodmEueSA+PSB5Yikge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB2YiA9IHRoaXMuY3JlYXRlVmVydGV4KCh5Yi1mYikvZm0sIHliKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgLy8gdXB3YXJkXG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKCF2YSB8fCB2YS55ID4geWIpIHtcbiAgICAgICAgICAgICAgICB2YSA9IHRoaXMuY3JlYXRlVmVydGV4KCh5Yi1mYikvZm0sIHliKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh2YS55IDwgeXQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmIgPSB0aGlzLmNyZWF0ZVZlcnRleCgoeXQtZmIpL2ZtLCB5dCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAvLyBjbG9zZXIgdG8gaG9yaXpvbnRhbCB0aGFuIHZlcnRpY2FsLCBjb25uZWN0IHN0YXJ0IHBvaW50IHRvIHRoZVxuICAgIC8vIGxlZnQgb3IgcmlnaHQgc2lkZSBvZiB0aGUgYm91bmRpbmcgYm94XG4gICAgZWxzZSB7XG4gICAgICAgIC8vIHJpZ2h0d2FyZFxuICAgICAgICBpZiAobHkgPCByeSkge1xuICAgICAgICAgICAgaWYgKCF2YSB8fCB2YS54IDwgeGwpIHtcbiAgICAgICAgICAgICAgICB2YSA9IHRoaXMuY3JlYXRlVmVydGV4KHhsLCBmbSp4bCtmYik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodmEueCA+PSB4cikge1xuICAg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55LFxuICAgICAgICB0MCA9IDAsXG4gICAgICAgIHQxID0gMSxcbiAgICAgICAgZHggPSBieC1heCxcbiAgICAgICAgZHkgPSBieS1heTtcbiAgICAvLyBsZWZ0XG4gICAgdmFyIHEgPSBheC1iYm94LnhsO1xuICAgIGlmIChkeD09PTAgJiYgcTwwKSB7cmV0dXJuIGZhbHNlO31cbiAgICB2YXIgciA9IC1xL2R4O1xuICAgIGlmIChkeDwwKSB7XG4gICAgICAgIGlmIChyPHQwKSB7cmV0dXJuIGZhbHNlO31cbiAgICAgICAgaWYgKHI8dDEpIHt0MT1yO31cbiAgICAgICAgfVxuICAgIGVsc2UgaWYgKGR4PjApIHtcbiAgICAgICAgaWYgKHI+dDEpIHtyZXR1cm4gZmFsc2U7fVxuICAgICAgICBpZiAocj50MCkge3QwPXI7fVxuICAgICAgICB9XG4gICAgLy8gcmlnaHRcbiAgICBxID0gYmJveC54ci1heDtcbiAgICBpZiAoZHg9PT0wICYmIHE8MCkge3JldHVybiBmYWxzZTt9XG4gICAgciA9IHEvZHg7XG4gICAgaWYgKGR4PDApIHtcbiAgICAgICAgaWYgKHI+dDEpIHtyZXR1cm4gZmFsc2U7fVxuICAgICAgICBpZiAocj50MCkge3QwPXI7fVxuICAgICAgICB9XG4gICAgZWxzZSBpZiAoZHg+MCkge1xuICAgICAgICBpZiAocjx0MCkge3JldHVybiBmYWxzZTt9XG4gICAgICAgIGlmIChyPHQxKSB7dDE9cjt9XG4gICAgICAgIH1cbiAgICAvLyB0b3BcbiAgICBxID0gYXktYmJveC55dDtcbiAgICBpZiAoZHk9PT0wICYmIHE8MCkge3JldHVybiBmYWxzZTt9XG4gICAgciA9IC1xL2R5O1xuICAgIGlmIChkeTwwKSB7XG4gICAgICAgIGlmIChyPHQwKSB7cmV0dXJuIGZhbHNlO31cbiAgICAgICAgaWYgKHI8dDEpIHt0MT1yO31cbiAgICAgICAgfVxuICAgIGVsc2UgaWYgKGR5PjApIHtcbiAgICAgICAgaWYgKHI+dDE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oRXBzaWxvbih2YS55LHliKTpcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RCb3JkZXJTZWdtZW50ID0gdGhpcy5lcXVhbFdpdGhFcHNpbG9uKHZ6LngseGwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmIgPSB0aGlzLmNyZWF0ZVZlcnRleCh4bCwgbGFzdEJvcmRlclNlZ21lbnQgPyB2ei55IDogeWIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWRnZSA9IHRoaXMuY3JlYXRlQm9yZGVyRWRnZShjZWxsLnNpdGUsIHZhLCB2Yik7XG4gICAgICAgICAgICAgICAgICAgICAgICBpTGVmdCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgaGFsZmVkZ2VzLnNwbGljZShpTGVmdCwgMCwgdGhpcy5jcmVhdGVIYWxmZWRnZShlZGdlLCBjZWxsLnNpdGUsIG51bGwpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5IYWxmZWRnZXMrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggbGFzdEJvcmRlclNlZ21lbnQgKSB7IGJyZWFrOyB9XG4gICAgICAgICAgICAgICAgICAgICAgICB2YSA9IHZiO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoXG5cbiAgICAgICAgICAgICAgICAgICAgLy8gd2FsayByaWdodHdhcmQgYWxvbmcgYm90dG9tIHNpZGVcbiAgICAgICAgICAgICAgICAgICAgY2FzZSB0aGlzLmVxdWFsV2l0aEVwc2lsb24odmEueSx5YikgJiYgdGhpcy5sZXNzVGhhbldpdGhFcHNpbG9uKHZhLngseHIpOlxuICAgICAgICAgICAgICAgICAgICAgICAgbGFzdEJvcmRlclNlZ21lbnQgPSB0aGlzLmVxdWFsV2l0aEVwc2lsb24odnoueSx5Yik7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YiA9IHRoaXMuY3JlYXRlVmVydGV4KGxhc3RCb3JkZXJTZWdtZW50ID8gdnoueCA6IHhyLCB5Yik7XG4gICAgICAgICAgICAgICAgICAgICAgICBlZGdlID0gdGhpcy5jcmVhdGVCb3JkZXJFZGdlKGNlbGwuc2l0ZSwgdmEsIHZiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlMZWZ0Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICBoYWxmZWRnZXMuc3BsaWNlKGlMZWZ0LCAwLCB0aGlzLmNyZWF0ZUhhbGZlZGdlKGVkZ2UsIGNlbGwuc2l0ZSwgbnVsbCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbkhhbGZlZGdlcysrO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBsYXN0Qm9yZGVyU2VnbWVudCApIHsgYnJlYWs7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHZhID0gdmI7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2hcblxuICAgICAgICAgICAgICAgICAgICAvLyB3YWxrIHVwd2FyZCBhbG9uZyByaWdodCBzaWRlXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgdGhpcy5lcXVhbFdpdGhFcHNpbG9uKHZhLngseHIpICYmIHRoaXMuZ3JlYXRlclRoYW5XaXRoRXBzaWxvbih2YS55LHl0KTpcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RCb3JkZXJTZWdtZW50ID0gdGhpcy5lcXVhbFdpdGhFcHNpbG9uKHZ6LngseHIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmIgPSB0aGlzLmNyZWF0ZVZlcnRleCh4ciwgbGFzdEJvcmRlclNlZ21lbnQgPyB2ei55IDogeXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWRnZSA9IHRoaXMuY3JlYXRlQm9yZGVyRWRnZShjZWxsLnNpdGUsIHZhLCB2Yik7XG4gICAgICAgICAgICAgICAgICAgICAgICBpTGVmdCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgaGFsZmVkZ2VzLnNwbGljZShpTGVmdCwgMCwgdGhpcy5jcmVhdGVIYWxmZWRnZShlZGdlLCBjZWxsLnNpdGUsIG51bGwpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5IYWxmZWRnZXMrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggbGFzdEJvcmRlclNlZ21lbnQgKSB7IGJyZWFrOyB9XG4gICAgICAgICAgICAgICAgICAgICAgICB2YSA9IHZiO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoXG5cbiAgICAgICAgICAgICAgICAgICAgLy8gd2FsayBsZWZ0d2FyZCBhbG9uZyB0b3Agc2lkZVxuICAgICAgICAgICAgICAgICAgICBjYXNlIHRoaXMuZXF1YWxXaXRoRXBzaWxvbih2YS55LHl0KSAmJiB0aGlzLmdyZWF0ZXJUaGFuV2l0aEVwc2lsb24odmEueCx4bCk6XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXN0Qm9yZGVyU2VnbWVudCA9IHRoaXMuZXF1YWxXaXRoRXBzaWxvbih2ei55LHl0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZiID0gdGhpcy5jcmVhdGVWZXJ0ZXgobGFzdEJvcmRlclNlZ21lbnQgPyB2ei54IDogeGwsIHl0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVkZ2UgPSB0aGlzLmNyZWF0ZUJvcmRlckVkZ2UoY2VsbC5zaXRlLCB2YSwgdmIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaUxlZnQrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhbGZlZGdlcy5zcGxpY2UoaUxlZnQsIDAsIHRoaXMuY3JlYXRlSGFsZmVkZ2UoZWRnZSwgY2VsbC5zaXRlLCBudWxsKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBuSGFsZmVkZ2VzKys7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIGxhc3RCb3JkZXJTZWdtZW50ICkgeyBicmVhazsgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdmEgPSB2YjtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaFxuXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3YWxrIGRvd253YXJkIGFsb25nIGxlZnQgc2lkZVxuICAgICAgICAgICAgICAgICAgICAgICAgbGFzdEJvcmRlclNlZ21lbnQgPSB0aGlzLmVxdWFsV2l0aEVwc2lsb24odnoueCx4bCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YiA9IHRoaXMuY3JlYXRlVmVydGV4KHhsLCBsYXN0Qm9yZGVyU2VnbWVudCA/IHZ6LnkgOiB5Yik7XG4gICAgICAgICAgICAgICAgICAgICAgICBlZGdlID0gdGhpcy5jcmVhdGVCb3JkZXJFZGdlKGNlbGwuc2l0ZSwgdmEsIHZiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlMZWZ0Kys7XG4gICAgICAgICAgICAgICAgICAgICAgICBoYWxmZWRnZXMuc3BsaWNlKGlMZWZ0LCAwLCB0aGlzLmNyZWF0ZUhhbGZlZGdlKGVkZ2UsIGNlbGwuc2l0ZSwgbnVsbCkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbkhhbGZlZGdlcysrO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBsYXN0Qm9yZGVyU2VnbWVudCApIHsgYnJlYWs7IH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHZhID0gdmI7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2hcblxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2FsayByaWdodHdhcmQgYWxvbmcgYm90dG9tIHNpZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RCb3JkZXJTZWdtZW50ID0gdGhpcy5lcXVhbFdpdGhFcHNpbG9uKHZ6LnkseWIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmIgPSB0aGlzLmNyZWF0ZVZlcnRleChsYXN0Qm9yZGVyU2VnbWVudCA/IHZ6LnggOiB4ciwgeWIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWRnZSA9IHRoaXMuY3JlYXRlQm9yZGVyRWRnZShjZWxsLnNpdGUsIHZhLCB2Yik7XG4gICAgICAgICAgICAgICAgICAgICAgICBpTGVmdCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgaGFsZmVkZ2VzLnNwbGljZShpTGVmdCwgMCwgdGhpcy5jcmVhdGVIYWxmZWRnZShlZGdlLCBjZWxsLnNpdGUsIG51bGwpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5IYWxmZWRnZXMrKztcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggbGFzdEJvcmRlclNlZ21lbnQgKSB7IGJyZWFrOyB9XG4gICAgICAgICAgICAgICAgICAgICAgICB2YSA9IHZiO1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdhbGsgdXB3YXJkIGFsb25nIHJpZ2h0IHNpZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RCb3JkZXJTZWdtZW50ID0gdGhpcy5lcXVhbFdpdGhFcHNpbG9uKHZ6LngseHIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdmIgPSB0aGlzLmNyZWF0ZVZlcnRleCh4ciwgbGFzdEJvcmRlclNlZ21lbnQgPyB2ei55IDogeXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZWRnZSA9IHRoaXMuY3JlYXRlQm9yZGVyRWRnZShjZWxsLnNpdGUsIHZhLCB2Yik7XG4gICAgICAgICAgICAgICAgICAgICAgICBpTGVmdCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgaGFsZmVkZ2VzLnNwbGljZShpTGVmdCwgMCwgdGhpcy5jcmVhdGVIYWxmZWRnZShlZGdlLCBjZWxsLnNpdGUsIG51bGwpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG5IYWxm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qKi8gXSk7XG59KTsiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/cytoscape-spread/cytoscape-spread.js\n"); /***/ }), /***/ "./node_modules/cytoscape-svg/cytoscape-svg.js": /*!*****************************************************!*\ !*** ./node_modules/cytoscape-svg/cytoscape-svg.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse {}\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// identity function for calling harmony imports with the correct context\n/******/ \t__webpack_require__.i = function(value) { return value; };\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 1);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * Most of the code is taken from https://github.com/iVis-at-Bilkent/cytoscape.js\n * and adapted\n */\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar C2S = __webpack_require__(2);\n\nvar CRp = {};\nvar is = {};\n\nis.number = function (obj) {\n return obj != null && (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === _typeof(1) && !isNaN(obj);\n};\n\nCRp.bufferCanvasImage = function (options, cy) {\n\n //disable usePaths temporarily\n var usePaths = cy.renderer().usePaths;\n cy.renderer().usePaths = function () {\n return false;\n };\n // flush path cache\n cy.elements().forEach(function (ele) {\n ele._private.rscratch.pathCacheKey = null;\n ele._private.rscratch.pathCache = null;\n });\n\n var renderer = cy.renderer();\n var eles = cy.mutableElements();\n var bb = eles.boundingBox();\n var ctrRect = renderer.findContainerClientCoords();\n var width = options.full ? Math.ceil(bb.w) : ctrRect[2];\n var height = options.full ? Math.ceil(bb.h) : ctrRect[3];\n var specdMaxDims = is.number(options.maxWidth) || is.number(options.maxHeight);\n var pxRatio = renderer.getPixelRatio();\n var scale = 1;\n\n if (options.scale !== undefined) {\n width *= options.scale;\n height *= options.scale;\n\n scale = options.scale;\n } else if (specdMaxDims) {\n var maxScaleW = Infinity;\n var maxScaleH = Infinity;\n\n if (is.number(options.maxWidth)) {\n maxScaleW = scale * options.maxWidth / width;\n }\n\n if (is.number(options.maxHeight)) {\n maxScaleH = scale * options.maxHeight / height;\n }\n\n scale = Math.min(maxScaleW, maxScaleH);\n\n width *= scale;\n height *= scale;\n }\n\n if (!specdMaxDims) {\n width *= pxRatio;\n height *= pxRatio;\n scale *= pxRatio;\n }\n\n var buffCxt = null;\n var buffCanvas = buffCxt = new C2S(width, height);\n\n // Rasterize the layers, but only if container has nonzero size\n if (width > 0 && height > 0) {\n\n buffCxt.clearRect(0, 0, width, height);\n\n buffCxt.globalCompositeOperation = 'source-over';\n\n var zsortedEles = renderer.getCachedZSortedEles();\n\n if (options.full) {\n // draw the full bounds of the graph\n buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale);\n buffCxt.scale(scale, scale);\n\n renderer.drawElements(buffCxt, zsortedEles);\n\n buffCxt.scale(1 / scale, 1 / scale);\n buffCxt.translate(bb.x1 * scale, bb.y1 * scale);\n } else {\n // draw the current view\n var pan = cy.pan();\n\n var translation = {\n x: pan.x * scale,\n y: pan.y * scale\n };\n\n scale *= cy.zoom();\n\n buffCxt.translate(translation.x, translation.y);\n buffCxt.scale(scale, scale);\n\n renderer.drawElements(buffCxt, zsortedEles);\n\n buffCxt.scale(1 / scale, 1 / scale);\n buffCxt.translate(-translation.x, -translation.y);\n }\n\n // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs\n if (options.bg) {\n buffCxt.globalCompositeOperation = 'destination-over';\n\n buffCxt.fillStyle = options.bg;\n buffCxt.rect(0, 0, width, height);\n buffCxt.fill();\n }\n }\n\n // restore usePaths to default value\n cy.renderer().usePaths = usePaths;\n return buffCanvas;\n};\n\nfunction output(canvas) {\n return canvas.getSerializedSvg();\n}\n\nCRp.svg = function (options) {\n return output(CRp.bufferCanvasImage(options || {}, this));\n};\n\nmodule.exports = CRp;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar impl = __webpack_require__(0);\n\n// registers the extension on a cytoscape lib ref\nvar register = function register(cytoscape) {\n if (!cytoscape) {\n return;\n } // can't register if cytoscape unspecified\n\n cytoscape('core', 'svg', impl.svg); // register with cytoscape.js\n};\n\nif (typeof cytoscape !== 'undefined') {\n // expose to global cytoscape (i.e. window.cytoscape)\n register(cytoscape);\n}\n\nmodule.exports = register;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/*!!\n * Canvas 2 Svg v1.0.19\n * A low level canvas to SVG converter. Uses a mock canvas context to build an SVG document.\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n * Author:\n * Kerry Liu\n *\n * Copyright (c) 2014 Gliffy Inc.\n */\n\n;(function () {\n \"use strict\";\n\n var STYLES, ctx, CanvasGradient, CanvasPattern, namedEntities;\n\n //helper function to format a string\n function format(str, args) {\n var keys = Object.keys(args), i;\n for (i=0; i 1) {\n options = defaultOptions;\n options.width = arguments[0];\n options.height = arguments[1];\n } else if ( !o ) {\n options = defaultOptions;\n } else {\n options = o;\n }\n\n if (!(this instanceof ctx)) {\n //did someone call this without new?\n return new ctx(options);\n }\n\n //setup options\n this.width = options.width || defaultOptions.width;\n this.height = options.height || defaultOptions.height;\n this.enableMirroring = options.enableMirroring !== undefined ? options.enableMirroring : defaultOptions.enableMirroring;\n\n this.canvas = this; ///point back to this instance!\n this.__document = options.document || document;\n\n // allow passing in an existing context to wrap around\n // if a context is passed in, we know a canvas already exist\n if (options.ctx) {\n this.__ctx = options.ctx;\n } else {\n this.__canvas = this.__document.createElement(\"canvas\");\n this.__ctx = this.__canvas.getContext(\"2d\");\n }\n\n this.__setDefaultStyles();\n this.__stack = [this.__getStyleState()];\n this.__groupStack = [];\n\n //the root svg element\n this.__root = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n this.__root.setAttribute(\"version\", 1.1);\n this.__root.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n this.__root.setAttributeNS(\"http://www.w3.org/2000/xmlns/\", \"xmlns:xlink\", \"http://www.w3.org/1999/xlink\");\n this.__root.setAttribute(\"width\", this.width);\n this.__root.setAttribute(\"height\", this.height);\n\n //make sure we don't generate the same ids in defs\n this.__ids = {};\n\n //defs tag\n this.__defs = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"defs\");\n this.__root.appendChild(this.__defs);\n\n //also add a group child. the svg element can't use the transform attribute\n this.__currentElement = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n this.__root.appendChild(this.__currentElement);\n };\n\n\n /**\n * Creates the specified svg element\n * @private\n */\n ctx.prototype.__createElement = function (elementName, properties, resetFill) {\n if (typeof properties === \"undefined\") {\n properties = {};\n }\n\n var element = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", elementName),\n keys = Object.keys(properties), i, key;\n if (resetFill) {\n //if fill or stroke is not specified, the svg element should not display. By default SVG's fill is black.\n element.setAttribute(\"fill\", \"none\");\n element.setAttribute(\"stroke\", \"none\");\n }\n for (i=0; i 0) {\n \tif (this.__currentElement.nodeName === \"path\") {\n \t\tif (!this.__currentElementsToStyle) this.__currentElementsToStyle = {element: parent, children: []};\n \t\tthis.__currentElementsToStyle.children.push(this.__currentElement)\n \t\tthis.__applyCurrentDefaultPath();\n \t}\n\n var group = this.__createElement(\"g\");\n parent.appendChild(group);\n this.__currentElement = group;\n }\n\n var transform = this.__currentElement.getAttribute(\"transform\");\n if (transform) {\n transform += \" \";\n } else {\n transform = \"\";\n }\n transform += t;\n this.__currentElement.setAttribute(\"transform\", transform);\n };\n\n /**\n * scales the current element\n */\n ctx.prototype.scale = function (x, y) {\n if (y === undefined) {\n y = x;\n }\n this.__addTransform(format(\"scale({x},{y})\", {x:x, y:y}));\n };\n\n /**\n * rotates the current element\n */\n ctx.prototype.rotate = function (angle) {\n var degrees = (angle * 180 / Math.PI);\n this.__addTransform(format(\"rotate({angle},{cx},{cy})\", {angle:degrees, cx:0, cy:0}));\n };\n\n /**\n * translates the current element\n */\n ctx.prototype.translate = function (x, y) {\n this.__addTransform(format(\"translate({x},{y})\", {x:x,y:y}));\n };\n\n /**\n * applies a transform to the current element\n */\n ctx.prototype.transform = function (a, b, c, d, e, f) {\n this.__addTransform(format(\"matrix({a},{b},{c},{d},{e},{f})\", {a:a, b:b, c:c, d:d, e:e, f:f}));\n };\n\n /**\n * Create a new Path Element\n */\n ctx.prototype.beginPath = function () {\n var path, parent;\n\n // Note that there is only one current default path, it is not part of the drawing state.\n // See also: https://html.spec.whatwg.org/multipage/scripting.html#current-default-path\n this.__currentDefaultPath = \"\";\n this.__currentPosition = {};\n\n path = this.__createElement(\"path\", {}, true);\n parent = this.__closestGroupOrSvg();\n parent.appendChild(path);\n this.__currentElement = path;\n };\n\n /**\n * Helper function to apply currentDefaultPath to current path element\n * @private\n */\n ctx.prototype.__applyCurrentDefaultPath = function () {\n \tvar currentElement = this.__currentElement;\n if (currentElement.nodeName === \"path\") {\n\t\t\tcurrentElement.setAttribute(\"d\", this.__currentDefaultPath);\n } else {\n\t\t\tconsole.error(\"Attempted to apply path command to node\", currentElement.nodeName);\n }\n };\n\n /**\n * Helper function to add path command\n * @private\n */\n ctx.prototype.__addPathCommand = function (command) {\n this.__currentDefaultPath += \" \";\n this.__currentDefaultPath += command;\n };\n\n /**\n * Adds the move command to the current path element,\n * if the currentPathElement is not empty create a new path element\n */\n ctx.prototype.moveTo = function (x,y) {\n if (this.__currentElement.nodeName !== \"path\") {\n this.beginPath();\n }\n\n // creates a new subpath with the given point\n this.__currentPosition = {x: x, y: y};\n this.__addPathCommand(format(\"M {x} {y}\", {x:x, y:y}));\n };\n\n /**\n * Closes the current path\n */\n ctx.prototype.closePath = function () {\n if (this.__currentDefaultPath) {\n this.__addPathCommand(\"Z\");\n }\n };\n\n /**\n * Adds a line to command\n */\n ctx.prototype.lineTo = function (x, y) {\n this.__currentPosition = {x: x, y: y};\n if (this.__currentDefaultPath.indexOf('M') > -1) {\n this.__addPathCommand(format(\"L {x} {y}\", {x:x, y:y}));\n } else {\n this.__addPathCommand(format(\"M {x} {y}\", {x:x, y:y}));\n }\n };\n\n /**\n * Add a bezier command\n */\n ctx.prototype.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n this.__currentPosition = {x: x, y: y};\n this.__addPathCommand(format(\"C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}\",\n {cp1x:cp1x, cp1y:cp1y, cp2x:cp2x, cp2y:cp2y, x:x, y:y}));\n };\n\n /**\n * Adds a quadratic curve to command\n */\n ctx.prototype.quadraticCurveTo = function (cpx, cpy, x, y) {\n this.__currentPosition = {x: x, y: y};\n this.__addPathCommand(format(\"Q {cpx} {cpy} {x} {y}\", {cpx:cpx, cpy:cpy, x:x, y:y}));\n };\n\n\n /**\n * Return a new normalized vector of given vector\n */\n var normalize = function (vector) {\n var len = Math.sqrt(vector[0] * vector[0] + vector[1] * vector[1]);\n return [vector[0] / len, vector[1] / len];\n };\n\n /**\n * Adds the arcTo to the current path\n *\n * @see http://www.w3.org/TR/2015/WD-2dcontext-20150514/#dom-context-2d-arcto\n */\n ctx.prototype.arcTo = function (x1, y1, x2, y2, radius) {\n // Let the point (x0, y0) be the last point in the subpath.\n var x0 = this.__currentPosition && this.__currentPosition.x;\n var y0 = this.__currentPosition && this.__currentPosition.y;\n\n // First ensure there is a subpath for (x1, y1).\n if (typeof x0 == \"undefined\" || typeof y0 == \"undefined\") {\n return;\n }\n\n // Negative values for radius must cause the implementation to throw an IndexSizeError exception.\n if (radius < 0) {\n throw new Error(\"IndexSizeError: The radius provided (\" + radius + \") is negative.\");\n }\n\n // If the point (x0, y0) is equal to the point (x1, y1),\n // or if the point (x1, y1) is equal to the point (x2, y2),\n // or if the radius radius is zero,\n // then the method must add the point (x1, y1) to the subpath,\n // and connect that point to the previous point (x0, y0) by a straight line.\n if (((x0 === x1) && (y0 === y1))\n || ((x1 === x2) && (y1 === y2))\n || (radius === 0)) {\n this.lineTo(x1, y1);\n return;\n }\n\n // Otherwise, if the points (x0, y0), (x1, y1), and (x2, y2) all lie on a single straight line,\n // then the method must add the point (x1, y1) to the subpath,\n // and connect that point to the previous point (x0, y0) by a straight line.\n var unit_vec_p1_p0 = normalize([x0 - x1, y0 - y1]);\n var unit_vec_p1_p2 = normalize([x2 - x1, y2 - y1]);\n if (unit_vec_p1_p0[0] * unit_vec_p1_p2[1] === unit_vec_p1_p0[1] * unit_vec_p1_p2[0]) {\n this.lineTo(x1, y1);\n return;\n }\n\n // Otherwise, let The Arc be the shortest arc given by circumference of the circle that has radius radius,\n // and that has one point tangent to the half-infinite line that crosses the point (x0, y0) and ends at the point (x1, y1),\n // and that has a different point tangent to the half-infinite line that ends at the point (x1, y1), and crosses the point (x2, y2).\n // The points at which this circle touches these two lines are called the start and end tangent points respectively.\n\n // note that both vectors are unit vectors, so the length is 1\n var cos = (unit_vec_p1_p0[0] * unit_vec_p1_p2[0] + unit_vec_p1_p0[1] * unit_vec_p1_p2[1]);\n var theta = Math.acos(Math.abs(cos));\n\n // Calculate origin\n var unit_vec_p1_origin = normalize([\n unit_vec_p1_p0[0] + unit_vec_p1_p2[0],\n unit_vec_p1_p0[1] + unit_vec_p1_p2[1]\n ]);\n var len_p1_origin = radius / Math.sin(theta / 2);\n var x = x1 + len_p1_origin * unit_vec_p1_origin[0];\n var y = y1 + len_p1_origin * unit_vec_p1_origin[1];\n\n // Calculate start angle and end angle\n // rotate 90deg clockwise (note that y axis points to its down)\n var unit_vec_origin_start_tangent = [\n -unit_vec_p1_p0[1],\n unit_vec_p1_p0[0]\n ];\n // rotate 90deg counter clockwise (note that y axis points to its down)\n var unit_vec_origin_end_tangent = [\n unit_vec_p1_p2[1],\n -unit_vec_p1_p2[0]\n ];\n var getAngle = function (vector) {\n // get angle (clockwise) between vector and (1, 0)\n var x = vector[0];\n var y = vector[1];\n if (y >= 0) { // note that y axis points to its down\n return Math.acos(x);\n } else {\n return -Math.acos(x);\n }\n };\n var startAngle = getAngle(unit_vec_origin_start_tangent);\n var endAngle = getAngle(unit_vec_origin_end_tangent);\n\n // Connect the point (x0, y0) to the start tangent point by a straight line\n this.lineTo(x + unit_vec_origin_start_tangent[0] * radius,\n y + unit_vec_origin_start_tangent[1] * radius);\n\n // Connect the start tangent point to the end tangent point by arc\n // and adding the end tangent point to the subpath.\n this.arc(x, y, radius, startAngle, endAngle);\n };\n\n /**\n * Sets the stroke property on the current element\n */\n ctx.prototype.stroke = function () {\n if (this.__currentElement.nodeName === \"path\") {\n this.__currentElement.setAttribute(\"paint-order\", \"fill stroke markers\");\n }\n this.__applyCurrentDefaultPath();\n this.__applyStyleToCurrentElement(\"stroke\");\n };\n\n /**\n * Sets fill properties on the current element\n */\n ctx.prototype.fill = function () {\n if (this.__currentElement.nodeName === \"path\") {\n this.__currentElement.setAttribute(\"paint-order\", \"stroke fill markers\");\n }\n this.__applyCurrentDefaultPath();\n this.__applyStyleToCurrentElement(\"fill\");\n };\n\n /**\n * Adds a rectangle to the path.\n */\n ctx.prototype.rect = function (x, y, width, height) {\n if (this.__currentElement.nodeName !== \"path\") {\n this.beginPath();\n }\n this.moveTo(x, y);\n this.lineTo(x+width, y);\n this.lineTo(x+width, y+height);\n this.lineTo(x, y+height);\n this.lineTo(x, y);\n this.closePath();\n };\n\n\n /**\n * adds a rectangle element\n */\n ctx.prototype.fillRect = function (x, y, width, height) {\n var rect, parent;\n rect = this.__createElement(\"rect\", {\n x : x,\n y : y,\n width : width,\n height : height\n }, true);\n parent = this.__closestGroupOrSvg();\n parent.appendChild(rect);\n this.__currentElement = rect;\n this.__applyStyleToCurrentElement(\"fill\");\n };\n\n /**\n * Draws a rectangle with no fill\n * @param x\n * @param y\n * @param width\n * @param height\n */\n ctx.prototype.strokeRect = function (x, y, width, height) {\n var rect, parent;\n rect = this.__createElement(\"rect\", {\n x : x,\n y : y,\n width : width,\n height : height\n }, true);\n parent = this.__closestGroupOrSvg();\n parent.appendChild(rect);\n this.__currentElement = rect;\n this.__applyStyleToCurrentElement(\"stroke\");\n };\n\n\n /**\n * Clear entire canvas:\n * 1. save current transforms\n * 2. remove all the childNodes of the root g element\n */\n ctx.prototype.__clearCanvas = function () {\n var current = this.__closestGroupOrSvg(),\n transform = current.getAttribute(\"transform\");\n var rootGroup = this.__root.childNodes[1];\n var childNodes = rootGroup.childNodes;\n for (var i = childNodes.length - 1; i >= 0; i--) {\n if (childNodes[i]) {\n rootGroup.removeChild(childNodes[i]);\n }\n }\n this.__currentElement = rootGroup;\n //reset __groupStack as all the child group nodes are all removed.\n this.__groupStack = [];\n if (transform) {\n this.__addTransform(transform);\n }\n };\n\n /**\n * \"Clears\" a canvas by just drawing a white rectangle in the current group.\n */\n ctx.prototype.clearRect = function (x, y, width, height) {\n //clear entire canvas\n if (x === 0 && y === 0 && width === this.width && height === this.height) {\n this.__clearCanvas();\n return;\n }\n var rect, parent = this.__closestGroupOrSvg();\n rect = this.__createElement(\"rect\", {\n x : x,\n y : y,\n width : width,\n height : height,\n fill : \"#FFFFFF\"\n }, true);\n parent.appendChild(rect);\n };\n\n /**\n * Adds a linear gradient to a defs tag.\n * Returns a canvas gradient object that has a reference to it's parent def\n */\n ctx.prototype.createLinearGradient = function (x1, y1, x2, y2) {\n var grad = this.__createElement(\"linearGradient\", {\n id : randomString(this.__ids),\n x1 : x1+\"px\",\n x2 : x2+\"px\",\n y1 : y1+\"px\",\n y2 : y2+\"px\",\n \"gradientUnits\" : \"userSpaceOnUse\"\n }, false);\n this.__defs.appendChild(grad);\n return new CanvasGradient(grad, this);\n };\n\n /**\n * Adds a radial gradient to a defs tag.\n * Returns a canvas gradient object that has a reference to it's parent def\n */\n ctx.prototype.createRadialGradient = function (x0, y0, r0, x1, y1, r1) {\n var grad = this.__createElement(\"radialGradient\", {\n id : randomString(this.__ids),\n cx : x1+\"px\",\n cy : y1+\"px\",\n r : r1+\"px\",\n fx : x0+\"px\",\n fy : y0+\"px\",\n \"gradientUnits\" : \"userSpaceOnUse\"\n }, false);\n this.__defs.appendChild(grad);\n return new CanvasGradient(grad, this);\n\n };\n\n /**\n * Parses the font string and returns svg mapping\n * @private\n */\n ctx.prototype.__parseFont = function () {\n var regex = /^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))(?:\\s*\\/\\s*(normal|[.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])))?\\s*([-,\\'\\\"\\sa-z0-9]+?)\\s*$/i;\n var fontPart = regex.exec( this.font );\n var data = {\n style : fontPart[1] || 'normal',\n size : fontPart[4] || '10px',\n family : fontPart[6] || 'sans-serif',\n weight: fontPart[3] || 'normal',\n decoration : fontPart[2] || 'normal',\n href : null\n };\n\n //canvas doesn't support underline natively, but we can pass this attribute\n if (this.__fontUnderline === \"underline\") {\n data.decoration = \"underline\";\n }\n\n //canvas also doesn't support linking, but we can pass this as well\n if (this.__fontHref) {\n data.href = this.__fontHref;\n }\n\n return data;\n };\n\n /**\n * Helper to link text fragments\n * @param font\n * @param element\n * @return {*}\n * @private\n */\n ctx.prototype.__wrapTextLink = function (font, element) {\n if (font.href) {\n var a = this.__createElement(\"a\");\n a.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", font.href);\n a.appendChild(element);\n return a;\n }\n return element;\n };\n\n /**\n * Fills or strokes text\n * @param text\n * @param x\n * @param y\n * @param action - stroke or fill\n * @private\n */\n ctx.prototype.__applyText = function (text, x, y, action) {\n var font = this.__parseFont(),\n parent = this.__closestGroupOrSvg(),\n textElement = this.__createElement(\"text\", {\n \"font-family\" : font.family,\n \"font-size\" : font.size,\n \"font-style\" : font.style,\n \"font-weight\" : font.weight,\n \"text-decoration\" : font.decoration,\n \"x\" : x,\n \"y\" : y,\n \"text-anchor\": getTextAnchor(this.textAlign),\n \"dominant-baseline\": getDominantBaseline(this.textBaseline)\n }, true);\n\n textElement.appendChild(this.__document.createTextNode(text));\n this.__currentElement = textElement;\n this.__applyStyleToCurrentElement(action);\n parent.appendChild(this.__wrapTextLink(font,textElement));\n };\n\n /**\n * Creates a text element\n * @param text\n * @param x\n * @param y\n */\n ctx.prototype.fillText = function (text, x, y) {\n this.__applyText(text, x, y, \"fill\");\n };\n\n /**\n * Strokes text\n * @param text\n * @param x\n * @param y\n */\n ctx.prototype.strokeText = function (text, x, y) {\n this.__applyText(text, x, y, \"stroke\");\n };\n\n /**\n * No need to implement this for svg.\n * @param text\n * @return {TextMetrics}\n */\n ctx.prototype.measureText = function (text) {\n this.__ctx.font = this.font;\n return this.__ctx.measureText(text);\n };\n\n /**\n * Arc command!\n */\n ctx.prototype.arc = function (x, y, radius, startAngle, endAngle, counterClockwise) {\n // in canvas no circle is drawn if no angle is provided.\n if (startAngle === endAngle) {\n return;\n }\n startAngle = startAngle % (2*Math.PI);\n endAngle = endAngle % (2*Math.PI);\n if (startAngle === endAngle) {\n //circle time! subtract some of the angle so svg is happy (svg elliptical arc can't draw a full circle)\n endAngle = ((endAngle + (2*Math.PI)) - 0.001 * (counterClockwise ? -1 : 1)) % (2*Math.PI);\n }\n var endX = x+radius*Math.cos(endAngle),\n endY = y+radius*Math.sin(endAngle),\n startX = x+radius*Math.cos(startAngle),\n startY = y+radius*Math.sin(startAngle),\n sweepFlag = counterClockwise ? 0 : 1,\n largeArcFlag = 0,\n diff = endAngle - startAngle;\n\n // https://github.com/gliffy/canvas2svg/issues/4\n if (diff < 0) {\n diff += 2*Math.PI;\n }\n\n if (counterClockwise) {\n largeArcFlag = diff > Math.PI ? 0 : 1;\n } else {\n largeArcFlag = diff > Math.PI ? 1 : 0;\n }\n\n this.lineTo(startX, startY);\n this.__addPathCommand(format(\"A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}\",\n {rx:radius, ry:radius, xAxisRotation:0, largeArcFlag:largeArcFlag, sweepFlag:sweepFlag, endX:endX, endY:endY}));\n\n this.__currentPosition = {x: endX, y: endY};\n };\n\n /**\n * Generates a ClipPath from the clip command.\n */\n ctx.prototype.clip = function () {\n var group = this.__closestGroupOrSvg(),\n clipPath = this.__createElement(\"clipPath\"),\n id = randomString(this.__ids),\n newGroup = this.__createElement(\"g\");\n\n this.__applyCurrentDefaultPath();\n group.removeChild(this.__currentElement);\n clipPath.setAttribute(\"id\", id);\n clipPath.appendChild(this.__currentElement);\n\n this.__defs.appendChild(clipPath);\n\n //set the clip path to this group\n group.setAttribute(\"clip-path\", format(\"url(#{id})\", {id:id}));\n\n //clip paths can be scaled and transformed, we need to add another wrapper group to avoid later transformations\n // to this path\n group.appendChild(newGroup);\n\n this.__currentElement = newGroup;\n\n };\n\n /**\n * Draws a canvas, image or mock context to this canvas.\n * Note that all svg dom manipulation uses node.childNodes rather than node.children for IE support.\n * http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage\n */\n ctx.prototype.drawImage = function () {\n //convert arguments to a real array\n var args = Array.prototype.slice.call(arguments),\n image=args[0],\n dx, dy, dw, dh, sx=0, sy=0, sw, sh, parent, svg, defs, group,\n currentElement, svgImage, canvas, context, id;\n\n if (args.length === 3) {\n dx = args[1];\n dy = args[2];\n sw = image.width;\n sh = image.height;\n dw = sw;\n dh = sh;\n } else if (args.length === 5) {\n dx = args[1];\n dy = args[2];\n dw = args[3];\n dh = args[4];\n sw = image.width;\n sh = image.height;\n } else if (args.length === 9) {\n sx = args[1];\n sy = args[2];\n sw = args[3];\n sh = args[4];\n dx = args[5];\n dy = args[6];\n dw = args[7];\n dh = args[8];\n } else {\n throw new Error(\"Inavlid number of arguments passed to drawImage: \" + arguments.length);\n }\n\n parent = this.__closestGroupOrSvg();\n currentElement = this.__currentElement;\n var translateDirective = \"translate(\" + dx + \", \" + dy + \")\";\n if (image instanceof ctx) {\n //canvas2svg mock canvas context. In the future we may want to clone nodes instead.\n //also I'm currently ignoring dw, dh, sw, sh, sx, sy for a mock context.\n svg = image.getSvg().cloneNode(true);\n if (svg.childNodes && svg.childNodes.length > 1) {\n defs = svg.childNodes[0];\n while(defs.childNodes.length) {\n id = defs.childNodes[0].getAttribute(\"id\");\n this.__ids[id] = id;\n this.__defs.appendChild(defs.childNodes[0]);\n }\n group = svg.childNodes[1];\n if (group) {\n //save original transform\n var originTransform = group.getAttribute(\"transform\");\n var transformDirective;\n if (originTransform) {\n transformDirective = originTransform+\" \"+translateDirective;\n } else {\n transformDirective = translateDirective;\n }\n group.setAttribute(\"transform\", transformDirective);\n parent.appendChild(group);\n }\n }\n } else if (image.nodeName === \"CANVAS\" || image.nodeName === \"IMG\") {\n //canvas or image\n svgImage = this.__createElement(\"image\");\n svgImage.setAttribute(\"width\", dw);\n svgImage.setAttribute(\"height\", dh);\n svgImage.setAttribute(\"opacity\", this.globalAlpha);\n svgImage.setAttribute(\"preserveAspectRatio\", \"none\");\n\n // force embed every images's base64 in SVG by using 'true'\n // makes SVG self-contained\n if (true) {\n //crop the image using a temporary canvas\n canvas = this.__document.createElement(\"canvas\");\n canvas.width = dw;\n canvas.height = dh;\n context = canvas.getContext(\"2d\");\n context.drawImage(image, sx, sy, sw, sh, 0, 0, dw, dh);\n image = canvas;\n }\n svgImage.setAttribute(\"transform\", translateDirective);\n svgImage.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\",\n image.nodeName === \"CANVAS\" ? image.toDataURL() : image.getAttribute(\"src\"));\n parent.appendChild(svgImage);\n }\n };\n\n /**\n * Generates a pattern tag\n */\n ctx.prototype.createPattern = function (image, repetition) {\n var pattern = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"pattern\"), id = randomString(this.__ids),\n img;\n pattern.setAttribute(\"id\", id);\n pattern.setAttribute(\"width\", image.width);\n pattern.setAttribute(\"height\", image.height);\n if (image.nodeName === \"CANVAS\" || image.nodeName === \"IMG\") {\n img = this.__document.createElementNS(\"http://www.w3.org/2000/svg\", \"image\");\n img.setAttribute(\"width\", image.width);\n img.setAttribute(\"height\", image.height);\n img.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\",\n image.nodeName === \"CANVAS\" ? image.toDataURL() : image.getAttribute(\"src\"));\n pattern.appendChild(img);\n this.__defs.appendChild(pattern);\n } else if (image instanceof ctx) {\n pattern.appendChild(image.__root.childNodes[1]);\n this.__defs.appendChild(pattern);\n }\n return new CanvasPattern(pattern, this);\n };\n\n ctx.prototype.setLineDash = function (dashArray) {\n if (dashArray && dashArray.length > 0) {\n this.lineDash = dashArray.join(\",\");\n } else {\n this.lineDash = null;\n }\n };\n\n /**\n * Not yet implemented\n */\n ctx.prototype.drawFocusRing = function () {};\n ctx.prototype.createImageData = function () {};\n ctx.prototype.getImageData = function () {};\n ctx.prototype.putImageData = function () {};\n ctx.prototype.globalCompositeOperation = function () {};\n ctx.prototype.setTransform = function () {};\n\n //add options for alternative namespace\n if (typeof window === \"object\") {\n window.C2S = ctx;\n }\n\n // CommonJS/Browserify\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n module.exports = ctx;\n }\n\n}());\n\n\n/***/ })\n/******/ ]);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9jeXRvc2NhcGUtc3ZnL2N5dG9zY2FwZS1zdmcuanM/MjcwMSJdLCJ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ICAgICAgICAgc3ZnIDogXCJidXR0XCIsXG4gICAgICAgICAgICBhcHBseSA6IFwic3Ryb2tlXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJsaW5lSm9pblwiOntcbiAgICAgICAgICAgIHN2Z0F0dHIgOiBcInN0cm9rZS1saW5lam9pblwiLFxuICAgICAgICAgICAgY2FudmFzIDogXCJtaXRlclwiLFxuICAgICAgICAgICAgc3ZnIDogXCJtaXRlclwiLFxuICAgICAgICAgICAgYXBwbHkgOiBcInN0cm9rZVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwibWl0ZXJMaW1pdFwiOntcbiAgICAgICAgICAgIHN2Z0F0dHIgOiBcInN0cm9rZS1taXRlcmxpbWl0XCIsXG4gICAgICAgICAgICBjYW52YXMgOiAxMCxcbiAgICAgICAgICAgIHN2ZyA6IDQsXG4gICAgICAgICAgICBhcHBseSA6IFwic3Ryb2tlXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJsaW5lV2lkdGhcIjp7XG4gICAgICAgICAgICBzdmdBdHRyIDogXCJzdHJva2Utd2lkdGhcIixcbiAgICAgICAgICAgIGNhbnZhcyA6IDEsXG4gICAgICAgICAgICBzdmcgOiAxLFxuICAgICAgICAgICAgYXBwbHkgOiBcInN0cm9rZVwiXG4gICAgICAgIH0sXG4gICAgICAgIFwiZ2xvYmFsQWxwaGFcIjoge1xuICAgICAgICAgICAgc3ZnQXR0ciA6IFwib3BhY2l0eVwiLFxuICAgICAgICAgICAgY2FudmFzIDogMSxcbiAgICAgICAgICAgIHN2ZyA6IDEsXG4gICAgICAgICAgICBhcHBseSA6ICBcImZpbGwgc3Ryb2tlXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJmb250XCI6e1xuICAgICAgICAgICAgLy9mb250IGNvbnZlcnRzIHRvIG11bHRpcGxlIHN2ZyBhdHRyaWJ1dGVzLCB0aGVyZSBpcyBjdXN0b20gbG9naWMgZm9yIHRoaXNcbiAgICAgICAgICAgIGNhbnZhcyA6IFwiMTBweCBzYW5zLXNlcmlmXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJzaGFkb3dDb2xvclwiOntcbiAgICAgICAgICAgIGNhbnZhcyA6IFwiIzAwMDAwMFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwic2hhZG93T2Zmc2V0WFwiOntcbiAgICAgICAgICAgIGNhbnZhcyA6IDBcbiAgICAgICAgfSxcbiAgICAgICAgXCJzaGFkb3dPZmZzZXRZXCI6e1xuICAgICAgICAgICAgY2FudmFzIDogMFxuICAgICAgICB9LFxuICAgICAgICBcInNoYWRvd0JsdXJcIjp7XG4gICAgICAgICAgICBjYW52YXMgOiAwXG4gICAgICAgIH0sXG4gICAgICAgIFwidGV4dEFsaWduXCI6e1xuICAgICAgICAgICAgY2FudmFzIDogXCJzdGFydFwiXG4gICAgICAgIH0sXG4gICAgICAgIFwidGV4dEJhc2VsaW5lXCI6e1xuICAgICAgICAgICAgY2FudmFzIDogXCJhbHBoYWJldGljXCJcbiAgICAgICAgfSxcbiAgICAgICAgXCJsaW5lRGFzaFwiIDoge1xuICAgICAgICAgICAgc3ZnQXR0ciA6IFwic3Ryb2tlLWRhc2hhcnJheVwiLFxuICAgICAgICAgICAgY2FudmFzIDogW10sXG4gICAgICAgICAgICBzdmcgOiBudWxsLFxuICAgICAgICAgICAgYXBwbHkgOiBcInN0cm9rZVwiXG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICpcbiAgICAgKiBAcGFyYW0gZ3JhZGllbnROb2RlIC0gcmVmZXJlbmNlIHRvIHRoZSBncmFkaWVudFxuICAgICAqIEBjb25zdHJ1Y3RvclxuICAgICAqL1xuICAgIENhbnZhc0dyYWRpZW50ID0gZnVuY3Rpb24gKGdyYWRpZW50Tm9kZSwgY3R4KSB7XG4gICAgICAgIHRoaXMuX19yb290ID0gZ3JhZGllbnROb2RlO1xuICAgICAgICB0aGlzLl9fY3R4ID0gY3R4O1xuICAgIH07XG5cbiAgICAvKipcbiAgICA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TEVTW2tleXNbaV1dO1xuICAgICAgICAgICAgdmFsdWUgPSB0aGlzW2tleXNbaV1dO1xuICAgICAgICAgICAgaWYgKHN0eWxlLmFwcGx5KSB7XG4gICAgICAgICAgICAgICAgLy9pcyB0aGlzIGEgZ3JhZGllbnQgb3IgcGF0dGVybj9cbiAgICAgICAgICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBDYW52YXNQYXR0ZXJuKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vcGF0dGVyblxuICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUuX19jdHgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vY29weSBvdmVyIGRlZnNcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlKHZhbHVlLl9fY3R4Ll9fZGVmcy5jaGlsZE5vZGVzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkID0gdmFsdWUuX19jdHguX19kZWZzLmNoaWxkTm9kZXNbMF0uZ2V0QXR0cmlidXRlKFwiaWRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fX2lkc1tpZF0gPSBpZDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9fZGVmcy5hcHBlbmRDaGlsZCh2YWx1ZS5fX2N0eC5fX2RlZnMuY2hpbGROb2Rlc1swXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY3VycmVudEVsZW1lbnQuc2V0QXR0cmlidXRlKHN0eWxlLmFwcGx5LCBmb3JtYXQoXCJ1cmwoI3tpZH0pXCIsIHtpZDp2YWx1ZS5fX3Jvb3QuZ2V0QXR0cmlidXRlKFwiaWRcIil9KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZhbHVlIGluc3RhbmNlb2YgQ2FudmFzR3JhZGllbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9ncmFkaWVudFxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50RWxlbWVudC5zZXRBdHRyaWJ1dGUoc3R5bGUuYXBwbHksIGZvcm1hdChcInVybCgje2lkfSlcIiwge2lkOnZhbHVlLl9fcm9vdC5nZXRBdHRyaWJ1dGUoXCJpZFwiKX0pKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHN0eWxlLmFwcGx5LmluZGV4T2YodHlwZSkhPT0tMSAmJiBzdHlsZS5zdmcgIT09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoc3R5bGUuc3ZnQXR0ciA9PT0gXCJzdHJva2VcIiB8fCBzdHlsZS5zdmdBdHRyID09PSBcImZpbGxcIikgJiYgdmFsdWUuaW5kZXhPZihcInJnYmFcIikgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL3NlcGFyYXRlIGFscGhhIHZhbHVlLCBzaW5jZSBpbGx1c3RyYXRvciBjYW4ndCBoYW5kbGUgaXRcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2V4ID0gL3JnYmFcXChcXHMqKFxcZCspXFxzKixcXHMqKFxcZCspXFxzKixcXHMqKFxcZCspXFxzKixcXHMqKFxcZD9cXC4/XFxkKilcXHMqXFwpL2dpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2hlcyA9IHJlZ2V4LmV4ZWModmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudEVsZW1lbnQuc2V0QXR0cmlidXRlKHN0eWxlLnN2Z0F0dHIsIGZvcm1hdChcInJnYih7cn0se2d9LHtifSlcIiwge3I6bWF0Y2hlc1sxXSwgZzptYXRjaGVzWzJdLCBiOm1hdGNoZXNbM119KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL3Nob3VsZCB0YWtlIGdsb2JhbEFscGhhIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcGFjaXR5ID0gbWF0Y2hlc1s0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBnbG9iYWxBbHBoYSA9IHRoaXMuZ2xvYmFsQWxwaGE7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2xvYmFsQWxwaGEgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wYWNpdHkgKj0gZ2xvYmFsQWxwaGE7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50RWxlbWVudC5zZXRBdHRyaWJ1dGUoc3R5bGUuc3ZnQXR0citcIi1vcGFjaXR5XCIsIG9wYWNpdHkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF0dHIgPSBzdHlsZS5zdmdBdHRyO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGtleXNbaV0gPT09ICdnbG9iYWxBbHBoYScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyID0gdHlwZSsnLScrc3R5bGUuc3ZnQXR0cjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudEVsZW1lbnQuZ2V0QXR0cmlidXRlKGF0dHIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZpbGwtb3BhY2l0eSBvciBzdHJva2Utb3BhY2l0eSBoYXMgYWxyZWFkeSBiZWVuIHNldCBieSBzdHJva2Ugb3IgZmlsbC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgLy9vdGhlcndpc2Ugb25seSB1cGRhdGUgYXR0cmlidXRlIGlmIHJpZ2h0IHR5cGUsIGFuZCBub3Qgc3ZnIGRlZmF1bHRcb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udC5zaXplLFxuICAgICAgICAgICAgICAgIFwiZm9udC1zdHlsZVwiIDogZm9udC5zdHlsZSxcbiAgICAgICAgICAgICAgICBcImZvbnQtd2VpZ2h0XCIgOiBmb250LndlaWdodCxcbiAgICAgICAgICAgICAgICBcInRleHQtZGVjb3JhdGlvblwiIDogZm9udC5kZWNvcmF0aW9uLFxuICAgICAgICAgICAgICAgIFwieFwiIDogeCxcbiAgICAgICAgICAgICAgICBcInlcIiA6IHksXG4gICAgICAgICAgICAgICAgXCJ0ZXh0LWFuY2hvclwiOiBnZXRUZXh0QW5jaG9yKHRoaXMudGV4dEFsaWduKSxcbiAgICAgICAgICAgICAgICBcImRvbWluYW50LWJhc2VsaW5lXCI6IGdldERvbWluYW50QmFzZWxpbmUodGhpcy50ZXh0QmFzZWxpbmUpXG4gICAgICAgICAgICB9LCB0cnVlKTtcblxuICAgICAgICB0ZXh0RWxlbWVudC5hcHBlbmRDaGlsZCh0aGlzLl9fZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUodGV4dCkpO1xuICAgICAgICB0aGlzLl9fY3VycmVudEVsZW1lbnQgPSB0ZXh0RWxlbWVudDtcbiAgICAgICAgdGhpcy5fX2FwcGx5U3R5bGVUb0N1cnJlbnRFbGVtZW50KGFjdGlvbik7XG4gICAgICAgIHBhcmVudC5hcHBlbmRDaGlsZCh0aGlzLl9fd3JhcFRleHRMaW5rKGZvbnQsdGV4dEVsZW1lbnQpKTtcbiAgICB9O1xuXG4gICAgLyoqXG4gICAgICogQ3JlYXRlcyBhIHRleHQgZWxlbWVudFxuICAgICAqIEBwYXJhbSB0ZXh0XG4gICAgICogQHBhcmFtIHhcbiAgICAgKiBAcGFyYW0geVxuICAgICAqL1xuICAgIGN0eC5wcm90b3R5cGUuZmlsbFRleHQgPSBmdW5jdGlvbiAodGV4dCwgeCwgeSkge1xuICAgICAgICB0aGlzLl9fYXBwbHlUZXh0KHRleHQsIHgsIHksIFwiZmlsbFwiKTtcbiAgICB9O1xuXG4g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gICBjdHgucHJvdG90eXBlLmRyYXdJbWFnZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgLy9jb252ZXJ0IGFyZ3VtZW50cyB0byBhIHJlYWwgYXJyYXlcbiAgICAgICAgdmFyIGFyZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMpLFxuICAgICAgICAgICAgaW1hZ2U9YXJnc1swXSxcbiAgICAgICAgICAgIGR4LCBkeSwgZHcsIGRoLCBzeD0wLCBzeT0wLCBzdywgc2gsIHBhcmVudCwgc3ZnLCBkZWZzLCBncm91cCxcbiAgICAgICAgICAgIGN1cnJlbnRFbGVtZW50LCBzdmdJbWFnZSwgY2FudmFzLCBjb250ZXh0LCBpZDtcblxuICAgICAgICBpZiAoYXJncy5sZW5ndGggPT09IDMpIHtcbiAgICAgICAgICAgIGR4ID0gYXJnc1sxXTtcbiAgICAgICAgICAgIGR5ID0gYXJnc1syXTtcbiAgICAgICAgICAgIHN3ID0gaW1hZ2Uud2lkdGg7XG4gICAgICAgICAgICBzaCA9IGltYWdlLmhlaWdodDtcbiAgICAgICAgICAgIGR3ID0gc3c7XG4gICAgICAgICAgICBkaCA9IHNoO1xuICAgICAgICB9IGVsc2UgaWYgKGFyZ3MubGVuZ3RoID09PSA1KSB7XG4gICAgICAgICAgICBkeCA9IGFyZ3NbMV07XG4gICAgICAgICAgICBkeSA9IGFyZ3NbMl07XG4gICAgICAgICAgICBkdyA9IGFyZ3NbM107XG4gICAgICAgICAgICBkaCA9IGFyZ3NbNF07XG4gICAgICAgICAgICBzdyA9IGltYWdlLndpZHRoO1xuICAgICAgICAgICAgc2ggPSBpbWFnZS5oZWlnaHQ7XG4gICAgICAgIH0gZWxzZSBpZiAoYXJncy5sZW5ndGggPT09IDkpIHtcbiAgICAgICAgICAgIHN4ID0gYXJnc1sxXTtcbiAgICAgICAgICAgIHN5ID0gYXJnc1syXTtcbiAgICAgICAgICAgIHN3ID0gYXJnc1szXTtcbiAgIC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ICAgICAgICAgICAgd2hpbGUoZGVmcy5jaGlsZE5vZGVzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IGRlZnMuY2hpbGROb2Rlc1swXS5nZXRBdHRyaWJ1dGUoXCJpZFwiKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fX2lkc1tpZF0gPSBpZDtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fX2RlZnMuYXBwZW5kQ2hpbGQoZGVmcy5jaGlsZE5vZGVzWzBdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZ3JvdXAgPSBzdmcuY2hpbGROb2Rlc1sxXTtcbiAgICAgICAgICAgICAgICBpZiAoZ3JvdXApIHtcbiAgICAgICAgICAgICAgICAgICAgLy9zYXZlIG9yaWdpbmFsIHRyYW5zZm9ybVxuICAgICAgICAgICAgICAgICAgICB2YXIgb3JpZ2luVHJhbnNmb3JtID0gZ3JvdXAuZ2V0QXR0cmlidXRlKFwidHJhbnNmb3JtXCIpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgdHJhbnNmb3JtRGlyZWN0aXZlO1xuICAgICAgICAgICAgICAgICAgICBpZiAob3JpZ2luVHJhbnNmb3JtKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1EaXJlY3RpdmUgPSBvcmlnaW5UcmFuc2Zvcm0rXCIgXCIrdHJhbnNsYXRlRGlyZWN0aXZlO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtRGlyZWN0aXZlID0gdHJhbnNsYXRlRGlyZWN0aXZlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGdyb3VwLnNldEF0dHJpYnV0ZShcInRyYW5zZm9ybVwiLCB0cmFuc2Zvcm1EaXJlY3RpdmUpO1xuICAgICAgICAgICAgICAgICAgICBwYXJlbnQuYXBwZW5kQ2hpbGQo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xuICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IGN0eDtcbiAgICB9XG5cbn0oKSk7XG5cblxuLyoqKi8gfSlcbi8qKioqKiovIF0pO1xufSk7Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/cytoscape-svg/cytoscape-svg.js\n"); /***/ }), /***/ "./node_modules/cytoscape/dist/cytoscape.cjs.js": /*!******************************************************!*\ !*** ./node_modules/cytoscape/dist/cytoscape.cjs.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {/**\n * Copyright (c) 2016-2020, The Cytoscape Consortium.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the “Software”), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do\n * so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\n\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar util = _interopDefault(__webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\"));\nvar Heap = _interopDefault(__webpack_require__(/*! heap */ \"./node_modules/heap/index.js\"));\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nvar window$1 = typeof window === 'undefined' ? null : window; // eslint-disable-line no-undef\n\nvar navigator = window$1 ? window$1.navigator : null;\nvar document$1 = window$1 ? window$1.document : null;\n\nvar typeofstr = _typeof('');\n\nvar typeofobj = _typeof({});\n\nvar typeoffn = _typeof(function () {});\n\nvar typeofhtmlele = typeof HTMLElement === \"undefined\" ? \"undefined\" : _typeof(HTMLElement);\n\nvar instanceStr = function instanceStr(obj) {\n return obj && obj.instanceString && fn(obj.instanceString) ? obj.instanceString() : null;\n};\n\nvar string = function string(obj) {\n return obj != null && _typeof(obj) == typeofstr;\n};\nvar fn = function fn(obj) {\n return obj != null && _typeof(obj) === typeoffn;\n};\nvar array = function array(obj) {\n return Array.isArray ? Array.isArray(obj) : obj != null && obj instanceof Array;\n};\nvar plainObject = function plainObject(obj) {\n return obj != null && _typeof(obj) === typeofobj && !array(obj) && obj.constructor === Object;\n};\nvar object = function object(obj) {\n return obj != null && _typeof(obj) === typeofobj;\n};\nvar number = function number(obj) {\n return obj != null && _typeof(obj) === _typeof(1) && !isNaN(obj);\n};\nvar integer = function integer(obj) {\n return number(obj) && Math.floor(obj) === obj;\n};\nvar htmlElement = function htmlElement(obj) {\n if ('undefined' === typeofhtmlele) {\n return undefined;\n } else {\n return null != obj && obj instanceof HTMLElement;\n }\n};\nvar elementOrCollection = function elementOrCollection(obj) {\n return element(obj) || collection(obj);\n};\nvar element = function element(obj) {\n return instanceStr(obj) === 'collection' && obj._private.single;\n};\nvar collection = function collection(obj) {\n return instanceStr(obj) === 'collection' && !obj._private.single;\n};\nvar core = function core(obj) {\n return instanceStr(obj) === 'core';\n};\nvar stylesheet = function stylesheet(obj) {\n return instanceStr(obj) === 'stylesheet';\n};\nvar event = function event(obj) {\n return instanceStr(obj) === 'event';\n};\nvar emptyString = function emptyString(obj) {\n if (obj === undefined || obj === null) {\n // null is empty\n return true;\n } else if (obj === '' || obj.match(/^\\s+$/)) {\n return true; // empty string is empty\n }\n\n return false; // otherwise, we don't know what we've got\n};\nvar domElement = function domElement(obj) {\n if (typeof HTMLElement === 'undefined') {\n return false; // we're not in a browser so it doesn't matter\n } else {\n return obj instanceof HTMLElement;\n }\n};\nvar boundingBox = function boundingBox(obj) {\n return plainObject(obj) && number(obj.x1) && number(obj.x2) && number(obj.y1) && number(obj.y2);\n};\nvar promise = function promise(obj) {\n return object(obj) && fn(obj.then);\n};\nvar ms = function ms() {\n return navigator && navigator.userAgent.match(/msie|trident|edge/i);\n}; // probably a better way to detect this...\n\nvar memoize = function memoize(fn, keyFn) {\n if (!keyFn) {\n keyFn = function keyFn() {\n if (arguments.length === 1) {\n return arguments[0];\n } else if (arguments.length === 0) {\n return 'undefined';\n }\n\n var args = [];\n\n for (var i = 0; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n\n return args.join('$');\n };\n }\n\n var memoizedFn = function memoizedFn() {\n var self = this;\n var args = arguments;\n var ret;\n var k = keyFn.apply(self, args);\n var cache = memoizedFn.cache;\n\n if (!(ret = cache[k])) {\n ret = cache[k] = fn.apply(self, args);\n }\n\n return ret;\n };\n\n memoizedFn.cache = {};\n return memoizedFn;\n};\n\nvar camel2dash = memoize(function (str) {\n return str.replace(/([A-Z])/g, function (v) {\n return '-' + v.toLowerCase();\n });\n});\nvar dash2camel = memoize(function (str) {\n return str.replace(/(-\\w)/g, function (v) {\n return v[1].toUpperCase();\n });\n});\nvar prependCamel = memoize(function (prefix, str) {\n return prefix + str[0].toUpperCase() + str.substring(1);\n}, function (prefix, str) {\n return prefix + '$' + str;\n});\nvar capitalize = function capitalize(str) {\n if (emptyString(str)) {\n return str;\n }\n\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar number$1 = '(?:[-+]?(?:(?:\\\\d+|\\\\d*\\\\.\\\\d+)(?:[Ee][+-]?\\\\d+)?))';\nvar rgba = 'rgb[a]?\\\\((' + number$1 + '[%]?)\\\\s*,\\\\s*(' + number$1 + '[%]?)\\\\s*,\\\\s*(' + number$1 + '[%]?)(?:\\\\s*,\\\\s*(' + number$1 + '))?\\\\)';\nvar rgbaNoBackRefs = 'rgb[a]?\\\\((?:' + number$1 + '[%]?)\\\\s*,\\\\s*(?:' + number$1 + '[%]?)\\\\s*,\\\\s*(?:' + number$1 + '[%]?)(?:\\\\s*,\\\\s*(?:' + number$1 + '))?\\\\)';\nvar hsla = 'hsl[a]?\\\\((' + number$1 + ')\\\\s*,\\\\s*(' + number$1 + '[%])\\\\s*,\\\\s*(' + number$1 + '[%])(?:\\\\s*,\\\\s*(' + number$1 + '))?\\\\)';\nvar hslaNoBackRefs = 'hsl[a]?\\\\((?:' + number$1 + ')\\\\s*,\\\\s*(?:' + number$1 + '[%])\\\\s*,\\\\s*(?:' + number$1 + '[%])(?:\\\\s*,\\\\s*(?:' + number$1 + '))?\\\\)';\nvar hex3 = '\\\\#[0-9a-fA-F]{3}';\nvar hex6 = '\\\\#[0-9a-fA-F]{6}';\n\nvar ascending = function ascending(a, b) {\n if (a < b) {\n return -1;\n } else if (a > b) {\n return 1;\n } else {\n return 0;\n }\n};\nvar descending = function descending(a, b) {\n return -1 * ascending(a, b);\n};\n\nvar extend = Object.assign != null ? Object.assign.bind(Object) : function (tgt) {\n var args = arguments;\n\n for (var i = 1; i < args.length; i++) {\n var obj = args[i];\n\n if (obj == null) {\n continue;\n }\n\n var keys = Object.keys(obj);\n\n for (var j = 0; j < keys.length; j++) {\n var k = keys[j];\n tgt[k] = obj[k];\n }\n }\n\n return tgt;\n};\n\nvar hex2tuple = function hex2tuple(hex) {\n if (!(hex.length === 4 || hex.length === 7) || hex[0] !== '#') {\n return;\n }\n\n var shortHex = hex.length === 4;\n var r, g, b;\n var base = 16;\n\n if (shortHex) {\n r = parseInt(hex[1] + hex[1], base);\n g = parseInt(hex[2] + hex[2], base);\n b = parseInt(hex[3] + hex[3], base);\n } else {\n r = parseInt(hex[1] + hex[2], base);\n g = parseInt(hex[3] + hex[4], base);\n b = parseInt(hex[5] + hex[6], base);\n }\n\n return [r, g, b];\n}; // get [r, g, b, a] from hsl(0, 0, 0) or hsla(0, 0, 0, 0)\n\nvar hsl2tuple = function hsl2tuple(hsl) {\n var ret;\n var h, s, l, a, r, g, b;\n\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n\n var m = new RegExp('^' + hsla + '$').exec(hsl);\n\n if (m) {\n // get hue\n h = parseInt(m[1]);\n\n if (h < 0) {\n h = (360 - -1 * h % 360) % 360;\n } else if (h > 360) {\n h = h % 360;\n }\n\n h /= 360; // normalise on [0, 1]\n\n s = parseFloat(m[2]);\n\n if (s < 0 || s > 100) {\n return;\n } // saturation is [0, 100]\n\n\n s = s / 100; // normalise on [0, 1]\n\n l = parseFloat(m[3]);\n\n if (l < 0 || l > 100) {\n return;\n } // lightness is [0, 100]\n\n\n l = l / 100; // normalise on [0, 1]\n\n a = m[4];\n\n if (a !== undefined) {\n a = parseFloat(a);\n\n if (a < 0 || a > 1) {\n return;\n } // alpha is [0, 1]\n\n } // now, convert to rgb\n // code from http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n\n\n if (s === 0) {\n r = g = b = Math.round(l * 255); // achromatic\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = Math.round(255 * hue2rgb(p, q, h + 1 / 3));\n g = Math.round(255 * hue2rgb(p, q, h));\n b = Math.round(255 * hue2rgb(p, q, h - 1 / 3));\n }\n\n ret = [r, g, b, a];\n }\n\n return ret;\n}; // get [r, g, b, a] from rgb(0, 0, 0) or rgba(0, 0, 0, 0)\n\nvar rgb2tuple = function rgb2tuple(rgb) {\n var ret;\n var m = new RegExp('^' + rgba + '$').exec(rgb);\n\n if (m) {\n ret = [];\n var isPct = [];\n\n for (var i = 1; i <= 3; i++) {\n var channel = m[i];\n\n if (channel[channel.length - 1] === '%') {\n isPct[i] = true;\n }\n\n channel = parseFloat(channel);\n\n if (isPct[i]) {\n channel = channel / 100 * 255; // normalise to [0, 255]\n }\n\n if (channel < 0 || channel > 255) {\n return;\n } // invalid channel value\n\n\n ret.push(Math.floor(channel));\n }\n\n var atLeastOneIsPct = isPct[1] || isPct[2] || isPct[3];\n var allArePct = isPct[1] && isPct[2] && isPct[3];\n\n if (atLeastOneIsPct && !allArePct) {\n return;\n } // must all be percent values if one is\n\n\n var alpha = m[4];\n\n if (alpha !== undefined) {\n alpha = parseFloat(alpha);\n\n if (alpha < 0 || alpha > 1) {\n return;\n } // invalid alpha value\n\n\n ret.push(alpha);\n }\n }\n\n return ret;\n};\nvar colorname2tuple = function colorname2tuple(color) {\n return colors[color.toLowerCase()];\n};\nvar color2tuple = function color2tuple(color) {\n return (array(color) ? color : null) || colorname2tuple(color) || hex2tuple(color) || rgb2tuple(color) || hsl2tuple(color);\n};\nvar colors = {\n // special colour names\n transparent: [0, 0, 0, 0],\n // NB alpha === 0\n // regular colours\n aliceblue: [240, 248, 255],\n antiquewhite: [250, 235, 215],\n aqua: [0, 255, 255],\n aquamarine: [127, 255, 212],\n azure: [240, 255, 255],\n beige: [245, 245, 220],\n bisque: [255, 228, 196],\n black: [0, 0, 0],\n blanchedalmond: [255, 235, 205],\n blue: [0, 0, 255],\n blueviolet: [138, 43, 226],\n brown: [165, 42, 42],\n burlywood: [222, 184, 135],\n cadetblue: [95, 158, 160],\n chartreuse: [127, 255, 0],\n chocolate: [210, 105, 30],\n coral: [255, 127, 80],\n cornflowerblue: [100, 149, 237],\n cornsilk: [255, 248, 220],\n crimson: [220, 20, 60],\n cyan: [0, 255, 255],\n darkblue: [0, 0, 139],\n darkcyan: [0, 139, 139],\n darkgoldenrod: [184, 134, 11],\n darkgray: [169, 169, 169],\n darkgreen: [0, 100, 0],\n darkgrey: [169, 169, 169],\n darkkhaki: [189, 183, 107],\n darkmagenta: [139, 0, 139],\n darkolivegreen: [85, 107, 47],\n darkorange: [255, 140, 0],\n darkorchid: [153, 50, 204],\n darkred: [139, 0, 0],\n darksalmon: [233, 150, 122],\n darkseagreen: [143, 188, 143],\n darkslateblue: [72, 61, 139],\n darkslategray: [47, 79, 79],\n darkslategrey: [47, 79, 79],\n darkturquoise: [0, 206, 209],\n darkviolet: [148, 0, 211],\n deeppink: [255, 20, 147],\n deepskyblue: [0, 191, 255],\n dimgray: [105, 105, 105],\n dimgrey: [105, 105, 105],\n dodgerblue: [30, 144, 255],\n firebrick: [178, 34, 34],\n floralwhite: [255, 250, 240],\n forestgreen: [34, 139, 34],\n fuchsia: [255, 0, 255],\n gainsboro: [220, 220, 220],\n ghostwhite: [248, 248, 255],\n gold: [255, 215, 0],\n goldenrod: [218, 165, 32],\n gray: [128, 128, 128],\n grey: [128, 128, 128],\n green: [0, 128, 0],\n greenyellow: [173, 255, 47],\n honeydew: [240, 255, 240],\n hotpink: [255, 105, 180],\n indianred: [205, 92, 92],\n indigo: [75, 0, 130],\n ivory: [255, 255, 240],\n khaki: [240, 230, 140],\n lavender: [230, 230, 250],\n lavenderblush: [255, 240, 245],\n lawngreen: [124, 252, 0],\n lemonchiffon: [255, 250, 205],\n lightblue: [173, 216, 230],\n lightcoral: [240, 128, 128],\n lightcyan: [224, 255, 255],\n lightgoldenrodyellow: [250, 250, 210],\n lightgray: [211, 211, 211],\n lightgreen: [144, 238, 144],\n lightgrey: [211, 211, 211],\n lightpink: [255, 182, 193],\n lightsalmon: [255, 160, 122],\n lightseagreen: [32, 178, 170],\n lightskyblue: [135, 206, 250],\n lightslategray: [119, 136, 153],\n lightslategrey: [119, 136, 153],\n lightsteelblue: [176, 196, 222],\n lightyellow: [255, 255, 224],\n lime: [0, 255, 0],\n limegreen: [50, 205, 50],\n linen: [250, 240, 230],\n magenta: [255, 0, 255],\n maroon: [128, 0, 0],\n mediumaquamarine: [102, 205, 170],\n mediumblue: [0, 0, 205],\n mediumorchid: [186, 85, 211],\n mediumpurple: [147, 112, 219],\n mediumseagreen: [60, 179, 113],\n mediumslateblue: [123, 104, 238],\n mediumspringgreen: [0, 250, 154],\n mediumturquoise: [72, 209, 204],\n mediumvioletred: [199, 21, 133],\n midnightblue: [25, 25, 112],\n mintcream: [245, 255, 250],\n mistyrose: [255, 228, 225],\n moccasin: [255, 228, 181],\n navajowhite: [255, 222, 173],\n navy: [0, 0, 128],\n oldlace: [253, 245, 230],\n olive: [128, 128, 0],\n olivedrab: [107, 142, 35],\n orange: [255, 165, 0],\n orangered: [255, 69, 0],\n orchid: [218, 112, 214],\n palegoldenrod: [238, 232, 170],\n palegreen: [152, 251, 152],\n paleturquoise: [175, 238, 238],\n palevioletred: [219, 112, 147],\n papayawhip: [255, 239, 213],\n peachpuff: [255, 218, 185],\n peru: [205, 133, 63],\n pink: [255, 192, 203],\n plum: [221, 160, 221],\n powderblue: [176, 224, 230],\n purple: [128, 0, 128],\n red: [255, 0, 0],\n rosybrown: [188, 143, 143],\n royalblue: [65, 105, 225],\n saddlebrown: [139, 69, 19],\n salmon: [250, 128, 114],\n sandybrown: [244, 164, 96],\n seagreen: [46, 139, 87],\n seashell: [255, 245, 238],\n sienna: [160, 82, 45],\n silver: [192, 192, 192],\n skyblue: [135, 206, 235],\n slateblue: [106, 90, 205],\n slategray: [112, 128, 144],\n slategrey: [112, 128, 144],\n snow: [255, 250, 250],\n springgreen: [0, 255, 127],\n steelblue: [70, 130, 180],\n tan: [210, 180, 140],\n teal: [0, 128, 128],\n thistle: [216, 191, 216],\n tomato: [255, 99, 71],\n turquoise: [64, 224, 208],\n violet: [238, 130, 238],\n wheat: [245, 222, 179],\n white: [255, 255, 255],\n whitesmoke: [245, 245, 245],\n yellow: [255, 255, 0],\n yellowgreen: [154, 205, 50]\n};\n\nvar setMap = function setMap(options) {\n var obj = options.map;\n var keys = options.keys;\n var l = keys.length;\n\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n\n if (plainObject(key)) {\n throw Error('Tried to set map with object key');\n }\n\n if (i < keys.length - 1) {\n // extend the map if necessary\n if (obj[key] == null) {\n obj[key] = {};\n }\n\n obj = obj[key];\n } else {\n // set the value\n obj[key] = options.value;\n }\n }\n}; // gets the value in a map even if it's not built in places\n\nvar getMap = function getMap(options) {\n var obj = options.map;\n var keys = options.keys;\n var l = keys.length;\n\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n\n if (plainObject(key)) {\n throw Error('Tried to get map with object key');\n }\n\n obj = obj[key];\n\n if (obj == null) {\n return obj;\n }\n }\n\n return obj;\n}; // deletes the entry in the map\n\nvar performance = window$1 ? window$1.performance : null;\nvar pnow = performance && performance.now ? function () {\n return performance.now();\n} : function () {\n return Date.now();\n};\n\nvar raf = function () {\n if (window$1) {\n if (window$1.requestAnimationFrame) {\n return function (fn) {\n window$1.requestAnimationFrame(fn);\n };\n } else if (window$1.mozRequestAnimationFrame) {\n return function (fn) {\n window$1.mozRequestAnimationFrame(fn);\n };\n } else if (window$1.webkitRequestAnimationFrame) {\n return function (fn) {\n window$1.webkitRequestAnimationFrame(fn);\n };\n } else if (window$1.msRequestAnimationFrame) {\n return function (fn) {\n window$1.msRequestAnimationFrame(fn);\n };\n }\n }\n\n return function (fn) {\n if (fn) {\n setTimeout(function () {\n fn(pnow());\n }, 1000 / 60);\n }\n };\n}();\n\nvar requestAnimationFrame = function requestAnimationFrame(fn) {\n return raf(fn);\n};\nvar performanceNow = pnow;\n\nvar DEFAULT_HASH_SEED = 9261;\nvar K = 65599; // 37 also works pretty well\n\nvar DEFAULT_HASH_SEED_ALT = 5381;\nvar hashIterableInts = function hashIterableInts(iterator) {\n var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_HASH_SEED;\n // sdbm/string-hash\n var hash = seed;\n var entry;\n\n for (;;) {\n entry = iterator.next();\n\n if (entry.done) {\n break;\n }\n\n hash = hash * K + entry.value | 0;\n }\n\n return hash;\n};\nvar hashInt = function hashInt(num) {\n var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_HASH_SEED;\n // sdbm/string-hash\n return seed * K + num | 0;\n};\nvar hashIntAlt = function hashIntAlt(num) {\n var seed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_HASH_SEED_ALT;\n // djb2/string-hash\n return (seed << 5) + seed + num | 0;\n};\nvar combineHashes = function combineHashes(hash1, hash2) {\n return hash1 * 0x200000 + hash2;\n};\nvar combineHashesArray = function combineHashesArray(hashes) {\n return hashes[0] * 0x200000 + hashes[1];\n};\nvar hashArrays = function hashArrays(hashes1, hashes2) {\n return [hashInt(hashes1[0], hashes2[0]), hashIntAlt(hashes1[1], hashes2[1])];\n};\nvar hashIntsArray = function hashIntsArray(ints, seed) {\n var entry = {\n value: 0,\n done: false\n };\n var i = 0;\n var length = ints.length;\n var iterator = {\n next: function next() {\n if (i < length) {\n entry.value = ints[i++];\n } else {\n entry.done = true;\n }\n\n return entry;\n }\n };\n return hashIterableInts(iterator, seed);\n};\nvar hashString = function hashString(str, seed) {\n var entry = {\n value: 0,\n done: false\n };\n var i = 0;\n var length = str.length;\n var iterator = {\n next: function next() {\n if (i < length) {\n entry.value = str.charCodeAt(i++);\n } else {\n entry.done = true;\n }\n\n return entry;\n }\n };\n return hashIterableInts(iterator, seed);\n};\nvar hashStrings = function hashStrings() {\n return hashStringsArray(arguments);\n};\nvar hashStringsArray = function hashStringsArray(strs) {\n var hash;\n\n for (var i = 0; i < strs.length; i++) {\n var str = strs[i];\n\n if (i === 0) {\n hash = hashString(str);\n } else {\n hash = hashString(str, hash);\n }\n }\n\n return hash;\n};\n\n/*global console */\nvar warningsEnabled = true;\nvar warnSupported = console.warn != null; // eslint-disable-line no-console\n\nvar traceSupported = console.trace != null; // eslint-disable-line no-console\n\nvar MAX_INT = Number.MAX_SAFE_INTEGER || 9007199254740991;\nvar trueify = function trueify() {\n return true;\n};\nvar falsify = function falsify() {\n return false;\n};\nvar zeroify = function zeroify() {\n return 0;\n};\nvar noop = function noop() {};\nvar error = function error(msg) {\n throw new Error(msg);\n};\nvar warnings = function warnings(enabled) {\n if (enabled !== undefined) {\n warningsEnabled = !!enabled;\n } else {\n return warningsEnabled;\n }\n};\nvar warn = function warn(msg) {\n /* eslint-disable no-console */\n if (!warnings()) {\n return;\n }\n\n if (warnSupported) {\n console.warn(msg);\n } else {\n console.log(msg);\n\n if (traceSupported) {\n console.trace();\n }\n }\n};\n/* eslint-enable */\n\nvar clone = function clone(obj) {\n return extend({}, obj);\n}; // gets a shallow copy of the argument\n\nvar copy = function copy(obj) {\n if (obj == null) {\n return obj;\n }\n\n if (array(obj)) {\n return obj.slice();\n } else if (plainObject(obj)) {\n return clone(obj);\n } else {\n return obj;\n }\n};\nvar copyArray = function copyArray(arr) {\n return arr.slice();\n};\nvar uuid = function uuid(a, b\n/* placeholders */\n) {\n for ( // loop :)\n b = a = ''; // b - result , a - numeric letiable\n a++ < 36; //\n b += a * 51 & 52 // if \"a\" is not 9 or 14 or 19 or 24\n ? // return a random number or 4\n (a ^ 15 // if \"a\" is not 15\n ? // genetate a random number from 0 to 15\n 8 ^ Math.random() * (a ^ 20 ? 16 : 4) // unless \"a\" is 20, in which case a random number from 8 to 11\n : 4 // otherwise 4\n ).toString(16) : '-' // in other cases (if \"a\" is 9,14,19,24) insert \"-\"\n ) {\n }\n\n return b;\n};\nvar _staticEmptyObject = {};\nvar staticEmptyObject = function staticEmptyObject() {\n return _staticEmptyObject;\n};\nvar defaults = function defaults(_defaults) {\n var keys = Object.keys(_defaults);\n return function (opts) {\n var filledOpts = {};\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var optVal = opts == null ? undefined : opts[key];\n filledOpts[key] = optVal === undefined ? _defaults[key] : optVal;\n }\n\n return filledOpts;\n };\n};\nvar removeFromArray = function removeFromArray(arr, ele, manyCopies) {\n for (var i = arr.length; i >= 0; i--) {\n if (arr[i] === ele) {\n arr.splice(i, 1);\n\n if (!manyCopies) {\n break;\n }\n }\n }\n};\nvar clearArray = function clearArray(arr) {\n arr.splice(0, arr.length);\n};\nvar push = function push(arr, otherArr) {\n for (var i = 0; i < otherArr.length; i++) {\n var el = otherArr[i];\n arr.push(el);\n }\n};\nvar getPrefixedProperty = function getPrefixedProperty(obj, propName, prefix) {\n if (prefix) {\n propName = prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth\n }\n\n return obj[propName];\n};\nvar setPrefixedProperty = function setPrefixedProperty(obj, propName, prefix, value) {\n if (prefix) {\n propName = prependCamel(prefix, propName); // e.g. (labelWidth, source) => sourceLabelWidth\n }\n\n obj[propName] = value;\n};\n\n/* global Map */\nvar ObjectMap =\n/*#__PURE__*/\nfunction () {\n function ObjectMap() {\n _classCallCheck(this, ObjectMap);\n\n this._obj = {};\n }\n\n _createClass(ObjectMap, [{\n key: \"set\",\n value: function set(key, val) {\n this._obj[key] = val;\n return this;\n }\n }, {\n key: \"delete\",\n value: function _delete(key) {\n this._obj[key] = undefined;\n return this;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this._obj = {};\n }\n }, {\n key: \"has\",\n value: function has(key) {\n return this._obj[key] !== undefined;\n }\n }, {\n key: \"get\",\n value: function get(key) {\n return this._obj[key];\n }\n }]);\n\n return ObjectMap;\n}();\n\nvar Map$1 = typeof Map !== 'undefined' ? Map : ObjectMap;\n\n/* global Set */\nvar undef = \"undefined\" ;\n\nvar ObjectSet =\n/*#__PURE__*/\nfunction () {\n function ObjectSet(arrayOrObjectSet) {\n _classCallCheck(this, ObjectSet);\n\n this._obj = Object.create(null);\n this.size = 0;\n\n if (arrayOrObjectSet != null) {\n var arr;\n\n if (arrayOrObjectSet.instanceString != null && arrayOrObjectSet.instanceString() === this.instanceString()) {\n arr = arrayOrObjectSet.toArray();\n } else {\n arr = arrayOrObjectSet;\n }\n\n for (var i = 0; i < arr.length; i++) {\n this.add(arr[i]);\n }\n }\n }\n\n _createClass(ObjectSet, [{\n key: \"instanceString\",\n value: function instanceString() {\n return 'set';\n }\n }, {\n key: \"add\",\n value: function add(val) {\n var o = this._obj;\n\n if (o[val] !== 1) {\n o[val] = 1;\n this.size++;\n }\n }\n }, {\n key: \"delete\",\n value: function _delete(val) {\n var o = this._obj;\n\n if (o[val] === 1) {\n o[val] = 0;\n this.size--;\n }\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this._obj = Object.create(null);\n }\n }, {\n key: \"has\",\n value: function has(val) {\n return this._obj[val] === 1;\n }\n }, {\n key: \"toArray\",\n value: function toArray() {\n var _this = this;\n\n return Object.keys(this._obj).filter(function (key) {\n return _this.has(key);\n });\n }\n }, {\n key: \"forEach\",\n value: function forEach(callback, thisArg) {\n return this.toArray().forEach(callback, thisArg);\n }\n }]);\n\n return ObjectSet;\n}();\n\nvar Set$1 = (typeof Set === \"undefined\" ? \"undefined\" : _typeof(Set)) !== undef ? Set : ObjectSet;\n\nvar Element = function Element(cy, params, restore) {\n restore = restore === undefined || restore ? true : false;\n\n if (cy === undefined || params === undefined || !core(cy)) {\n error('An element must have a core reference and parameters set');\n return;\n }\n\n var group = params.group; // try to automatically infer the group if unspecified\n\n if (group == null) {\n if (params.data && params.data.source != null && params.data.target != null) {\n group = 'edges';\n } else {\n group = 'nodes';\n }\n } // validate group\n\n\n if (group !== 'nodes' && group !== 'edges') {\n error('An element must be of type `nodes` or `edges`; you specified `' + group + '`');\n return;\n } // make the element array-like, just like a collection\n\n\n this.length = 1;\n this[0] = this; // NOTE: when something is added here, add also to ele.json()\n\n var _p = this._private = {\n cy: cy,\n single: true,\n // indicates this is an element\n data: params.data || {},\n // data object\n position: params.position || {\n x: 0,\n y: 0\n },\n // (x, y) position pair\n autoWidth: undefined,\n // width and height of nodes calculated by the renderer when set to special 'auto' value\n autoHeight: undefined,\n autoPadding: undefined,\n compoundBoundsClean: false,\n // whether the compound dimensions need to be recalculated the next time dimensions are read\n listeners: [],\n // array of bound listeners\n group: group,\n // string; 'nodes' or 'edges'\n style: {},\n // properties as set by the style\n rstyle: {},\n // properties for style sent from the renderer to the core\n styleCxts: [],\n // applied style contexts from the styler\n styleKeys: {},\n // per-group keys of style property values\n removed: true,\n // whether it's inside the vis; true if removed (set true here since we call restore)\n selected: params.selected ? true : false,\n // whether it's selected\n selectable: params.selectable === undefined ? true : params.selectable ? true : false,\n // whether it's selectable\n locked: params.locked ? true : false,\n // whether the element is locked (cannot be moved)\n grabbed: false,\n // whether the element is grabbed by the mouse; renderer sets this privately\n grabbable: params.grabbable === undefined ? true : params.grabbable ? true : false,\n // whether the element can be grabbed\n pannable: params.pannable === undefined ? group === 'edges' ? true : false : params.pannable ? true : false,\n // whether the element has passthrough panning enabled\n active: false,\n // whether the element is active from user interaction\n classes: new Set$1(),\n // map ( className => true )\n animation: {\n // object for currently-running animations\n current: [],\n queue: []\n },\n rscratch: {},\n // object in which the renderer can store information\n scratch: params.scratch || {},\n // scratch objects\n edges: [],\n // array of connected edges\n children: [],\n // array of children\n parent: null,\n // parent ref\n traversalCache: {},\n // cache of output of traversal functions\n backgrounding: false,\n // whether background images are loading\n bbCache: null,\n // cache of the current bounding box\n bbCacheShift: {\n x: 0,\n y: 0\n },\n // shift applied to cached bb to be applied on next get\n bodyBounds: null,\n // bounds cache of element body, w/o overlay\n overlayBounds: null,\n // bounds cache of element body, including overlay\n labelBounds: {\n // bounds cache of labels\n all: null,\n source: null,\n target: null,\n main: null\n },\n arrowBounds: {\n // bounds cache of edge arrows\n source: null,\n target: null,\n 'mid-source': null,\n 'mid-target': null\n }\n };\n\n if (_p.position.x == null) {\n _p.position.x = 0;\n }\n\n if (_p.position.y == null) {\n _p.position.y = 0;\n } // renderedPosition overrides if specified\n\n\n if (params.renderedPosition) {\n var rpos = params.renderedPosition;\n var pan = cy.pan();\n var zoom = cy.zoom();\n _p.position = {\n x: (rpos.x - pan.x) / zoom,\n y: (rpos.y - pan.y) / zoom\n };\n }\n\n var classes = [];\n\n if (array(params.classes)) {\n classes = params.classes;\n } else if (string(params.classes)) {\n classes = params.classes.split(/\\s+/);\n }\n\n for (var i = 0, l = classes.length; i < l; i++) {\n var cls = classes[i];\n\n if (!cls || cls === '') {\n continue;\n }\n\n _p.classes.add(cls);\n }\n\n this.createEmitter();\n var bypass = params.style || params.css;\n\n if (bypass) {\n warn('Setting a `style` bypass at element creation is deprecated');\n this.style(bypass);\n }\n\n if (restore === undefined || restore) {\n this.restore();\n }\n};\n\nvar defineSearch = function defineSearch(params) {\n params = {\n bfs: params.bfs || !params.dfs,\n dfs: params.dfs || !params.bfs\n }; // from pseudocode on wikipedia\n\n return function searchFn(roots, fn$1, directed) {\n var options;\n\n if (plainObject(roots) && !elementOrCollection(roots)) {\n options = roots;\n roots = options.roots || options.root;\n fn$1 = options.visit;\n directed = options.directed;\n }\n\n directed = arguments.length === 2 && !fn(fn$1) ? fn$1 : directed;\n fn$1 = fn(fn$1) ? fn$1 : function () {};\n var cy = this._private.cy;\n var v = roots = string(roots) ? this.filter(roots) : roots;\n var Q = [];\n var connectedNodes = [];\n var connectedBy = {};\n var id2depth = {};\n var V = {};\n var j = 0;\n var found;\n\n var _this$byGroup = this.byGroup(),\n nodes = _this$byGroup.nodes,\n edges = _this$byGroup.edges; // enqueue v\n\n\n for (var i = 0; i < v.length; i++) {\n var vi = v[i];\n var viId = vi.id();\n\n if (vi.isNode()) {\n Q.unshift(vi);\n\n if (params.bfs) {\n V[viId] = true;\n connectedNodes.push(vi);\n }\n\n id2depth[viId] = 0;\n }\n }\n\n var _loop2 = function _loop2() {\n var v = params.bfs ? Q.shift() : Q.pop();\n var vId = v.id();\n\n if (params.dfs) {\n if (V[vId]) {\n return \"continue\";\n }\n\n V[vId] = true;\n connectedNodes.push(v);\n }\n\n var depth = id2depth[vId];\n var prevEdge = connectedBy[vId];\n var src = prevEdge != null ? prevEdge.source() : null;\n var tgt = prevEdge != null ? prevEdge.target() : null;\n var prevNode = prevEdge == null ? undefined : v.same(src) ? tgt[0] : src[0];\n var ret = void 0;\n ret = fn$1(v, prevEdge, prevNode, j++, depth);\n\n if (ret === true) {\n found = v;\n return \"break\";\n }\n\n if (ret === false) {\n return \"break\";\n }\n\n var vwEdges = v.connectedEdges().filter(function (e) {\n return (!directed || e.source().same(v)) && edges.has(e);\n });\n\n for (var _i2 = 0; _i2 < vwEdges.length; _i2++) {\n var e = vwEdges[_i2];\n var w = e.connectedNodes().filter(function (n) {\n return !n.same(v) && nodes.has(n);\n });\n var wId = w.id();\n\n if (w.length !== 0 && !V[wId]) {\n w = w[0];\n Q.push(w);\n\n if (params.bfs) {\n V[wId] = true;\n connectedNodes.push(w);\n }\n\n connectedBy[wId] = e;\n id2depth[wId] = id2depth[vId] + 1;\n }\n }\n };\n\n _loop: while (Q.length !== 0) {\n var _ret = _loop2();\n\n switch (_ret) {\n case \"continue\":\n continue;\n\n case \"break\":\n break _loop;\n }\n }\n\n var connectedEles = cy.collection();\n\n for (var _i = 0; _i < connectedNodes.length; _i++) {\n var node = connectedNodes[_i];\n var edge = connectedBy[node.id()];\n\n if (edge != null) {\n connectedEles.merge(edge);\n }\n\n connectedEles.merge(node);\n }\n\n return {\n path: cy.collection(connectedEles),\n found: cy.collection(found)\n };\n };\n}; // search, spanning trees, etc\n\n\nvar elesfn = {\n breadthFirstSearch: defineSearch({\n bfs: true\n }),\n depthFirstSearch: defineSearch({\n dfs: true\n })\n}; // nice, short mathemathical alias\n\nelesfn.bfs = elesfn.breadthFirstSearch;\nelesfn.dfs = elesfn.depthFirstSearch;\n\nvar dijkstraDefaults = defaults({\n root: null,\n weight: function weight(edge) {\n return 1;\n },\n directed: false\n});\nvar elesfn$1 = {\n dijkstra: function dijkstra(options) {\n if (!plainObject(options)) {\n var args = arguments;\n options = {\n root: args[0],\n weight: args[1],\n directed: args[2]\n };\n }\n\n var _dijkstraDefaults = dijkstraDefaults(options),\n root = _dijkstraDefaults.root,\n weight = _dijkstraDefaults.weight,\n directed = _dijkstraDefaults.directed;\n\n var eles = this;\n var weightFn = weight;\n var source = string(root) ? this.filter(root)[0] : root[0];\n var dist = {};\n var prev = {};\n var knownDist = {};\n\n var _this$byGroup = this.byGroup(),\n nodes = _this$byGroup.nodes,\n edges = _this$byGroup.edges;\n\n edges.unmergeBy(function (ele) {\n return ele.isLoop();\n });\n\n var getDist = function getDist(node) {\n return dist[node.id()];\n };\n\n var setDist = function setDist(node, d) {\n dist[node.id()] = d;\n Q.updateItem(node);\n };\n\n var Q = new Heap(function (a, b) {\n return getDist(a) - getDist(b);\n });\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n dist[node.id()] = node.same(source) ? 0 : Infinity;\n Q.push(node);\n }\n\n var distBetween = function distBetween(u, v) {\n var uvs = (directed ? u.edgesTo(v) : u.edgesWith(v)).intersect(edges);\n var smallestDistance = Infinity;\n var smallestEdge;\n\n for (var _i = 0; _i < uvs.length; _i++) {\n var edge = uvs[_i];\n\n var _weight = weightFn(edge);\n\n if (_weight < smallestDistance || !smallestEdge) {\n smallestDistance = _weight;\n smallestEdge = edge;\n }\n }\n\n return {\n edge: smallestEdge,\n dist: smallestDistance\n };\n };\n\n while (Q.size() > 0) {\n var u = Q.pop();\n var smalletsDist = getDist(u);\n var uid = u.id();\n knownDist[uid] = smalletsDist;\n\n if (smalletsDist === Infinity) {\n continue;\n }\n\n var neighbors = u.neighborhood().intersect(nodes);\n\n for (var _i2 = 0; _i2 < neighbors.length; _i2++) {\n var v = neighbors[_i2];\n var vid = v.id();\n var vDist = distBetween(u, v);\n var alt = smalletsDist + vDist.dist;\n\n if (alt < getDist(v)) {\n setDist(v, alt);\n prev[vid] = {\n node: u,\n edge: vDist.edge\n };\n }\n } // for\n\n } // while\n\n\n return {\n distanceTo: function distanceTo(node) {\n var target = string(node) ? nodes.filter(node)[0] : node[0];\n return knownDist[target.id()];\n },\n pathTo: function pathTo(node) {\n var target = string(node) ? nodes.filter(node)[0] : node[0];\n var S = [];\n var u = target;\n var uid = u.id();\n\n if (target.length > 0) {\n S.unshift(target);\n\n while (prev[uid]) {\n var p = prev[uid];\n S.unshift(p.edge);\n S.unshift(p.node);\n u = p.node;\n uid = u.id();\n }\n }\n\n return eles.spawn(S);\n }\n };\n }\n};\n\nvar elesfn$2 = {\n // kruskal's algorithm (finds min spanning tree, assuming undirected graph)\n // implemented from pseudocode from wikipedia\n kruskal: function kruskal(weightFn) {\n weightFn = weightFn || function (edge) {\n return 1;\n };\n\n var _this$byGroup = this.byGroup(),\n nodes = _this$byGroup.nodes,\n edges = _this$byGroup.edges;\n\n var numNodes = nodes.length;\n var forest = new Array(numNodes);\n var A = nodes; // assumes byGroup() creates new collections that can be safely mutated\n\n var findSetIndex = function findSetIndex(ele) {\n for (var i = 0; i < forest.length; i++) {\n var eles = forest[i];\n\n if (eles.has(ele)) {\n return i;\n }\n }\n }; // start with one forest per node\n\n\n for (var i = 0; i < numNodes; i++) {\n forest[i] = this.spawn(nodes[i]);\n }\n\n var S = edges.sort(function (a, b) {\n return weightFn(a) - weightFn(b);\n });\n\n for (var _i = 0; _i < S.length; _i++) {\n var edge = S[_i];\n var u = edge.source()[0];\n var v = edge.target()[0];\n var setUIndex = findSetIndex(u);\n var setVIndex = findSetIndex(v);\n var setU = forest[setUIndex];\n var setV = forest[setVIndex];\n\n if (setUIndex !== setVIndex) {\n A.merge(edge); // combine forests for u and v\n\n setU.merge(setV);\n forest.splice(setVIndex, 1);\n }\n }\n\n return A;\n }\n};\n\nvar aStarDefaults = defaults({\n root: null,\n goal: null,\n weight: function weight(edge) {\n return 1;\n },\n heuristic: function heuristic(edge) {\n return 0;\n },\n directed: false\n});\nvar elesfn$3 = {\n // Implemented from pseudocode from wikipedia\n aStar: function aStar(options) {\n var cy = this.cy();\n\n var _aStarDefaults = aStarDefaults(options),\n root = _aStarDefaults.root,\n goal = _aStarDefaults.goal,\n heuristic = _aStarDefaults.heuristic,\n directed = _aStarDefaults.directed,\n weight = _aStarDefaults.weight;\n\n root = cy.collection(root)[0];\n goal = cy.collection(goal)[0];\n var sid = root.id();\n var tid = goal.id();\n var gScore = {};\n var fScore = {};\n var closedSetIds = {};\n var openSet = new Heap(function (a, b) {\n return fScore[a.id()] - fScore[b.id()];\n });\n var openSetIds = new Set$1();\n var cameFrom = {};\n var cameFromEdge = {};\n\n var addToOpenSet = function addToOpenSet(ele, id) {\n openSet.push(ele);\n openSetIds.add(id);\n };\n\n var cMin, cMinId;\n\n var popFromOpenSet = function popFromOpenSet() {\n cMin = openSet.pop();\n cMinId = cMin.id();\n openSetIds[\"delete\"](cMinId);\n };\n\n var isInOpenSet = function isInOpenSet(id) {\n return openSetIds.has(id);\n };\n\n addToOpenSet(root, sid);\n gScore[sid] = 0;\n fScore[sid] = heuristic(root); // Counter\n\n var steps = 0; // Main loop\n\n while (openSet.size() > 0) {\n popFromOpenSet();\n steps++; // If we've found our goal, then we are done\n\n if (cMinId === tid) {\n var path = [];\n var pathNode = goal;\n var pathNodeId = tid;\n var pathEdge = cameFromEdge[pathNodeId];\n\n for (;;) {\n path.unshift(pathNode);\n\n if (pathEdge != null) {\n path.unshift(pathEdge);\n }\n\n pathNode = cameFrom[pathNodeId];\n\n if (pathNode == null) {\n break;\n }\n\n pathNodeId = pathNode.id();\n pathEdge = cameFromEdge[pathNodeId];\n }\n\n return {\n found: true,\n distance: gScore[cMinId],\n path: this.spawn(path),\n steps: steps\n };\n } // Add cMin to processed nodes\n\n\n closedSetIds[cMinId] = true; // Update scores for neighbors of cMin\n // Take into account if graph is directed or not\n\n var vwEdges = cMin._private.edges;\n\n for (var i = 0; i < vwEdges.length; i++) {\n var e = vwEdges[i]; // edge must be in set of calling eles\n\n if (!this.hasElementWithId(e.id())) {\n continue;\n } // cMin must be the source of edge if directed\n\n\n if (directed && e.data('source') !== cMinId) {\n continue;\n }\n\n var wSrc = e.source();\n var wTgt = e.target();\n var w = wSrc.id() !== cMinId ? wSrc : wTgt;\n var wid = w.id(); // node must be in set of calling eles\n\n if (!this.hasElementWithId(wid)) {\n continue;\n } // if node is in closedSet, ignore it\n\n\n if (closedSetIds[wid]) {\n continue;\n } // New tentative score for node w\n\n\n var tempScore = gScore[cMinId] + weight(e); // Update gScore for node w if:\n // w not present in openSet\n // OR\n // tentative gScore is less than previous value\n // w not in openSet\n\n if (!isInOpenSet(wid)) {\n gScore[wid] = tempScore;\n fScore[wid] = tempScore + heuristic(w);\n addToOpenSet(w, wid);\n cameFrom[wid] = cMin;\n cameFromEdge[wid] = e;\n continue;\n } // w already in openSet, but with greater gScore\n\n\n if (tempScore < gScore[wid]) {\n gScore[wid] = tempScore;\n fScore[wid] = tempScore + heuristic(w);\n cameFrom[wid] = cMin;\n }\n } // End of neighbors update\n\n } // End of main loop\n // If we've reached here, then we've not reached our goal\n\n\n return {\n found: false,\n distance: undefined,\n path: undefined,\n steps: steps\n };\n }\n}; // elesfn\n\nvar floydWarshallDefaults = defaults({\n weight: function weight(edge) {\n return 1;\n },\n directed: false\n});\nvar elesfn$4 = {\n // Implemented from pseudocode from wikipedia\n floydWarshall: function floydWarshall(options) {\n var cy = this.cy();\n\n var _floydWarshallDefault = floydWarshallDefaults(options),\n weight = _floydWarshallDefault.weight,\n directed = _floydWarshallDefault.directed;\n\n var weightFn = weight;\n\n var _this$byGroup = this.byGroup(),\n nodes = _this$byGroup.nodes,\n edges = _this$byGroup.edges;\n\n var N = nodes.length;\n var Nsq = N * N;\n\n var indexOf = function indexOf(node) {\n return nodes.indexOf(node);\n };\n\n var atIndex = function atIndex(i) {\n return nodes[i];\n }; // Initialize distance matrix\n\n\n var dist = new Array(Nsq);\n\n for (var n = 0; n < Nsq; n++) {\n var j = n % N;\n var i = (n - j) / N;\n\n if (i === j) {\n dist[n] = 0;\n } else {\n dist[n] = Infinity;\n }\n } // Initialize matrix used for path reconstruction\n // Initialize distance matrix\n\n\n var next = new Array(Nsq);\n var edgeNext = new Array(Nsq); // Process edges\n\n for (var _i = 0; _i < edges.length; _i++) {\n var edge = edges[_i];\n var src = edge.source()[0];\n var tgt = edge.target()[0];\n\n if (src === tgt) {\n continue;\n } // exclude loops\n\n\n var s = indexOf(src);\n var t = indexOf(tgt);\n var st = s * N + t; // source to target index\n\n var _weight = weightFn(edge); // Check if already process another edge between same 2 nodes\n\n\n if (dist[st] > _weight) {\n dist[st] = _weight;\n next[st] = t;\n edgeNext[st] = edge;\n } // If undirected graph, process 'reversed' edge\n\n\n if (!directed) {\n var ts = t * N + s; // target to source index\n\n if (!directed && dist[ts] > _weight) {\n dist[ts] = _weight;\n next[ts] = s;\n edgeNext[ts] = edge;\n }\n }\n } // Main loop\n\n\n for (var k = 0; k < N; k++) {\n for (var _i2 = 0; _i2 < N; _i2++) {\n var ik = _i2 * N + k;\n\n for (var _j = 0; _j < N; _j++) {\n var ij = _i2 * N + _j;\n var kj = k * N + _j;\n\n if (dist[ik] + dist[kj] < dist[ij]) {\n dist[ij] = dist[ik] + dist[kj];\n next[ij] = next[ik];\n }\n }\n }\n }\n\n var getArgEle = function getArgEle(ele) {\n return (string(ele) ? cy.filter(ele) : ele)[0];\n };\n\n var indexOfArgEle = function indexOfArgEle(ele) {\n return indexOf(getArgEle(ele));\n };\n\n var res = {\n distance: function distance(from, to) {\n var i = indexOfArgEle(from);\n var j = indexOfArgEle(to);\n return dist[i * N + j];\n },\n path: function path(from, to) {\n var i = indexOfArgEle(from);\n var j = indexOfArgEle(to);\n var fromNode = atIndex(i);\n\n if (i === j) {\n return fromNode.collection();\n }\n\n if (next[i * N + j] == null) {\n return cy.collection();\n }\n\n var path = cy.collection();\n var prev = i;\n var edge;\n path.merge(fromNode);\n\n while (i !== j) {\n prev = i;\n i = next[i * N + j];\n edge = edgeNext[prev * N + i];\n path.merge(edge);\n path.merge(atIndex(i));\n }\n\n return path;\n }\n };\n return res;\n } // floydWarshall\n\n}; // elesfn\n\nvar bellmanFordDefaults = defaults({\n weight: function weight(edge) {\n return 1;\n },\n directed: false,\n root: null\n});\nvar elesfn$5 = {\n // Implemented from pseudocode from wikipedia\n bellmanFord: function bellmanFord(options) {\n var _this = this;\n\n var _bellmanFordDefaults = bellmanFordDefaults(options),\n weight = _bellmanFordDefaults.weight,\n directed = _bellmanFordDefaults.directed,\n root = _bellmanFordDefaults.root;\n\n var weightFn = weight;\n var eles = this;\n var cy = this.cy();\n\n var _this$byGroup = this.byGroup(),\n edges = _this$byGroup.edges,\n nodes = _this$byGroup.nodes;\n\n var numNodes = nodes.length;\n var infoMap = new Map$1();\n var hasNegativeWeightCycle = false;\n var negativeWeightCycles = [];\n root = cy.collection(root)[0]; // in case selector passed\n\n edges.unmergeBy(function (edge) {\n return edge.isLoop();\n });\n var numEdges = edges.length;\n\n var getInfo = function getInfo(node) {\n var obj = infoMap.get(node.id());\n\n if (!obj) {\n obj = {};\n infoMap.set(node.id(), obj);\n }\n\n return obj;\n };\n\n var getNodeFromTo = function getNodeFromTo(to) {\n return (string(to) ? cy.$(to) : to)[0];\n };\n\n var distanceTo = function distanceTo(to) {\n return getInfo(getNodeFromTo(to)).dist;\n };\n\n var pathTo = function pathTo(to) {\n var thisStart = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : root;\n var end = getNodeFromTo(to);\n var path = [];\n var node = end;\n\n for (;;) {\n if (node == null) {\n return _this.spawn();\n }\n\n var _getInfo = getInfo(node),\n edge = _getInfo.edge,\n pred = _getInfo.pred;\n\n path.unshift(node[0]);\n\n if (node.same(thisStart) && path.length > 0) {\n break;\n }\n\n if (edge != null) {\n path.unshift(edge);\n }\n\n node = pred;\n }\n\n return eles.spawn(path);\n }; // Initializations { dist, pred, edge }\n\n\n for (var i = 0; i < numNodes; i++) {\n var node = nodes[i];\n var info = getInfo(node);\n\n if (node.same(root)) {\n info.dist = 0;\n } else {\n info.dist = Infinity;\n }\n\n info.pred = null;\n info.edge = null;\n } // Edges relaxation\n\n\n var replacedEdge = false;\n\n var checkForEdgeReplacement = function checkForEdgeReplacement(node1, node2, edge, info1, info2, weight) {\n var dist = info1.dist + weight;\n\n if (dist < info2.dist && !edge.same(info1.edge)) {\n info2.dist = dist;\n info2.pred = node1;\n info2.edge = edge;\n replacedEdge = true;\n }\n };\n\n for (var _i = 1; _i < numNodes; _i++) {\n replacedEdge = false;\n\n for (var e = 0; e < numEdges; e++) {\n var edge = edges[e];\n var src = edge.source();\n var tgt = edge.target();\n\n var _weight = weightFn(edge);\n\n var srcInfo = getInfo(src);\n var tgtInfo = getInfo(tgt);\n checkForEdgeReplacement(src, tgt, edge, srcInfo, tgtInfo, _weight); // If undirected graph, we need to take into account the 'reverse' edge\n\n if (!directed) {\n checkForEdgeReplacement(tgt, src, edge, tgtInfo, srcInfo, _weight);\n }\n }\n\n if (!replacedEdge) {\n break;\n }\n }\n\n if (replacedEdge) {\n // Check for negative weight cycles\n for (var _e = 0; _e < numEdges; _e++) {\n var _edge = edges[_e];\n\n var _src = _edge.source();\n\n var _tgt = _edge.target();\n\n var _weight2 = weightFn(_edge);\n\n var srcDist = getInfo(_src).dist;\n var tgtDist = getInfo(_tgt).dist;\n\n if (srcDist + _weight2 < tgtDist || !directed && tgtDist + _weight2 < srcDist) {\n warn('Graph contains a negative weight cycle for Bellman-Ford');\n hasNegativeWeightCycle = true;\n break;\n }\n }\n }\n\n return {\n distanceTo: distanceTo,\n pathTo: pathTo,\n hasNegativeWeightCycle: hasNegativeWeightCycle,\n negativeWeightCycles: negativeWeightCycles\n };\n } // bellmanFord\n\n}; // elesfn\n\nvar sqrt2 = Math.sqrt(2); // Function which colapses 2 (meta) nodes into one\n// Updates the remaining edge lists\n// Receives as a paramater the edge which causes the collapse\n\nvar collapse = function collapse(edgeIndex, nodeMap, remainingEdges) {\n if (remainingEdges.length === 0) {\n error(\"Karger-Stein must be run on a connected (sub)graph\");\n }\n\n var edgeInfo = remainingEdges[edgeIndex];\n var sourceIn = edgeInfo[1];\n var targetIn = edgeInfo[2];\n var partition1 = nodeMap[sourceIn];\n var partition2 = nodeMap[targetIn];\n var newEdges = remainingEdges; // re-use array\n // Delete all edges between partition1 and partition2\n\n for (var i = newEdges.length - 1; i >= 0; i--) {\n var edge = newEdges[i];\n var src = edge[1];\n var tgt = edge[2];\n\n if (nodeMap[src] === partition1 && nodeMap[tgt] === partition2 || nodeMap[src] === partition2 && nodeMap[tgt] === partition1) {\n newEdges.splice(i, 1);\n }\n } // All edges pointing to partition2 should now point to partition1\n\n\n for (var _i = 0; _i < newEdges.length; _i++) {\n var _edge = newEdges[_i];\n\n if (_edge[1] === partition2) {\n // Check source\n newEdges[_i] = _edge.slice(); // copy\n\n newEdges[_i][1] = partition1;\n } else if (_edge[2] === partition2) {\n // Check target\n newEdges[_i] = _edge.slice(); // copy\n\n newEdges[_i][2] = partition1;\n }\n } // Move all nodes from partition2 to partition1\n\n\n for (var _i2 = 0; _i2 < nodeMap.length; _i2++) {\n if (nodeMap[_i2] === partition2) {\n nodeMap[_i2] = partition1;\n }\n }\n\n return newEdges;\n}; // Contracts a graph until we reach a certain number of meta nodes\n\n\nvar contractUntil = function contractUntil(metaNodeMap, remainingEdges, size, sizeLimit) {\n while (size > sizeLimit) {\n // Choose an edge randomly\n var edgeIndex = Math.floor(Math.random() * remainingEdges.length); // Collapse graph based on edge\n\n remainingEdges = collapse(edgeIndex, metaNodeMap, remainingEdges);\n size--;\n }\n\n return remainingEdges;\n};\n\nvar elesfn$6 = {\n // Computes the minimum cut of an undirected graph\n // Returns the correct answer with high probability\n kargerStein: function kargerStein() {\n var _this = this;\n\n var _this$byGroup = this.byGroup(),\n nodes = _this$byGroup.nodes,\n edges = _this$byGroup.edges;\n\n edges.unmergeBy(function (edge) {\n return edge.isLoop();\n });\n var numNodes = nodes.length;\n var numEdges = edges.length;\n var numIter = Math.ceil(Math.pow(Math.log(numNodes) / Math.LN2, 2));\n var stopSize = Math.floor(numNodes / sqrt2);\n\n if (numNodes < 2) {\n error('At least 2 nodes are required for Karger-Stein algorithm');\n return undefined;\n } // Now store edge destination as indexes\n // Format for each edge (edge index, source node index, target node index)\n\n\n var edgeIndexes = [];\n\n for (var i = 0; i < numEdges; i++) {\n var e = edges[i];\n edgeIndexes.push([i, nodes.indexOf(e.source()), nodes.indexOf(e.target())]);\n } // We will store the best cut found here\n\n\n var minCutSize = Infinity;\n var minCutEdgeIndexes = [];\n var minCutNodeMap = new Array(numNodes); // Initial meta node partition\n\n var metaNodeMap = new Array(numNodes);\n var metaNodeMap2 = new Array(numNodes);\n\n var copyNodesMap = function copyNodesMap(from, to) {\n for (var _i3 = 0; _i3 < numNodes; _i3++) {\n to[_i3] = from[_i3];\n }\n }; // Main loop\n\n\n for (var iter = 0; iter <= numIter; iter++) {\n // Reset meta node partition\n for (var _i4 = 0; _i4 < numNodes; _i4++) {\n metaNodeMap[_i4] = _i4;\n } // Contract until stop point (stopSize nodes)\n\n\n var edgesState = contractUntil(metaNodeMap, edgeIndexes.slice(), numNodes, stopSize);\n var edgesState2 = edgesState.slice(); // copy\n // Create a copy of the colapsed nodes state\n\n copyNodesMap(metaNodeMap, metaNodeMap2); // Run 2 iterations starting in the stop state\n\n var res1 = contractUntil(metaNodeMap, edgesState, stopSize, 2);\n var res2 = contractUntil(metaNodeMap2, edgesState2, stopSize, 2); // Is any of the 2 results the best cut so far?\n\n if (res1.length <= res2.length && res1.length < minCutSize) {\n minCutSize = res1.length;\n minCutEdgeIndexes = res1;\n copyNodesMap(metaNodeMap, minCutNodeMap);\n } else if (res2.length <= res1.length && res2.length < minCutSize) {\n minCutSize = res2.length;\n minCutEdgeIndexes = res2;\n copyNodesMap(metaNodeMap2, minCutNodeMap);\n }\n } // end of main loop\n // Construct result\n\n\n var cut = this.spawn(minCutEdgeIndexes.map(function (e) {\n return edges[e[0]];\n }));\n var partition1 = this.spawn();\n var partition2 = this.spawn(); // traverse metaNodeMap for best cut\n\n var witnessNodePartition = minCutNodeMap[0];\n\n for (var _i5 = 0; _i5 < minCutNodeMap.length; _i5++) {\n var partitionId = minCutNodeMap[_i5];\n var node = nodes[_i5];\n\n if (partitionId === witnessNodePartition) {\n partition1.merge(node);\n } else {\n partition2.merge(node);\n }\n } // construct components corresponding to each disjoint subset of nodes\n\n\n var constructComponent = function constructComponent(subset) {\n var component = _this.spawn();\n\n subset.forEach(function (node) {\n component.merge(node);\n node.connectedEdges().forEach(function (edge) {\n // ensure edge is within calling collection and edge is not in cut\n if (_this.contains(edge) && !cut.contains(edge)) {\n component.merge(edge);\n }\n });\n });\n return component;\n };\n\n var components = [constructComponent(partition1), constructComponent(partition2)];\n var ret = {\n cut: cut,\n components: components,\n // n.b. partitions are included to be compatible with the old api spec\n // (could be removed in a future major version)\n partition1: partition1,\n partition2: partition2\n };\n return ret;\n }\n}; // elesfn\n\nvar copyPosition = function copyPosition(p) {\n return {\n x: p.x,\n y: p.y\n };\n};\nvar modelToRenderedPosition = function modelToRenderedPosition(p, zoom, pan) {\n return {\n x: p.x * zoom + pan.x,\n y: p.y * zoom + pan.y\n };\n};\nvar renderedToModelPosition = function renderedToModelPosition(p, zoom, pan) {\n return {\n x: (p.x - pan.x) / zoom,\n y: (p.y - pan.y) / zoom\n };\n};\nvar array2point = function array2point(arr) {\n return {\n x: arr[0],\n y: arr[1]\n };\n};\nvar min = function min(arr) {\n var begin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : arr.length;\n var min = Infinity;\n\n for (var i = begin; i < end; i++) {\n var val = arr[i];\n\n if (isFinite(val)) {\n min = Math.min(val, min);\n }\n }\n\n return min;\n};\nvar max = function max(arr) {\n var begin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : arr.length;\n var max = -Infinity;\n\n for (var i = begin; i < end; i++) {\n var val = arr[i];\n\n if (isFinite(val)) {\n max = Math.max(val, max);\n }\n }\n\n return max;\n};\nvar mean = function mean(arr) {\n var begin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : arr.length;\n var total = 0;\n var n = 0;\n\n for (var i = begin; i < end; i++) {\n var val = arr[i];\n\n if (isFinite(val)) {\n total += val;\n n++;\n }\n }\n\n return total / n;\n};\nvar median = function median(arr) {\n var begin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : arr.length;\n var copy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var sort = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var includeHoles = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n\n if (copy) {\n arr = arr.slice(begin, end);\n } else {\n if (end < arr.length) {\n arr.splice(end, arr.length - end);\n }\n\n if (begin > 0) {\n arr.splice(0, begin);\n }\n } // all non finite (e.g. Infinity, NaN) elements must be -Infinity so they go to the start\n\n\n var off = 0; // offset from non-finite values\n\n for (var i = arr.length - 1; i >= 0; i--) {\n var v = arr[i];\n\n if (includeHoles) {\n if (!isFinite(v)) {\n arr[i] = -Infinity;\n off++;\n }\n } else {\n // just remove it if we don't want to consider holes\n arr.splice(i, 1);\n }\n }\n\n if (sort) {\n arr.sort(function (a, b) {\n return a - b;\n }); // requires copy = true if you don't want to change the orig\n }\n\n var len = arr.length;\n var mid = Math.floor(len / 2);\n\n if (len % 2 !== 0) {\n return arr[mid + 1 + off];\n } else {\n return (arr[mid - 1 + off] + arr[mid + off]) / 2;\n }\n};\nvar deg2rad = function deg2rad(deg) {\n return Math.PI * deg / 180;\n};\nvar getAngleFromDisp = function getAngleFromDisp(dispX, dispY) {\n return Math.atan2(dispY, dispX) - Math.PI / 2;\n};\nvar log2 = Math.log2 || function (n) {\n return Math.log(n) / Math.log(2);\n};\nvar signum = function signum(x) {\n if (x > 0) {\n return 1;\n } else if (x < 0) {\n return -1;\n } else {\n return 0;\n }\n};\nvar dist = function dist(p1, p2) {\n return Math.sqrt(sqdist(p1, p2));\n};\nvar sqdist = function sqdist(p1, p2) {\n var dx = p2.x - p1.x;\n var dy = p2.y - p1.y;\n return dx * dx + dy * dy;\n};\nvar inPlaceSumNormalize = function inPlaceSumNormalize(v) {\n var length = v.length; // First, get sum of all elements\n\n var total = 0;\n\n for (var i = 0; i < length; i++) {\n total += v[i];\n } // Now, divide each by the sum of all elements\n\n\n for (var _i = 0; _i < length; _i++) {\n v[_i] = v[_i] / total;\n }\n\n return v;\n};\n\nvar qbezierAt = function qbezierAt(p0, p1, p2, t) {\n return (1 - t) * (1 - t) * p0 + 2 * (1 - t) * t * p1 + t * t * p2;\n};\nvar qbezierPtAt = function qbezierPtAt(p0, p1, p2, t) {\n return {\n x: qbezierAt(p0.x, p1.x, p2.x, t),\n y: qbezierAt(p0.y, p1.y, p2.y, t)\n };\n};\nvar lineAt = function lineAt(p0, p1, t, d) {\n var vec = {\n x: p1.x - p0.x,\n y: p1.y - p0.y\n };\n var vecDist = dist(p0, p1);\n var normVec = {\n x: vec.x / vecDist,\n y: vec.y / vecDist\n };\n t = t == null ? 0 : t;\n d = d != null ? d : t * vecDist;\n return {\n x: p0.x + normVec.x * d,\n y: p0.y + normVec.y * d\n };\n};\nvar bound = function bound(min, val, max) {\n return Math.max(min, Math.min(max, val));\n}; // makes a full bb (x1, y1, x2, y2, w, h) from implicit params\n\nvar makeBoundingBox = function makeBoundingBox(bb) {\n if (bb == null) {\n return {\n x1: Infinity,\n y1: Infinity,\n x2: -Infinity,\n y2: -Infinity,\n w: 0,\n h: 0\n };\n } else if (bb.x1 != null && bb.y1 != null) {\n if (bb.x2 != null && bb.y2 != null && bb.x2 >= bb.x1 && bb.y2 >= bb.y1) {\n return {\n x1: bb.x1,\n y1: bb.y1,\n x2: bb.x2,\n y2: bb.y2,\n w: bb.x2 - bb.x1,\n h: bb.y2 - bb.y1\n };\n } else if (bb.w != null && bb.h != null && bb.w >= 0 && bb.h >= 0) {\n return {\n x1: bb.x1,\n y1: bb.y1,\n x2: bb.x1 + bb.w,\n y2: bb.y1 + bb.h,\n w: bb.w,\n h: bb.h\n };\n }\n }\n};\nvar copyBoundingBox = function copyBoundingBox(bb) {\n return {\n x1: bb.x1,\n x2: bb.x2,\n w: bb.w,\n y1: bb.y1,\n y2: bb.y2,\n h: bb.h\n };\n};\nvar clearBoundingBox = function clearBoundingBox(bb) {\n bb.x1 = Infinity;\n bb.y1 = Infinity;\n bb.x2 = -Infinity;\n bb.y2 = -Infinity;\n bb.w = 0;\n bb.h = 0;\n};\nvar updateBoundingBox = function updateBoundingBox(bb1, bb2) {\n // update bb1 with bb2 bounds\n bb1.x1 = Math.min(bb1.x1, bb2.x1);\n bb1.x2 = Math.max(bb1.x2, bb2.x2);\n bb1.w = bb1.x2 - bb1.x1;\n bb1.y1 = Math.min(bb1.y1, bb2.y1);\n bb1.y2 = Math.max(bb1.y2, bb2.y2);\n bb1.h = bb1.y2 - bb1.y1;\n};\nvar expandBoundingBoxByPoint = function expandBoundingBoxByPoint(bb, x, y) {\n bb.x1 = Math.min(bb.x1, x);\n bb.x2 = Math.max(bb.x2, x);\n bb.w = bb.x2 - bb.x1;\n bb.y1 = Math.min(bb.y1, y);\n bb.y2 = Math.max(bb.y2, y);\n bb.h = bb.y2 - bb.y1;\n};\nvar expandBoundingBox = function expandBoundingBox(bb) {\n var padding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n bb.x1 -= padding;\n bb.x2 += padding;\n bb.y1 -= padding;\n bb.y2 += padding;\n bb.w = bb.x2 - bb.x1;\n bb.h = bb.y2 - bb.y1;\n return bb;\n};\nvar expandBoundingBoxSides = function expandBoundingBoxSides(bb) {\n var padding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0];\n var top, right, bottom, left;\n\n if (padding.length === 1) {\n top = right = bottom = left = padding[0];\n } else if (padding.length === 2) {\n top = bottom = padding[0];\n left = right = padding[1];\n } else if (padding.length === 4) {\n var _padding = _slicedToArray(padding, 4);\n\n top = _padding[0];\n right = _padding[1];\n bottom = _padding[2];\n left = _padding[3];\n }\n\n bb.x1 -= left;\n bb.x2 += right;\n bb.y1 -= top;\n bb.y2 += bottom;\n bb.w = bb.x2 - bb.x1;\n bb.h = bb.y2 - bb.y1;\n return bb;\n};\n\nvar assignBoundingBox = function assignBoundingBox(bb1, bb2) {\n bb1.x1 = bb2.x1;\n bb1.y1 = bb2.y1;\n bb1.x2 = bb2.x2;\n bb1.y2 = bb2.y2;\n bb1.w = bb1.x2 - bb1.x1;\n bb1.h = bb1.y2 - bb1.y1;\n};\nvar assignShiftToBoundingBox = function assignShiftToBoundingBox(bb, delta) {\n bb.x1 += delta.x;\n bb.x2 += delta.x;\n bb.y1 += delta.y;\n bb.y2 += delta.y;\n};\nvar boundingBoxesIntersect = function boundingBoxesIntersect(bb1, bb2) {\n // case: one bb to right of other\n if (bb1.x1 > bb2.x2) {\n return false;\n }\n\n if (bb2.x1 > bb1.x2) {\n return false;\n } // case: one bb to left of other\n\n\n if (bb1.x2 < bb2.x1) {\n return false;\n }\n\n if (bb2.x2 < bb1.x1) {\n return false;\n } // case: one bb above other\n\n\n if (bb1.y2 < bb2.y1) {\n return false;\n }\n\n if (bb2.y2 < bb1.y1) {\n return false;\n } // case: one bb below other\n\n\n if (bb1.y1 > bb2.y2) {\n return false;\n }\n\n if (bb2.y1 > bb1.y2) {\n return false;\n } // otherwise, must have some overlap\n\n\n return true;\n};\nvar inBoundingBox = function inBoundingBox(bb, x, y) {\n return bb.x1 <= x && x <= bb.x2 && bb.y1 <= y && y <= bb.y2;\n};\nvar pointInBoundingBox = function pointInBoundingBox(bb, pt) {\n return inBoundingBox(bb, pt.x, pt.y);\n};\nvar boundingBoxInBoundingBox = function boundingBoxInBoundingBox(bb1, bb2) {\n return inBoundingBox(bb1, bb2.x1, bb2.y1) && inBoundingBox(bb1, bb2.x2, bb2.y2);\n};\nvar roundRectangleIntersectLine = function roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding) {\n var cornerRadius = getRoundRectangleRadius(width, height);\n var halfWidth = width / 2;\n var halfHeight = height / 2; // Check intersections with straight line segments\n\n var straightLineIntersections; // Top segment, left to right\n\n {\n var topStartX = nodeX - halfWidth + cornerRadius - padding;\n var topStartY = nodeY - halfHeight - padding;\n var topEndX = nodeX + halfWidth - cornerRadius + padding;\n var topEndY = topStartY;\n straightLineIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false);\n\n if (straightLineIntersections.length > 0) {\n return straightLineIntersections;\n }\n } // Right segment, top to bottom\n\n {\n var rightStartX = nodeX + halfWidth + padding;\n var rightStartY = nodeY - halfHeight + cornerRadius - padding;\n var rightEndX = rightStartX;\n var rightEndY = nodeY + halfHeight - cornerRadius + padding;\n straightLineIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, rightStartX, rightStartY, rightEndX, rightEndY, false);\n\n if (straightLineIntersections.length > 0) {\n return straightLineIntersections;\n }\n } // Bottom segment, left to right\n\n {\n var bottomStartX = nodeX - halfWidth + cornerRadius - padding;\n var bottomStartY = nodeY + halfHeight + padding;\n var bottomEndX = nodeX + halfWidth - cornerRadius + padding;\n var bottomEndY = bottomStartY;\n straightLineIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, bottomStartX, bottomStartY, bottomEndX, bottomEndY, false);\n\n if (straightLineIntersections.length > 0) {\n return straightLineIntersections;\n }\n } // Left segment, top to bottom\n\n {\n var leftStartX = nodeX - halfWidth - padding;\n var leftStartY = nodeY - halfHeight + cornerRadius - padding;\n var leftEndX = leftStartX;\n var leftEndY = nodeY + halfHeight - cornerRadius + padding;\n straightLineIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, leftStartX, leftStartY, leftEndX, leftEndY, false);\n\n if (straightLineIntersections.length > 0) {\n return straightLineIntersections;\n }\n } // Check intersections with arc segments\n\n var arcIntersections; // Top Left\n\n {\n var topLeftCenterX = nodeX - halfWidth + cornerRadius;\n var topLeftCenterY = nodeY - halfHeight + cornerRadius;\n arcIntersections = intersectLineCircle(x, y, nodeX, nodeY, topLeftCenterX, topLeftCenterY, cornerRadius + padding); // Ensure the intersection is on the desired quarter of the circle\n\n if (arcIntersections.length > 0 && arcIntersections[0] <= topLeftCenterX && arcIntersections[1] <= topLeftCenterY) {\n return [arcIntersections[0], arcIntersections[1]];\n }\n } // Top Right\n\n {\n var topRightCenterX = nodeX + halfWidth - cornerRadius;\n var topRightCenterY = nodeY - halfHeight + cornerRadius;\n arcIntersections = intersectLineCircle(x, y, nodeX, nodeY, topRightCenterX, topRightCenterY, cornerRadius + padding); // Ensure the intersection is on the desired quarter of the circle\n\n if (arcIntersections.length > 0 && arcIntersections[0] >= topRightCenterX && arcIntersections[1] <= topRightCenterY) {\n return [arcIntersections[0], arcIntersections[1]];\n }\n } // Bottom Right\n\n {\n var bottomRightCenterX = nodeX + halfWidth - cornerRadius;\n var bottomRightCenterY = nodeY + halfHeight - cornerRadius;\n arcIntersections = intersectLineCircle(x, y, nodeX, nodeY, bottomRightCenterX, bottomRightCenterY, cornerRadius + padding); // Ensure the intersection is on the desired quarter of the circle\n\n if (arcIntersections.length > 0 && arcIntersections[0] >= bottomRightCenterX && arcIntersections[1] >= bottomRightCenterY) {\n return [arcIntersections[0], arcIntersections[1]];\n }\n } // Bottom Left\n\n {\n var bottomLeftCenterX = nodeX - halfWidth + cornerRadius;\n var bottomLeftCenterY = nodeY + halfHeight - cornerRadius;\n arcIntersections = intersectLineCircle(x, y, nodeX, nodeY, bottomLeftCenterX, bottomLeftCenterY, cornerRadius + padding); // Ensure the intersection is on the desired quarter of the circle\n\n if (arcIntersections.length > 0 && arcIntersections[0] <= bottomLeftCenterX && arcIntersections[1] >= bottomLeftCenterY) {\n return [arcIntersections[0], arcIntersections[1]];\n }\n }\n return []; // if nothing\n};\nvar inLineVicinity = function inLineVicinity(x, y, lx1, ly1, lx2, ly2, tolerance) {\n var t = tolerance;\n var x1 = Math.min(lx1, lx2);\n var x2 = Math.max(lx1, lx2);\n var y1 = Math.min(ly1, ly2);\n var y2 = Math.max(ly1, ly2);\n return x1 - t <= x && x <= x2 + t && y1 - t <= y && y <= y2 + t;\n};\nvar inBezierVicinity = function inBezierVicinity(x, y, x1, y1, x2, y2, x3, y3, tolerance) {\n var bb = {\n x1: Math.min(x1, x3, x2) - tolerance,\n x2: Math.max(x1, x3, x2) + tolerance,\n y1: Math.min(y1, y3, y2) - tolerance,\n y2: Math.max(y1, y3, y2) + tolerance\n }; // if outside the rough bounding box for the bezier, then it can't be a hit\n\n if (x < bb.x1 || x > bb.x2 || y < bb.y1 || y > bb.y2) {\n // console.log('bezier out of rough bb')\n return false;\n } else {\n // console.log('do more expensive check');\n return true;\n }\n};\nvar solveQuadratic = function solveQuadratic(a, b, c, val) {\n c -= val;\n var r = b * b - 4 * a * c;\n\n if (r < 0) {\n return [];\n }\n\n var sqrtR = Math.sqrt(r);\n var denom = 2 * a;\n var root1 = (-b + sqrtR) / denom;\n var root2 = (-b - sqrtR) / denom;\n return [root1, root2];\n};\nvar solveCubic = function solveCubic(a, b, c, d, result) {\n // Solves a cubic function, returns root in form [r1, i1, r2, i2, r3, i3], where\n // r is the real component, i is the imaginary component\n // An implementation of the Cardano method from the year 1545\n // http://en.wikipedia.org/wiki/Cubic_function#The_nature_of_the_roots\n var epsilon = 0.00001; // avoid division by zero while keeping the overall expression close in value\n\n if (a === 0) {\n a = epsilon;\n }\n\n b /= a;\n c /= a;\n d /= a;\n var discriminant, q, r, dum1, s, t, term1, r13;\n q = (3.0 * c - b * b) / 9.0;\n r = -(27.0 * d) + b * (9.0 * c - 2.0 * (b * b));\n r /= 54.0;\n discriminant = q * q * q + r * r;\n result[1] = 0;\n term1 = b / 3.0;\n\n if (discriminant > 0) {\n s = r + Math.sqrt(discriminant);\n s = s < 0 ? -Math.pow(-s, 1.0 / 3.0) : Math.pow(s, 1.0 / 3.0);\n t = r - Math.sqrt(discriminant);\n t = t < 0 ? -Math.pow(-t, 1.0 / 3.0) : Math.pow(t, 1.0 / 3.0);\n result[0] = -term1 + s + t;\n term1 += (s + t) / 2.0;\n result[4] = result[2] = -term1;\n term1 = Math.sqrt(3.0) * (-t + s) / 2;\n result[3] = term1;\n result[5] = -term1;\n return;\n }\n\n result[5] = result[3] = 0;\n\n if (discriminant === 0) {\n r13 = r < 0 ? -Math.pow(-r, 1.0 / 3.0) : Math.pow(r, 1.0 / 3.0);\n result[0] = -term1 + 2.0 * r13;\n result[4] = result[2] = -(r13 + term1);\n return;\n }\n\n q = -q;\n dum1 = q * q * q;\n dum1 = Math.acos(r / Math.sqrt(dum1));\n r13 = 2.0 * Math.sqrt(q);\n result[0] = -term1 + r13 * Math.cos(dum1 / 3.0);\n result[2] = -term1 + r13 * Math.cos((dum1 + 2.0 * Math.PI) / 3.0);\n result[4] = -term1 + r13 * Math.cos((dum1 + 4.0 * Math.PI) / 3.0);\n return;\n};\nvar sqdistToQuadraticBezier = function sqdistToQuadraticBezier(x, y, x1, y1, x2, y2, x3, y3) {\n // Find minimum distance by using the minimum of the distance\n // function between the given point and the curve\n // This gives the coefficients of the resulting cubic equation\n // whose roots tell us where a possible minimum is\n // (Coefficients are divided by 4)\n var a = 1.0 * x1 * x1 - 4 * x1 * x2 + 2 * x1 * x3 + 4 * x2 * x2 - 4 * x2 * x3 + x3 * x3 + y1 * y1 - 4 * y1 * y2 + 2 * y1 * y3 + 4 * y2 * y2 - 4 * y2 * y3 + y3 * y3;\n var b = 1.0 * 9 * x1 * x2 - 3 * x1 * x1 - 3 * x1 * x3 - 6 * x2 * x2 + 3 * x2 * x3 + 9 * y1 * y2 - 3 * y1 * y1 - 3 * y1 * y3 - 6 * y2 * y2 + 3 * y2 * y3;\n var c = 1.0 * 3 * x1 * x1 - 6 * x1 * x2 + x1 * x3 - x1 * x + 2 * x2 * x2 + 2 * x2 * x - x3 * x + 3 * y1 * y1 - 6 * y1 * y2 + y1 * y3 - y1 * y + 2 * y2 * y2 + 2 * y2 * y - y3 * y;\n var d = 1.0 * x1 * x2 - x1 * x1 + x1 * x - x2 * x + y1 * y2 - y1 * y1 + y1 * y - y2 * y; // debug(\"coefficients: \" + a / a + \", \" + b / a + \", \" + c / a + \", \" + d / a);\n\n var roots = []; // Use the cubic solving algorithm\n\n solveCubic(a, b, c, d, roots);\n var zeroThreshold = 0.0000001;\n var params = [];\n\n for (var index = 0; index < 6; index += 2) {\n if (Math.abs(roots[index + 1]) < zeroThreshold && roots[index] >= 0 && roots[index] <= 1.0) {\n params.push(roots[index]);\n }\n }\n\n params.push(1.0);\n params.push(0.0);\n var minDistanceSquared = -1;\n var curX, curY, distSquared;\n\n for (var i = 0; i < params.length; i++) {\n curX = Math.pow(1.0 - params[i], 2.0) * x1 + 2.0 * (1 - params[i]) * params[i] * x2 + params[i] * params[i] * x3;\n curY = Math.pow(1 - params[i], 2.0) * y1 + 2 * (1.0 - params[i]) * params[i] * y2 + params[i] * params[i] * y3;\n distSquared = Math.pow(curX - x, 2) + Math.pow(curY - y, 2); // debug('distance for param ' + params[i] + \": \" + Math.sqrt(distSquared));\n\n if (minDistanceSquared >= 0) {\n if (distSquared < minDistanceSquared) {\n minDistanceSquared = distSquared;\n }\n } else {\n minDistanceSquared = distSquared;\n }\n }\n\n return minDistanceSquared;\n};\nvar sqdistToFiniteLine = function sqdistToFiniteLine(x, y, x1, y1, x2, y2) {\n var offset = [x - x1, y - y1];\n var line = [x2 - x1, y2 - y1];\n var lineSq = line[0] * line[0] + line[1] * line[1];\n var hypSq = offset[0] * offset[0] + offset[1] * offset[1];\n var dotProduct = offset[0] * line[0] + offset[1] * line[1];\n var adjSq = dotProduct * dotProduct / lineSq;\n\n if (dotProduct < 0) {\n return hypSq;\n }\n\n if (adjSq > lineSq) {\n return (x - x2) * (x - x2) + (y - y2) * (y - y2);\n }\n\n return hypSq - adjSq;\n};\nvar pointInsidePolygonPoints = function pointInsidePolygonPoints(x, y, points) {\n var x1, y1, x2, y2;\n var y3; // Intersect with vertical line through (x, y)\n\n var up = 0; // let down = 0;\n\n for (var i = 0; i < points.length / 2; i++) {\n x1 = points[i * 2];\n y1 = points[i * 2 + 1];\n\n if (i + 1 < points.length / 2) {\n x2 = points[(i + 1) * 2];\n y2 = points[(i + 1) * 2 + 1];\n } else {\n x2 = points[(i + 1 - points.length / 2) * 2];\n y2 = points[(i + 1 - points.length / 2) * 2 + 1];\n }\n\n if (x1 == x && x2 == x) ; else if (x1 >= x && x >= x2 || x1 <= x && x <= x2) {\n y3 = (x - x1) / (x2 - x1) * (y2 - y1) + y1;\n\n if (y3 > y) {\n up++;\n } // if( y3 < y ){\n // down++;\n // }\n\n } else {\n continue;\n }\n }\n\n if (up % 2 === 0) {\n return false;\n } else {\n return true;\n }\n};\nvar pointInsidePolygon = function pointInsidePolygon(x, y, basePoints, centerX, centerY, width, height, direction, padding) {\n var transformedPoints = new Array(basePoints.length); // Gives negative angle\n\n var angle;\n\n if (direction[0] != null) {\n angle = Math.atan(direction[1] / direction[0]);\n\n if (direction[0] < 0) {\n angle = angle + Math.PI / 2;\n } else {\n angle = -angle - Math.PI / 2;\n }\n } else {\n angle = direction;\n }\n\n var cos = Math.cos(-angle);\n var sin = Math.sin(-angle); // console.log(\"base: \" + basePoints);\n\n for (var i = 0; i < transformedPoints.length / 2; i++) {\n transformedPoints[i * 2] = width / 2 * (basePoints[i * 2] * cos - basePoints[i * 2 + 1] * sin);\n transformedPoints[i * 2 + 1] = height / 2 * (basePoints[i * 2 + 1] * cos + basePoints[i * 2] * sin);\n transformedPoints[i * 2] += centerX;\n transformedPoints[i * 2 + 1] += centerY;\n }\n\n var points;\n\n if (padding > 0) {\n var expandedLineSet = expandPolygon(transformedPoints, -padding);\n points = joinLines(expandedLineSet);\n } else {\n points = transformedPoints;\n }\n\n return pointInsidePolygonPoints(x, y, points);\n};\nvar pointInsideRoundPolygon = function pointInsideRoundPolygon(x, y, basePoints, centerX, centerY, width, height) {\n var cutPolygonPoints = new Array(basePoints.length);\n var halfW = width / 2;\n var halfH = height / 2;\n var cornerRadius = getRoundPolygonRadius(width, height);\n var squaredCornerRadius = cornerRadius * cornerRadius;\n\n for (var i = 0; i < basePoints.length / 4; i++) {\n var sourceUv = void 0,\n destUv = void 0;\n\n if (i === 0) {\n sourceUv = basePoints.length - 2;\n } else {\n sourceUv = i * 4 - 2;\n }\n\n destUv = i * 4 + 2;\n var px = centerX + halfW * basePoints[i * 4];\n var py = centerY + halfH * basePoints[i * 4 + 1];\n var cosTheta = -basePoints[sourceUv] * basePoints[destUv] - basePoints[sourceUv + 1] * basePoints[destUv + 1];\n var offset = cornerRadius / Math.tan(Math.acos(cosTheta) / 2);\n var cp0x = px - offset * basePoints[sourceUv];\n var cp0y = py - offset * basePoints[sourceUv + 1];\n var cp1x = px + offset * basePoints[destUv];\n var cp1y = py + offset * basePoints[destUv + 1];\n cutPolygonPoints[i * 4] = cp0x;\n cutPolygonPoints[i * 4 + 1] = cp0y;\n cutPolygonPoints[i * 4 + 2] = cp1x;\n cutPolygonPoints[i * 4 + 3] = cp1y;\n var orthx = basePoints[sourceUv + 1];\n var orthy = -basePoints[sourceUv];\n var cosAlpha = orthx * basePoints[destUv] + orthy * basePoints[destUv + 1];\n\n if (cosAlpha < 0) {\n orthx *= -1;\n orthy *= -1;\n }\n\n var cx = cp0x + orthx * cornerRadius;\n var cy = cp0y + orthy * cornerRadius;\n var squaredDistance = Math.pow(cx - x, 2) + Math.pow(cy - y, 2);\n\n if (squaredDistance <= squaredCornerRadius) {\n return true;\n }\n }\n\n return pointInsidePolygonPoints(x, y, cutPolygonPoints);\n};\nvar joinLines = function joinLines(lineSet) {\n var vertices = new Array(lineSet.length / 2);\n var currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY;\n var nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY;\n\n for (var i = 0; i < lineSet.length / 4; i++) {\n currentLineStartX = lineSet[i * 4];\n currentLineStartY = lineSet[i * 4 + 1];\n currentLineEndX = lineSet[i * 4 + 2];\n currentLineEndY = lineSet[i * 4 + 3];\n\n if (i < lineSet.length / 4 - 1) {\n nextLineStartX = lineSet[(i + 1) * 4];\n nextLineStartY = lineSet[(i + 1) * 4 + 1];\n nextLineEndX = lineSet[(i + 1) * 4 + 2];\n nextLineEndY = lineSet[(i + 1) * 4 + 3];\n } else {\n nextLineStartX = lineSet[0];\n nextLineStartY = lineSet[1];\n nextLineEndX = lineSet[2];\n nextLineEndY = lineSet[3];\n }\n\n var intersection = finiteLinesIntersect(currentLineStartX, currentLineStartY, currentLineEndX, currentLineEndY, nextLineStartX, nextLineStartY, nextLineEndX, nextLineEndY, true);\n vertices[i * 2] = intersection[0];\n vertices[i * 2 + 1] = intersection[1];\n }\n\n return vertices;\n};\nvar expandPolygon = function expandPolygon(points, pad) {\n var expandedLineSet = new Array(points.length * 2);\n var currentPointX, currentPointY, nextPointX, nextPointY;\n\n for (var i = 0; i < points.length / 2; i++) {\n currentPointX = points[i * 2];\n currentPointY = points[i * 2 + 1];\n\n if (i < points.length / 2 - 1) {\n nextPointX = points[(i + 1) * 2];\n nextPointY = points[(i + 1) * 2 + 1];\n } else {\n nextPointX = points[0];\n nextPointY = points[1];\n } // Current line: [currentPointX, currentPointY] to [nextPointX, nextPointY]\n // Assume CCW polygon winding\n\n\n var offsetX = nextPointY - currentPointY;\n var offsetY = -(nextPointX - currentPointX); // Normalize\n\n var offsetLength = Math.sqrt(offsetX * offsetX + offsetY * offsetY);\n var normalizedOffsetX = offsetX / offsetLength;\n var normalizedOffsetY = offsetY / offsetLength;\n expandedLineSet[i * 4] = currentPointX + normalizedOffsetX * pad;\n expandedLineSet[i * 4 + 1] = currentPointY + normalizedOffsetY * pad;\n expandedLineSet[i * 4 + 2] = nextPointX + normalizedOffsetX * pad;\n expandedLineSet[i * 4 + 3] = nextPointY + normalizedOffsetY * pad;\n }\n\n return expandedLineSet;\n};\nvar intersectLineEllipse = function intersectLineEllipse(x, y, centerX, centerY, ellipseWradius, ellipseHradius) {\n var dispX = centerX - x;\n var dispY = centerY - y;\n dispX /= ellipseWradius;\n dispY /= ellipseHradius;\n var len = Math.sqrt(dispX * dispX + dispY * dispY);\n var newLength = len - 1;\n\n if (newLength < 0) {\n return [];\n }\n\n var lenProportion = newLength / len;\n return [(centerX - x) * lenProportion + x, (centerY - y) * lenProportion + y];\n};\nvar checkInEllipse = function checkInEllipse(x, y, width, height, centerX, centerY, padding) {\n x -= centerX;\n y -= centerY;\n x /= width / 2 + padding;\n y /= height / 2 + padding;\n return x * x + y * y <= 1;\n}; // Returns intersections of increasing distance from line's start point\n\nvar intersectLineCircle = function intersectLineCircle(x1, y1, x2, y2, centerX, centerY, radius) {\n // Calculate d, direction vector of line\n var d = [x2 - x1, y2 - y1]; // Direction vector of line\n\n var f = [x1 - centerX, y1 - centerY];\n var a = d[0] * d[0] + d[1] * d[1];\n var b = 2 * (f[0] * d[0] + f[1] * d[1]);\n var c = f[0] * f[0] + f[1] * f[1] - radius * radius;\n var discriminant = b * b - 4 * a * c;\n\n if (discriminant < 0) {\n return [];\n }\n\n var t1 = (-b + Math.sqrt(discriminant)) / (2 * a);\n var t2 = (-b - Math.sqrt(discriminant)) / (2 * a);\n var tMin = Math.min(t1, t2);\n var tMax = Math.max(t1, t2);\n var inRangeParams = [];\n\n if (tMin >= 0 && tMin <= 1) {\n inRangeParams.push(tMin);\n }\n\n if (tMax >= 0 && tMax <= 1) {\n inRangeParams.push(tMax);\n }\n\n if (inRangeParams.length === 0) {\n return [];\n }\n\n var nearIntersectionX = inRangeParams[0] * d[0] + x1;\n var nearIntersectionY = inRangeParams[0] * d[1] + y1;\n\n if (inRangeParams.length > 1) {\n if (inRangeParams[0] == inRangeParams[1]) {\n return [nearIntersectionX, nearIntersectionY];\n } else {\n var farIntersectionX = inRangeParams[1] * d[0] + x1;\n var farIntersectionY = inRangeParams[1] * d[1] + y1;\n return [nearIntersectionX, nearIntersectionY, farIntersectionX, farIntersectionY];\n }\n } else {\n return [nearIntersectionX, nearIntersectionY];\n }\n};\nvar midOfThree = function midOfThree(a, b, c) {\n if (b <= a && a <= c || c <= a && a <= b) {\n return a;\n } else if (a <= b && b <= c || c <= b && b <= a) {\n return b;\n } else {\n return c;\n }\n}; // (x1,y1)=>(x2,y2) intersect with (x3,y3)=>(x4,y4)\n\nvar finiteLinesIntersect = function finiteLinesIntersect(x1, y1, x2, y2, x3, y3, x4, y4, infiniteLines) {\n var dx13 = x1 - x3;\n var dx21 = x2 - x1;\n var dx43 = x4 - x3;\n var dy13 = y1 - y3;\n var dy21 = y2 - y1;\n var dy43 = y4 - y3;\n var ua_t = dx43 * dy13 - dy43 * dx13;\n var ub_t = dx21 * dy13 - dy21 * dx13;\n var u_b = dy43 * dx21 - dx43 * dy21;\n\n if (u_b !== 0) {\n var ua = ua_t / u_b;\n var ub = ub_t / u_b;\n var flptThreshold = 0.001;\n\n var _min = 0 - flptThreshold;\n\n var _max = 1 + flptThreshold;\n\n if (_min <= ua && ua <= _max && _min <= ub && ub <= _max) {\n return [x1 + ua * dx21, y1 + ua * dy21];\n } else {\n if (!infiniteLines) {\n return [];\n } else {\n return [x1 + ua * dx21, y1 + ua * dy21];\n }\n }\n } else {\n if (ua_t === 0 || ub_t === 0) {\n // Parallel, coincident lines. Check if overlap\n // Check endpoint of second line\n if (midOfThree(x1, x2, x4) === x4) {\n return [x4, y4];\n } // Check start point of second line\n\n\n if (midOfThree(x1, x2, x3) === x3) {\n return [x3, y3];\n } // Endpoint of first line\n\n\n if (midOfThree(x3, x4, x2) === x2) {\n return [x2, y2];\n }\n\n return [];\n } else {\n // Parallel, non-coincident\n return [];\n }\n }\n}; // math.polygonIntersectLine( x, y, basePoints, centerX, centerY, width, height, padding )\n// intersect a node polygon (pts transformed)\n//\n// math.polygonIntersectLine( x, y, basePoints, centerX, centerY )\n// intersect the points (no transform)\n\nvar polygonIntersectLine = function polygonIntersectLine(x, y, basePoints, centerX, centerY, width, height, padding) {\n var intersections = [];\n var intersection;\n var transformedPoints = new Array(basePoints.length);\n var doTransform = true;\n\n if (width == null) {\n doTransform = false;\n }\n\n var points;\n\n if (doTransform) {\n for (var i = 0; i < transformedPoints.length / 2; i++) {\n transformedPoints[i * 2] = basePoints[i * 2] * width + centerX;\n transformedPoints[i * 2 + 1] = basePoints[i * 2 + 1] * height + centerY;\n }\n\n if (padding > 0) {\n var expandedLineSet = expandPolygon(transformedPoints, -padding);\n points = joinLines(expandedLineSet);\n } else {\n points = transformedPoints;\n }\n } else {\n points = basePoints;\n }\n\n var currentX, currentY, nextX, nextY;\n\n for (var _i2 = 0; _i2 < points.length / 2; _i2++) {\n currentX = points[_i2 * 2];\n currentY = points[_i2 * 2 + 1];\n\n if (_i2 < points.length / 2 - 1) {\n nextX = points[(_i2 + 1) * 2];\n nextY = points[(_i2 + 1) * 2 + 1];\n } else {\n nextX = points[0];\n nextY = points[1];\n }\n\n intersection = finiteLinesIntersect(x, y, centerX, centerY, currentX, currentY, nextX, nextY);\n\n if (intersection.length !== 0) {\n intersections.push(intersection[0], intersection[1]);\n }\n }\n\n return intersections;\n};\nvar roundPolygonIntersectLine = function roundPolygonIntersectLine(x, y, basePoints, centerX, centerY, width, height, padding) {\n var intersections = [];\n var intersection;\n var lines = new Array(basePoints.length);\n var halfW = width / 2;\n var halfH = height / 2;\n var cornerRadius = getRoundPolygonRadius(width, height);\n\n for (var i = 0; i < basePoints.length / 4; i++) {\n var sourceUv = void 0,\n destUv = void 0;\n\n if (i === 0) {\n sourceUv = basePoints.length - 2;\n } else {\n sourceUv = i * 4 - 2;\n }\n\n destUv = i * 4 + 2;\n var px = centerX + halfW * basePoints[i * 4];\n var py = centerY + halfH * basePoints[i * 4 + 1];\n var cosTheta = -basePoints[sourceUv] * basePoints[destUv] - basePoints[sourceUv + 1] * basePoints[destUv + 1];\n var offset = cornerRadius / Math.tan(Math.acos(cosTheta) / 2);\n var cp0x = px - offset * basePoints[sourceUv];\n var cp0y = py - offset * basePoints[sourceUv + 1];\n var cp1x = px + offset * basePoints[destUv];\n var cp1y = py + offset * basePoints[destUv + 1];\n\n if (i === 0) {\n lines[basePoints.length - 2] = cp0x;\n lines[basePoints.length - 1] = cp0y;\n } else {\n lines[i * 4 - 2] = cp0x;\n lines[i * 4 - 1] = cp0y;\n }\n\n lines[i * 4] = cp1x;\n lines[i * 4 + 1] = cp1y;\n var orthx = basePoints[sourceUv + 1];\n var orthy = -basePoints[sourceUv];\n var cosAlpha = orthx * basePoints[destUv] + orthy * basePoints[destUv + 1];\n\n if (cosAlpha < 0) {\n orthx *= -1;\n orthy *= -1;\n }\n\n var cx = cp0x + orthx * cornerRadius;\n var cy = cp0y + orthy * cornerRadius;\n intersection = intersectLineCircle(x, y, centerX, centerY, cx, cy, cornerRadius);\n\n if (intersection.length !== 0) {\n intersections.push(intersection[0], intersection[1]);\n }\n }\n\n for (var _i3 = 0; _i3 < lines.length / 4; _i3++) {\n intersection = finiteLinesIntersect(x, y, centerX, centerY, lines[_i3 * 4], lines[_i3 * 4 + 1], lines[_i3 * 4 + 2], lines[_i3 * 4 + 3], false);\n\n if (intersection.length !== 0) {\n intersections.push(intersection[0], intersection[1]);\n }\n }\n\n if (intersections.length > 2) {\n var lowestIntersection = [intersections[0], intersections[1]];\n var lowestSquaredDistance = Math.pow(lowestIntersection[0] - x, 2) + Math.pow(lowestIntersection[1] - y, 2);\n\n for (var _i4 = 1; _i4 < intersections.length / 2; _i4++) {\n var squaredDistance = Math.pow(intersections[_i4 * 2] - x, 2) + Math.pow(intersections[_i4 * 2 + 1] - y, 2);\n\n if (squaredDistance <= lowestSquaredDistance) {\n lowestIntersection[0] = intersections[_i4 * 2];\n lowestIntersection[1] = intersections[_i4 * 2 + 1];\n lowestSquaredDistance = squaredDistance;\n }\n }\n\n return lowestIntersection;\n }\n\n return intersections;\n};\nvar shortenIntersection = function shortenIntersection(intersection, offset, amount) {\n var disp = [intersection[0] - offset[0], intersection[1] - offset[1]];\n var length = Math.sqrt(disp[0] * disp[0] + disp[1] * disp[1]);\n var lenRatio = (length - amount) / length;\n\n if (lenRatio < 0) {\n lenRatio = 0.00001;\n }\n\n return [offset[0] + lenRatio * disp[0], offset[1] + lenRatio * disp[1]];\n};\nvar generateUnitNgonPointsFitToSquare = function generateUnitNgonPointsFitToSquare(sides, rotationRadians) {\n var points = generateUnitNgonPoints(sides, rotationRadians);\n points = fitPolygonToSquare(points);\n return points;\n};\nvar fitPolygonToSquare = function fitPolygonToSquare(points) {\n var x, y;\n var sides = points.length / 2;\n var minX = Infinity,\n minY = Infinity,\n maxX = -Infinity,\n maxY = -Infinity;\n\n for (var i = 0; i < sides; i++) {\n x = points[2 * i];\n y = points[2 * i + 1];\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n } // stretch factors\n\n\n var sx = 2 / (maxX - minX);\n var sy = 2 / (maxY - minY);\n\n for (var _i5 = 0; _i5 < sides; _i5++) {\n x = points[2 * _i5] = points[2 * _i5] * sx;\n y = points[2 * _i5 + 1] = points[2 * _i5 + 1] * sy;\n minX = Math.min(minX, x);\n maxX = Math.max(maxX, x);\n minY = Math.min(minY, y);\n maxY = Math.max(maxY, y);\n }\n\n if (minY < -1) {\n for (var _i6 = 0; _i6 < sides; _i6++) {\n y = points[2 * _i6 + 1] = points[2 * _i6 + 1] + (-1 - minY);\n }\n }\n\n return points;\n};\nvar generateUnitNgonPoints = function generateUnitNgonPoints(sides, rotationRadians) {\n var increment = 1.0 / sides * 2 * Math.PI;\n var startAngle = sides % 2 === 0 ? Math.PI / 2.0 + increment / 2.0 : Math.PI / 2.0;\n startAngle += rotationRadians;\n var points = new Array(sides * 2);\n var currentAngle;\n\n for (var i = 0; i < sides; i++) {\n currentAngle = i * increment + startAngle;\n points[2 * i] = Math.cos(currentAngle); // x\n\n points[2 * i + 1] = Math.sin(-currentAngle); // y\n }\n\n return points;\n}; // Set the default radius, unless half of width or height is smaller than default\n\nvar getRoundRectangleRadius = function getRoundRectangleRadius(width, height) {\n return Math.min(width / 4, height / 4, 8);\n}; // Set the default radius\n\nvar getRoundPolygonRadius = function getRoundPolygonRadius(width, height) {\n return Math.min(width / 10, height / 10, 8);\n};\nvar getCutRectangleCornerLength = function getCutRectangleCornerLength() {\n return 8;\n};\nvar bezierPtsToQuadCoeff = function bezierPtsToQuadCoeff(p0, p1, p2) {\n return [p0 - 2 * p1 + p2, 2 * (p1 - p0), p0];\n}; // get curve width, height, and control point position offsets as a percentage of node height / width\n\nvar getBarrelCurveConstants = function getBarrelCurveConstants(width, height) {\n return {\n heightOffset: Math.min(15, 0.05 * height),\n widthOffset: Math.min(100, 0.25 * width),\n ctrlPtOffsetPct: 0.05\n };\n};\n\nvar pageRankDefaults = defaults({\n dampingFactor: 0.8,\n precision: 0.000001,\n iterations: 200,\n weight: function weight(edge) {\n return 1;\n }\n});\nvar elesfn$7 = {\n pageRank: function pageRank(options) {\n var _pageRankDefaults = pageRankDefaults(options),\n dampingFactor = _pageRankDefaults.dampingFactor,\n precision = _pageRankDefaults.precision,\n iterations = _pageRankDefaults.iterations,\n weight = _pageRankDefaults.weight;\n\n var cy = this._private.cy;\n\n var _this$byGroup = this.byGroup(),\n nodes = _this$byGroup.nodes,\n edges = _this$byGroup.edges;\n\n var numNodes = nodes.length;\n var numNodesSqd = numNodes * numNodes;\n var numEdges = edges.length; // Construct transposed adjacency matrix\n // First lets have a zeroed matrix of the right size\n // We'll also keep track of the sum of each column\n\n var matrix = new Array(numNodesSqd);\n var columnSum = new Array(numNodes);\n var additionalProb = (1 - dampingFactor) / numNodes; // Create null matrix\n\n for (var i = 0; i < numNodes; i++) {\n for (var j = 0; j < numNodes; j++) {\n var n = i * numNodes + j;\n matrix[n] = 0;\n }\n\n columnSum[i] = 0;\n } // Now, process edges\n\n\n for (var _i = 0; _i < numEdges; _i++) {\n var edge = edges[_i];\n var srcId = edge.data('source');\n var tgtId = edge.data('target'); // Don't include loops in the matrix\n\n if (srcId === tgtId) {\n continue;\n }\n\n var s = nodes.indexOfId(srcId);\n var t = nodes.indexOfId(tgtId);\n var w = weight(edge);\n\n var _n = t * numNodes + s; // Update matrix\n\n\n matrix[_n] += w; // Update column sum\n\n columnSum[s] += w;\n } // Add additional probability based on damping factor\n // Also, take into account columns that have sum = 0\n\n\n var p = 1.0 / numNodes + additionalProb; // Shorthand\n // Traverse matrix, column by column\n\n for (var _j = 0; _j < numNodes; _j++) {\n if (columnSum[_j] === 0) {\n // No 'links' out from node jth, assume equal probability for each possible node\n for (var _i2 = 0; _i2 < numNodes; _i2++) {\n var _n2 = _i2 * numNodes + _j;\n\n matrix[_n2] = p;\n }\n } else {\n // Node jth has outgoing link, compute normalized probabilities\n for (var _i3 = 0; _i3 < numNodes; _i3++) {\n var _n3 = _i3 * numNodes + _j;\n\n matrix[_n3] = matrix[_n3] / columnSum[_j] + additionalProb;\n }\n }\n } // Compute dominant eigenvector using power method\n\n\n var eigenvector = new Array(numNodes);\n var temp = new Array(numNodes);\n var previous; // Start with a vector of all 1's\n // Also, initialize a null vector which will be used as shorthand\n\n for (var _i4 = 0; _i4 < numNodes; _i4++) {\n eigenvector[_i4] = 1;\n }\n\n for (var iter = 0; iter < iterations; iter++) {\n // Temp array with all 0's\n for (var _i5 = 0; _i5 < numNodes; _i5++) {\n temp[_i5] = 0;\n } // Multiply matrix with previous result\n\n\n for (var _i6 = 0; _i6 < numNodes; _i6++) {\n for (var _j2 = 0; _j2 < numNodes; _j2++) {\n var _n4 = _i6 * numNodes + _j2;\n\n temp[_i6] += matrix[_n4] * eigenvector[_j2];\n }\n }\n\n inPlaceSumNormalize(temp);\n previous = eigenvector;\n eigenvector = temp;\n temp = previous;\n var diff = 0; // Compute difference (squared module) of both vectors\n\n for (var _i7 = 0; _i7 < numNodes; _i7++) {\n var delta = previous[_i7] - eigenvector[_i7];\n diff += delta * delta;\n } // If difference is less than the desired threshold, stop iterating\n\n\n if (diff < precision) {\n break;\n }\n } // Construct result\n\n\n var res = {\n rank: function rank(node) {\n node = cy.collection(node)[0];\n return eigenvector[nodes.indexOf(node)];\n }\n };\n return res;\n } // pageRank\n\n}; // elesfn\n\nvar defaults$1 = defaults({\n root: null,\n weight: function weight(edge) {\n return 1;\n },\n directed: false,\n alpha: 0\n});\nvar elesfn$8 = {\n degreeCentralityNormalized: function degreeCentralityNormalized(options) {\n options = defaults$1(options);\n var cy = this.cy();\n var nodes = this.nodes();\n var numNodes = nodes.length;\n\n if (!options.directed) {\n var degrees = {};\n var maxDegree = 0;\n\n for (var i = 0; i < numNodes; i++) {\n var node = nodes[i]; // add current node to the current options object and call degreeCentrality\n\n options.root = node;\n var currDegree = this.degreeCentrality(options);\n\n if (maxDegree < currDegree.degree) {\n maxDegree = currDegree.degree;\n }\n\n degrees[node.id()] = currDegree.degree;\n }\n\n return {\n degree: function degree(node) {\n if (maxDegree === 0) {\n return 0;\n }\n\n if (string(node)) {\n // from is a selector string\n node = cy.filter(node);\n }\n\n return degrees[node.id()] / maxDegree;\n }\n };\n } else {\n var indegrees = {};\n var outdegrees = {};\n var maxIndegree = 0;\n var maxOutdegree = 0;\n\n for (var _i = 0; _i < numNodes; _i++) {\n var _node = nodes[_i];\n\n var id = _node.id(); // add current node to the current options object and call degreeCentrality\n\n\n options.root = _node;\n\n var _currDegree = this.degreeCentrality(options);\n\n if (maxIndegree < _currDegree.indegree) maxIndegree = _currDegree.indegree;\n if (maxOutdegree < _currDegree.outdegree) maxOutdegree = _currDegree.outdegree;\n indegrees[id] = _currDegree.indegree;\n outdegrees[id] = _currDegree.outdegree;\n }\n\n return {\n indegree: function indegree(node) {\n if (maxIndegree == 0) {\n return 0;\n }\n\n if (string(node)) {\n // from is a selector string\n node = cy.filter(node);\n }\n\n return indegrees[node.id()] / maxIndegree;\n },\n outdegree: function outdegree(node) {\n if (maxOutdegree === 0) {\n return 0;\n }\n\n if (string(node)) {\n // from is a selector string\n node = cy.filter(node);\n }\n\n return outdegrees[node.id()] / maxOutdegree;\n }\n };\n }\n },\n // degreeCentralityNormalized\n // Implemented from the algorithm in Opsahl's paper\n // \"Node centrality in weighted networks: Generalizing degree and shortest paths\"\n // check the heading 2 \"Degree\"\n degreeCentrality: function degreeCentrality(options) {\n options = defaults$1(options);\n var cy = this.cy();\n var callingEles = this;\n var _options = options,\n root = _options.root,\n weight = _options.weight,\n directed = _options.directed,\n alpha = _options.alpha;\n root = cy.collection(root)[0];\n\n if (!directed) {\n var connEdges = root.connectedEdges().intersection(callingEles);\n var k = connEdges.length;\n var s = 0; // Now, sum edge weights\n\n for (var i = 0; i < connEdges.length; i++) {\n s += weight(connEdges[i]);\n }\n\n return {\n degree: Math.pow(k, 1 - alpha) * Math.pow(s, alpha)\n };\n } else {\n var edges = root.connectedEdges();\n var incoming = edges.filter(function (edge) {\n return edge.target().same(root) && callingEles.has(edge);\n });\n var outgoing = edges.filter(function (edge) {\n return edge.source().same(root) && callingEles.has(edge);\n });\n var k_in = incoming.length;\n var k_out = outgoing.length;\n var s_in = 0;\n var s_out = 0; // Now, sum incoming edge weights\n\n for (var _i2 = 0; _i2 < incoming.length; _i2++) {\n s_in += weight(incoming[_i2]);\n } // Now, sum outgoing edge weights\n\n\n for (var _i3 = 0; _i3 < outgoing.length; _i3++) {\n s_out += weight(outgoing[_i3]);\n }\n\n return {\n indegree: Math.pow(k_in, 1 - alpha) * Math.pow(s_in, alpha),\n outdegree: Math.pow(k_out, 1 - alpha) * Math.pow(s_out, alpha)\n };\n }\n } // degreeCentrality\n\n}; // elesfn\n// nice, short mathemathical alias\n\nelesfn$8.dc = elesfn$8.degreeCentrality;\nelesfn$8.dcn = elesfn$8.degreeCentralityNormalised = elesfn$8.degreeCentralityNormalized;\n\nvar defaults$2 = defaults({\n harmonic: true,\n weight: function weight() {\n return 1;\n },\n directed: false,\n root: null\n});\nvar elesfn$9 = {\n closenessCentralityNormalized: function closenessCentralityNormalized(options) {\n var _defaults = defaults$2(options),\n harmonic = _defaults.harmonic,\n weight = _defaults.weight,\n directed = _defaults.directed;\n\n var cy = this.cy();\n var closenesses = {};\n var maxCloseness = 0;\n var nodes = this.nodes();\n var fw = this.floydWarshall({\n weight: weight,\n directed: directed\n }); // Compute closeness for every node and find the maximum closeness\n\n for (var i = 0; i < nodes.length; i++) {\n var currCloseness = 0;\n var node_i = nodes[i];\n\n for (var j = 0; j < nodes.length; j++) {\n if (i !== j) {\n var d = fw.distance(node_i, nodes[j]);\n\n if (harmonic) {\n currCloseness += 1 / d;\n } else {\n currCloseness += d;\n }\n }\n }\n\n if (!harmonic) {\n currCloseness = 1 / currCloseness;\n }\n\n if (maxCloseness < currCloseness) {\n maxCloseness = currCloseness;\n }\n\n closenesses[node_i.id()] = currCloseness;\n }\n\n return {\n closeness: function closeness(node) {\n if (maxCloseness == 0) {\n return 0;\n }\n\n if (string(node)) {\n // from is a selector string\n node = cy.filter(node)[0].id();\n } else {\n // from is a node\n node = node.id();\n }\n\n return closenesses[node] / maxCloseness;\n }\n };\n },\n // Implemented from pseudocode from wikipedia\n closenessCentrality: function closenessCentrality(options) {\n var _defaults2 = defaults$2(options),\n root = _defaults2.root,\n weight = _defaults2.weight,\n directed = _defaults2.directed,\n harmonic = _defaults2.harmonic;\n\n root = this.filter(root)[0]; // we need distance from this node to every other node\n\n var dijkstra = this.dijkstra({\n root: root,\n weight: weight,\n directed: directed\n });\n var totalDistance = 0;\n var nodes = this.nodes();\n\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n\n if (!n.same(root)) {\n var d = dijkstra.distanceTo(n);\n\n if (harmonic) {\n totalDistance += 1 / d;\n } else {\n totalDistance += d;\n }\n }\n }\n\n return harmonic ? totalDistance : 1 / totalDistance;\n } // closenessCentrality\n\n}; // elesfn\n// nice, short mathemathical alias\n\nelesfn$9.cc = elesfn$9.closenessCentrality;\nelesfn$9.ccn = elesfn$9.closenessCentralityNormalised = elesfn$9.closenessCentralityNormalized;\n\nvar defaults$3 = defaults({\n weight: null,\n directed: false\n});\nvar elesfn$a = {\n // Implemented from the algorithm in the paper \"On Variants of Shortest-Path Betweenness Centrality and their Generic Computation\" by Ulrik Brandes\n betweennessCentrality: function betweennessCentrality(options) {\n var _defaults = defaults$3(options),\n directed = _defaults.directed,\n weight = _defaults.weight;\n\n var weighted = weight != null;\n var cy = this.cy(); // starting\n\n var V = this.nodes();\n var A = {};\n var _C = {};\n var max = 0;\n var C = {\n set: function set(key, val) {\n _C[key] = val;\n\n if (val > max) {\n max = val;\n }\n },\n get: function get(key) {\n return _C[key];\n }\n }; // A contains the neighborhoods of every node\n\n for (var i = 0; i < V.length; i++) {\n var v = V[i];\n var vid = v.id();\n\n if (directed) {\n A[vid] = v.outgoers().nodes(); // get outgoers of every node\n } else {\n A[vid] = v.openNeighborhood().nodes(); // get neighbors of every node\n }\n\n C.set(vid, 0);\n }\n\n var _loop = function _loop(s) {\n var sid = V[s].id();\n var S = []; // stack\n\n var P = {};\n var g = {};\n var d = {};\n var Q = new Heap(function (a, b) {\n return d[a] - d[b];\n }); // queue\n // init dictionaries\n\n for (var _i = 0; _i < V.length; _i++) {\n var _vid = V[_i].id();\n\n P[_vid] = [];\n g[_vid] = 0;\n d[_vid] = Infinity;\n }\n\n g[sid] = 1; // sigma\n\n d[sid] = 0; // distance to s\n\n Q.push(sid);\n\n while (!Q.empty()) {\n var _v = Q.pop();\n\n S.push(_v);\n\n if (weighted) {\n for (var j = 0; j < A[_v].length; j++) {\n var w = A[_v][j];\n var vEle = cy.getElementById(_v);\n var edge = void 0;\n\n if (vEle.edgesTo(w).length > 0) {\n edge = vEle.edgesTo(w)[0];\n } else {\n edge = w.edgesTo(vEle)[0];\n }\n\n var edgeWeight = weight(edge);\n w = w.id();\n\n if (d[w] > d[_v] + edgeWeight) {\n d[w] = d[_v] + edgeWeight;\n\n if (Q.nodes.indexOf(w) < 0) {\n //if w is not in Q\n Q.push(w);\n } else {\n // update position if w is in Q\n Q.updateItem(w);\n }\n\n g[w] = 0;\n P[w] = [];\n }\n\n if (d[w] == d[_v] + edgeWeight) {\n g[w] = g[w] + g[_v];\n P[w].push(_v);\n }\n }\n } else {\n for (var _j = 0; _j < A[_v].length; _j++) {\n var _w = A[_v][_j].id();\n\n if (d[_w] == Infinity) {\n Q.push(_w);\n d[_w] = d[_v] + 1;\n }\n\n if (d[_w] == d[_v] + 1) {\n g[_w] = g[_w] + g[_v];\n\n P[_w].push(_v);\n }\n }\n }\n }\n\n var e = {};\n\n for (var _i2 = 0; _i2 < V.length; _i2++) {\n e[V[_i2].id()] = 0;\n }\n\n while (S.length > 0) {\n var _w2 = S.pop();\n\n for (var _j2 = 0; _j2 < P[_w2].length; _j2++) {\n var _v2 = P[_w2][_j2];\n e[_v2] = e[_v2] + g[_v2] / g[_w2] * (1 + e[_w2]);\n\n if (_w2 != V[s].id()) {\n C.set(_w2, C.get(_w2) + e[_w2]);\n }\n }\n }\n };\n\n for (var s = 0; s < V.length; s++) {\n _loop(s);\n }\n\n var ret = {\n betweenness: function betweenness(node) {\n var id = cy.collection(node).id();\n return C.get(id);\n },\n betweennessNormalized: function betweennessNormalized(node) {\n if (max == 0) {\n return 0;\n }\n\n var id = cy.collection(node).id();\n return C.get(id) / max;\n }\n }; // alias\n\n ret.betweennessNormalised = ret.betweennessNormalized;\n return ret;\n } // betweennessCentrality\n\n}; // elesfn\n// nice, short mathemathical alias\n\nelesfn$a.bc = elesfn$a.betweennessCentrality;\n\n// Implemented by Zoe Xi @zoexi for GSOC 2016\n/* eslint-disable no-unused-vars */\n\nvar defaults$4 = defaults({\n expandFactor: 2,\n // affects time of computation and cluster granularity to some extent: M * M\n inflateFactor: 2,\n // affects cluster granularity (the greater the value, the more clusters): M(i,j) / E(j)\n multFactor: 1,\n // optional self loops for each node. Use a neutral value to improve cluster computations.\n maxIterations: 20,\n // maximum number of iterations of the MCL algorithm in a single run\n attributes: [// attributes/features used to group nodes, ie. similarity values between nodes\n function (edge) {\n return 1;\n }]\n});\n/* eslint-enable */\n\nvar setOptions = function setOptions(options) {\n return defaults$4(options);\n};\n/* eslint-enable */\n\n\nvar getSimilarity = function getSimilarity(edge, attributes) {\n var total = 0;\n\n for (var i = 0; i < attributes.length; i++) {\n total += attributes[i](edge);\n }\n\n return total;\n};\n\nvar addLoops = function addLoops(M, n, val) {\n for (var i = 0; i < n; i++) {\n M[i * n + i] = val;\n }\n};\n\nvar normalize = function normalize(M, n) {\n var sum;\n\n for (var col = 0; col < n; col++) {\n sum = 0;\n\n for (var row = 0; row < n; row++) {\n sum += M[row * n + col];\n }\n\n for (var _row = 0; _row < n; _row++) {\n M[_row * n + col] = M[_row * n + col] / sum;\n }\n }\n}; // TODO: blocked matrix multiplication?\n\n\nvar mmult = function mmult(A, B, n) {\n var C = new Array(n * n);\n\n for (var i = 0; i < n; i++) {\n for (var j = 0; j < n; j++) {\n C[i * n + j] = 0;\n }\n\n for (var k = 0; k < n; k++) {\n for (var _j = 0; _j < n; _j++) {\n C[i * n + _j] += A[i * n + k] * B[k * n + _j];\n }\n }\n }\n\n return C;\n};\n\nvar expand = function expand(M, n, expandFactor\n/** power **/\n) {\n var _M = M.slice(0);\n\n for (var p = 1; p < expandFactor; p++) {\n M = mmult(M, _M, n);\n }\n\n return M;\n};\n\nvar inflate = function inflate(M, n, inflateFactor\n/** r **/\n) {\n var _M = new Array(n * n); // M(i,j) ^ inflatePower\n\n\n for (var i = 0; i < n * n; i++) {\n _M[i] = Math.pow(M[i], inflateFactor);\n }\n\n normalize(_M, n);\n return _M;\n};\n\nvar hasConverged = function hasConverged(M, _M, n2, roundFactor) {\n // Check that both matrices have the same elements (i,j)\n for (var i = 0; i < n2; i++) {\n var v1 = Math.round(M[i] * Math.pow(10, roundFactor)) / Math.pow(10, roundFactor); // truncate to 'roundFactor' decimal places\n\n var v2 = Math.round(_M[i] * Math.pow(10, roundFactor)) / Math.pow(10, roundFactor);\n\n if (v1 !== v2) {\n return false;\n }\n }\n\n return true;\n};\n\nvar assign = function assign(M, n, nodes, cy) {\n var clusters = [];\n\n for (var i = 0; i < n; i++) {\n var cluster = [];\n\n for (var j = 0; j < n; j++) {\n // Row-wise attractors and elements that they attract belong in same cluster\n if (Math.round(M[i * n + j] * 1000) / 1000 > 0) {\n cluster.push(nodes[j]);\n }\n }\n\n if (cluster.length !== 0) {\n clusters.push(cy.collection(cluster));\n }\n }\n\n return clusters;\n};\n\nvar isDuplicate = function isDuplicate(c1, c2) {\n for (var i = 0; i < c1.length; i++) {\n if (!c2[i] || c1[i].id() !== c2[i].id()) {\n return false;\n }\n }\n\n return true;\n};\n\nvar removeDuplicates = function removeDuplicates(clusters) {\n for (var i = 0; i < clusters.length; i++) {\n for (var j = 0; j < clusters.length; j++) {\n if (i != j && isDuplicate(clusters[i], clusters[j])) {\n clusters.splice(j, 1);\n }\n }\n }\n\n return clusters;\n};\n\nvar markovClustering = function markovClustering(options) {\n var nodes = this.nodes();\n var edges = this.edges();\n var cy = this.cy(); // Set parameters of algorithm:\n\n var opts = setOptions(options); // Map each node to its position in node array\n\n var id2position = {};\n\n for (var i = 0; i < nodes.length; i++) {\n id2position[nodes[i].id()] = i;\n } // Generate stochastic matrix M from input graph G (should be symmetric/undirected)\n\n\n var n = nodes.length,\n n2 = n * n;\n\n var M = new Array(n2),\n _M;\n\n for (var _i = 0; _i < n2; _i++) {\n M[_i] = 0;\n }\n\n for (var e = 0; e < edges.length; e++) {\n var edge = edges[e];\n var _i2 = id2position[edge.source().id()];\n var j = id2position[edge.target().id()];\n var sim = getSimilarity(edge, opts.attributes);\n M[_i2 * n + j] += sim; // G should be symmetric and undirected\n\n M[j * n + _i2] += sim;\n } // Begin Markov cluster algorithm\n // Step 1: Add self loops to each node, ie. add multFactor to matrix diagonal\n\n\n addLoops(M, n, opts.multFactor); // Step 2: M = normalize( M );\n\n normalize(M, n);\n var isStillMoving = true;\n var iterations = 0;\n\n while (isStillMoving && iterations < opts.maxIterations) {\n isStillMoving = false; // Step 3:\n\n _M = expand(M, n, opts.expandFactor); // Step 4:\n\n M = inflate(_M, n, opts.inflateFactor); // Step 5: check to see if ~steady state has been reached\n\n if (!hasConverged(M, _M, n2, 4)) {\n isStillMoving = true;\n }\n\n iterations++;\n } // Build clusters from matrix\n\n\n var clusters = assign(M, n, nodes, cy); // Remove duplicate clusters due to symmetry of graph and M matrix\n\n clusters = removeDuplicates(clusters);\n return clusters;\n};\n\nvar markovClustering$1 = {\n markovClustering: markovClustering,\n mcl: markovClustering\n};\n\n// Common distance metrics for clustering algorithms\n\nvar identity = function identity(x) {\n return x;\n};\n\nvar absDiff = function absDiff(p, q) {\n return Math.abs(q - p);\n};\n\nvar addAbsDiff = function addAbsDiff(total, p, q) {\n return total + absDiff(p, q);\n};\n\nvar addSquaredDiff = function addSquaredDiff(total, p, q) {\n return total + Math.pow(q - p, 2);\n};\n\nvar sqrt = function sqrt(x) {\n return Math.sqrt(x);\n};\n\nvar maxAbsDiff = function maxAbsDiff(currentMax, p, q) {\n return Math.max(currentMax, absDiff(p, q));\n};\n\nvar getDistance = function getDistance(length, getP, getQ, init, visit) {\n var post = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : identity;\n var ret = init;\n var p, q;\n\n for (var dim = 0; dim < length; dim++) {\n p = getP(dim);\n q = getQ(dim);\n ret = visit(ret, p, q);\n }\n\n return post(ret);\n};\n\nvar distances = {\n euclidean: function euclidean(length, getP, getQ) {\n if (length >= 2) {\n return getDistance(length, getP, getQ, 0, addSquaredDiff, sqrt);\n } else {\n // for single attr case, more efficient to avoid sqrt\n return getDistance(length, getP, getQ, 0, addAbsDiff);\n }\n },\n squaredEuclidean: function squaredEuclidean(length, getP, getQ) {\n return getDistance(length, getP, getQ, 0, addSquaredDiff);\n },\n manhattan: function manhattan(length, getP, getQ) {\n return getDistance(length, getP, getQ, 0, addAbsDiff);\n },\n max: function max(length, getP, getQ) {\n return getDistance(length, getP, getQ, -Infinity, maxAbsDiff);\n }\n}; // in case the user accidentally doesn't use camel case\n\ndistances['squared-euclidean'] = distances['squaredEuclidean'];\ndistances['squaredeuclidean'] = distances['squaredEuclidean'];\nfunction clusteringDistance (method, length, getP, getQ, nodeP, nodeQ) {\n var impl;\n\n if (fn(method)) {\n impl = method;\n } else {\n impl = distances[method] || distances.euclidean;\n }\n\n if (length === 0 && fn(method)) {\n return impl(nodeP, nodeQ);\n } else {\n return impl(length, getP, getQ, nodeP, nodeQ);\n }\n}\n\nvar defaults$5 = defaults({\n k: 2,\n m: 2,\n sensitivityThreshold: 0.0001,\n distance: 'euclidean',\n maxIterations: 10,\n attributes: [],\n testMode: false,\n testCentroids: null\n});\n\nvar setOptions$1 = function setOptions(options) {\n return defaults$5(options);\n};\n/* eslint-enable */\n\n\nvar getDist = function getDist(type, node, centroid, attributes, mode) {\n var noNodeP = mode !== 'kMedoids';\n var getP = noNodeP ? function (i) {\n return centroid[i];\n } : function (i) {\n return attributes[i](centroid);\n };\n\n var getQ = function getQ(i) {\n return attributes[i](node);\n };\n\n var nodeP = centroid;\n var nodeQ = node;\n return clusteringDistance(type, attributes.length, getP, getQ, nodeP, nodeQ);\n};\n\nvar randomCentroids = function randomCentroids(nodes, k, attributes) {\n var ndim = attributes.length;\n var min = new Array(ndim);\n var max = new Array(ndim);\n var centroids = new Array(k);\n var centroid = null; // Find min, max values for each attribute dimension\n\n for (var i = 0; i < ndim; i++) {\n min[i] = nodes.min(attributes[i]).value;\n max[i] = nodes.max(attributes[i]).value;\n } // Build k centroids, each represented as an n-dim feature vector\n\n\n for (var c = 0; c < k; c++) {\n centroid = [];\n\n for (var _i = 0; _i < ndim; _i++) {\n centroid[_i] = Math.random() * (max[_i] - min[_i]) + min[_i]; // random initial value\n }\n\n centroids[c] = centroid;\n }\n\n return centroids;\n};\n\nvar classify = function classify(node, centroids, distance, attributes, type) {\n var min = Infinity;\n var index = 0;\n\n for (var i = 0; i < centroids.length; i++) {\n var dist = getDist(distance, node, centroids[i], attributes, type);\n\n if (dist < min) {\n min = dist;\n index = i;\n }\n }\n\n return index;\n};\n\nvar buildCluster = function buildCluster(centroid, nodes, assignment) {\n var cluster = [];\n var node = null;\n\n for (var n = 0; n < nodes.length; n++) {\n node = nodes[n];\n\n if (assignment[node.id()] === centroid) {\n //console.log(\"Node \" + node.id() + \" is associated with medoid #: \" + m);\n cluster.push(node);\n }\n }\n\n return cluster;\n};\n\nvar haveValuesConverged = function haveValuesConverged(v1, v2, sensitivityThreshold) {\n return Math.abs(v2 - v1) <= sensitivityThreshold;\n};\n\nvar haveMatricesConverged = function haveMatricesConverged(v1, v2, sensitivityThreshold) {\n for (var i = 0; i < v1.length; i++) {\n for (var j = 0; j < v1[i].length; j++) {\n var diff = Math.abs(v1[i][j] - v2[i][j]);\n\n if (diff > sensitivityThreshold) {\n return false;\n }\n }\n }\n\n return true;\n};\n\nvar seenBefore = function seenBefore(node, medoids, n) {\n for (var i = 0; i < n; i++) {\n if (node === medoids[i]) return true;\n }\n\n return false;\n};\n\nvar randomMedoids = function randomMedoids(nodes, k) {\n var medoids = new Array(k); // For small data sets, the probability of medoid conflict is greater,\n // so we need to check to see if we've already seen or chose this node before.\n\n if (nodes.length < 50) {\n // Randomly select k medoids from the n nodes\n for (var i = 0; i < k; i++) {\n var node = nodes[Math.floor(Math.random() * nodes.length)]; // If we've already chosen this node to be a medoid, don't choose it again (for small data sets).\n // Instead choose a different random node.\n\n while (seenBefore(node, medoids, i)) {\n node = nodes[Math.floor(Math.random() * nodes.length)];\n }\n\n medoids[i] = node;\n }\n } else {\n // Relatively large data set, so pretty safe to not check and just select random nodes\n for (var _i2 = 0; _i2 < k; _i2++) {\n medoids[_i2] = nodes[Math.floor(Math.random() * nodes.length)];\n }\n }\n\n return medoids;\n};\n\nvar findCost = function findCost(potentialNewMedoid, cluster, attributes) {\n var cost = 0;\n\n for (var n = 0; n < cluster.length; n++) {\n cost += getDist('manhattan', cluster[n], potentialNewMedoid, attributes, 'kMedoids');\n }\n\n return cost;\n};\n\nvar kMeans = function kMeans(options) {\n var cy = this.cy();\n var nodes = this.nodes();\n var node = null; // Set parameters of algorithm: # of clusters, distance metric, etc.\n\n var opts = setOptions$1(options); // Begin k-means algorithm\n\n var clusters = new Array(opts.k);\n var assignment = {};\n var centroids; // Step 1: Initialize centroid positions\n\n if (opts.testMode) {\n if (typeof opts.testCentroids === 'number') {\n centroids = randomCentroids(nodes, opts.k, opts.attributes);\n } else if (_typeof(opts.testCentroids) === 'object') {\n centroids = opts.testCentroids;\n } else {\n centroids = randomCentroids(nodes, opts.k, opts.attributes);\n }\n } else {\n centroids = randomCentroids(nodes, opts.k, opts.attributes);\n }\n\n var isStillMoving = true;\n var iterations = 0;\n\n while (isStillMoving && iterations < opts.maxIterations) {\n // Step 2: Assign nodes to the nearest centroid\n for (var n = 0; n < nodes.length; n++) {\n node = nodes[n]; // Determine which cluster this node belongs to: node id => cluster #\n\n assignment[node.id()] = classify(node, centroids, opts.distance, opts.attributes, 'kMeans');\n } // Step 3: For each of the k clusters, update its centroid\n\n\n isStillMoving = false;\n\n for (var c = 0; c < opts.k; c++) {\n // Get all nodes that belong to this cluster\n var cluster = buildCluster(c, nodes, assignment);\n\n if (cluster.length === 0) {\n // If cluster is empty, break out early & move to next cluster\n continue;\n } // Update centroids by calculating avg of all nodes within the cluster.\n\n\n var ndim = opts.attributes.length;\n var centroid = centroids[c]; // [ dim_1, dim_2, dim_3, ... , dim_n ]\n\n var newCentroid = new Array(ndim);\n var sum = new Array(ndim);\n\n for (var d = 0; d < ndim; d++) {\n sum[d] = 0.0;\n\n for (var i = 0; i < cluster.length; i++) {\n node = cluster[i];\n sum[d] += opts.attributes[d](node);\n }\n\n newCentroid[d] = sum[d] / cluster.length; // Check to see if algorithm has converged, i.e. when centroids no longer change\n\n if (!haveValuesConverged(newCentroid[d], centroid[d], opts.sensitivityThreshold)) {\n isStillMoving = true;\n }\n }\n\n centroids[c] = newCentroid;\n clusters[c] = cy.collection(cluster);\n }\n\n iterations++;\n }\n\n return clusters;\n};\n\nvar kMedoids = function kMedoids(options) {\n var cy = this.cy();\n var nodes = this.nodes();\n var node = null;\n var opts = setOptions$1(options); // Begin k-medoids algorithm\n\n var clusters = new Array(opts.k);\n var medoids;\n var assignment = {};\n var curCost;\n var minCosts = new Array(opts.k); // minimum cost configuration for each cluster\n // Step 1: Initialize k medoids\n\n if (opts.testMode) {\n if (typeof opts.testCentroids === 'number') ; else if (_typeof(opts.testCentroids) === 'object') {\n medoids = opts.testCentroids;\n } else {\n medoids = randomMedoids(nodes, opts.k);\n }\n } else {\n medoids = randomMedoids(nodes, opts.k);\n }\n\n var isStillMoving = true;\n var iterations = 0;\n\n while (isStillMoving && iterations < opts.maxIterations) {\n // Step 2: Assign nodes to the nearest medoid\n for (var n = 0; n < nodes.length; n++) {\n node = nodes[n]; // Determine which cluster this node belongs to: node id => cluster #\n\n assignment[node.id()] = classify(node, medoids, opts.distance, opts.attributes, 'kMedoids');\n }\n\n isStillMoving = false; // Step 3: For each medoid m, and for each node assciated with mediod m,\n // select the node with the lowest configuration cost as new medoid.\n\n for (var m = 0; m < medoids.length; m++) {\n // Get all nodes that belong to this medoid\n var cluster = buildCluster(m, nodes, assignment);\n\n if (cluster.length === 0) {\n // If cluster is empty, break out early & move to next cluster\n continue;\n }\n\n minCosts[m] = findCost(medoids[m], cluster, opts.attributes); // original cost\n // Select different medoid if its configuration has the lowest cost\n\n for (var _n = 0; _n < cluster.length; _n++) {\n curCost = findCost(cluster[_n], cluster, opts.attributes);\n\n if (curCost < minCosts[m]) {\n minCosts[m] = curCost;\n medoids[m] = cluster[_n];\n isStillMoving = true;\n }\n }\n\n clusters[m] = cy.collection(cluster);\n }\n\n iterations++;\n }\n\n return clusters;\n};\n\nvar updateCentroids = function updateCentroids(centroids, nodes, U, weight, opts) {\n var numerator, denominator;\n\n for (var n = 0; n < nodes.length; n++) {\n for (var c = 0; c < centroids.length; c++) {\n weight[n][c] = Math.pow(U[n][c], opts.m);\n }\n }\n\n for (var _c = 0; _c < centroids.length; _c++) {\n for (var dim = 0; dim < opts.attributes.length; dim++) {\n numerator = 0;\n denominator = 0;\n\n for (var _n2 = 0; _n2 < nodes.length; _n2++) {\n numerator += weight[_n2][_c] * opts.attributes[dim](nodes[_n2]);\n denominator += weight[_n2][_c];\n }\n\n centroids[_c][dim] = numerator / denominator;\n }\n }\n};\n\nvar updateMembership = function updateMembership(U, _U, centroids, nodes, opts) {\n // Save previous step\n for (var i = 0; i < U.length; i++) {\n _U[i] = U[i].slice();\n }\n\n var sum, numerator, denominator;\n var pow = 2 / (opts.m - 1);\n\n for (var c = 0; c < centroids.length; c++) {\n for (var n = 0; n < nodes.length; n++) {\n sum = 0;\n\n for (var k = 0; k < centroids.length; k++) {\n // against all other centroids\n numerator = getDist(opts.distance, nodes[n], centroids[c], opts.attributes, 'cmeans');\n denominator = getDist(opts.distance, nodes[n], centroids[k], opts.attributes, 'cmeans');\n sum += Math.pow(numerator / denominator, pow);\n }\n\n U[n][c] = 1 / sum;\n }\n }\n};\n\nvar assign$1 = function assign(nodes, U, opts, cy) {\n var clusters = new Array(opts.k);\n\n for (var c = 0; c < clusters.length; c++) {\n clusters[c] = [];\n }\n\n var max;\n var index;\n\n for (var n = 0; n < U.length; n++) {\n // for each node (U is N x C matrix)\n max = -Infinity;\n index = -1; // Determine which cluster the node is most likely to belong in\n\n for (var _c2 = 0; _c2 < U[0].length; _c2++) {\n if (U[n][_c2] > max) {\n max = U[n][_c2];\n index = _c2;\n }\n }\n\n clusters[index].push(nodes[n]);\n } // Turn every array into a collection of nodes\n\n\n for (var _c3 = 0; _c3 < clusters.length; _c3++) {\n clusters[_c3] = cy.collection(clusters[_c3]);\n }\n\n return clusters;\n};\n\nvar fuzzyCMeans = function fuzzyCMeans(options) {\n var cy = this.cy();\n var nodes = this.nodes();\n var opts = setOptions$1(options); // Begin fuzzy c-means algorithm\n\n var clusters;\n var centroids;\n var U;\n\n var _U;\n\n var weight; // Step 1: Initialize letiables.\n\n _U = new Array(nodes.length);\n\n for (var i = 0; i < nodes.length; i++) {\n // N x C matrix\n _U[i] = new Array(opts.k);\n }\n\n U = new Array(nodes.length);\n\n for (var _i3 = 0; _i3 < nodes.length; _i3++) {\n // N x C matrix\n U[_i3] = new Array(opts.k);\n }\n\n for (var _i4 = 0; _i4 < nodes.length; _i4++) {\n var total = 0;\n\n for (var j = 0; j < opts.k; j++) {\n U[_i4][j] = Math.random();\n total += U[_i4][j];\n }\n\n for (var _j = 0; _j < opts.k; _j++) {\n U[_i4][_j] = U[_i4][_j] / total;\n }\n }\n\n centroids = new Array(opts.k);\n\n for (var _i5 = 0; _i5 < opts.k; _i5++) {\n centroids[_i5] = new Array(opts.attributes.length);\n }\n\n weight = new Array(nodes.length);\n\n for (var _i6 = 0; _i6 < nodes.length; _i6++) {\n // N x C matrix\n weight[_i6] = new Array(opts.k);\n } // end init FCM\n\n\n var isStillMoving = true;\n var iterations = 0;\n\n while (isStillMoving && iterations < opts.maxIterations) {\n isStillMoving = false; // Step 2: Calculate the centroids for each step.\n\n updateCentroids(centroids, nodes, U, weight, opts); // Step 3: Update the partition matrix U.\n\n updateMembership(U, _U, centroids, nodes, opts); // Step 4: Check for convergence.\n\n if (!haveMatricesConverged(U, _U, opts.sensitivityThreshold)) {\n isStillMoving = true;\n }\n\n iterations++;\n } // Assign nodes to clusters with highest probability.\n\n\n clusters = assign$1(nodes, U, opts, cy);\n return {\n clusters: clusters,\n degreeOfMembership: U\n };\n};\n\nvar kClustering = {\n kMeans: kMeans,\n kMedoids: kMedoids,\n fuzzyCMeans: fuzzyCMeans,\n fcm: fuzzyCMeans\n};\n\n// Implemented by Zoe Xi @zoexi for GSOC 2016\nvar defaults$6 = defaults({\n distance: 'euclidean',\n // distance metric to compare nodes\n linkage: 'min',\n // linkage criterion : how to determine the distance between clusters of nodes\n mode: 'threshold',\n // mode:'threshold' => clusters must be threshold distance apart\n threshold: Infinity,\n // the distance threshold\n // mode:'dendrogram' => the nodes are organised as leaves in a tree (siblings are close), merging makes clusters\n addDendrogram: false,\n // whether to add the dendrogram to the graph for viz\n dendrogramDepth: 0,\n // depth at which dendrogram branches are merged into the returned clusters\n attributes: [] // array of attr functions\n\n});\nvar linkageAliases = {\n 'single': 'min',\n 'complete': 'max'\n};\n\nvar setOptions$2 = function setOptions(options) {\n var opts = defaults$6(options);\n var preferredAlias = linkageAliases[opts.linkage];\n\n if (preferredAlias != null) {\n opts.linkage = preferredAlias;\n }\n\n return opts;\n};\n\nvar mergeClosest = function mergeClosest(clusters, index, dists, mins, opts) {\n // Find two closest clusters from cached mins\n var minKey = 0;\n var min = Infinity;\n var dist;\n var attrs = opts.attributes;\n\n var getDist = function getDist(n1, n2) {\n return clusteringDistance(opts.distance, attrs.length, function (i) {\n return attrs[i](n1);\n }, function (i) {\n return attrs[i](n2);\n }, n1, n2);\n };\n\n for (var i = 0; i < clusters.length; i++) {\n var key = clusters[i].key;\n var _dist = dists[key][mins[key]];\n\n if (_dist < min) {\n minKey = key;\n min = _dist;\n }\n }\n\n if (opts.mode === 'threshold' && min >= opts.threshold || opts.mode === 'dendrogram' && clusters.length === 1) {\n return false;\n }\n\n var c1 = index[minKey];\n var c2 = index[mins[minKey]];\n var merged; // Merge two closest clusters\n\n if (opts.mode === 'dendrogram') {\n merged = {\n left: c1,\n right: c2,\n key: c1.key\n };\n } else {\n merged = {\n value: c1.value.concat(c2.value),\n key: c1.key\n };\n }\n\n clusters[c1.index] = merged;\n clusters.splice(c2.index, 1);\n index[c1.key] = merged; // Update distances with new merged cluster\n\n for (var _i = 0; _i < clusters.length; _i++) {\n var cur = clusters[_i];\n\n if (c1.key === cur.key) {\n dist = Infinity;\n } else if (opts.linkage === 'min') {\n dist = dists[c1.key][cur.key];\n\n if (dists[c1.key][cur.key] > dists[c2.key][cur.key]) {\n dist = dists[c2.key][cur.key];\n }\n } else if (opts.linkage === 'max') {\n dist = dists[c1.key][cur.key];\n\n if (dists[c1.key][cur.key] < dists[c2.key][cur.key]) {\n dist = dists[c2.key][cur.key];\n }\n } else if (opts.linkage === 'mean') {\n dist = (dists[c1.key][cur.key] * c1.size + dists[c2.key][cur.key] * c2.size) / (c1.size + c2.size);\n } else {\n if (opts.mode === 'dendrogram') dist = getDist(cur.value, c1.value);else dist = getDist(cur.value[0], c1.value[0]);\n }\n\n dists[c1.key][cur.key] = dists[cur.key][c1.key] = dist; // distance matrix is symmetric\n } // Update cached mins\n\n\n for (var _i2 = 0; _i2 < clusters.length; _i2++) {\n var key1 = clusters[_i2].key;\n\n if (mins[key1] === c1.key || mins[key1] === c2.key) {\n var _min = key1;\n\n for (var j = 0; j < clusters.length; j++) {\n var key2 = clusters[j].key;\n\n if (dists[key1][key2] < dists[key1][_min]) {\n _min = key2;\n }\n }\n\n mins[key1] = _min;\n }\n\n clusters[_i2].index = _i2;\n } // Clean up meta data used for clustering\n\n\n c1.key = c2.key = c1.index = c2.index = null;\n return true;\n};\n\nvar getAllChildren = function getAllChildren(root, arr, cy) {\n if (!root) return;\n\n if (root.value) {\n arr.push(root.value);\n } else {\n if (root.left) getAllChildren(root.left, arr);\n if (root.right) getAllChildren(root.right, arr);\n }\n};\n\nvar buildDendrogram = function buildDendrogram(root, cy) {\n if (!root) return '';\n\n if (root.left && root.right) {\n var leftStr = buildDendrogram(root.left, cy);\n var rightStr = buildDendrogram(root.right, cy);\n var node = cy.add({\n group: 'nodes',\n data: {\n id: leftStr + ',' + rightStr\n }\n });\n cy.add({\n group: 'edges',\n data: {\n source: leftStr,\n target: node.id()\n }\n });\n cy.add({\n group: 'edges',\n data: {\n source: rightStr,\n target: node.id()\n }\n });\n return node.id();\n } else if (root.value) {\n return root.value.id();\n }\n};\n\nvar buildClustersFromTree = function buildClustersFromTree(root, k, cy) {\n if (!root) return [];\n var left = [],\n right = [],\n leaves = [];\n\n if (k === 0) {\n // don't cut tree, simply return all nodes as 1 single cluster\n if (root.left) getAllChildren(root.left, left);\n if (root.right) getAllChildren(root.right, right);\n leaves = left.concat(right);\n return [cy.collection(leaves)];\n } else if (k === 1) {\n // cut at root\n if (root.value) {\n // leaf node\n return [cy.collection(root.value)];\n } else {\n if (root.left) getAllChildren(root.left, left);\n if (root.right) getAllChildren(root.right, right);\n return [cy.collection(left), cy.collection(right)];\n }\n } else {\n if (root.value) {\n return [cy.collection(root.value)];\n } else {\n if (root.left) left = buildClustersFromTree(root.left, k - 1, cy);\n if (root.right) right = buildClustersFromTree(root.right, k - 1, cy);\n return left.concat(right);\n }\n }\n};\n/* eslint-enable */\n\n\nvar hierarchicalClustering = function hierarchicalClustering(options) {\n var cy = this.cy();\n var nodes = this.nodes(); // Set parameters of algorithm: linkage type, distance metric, etc.\n\n var opts = setOptions$2(options);\n var attrs = opts.attributes;\n\n var getDist = function getDist(n1, n2) {\n return clusteringDistance(opts.distance, attrs.length, function (i) {\n return attrs[i](n1);\n }, function (i) {\n return attrs[i](n2);\n }, n1, n2);\n }; // Begin hierarchical algorithm\n\n\n var clusters = [];\n var dists = []; // distances between each pair of clusters\n\n var mins = []; // closest cluster for each cluster\n\n var index = []; // hash of all clusters by key\n // In agglomerative (bottom-up) clustering, each node starts as its own cluster\n\n for (var n = 0; n < nodes.length; n++) {\n var cluster = {\n value: opts.mode === 'dendrogram' ? nodes[n] : [nodes[n]],\n key: n,\n index: n\n };\n clusters[n] = cluster;\n index[n] = cluster;\n dists[n] = [];\n mins[n] = 0;\n } // Calculate the distance between each pair of clusters\n\n\n for (var i = 0; i < clusters.length; i++) {\n for (var j = 0; j <= i; j++) {\n var dist = void 0;\n\n if (opts.mode === 'dendrogram') {\n // modes store cluster values differently\n dist = i === j ? Infinity : getDist(clusters[i].value, clusters[j].value);\n } else {\n dist = i === j ? Infinity : getDist(clusters[i].value[0], clusters[j].value[0]);\n }\n\n dists[i][j] = dist;\n dists[j][i] = dist;\n\n if (dist < dists[i][mins[i]]) {\n mins[i] = j; // Cache mins: closest cluster to cluster i is cluster j\n }\n }\n } // Find the closest pair of clusters and merge them into a single cluster.\n // Update distances between new cluster and each of the old clusters, and loop until threshold reached.\n\n\n var merged = mergeClosest(clusters, index, dists, mins, opts);\n\n while (merged) {\n merged = mergeClosest(clusters, index, dists, mins, opts);\n }\n\n var retClusters; // Dendrogram mode builds the hierarchy and adds intermediary nodes + edges\n // in addition to returning the clusters.\n\n if (opts.mode === 'dendrogram') {\n retClusters = buildClustersFromTree(clusters[0], opts.dendrogramDepth, cy);\n if (opts.addDendrogram) buildDendrogram(clusters[0], cy);\n } else {\n // Regular mode simply returns the clusters\n retClusters = new Array(clusters.length);\n clusters.forEach(function (cluster, i) {\n // Clean up meta data used for clustering\n cluster.key = cluster.index = null;\n retClusters[i] = cy.collection(cluster.value);\n });\n }\n\n return retClusters;\n};\n\nvar hierarchicalClustering$1 = {\n hierarchicalClustering: hierarchicalClustering,\n hca: hierarchicalClustering\n};\n\n// Implemented by Zoe Xi @zoexi for GSOC 2016\nvar defaults$7 = defaults({\n distance: 'euclidean',\n // distance metric to compare attributes between two nodes\n preference: 'median',\n // suitability of a data point to serve as an exemplar\n damping: 0.8,\n // damping factor between [0.5, 1)\n maxIterations: 1000,\n // max number of iterations to run\n minIterations: 100,\n // min number of iterations to run in order for clustering to stop\n attributes: [// functions to quantify the similarity between any two points\n // e.g. node => node.data('weight')\n ]\n});\n\nvar setOptions$3 = function setOptions(options) {\n var dmp = options.damping;\n var pref = options.preference;\n\n if (!(0.5 <= dmp && dmp < 1)) {\n error(\"Damping must range on [0.5, 1). Got: \".concat(dmp));\n }\n\n var validPrefs = ['median', 'mean', 'min', 'max'];\n\n if (!(validPrefs.some(function (v) {\n return v === pref;\n }) || number(pref))) {\n error(\"Preference must be one of [\".concat(validPrefs.map(function (p) {\n return \"'\".concat(p, \"'\");\n }).join(', '), \"] or a number. Got: \").concat(pref));\n }\n\n return defaults$7(options);\n};\n/* eslint-enable */\n\n\nvar getSimilarity$1 = function getSimilarity(type, n1, n2, attributes) {\n var attr = function attr(n, i) {\n return attributes[i](n);\n }; // nb negative because similarity should have an inverse relationship to distance\n\n\n return -clusteringDistance(type, attributes.length, function (i) {\n return attr(n1, i);\n }, function (i) {\n return attr(n2, i);\n }, n1, n2);\n};\n\nvar getPreference = function getPreference(S, preference) {\n // larger preference = greater # of clusters\n var p = null;\n\n if (preference === 'median') {\n p = median(S);\n } else if (preference === 'mean') {\n p = mean(S);\n } else if (preference === 'min') {\n p = min(S);\n } else if (preference === 'max') {\n p = max(S);\n } else {\n // Custom preference number, as set by user\n p = preference;\n }\n\n return p;\n};\n\nvar findExemplars = function findExemplars(n, R, A) {\n var indices = [];\n\n for (var i = 0; i < n; i++) {\n if (R[i * n + i] + A[i * n + i] > 0) {\n indices.push(i);\n }\n }\n\n return indices;\n};\n\nvar assignClusters = function assignClusters(n, S, exemplars) {\n var clusters = [];\n\n for (var i = 0; i < n; i++) {\n var index = -1;\n var max = -Infinity;\n\n for (var ei = 0; ei < exemplars.length; ei++) {\n var e = exemplars[ei];\n\n if (S[i * n + e] > max) {\n index = e;\n max = S[i * n + e];\n }\n }\n\n if (index > 0) {\n clusters.push(index);\n }\n }\n\n for (var _ei = 0; _ei < exemplars.length; _ei++) {\n clusters[exemplars[_ei]] = exemplars[_ei];\n }\n\n return clusters;\n};\n\nvar assign$2 = function assign(n, S, exemplars) {\n var clusters = assignClusters(n, S, exemplars);\n\n for (var ei = 0; ei < exemplars.length; ei++) {\n var ii = [];\n\n for (var c = 0; c < clusters.length; c++) {\n if (clusters[c] === exemplars[ei]) {\n ii.push(c);\n }\n }\n\n var maxI = -1;\n var maxSum = -Infinity;\n\n for (var i = 0; i < ii.length; i++) {\n var sum = 0;\n\n for (var j = 0; j < ii.length; j++) {\n sum += S[ii[j] * n + ii[i]];\n }\n\n if (sum > maxSum) {\n maxI = i;\n maxSum = sum;\n }\n }\n\n exemplars[ei] = ii[maxI];\n }\n\n clusters = assignClusters(n, S, exemplars);\n return clusters;\n};\n\nvar affinityPropagation = function affinityPropagation(options) {\n var cy = this.cy();\n var nodes = this.nodes();\n var opts = setOptions$3(options); // Map each node to its position in node array\n\n var id2position = {};\n\n for (var i = 0; i < nodes.length; i++) {\n id2position[nodes[i].id()] = i;\n } // Begin affinity propagation algorithm\n\n\n var n; // number of data points\n\n var n2; // size of matrices\n\n var S; // similarity matrix (1D array)\n\n var p; // preference/suitability of a data point to serve as an exemplar\n\n var R; // responsibility matrix (1D array)\n\n var A; // availability matrix (1D array)\n\n n = nodes.length;\n n2 = n * n; // Initialize and build S similarity matrix\n\n S = new Array(n2);\n\n for (var _i = 0; _i < n2; _i++) {\n S[_i] = -Infinity; // for cases where two data points shouldn't be linked together\n }\n\n for (var _i2 = 0; _i2 < n; _i2++) {\n for (var j = 0; j < n; j++) {\n if (_i2 !== j) {\n S[_i2 * n + j] = getSimilarity$1(opts.distance, nodes[_i2], nodes[j], opts.attributes);\n }\n }\n } // Place preferences on the diagonal of S\n\n\n p = getPreference(S, opts.preference);\n\n for (var _i3 = 0; _i3 < n; _i3++) {\n S[_i3 * n + _i3] = p;\n } // Initialize R responsibility matrix\n\n\n R = new Array(n2);\n\n for (var _i4 = 0; _i4 < n2; _i4++) {\n R[_i4] = 0.0;\n } // Initialize A availability matrix\n\n\n A = new Array(n2);\n\n for (var _i5 = 0; _i5 < n2; _i5++) {\n A[_i5] = 0.0;\n }\n\n var old = new Array(n);\n var Rp = new Array(n);\n var se = new Array(n);\n\n for (var _i6 = 0; _i6 < n; _i6++) {\n old[_i6] = 0.0;\n Rp[_i6] = 0.0;\n se[_i6] = 0;\n }\n\n var e = new Array(n * opts.minIterations);\n\n for (var _i7 = 0; _i7 < e.length; _i7++) {\n e[_i7] = 0;\n }\n\n var iter;\n\n for (iter = 0; iter < opts.maxIterations; iter++) {\n // main algorithmic loop\n // Update R responsibility matrix\n for (var _i8 = 0; _i8 < n; _i8++) {\n var max = -Infinity,\n max2 = -Infinity,\n maxI = -1,\n AS = 0.0;\n\n for (var _j = 0; _j < n; _j++) {\n old[_j] = R[_i8 * n + _j];\n AS = A[_i8 * n + _j] + S[_i8 * n + _j];\n\n if (AS >= max) {\n max2 = max;\n max = AS;\n maxI = _j;\n } else if (AS > max2) {\n max2 = AS;\n }\n }\n\n for (var _j2 = 0; _j2 < n; _j2++) {\n R[_i8 * n + _j2] = (1 - opts.damping) * (S[_i8 * n + _j2] - max) + opts.damping * old[_j2];\n }\n\n R[_i8 * n + maxI] = (1 - opts.damping) * (S[_i8 * n + maxI] - max2) + opts.damping * old[maxI];\n } // Update A availability matrix\n\n\n for (var _i9 = 0; _i9 < n; _i9++) {\n var sum = 0;\n\n for (var _j3 = 0; _j3 < n; _j3++) {\n old[_j3] = A[_j3 * n + _i9];\n Rp[_j3] = Math.max(0, R[_j3 * n + _i9]);\n sum += Rp[_j3];\n }\n\n sum -= Rp[_i9];\n Rp[_i9] = R[_i9 * n + _i9];\n sum += Rp[_i9];\n\n for (var _j4 = 0; _j4 < n; _j4++) {\n A[_j4 * n + _i9] = (1 - opts.damping) * Math.min(0, sum - Rp[_j4]) + opts.damping * old[_j4];\n }\n\n A[_i9 * n + _i9] = (1 - opts.damping) * (sum - Rp[_i9]) + opts.damping * old[_i9];\n } // Check for convergence\n\n\n var K = 0;\n\n for (var _i10 = 0; _i10 < n; _i10++) {\n var E = A[_i10 * n + _i10] + R[_i10 * n + _i10] > 0 ? 1 : 0;\n e[iter % opts.minIterations * n + _i10] = E;\n K += E;\n }\n\n if (K > 0 && (iter >= opts.minIterations - 1 || iter == opts.maxIterations - 1)) {\n var _sum = 0;\n\n for (var _i11 = 0; _i11 < n; _i11++) {\n se[_i11] = 0;\n\n for (var _j5 = 0; _j5 < opts.minIterations; _j5++) {\n se[_i11] += e[_j5 * n + _i11];\n }\n\n if (se[_i11] === 0 || se[_i11] === opts.minIterations) {\n _sum++;\n }\n }\n\n if (_sum === n) {\n // then we have convergence\n break;\n }\n }\n } // Identify exemplars (cluster centers)\n\n\n var exemplarsIndices = findExemplars(n, R, A); // Assign nodes to clusters\n\n var clusterIndices = assign$2(n, S, exemplarsIndices);\n var clusters = {};\n\n for (var c = 0; c < exemplarsIndices.length; c++) {\n clusters[exemplarsIndices[c]] = [];\n }\n\n for (var _i12 = 0; _i12 < nodes.length; _i12++) {\n var pos = id2position[nodes[_i12].id()];\n\n var clusterIndex = clusterIndices[pos];\n\n if (clusterIndex != null) {\n // the node may have not been assigned a cluster if no valid attributes were specified\n clusters[clusterIndex].push(nodes[_i12]);\n }\n }\n\n var retClusters = new Array(exemplarsIndices.length);\n\n for (var _c = 0; _c < exemplarsIndices.length; _c++) {\n retClusters[_c] = cy.collection(clusters[exemplarsIndices[_c]]);\n }\n\n return retClusters;\n};\n\nvar affinityPropagation$1 = {\n affinityPropagation: affinityPropagation,\n ap: affinityPropagation\n};\n\nvar hierholzerDefaults = defaults({\n root: undefined,\n directed: false\n});\nvar elesfn$b = {\n hierholzer: function hierholzer(options) {\n if (!plainObject(options)) {\n var args = arguments;\n options = {\n root: args[0],\n directed: args[1]\n };\n }\n\n var _hierholzerDefaults = hierholzerDefaults(options),\n root = _hierholzerDefaults.root,\n directed = _hierholzerDefaults.directed;\n\n var eles = this;\n var dflag = false;\n var oddIn;\n var oddOut;\n var startVertex;\n if (root) startVertex = string(root) ? this.filter(root)[0].id() : root[0].id();\n var nodes = {};\n var edges = {};\n\n if (directed) {\n eles.forEach(function (ele) {\n var id = ele.id();\n\n if (ele.isNode()) {\n var ind = ele.indegree(true);\n var outd = ele.outdegree(true);\n var d1 = ind - outd;\n var d2 = outd - ind;\n\n if (d1 == 1) {\n if (oddIn) dflag = true;else oddIn = id;\n } else if (d2 == 1) {\n if (oddOut) dflag = true;else oddOut = id;\n } else if (d2 > 1 || d1 > 1) {\n dflag = true;\n }\n\n nodes[id] = [];\n ele.outgoers().forEach(function (e) {\n if (e.isEdge()) nodes[id].push(e.id());\n });\n } else {\n edges[id] = [undefined, ele.target().id()];\n }\n });\n } else {\n eles.forEach(function (ele) {\n var id = ele.id();\n\n if (ele.isNode()) {\n var d = ele.degree(true);\n\n if (d % 2) {\n if (!oddIn) oddIn = id;else if (!oddOut) oddOut = id;else dflag = true;\n }\n\n nodes[id] = [];\n ele.connectedEdges().forEach(function (e) {\n return nodes[id].push(e.id());\n });\n } else {\n edges[id] = [ele.source().id(), ele.target().id()];\n }\n });\n }\n\n var result = {\n found: false,\n trail: undefined\n };\n if (dflag) return result;else if (oddOut && oddIn) {\n if (directed) {\n if (startVertex && oddOut != startVertex) {\n return result;\n }\n\n startVertex = oddOut;\n } else {\n if (startVertex && oddOut != startVertex && oddIn != startVertex) {\n return result;\n } else if (!startVertex) {\n startVertex = oddOut;\n }\n }\n } else {\n if (!startVertex) startVertex = eles[0].id();\n }\n\n var walk = function walk(v) {\n var currentNode = v;\n var subtour = [v];\n var adj, adjTail, adjHead;\n\n while (nodes[currentNode].length) {\n adj = nodes[currentNode].shift();\n adjTail = edges[adj][0];\n adjHead = edges[adj][1];\n\n if (currentNode != adjHead) {\n nodes[adjHead] = nodes[adjHead].filter(function (e) {\n return e != adj;\n });\n currentNode = adjHead;\n } else if (!directed && currentNode != adjTail) {\n nodes[adjTail] = nodes[adjTail].filter(function (e) {\n return e != adj;\n });\n currentNode = adjTail;\n }\n\n subtour.unshift(adj);\n subtour.unshift(currentNode);\n }\n\n return subtour;\n };\n\n var trail = [];\n var subtour = [];\n subtour = walk(startVertex);\n\n while (subtour.length != 1) {\n if (nodes[subtour[0]].length == 0) {\n trail.unshift(eles.getElementById(subtour.shift()));\n trail.unshift(eles.getElementById(subtour.shift()));\n } else {\n subtour = walk(subtour.shift()).concat(subtour);\n }\n }\n\n trail.unshift(eles.getElementById(subtour.shift())); // final node\n\n for (var d in nodes) {\n if (nodes[d].length) {\n return result;\n }\n }\n\n result.found = true;\n result.trail = this.spawn(trail);\n return result;\n }\n};\n\nvar hopcroftTarjanBiconnected = function hopcroftTarjanBiconnected() {\n var eles = this;\n var nodes = {};\n var id = 0;\n var edgeCount = 0;\n var components = [];\n var stack = [];\n var visitedEdges = {};\n\n var buildComponent = function buildComponent(x, y) {\n var i = stack.length - 1;\n var cutset = [];\n var component = eles.spawn();\n\n while (stack[i].x != x || stack[i].y != y) {\n cutset.push(stack.pop().edge);\n i--;\n }\n\n cutset.push(stack.pop().edge);\n cutset.forEach(function (edge) {\n var connectedNodes = edge.connectedNodes().intersection(eles);\n component.merge(edge);\n connectedNodes.forEach(function (node) {\n var nodeId = node.id();\n var connectedEdges = node.connectedEdges().intersection(eles);\n component.merge(node);\n\n if (!nodes[nodeId].cutVertex) {\n component.merge(connectedEdges);\n } else {\n component.merge(connectedEdges.filter(function (edge) {\n return edge.isLoop();\n }));\n }\n });\n });\n components.push(component);\n };\n\n var biconnectedSearch = function biconnectedSearch(root, currentNode, parent) {\n if (root === parent) edgeCount += 1;\n nodes[currentNode] = {\n id: id,\n low: id++,\n cutVertex: false\n };\n var edges = eles.getElementById(currentNode).connectedEdges().intersection(eles);\n\n if (edges.size() === 0) {\n components.push(eles.spawn(eles.getElementById(currentNode)));\n } else {\n var sourceId, targetId, otherNodeId, edgeId;\n edges.forEach(function (edge) {\n sourceId = edge.source().id();\n targetId = edge.target().id();\n otherNodeId = sourceId === currentNode ? targetId : sourceId;\n\n if (otherNodeId !== parent) {\n edgeId = edge.id();\n\n if (!visitedEdges[edgeId]) {\n visitedEdges[edgeId] = true;\n stack.push({\n x: currentNode,\n y: otherNodeId,\n edge: edge\n });\n }\n\n if (!(otherNodeId in nodes)) {\n biconnectedSearch(root, otherNodeId, currentNode);\n nodes[currentNode].low = Math.min(nodes[currentNode].low, nodes[otherNodeId].low);\n\n if (nodes[currentNode].id <= nodes[otherNodeId].low) {\n nodes[currentNode].cutVertex = true;\n buildComponent(currentNode, otherNodeId);\n }\n } else {\n nodes[currentNode].low = Math.min(nodes[currentNode].low, nodes[otherNodeId].id);\n }\n }\n });\n }\n };\n\n eles.forEach(function (ele) {\n if (ele.isNode()) {\n var nodeId = ele.id();\n\n if (!(nodeId in nodes)) {\n edgeCount = 0;\n biconnectedSearch(nodeId, nodeId);\n nodes[nodeId].cutVertex = edgeCount > 1;\n }\n }\n });\n var cutVertices = Object.keys(nodes).filter(function (id) {\n return nodes[id].cutVertex;\n }).map(function (id) {\n return eles.getElementById(id);\n });\n return {\n cut: eles.spawn(cutVertices),\n components: components\n };\n};\n\nvar hopcroftTarjanBiconnected$1 = {\n hopcroftTarjanBiconnected: hopcroftTarjanBiconnected,\n htbc: hopcroftTarjanBiconnected,\n htb: hopcroftTarjanBiconnected,\n hopcroftTarjanBiconnectedComponents: hopcroftTarjanBiconnected\n};\n\nvar tarjanStronglyConnected = function tarjanStronglyConnected() {\n var eles = this;\n var nodes = {};\n var index = 0;\n var components = [];\n var stack = [];\n var cut = eles.spawn(eles);\n\n var stronglyConnectedSearch = function stronglyConnectedSearch(sourceNodeId) {\n stack.push(sourceNodeId);\n nodes[sourceNodeId] = {\n index: index,\n low: index++,\n explored: false\n };\n var connectedEdges = eles.getElementById(sourceNodeId).connectedEdges().intersection(eles);\n connectedEdges.forEach(function (edge) {\n var targetNodeId = edge.target().id();\n\n if (targetNodeId !== sourceNodeId) {\n if (!(targetNodeId in nodes)) {\n stronglyConnectedSearch(targetNodeId);\n }\n\n if (!nodes[targetNodeId].explored) {\n nodes[sourceNodeId].low = Math.min(nodes[sourceNodeId].low, nodes[targetNodeId].low);\n }\n }\n });\n\n if (nodes[sourceNodeId].index === nodes[sourceNodeId].low) {\n var componentNodes = eles.spawn();\n\n for (;;) {\n var nodeId = stack.pop();\n componentNodes.merge(eles.getElementById(nodeId));\n nodes[nodeId].low = nodes[sourceNodeId].index;\n nodes[nodeId].explored = true;\n\n if (nodeId === sourceNodeId) {\n break;\n }\n }\n\n var componentEdges = componentNodes.edgesWith(componentNodes);\n var component = componentNodes.merge(componentEdges);\n components.push(component);\n cut = cut.difference(component);\n }\n };\n\n eles.forEach(function (ele) {\n if (ele.isNode()) {\n var nodeId = ele.id();\n\n if (!(nodeId in nodes)) {\n stronglyConnectedSearch(nodeId);\n }\n }\n });\n return {\n cut: cut,\n components: components\n };\n};\n\nvar tarjanStronglyConnected$1 = {\n tarjanStronglyConnected: tarjanStronglyConnected,\n tsc: tarjanStronglyConnected,\n tscc: tarjanStronglyConnected,\n tarjanStronglyConnectedComponents: tarjanStronglyConnected\n};\n\nvar elesfn$c = {};\n[elesfn, elesfn$1, elesfn$2, elesfn$3, elesfn$4, elesfn$5, elesfn$6, elesfn$7, elesfn$8, elesfn$9, elesfn$a, markovClustering$1, kClustering, hierarchicalClustering$1, affinityPropagation$1, elesfn$b, hopcroftTarjanBiconnected$1, tarjanStronglyConnected$1].forEach(function (props) {\n extend(elesfn$c, props);\n});\n\n/*!\nEmbeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable\nCopyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)\nLicensed under The MIT License (http://opensource.org/licenses/MIT)\n*/\n\n/* promise states [Promises/A+ 2.1] */\nvar STATE_PENDING = 0;\n/* [Promises/A+ 2.1.1] */\n\nvar STATE_FULFILLED = 1;\n/* [Promises/A+ 2.1.2] */\n\nvar STATE_REJECTED = 2;\n/* [Promises/A+ 2.1.3] */\n\n/* promise object constructor */\n\nvar api = function api(executor) {\n /* optionally support non-constructor/plain-function call */\n if (!(this instanceof api)) return new api(executor);\n /* initialize object */\n\n this.id = 'Thenable/1.0.7';\n this.state = STATE_PENDING;\n /* initial state */\n\n this.fulfillValue = undefined;\n /* initial value */\n\n /* [Promises/A+ 1.3, 2.1.2.2] */\n\n this.rejectReason = undefined;\n /* initial reason */\n\n /* [Promises/A+ 1.5, 2.1.3.2] */\n\n this.onFulfilled = [];\n /* initial handlers */\n\n this.onRejected = [];\n /* initial handlers */\n\n /* provide optional information-hiding proxy */\n\n this.proxy = {\n then: this.then.bind(this)\n };\n /* support optional executor function */\n\n if (typeof executor === 'function') executor.call(this, this.fulfill.bind(this), this.reject.bind(this));\n};\n/* promise API methods */\n\n\napi.prototype = {\n /* promise resolving methods */\n fulfill: function fulfill(value) {\n return deliver(this, STATE_FULFILLED, 'fulfillValue', value);\n },\n reject: function reject(value) {\n return deliver(this, STATE_REJECTED, 'rejectReason', value);\n },\n\n /* \"The then Method\" [Promises/A+ 1.1, 1.2, 2.2] */\n then: function then(onFulfilled, onRejected) {\n var curr = this;\n var next = new api();\n /* [Promises/A+ 2.2.7] */\n\n curr.onFulfilled.push(resolver(onFulfilled, next, 'fulfill'));\n /* [Promises/A+ 2.2.2/2.2.6] */\n\n curr.onRejected.push(resolver(onRejected, next, 'reject'));\n /* [Promises/A+ 2.2.3/2.2.6] */\n\n execute(curr);\n return next.proxy;\n /* [Promises/A+ 2.2.7, 3.3] */\n }\n};\n/* deliver an action */\n\nvar deliver = function deliver(curr, state, name, value) {\n if (curr.state === STATE_PENDING) {\n curr.state = state;\n /* [Promises/A+ 2.1.2.1, 2.1.3.1] */\n\n curr[name] = value;\n /* [Promises/A+ 2.1.2.2, 2.1.3.2] */\n\n execute(curr);\n }\n\n return curr;\n};\n/* execute all handlers */\n\n\nvar execute = function execute(curr) {\n if (curr.state === STATE_FULFILLED) execute_handlers(curr, 'onFulfilled', curr.fulfillValue);else if (curr.state === STATE_REJECTED) execute_handlers(curr, 'onRejected', curr.rejectReason);\n};\n/* execute particular set of handlers */\n\n\nvar execute_handlers = function execute_handlers(curr, name, value) {\n /* global setImmediate: true */\n\n /* global setTimeout: true */\n\n /* short-circuit processing */\n if (curr[name].length === 0) return;\n /* iterate over all handlers, exactly once */\n\n var handlers = curr[name];\n curr[name] = [];\n /* [Promises/A+ 2.2.2.3, 2.2.3.3] */\n\n var func = function func() {\n for (var i = 0; i < handlers.length; i++) {\n handlers[i](value);\n }\n /* [Promises/A+ 2.2.5] */\n\n };\n /* execute procedure asynchronously */\n\n /* [Promises/A+ 2.2.4, 3.1] */\n\n\n if (typeof setImmediate === 'function') setImmediate(func);else setTimeout(func, 0);\n};\n/* generate a resolver function */\n\n\nvar resolver = function resolver(cb, next, method) {\n return function (value) {\n if (typeof cb !== 'function')\n /* [Promises/A+ 2.2.1, 2.2.7.3, 2.2.7.4] */\n next[method].call(next, value);\n /* [Promises/A+ 2.2.7.3, 2.2.7.4] */\n else {\n var result;\n\n try {\n result = cb(value);\n }\n /* [Promises/A+ 2.2.2.1, 2.2.3.1, 2.2.5, 3.2] */\n catch (e) {\n next.reject(e);\n /* [Promises/A+ 2.2.7.2] */\n\n return;\n }\n\n resolve(next, result);\n /* [Promises/A+ 2.2.7.1] */\n }\n };\n};\n/* \"Promise Resolution Procedure\" */\n\n/* [Promises/A+ 2.3] */\n\n\nvar resolve = function resolve(promise, x) {\n /* sanity check arguments */\n\n /* [Promises/A+ 2.3.1] */\n if (promise === x || promise.proxy === x) {\n promise.reject(new TypeError('cannot resolve promise with itself'));\n return;\n }\n /* surgically check for a \"then\" method\n (mainly to just call the \"getter\" of \"then\" only once) */\n\n\n var then;\n\n if (_typeof(x) === 'object' && x !== null || typeof x === 'function') {\n try {\n then = x.then;\n }\n /* [Promises/A+ 2.3.3.1, 3.5] */\n catch (e) {\n promise.reject(e);\n /* [Promises/A+ 2.3.3.2] */\n\n return;\n }\n }\n /* handle own Thenables [Promises/A+ 2.3.2]\n and similar \"thenables\" [Promises/A+ 2.3.3] */\n\n\n if (typeof then === 'function') {\n var resolved = false;\n\n try {\n /* call retrieved \"then\" method */\n\n /* [Promises/A+ 2.3.3.3] */\n then.call(x,\n /* resolvePromise */\n\n /* [Promises/A+ 2.3.3.3.1] */\n function (y) {\n if (resolved) return;\n resolved = true;\n /* [Promises/A+ 2.3.3.3.3] */\n\n if (y === x)\n /* [Promises/A+ 3.6] */\n promise.reject(new TypeError('circular thenable chain'));else resolve(promise, y);\n },\n /* rejectPromise */\n\n /* [Promises/A+ 2.3.3.3.2] */\n function (r) {\n if (resolved) return;\n resolved = true;\n /* [Promises/A+ 2.3.3.3.3] */\n\n promise.reject(r);\n });\n } catch (e) {\n if (!resolved)\n /* [Promises/A+ 2.3.3.3.3] */\n promise.reject(e);\n /* [Promises/A+ 2.3.3.3.4] */\n }\n\n return;\n }\n /* handle other values */\n\n\n promise.fulfill(x);\n /* [Promises/A+ 2.3.4, 2.3.3.4] */\n}; // so we always have Promise.all()\n\n\napi.all = function (ps) {\n return new api(function (resolveAll, rejectAll) {\n var vals = new Array(ps.length);\n var doneCount = 0;\n\n var fulfill = function fulfill(i, val) {\n vals[i] = val;\n doneCount++;\n\n if (doneCount === ps.length) {\n resolveAll(vals);\n }\n };\n\n for (var i = 0; i < ps.length; i++) {\n (function (i) {\n var p = ps[i];\n var isPromise = p != null && p.then != null;\n\n if (isPromise) {\n p.then(function (val) {\n fulfill(i, val);\n }, function (err) {\n rejectAll(err);\n });\n } else {\n var val = p;\n fulfill(i, val);\n }\n })(i);\n }\n });\n};\n\napi.resolve = function (val) {\n return new api(function (resolve, reject) {\n resolve(val);\n });\n};\n\napi.reject = function (val) {\n return new api(function (resolve, reject) {\n reject(val);\n });\n};\n\nvar Promise$1 = typeof Promise !== 'undefined' ? Promise : api; // eslint-disable-line no-undef\n\nvar Animation = function Animation(target, opts, opts2) {\n var isCore = core(target);\n var isEle = !isCore;\n\n var _p = this._private = extend({\n duration: 1000\n }, opts, opts2);\n\n _p.target = target;\n _p.style = _p.style || _p.css;\n _p.started = false;\n _p.playing = false;\n _p.hooked = false;\n _p.applying = false;\n _p.progress = 0;\n _p.completes = [];\n _p.frames = [];\n\n if (_p.complete && fn(_p.complete)) {\n _p.completes.push(_p.complete);\n }\n\n if (isEle) {\n var pos = target.position();\n _p.startPosition = _p.startPosition || {\n x: pos.x,\n y: pos.y\n };\n _p.startStyle = _p.startStyle || target.cy().style().getAnimationStartStyle(target, _p.style);\n }\n\n if (isCore) {\n var pan = target.pan();\n _p.startPan = {\n x: pan.x,\n y: pan.y\n };\n _p.startZoom = target.zoom();\n } // for future timeline/animations impl\n\n\n this.length = 1;\n this[0] = this;\n};\n\nvar anifn = Animation.prototype;\nextend(anifn, {\n instanceString: function instanceString() {\n return 'animation';\n },\n hook: function hook() {\n var _p = this._private;\n\n if (!_p.hooked) {\n // add to target's animation queue\n var q;\n var tAni = _p.target._private.animation;\n\n if (_p.queue) {\n q = tAni.queue;\n } else {\n q = tAni.current;\n }\n\n q.push(this); // add to the animation loop pool\n\n if (elementOrCollection(_p.target)) {\n _p.target.cy().addToAnimationPool(_p.target);\n }\n\n _p.hooked = true;\n }\n\n return this;\n },\n play: function play() {\n var _p = this._private; // autorewind\n\n if (_p.progress === 1) {\n _p.progress = 0;\n }\n\n _p.playing = true;\n _p.started = false; // needs to be started by animation loop\n\n _p.stopped = false;\n this.hook(); // the animation loop will start the animation...\n\n return this;\n },\n playing: function playing() {\n return this._private.playing;\n },\n apply: function apply() {\n var _p = this._private;\n _p.applying = true;\n _p.started = false; // needs to be started by animation loop\n\n _p.stopped = false;\n this.hook(); // the animation loop will apply the animation at this progress\n\n return this;\n },\n applying: function applying() {\n return this._private.applying;\n },\n pause: function pause() {\n var _p = this._private;\n _p.playing = false;\n _p.started = false;\n return this;\n },\n stop: function stop() {\n var _p = this._private;\n _p.playing = false;\n _p.started = false;\n _p.stopped = true; // to be removed from animation queues\n\n return this;\n },\n rewind: function rewind() {\n return this.progress(0);\n },\n fastforward: function fastforward() {\n return this.progress(1);\n },\n time: function time(t) {\n var _p = this._private;\n\n if (t === undefined) {\n return _p.progress * _p.duration;\n } else {\n return this.progress(t / _p.duration);\n }\n },\n progress: function progress(p) {\n var _p = this._private;\n var wasPlaying = _p.playing;\n\n if (p === undefined) {\n return _p.progress;\n } else {\n if (wasPlaying) {\n this.pause();\n }\n\n _p.progress = p;\n _p.started = false;\n\n if (wasPlaying) {\n this.play();\n }\n }\n\n return this;\n },\n completed: function completed() {\n return this._private.progress === 1;\n },\n reverse: function reverse() {\n var _p = this._private;\n var wasPlaying = _p.playing;\n\n if (wasPlaying) {\n this.pause();\n }\n\n _p.progress = 1 - _p.progress;\n _p.started = false;\n\n var swap = function swap(a, b) {\n var _pa = _p[a];\n\n if (_pa == null) {\n return;\n }\n\n _p[a] = _p[b];\n _p[b] = _pa;\n };\n\n swap('zoom', 'startZoom');\n swap('pan', 'startPan');\n swap('position', 'startPosition'); // swap styles\n\n if (_p.style) {\n for (var i = 0; i < _p.style.length; i++) {\n var prop = _p.style[i];\n var name = prop.name;\n var startStyleProp = _p.startStyle[name];\n _p.startStyle[name] = prop;\n _p.style[i] = startStyleProp;\n }\n }\n\n if (wasPlaying) {\n this.play();\n }\n\n return this;\n },\n promise: function promise(type) {\n var _p = this._private;\n var arr;\n\n switch (type) {\n case 'frame':\n arr = _p.frames;\n break;\n\n default:\n case 'complete':\n case 'completed':\n arr = _p.completes;\n }\n\n return new Promise$1(function (resolve, reject) {\n arr.push(function () {\n resolve();\n });\n });\n }\n});\nanifn.complete = anifn.completed;\nanifn.run = anifn.play;\nanifn.running = anifn.playing;\n\nvar define = {\n animated: function animated() {\n return function animatedImpl() {\n var self = this;\n var selfIsArrayLike = self.length !== undefined;\n var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n\n var cy = this._private.cy || this;\n\n if (!cy.styleEnabled()) {\n return false;\n }\n\n var ele = all[0];\n\n if (ele) {\n return ele._private.animation.current.length > 0;\n }\n };\n },\n // animated\n clearQueue: function clearQueue() {\n return function clearQueueImpl() {\n var self = this;\n var selfIsArrayLike = self.length !== undefined;\n var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n\n var cy = this._private.cy || this;\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n for (var i = 0; i < all.length; i++) {\n var ele = all[i];\n ele._private.animation.queue = [];\n }\n\n return this;\n };\n },\n // clearQueue\n delay: function delay() {\n return function delayImpl(time, complete) {\n var cy = this._private.cy || this;\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n return this.animate({\n delay: time,\n duration: time,\n complete: complete\n });\n };\n },\n // delay\n delayAnimation: function delayAnimation() {\n return function delayAnimationImpl(time, complete) {\n var cy = this._private.cy || this;\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n return this.animation({\n delay: time,\n duration: time,\n complete: complete\n });\n };\n },\n // delay\n animation: function animation() {\n return function animationImpl(properties, params) {\n var self = this;\n var selfIsArrayLike = self.length !== undefined;\n var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n\n var cy = this._private.cy || this;\n var isCore = !selfIsArrayLike;\n var isEles = !isCore;\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n var style = cy.style();\n properties = extend({}, properties, params);\n var propertiesEmpty = Object.keys(properties).length === 0;\n\n if (propertiesEmpty) {\n return new Animation(all[0], properties); // nothing to animate\n }\n\n if (properties.duration === undefined) {\n properties.duration = 400;\n }\n\n switch (properties.duration) {\n case 'slow':\n properties.duration = 600;\n break;\n\n case 'fast':\n properties.duration = 200;\n break;\n }\n\n if (isEles) {\n properties.style = style.getPropsList(properties.style || properties.css);\n properties.css = undefined;\n }\n\n if (isEles && properties.renderedPosition != null) {\n var rpos = properties.renderedPosition;\n var pan = cy.pan();\n var zoom = cy.zoom();\n properties.position = renderedToModelPosition(rpos, zoom, pan);\n } // override pan w/ panBy if set\n\n\n if (isCore && properties.panBy != null) {\n var panBy = properties.panBy;\n var cyPan = cy.pan();\n properties.pan = {\n x: cyPan.x + panBy.x,\n y: cyPan.y + panBy.y\n };\n } // override pan w/ center if set\n\n\n var center = properties.center || properties.centre;\n\n if (isCore && center != null) {\n var centerPan = cy.getCenterPan(center.eles, properties.zoom);\n\n if (centerPan != null) {\n properties.pan = centerPan;\n }\n } // override pan & zoom w/ fit if set\n\n\n if (isCore && properties.fit != null) {\n var fit = properties.fit;\n var fitVp = cy.getFitViewport(fit.eles || fit.boundingBox, fit.padding);\n\n if (fitVp != null) {\n properties.pan = fitVp.pan;\n properties.zoom = fitVp.zoom;\n }\n } // override zoom (& potentially pan) w/ zoom obj if set\n\n\n if (isCore && plainObject(properties.zoom)) {\n var vp = cy.getZoomedViewport(properties.zoom);\n\n if (vp != null) {\n if (vp.zoomed) {\n properties.zoom = vp.zoom;\n }\n\n if (vp.panned) {\n properties.pan = vp.pan;\n }\n } else {\n properties.zoom = null; // an inavalid zoom (e.g. no delta) gets automatically destroyed\n }\n }\n\n return new Animation(all[0], properties);\n };\n },\n // animate\n animate: function animate() {\n return function animateImpl(properties, params) {\n var self = this;\n var selfIsArrayLike = self.length !== undefined;\n var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n\n var cy = this._private.cy || this;\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n if (params) {\n properties = extend({}, properties, params);\n } // manually hook and run the animation\n\n\n for (var i = 0; i < all.length; i++) {\n var ele = all[i];\n var queue = ele.animated() && (properties.queue === undefined || properties.queue);\n var ani = ele.animation(properties, queue ? {\n queue: true\n } : undefined);\n ani.play();\n }\n\n return this; // chaining\n };\n },\n // animate\n stop: function stop() {\n return function stopImpl(clearQueue, jumpToEnd) {\n var self = this;\n var selfIsArrayLike = self.length !== undefined;\n var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n\n var cy = this._private.cy || this;\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n for (var i = 0; i < all.length; i++) {\n var ele = all[i];\n var _p = ele._private;\n var anis = _p.animation.current;\n\n for (var j = 0; j < anis.length; j++) {\n var ani = anis[j];\n var ani_p = ani._private;\n\n if (jumpToEnd) {\n // next iteration of the animation loop, the animation\n // will go straight to the end and be removed\n ani_p.duration = 0;\n }\n } // clear the queue of future animations\n\n\n if (clearQueue) {\n _p.animation.queue = [];\n }\n\n if (!jumpToEnd) {\n _p.animation.current = [];\n }\n } // we have to notify (the animation loop doesn't do it for us on `stop`)\n\n\n cy.notify('draw');\n return this;\n };\n } // stop\n\n}; // define\n\nvar define$1 = {\n // access data field\n data: function data(params) {\n var defaults = {\n field: 'data',\n bindingEvent: 'data',\n allowBinding: false,\n allowSetting: false,\n allowGetting: false,\n settingEvent: 'data',\n settingTriggersEvent: false,\n triggerFnName: 'trigger',\n immutableKeys: {},\n // key => true if immutable\n updateStyle: false,\n beforeGet: function beforeGet(self) {},\n beforeSet: function beforeSet(self, obj) {},\n onSet: function onSet(self) {},\n canSet: function canSet(self) {\n return true;\n }\n };\n params = extend({}, defaults, params);\n return function dataImpl(name, value) {\n var p = params;\n var self = this;\n var selfIsArrayLike = self.length !== undefined;\n var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n\n var single = selfIsArrayLike ? self[0] : self; // .data('foo', ...)\n\n if (string(name)) {\n // set or get property\n // .data('foo')\n if (p.allowGetting && value === undefined) {\n // get\n var ret;\n\n if (single) {\n p.beforeGet(single);\n ret = single._private[p.field][name];\n }\n\n return ret; // .data('foo', 'bar')\n } else if (p.allowSetting && value !== undefined) {\n // set\n var valid = !p.immutableKeys[name];\n\n if (valid) {\n var change = _defineProperty({}, name, value);\n\n p.beforeSet(self, change);\n\n for (var i = 0, l = all.length; i < l; i++) {\n var ele = all[i];\n\n if (p.canSet(ele)) {\n ele._private[p.field][name] = value;\n }\n } // update mappers if asked\n\n\n if (p.updateStyle) {\n self.updateStyle();\n } // call onSet callback\n\n\n p.onSet(self);\n\n if (p.settingTriggersEvent) {\n self[p.triggerFnName](p.settingEvent);\n }\n }\n } // .data({ 'foo': 'bar' })\n\n } else if (p.allowSetting && plainObject(name)) {\n // extend\n var obj = name;\n var k, v;\n var keys = Object.keys(obj);\n p.beforeSet(self, obj);\n\n for (var _i = 0; _i < keys.length; _i++) {\n k = keys[_i];\n v = obj[k];\n\n var _valid = !p.immutableKeys[k];\n\n if (_valid) {\n for (var j = 0; j < all.length; j++) {\n var _ele = all[j];\n\n if (p.canSet(_ele)) {\n _ele._private[p.field][k] = v;\n }\n }\n }\n } // update mappers if asked\n\n\n if (p.updateStyle) {\n self.updateStyle();\n } // call onSet callback\n\n\n p.onSet(self);\n\n if (p.settingTriggersEvent) {\n self[p.triggerFnName](p.settingEvent);\n } // .data(function(){ ... })\n\n } else if (p.allowBinding && fn(name)) {\n // bind to event\n var fn$1 = name;\n self.on(p.bindingEvent, fn$1); // .data()\n } else if (p.allowGetting && name === undefined) {\n // get whole object\n var _ret;\n\n if (single) {\n p.beforeGet(single);\n _ret = single._private[p.field];\n }\n\n return _ret;\n }\n\n return self; // maintain chainability\n }; // function\n },\n // data\n // remove data field\n removeData: function removeData(params) {\n var defaults = {\n field: 'data',\n event: 'data',\n triggerFnName: 'trigger',\n triggerEvent: false,\n immutableKeys: {} // key => true if immutable\n\n };\n params = extend({}, defaults, params);\n return function removeDataImpl(names) {\n var p = params;\n var self = this;\n var selfIsArrayLike = self.length !== undefined;\n var all = selfIsArrayLike ? self : [self]; // put in array if not array-like\n // .removeData('foo bar')\n\n if (string(names)) {\n // then get the list of keys, and delete them\n var keys = names.split(/\\s+/);\n var l = keys.length;\n\n for (var i = 0; i < l; i++) {\n // delete each non-empty key\n var key = keys[i];\n\n if (emptyString(key)) {\n continue;\n }\n\n var valid = !p.immutableKeys[key]; // not valid if immutable\n\n if (valid) {\n for (var i_a = 0, l_a = all.length; i_a < l_a; i_a++) {\n all[i_a]._private[p.field][key] = undefined;\n }\n }\n }\n\n if (p.triggerEvent) {\n self[p.triggerFnName](p.event);\n } // .removeData()\n\n } else if (names === undefined) {\n // then delete all keys\n for (var _i_a = 0, _l_a = all.length; _i_a < _l_a; _i_a++) {\n var _privateFields = all[_i_a]._private[p.field];\n\n var _keys = Object.keys(_privateFields);\n\n for (var _i2 = 0; _i2 < _keys.length; _i2++) {\n var _key = _keys[_i2];\n var validKeyToDelete = !p.immutableKeys[_key];\n\n if (validKeyToDelete) {\n _privateFields[_key] = undefined;\n }\n }\n }\n\n if (p.triggerEvent) {\n self[p.triggerFnName](p.event);\n }\n }\n\n return self; // maintain chaining\n }; // function\n } // removeData\n\n}; // define\n\nvar define$2 = {\n eventAliasesOn: function eventAliasesOn(proto) {\n var p = proto;\n p.addListener = p.listen = p.bind = p.on;\n p.unlisten = p.unbind = p.off = p.removeListener;\n p.trigger = p.emit; // this is just a wrapper alias of .on()\n\n p.pon = p.promiseOn = function (events, selector) {\n var self = this;\n var args = Array.prototype.slice.call(arguments, 0);\n return new Promise$1(function (resolve, reject) {\n var callback = function callback(e) {\n self.off.apply(self, offArgs);\n resolve(e);\n };\n\n var onArgs = args.concat([callback]);\n var offArgs = onArgs.concat([]);\n self.on.apply(self, onArgs);\n });\n };\n }\n}; // define\n\n// use this module to cherry pick functions into your prototype\nvar define$3 = {};\n[define, define$1, define$2].forEach(function (m) {\n extend(define$3, m);\n});\n\nvar elesfn$d = {\n animate: define$3.animate(),\n animation: define$3.animation(),\n animated: define$3.animated(),\n clearQueue: define$3.clearQueue(),\n delay: define$3.delay(),\n delayAnimation: define$3.delayAnimation(),\n stop: define$3.stop()\n};\n\nvar elesfn$e = {\n classes: function classes(_classes) {\n var self = this;\n\n if (_classes === undefined) {\n var ret = [];\n\n self[0]._private.classes.forEach(function (cls) {\n return ret.push(cls);\n });\n\n return ret;\n } else if (!array(_classes)) {\n // extract classes from string\n _classes = (_classes || '').match(/\\S+/g) || [];\n }\n\n var changed = [];\n var classesSet = new Set$1(_classes); // check and update each ele\n\n for (var j = 0; j < self.length; j++) {\n var ele = self[j];\n var _p = ele._private;\n var eleClasses = _p.classes;\n var changedEle = false; // check if ele has all of the passed classes\n\n for (var i = 0; i < _classes.length; i++) {\n var cls = _classes[i];\n var eleHasClass = eleClasses.has(cls);\n\n if (!eleHasClass) {\n changedEle = true;\n break;\n }\n } // check if ele has classes outside of those passed\n\n\n if (!changedEle) {\n changedEle = eleClasses.size !== _classes.length;\n }\n\n if (changedEle) {\n _p.classes = classesSet;\n changed.push(ele);\n }\n } // trigger update style on those eles that had class changes\n\n\n if (changed.length > 0) {\n this.spawn(changed).updateStyle().emit('class');\n }\n\n return self;\n },\n addClass: function addClass(classes) {\n return this.toggleClass(classes, true);\n },\n hasClass: function hasClass(className) {\n var ele = this[0];\n return ele != null && ele._private.classes.has(className);\n },\n toggleClass: function toggleClass(classes, toggle) {\n if (!array(classes)) {\n // extract classes from string\n classes = classes.match(/\\S+/g) || [];\n }\n\n var self = this;\n var toggleUndefd = toggle === undefined;\n var changed = []; // eles who had classes changed\n\n for (var i = 0, il = self.length; i < il; i++) {\n var ele = self[i];\n var eleClasses = ele._private.classes;\n var changedEle = false;\n\n for (var j = 0; j < classes.length; j++) {\n var cls = classes[j];\n var hasClass = eleClasses.has(cls);\n var changedNow = false;\n\n if (toggle || toggleUndefd && !hasClass) {\n eleClasses.add(cls);\n changedNow = true;\n } else if (!toggle || toggleUndefd && hasClass) {\n eleClasses[\"delete\"](cls);\n changedNow = true;\n }\n\n if (!changedEle && changedNow) {\n changed.push(ele);\n changedEle = true;\n }\n } // for j classes\n\n } // for i eles\n // trigger update style on those eles that had class changes\n\n\n if (changed.length > 0) {\n this.spawn(changed).updateStyle().emit('class');\n }\n\n return self;\n },\n removeClass: function removeClass(classes) {\n return this.toggleClass(classes, false);\n },\n flashClass: function flashClass(classes, duration) {\n var self = this;\n\n if (duration == null) {\n duration = 250;\n } else if (duration === 0) {\n return self; // nothing to do really\n }\n\n self.addClass(classes);\n setTimeout(function () {\n self.removeClass(classes);\n }, duration);\n return self;\n }\n};\nelesfn$e.className = elesfn$e.classNames = elesfn$e.classes;\n\nvar tokens = {\n metaChar: '[\\\\!\\\\\"\\\\#\\\\$\\\\%\\\\&\\\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\.\\\\/\\\\:\\\\;\\\\<\\\\=\\\\>\\\\?\\\\@\\\\[\\\\]\\\\^\\\\`\\\\{\\\\|\\\\}\\\\~]',\n // chars we need to escape in let names, etc\n comparatorOp: '=|\\\\!=|>|>=|<|<=|\\\\$=|\\\\^=|\\\\*=',\n // binary comparison op (used in data selectors)\n boolOp: '\\\\?|\\\\!|\\\\^',\n // boolean (unary) operators (used in data selectors)\n string: '\"(?:\\\\\\\\\"|[^\"])*\"' + '|' + \"'(?:\\\\\\\\'|[^'])*'\",\n // string literals (used in data selectors) -- doublequotes | singlequotes\n number: number$1,\n // number literal (used in data selectors) --- e.g. 0.1234, 1234, 12e123\n meta: 'degree|indegree|outdegree',\n // allowed metadata fields (i.e. allowed functions to use from Collection)\n separator: '\\\\s*,\\\\s*',\n // queries are separated by commas, e.g. edge[foo = 'bar'], node.someClass\n descendant: '\\\\s+',\n child: '\\\\s+>\\\\s+',\n subject: '\\\\$',\n group: 'node|edge|\\\\*',\n directedEdge: '\\\\s+->\\\\s+',\n undirectedEdge: '\\\\s+<->\\\\s+'\n};\ntokens.variable = '(?:[\\\\w-]|(?:\\\\\\\\' + tokens.metaChar + '))+'; // a variable name\n\ntokens.value = tokens.string + '|' + tokens.number; // a value literal, either a string or number\n\ntokens.className = tokens.variable; // a class name (follows variable conventions)\n\ntokens.id = tokens.variable; // an element id (follows variable conventions)\n\n(function () {\n var ops, op, i; // add @ variants to comparatorOp\n\n ops = tokens.comparatorOp.split('|');\n\n for (i = 0; i < ops.length; i++) {\n op = ops[i];\n tokens.comparatorOp += '|@' + op;\n } // add ! variants to comparatorOp\n\n\n ops = tokens.comparatorOp.split('|');\n\n for (i = 0; i < ops.length; i++) {\n op = ops[i];\n\n if (op.indexOf('!') >= 0) {\n continue;\n } // skip ops that explicitly contain !\n\n\n if (op === '=') {\n continue;\n } // skip = b/c != is explicitly defined\n\n\n tokens.comparatorOp += '|\\\\!' + op;\n }\n})();\n\n/**\n * Make a new query object\n *\n * @prop type {Type} The type enum (int) of the query\n * @prop checks List of checks to make against an ele to test for a match\n */\nvar newQuery = function newQuery() {\n return {\n checks: []\n };\n};\n\n/**\n * A check type enum-like object. Uses integer values for fast match() lookup.\n * The ordering does not matter as long as the ints are unique.\n */\nvar Type = {\n /** E.g. node */\n GROUP: 0,\n\n /** A collection of elements */\n COLLECTION: 1,\n\n /** A filter(ele) function */\n FILTER: 2,\n\n /** E.g. [foo > 1] */\n DATA_COMPARE: 3,\n\n /** E.g. [foo] */\n DATA_EXIST: 4,\n\n /** E.g. [?foo] */\n DATA_BOOL: 5,\n\n /** E.g. [[degree > 2]] */\n META_COMPARE: 6,\n\n /** E.g. :selected */\n STATE: 7,\n\n /** E.g. #foo */\n ID: 8,\n\n /** E.g. .foo */\n CLASS: 9,\n\n /** E.g. #foo <-> #bar */\n UNDIRECTED_EDGE: 10,\n\n /** E.g. #foo -> #bar */\n DIRECTED_EDGE: 11,\n\n /** E.g. $#foo -> #bar */\n NODE_SOURCE: 12,\n\n /** E.g. #foo -> $#bar */\n NODE_TARGET: 13,\n\n /** E.g. $#foo <-> #bar */\n NODE_NEIGHBOR: 14,\n\n /** E.g. #foo > #bar */\n CHILD: 15,\n\n /** E.g. #foo #bar */\n DESCENDANT: 16,\n\n /** E.g. $#foo > #bar */\n PARENT: 17,\n\n /** E.g. $#foo #bar */\n ANCESTOR: 18,\n\n /** E.g. #foo > $bar > #baz */\n COMPOUND_SPLIT: 19,\n\n /** Always matches, useful placeholder for subject in `COMPOUND_SPLIT` */\n TRUE: 20\n};\n\nvar stateSelectors = [{\n selector: ':selected',\n matches: function matches(ele) {\n return ele.selected();\n }\n}, {\n selector: ':unselected',\n matches: function matches(ele) {\n return !ele.selected();\n }\n}, {\n selector: ':selectable',\n matches: function matches(ele) {\n return ele.selectable();\n }\n}, {\n selector: ':unselectable',\n matches: function matches(ele) {\n return !ele.selectable();\n }\n}, {\n selector: ':locked',\n matches: function matches(ele) {\n return ele.locked();\n }\n}, {\n selector: ':unlocked',\n matches: function matches(ele) {\n return !ele.locked();\n }\n}, {\n selector: ':visible',\n matches: function matches(ele) {\n return ele.visible();\n }\n}, {\n selector: ':hidden',\n matches: function matches(ele) {\n return !ele.visible();\n }\n}, {\n selector: ':transparent',\n matches: function matches(ele) {\n return ele.transparent();\n }\n}, {\n selector: ':grabbed',\n matches: function matches(ele) {\n return ele.grabbed();\n }\n}, {\n selector: ':free',\n matches: function matches(ele) {\n return !ele.grabbed();\n }\n}, {\n selector: ':removed',\n matches: function matches(ele) {\n return ele.removed();\n }\n}, {\n selector: ':inside',\n matches: function matches(ele) {\n return !ele.removed();\n }\n}, {\n selector: ':grabbable',\n matches: function matches(ele) {\n return ele.grabbable();\n }\n}, {\n selector: ':ungrabbable',\n matches: function matches(ele) {\n return !ele.grabbable();\n }\n}, {\n selector: ':animated',\n matches: function matches(ele) {\n return ele.animated();\n }\n}, {\n selector: ':unanimated',\n matches: function matches(ele) {\n return !ele.animated();\n }\n}, {\n selector: ':parent',\n matches: function matches(ele) {\n return ele.isParent();\n }\n}, {\n selector: ':childless',\n matches: function matches(ele) {\n return ele.isChildless();\n }\n}, {\n selector: ':child',\n matches: function matches(ele) {\n return ele.isChild();\n }\n}, {\n selector: ':orphan',\n matches: function matches(ele) {\n return ele.isOrphan();\n }\n}, {\n selector: ':nonorphan',\n matches: function matches(ele) {\n return ele.isChild();\n }\n}, {\n selector: ':compound',\n matches: function matches(ele) {\n if (ele.isNode()) {\n return ele.isParent();\n } else {\n return ele.source().isParent() || ele.target().isParent();\n }\n }\n}, {\n selector: ':loop',\n matches: function matches(ele) {\n return ele.isLoop();\n }\n}, {\n selector: ':simple',\n matches: function matches(ele) {\n return ele.isSimple();\n }\n}, {\n selector: ':active',\n matches: function matches(ele) {\n return ele.active();\n }\n}, {\n selector: ':inactive',\n matches: function matches(ele) {\n return !ele.active();\n }\n}, {\n selector: ':backgrounding',\n matches: function matches(ele) {\n return ele.backgrounding();\n }\n}, {\n selector: ':nonbackgrounding',\n matches: function matches(ele) {\n return !ele.backgrounding();\n }\n}].sort(function (a, b) {\n // n.b. selectors that are starting substrings of others must have the longer ones first\n return descending(a.selector, b.selector);\n});\n\nvar lookup = function () {\n var selToFn = {};\n var s;\n\n for (var i = 0; i < stateSelectors.length; i++) {\n s = stateSelectors[i];\n selToFn[s.selector] = s.matches;\n }\n\n return selToFn;\n}();\n\nvar stateSelectorMatches = function stateSelectorMatches(sel, ele) {\n return lookup[sel](ele);\n};\nvar stateSelectorRegex = '(' + stateSelectors.map(function (s) {\n return s.selector;\n}).join('|') + ')';\n\n// so that values get compared properly in Selector.filter()\n\nvar cleanMetaChars = function cleanMetaChars(str) {\n return str.replace(new RegExp('\\\\\\\\(' + tokens.metaChar + ')', 'g'), function (match, $1) {\n return $1;\n });\n};\n\nvar replaceLastQuery = function replaceLastQuery(selector, examiningQuery, replacementQuery) {\n selector[selector.length - 1] = replacementQuery;\n}; // NOTE: add new expression syntax here to have it recognised by the parser;\n// - a query contains all adjacent (i.e. no separator in between) expressions;\n// - the current query is stored in selector[i]\n// - you need to check the query objects in match() for it actually filter properly, but that's pretty straight forward\n\n\nvar exprs = [{\n name: 'group',\n // just used for identifying when debugging\n query: true,\n regex: '(' + tokens.group + ')',\n populate: function populate(selector, query, _ref) {\n var _ref2 = _slicedToArray(_ref, 1),\n group = _ref2[0];\n\n query.checks.push({\n type: Type.GROUP,\n value: group === '*' ? group : group + 's'\n });\n }\n}, {\n name: 'state',\n query: true,\n regex: stateSelectorRegex,\n populate: function populate(selector, query, _ref3) {\n var _ref4 = _slicedToArray(_ref3, 1),\n state = _ref4[0];\n\n query.checks.push({\n type: Type.STATE,\n value: state\n });\n }\n}, {\n name: 'id',\n query: true,\n regex: '\\\\#(' + tokens.id + ')',\n populate: function populate(selector, query, _ref5) {\n var _ref6 = _slicedToArray(_ref5, 1),\n id = _ref6[0];\n\n query.checks.push({\n type: Type.ID,\n value: cleanMetaChars(id)\n });\n }\n}, {\n name: 'className',\n query: true,\n regex: '\\\\.(' + tokens.className + ')',\n populate: function populate(selector, query, _ref7) {\n var _ref8 = _slicedToArray(_ref7, 1),\n className = _ref8[0];\n\n query.checks.push({\n type: Type.CLASS,\n value: cleanMetaChars(className)\n });\n }\n}, {\n name: 'dataExists',\n query: true,\n regex: '\\\\[\\\\s*(' + tokens.variable + ')\\\\s*\\\\]',\n populate: function populate(selector, query, _ref9) {\n var _ref10 = _slicedToArray(_ref9, 1),\n variable = _ref10[0];\n\n query.checks.push({\n type: Type.DATA_EXIST,\n field: cleanMetaChars(variable)\n });\n }\n}, {\n name: 'dataCompare',\n query: true,\n regex: '\\\\[\\\\s*(' + tokens.variable + ')\\\\s*(' + tokens.comparatorOp + ')\\\\s*(' + tokens.value + ')\\\\s*\\\\]',\n populate: function populate(selector, query, _ref11) {\n var _ref12 = _slicedToArray(_ref11, 3),\n variable = _ref12[0],\n comparatorOp = _ref12[1],\n value = _ref12[2];\n\n var valueIsString = new RegExp('^' + tokens.string + '$').exec(value) != null;\n\n if (valueIsString) {\n value = value.substring(1, value.length - 1);\n } else {\n value = parseFloat(value);\n }\n\n query.checks.push({\n type: Type.DATA_COMPARE,\n field: cleanMetaChars(variable),\n operator: comparatorOp,\n value: value\n });\n }\n}, {\n name: 'dataBool',\n query: true,\n regex: '\\\\[\\\\s*(' + tokens.boolOp + ')\\\\s*(' + tokens.variable + ')\\\\s*\\\\]',\n populate: function populate(selector, query, _ref13) {\n var _ref14 = _slicedToArray(_ref13, 2),\n boolOp = _ref14[0],\n variable = _ref14[1];\n\n query.checks.push({\n type: Type.DATA_BOOL,\n field: cleanMetaChars(variable),\n operator: boolOp\n });\n }\n}, {\n name: 'metaCompare',\n query: true,\n regex: '\\\\[\\\\[\\\\s*(' + tokens.meta + ')\\\\s*(' + tokens.comparatorOp + ')\\\\s*(' + tokens.number + ')\\\\s*\\\\]\\\\]',\n populate: function populate(selector, query, _ref15) {\n var _ref16 = _slicedToArray(_ref15, 3),\n meta = _ref16[0],\n comparatorOp = _ref16[1],\n number = _ref16[2];\n\n query.checks.push({\n type: Type.META_COMPARE,\n field: cleanMetaChars(meta),\n operator: comparatorOp,\n value: parseFloat(number)\n });\n }\n}, {\n name: 'nextQuery',\n separator: true,\n regex: tokens.separator,\n populate: function populate(selector, query) {\n var currentSubject = selector.currentSubject;\n var edgeCount = selector.edgeCount;\n var compoundCount = selector.compoundCount;\n var lastQ = selector[selector.length - 1];\n\n if (currentSubject != null) {\n lastQ.subject = currentSubject;\n selector.currentSubject = null;\n }\n\n lastQ.edgeCount = edgeCount;\n lastQ.compoundCount = compoundCount;\n selector.edgeCount = 0;\n selector.compoundCount = 0; // go on to next query\n\n var nextQuery = selector[selector.length++] = newQuery();\n return nextQuery; // this is the new query to be filled by the following exprs\n }\n}, {\n name: 'directedEdge',\n separator: true,\n regex: tokens.directedEdge,\n populate: function populate(selector, query) {\n if (selector.currentSubject == null) {\n // undirected edge\n var edgeQuery = newQuery();\n var source = query;\n var target = newQuery();\n edgeQuery.checks.push({\n type: Type.DIRECTED_EDGE,\n source: source,\n target: target\n }); // the query in the selector should be the edge rather than the source\n\n replaceLastQuery(selector, query, edgeQuery);\n selector.edgeCount++; // we're now populating the target query with expressions that follow\n\n return target;\n } else {\n // source/target\n var srcTgtQ = newQuery();\n var _source = query;\n\n var _target = newQuery();\n\n srcTgtQ.checks.push({\n type: Type.NODE_SOURCE,\n source: _source,\n target: _target\n }); // the query in the selector should be the neighbourhood rather than the node\n\n replaceLastQuery(selector, query, srcTgtQ);\n selector.edgeCount++;\n return _target; // now populating the target with the following expressions\n }\n }\n}, {\n name: 'undirectedEdge',\n separator: true,\n regex: tokens.undirectedEdge,\n populate: function populate(selector, query) {\n if (selector.currentSubject == null) {\n // undirected edge\n var edgeQuery = newQuery();\n var source = query;\n var target = newQuery();\n edgeQuery.checks.push({\n type: Type.UNDIRECTED_EDGE,\n nodes: [source, target]\n }); // the query in the selector should be the edge rather than the source\n\n replaceLastQuery(selector, query, edgeQuery);\n selector.edgeCount++; // we're now populating the target query with expressions that follow\n\n return target;\n } else {\n // neighbourhood\n var nhoodQ = newQuery();\n var node = query;\n var neighbor = newQuery();\n nhoodQ.checks.push({\n type: Type.NODE_NEIGHBOR,\n node: node,\n neighbor: neighbor\n }); // the query in the selector should be the neighbourhood rather than the node\n\n replaceLastQuery(selector, query, nhoodQ);\n return neighbor; // now populating the neighbor with following expressions\n }\n }\n}, {\n name: 'child',\n separator: true,\n regex: tokens.child,\n populate: function populate(selector, query) {\n if (selector.currentSubject == null) {\n // default: child query\n var parentChildQuery = newQuery();\n var child = newQuery();\n var parent = selector[selector.length - 1];\n parentChildQuery.checks.push({\n type: Type.CHILD,\n parent: parent,\n child: child\n }); // the query in the selector should be the '>' itself\n\n replaceLastQuery(selector, query, parentChildQuery);\n selector.compoundCount++; // we're now populating the child query with expressions that follow\n\n return child;\n } else if (selector.currentSubject === query) {\n // compound split query\n var compound = newQuery();\n var left = selector[selector.length - 1];\n var right = newQuery();\n var subject = newQuery();\n\n var _child = newQuery();\n\n var _parent = newQuery(); // set up the root compound q\n\n\n compound.checks.push({\n type: Type.COMPOUND_SPLIT,\n left: left,\n right: right,\n subject: subject\n }); // populate the subject and replace the q at the old spot (within left) with TRUE\n\n subject.checks = query.checks; // take the checks from the left\n\n query.checks = [{\n type: Type.TRUE\n }]; // checks under left refs the subject implicitly\n // set up the right q\n\n _parent.checks.push({\n type: Type.TRUE\n }); // parent implicitly refs the subject\n\n\n right.checks.push({\n type: Type.PARENT,\n // type is swapped on right side queries\n parent: _parent,\n child: _child // empty for now\n\n });\n replaceLastQuery(selector, left, compound); // update the ref since we moved things around for `query`\n\n selector.currentSubject = subject;\n selector.compoundCount++;\n return _child; // now populating the right side's child\n } else {\n // parent query\n // info for parent query\n var _parent2 = newQuery();\n\n var _child2 = newQuery();\n\n var pcQChecks = [{\n type: Type.PARENT,\n parent: _parent2,\n child: _child2\n }]; // the parent-child query takes the place of the query previously being populated\n\n _parent2.checks = query.checks; // the previous query contains the checks for the parent\n\n query.checks = pcQChecks; // pc query takes over\n\n selector.compoundCount++;\n return _child2; // we're now populating the child\n }\n }\n}, {\n name: 'descendant',\n separator: true,\n regex: tokens.descendant,\n populate: function populate(selector, query) {\n if (selector.currentSubject == null) {\n // default: descendant query\n var ancChQuery = newQuery();\n var descendant = newQuery();\n var ancestor = selector[selector.length - 1];\n ancChQuery.checks.push({\n type: Type.DESCENDANT,\n ancestor: ancestor,\n descendant: descendant\n }); // the query in the selector should be the '>' itself\n\n replaceLastQuery(selector, query, ancChQuery);\n selector.compoundCount++; // we're now populating the descendant query with expressions that follow\n\n return descendant;\n } else if (selector.currentSubject === query) {\n // compound split query\n var compound = newQuery();\n var left = selector[selector.length - 1];\n var right = newQuery();\n var subject = newQuery();\n\n var _descendant = newQuery();\n\n var _ancestor = newQuery(); // set up the root compound q\n\n\n compound.checks.push({\n type: Type.COMPOUND_SPLIT,\n left: left,\n right: right,\n subject: subject\n }); // populate the subject and replace the q at the old spot (within left) with TRUE\n\n subject.checks = query.checks; // take the checks from the left\n\n query.checks = [{\n type: Type.TRUE\n }]; // checks under left refs the subject implicitly\n // set up the right q\n\n _ancestor.checks.push({\n type: Type.TRUE\n }); // ancestor implicitly refs the subject\n\n\n right.checks.push({\n type: Type.ANCESTOR,\n // type is swapped on right side queries\n ancestor: _ancestor,\n descendant: _descendant // empty for now\n\n });\n replaceLastQuery(selector, left, compound); // update the ref since we moved things around for `query`\n\n selector.currentSubject = subject;\n selector.compoundCount++;\n return _descendant; // now populating the right side's descendant\n } else {\n // ancestor query\n // info for parent query\n var _ancestor2 = newQuery();\n\n var _descendant2 = newQuery();\n\n var adQChecks = [{\n type: Type.ANCESTOR,\n ancestor: _ancestor2,\n descendant: _descendant2\n }]; // the parent-child query takes the place of the query previously being populated\n\n _ancestor2.checks = query.checks; // the previous query contains the checks for the parent\n\n query.checks = adQChecks; // pc query takes over\n\n selector.compoundCount++;\n return _descendant2; // we're now populating the child\n }\n }\n}, {\n name: 'subject',\n modifier: true,\n regex: tokens.subject,\n populate: function populate(selector, query) {\n if (selector.currentSubject != null && selector.currentSubject !== query) {\n warn('Redefinition of subject in selector `' + selector.toString() + '`');\n return false;\n }\n\n selector.currentSubject = query;\n var topQ = selector[selector.length - 1];\n var topChk = topQ.checks[0];\n var topType = topChk == null ? null : topChk.type;\n\n if (topType === Type.DIRECTED_EDGE) {\n // directed edge with subject on the target\n // change to target node check\n topChk.type = Type.NODE_TARGET;\n } else if (topType === Type.UNDIRECTED_EDGE) {\n // undirected edge with subject on the second node\n // change to neighbor check\n topChk.type = Type.NODE_NEIGHBOR;\n topChk.node = topChk.nodes[1]; // second node is subject\n\n topChk.neighbor = topChk.nodes[0]; // clean up unused fields for new type\n\n topChk.nodes = null;\n }\n }\n}];\nexprs.forEach(function (e) {\n return e.regexObj = new RegExp('^' + e.regex);\n});\n\n/**\n * Of all the expressions, find the first match in the remaining text.\n * @param {string} remaining The remaining text to parse\n * @returns The matched expression and the newly remaining text `{ expr, match, name, remaining }`\n */\n\nvar consumeExpr = function consumeExpr(remaining) {\n var expr;\n var match;\n var name;\n\n for (var j = 0; j < exprs.length; j++) {\n var e = exprs[j];\n var n = e.name;\n var m = remaining.match(e.regexObj);\n\n if (m != null) {\n match = m;\n expr = e;\n name = n;\n var consumed = m[0];\n remaining = remaining.substring(consumed.length);\n break; // we've consumed one expr, so we can return now\n }\n }\n\n return {\n expr: expr,\n match: match,\n name: name,\n remaining: remaining\n };\n};\n/**\n * Consume all the leading whitespace\n * @param {string} remaining The text to consume\n * @returns The text with the leading whitespace removed\n */\n\n\nvar consumeWhitespace = function consumeWhitespace(remaining) {\n var match = remaining.match(/^\\s+/);\n\n if (match) {\n var consumed = match[0];\n remaining = remaining.substring(consumed.length);\n }\n\n return remaining;\n};\n/**\n * Parse the string and store the parsed representation in the Selector.\n * @param {string} selector The selector string\n * @returns `true` if the selector was successfully parsed, `false` otherwise\n */\n\n\nvar parse = function parse(selector) {\n var self = this;\n var remaining = self.inputText = selector;\n var currentQuery = self[0] = newQuery();\n self.length = 1;\n remaining = consumeWhitespace(remaining); // get rid of leading whitespace\n\n for (;;) {\n var exprInfo = consumeExpr(remaining);\n\n if (exprInfo.expr == null) {\n warn('The selector `' + selector + '`is invalid');\n return false;\n } else {\n var args = exprInfo.match.slice(1); // let the token populate the selector object in currentQuery\n\n var ret = exprInfo.expr.populate(self, currentQuery, args);\n\n if (ret === false) {\n return false; // exit if population failed\n } else if (ret != null) {\n currentQuery = ret; // change the current query to be filled if the expr specifies\n }\n }\n\n remaining = exprInfo.remaining; // we're done when there's nothing left to parse\n\n if (remaining.match(/^\\s*$/)) {\n break;\n }\n }\n\n var lastQ = self[self.length - 1];\n\n if (self.currentSubject != null) {\n lastQ.subject = self.currentSubject;\n }\n\n lastQ.edgeCount = self.edgeCount;\n lastQ.compoundCount = self.compoundCount;\n\n for (var i = 0; i < self.length; i++) {\n var q = self[i]; // in future, this could potentially be allowed if there were operator precedence and detection of invalid combinations\n\n if (q.compoundCount > 0 && q.edgeCount > 0) {\n warn('The selector `' + selector + '` is invalid because it uses both a compound selector and an edge selector');\n return false;\n }\n\n if (q.edgeCount > 1) {\n warn('The selector `' + selector + '` is invalid because it uses multiple edge selectors');\n return false;\n } else if (q.edgeCount === 1) {\n warn('The selector `' + selector + '` 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.');\n }\n }\n\n return true; // success\n};\n/**\n * Get the selector represented as a string. This value uses default formatting,\n * so things like spacing may differ from the input text passed to the constructor.\n * @returns {string} The selector string\n */\n\n\nvar toString = function toString() {\n if (this.toStringCache != null) {\n return this.toStringCache;\n }\n\n var clean = function clean(obj) {\n if (obj == null) {\n return '';\n } else {\n return obj;\n }\n };\n\n var cleanVal = function cleanVal(val) {\n if (string(val)) {\n return '\"' + val + '\"';\n } else {\n return clean(val);\n }\n };\n\n var space = function space(val) {\n return ' ' + val + ' ';\n };\n\n var checkToString = function checkToString(check, subject) {\n var type = check.type,\n value = check.value;\n\n switch (type) {\n case Type.GROUP:\n {\n var group = clean(value);\n return group.substring(0, group.length - 1);\n }\n\n case Type.DATA_COMPARE:\n {\n var field = check.field,\n operator = check.operator;\n return '[' + field + space(clean(operator)) + cleanVal(value) + ']';\n }\n\n case Type.DATA_BOOL:\n {\n var _operator = check.operator,\n _field = check.field;\n return '[' + clean(_operator) + _field + ']';\n }\n\n case Type.DATA_EXIST:\n {\n var _field2 = check.field;\n return '[' + _field2 + ']';\n }\n\n case Type.META_COMPARE:\n {\n var _operator2 = check.operator,\n _field3 = check.field;\n return '[[' + _field3 + space(clean(_operator2)) + cleanVal(value) + ']]';\n }\n\n case Type.STATE:\n {\n return value;\n }\n\n case Type.ID:\n {\n return '#' + value;\n }\n\n case Type.CLASS:\n {\n return '.' + value;\n }\n\n case Type.PARENT:\n case Type.CHILD:\n {\n return queryToString(check.parent, subject) + space('>') + queryToString(check.child, subject);\n }\n\n case Type.ANCESTOR:\n case Type.DESCENDANT:\n {\n return queryToString(check.ancestor, subject) + ' ' + queryToString(check.descendant, subject);\n }\n\n case Type.COMPOUND_SPLIT:\n {\n var lhs = queryToString(check.left, subject);\n var sub = queryToString(check.subject, subject);\n var rhs = queryToString(check.right, subject);\n return lhs + (lhs.length > 0 ? ' ' : '') + sub + rhs;\n }\n\n case Type.TRUE:\n {\n return '';\n }\n }\n };\n\n var queryToString = function queryToString(query, subject) {\n return query.checks.reduce(function (str, chk, i) {\n return str + (subject === query && i === 0 ? '$' : '') + checkToString(chk, subject);\n }, '');\n };\n\n var str = '';\n\n for (var i = 0; i < this.length; i++) {\n var query = this[i];\n str += queryToString(query, query.subject);\n\n if (this.length > 1 && i < this.length - 1) {\n str += ', ';\n }\n }\n\n this.toStringCache = str;\n return str;\n};\nvar parse$1 = {\n parse: parse,\n toString: toString\n};\n\nvar valCmp = function valCmp(fieldVal, operator, value) {\n var matches;\n var isFieldStr = string(fieldVal);\n var isFieldNum = number(fieldVal);\n var isValStr = string(value);\n var fieldStr, valStr;\n var caseInsensitive = false;\n var notExpr = false;\n var isIneqCmp = false;\n\n if (operator.indexOf('!') >= 0) {\n operator = operator.replace('!', '');\n notExpr = true;\n }\n\n if (operator.indexOf('@') >= 0) {\n operator = operator.replace('@', '');\n caseInsensitive = true;\n }\n\n if (isFieldStr || isValStr || caseInsensitive) {\n fieldStr = !isFieldStr && !isFieldNum ? '' : '' + fieldVal;\n valStr = '' + value;\n } // if we're doing a case insensitive comparison, then we're using a STRING comparison\n // even if we're comparing numbers\n\n\n if (caseInsensitive) {\n fieldVal = fieldStr = fieldStr.toLowerCase();\n value = valStr = valStr.toLowerCase();\n }\n\n switch (operator) {\n case '*=':\n matches = fieldStr.indexOf(valStr) >= 0;\n break;\n\n case '$=':\n matches = fieldStr.indexOf(valStr, fieldStr.length - valStr.length) >= 0;\n break;\n\n case '^=':\n matches = fieldStr.indexOf(valStr) === 0;\n break;\n\n case '=':\n matches = fieldVal === value;\n break;\n\n case '>':\n isIneqCmp = true;\n matches = fieldVal > value;\n break;\n\n case '>=':\n isIneqCmp = true;\n matches = fieldVal >= value;\n break;\n\n case '<':\n isIneqCmp = true;\n matches = fieldVal < value;\n break;\n\n case '<=':\n isIneqCmp = true;\n matches = fieldVal <= value;\n break;\n\n default:\n matches = false;\n break;\n } // apply the not op, but null vals for inequalities should always stay non-matching\n\n\n if (notExpr && (fieldVal != null || !isIneqCmp)) {\n matches = !matches;\n }\n\n return matches;\n};\nvar boolCmp = function boolCmp(fieldVal, operator) {\n switch (operator) {\n case '?':\n return fieldVal ? true : false;\n\n case '!':\n return fieldVal ? false : true;\n\n case '^':\n return fieldVal === undefined;\n }\n};\nvar existCmp = function existCmp(fieldVal) {\n return fieldVal !== undefined;\n};\nvar data = function data(ele, field) {\n return ele.data(field);\n};\nvar meta = function meta(ele, field) {\n return ele[field]();\n};\n\n/** A lookup of `match(check, ele)` functions by `Type` int */\n\nvar match = [];\n/**\n * Returns whether the query matches for the element\n * @param query The `{ type, value, ... }` query object\n * @param ele The element to compare against\n*/\n\nvar matches = function matches(query, ele) {\n return query.checks.every(function (chk) {\n return match[chk.type](chk, ele);\n });\n};\n\nmatch[Type.GROUP] = function (check, ele) {\n var group = check.value;\n return group === '*' || group === ele.group();\n};\n\nmatch[Type.STATE] = function (check, ele) {\n var stateSelector = check.value;\n return stateSelectorMatches(stateSelector, ele);\n};\n\nmatch[Type.ID] = function (check, ele) {\n var id = check.value;\n return ele.id() === id;\n};\n\nmatch[Type.CLASS] = function (check, ele) {\n var cls = check.value;\n return ele.hasClass(cls);\n};\n\nmatch[Type.META_COMPARE] = function (check, ele) {\n var field = check.field,\n operator = check.operator,\n value = check.value;\n return valCmp(meta(ele, field), operator, value);\n};\n\nmatch[Type.DATA_COMPARE] = function (check, ele) {\n var field = check.field,\n operator = check.operator,\n value = check.value;\n return valCmp(data(ele, field), operator, value);\n};\n\nmatch[Type.DATA_BOOL] = function (check, ele) {\n var field = check.field,\n operator = check.operator;\n return boolCmp(data(ele, field), operator);\n};\n\nmatch[Type.DATA_EXIST] = function (check, ele) {\n var field = check.field,\n operator = check.operator;\n return existCmp(data(ele, field));\n};\n\nmatch[Type.UNDIRECTED_EDGE] = function (check, ele) {\n var qA = check.nodes[0];\n var qB = check.nodes[1];\n var src = ele.source();\n var tgt = ele.target();\n return matches(qA, src) && matches(qB, tgt) || matches(qB, src) && matches(qA, tgt);\n};\n\nmatch[Type.NODE_NEIGHBOR] = function (check, ele) {\n return matches(check.node, ele) && ele.neighborhood().some(function (n) {\n return n.isNode() && matches(check.neighbor, n);\n });\n};\n\nmatch[Type.DIRECTED_EDGE] = function (check, ele) {\n return matches(check.source, ele.source()) && matches(check.target, ele.target());\n};\n\nmatch[Type.NODE_SOURCE] = function (check, ele) {\n return matches(check.source, ele) && ele.outgoers().some(function (n) {\n return n.isNode() && matches(check.target, n);\n });\n};\n\nmatch[Type.NODE_TARGET] = function (check, ele) {\n return matches(check.target, ele) && ele.incomers().some(function (n) {\n return n.isNode() && matches(check.source, n);\n });\n};\n\nmatch[Type.CHILD] = function (check, ele) {\n return matches(check.child, ele) && matches(check.parent, ele.parent());\n};\n\nmatch[Type.PARENT] = function (check, ele) {\n return matches(check.parent, ele) && ele.children().some(function (c) {\n return matches(check.child, c);\n });\n};\n\nmatch[Type.DESCENDANT] = function (check, ele) {\n return matches(check.descendant, ele) && ele.ancestors().some(function (a) {\n return matches(check.ancestor, a);\n });\n};\n\nmatch[Type.ANCESTOR] = function (check, ele) {\n return matches(check.ancestor, ele) && ele.descendants().some(function (d) {\n return matches(check.descendant, d);\n });\n};\n\nmatch[Type.COMPOUND_SPLIT] = function (check, ele) {\n return matches(check.subject, ele) && matches(check.left, ele) && matches(check.right, ele);\n};\n\nmatch[Type.TRUE] = function () {\n return true;\n};\n\nmatch[Type.COLLECTION] = function (check, ele) {\n var collection = check.value;\n return collection.has(ele);\n};\n\nmatch[Type.FILTER] = function (check, ele) {\n var filter = check.value;\n return filter(ele);\n};\n\nvar filter = function filter(collection) {\n var self = this; // for 1 id #foo queries, just get the element\n\n if (self.length === 1 && self[0].checks.length === 1 && self[0].checks[0].type === Type.ID) {\n return collection.getElementById(self[0].checks[0].value).collection();\n }\n\n var selectorFunction = function selectorFunction(element) {\n for (var j = 0; j < self.length; j++) {\n var query = self[j];\n\n if (matches(query, element)) {\n return true;\n }\n }\n\n return false;\n };\n\n if (self.text() == null) {\n selectorFunction = function selectorFunction() {\n return true;\n };\n }\n\n return collection.filter(selectorFunction);\n}; // filter\n// does selector match a single element?\n\n\nvar matches$1 = function matches$1(ele) {\n var self = this;\n\n for (var j = 0; j < self.length; j++) {\n var query = self[j];\n\n if (matches(query, ele)) {\n return true;\n }\n }\n\n return false;\n}; // matches\n\n\nvar matching = {\n matches: matches$1,\n filter: filter\n};\n\nvar Selector = function Selector(selector) {\n this.inputText = selector;\n this.currentSubject = null;\n this.compoundCount = 0;\n this.edgeCount = 0;\n this.length = 0;\n\n if (selector == null || string(selector) && selector.match(/^\\s*$/)) ; else if (elementOrCollection(selector)) {\n this.addQuery({\n checks: [{\n type: Type.COLLECTION,\n value: selector.collection()\n }]\n });\n } else if (fn(selector)) {\n this.addQuery({\n checks: [{\n type: Type.FILTER,\n value: selector\n }]\n });\n } else if (string(selector)) {\n if (!this.parse(selector)) {\n this.invalid = true;\n }\n } else {\n error('A selector must be created from a string; found ');\n }\n};\n\nvar selfn = Selector.prototype;\n[parse$1, matching].forEach(function (p) {\n return extend(selfn, p);\n});\n\nselfn.text = function () {\n return this.inputText;\n};\n\nselfn.size = function () {\n return this.length;\n};\n\nselfn.eq = function (i) {\n return this[i];\n};\n\nselfn.sameText = function (otherSel) {\n return !this.invalid && !otherSel.invalid && this.text() === otherSel.text();\n};\n\nselfn.addQuery = function (q) {\n this[this.length++] = q;\n};\n\nselfn.selector = selfn.toString;\n\nvar elesfn$f = {\n allAre: function allAre(selector) {\n var selObj = new Selector(selector);\n return this.every(function (ele) {\n return selObj.matches(ele);\n });\n },\n is: function is(selector) {\n var selObj = new Selector(selector);\n return this.some(function (ele) {\n return selObj.matches(ele);\n });\n },\n some: function some(fn, thisArg) {\n for (var i = 0; i < this.length; i++) {\n var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]);\n\n if (ret) {\n return true;\n }\n }\n\n return false;\n },\n every: function every(fn, thisArg) {\n for (var i = 0; i < this.length; i++) {\n var ret = !thisArg ? fn(this[i], i, this) : fn.apply(thisArg, [this[i], i, this]);\n\n if (!ret) {\n return false;\n }\n }\n\n return true;\n },\n same: function same(collection) {\n // cheap collection ref check\n if (this === collection) {\n return true;\n }\n\n collection = this.cy().collection(collection);\n var thisLength = this.length;\n var collectionLength = collection.length; // cheap length check\n\n if (thisLength !== collectionLength) {\n return false;\n } // cheap element ref check\n\n\n if (thisLength === 1) {\n return this[0] === collection[0];\n }\n\n return this.every(function (ele) {\n return collection.hasElementWithId(ele.id());\n });\n },\n anySame: function anySame(collection) {\n collection = this.cy().collection(collection);\n return this.some(function (ele) {\n return collection.hasElementWithId(ele.id());\n });\n },\n allAreNeighbors: function allAreNeighbors(collection) {\n collection = this.cy().collection(collection);\n var nhood = this.neighborhood();\n return collection.every(function (ele) {\n return nhood.hasElementWithId(ele.id());\n });\n },\n contains: function contains(collection) {\n collection = this.cy().collection(collection);\n var self = this;\n return collection.every(function (ele) {\n return self.hasElementWithId(ele.id());\n });\n }\n};\nelesfn$f.allAreNeighbours = elesfn$f.allAreNeighbors;\nelesfn$f.has = elesfn$f.contains;\nelesfn$f.equal = elesfn$f.equals = elesfn$f.same;\n\nvar cache = function cache(fn, name) {\n return function traversalCache(arg1, arg2, arg3, arg4) {\n var selectorOrEles = arg1;\n var eles = this;\n var key;\n\n if (selectorOrEles == null) {\n key = '';\n } else if (elementOrCollection(selectorOrEles) && selectorOrEles.length === 1) {\n key = selectorOrEles.id();\n }\n\n if (eles.length === 1 && key) {\n var _p = eles[0]._private;\n var tch = _p.traversalCache = _p.traversalCache || {};\n var ch = tch[name] = tch[name] || [];\n var hash = hashString(key);\n var cacheHit = ch[hash];\n\n if (cacheHit) {\n return cacheHit;\n } else {\n return ch[hash] = fn.call(eles, arg1, arg2, arg3, arg4);\n }\n } else {\n return fn.call(eles, arg1, arg2, arg3, arg4);\n }\n };\n};\n\nvar elesfn$g = {\n parent: function parent(selector) {\n var parents = []; // optimisation for single ele call\n\n if (this.length === 1) {\n var parent = this[0]._private.parent;\n\n if (parent) {\n return parent;\n }\n }\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var _parent = ele._private.parent;\n\n if (_parent) {\n parents.push(_parent);\n }\n }\n\n return this.spawn(parents, {\n unique: true\n }).filter(selector);\n },\n parents: function parents(selector) {\n var parents = [];\n var eles = this.parent();\n\n while (eles.nonempty()) {\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n parents.push(ele);\n }\n\n eles = eles.parent();\n }\n\n return this.spawn(parents, {\n unique: true\n }).filter(selector);\n },\n commonAncestors: function commonAncestors(selector) {\n var ancestors;\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var parents = ele.parents();\n ancestors = ancestors || parents;\n ancestors = ancestors.intersect(parents); // current list must be common with current ele parents set\n }\n\n return ancestors.filter(selector);\n },\n orphans: function orphans(selector) {\n return this.stdFilter(function (ele) {\n return ele.isOrphan();\n }).filter(selector);\n },\n nonorphans: function nonorphans(selector) {\n return this.stdFilter(function (ele) {\n return ele.isChild();\n }).filter(selector);\n },\n children: cache(function (selector) {\n var children = [];\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var eleChildren = ele._private.children;\n\n for (var j = 0; j < eleChildren.length; j++) {\n children.push(eleChildren[j]);\n }\n }\n\n return this.spawn(children, {\n unique: true\n }).filter(selector);\n }, 'children'),\n siblings: function siblings(selector) {\n return this.parent().children().not(this).filter(selector);\n },\n isParent: function isParent() {\n var ele = this[0];\n\n if (ele) {\n return ele.isNode() && ele._private.children.length !== 0;\n }\n },\n isChildless: function isChildless() {\n var ele = this[0];\n\n if (ele) {\n return ele.isNode() && ele._private.children.length === 0;\n }\n },\n isChild: function isChild() {\n var ele = this[0];\n\n if (ele) {\n return ele.isNode() && ele._private.parent != null;\n }\n },\n isOrphan: function isOrphan() {\n var ele = this[0];\n\n if (ele) {\n return ele.isNode() && ele._private.parent == null;\n }\n },\n descendants: function descendants(selector) {\n var elements = [];\n\n function add(eles) {\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n elements.push(ele);\n\n if (ele.children().nonempty()) {\n add(ele.children());\n }\n }\n }\n\n add(this.children());\n return this.spawn(elements, {\n unique: true\n }).filter(selector);\n }\n};\n\nfunction forEachCompound(eles, fn, includeSelf, recursiveStep) {\n var q = [];\n var did = new Set$1();\n var cy = eles.cy();\n var hasCompounds = cy.hasCompoundNodes();\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n\n if (includeSelf) {\n q.push(ele);\n } else if (hasCompounds) {\n recursiveStep(q, did, ele);\n }\n }\n\n while (q.length > 0) {\n var _ele = q.shift();\n\n fn(_ele);\n did.add(_ele.id());\n\n if (hasCompounds) {\n recursiveStep(q, did, _ele);\n }\n }\n\n return eles;\n}\n\nfunction addChildren(q, did, ele) {\n if (ele.isParent()) {\n var children = ele._private.children;\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n\n if (!did.has(child.id())) {\n q.push(child);\n }\n }\n }\n} // very efficient version of eles.add( eles.descendants() ).forEach()\n// for internal use\n\n\nelesfn$g.forEachDown = function (fn) {\n var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return forEachCompound(this, fn, includeSelf, addChildren);\n};\n\nfunction addParent(q, did, ele) {\n if (ele.isChild()) {\n var parent = ele._private.parent;\n\n if (!did.has(parent.id())) {\n q.push(parent);\n }\n }\n}\n\nelesfn$g.forEachUp = function (fn) {\n var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return forEachCompound(this, fn, includeSelf, addParent);\n};\n\nfunction addParentAndChildren(q, did, ele) {\n addParent(q, did, ele);\n addChildren(q, did, ele);\n}\n\nelesfn$g.forEachUpAndDown = function (fn) {\n var includeSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return forEachCompound(this, fn, includeSelf, addParentAndChildren);\n}; // aliases\n\n\nelesfn$g.ancestors = elesfn$g.parents;\n\nvar fn$1, elesfn$h;\nfn$1 = elesfn$h = {\n data: define$3.data({\n field: 'data',\n bindingEvent: 'data',\n allowBinding: true,\n allowSetting: true,\n settingEvent: 'data',\n settingTriggersEvent: true,\n triggerFnName: 'trigger',\n allowGetting: true,\n immutableKeys: {\n 'id': true,\n 'source': true,\n 'target': true,\n 'parent': true\n },\n updateStyle: true\n }),\n removeData: define$3.removeData({\n field: 'data',\n event: 'data',\n triggerFnName: 'trigger',\n triggerEvent: true,\n immutableKeys: {\n 'id': true,\n 'source': true,\n 'target': true,\n 'parent': true\n },\n updateStyle: true\n }),\n scratch: define$3.data({\n field: 'scratch',\n bindingEvent: 'scratch',\n allowBinding: true,\n allowSetting: true,\n settingEvent: 'scratch',\n settingTriggersEvent: true,\n triggerFnName: 'trigger',\n allowGetting: true,\n updateStyle: true\n }),\n removeScratch: define$3.removeData({\n field: 'scratch',\n event: 'scratch',\n triggerFnName: 'trigger',\n triggerEvent: true,\n updateStyle: true\n }),\n rscratch: define$3.data({\n field: 'rscratch',\n allowBinding: false,\n allowSetting: true,\n settingTriggersEvent: false,\n allowGetting: true\n }),\n removeRscratch: define$3.removeData({\n field: 'rscratch',\n triggerEvent: false\n }),\n id: function id() {\n var ele = this[0];\n\n if (ele) {\n return ele._private.data.id;\n }\n }\n}; // aliases\n\nfn$1.attr = fn$1.data;\nfn$1.removeAttr = fn$1.removeData;\nvar data$1 = elesfn$h;\n\nvar elesfn$i = {};\n\nfunction defineDegreeFunction(callback) {\n return function (includeLoops) {\n var self = this;\n\n if (includeLoops === undefined) {\n includeLoops = true;\n }\n\n if (self.length === 0) {\n return;\n }\n\n if (self.isNode() && !self.removed()) {\n var degree = 0;\n var node = self[0];\n var connectedEdges = node._private.edges;\n\n for (var i = 0; i < connectedEdges.length; i++) {\n var edge = connectedEdges[i];\n\n if (!includeLoops && edge.isLoop()) {\n continue;\n }\n\n degree += callback(node, edge);\n }\n\n return degree;\n } else {\n return;\n }\n };\n}\n\nextend(elesfn$i, {\n degree: defineDegreeFunction(function (node, edge) {\n if (edge.source().same(edge.target())) {\n return 2;\n } else {\n return 1;\n }\n }),\n indegree: defineDegreeFunction(function (node, edge) {\n if (edge.target().same(node)) {\n return 1;\n } else {\n return 0;\n }\n }),\n outdegree: defineDegreeFunction(function (node, edge) {\n if (edge.source().same(node)) {\n return 1;\n } else {\n return 0;\n }\n })\n});\n\nfunction defineDegreeBoundsFunction(degreeFn, callback) {\n return function (includeLoops) {\n var ret;\n var nodes = this.nodes();\n\n for (var i = 0; i < nodes.length; i++) {\n var ele = nodes[i];\n var degree = ele[degreeFn](includeLoops);\n\n if (degree !== undefined && (ret === undefined || callback(degree, ret))) {\n ret = degree;\n }\n }\n\n return ret;\n };\n}\n\nextend(elesfn$i, {\n minDegree: defineDegreeBoundsFunction('degree', function (degree, min) {\n return degree < min;\n }),\n maxDegree: defineDegreeBoundsFunction('degree', function (degree, max) {\n return degree > max;\n }),\n minIndegree: defineDegreeBoundsFunction('indegree', function (degree, min) {\n return degree < min;\n }),\n maxIndegree: defineDegreeBoundsFunction('indegree', function (degree, max) {\n return degree > max;\n }),\n minOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, min) {\n return degree < min;\n }),\n maxOutdegree: defineDegreeBoundsFunction('outdegree', function (degree, max) {\n return degree > max;\n })\n});\nextend(elesfn$i, {\n totalDegree: function totalDegree(includeLoops) {\n var total = 0;\n var nodes = this.nodes();\n\n for (var i = 0; i < nodes.length; i++) {\n total += nodes[i].degree(includeLoops);\n }\n\n return total;\n }\n});\n\nvar fn$2, elesfn$j;\n\nvar beforePositionSet = function beforePositionSet(eles, newPos, silent) {\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n\n if (!ele.locked()) {\n var oldPos = ele._private.position;\n var delta = {\n x: newPos.x != null ? newPos.x - oldPos.x : 0,\n y: newPos.y != null ? newPos.y - oldPos.y : 0\n };\n\n if (ele.isParent() && !(delta.x === 0 && delta.y === 0)) {\n ele.children().shift(delta, silent);\n }\n\n ele.shiftCachedBoundingBox(delta);\n }\n }\n};\n\nvar positionDef = {\n field: 'position',\n bindingEvent: 'position',\n allowBinding: true,\n allowSetting: true,\n settingEvent: 'position',\n settingTriggersEvent: true,\n triggerFnName: 'emitAndNotify',\n allowGetting: true,\n validKeys: ['x', 'y'],\n beforeGet: function beforeGet(ele) {\n ele.updateCompoundBounds();\n },\n beforeSet: function beforeSet(eles, newPos) {\n beforePositionSet(eles, newPos, false);\n },\n onSet: function onSet(eles) {\n eles.dirtyCompoundBoundsCache();\n },\n canSet: function canSet(ele) {\n return !ele.locked();\n }\n};\nfn$2 = elesfn$j = {\n position: define$3.data(positionDef),\n // position but no notification to renderer\n silentPosition: define$3.data(extend({}, positionDef, {\n allowBinding: false,\n allowSetting: true,\n settingTriggersEvent: false,\n allowGetting: false,\n beforeSet: function beforeSet(eles, newPos) {\n beforePositionSet(eles, newPos, true);\n }\n })),\n positions: function positions(pos, silent) {\n if (plainObject(pos)) {\n if (silent) {\n this.silentPosition(pos);\n } else {\n this.position(pos);\n }\n } else if (fn(pos)) {\n var _fn = pos;\n var cy = this.cy();\n cy.startBatch();\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n\n var _pos = void 0;\n\n if (_pos = _fn(ele, i)) {\n if (silent) {\n ele.silentPosition(_pos);\n } else {\n ele.position(_pos);\n }\n }\n }\n\n cy.endBatch();\n }\n\n return this; // chaining\n },\n silentPositions: function silentPositions(pos) {\n return this.positions(pos, true);\n },\n shift: function shift(dim, val, silent) {\n var delta;\n\n if (plainObject(dim)) {\n delta = {\n x: number(dim.x) ? dim.x : 0,\n y: number(dim.y) ? dim.y : 0\n };\n silent = val;\n } else if (string(dim) && number(val)) {\n delta = {\n x: 0,\n y: 0\n };\n delta[dim] = val;\n }\n\n if (delta != null) {\n var cy = this.cy();\n cy.startBatch();\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var pos = ele.position();\n var newPos = {\n x: pos.x + delta.x,\n y: pos.y + delta.y\n };\n\n if (silent) {\n ele.silentPosition(newPos);\n } else {\n ele.position(newPos);\n }\n }\n\n cy.endBatch();\n }\n\n return this;\n },\n silentShift: function silentShift(dim, val) {\n if (plainObject(dim)) {\n this.shift(dim, true);\n } else if (string(dim) && number(val)) {\n this.shift(dim, val, true);\n }\n\n return this;\n },\n // get/set the rendered (i.e. on screen) positon of the element\n renderedPosition: function renderedPosition(dim, val) {\n var ele = this[0];\n var cy = this.cy();\n var zoom = cy.zoom();\n var pan = cy.pan();\n var rpos = plainObject(dim) ? dim : undefined;\n var setting = rpos !== undefined || val !== undefined && string(dim);\n\n if (ele && ele.isNode()) {\n // must have an element and must be a node to return position\n if (setting) {\n for (var i = 0; i < this.length; i++) {\n var _ele = this[i];\n\n if (val !== undefined) {\n // set one dimension\n _ele.position(dim, (val - pan[dim]) / zoom);\n } else if (rpos !== undefined) {\n // set whole position\n _ele.position(renderedToModelPosition(rpos, zoom, pan));\n }\n }\n } else {\n // getting\n var pos = ele.position();\n rpos = modelToRenderedPosition(pos, zoom, pan);\n\n if (dim === undefined) {\n // then return the whole rendered position\n return rpos;\n } else {\n // then return the specified dimension\n return rpos[dim];\n }\n }\n } else if (!setting) {\n return undefined; // for empty collection case\n }\n\n return this; // chaining\n },\n // get/set the position relative to the parent\n relativePosition: function relativePosition(dim, val) {\n var ele = this[0];\n var cy = this.cy();\n var ppos = plainObject(dim) ? dim : undefined;\n var setting = ppos !== undefined || val !== undefined && string(dim);\n var hasCompoundNodes = cy.hasCompoundNodes();\n\n if (ele && ele.isNode()) {\n // must have an element and must be a node to return position\n if (setting) {\n for (var i = 0; i < this.length; i++) {\n var _ele2 = this[i];\n var parent = hasCompoundNodes ? _ele2.parent() : null;\n var hasParent = parent && parent.length > 0;\n var relativeToParent = hasParent;\n\n if (hasParent) {\n parent = parent[0];\n }\n\n var origin = relativeToParent ? parent.position() : {\n x: 0,\n y: 0\n };\n\n if (val !== undefined) {\n // set one dimension\n _ele2.position(dim, val + origin[dim]);\n } else if (ppos !== undefined) {\n // set whole position\n _ele2.position({\n x: ppos.x + origin.x,\n y: ppos.y + origin.y\n });\n }\n }\n } else {\n // getting\n var pos = ele.position();\n\n var _parent = hasCompoundNodes ? ele.parent() : null;\n\n var _hasParent = _parent && _parent.length > 0;\n\n var _relativeToParent = _hasParent;\n\n if (_hasParent) {\n _parent = _parent[0];\n }\n\n var _origin = _relativeToParent ? _parent.position() : {\n x: 0,\n y: 0\n };\n\n ppos = {\n x: pos.x - _origin.x,\n y: pos.y - _origin.y\n };\n\n if (dim === undefined) {\n // then return the whole rendered position\n return ppos;\n } else {\n // then return the specified dimension\n return ppos[dim];\n }\n }\n } else if (!setting) {\n return undefined; // for empty collection case\n }\n\n return this; // chaining\n }\n}; // aliases\n\nfn$2.modelPosition = fn$2.point = fn$2.position;\nfn$2.modelPositions = fn$2.points = fn$2.positions;\nfn$2.renderedPoint = fn$2.renderedPosition;\nfn$2.relativePoint = fn$2.relativePosition;\nvar position = elesfn$j;\n\nvar fn$3, elesfn$k;\nfn$3 = elesfn$k = {};\n\nelesfn$k.renderedBoundingBox = function (options) {\n var bb = this.boundingBox(options);\n var cy = this.cy();\n var zoom = cy.zoom();\n var pan = cy.pan();\n var x1 = bb.x1 * zoom + pan.x;\n var x2 = bb.x2 * zoom + pan.x;\n var y1 = bb.y1 * zoom + pan.y;\n var y2 = bb.y2 * zoom + pan.y;\n return {\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2,\n w: x2 - x1,\n h: y2 - y1\n };\n};\n\nelesfn$k.dirtyCompoundBoundsCache = function () {\n var cy = this.cy();\n\n if (!cy.styleEnabled() || !cy.hasCompoundNodes()) {\n return this;\n }\n\n this.forEachUp(function (ele) {\n if (ele.isParent()) {\n var _p = ele._private;\n _p.compoundBoundsClean = false;\n _p.bbCache = null;\n ele.emitAndNotify('bounds');\n }\n });\n return this;\n};\n\nelesfn$k.updateCompoundBounds = function () {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var cy = this.cy(); // not possible to do on non-compound graphs or with the style disabled\n\n if (!cy.styleEnabled() || !cy.hasCompoundNodes()) {\n return this;\n } // save cycles when batching -- but bounds will be stale (or not exist yet)\n\n\n if (!force && cy.batching()) {\n return this;\n }\n\n function update(parent) {\n if (!parent.isParent()) {\n return;\n }\n\n var _p = parent._private;\n var children = parent.children();\n var includeLabels = parent.pstyle('compound-sizing-wrt-labels').value === 'include';\n var min = {\n width: {\n val: parent.pstyle('min-width').pfValue,\n left: parent.pstyle('min-width-bias-left'),\n right: parent.pstyle('min-width-bias-right')\n },\n height: {\n val: parent.pstyle('min-height').pfValue,\n top: parent.pstyle('min-height-bias-top'),\n bottom: parent.pstyle('min-height-bias-bottom')\n }\n };\n var bb = children.boundingBox({\n includeLabels: includeLabels,\n includeOverlays: false,\n // updating the compound bounds happens outside of the regular\n // cache cycle (i.e. before fired events)\n useCache: false\n });\n var pos = _p.position; // if children take up zero area then keep position and fall back on stylesheet w/h\n\n if (bb.w === 0 || bb.h === 0) {\n bb = {\n w: parent.pstyle('width').pfValue,\n h: parent.pstyle('height').pfValue\n };\n bb.x1 = pos.x - bb.w / 2;\n bb.x2 = pos.x + bb.w / 2;\n bb.y1 = pos.y - bb.h / 2;\n bb.y2 = pos.y + bb.h / 2;\n }\n\n function computeBiasValues(propDiff, propBias, propBiasComplement) {\n var biasDiff = 0;\n var biasComplementDiff = 0;\n var biasTotal = propBias + propBiasComplement;\n\n if (propDiff > 0 && biasTotal > 0) {\n biasDiff = propBias / biasTotal * propDiff;\n biasComplementDiff = propBiasComplement / biasTotal * propDiff;\n }\n\n return {\n biasDiff: biasDiff,\n biasComplementDiff: biasComplementDiff\n };\n }\n\n function computePaddingValues(width, height, paddingObject, relativeTo) {\n // Assuming percentage is number from 0 to 1\n if (paddingObject.units === '%') {\n switch (relativeTo) {\n case 'width':\n return width > 0 ? paddingObject.pfValue * width : 0;\n\n case 'height':\n return height > 0 ? paddingObject.pfValue * height : 0;\n\n case 'average':\n return width > 0 && height > 0 ? paddingObject.pfValue * (width + height) / 2 : 0;\n\n case 'min':\n return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * height : paddingObject.pfValue * width : 0;\n\n case 'max':\n return width > 0 && height > 0 ? width > height ? paddingObject.pfValue * width : paddingObject.pfValue * height : 0;\n\n default:\n return 0;\n }\n } else if (paddingObject.units === 'px') {\n return paddingObject.pfValue;\n } else {\n return 0;\n }\n }\n\n var leftVal = min.width.left.value;\n\n if (min.width.left.units === 'px' && min.width.val > 0) {\n leftVal = leftVal * 100 / min.width.val;\n }\n\n var rightVal = min.width.right.value;\n\n if (min.width.right.units === 'px' && min.width.val > 0) {\n rightVal = rightVal * 100 / min.width.val;\n }\n\n var topVal = min.height.top.value;\n\n if (min.height.top.units === 'px' && min.height.val > 0) {\n topVal = topVal * 100 / min.height.val;\n }\n\n var bottomVal = min.height.bottom.value;\n\n if (min.height.bottom.units === 'px' && min.height.val > 0) {\n bottomVal = bottomVal * 100 / min.height.val;\n }\n\n var widthBiasDiffs = computeBiasValues(min.width.val - bb.w, leftVal, rightVal);\n var diffLeft = widthBiasDiffs.biasDiff;\n var diffRight = widthBiasDiffs.biasComplementDiff;\n var heightBiasDiffs = computeBiasValues(min.height.val - bb.h, topVal, bottomVal);\n var diffTop = heightBiasDiffs.biasDiff;\n var diffBottom = heightBiasDiffs.biasComplementDiff;\n _p.autoPadding = computePaddingValues(bb.w, bb.h, parent.pstyle('padding'), parent.pstyle('padding-relative-to').value);\n _p.autoWidth = Math.max(bb.w, min.width.val);\n pos.x = (-diffLeft + bb.x1 + bb.x2 + diffRight) / 2;\n _p.autoHeight = Math.max(bb.h, min.height.val);\n pos.y = (-diffTop + bb.y1 + bb.y2 + diffBottom) / 2;\n }\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var _p = ele._private;\n\n if (!_p.compoundBoundsClean) {\n update(ele);\n\n if (!cy.batching()) {\n _p.compoundBoundsClean = true;\n }\n }\n }\n\n return this;\n};\n\nvar noninf = function noninf(x) {\n if (x === Infinity || x === -Infinity) {\n return 0;\n }\n\n return x;\n};\n\nvar updateBounds = function updateBounds(b, x1, y1, x2, y2) {\n // don't update with zero area boxes\n if (x2 - x1 === 0 || y2 - y1 === 0) {\n return;\n } // don't update with null dim\n\n\n if (x1 == null || y1 == null || x2 == null || y2 == null) {\n return;\n }\n\n b.x1 = x1 < b.x1 ? x1 : b.x1;\n b.x2 = x2 > b.x2 ? x2 : b.x2;\n b.y1 = y1 < b.y1 ? y1 : b.y1;\n b.y2 = y2 > b.y2 ? y2 : b.y2;\n b.w = b.x2 - b.x1;\n b.h = b.y2 - b.y1;\n};\n\nvar updateBoundsFromBox = function updateBoundsFromBox(b, b2) {\n if (b2 == null) {\n return b;\n }\n\n return updateBounds(b, b2.x1, b2.y1, b2.x2, b2.y2);\n};\n\nvar prefixedProperty = function prefixedProperty(obj, field, prefix) {\n return getPrefixedProperty(obj, field, prefix);\n};\n\nvar updateBoundsFromArrow = function updateBoundsFromArrow(bounds, ele, prefix) {\n if (ele.cy().headless()) {\n return;\n }\n\n var _p = ele._private;\n var rstyle = _p.rstyle;\n var halfArW = rstyle.arrowWidth / 2;\n var arrowType = ele.pstyle(prefix + '-arrow-shape').value;\n var x;\n var y;\n\n if (arrowType !== 'none') {\n if (prefix === 'source') {\n x = rstyle.srcX;\n y = rstyle.srcY;\n } else if (prefix === 'target') {\n x = rstyle.tgtX;\n y = rstyle.tgtY;\n } else {\n x = rstyle.midX;\n y = rstyle.midY;\n } // always store the individual arrow bounds\n\n\n var bbs = _p.arrowBounds = _p.arrowBounds || {};\n var bb = bbs[prefix] = bbs[prefix] || {};\n bb.x1 = x - halfArW;\n bb.y1 = y - halfArW;\n bb.x2 = x + halfArW;\n bb.y2 = y + halfArW;\n bb.w = bb.x2 - bb.x1;\n bb.h = bb.y2 - bb.y1;\n expandBoundingBox(bb, 1);\n updateBounds(bounds, bb.x1, bb.y1, bb.x2, bb.y2);\n }\n};\n\nvar updateBoundsFromLabel = function updateBoundsFromLabel(bounds, ele, prefix) {\n if (ele.cy().headless()) {\n return;\n }\n\n var prefixDash;\n\n if (prefix) {\n prefixDash = prefix + '-';\n } else {\n prefixDash = '';\n }\n\n var _p = ele._private;\n var rstyle = _p.rstyle;\n var label = ele.pstyle(prefixDash + 'label').strValue;\n\n if (label) {\n var halign = ele.pstyle('text-halign');\n var valign = ele.pstyle('text-valign');\n var labelWidth = prefixedProperty(rstyle, 'labelWidth', prefix);\n var labelHeight = prefixedProperty(rstyle, 'labelHeight', prefix);\n var labelX = prefixedProperty(rstyle, 'labelX', prefix);\n var labelY = prefixedProperty(rstyle, 'labelY', prefix);\n var marginX = ele.pstyle(prefixDash + 'text-margin-x').pfValue;\n var marginY = ele.pstyle(prefixDash + 'text-margin-y').pfValue;\n var isEdge = ele.isEdge();\n var rotation = ele.pstyle(prefixDash + 'text-rotation');\n var outlineWidth = ele.pstyle('text-outline-width').pfValue;\n var borderWidth = ele.pstyle('text-border-width').pfValue;\n var halfBorderWidth = borderWidth / 2;\n var padding = ele.pstyle('text-background-padding').pfValue;\n var lh = labelHeight;\n var lw = labelWidth;\n var lw_2 = lw / 2;\n var lh_2 = lh / 2;\n var lx1, lx2, ly1, ly2;\n\n if (isEdge) {\n lx1 = labelX - lw_2;\n lx2 = labelX + lw_2;\n ly1 = labelY - lh_2;\n ly2 = labelY + lh_2;\n } else {\n switch (halign.value) {\n case 'left':\n lx1 = labelX - lw;\n lx2 = labelX;\n break;\n\n case 'center':\n lx1 = labelX - lw_2;\n lx2 = labelX + lw_2;\n break;\n\n case 'right':\n lx1 = labelX;\n lx2 = labelX + lw;\n break;\n }\n\n switch (valign.value) {\n case 'top':\n ly1 = labelY - lh;\n ly2 = labelY;\n break;\n\n case 'center':\n ly1 = labelY - lh_2;\n ly2 = labelY + lh_2;\n break;\n\n case 'bottom':\n ly1 = labelY;\n ly2 = labelY + lh;\n break;\n }\n } // shift by margin and expand by outline and border\n\n\n lx1 += marginX - Math.max(outlineWidth, halfBorderWidth) - padding;\n lx2 += marginX + Math.max(outlineWidth, halfBorderWidth) + padding;\n ly1 += marginY - Math.max(outlineWidth, halfBorderWidth) - padding;\n ly2 += marginY + Math.max(outlineWidth, halfBorderWidth) + padding; // always store the unrotated label bounds separately\n\n var bbPrefix = prefix || 'main';\n var bbs = _p.labelBounds;\n var bb = bbs[bbPrefix] = bbs[bbPrefix] || {};\n bb.x1 = lx1;\n bb.y1 = ly1;\n bb.x2 = lx2;\n bb.y2 = ly2;\n bb.w = lx2 - lx1;\n bb.h = ly2 - ly1;\n expandBoundingBox(bb, 1); // expand to work around browser dimension inaccuracies\n\n var isAutorotate = isEdge && rotation.strValue === 'autorotate';\n var isPfValue = rotation.pfValue != null && rotation.pfValue !== 0;\n\n if (isAutorotate || isPfValue) {\n var theta = isAutorotate ? prefixedProperty(_p.rstyle, 'labelAngle', prefix) : rotation.pfValue;\n var cos = Math.cos(theta);\n var sin = Math.sin(theta); // rotation point (default value for center-center)\n\n var xo = (lx1 + lx2) / 2;\n var yo = (ly1 + ly2) / 2;\n\n if (!isEdge) {\n switch (halign.value) {\n case 'left':\n xo = lx2;\n break;\n\n case 'right':\n xo = lx1;\n break;\n }\n\n switch (valign.value) {\n case 'top':\n yo = ly2;\n break;\n\n case 'bottom':\n yo = ly1;\n break;\n }\n }\n\n var rotate = function rotate(x, y) {\n x = x - xo;\n y = y - yo;\n return {\n x: x * cos - y * sin + xo,\n y: x * sin + y * cos + yo\n };\n };\n\n var px1y1 = rotate(lx1, ly1);\n var px1y2 = rotate(lx1, ly2);\n var px2y1 = rotate(lx2, ly1);\n var px2y2 = rotate(lx2, ly2);\n lx1 = Math.min(px1y1.x, px1y2.x, px2y1.x, px2y2.x);\n lx2 = Math.max(px1y1.x, px1y2.x, px2y1.x, px2y2.x);\n ly1 = Math.min(px1y1.y, px1y2.y, px2y1.y, px2y2.y);\n ly2 = Math.max(px1y1.y, px1y2.y, px2y1.y, px2y2.y);\n }\n\n var bbPrefixRot = bbPrefix + 'Rot';\n var bbRot = bbs[bbPrefixRot] = bbs[bbPrefixRot] || {};\n bbRot.x1 = lx1;\n bbRot.y1 = ly1;\n bbRot.x2 = lx2;\n bbRot.y2 = ly2;\n bbRot.w = lx2 - lx1;\n bbRot.h = ly2 - ly1;\n updateBounds(bounds, lx1, ly1, lx2, ly2);\n updateBounds(_p.labelBounds.all, lx1, ly1, lx2, ly2);\n }\n\n return bounds;\n}; // get the bounding box of the elements (in raw model position)\n\n\nvar boundingBoxImpl = function boundingBoxImpl(ele, options) {\n var cy = ele._private.cy;\n var styleEnabled = cy.styleEnabled();\n var headless = cy.headless();\n var bounds = makeBoundingBox();\n var _p = ele._private;\n var isNode = ele.isNode();\n var isEdge = ele.isEdge();\n var ex1, ex2, ey1, ey2; // extrema of body / lines\n\n var x, y; // node pos\n\n var rstyle = _p.rstyle;\n var manualExpansion = isNode && styleEnabled ? ele.pstyle('bounds-expansion').pfValue : [0]; // must use `display` prop only, as reading `compound.width()` causes recursion\n // (other factors like width values will be considered later in this function anyway)\n\n var isDisplayed = function isDisplayed(ele) {\n return ele.pstyle('display').value !== 'none';\n };\n\n var displayed = !styleEnabled || isDisplayed(ele) // must take into account connected nodes b/c of implicit edge hiding on display:none node\n && (!isEdge || isDisplayed(ele.source()) && isDisplayed(ele.target()));\n\n if (displayed) {\n // displayed suffices, since we will find zero area eles anyway\n var overlayOpacity = 0;\n var overlayPadding = 0;\n\n if (styleEnabled && options.includeOverlays) {\n overlayOpacity = ele.pstyle('overlay-opacity').value;\n\n if (overlayOpacity !== 0) {\n overlayPadding = ele.pstyle('overlay-padding').value;\n }\n }\n\n var w = 0;\n var wHalf = 0;\n\n if (styleEnabled) {\n w = ele.pstyle('width').pfValue;\n wHalf = w / 2;\n }\n\n if (isNode && options.includeNodes) {\n var pos = ele.position();\n x = pos.x;\n y = pos.y;\n\n var _w = ele.outerWidth();\n\n var halfW = _w / 2;\n var h = ele.outerHeight();\n var halfH = h / 2; // handle node dimensions\n /////////////////////////\n\n ex1 = x - halfW;\n ex2 = x + halfW;\n ey1 = y - halfH;\n ey2 = y + halfH;\n updateBounds(bounds, ex1, ey1, ex2, ey2);\n } else if (isEdge && options.includeEdges) {\n if (styleEnabled && !headless) {\n var curveStyle = ele.pstyle('curve-style').strValue; // handle edge dimensions (rough box estimate)\n //////////////////////////////////////////////\n\n ex1 = Math.min(rstyle.srcX, rstyle.midX, rstyle.tgtX);\n ex2 = Math.max(rstyle.srcX, rstyle.midX, rstyle.tgtX);\n ey1 = Math.min(rstyle.srcY, rstyle.midY, rstyle.tgtY);\n ey2 = Math.max(rstyle.srcY, rstyle.midY, rstyle.tgtY); // take into account edge width\n\n ex1 -= wHalf;\n ex2 += wHalf;\n ey1 -= wHalf;\n ey2 += wHalf;\n updateBounds(bounds, ex1, ey1, ex2, ey2); // precise edges\n ////////////////\n\n if (curveStyle === 'haystack') {\n var hpts = rstyle.haystackPts;\n\n if (hpts && hpts.length === 2) {\n ex1 = hpts[0].x;\n ey1 = hpts[0].y;\n ex2 = hpts[1].x;\n ey2 = hpts[1].y;\n\n if (ex1 > ex2) {\n var temp = ex1;\n ex1 = ex2;\n ex2 = temp;\n }\n\n if (ey1 > ey2) {\n var _temp = ey1;\n ey1 = ey2;\n ey2 = _temp;\n }\n\n updateBounds(bounds, ex1 - wHalf, ey1 - wHalf, ex2 + wHalf, ey2 + wHalf);\n }\n } else if (curveStyle === 'bezier' || curveStyle === 'unbundled-bezier' || curveStyle === 'segments' || curveStyle === 'taxi') {\n var pts;\n\n switch (curveStyle) {\n case 'bezier':\n case 'unbundled-bezier':\n pts = rstyle.bezierPts;\n break;\n\n case 'segments':\n case 'taxi':\n pts = rstyle.linePts;\n break;\n }\n\n if (pts != null) {\n for (var j = 0; j < pts.length; j++) {\n var pt = pts[j];\n ex1 = pt.x - wHalf;\n ex2 = pt.x + wHalf;\n ey1 = pt.y - wHalf;\n ey2 = pt.y + wHalf;\n updateBounds(bounds, ex1, ey1, ex2, ey2);\n }\n }\n } // bezier-like or segment-like edge\n\n } else {\n // headless or style disabled\n // fallback on source and target positions\n //////////////////////////////////////////\n var n1 = ele.source();\n var n1pos = n1.position();\n var n2 = ele.target();\n var n2pos = n2.position();\n ex1 = n1pos.x;\n ex2 = n2pos.x;\n ey1 = n1pos.y;\n ey2 = n2pos.y;\n\n if (ex1 > ex2) {\n var _temp2 = ex1;\n ex1 = ex2;\n ex2 = _temp2;\n }\n\n if (ey1 > ey2) {\n var _temp3 = ey1;\n ey1 = ey2;\n ey2 = _temp3;\n } // take into account edge width\n\n\n ex1 -= wHalf;\n ex2 += wHalf;\n ey1 -= wHalf;\n ey2 += wHalf;\n updateBounds(bounds, ex1, ey1, ex2, ey2);\n } // headless or style disabled\n\n } // edges\n // handle edge arrow size\n /////////////////////////\n\n\n if (styleEnabled && options.includeEdges && isEdge) {\n updateBoundsFromArrow(bounds, ele, 'mid-source');\n updateBoundsFromArrow(bounds, ele, 'mid-target');\n updateBoundsFromArrow(bounds, ele, 'source');\n updateBoundsFromArrow(bounds, ele, 'target');\n } // ghost\n ////////\n\n\n if (styleEnabled) {\n var ghost = ele.pstyle('ghost').value === 'yes';\n\n if (ghost) {\n var gx = ele.pstyle('ghost-offset-x').pfValue;\n var gy = ele.pstyle('ghost-offset-y').pfValue;\n updateBounds(bounds, bounds.x1 + gx, bounds.y1 + gy, bounds.x2 + gx, bounds.y2 + gy);\n }\n } // always store the body bounds separately from the labels\n\n\n var bbBody = _p.bodyBounds = _p.bodyBounds || {};\n assignBoundingBox(bbBody, bounds);\n expandBoundingBoxSides(bbBody, manualExpansion);\n expandBoundingBox(bbBody, 1); // expand to work around browser dimension inaccuracies\n // overlay\n //////////\n\n if (styleEnabled) {\n ex1 = bounds.x1;\n ex2 = bounds.x2;\n ey1 = bounds.y1;\n ey2 = bounds.y2;\n updateBounds(bounds, ex1 - overlayPadding, ey1 - overlayPadding, ex2 + overlayPadding, ey2 + overlayPadding);\n } // always store the body bounds separately from the labels\n\n\n var bbOverlay = _p.overlayBounds = _p.overlayBounds || {};\n assignBoundingBox(bbOverlay, bounds);\n expandBoundingBoxSides(bbOverlay, manualExpansion);\n expandBoundingBox(bbOverlay, 1); // expand to work around browser dimension inaccuracies\n // handle label dimensions\n //////////////////////////\n\n var bbLabels = _p.labelBounds = _p.labelBounds || {};\n\n if (bbLabels.all != null) {\n clearBoundingBox(bbLabels.all);\n } else {\n bbLabels.all = makeBoundingBox();\n }\n\n if (styleEnabled && options.includeLabels) {\n if (options.includeMainLabels) {\n updateBoundsFromLabel(bounds, ele, null);\n }\n\n if (isEdge) {\n if (options.includeSourceLabels) {\n updateBoundsFromLabel(bounds, ele, 'source');\n }\n\n if (options.includeTargetLabels) {\n updateBoundsFromLabel(bounds, ele, 'target');\n }\n }\n } // style enabled for labels\n\n } // if displayed\n\n\n bounds.x1 = noninf(bounds.x1);\n bounds.y1 = noninf(bounds.y1);\n bounds.x2 = noninf(bounds.x2);\n bounds.y2 = noninf(bounds.y2);\n bounds.w = noninf(bounds.x2 - bounds.x1);\n bounds.h = noninf(bounds.y2 - bounds.y1);\n\n if (bounds.w > 0 && bounds.h > 0 && displayed) {\n expandBoundingBoxSides(bounds, manualExpansion); // expand bounds by 1 because antialiasing can increase the visual/effective size by 1 on all sides\n\n expandBoundingBox(bounds, 1);\n }\n\n return bounds;\n};\n\nvar getKey = function getKey(opts) {\n var i = 0;\n\n var tf = function tf(val) {\n return (val ? 1 : 0) << i++;\n };\n\n var key = 0;\n key += tf(opts.incudeNodes);\n key += tf(opts.includeEdges);\n key += tf(opts.includeLabels);\n key += tf(opts.includeMainLabels);\n key += tf(opts.includeSourceLabels);\n key += tf(opts.includeTargetLabels);\n key += tf(opts.includeOverlays);\n return key;\n};\n\nvar getBoundingBoxPosKey = function getBoundingBoxPosKey(ele) {\n if (ele.isEdge()) {\n var p1 = ele.source().position();\n var p2 = ele.target().position();\n\n var r = function r(x) {\n return Math.round(x);\n };\n\n return hashIntsArray([r(p1.x), r(p1.y), r(p2.x), r(p2.y)]);\n } else {\n return 0;\n }\n};\n\nvar cachedBoundingBoxImpl = function cachedBoundingBoxImpl(ele, opts) {\n var _p = ele._private;\n var bb;\n var isEdge = ele.isEdge();\n var key = opts == null ? defBbOptsKey : getKey(opts);\n var usingDefOpts = key === defBbOptsKey;\n var currPosKey = getBoundingBoxPosKey(ele);\n var isPosKeySame = _p.bbCachePosKey === currPosKey;\n var useCache = opts.useCache && isPosKeySame;\n\n var isDirty = function isDirty(ele) {\n return ele._private.bbCache == null;\n };\n\n var needRecalc = !useCache || isDirty(ele) || isEdge && isDirty(ele.source()) || isDirty(ele.target());\n\n if (needRecalc) {\n if (!isPosKeySame) {\n ele.recalculateRenderedStyle();\n }\n\n bb = boundingBoxImpl(ele, defBbOpts);\n _p.bbCache = bb;\n _p.bbCacheShift.x = _p.bbCacheShift.y = 0;\n _p.bbCachePosKey = currPosKey;\n } else {\n bb = _p.bbCache;\n }\n\n if (!needRecalc && (_p.bbCacheShift.x !== 0 || _p.bbCacheShift.y !== 0)) {\n var shift = assignShiftToBoundingBox;\n var delta = _p.bbCacheShift;\n\n var safeShift = function safeShift(bb, delta) {\n if (bb != null) {\n shift(bb, delta);\n }\n };\n\n shift(bb, delta);\n var bodyBounds = _p.bodyBounds,\n overlayBounds = _p.overlayBounds,\n labelBounds = _p.labelBounds,\n arrowBounds = _p.arrowBounds;\n safeShift(bodyBounds, delta);\n safeShift(overlayBounds, delta);\n\n if (arrowBounds != null) {\n safeShift(arrowBounds.source, delta);\n safeShift(arrowBounds.target, delta);\n safeShift(arrowBounds['mid-source'], delta);\n safeShift(arrowBounds['mid-target'], delta);\n }\n\n if (labelBounds != null) {\n safeShift(labelBounds.main, delta);\n safeShift(labelBounds.all, delta);\n safeShift(labelBounds.source, delta);\n safeShift(labelBounds.target, delta);\n }\n } // always reset the shift, because we either applied the shift or cleared it by doing a fresh recalc\n\n\n _p.bbCacheShift.x = _p.bbCacheShift.y = 0; // not using def opts => need to build up bb from combination of sub bbs\n\n if (!usingDefOpts) {\n var isNode = ele.isNode();\n bb = makeBoundingBox();\n\n if (opts.includeNodes && isNode || opts.includeEdges && !isNode) {\n if (opts.includeOverlays) {\n updateBoundsFromBox(bb, _p.overlayBounds);\n } else {\n updateBoundsFromBox(bb, _p.bodyBounds);\n }\n }\n\n if (opts.includeLabels) {\n if (opts.includeMainLabels && (!isEdge || opts.includeSourceLabels && opts.includeTargetLabels)) {\n updateBoundsFromBox(bb, _p.labelBounds.all);\n } else {\n if (opts.includeMainLabels) {\n updateBoundsFromBox(bb, _p.labelBounds.mainRot);\n }\n\n if (opts.includeSourceLabels) {\n updateBoundsFromBox(bb, _p.labelBounds.sourceRot);\n }\n\n if (opts.includeTargetLabels) {\n updateBoundsFromBox(bb, _p.labelBounds.targetRot);\n }\n }\n }\n\n bb.w = bb.x2 - bb.x1;\n bb.h = bb.y2 - bb.y1;\n }\n\n return bb;\n};\n\nvar defBbOpts = {\n includeNodes: true,\n includeEdges: true,\n includeLabels: true,\n includeMainLabels: true,\n includeSourceLabels: true,\n includeTargetLabels: true,\n includeOverlays: true,\n useCache: true\n};\nvar defBbOptsKey = getKey(defBbOpts);\nvar filledBbOpts = defaults(defBbOpts);\n\nelesfn$k.boundingBox = function (options) {\n var bounds; // the main usecase is ele.boundingBox() for a single element with no/def options\n // specified s.t. the cache is used, so check for this case to make it faster by\n // avoiding the overhead of the rest of the function\n\n if (this.length === 1 && this[0]._private.bbCache != null && (options === undefined || options.useCache === undefined || options.useCache === true)) {\n if (options === undefined) {\n options = defBbOpts;\n } else {\n options = filledBbOpts(options);\n }\n\n bounds = cachedBoundingBoxImpl(this[0], options);\n } else {\n bounds = makeBoundingBox();\n options = options || defBbOpts;\n var opts = filledBbOpts(options);\n var eles = this;\n var cy = eles.cy();\n var styleEnabled = cy.styleEnabled();\n\n if (styleEnabled) {\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var _p = ele._private;\n var currPosKey = getBoundingBoxPosKey(ele);\n var isPosKeySame = _p.bbCachePosKey === currPosKey;\n var useCache = opts.useCache && isPosKeySame;\n ele.recalculateRenderedStyle(useCache);\n }\n }\n\n this.updateCompoundBounds();\n\n for (var _i = 0; _i < eles.length; _i++) {\n var _ele = eles[_i];\n updateBoundsFromBox(bounds, cachedBoundingBoxImpl(_ele, opts));\n }\n }\n\n bounds.x1 = noninf(bounds.x1);\n bounds.y1 = noninf(bounds.y1);\n bounds.x2 = noninf(bounds.x2);\n bounds.y2 = noninf(bounds.y2);\n bounds.w = noninf(bounds.x2 - bounds.x1);\n bounds.h = noninf(bounds.y2 - bounds.y1);\n return bounds;\n};\n\nelesfn$k.dirtyBoundingBoxCache = function () {\n for (var i = 0; i < this.length; i++) {\n var _p = this[i]._private;\n _p.bbCache = null;\n _p.bbCacheShift.x = _p.bbCacheShift.y = 0;\n _p.bbCachePosKey = null;\n _p.bodyBounds = null;\n _p.overlayBounds = null;\n _p.labelBounds.all = null;\n _p.labelBounds.source = null;\n _p.labelBounds.target = null;\n _p.labelBounds.main = null;\n _p.labelBounds.sourceRot = null;\n _p.labelBounds.targetRot = null;\n _p.labelBounds.mainRot = null;\n _p.arrowBounds.source = null;\n _p.arrowBounds.target = null;\n _p.arrowBounds['mid-source'] = null;\n _p.arrowBounds['mid-target'] = null;\n }\n\n this.emitAndNotify('bounds');\n return this;\n};\n\nelesfn$k.shiftCachedBoundingBox = function (delta) {\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var _p = ele._private;\n var bb = _p.bbCache;\n\n if (bb != null) {\n _p.bbCacheShift.x += delta.x;\n _p.bbCacheShift.y += delta.y;\n }\n }\n\n this.emitAndNotify('bounds');\n return this;\n}; // private helper to get bounding box for custom node positions\n// - good for perf in certain cases but currently requires dirtying the rendered style\n// - would be better to not modify the nodes but the nodes are read directly everywhere in the renderer...\n// - try to use for only things like discrete layouts where the node position would change anyway\n\n\nelesfn$k.boundingBoxAt = function (fn) {\n var nodes = this.nodes();\n var cy = this.cy();\n var hasCompoundNodes = cy.hasCompoundNodes();\n\n if (hasCompoundNodes) {\n nodes = nodes.filter(function (node) {\n return !node.isParent();\n });\n }\n\n if (plainObject(fn)) {\n var obj = fn;\n\n fn = function fn() {\n return obj;\n };\n }\n\n var storeOldPos = function storeOldPos(node, i) {\n return node._private.bbAtOldPos = fn(node, i);\n };\n\n var getOldPos = function getOldPos(node) {\n return node._private.bbAtOldPos;\n };\n\n cy.startBatch();\n nodes.forEach(storeOldPos).silentPositions(fn);\n\n if (hasCompoundNodes) {\n this.updateCompoundBounds(true); // force update b/c we're inside a batch cycle\n }\n\n var bb = copyBoundingBox(this.boundingBox({\n useCache: false\n }));\n nodes.silentPositions(getOldPos);\n cy.endBatch();\n return bb;\n};\n\nfn$3.boundingbox = fn$3.bb = fn$3.boundingBox;\nfn$3.renderedBoundingbox = fn$3.renderedBoundingBox;\nvar bounds = elesfn$k;\n\nvar fn$4, elesfn$l;\nfn$4 = elesfn$l = {};\n\nvar defineDimFns = function defineDimFns(opts) {\n opts.uppercaseName = capitalize(opts.name);\n opts.autoName = 'auto' + opts.uppercaseName;\n opts.labelName = 'label' + opts.uppercaseName;\n opts.outerName = 'outer' + opts.uppercaseName;\n opts.uppercaseOuterName = capitalize(opts.outerName);\n\n fn$4[opts.name] = function dimImpl() {\n var ele = this[0];\n var _p = ele._private;\n var cy = _p.cy;\n var styleEnabled = cy._private.styleEnabled;\n\n if (ele) {\n if (styleEnabled) {\n if (ele.isParent()) {\n ele.updateCompoundBounds();\n return _p[opts.autoName] || 0;\n }\n\n var d = ele.pstyle(opts.name);\n\n switch (d.strValue) {\n case 'label':\n ele.recalculateRenderedStyle();\n return _p.rstyle[opts.labelName] || 0;\n\n default:\n return d.pfValue;\n }\n } else {\n return 1;\n }\n }\n };\n\n fn$4['outer' + opts.uppercaseName] = function outerDimImpl() {\n var ele = this[0];\n var _p = ele._private;\n var cy = _p.cy;\n var styleEnabled = cy._private.styleEnabled;\n\n if (ele) {\n if (styleEnabled) {\n var dim = ele[opts.name]();\n var border = ele.pstyle('border-width').pfValue; // n.b. 1/2 each side\n\n var padding = 2 * ele.padding();\n return dim + border + padding;\n } else {\n return 1;\n }\n }\n };\n\n fn$4['rendered' + opts.uppercaseName] = function renderedDimImpl() {\n var ele = this[0];\n\n if (ele) {\n var d = ele[opts.name]();\n return d * this.cy().zoom();\n }\n };\n\n fn$4['rendered' + opts.uppercaseOuterName] = function renderedOuterDimImpl() {\n var ele = this[0];\n\n if (ele) {\n var od = ele[opts.outerName]();\n return od * this.cy().zoom();\n }\n };\n};\n\ndefineDimFns({\n name: 'width'\n});\ndefineDimFns({\n name: 'height'\n});\n\nelesfn$l.padding = function () {\n var ele = this[0];\n var _p = ele._private;\n\n if (ele.isParent()) {\n ele.updateCompoundBounds();\n\n if (_p.autoPadding !== undefined) {\n return _p.autoPadding;\n } else {\n return ele.pstyle('padding').pfValue;\n }\n } else {\n return ele.pstyle('padding').pfValue;\n }\n};\n\nelesfn$l.paddedHeight = function () {\n var ele = this[0];\n return ele.height() + 2 * ele.padding();\n};\n\nelesfn$l.paddedWidth = function () {\n var ele = this[0];\n return ele.width() + 2 * ele.padding();\n};\n\nvar widthHeight = elesfn$l;\n\nvar ifEdge = function ifEdge(ele, getValue) {\n if (ele.isEdge()) {\n return getValue(ele);\n }\n};\n\nvar ifEdgeRenderedPosition = function ifEdgeRenderedPosition(ele, getPoint) {\n if (ele.isEdge()) {\n var cy = ele.cy();\n return modelToRenderedPosition(getPoint(ele), cy.zoom(), cy.pan());\n }\n};\n\nvar ifEdgeRenderedPositions = function ifEdgeRenderedPositions(ele, getPoints) {\n if (ele.isEdge()) {\n var cy = ele.cy();\n var pan = cy.pan();\n var zoom = cy.zoom();\n return getPoints(ele).map(function (p) {\n return modelToRenderedPosition(p, zoom, pan);\n });\n }\n};\n\nvar controlPoints = function controlPoints(ele) {\n return ele.renderer().getControlPoints(ele);\n};\n\nvar segmentPoints = function segmentPoints(ele) {\n return ele.renderer().getSegmentPoints(ele);\n};\n\nvar sourceEndpoint = function sourceEndpoint(ele) {\n return ele.renderer().getSourceEndpoint(ele);\n};\n\nvar targetEndpoint = function targetEndpoint(ele) {\n return ele.renderer().getTargetEndpoint(ele);\n};\n\nvar midpoint = function midpoint(ele) {\n return ele.renderer().getEdgeMidpoint(ele);\n};\n\nvar pts = {\n controlPoints: {\n get: controlPoints,\n mult: true\n },\n segmentPoints: {\n get: segmentPoints,\n mult: true\n },\n sourceEndpoint: {\n get: sourceEndpoint\n },\n targetEndpoint: {\n get: targetEndpoint\n },\n midpoint: {\n get: midpoint\n }\n};\n\nvar renderedName = function renderedName(name) {\n return 'rendered' + name[0].toUpperCase() + name.substr(1);\n};\n\nvar edgePoints = Object.keys(pts).reduce(function (obj, name) {\n var spec = pts[name];\n var rName = renderedName(name);\n\n obj[name] = function () {\n return ifEdge(this, spec.get);\n };\n\n if (spec.mult) {\n obj[rName] = function () {\n return ifEdgeRenderedPositions(this, spec.get);\n };\n } else {\n obj[rName] = function () {\n return ifEdgeRenderedPosition(this, spec.get);\n };\n }\n\n return obj;\n}, {});\n\nvar dimensions = extend({}, position, bounds, widthHeight, edgePoints);\n\n/*!\nEvent object based on jQuery events, MIT license\n\nhttps://jquery.org/license/\nhttps://tldrlegal.com/license/mit-license\nhttps://github.com/jquery/jquery/blob/master/src/event.js\n*/\nvar Event = function Event(src, props) {\n this.recycle(src, props);\n};\n\nfunction returnFalse() {\n return false;\n}\n\nfunction returnTrue() {\n return true;\n} // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\n\n\nEvent.prototype = {\n instanceString: function instanceString() {\n return 'event';\n },\n recycle: function recycle(src, props) {\n this.isImmediatePropagationStopped = this.isPropagationStopped = this.isDefaultPrevented = returnFalse;\n\n if (src != null && src.preventDefault) {\n // Browser Event object\n this.type = src.type; // Events bubbling up the document may have been marked as prevented\n // by a handler lower down the tree; reflect the correct value.\n\n this.isDefaultPrevented = src.defaultPrevented ? returnTrue : returnFalse;\n } else if (src != null && src.type) {\n // Plain object containing all event details\n props = src;\n } else {\n // Event string\n this.type = src;\n } // Put explicitly provided properties onto the event object\n\n\n if (props != null) {\n // more efficient to manually copy fields we use\n this.originalEvent = props.originalEvent;\n this.type = props.type != null ? props.type : this.type;\n this.cy = props.cy;\n this.target = props.target;\n this.position = props.position;\n this.renderedPosition = props.renderedPosition;\n this.namespace = props.namespace;\n this.layout = props.layout;\n }\n\n if (this.cy != null && this.position != null && this.renderedPosition == null) {\n // create a rendered position based on the passed position\n var pos = this.position;\n var zoom = this.cy.zoom();\n var pan = this.cy.pan();\n this.renderedPosition = {\n x: pos.x * zoom + pan.x,\n y: pos.y * zoom + pan.y\n };\n } // Create a timestamp if incoming event doesn't have one\n\n\n this.timeStamp = src && src.timeStamp || Date.now();\n },\n preventDefault: function preventDefault() {\n this.isDefaultPrevented = returnTrue;\n var e = this.originalEvent;\n\n if (!e) {\n return;\n } // if preventDefault exists run it on the original event\n\n\n if (e.preventDefault) {\n e.preventDefault();\n }\n },\n stopPropagation: function stopPropagation() {\n this.isPropagationStopped = returnTrue;\n var e = this.originalEvent;\n\n if (!e) {\n return;\n } // if stopPropagation exists run it on the original event\n\n\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n },\n stopImmediatePropagation: function stopImmediatePropagation() {\n this.isImmediatePropagationStopped = returnTrue;\n this.stopPropagation();\n },\n isDefaultPrevented: returnFalse,\n isPropagationStopped: returnFalse,\n isImmediatePropagationStopped: returnFalse\n};\n\nvar eventRegex = /^([^.]+)(\\.(?:[^.]+))?$/; // regex for matching event strings (e.g. \"click.namespace\")\n\nvar universalNamespace = '.*'; // matches as if no namespace specified and prevents users from unbinding accidentally\n\nvar defaults$8 = {\n qualifierCompare: function qualifierCompare(q1, q2) {\n return q1 === q2;\n },\n eventMatches: function eventMatches()\n /*context, listener, eventObj*/\n {\n return true;\n },\n addEventFields: function addEventFields()\n /*context, evt*/\n {},\n callbackContext: function callbackContext(context\n /*, listener, eventObj*/\n ) {\n return context;\n },\n beforeEmit: function beforeEmit()\n /* context, listener, eventObj */\n {},\n afterEmit: function afterEmit()\n /* context, listener, eventObj */\n {},\n bubble: function bubble()\n /*context*/\n {\n return false;\n },\n parent: function parent()\n /*context*/\n {\n return null;\n },\n context: null\n};\nvar defaultsKeys = Object.keys(defaults$8);\nvar emptyOpts = {};\n\nfunction Emitter() {\n var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : emptyOpts;\n var context = arguments.length > 1 ? arguments[1] : undefined;\n\n // micro-optimisation vs Object.assign() -- reduces Element instantiation time\n for (var i = 0; i < defaultsKeys.length; i++) {\n var key = defaultsKeys[i];\n this[key] = opts[key] || defaults$8[key];\n }\n\n this.context = context || this.context;\n this.listeners = [];\n this.emitting = 0;\n}\n\nvar p = Emitter.prototype;\n\nvar forEachEvent = function forEachEvent(self, handler, events, qualifier, callback, conf, confOverrides) {\n if (fn(qualifier)) {\n callback = qualifier;\n qualifier = null;\n }\n\n if (confOverrides) {\n if (conf == null) {\n conf = confOverrides;\n } else {\n conf = extend({}, conf, confOverrides);\n }\n }\n\n var eventList = array(events) ? events : events.split(/\\s+/);\n\n for (var i = 0; i < eventList.length; i++) {\n var evt = eventList[i];\n\n if (emptyString(evt)) {\n continue;\n }\n\n var match = evt.match(eventRegex); // type[.namespace]\n\n if (match) {\n var type = match[1];\n var namespace = match[2] ? match[2] : null;\n var ret = handler(self, evt, type, namespace, qualifier, callback, conf);\n\n if (ret === false) {\n break;\n } // allow exiting early\n\n }\n }\n};\n\nvar makeEventObj = function makeEventObj(self, obj) {\n self.addEventFields(self.context, obj);\n return new Event(obj.type, obj);\n};\n\nvar forEachEventObj = function forEachEventObj(self, handler, events) {\n if (event(events)) {\n handler(self, events);\n return;\n } else if (plainObject(events)) {\n handler(self, makeEventObj(self, events));\n return;\n }\n\n var eventList = array(events) ? events : events.split(/\\s+/);\n\n for (var i = 0; i < eventList.length; i++) {\n var evt = eventList[i];\n\n if (emptyString(evt)) {\n continue;\n }\n\n var match = evt.match(eventRegex); // type[.namespace]\n\n if (match) {\n var type = match[1];\n var namespace = match[2] ? match[2] : null;\n var eventObj = makeEventObj(self, {\n type: type,\n namespace: namespace,\n target: self.context\n });\n handler(self, eventObj);\n }\n }\n};\n\np.on = p.addListener = function (events, qualifier, callback, conf, confOverrides) {\n forEachEvent(this, function (self, event, type, namespace, qualifier, callback, conf) {\n if (fn(callback)) {\n self.listeners.push({\n event: event,\n // full event string\n callback: callback,\n // callback to run\n type: type,\n // the event type (e.g. 'click')\n namespace: namespace,\n // the event namespace (e.g. \".foo\")\n qualifier: qualifier,\n // a restriction on whether to match this emitter\n conf: conf // additional configuration\n\n });\n }\n }, events, qualifier, callback, conf, confOverrides);\n return this;\n};\n\np.one = function (events, qualifier, callback, conf) {\n return this.on(events, qualifier, callback, conf, {\n one: true\n });\n};\n\np.removeListener = p.off = function (events, qualifier, callback, conf) {\n var _this = this;\n\n if (this.emitting !== 0) {\n this.listeners = copyArray(this.listeners);\n }\n\n var listeners = this.listeners;\n\n var _loop = function _loop(i) {\n var listener = listeners[i];\n forEachEvent(_this, function (self, event, type, namespace, qualifier, callback\n /*, conf*/\n ) {\n if ((listener.type === type || events === '*') && (!namespace && listener.namespace !== '.*' || listener.namespace === namespace) && (!qualifier || self.qualifierCompare(listener.qualifier, qualifier)) && (!callback || listener.callback === callback)) {\n listeners.splice(i, 1);\n return false;\n }\n }, events, qualifier, callback, conf);\n };\n\n for (var i = listeners.length - 1; i >= 0; i--) {\n _loop(i);\n }\n\n return this;\n};\n\np.removeAllListeners = function () {\n return this.removeListener('*');\n};\n\np.emit = p.trigger = function (events, extraParams, manualCallback) {\n var listeners = this.listeners;\n var numListenersBeforeEmit = listeners.length;\n this.emitting++;\n\n if (!array(extraParams)) {\n extraParams = [extraParams];\n }\n\n forEachEventObj(this, function (self, eventObj) {\n if (manualCallback != null) {\n listeners = [{\n event: eventObj.event,\n type: eventObj.type,\n namespace: eventObj.namespace,\n callback: manualCallback\n }];\n numListenersBeforeEmit = listeners.length;\n }\n\n var _loop2 = function _loop2(i) {\n var listener = listeners[i];\n\n if (listener.type === eventObj.type && (!listener.namespace || listener.namespace === eventObj.namespace || listener.namespace === universalNamespace) && self.eventMatches(self.context, listener, eventObj)) {\n var args = [eventObj];\n\n if (extraParams != null) {\n push(args, extraParams);\n }\n\n self.beforeEmit(self.context, listener, eventObj);\n\n if (listener.conf && listener.conf.one) {\n self.listeners = self.listeners.filter(function (l) {\n return l !== listener;\n });\n }\n\n var context = self.callbackContext(self.context, listener, eventObj);\n var ret = listener.callback.apply(context, args);\n self.afterEmit(self.context, listener, eventObj);\n\n if (ret === false) {\n eventObj.stopPropagation();\n eventObj.preventDefault();\n }\n } // if listener matches\n\n };\n\n for (var i = 0; i < numListenersBeforeEmit; i++) {\n _loop2(i);\n } // for listener\n\n\n if (self.bubble(self.context) && !eventObj.isPropagationStopped()) {\n self.parent(self.context).emit(eventObj, extraParams);\n }\n }, events);\n this.emitting--;\n return this;\n};\n\nvar emitterOptions = {\n qualifierCompare: function qualifierCompare(selector1, selector2) {\n if (selector1 == null || selector2 == null) {\n return selector1 == null && selector2 == null;\n } else {\n return selector1.sameText(selector2);\n }\n },\n eventMatches: function eventMatches(ele, listener, eventObj) {\n var selector = listener.qualifier;\n\n if (selector != null) {\n return ele !== eventObj.target && element(eventObj.target) && selector.matches(eventObj.target);\n }\n\n return true;\n },\n addEventFields: function addEventFields(ele, evt) {\n evt.cy = ele.cy();\n evt.target = ele;\n },\n callbackContext: function callbackContext(ele, listener, eventObj) {\n return listener.qualifier != null ? eventObj.target : ele;\n },\n beforeEmit: function beforeEmit(context, listener\n /*, eventObj*/\n ) {\n if (listener.conf && listener.conf.once) {\n listener.conf.onceCollection.removeListener(listener.event, listener.qualifier, listener.callback);\n }\n },\n bubble: function bubble() {\n return true;\n },\n parent: function parent(ele) {\n return ele.isChild() ? ele.parent() : ele.cy();\n }\n};\n\nvar argSelector = function argSelector(arg) {\n if (string(arg)) {\n return new Selector(arg);\n } else {\n return arg;\n }\n};\n\nvar elesfn$m = {\n createEmitter: function createEmitter() {\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var _p = ele._private;\n\n if (!_p.emitter) {\n _p.emitter = new Emitter(emitterOptions, ele);\n }\n }\n\n return this;\n },\n emitter: function emitter() {\n return this._private.emitter;\n },\n on: function on(events, selector, callback) {\n var argSel = argSelector(selector);\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n ele.emitter().on(events, argSel, callback);\n }\n\n return this;\n },\n removeListener: function removeListener(events, selector, callback) {\n var argSel = argSelector(selector);\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n ele.emitter().removeListener(events, argSel, callback);\n }\n\n return this;\n },\n removeAllListeners: function removeAllListeners() {\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n ele.emitter().removeAllListeners();\n }\n\n return this;\n },\n one: function one(events, selector, callback) {\n var argSel = argSelector(selector);\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n ele.emitter().one(events, argSel, callback);\n }\n\n return this;\n },\n once: function once(events, selector, callback) {\n var argSel = argSelector(selector);\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n ele.emitter().on(events, argSel, callback, {\n once: true,\n onceCollection: this\n });\n }\n },\n emit: function emit(events, extraParams) {\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n ele.emitter().emit(events, extraParams);\n }\n\n return this;\n },\n emitAndNotify: function emitAndNotify(event, extraParams) {\n // for internal use only\n if (this.length === 0) {\n return;\n } // empty collections don't need to notify anything\n // notify renderer\n\n\n this.cy().notify(event, this);\n this.emit(event, extraParams);\n return this;\n }\n};\ndefine$3.eventAliasesOn(elesfn$m);\n\nvar elesfn$n = {\n nodes: function nodes(selector) {\n return this.filter(function (ele) {\n return ele.isNode();\n }).filter(selector);\n },\n edges: function edges(selector) {\n return this.filter(function (ele) {\n return ele.isEdge();\n }).filter(selector);\n },\n // internal helper to get nodes and edges as separate collections with single iteration over elements\n byGroup: function byGroup() {\n var nodes = this.spawn();\n var edges = this.spawn();\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n\n if (ele.isNode()) {\n nodes.merge(ele);\n } else {\n edges.merge(ele);\n }\n }\n\n return {\n nodes: nodes,\n edges: edges\n };\n },\n filter: function filter(_filter, thisArg) {\n if (_filter === undefined) {\n // check this first b/c it's the most common/performant case\n return this;\n } else if (string(_filter) || elementOrCollection(_filter)) {\n return new Selector(_filter).filter(this);\n } else if (fn(_filter)) {\n var filterEles = this.spawn();\n var eles = this;\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var include = thisArg ? _filter.apply(thisArg, [ele, i, eles]) : _filter(ele, i, eles);\n\n if (include) {\n filterEles.merge(ele);\n }\n }\n\n return filterEles;\n }\n\n return this.spawn(); // if not handled by above, give 'em an empty collection\n },\n not: function not(toRemove) {\n if (!toRemove) {\n return this;\n } else {\n if (string(toRemove)) {\n toRemove = this.filter(toRemove);\n }\n\n var elements = [];\n var rMap = toRemove._private.map;\n\n for (var i = 0; i < this.length; i++) {\n var element = this[i];\n var remove = rMap.has(element.id());\n\n if (!remove) {\n elements.push(element);\n }\n }\n\n return this.spawn(elements);\n }\n },\n absoluteComplement: function absoluteComplement() {\n var cy = this.cy();\n return cy.mutableElements().not(this);\n },\n intersect: function intersect(other) {\n // if a selector is specified, then filter by it instead\n if (string(other)) {\n var selector = other;\n return this.filter(selector);\n }\n\n var elements = [];\n var col1 = this;\n var col2 = other;\n var col1Smaller = this.length < other.length;\n var map2 = col1Smaller ? col2._private.map : col1._private.map;\n var col = col1Smaller ? col1 : col2;\n\n for (var i = 0; i < col.length; i++) {\n var id = col[i]._private.data.id;\n var entry = map2.get(id);\n\n if (entry) {\n elements.push(entry.ele);\n }\n }\n\n return this.spawn(elements);\n },\n xor: function xor(other) {\n var cy = this._private.cy;\n\n if (string(other)) {\n other = cy.$(other);\n }\n\n var elements = [];\n var col1 = this;\n var col2 = other;\n\n var add = function add(col, other) {\n for (var i = 0; i < col.length; i++) {\n var ele = col[i];\n var id = ele._private.data.id;\n var inOther = other.hasElementWithId(id);\n\n if (!inOther) {\n elements.push(ele);\n }\n }\n };\n\n add(col1, col2);\n add(col2, col1);\n return this.spawn(elements);\n },\n diff: function diff(other) {\n var cy = this._private.cy;\n\n if (string(other)) {\n other = cy.$(other);\n }\n\n var left = [];\n var right = [];\n var both = [];\n var col1 = this;\n var col2 = other;\n\n var add = function add(col, other, retEles) {\n for (var i = 0; i < col.length; i++) {\n var ele = col[i];\n var id = ele._private.data.id;\n var inOther = other.hasElementWithId(id);\n\n if (inOther) {\n both.push(ele);\n } else {\n retEles.push(ele);\n }\n }\n };\n\n add(col1, col2, left);\n add(col2, col1, right);\n return {\n left: this.spawn(left, {\n unique: true\n }),\n right: this.spawn(right, {\n unique: true\n }),\n both: this.spawn(both, {\n unique: true\n })\n };\n },\n add: function add(toAdd) {\n var cy = this._private.cy;\n\n if (!toAdd) {\n return this;\n }\n\n if (string(toAdd)) {\n var selector = toAdd;\n toAdd = cy.mutableElements().filter(selector);\n }\n\n var elements = [];\n\n for (var i = 0; i < this.length; i++) {\n elements.push(this[i]);\n }\n\n var map = this._private.map;\n\n for (var _i = 0; _i < toAdd.length; _i++) {\n var add = !map.has(toAdd[_i].id());\n\n if (add) {\n elements.push(toAdd[_i]);\n }\n }\n\n return this.spawn(elements);\n },\n // in place merge on calling collection\n merge: function merge(toAdd) {\n var _p = this._private;\n var cy = _p.cy;\n\n if (!toAdd) {\n return this;\n }\n\n if (toAdd && string(toAdd)) {\n var selector = toAdd;\n toAdd = cy.mutableElements().filter(selector);\n }\n\n var map = _p.map;\n\n for (var i = 0; i < toAdd.length; i++) {\n var toAddEle = toAdd[i];\n var id = toAddEle._private.data.id;\n var add = !map.has(id);\n\n if (add) {\n var index = this.length++;\n this[index] = toAddEle;\n map.set(id, {\n ele: toAddEle,\n index: index\n });\n } else {\n // replace\n var _index = map.get(id).index;\n this[_index] = toAddEle;\n map.set(id, {\n ele: toAddEle,\n index: _index\n });\n }\n }\n\n return this; // chaining\n },\n unmergeAt: function unmergeAt(i) {\n var ele = this[i];\n var id = ele.id();\n var _p = this._private;\n var map = _p.map; // remove ele\n\n this[i] = undefined;\n map[\"delete\"](id);\n var unmergedLastEle = i === this.length - 1; // replace empty spot with last ele in collection\n\n if (this.length > 1 && !unmergedLastEle) {\n var lastEleI = this.length - 1;\n var lastEle = this[lastEleI];\n var lastEleId = lastEle._private.data.id;\n this[lastEleI] = undefined;\n this[i] = lastEle;\n map.set(lastEleId, {\n ele: lastEle,\n index: i\n });\n } // the collection is now 1 ele smaller\n\n\n this.length--;\n return this;\n },\n // remove single ele in place in calling collection\n unmergeOne: function unmergeOne(ele) {\n ele = ele[0];\n var _p = this._private;\n var id = ele._private.data.id;\n var map = _p.map;\n var entry = map.get(id);\n\n if (!entry) {\n return this; // no need to remove\n }\n\n var i = entry.index;\n this.unmergeAt(i);\n return this;\n },\n // remove eles in place on calling collection\n unmerge: function unmerge(toRemove) {\n var cy = this._private.cy;\n\n if (!toRemove) {\n return this;\n }\n\n if (toRemove && string(toRemove)) {\n var selector = toRemove;\n toRemove = cy.mutableElements().filter(selector);\n }\n\n for (var i = 0; i < toRemove.length; i++) {\n this.unmergeOne(toRemove[i]);\n }\n\n return this; // chaining\n },\n unmergeBy: function unmergeBy(toRmFn) {\n for (var i = this.length - 1; i >= 0; i--) {\n var ele = this[i];\n\n if (toRmFn(ele)) {\n this.unmergeAt(i);\n }\n }\n\n return this;\n },\n map: function map(mapFn, thisArg) {\n var arr = [];\n var eles = this;\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var ret = thisArg ? mapFn.apply(thisArg, [ele, i, eles]) : mapFn(ele, i, eles);\n arr.push(ret);\n }\n\n return arr;\n },\n reduce: function reduce(fn, initialValue) {\n var val = initialValue;\n var eles = this;\n\n for (var i = 0; i < eles.length; i++) {\n val = fn(val, eles[i], i, eles);\n }\n\n return val;\n },\n max: function max(valFn, thisArg) {\n var max = -Infinity;\n var maxEle;\n var eles = this;\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles);\n\n if (val > max) {\n max = val;\n maxEle = ele;\n }\n }\n\n return {\n value: max,\n ele: maxEle\n };\n },\n min: function min(valFn, thisArg) {\n var min = Infinity;\n var minEle;\n var eles = this;\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var val = thisArg ? valFn.apply(thisArg, [ele, i, eles]) : valFn(ele, i, eles);\n\n if (val < min) {\n min = val;\n minEle = ele;\n }\n }\n\n return {\n value: min,\n ele: minEle\n };\n }\n}; // aliases\n\nvar fn$5 = elesfn$n;\nfn$5['u'] = fn$5['|'] = fn$5['+'] = fn$5.union = fn$5.or = fn$5.add;\nfn$5['\\\\'] = fn$5['!'] = fn$5['-'] = fn$5.difference = fn$5.relativeComplement = fn$5.subtract = fn$5.not;\nfn$5['n'] = fn$5['&'] = fn$5['.'] = fn$5.and = fn$5.intersection = fn$5.intersect;\nfn$5['^'] = fn$5['(+)'] = fn$5['(-)'] = fn$5.symmetricDifference = fn$5.symdiff = fn$5.xor;\nfn$5.fnFilter = fn$5.filterFn = fn$5.stdFilter = fn$5.filter;\nfn$5.complement = fn$5.abscomp = fn$5.absoluteComplement;\n\nvar elesfn$o = {\n isNode: function isNode() {\n return this.group() === 'nodes';\n },\n isEdge: function isEdge() {\n return this.group() === 'edges';\n },\n isLoop: function isLoop() {\n return this.isEdge() && this.source()[0] === this.target()[0];\n },\n isSimple: function isSimple() {\n return this.isEdge() && this.source()[0] !== this.target()[0];\n },\n group: function group() {\n var ele = this[0];\n\n if (ele) {\n return ele._private.group;\n }\n }\n};\n\n/**\n * Elements are drawn in a specific order based on compound depth (low to high), the element type (nodes above edges),\n * and z-index (low to high). These styles affect how this applies:\n *\n * z-compound-depth: May be `bottom | orphan | auto | top`. The first drawn is `bottom`, then `orphan` which is the\n * same depth as the root of the compound graph, followed by the default value `auto` which draws in order from\n * root to leaves of the compound graph. The last drawn is `top`.\n * z-index-compare: May be `auto | manual`. The default value is `auto` which always draws edges under nodes.\n * `manual` ignores this convention and draws based on the `z-index` value setting.\n * z-index: An integer value that affects the relative draw order of elements. In general, an element with a higher\n * `z-index` will be drawn on top of an element with a lower `z-index`.\n */\n\nvar zIndexSort = function zIndexSort(a, b) {\n var cy = a.cy();\n var hasCompoundNodes = cy.hasCompoundNodes();\n\n function getDepth(ele) {\n var style = ele.pstyle('z-compound-depth');\n\n if (style.value === 'auto') {\n return hasCompoundNodes ? ele.zDepth() : 0;\n } else if (style.value === 'bottom') {\n return -1;\n } else if (style.value === 'top') {\n return MAX_INT;\n } // 'orphan'\n\n\n return 0;\n }\n\n var depthDiff = getDepth(a) - getDepth(b);\n\n if (depthDiff !== 0) {\n return depthDiff;\n }\n\n function getEleDepth(ele) {\n var style = ele.pstyle('z-index-compare');\n\n if (style.value === 'auto') {\n return ele.isNode() ? 1 : 0;\n } // 'manual'\n\n\n return 0;\n }\n\n var eleDiff = getEleDepth(a) - getEleDepth(b);\n\n if (eleDiff !== 0) {\n return eleDiff;\n }\n\n var zDiff = a.pstyle('z-index').value - b.pstyle('z-index').value;\n\n if (zDiff !== 0) {\n return zDiff;\n } // compare indices in the core (order added to graph w/ last on top)\n\n\n return a.poolIndex() - b.poolIndex();\n};\n\nvar elesfn$p = {\n forEach: function forEach(fn$1, thisArg) {\n if (fn(fn$1)) {\n var N = this.length;\n\n for (var i = 0; i < N; i++) {\n var ele = this[i];\n var ret = thisArg ? fn$1.apply(thisArg, [ele, i, this]) : fn$1(ele, i, this);\n\n if (ret === false) {\n break;\n } // exit each early on return false\n\n }\n }\n\n return this;\n },\n toArray: function toArray() {\n var array = [];\n\n for (var i = 0; i < this.length; i++) {\n array.push(this[i]);\n }\n\n return array;\n },\n slice: function slice(start, end) {\n var array = [];\n var thisSize = this.length;\n\n if (end == null) {\n end = thisSize;\n }\n\n if (start == null) {\n start = 0;\n }\n\n if (start < 0) {\n start = thisSize + start;\n }\n\n if (end < 0) {\n end = thisSize + end;\n }\n\n for (var i = start; i >= 0 && i < end && i < thisSize; i++) {\n array.push(this[i]);\n }\n\n return this.spawn(array);\n },\n size: function size() {\n return this.length;\n },\n eq: function eq(i) {\n return this[i] || this.spawn();\n },\n first: function first() {\n return this[0] || this.spawn();\n },\n last: function last() {\n return this[this.length - 1] || this.spawn();\n },\n empty: function empty() {\n return this.length === 0;\n },\n nonempty: function nonempty() {\n return !this.empty();\n },\n sort: function sort(sortFn) {\n if (!fn(sortFn)) {\n return this;\n }\n\n var sorted = this.toArray().sort(sortFn);\n return this.spawn(sorted);\n },\n sortByZIndex: function sortByZIndex() {\n return this.sort(zIndexSort);\n },\n zDepth: function zDepth() {\n var ele = this[0];\n\n if (!ele) {\n return undefined;\n } // let cy = ele.cy();\n\n\n var _p = ele._private;\n var group = _p.group;\n\n if (group === 'nodes') {\n var depth = _p.data.parent ? ele.parents().size() : 0;\n\n if (!ele.isParent()) {\n return MAX_INT - 1; // childless nodes always on top\n }\n\n return depth;\n } else {\n var src = _p.source;\n var tgt = _p.target;\n var srcDepth = src.zDepth();\n var tgtDepth = tgt.zDepth();\n return Math.max(srcDepth, tgtDepth, 0); // depth of deepest parent\n }\n }\n};\nelesfn$p.each = elesfn$p.forEach;\n\nvar defineSymbolIterator = function defineSymbolIterator() {\n var typeofUndef = \"undefined\" ;\n var isIteratorSupported = (typeof Symbol === \"undefined\" ? \"undefined\" : _typeof(Symbol)) != typeofUndef && _typeof(Symbol.iterator) != typeofUndef; // eslint-disable-line no-undef\n\n if (isIteratorSupported) {\n elesfn$p[Symbol.iterator] = function () {\n var _this = this;\n\n // eslint-disable-line no-undef\n var entry = {\n value: undefined,\n done: false\n };\n var i = 0;\n var length = this.length;\n return _defineProperty({\n next: function next() {\n if (i < length) {\n entry.value = _this[i++];\n } else {\n entry.value = undefined;\n entry.done = true;\n }\n\n return entry;\n }\n }, Symbol.iterator, function () {\n // eslint-disable-line no-undef\n return this;\n });\n };\n }\n};\n\ndefineSymbolIterator();\n\nvar getLayoutDimensionOptions = defaults({\n nodeDimensionsIncludeLabels: false\n});\nvar elesfn$q = {\n // Calculates and returns node dimensions { x, y } based on options given\n layoutDimensions: function layoutDimensions(options) {\n options = getLayoutDimensionOptions(options);\n var dims;\n\n if (!this.takesUpSpace()) {\n dims = {\n w: 0,\n h: 0\n };\n } else if (options.nodeDimensionsIncludeLabels) {\n var bbDim = this.boundingBox();\n dims = {\n w: bbDim.w,\n h: bbDim.h\n };\n } else {\n dims = {\n w: this.outerWidth(),\n h: this.outerHeight()\n };\n } // sanitise the dimensions for external layouts (avoid division by zero)\n\n\n if (dims.w === 0 || dims.h === 0) {\n dims.w = dims.h = 1;\n }\n\n return dims;\n },\n // using standard layout options, apply position function (w/ or w/o animation)\n layoutPositions: function layoutPositions(layout, options, fn) {\n var nodes = this.nodes();\n var cy = this.cy();\n var layoutEles = options.eles; // nodes & edges\n\n var getMemoizeKey = function getMemoizeKey(node) {\n return node.id();\n };\n\n var fnMem = memoize(fn, getMemoizeKey); // memoized version of position function\n\n layout.emit({\n type: 'layoutstart',\n layout: layout\n });\n layout.animations = [];\n\n var calculateSpacing = function calculateSpacing(spacing, nodesBb, pos) {\n var center = {\n x: nodesBb.x1 + nodesBb.w / 2,\n y: nodesBb.y1 + nodesBb.h / 2\n };\n var spacingVector = {\n // scale from center of bounding box (not necessarily 0,0)\n x: (pos.x - center.x) * spacing,\n y: (pos.y - center.y) * spacing\n };\n return {\n x: center.x + spacingVector.x,\n y: center.y + spacingVector.y\n };\n };\n\n var useSpacingFactor = options.spacingFactor && options.spacingFactor !== 1;\n\n var spacingBb = function spacingBb() {\n if (!useSpacingFactor) {\n return null;\n }\n\n var bb = makeBoundingBox();\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var pos = fnMem(node, i);\n expandBoundingBoxByPoint(bb, pos.x, pos.y);\n }\n\n return bb;\n };\n\n var bb = spacingBb();\n var getFinalPos = memoize(function (node, i) {\n var newPos = fnMem(node, i);\n\n if (useSpacingFactor) {\n var spacing = Math.abs(options.spacingFactor);\n newPos = calculateSpacing(spacing, bb, newPos);\n }\n\n if (options.transform != null) {\n newPos = options.transform(node, newPos);\n }\n\n return newPos;\n }, getMemoizeKey);\n\n if (options.animate) {\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var newPos = getFinalPos(node, i);\n var animateNode = options.animateFilter == null || options.animateFilter(node, i);\n\n if (animateNode) {\n var ani = node.animation({\n position: newPos,\n duration: options.animationDuration,\n easing: options.animationEasing\n });\n layout.animations.push(ani);\n } else {\n node.position(newPos);\n }\n }\n\n if (options.fit) {\n var fitAni = cy.animation({\n fit: {\n boundingBox: layoutEles.boundingBoxAt(getFinalPos),\n padding: options.padding\n },\n duration: options.animationDuration,\n easing: options.animationEasing\n });\n layout.animations.push(fitAni);\n } else if (options.zoom !== undefined && options.pan !== undefined) {\n var zoomPanAni = cy.animation({\n zoom: options.zoom,\n pan: options.pan,\n duration: options.animationDuration,\n easing: options.animationEasing\n });\n layout.animations.push(zoomPanAni);\n }\n\n layout.animations.forEach(function (ani) {\n return ani.play();\n });\n layout.one('layoutready', options.ready);\n layout.emit({\n type: 'layoutready',\n layout: layout\n });\n Promise$1.all(layout.animations.map(function (ani) {\n return ani.promise();\n })).then(function () {\n layout.one('layoutstop', options.stop);\n layout.emit({\n type: 'layoutstop',\n layout: layout\n });\n });\n } else {\n nodes.positions(getFinalPos);\n\n if (options.fit) {\n cy.fit(options.eles, options.padding);\n }\n\n if (options.zoom != null) {\n cy.zoom(options.zoom);\n }\n\n if (options.pan) {\n cy.pan(options.pan);\n }\n\n layout.one('layoutready', options.ready);\n layout.emit({\n type: 'layoutready',\n layout: layout\n });\n layout.one('layoutstop', options.stop);\n layout.emit({\n type: 'layoutstop',\n layout: layout\n });\n }\n\n return this; // chaining\n },\n layout: function layout(options) {\n var cy = this.cy();\n return cy.makeLayout(extend({}, options, {\n eles: this\n }));\n }\n}; // aliases:\n\nelesfn$q.createLayout = elesfn$q.makeLayout = elesfn$q.layout;\n\nfunction styleCache(key, fn, ele) {\n var _p = ele._private;\n var cache = _p.styleCache = _p.styleCache || [];\n var val;\n\n if ((val = cache[key]) != null) {\n return val;\n } else {\n val = cache[key] = fn(ele);\n return val;\n }\n}\n\nfunction cacheStyleFunction(key, fn) {\n key = hashString(key);\n return function cachedStyleFunction(ele) {\n return styleCache(key, fn, ele);\n };\n}\n\nfunction cachePrototypeStyleFunction(key, fn) {\n key = hashString(key);\n\n var selfFn = function selfFn(ele) {\n return fn.call(ele);\n };\n\n return function cachedPrototypeStyleFunction() {\n var ele = this[0];\n\n if (ele) {\n return styleCache(key, selfFn, ele);\n }\n };\n}\n\nvar elesfn$r = {\n recalculateRenderedStyle: function recalculateRenderedStyle(useCache) {\n var cy = this.cy();\n var renderer = cy.renderer();\n var styleEnabled = cy.styleEnabled();\n\n if (renderer && styleEnabled) {\n renderer.recalculateRenderedStyle(this, useCache);\n }\n\n return this;\n },\n dirtyStyleCache: function dirtyStyleCache() {\n var cy = this.cy();\n\n var dirty = function dirty(ele) {\n return ele._private.styleCache = null;\n };\n\n if (cy.hasCompoundNodes()) {\n var eles;\n eles = this.spawnSelf().merge(this.descendants()).merge(this.parents());\n eles.merge(eles.connectedEdges());\n eles.forEach(dirty);\n } else {\n this.forEach(function (ele) {\n dirty(ele);\n ele.connectedEdges().forEach(dirty);\n });\n }\n\n return this;\n },\n // fully updates (recalculates) the style for the elements\n updateStyle: function updateStyle(notifyRenderer) {\n var cy = this._private.cy;\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n if (cy.batching()) {\n var bEles = cy._private.batchStyleEles;\n bEles.merge(this);\n return this; // chaining and exit early when batching\n }\n\n var hasCompounds = cy.hasCompoundNodes();\n var style = cy.style();\n var updatedEles = this;\n notifyRenderer = notifyRenderer || notifyRenderer === undefined ? true : false;\n\n if (hasCompounds) {\n // then add everything up and down for compound selector checks\n updatedEles = this.spawnSelf().merge(this.descendants()).merge(this.parents());\n }\n\n var changedEles = style.apply(updatedEles);\n\n if (notifyRenderer) {\n changedEles.emitAndNotify('style'); // let renderer know we changed style\n } else {\n changedEles.emit('style'); // just fire the event\n }\n\n return this; // chaining\n },\n // get the internal parsed style object for the specified property\n parsedStyle: function parsedStyle(property) {\n var includeNonDefault = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var ele = this[0];\n var cy = ele.cy();\n\n if (!cy.styleEnabled()) {\n return;\n }\n\n if (ele) {\n var overriddenStyle = ele._private.style[property];\n\n if (overriddenStyle != null) {\n return overriddenStyle;\n } else if (includeNonDefault) {\n return cy.style().getDefaultProperty(property);\n } else {\n return null;\n }\n }\n },\n numericStyle: function numericStyle(property) {\n var ele = this[0];\n\n if (!ele.cy().styleEnabled()) {\n return;\n }\n\n if (ele) {\n var pstyle = ele.pstyle(property);\n return pstyle.pfValue !== undefined ? pstyle.pfValue : pstyle.value;\n }\n },\n numericStyleUnits: function numericStyleUnits(property) {\n var ele = this[0];\n\n if (!ele.cy().styleEnabled()) {\n return;\n }\n\n if (ele) {\n return ele.pstyle(property).units;\n }\n },\n // get the specified css property as a rendered value (i.e. on-screen value)\n // or get the whole rendered style if no property specified (NB doesn't allow setting)\n renderedStyle: function renderedStyle(property) {\n var cy = this.cy();\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n var ele = this[0];\n\n if (ele) {\n return cy.style().getRenderedStyle(ele, property);\n }\n },\n // read the calculated css style of the element or override the style (via a bypass)\n style: function style(name, value) {\n var cy = this.cy();\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n var updateTransitions = false;\n var style = cy.style();\n\n if (plainObject(name)) {\n // then extend the bypass\n var props = name;\n style.applyBypass(this, props, updateTransitions);\n this.emitAndNotify('style'); // let the renderer know we've updated style\n } else if (string(name)) {\n if (value === undefined) {\n // then get the property from the style\n var ele = this[0];\n\n if (ele) {\n return style.getStylePropertyValue(ele, name);\n } else {\n // empty collection => can't get any value\n return;\n }\n } else {\n // then set the bypass with the property value\n style.applyBypass(this, name, value, updateTransitions);\n this.emitAndNotify('style'); // let the renderer know we've updated style\n }\n } else if (name === undefined) {\n var _ele = this[0];\n\n if (_ele) {\n return style.getRawStyle(_ele);\n } else {\n // empty collection => can't get any value\n return;\n }\n }\n\n return this; // chaining\n },\n removeStyle: function removeStyle(names) {\n var cy = this.cy();\n\n if (!cy.styleEnabled()) {\n return this;\n }\n\n var updateTransitions = false;\n var style = cy.style();\n var eles = this;\n\n if (names === undefined) {\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n style.removeAllBypasses(ele, updateTransitions);\n }\n } else {\n names = names.split(/\\s+/);\n\n for (var _i = 0; _i < eles.length; _i++) {\n var _ele2 = eles[_i];\n style.removeBypasses(_ele2, names, updateTransitions);\n }\n }\n\n this.emitAndNotify('style'); // let the renderer know we've updated style\n\n return this; // chaining\n },\n show: function show() {\n this.css('display', 'element');\n return this; // chaining\n },\n hide: function hide() {\n this.css('display', 'none');\n return this; // chaining\n },\n effectiveOpacity: function effectiveOpacity() {\n var cy = this.cy();\n\n if (!cy.styleEnabled()) {\n return 1;\n }\n\n var hasCompoundNodes = cy.hasCompoundNodes();\n var ele = this[0];\n\n if (ele) {\n var _p = ele._private;\n var parentOpacity = ele.pstyle('opacity').value;\n\n if (!hasCompoundNodes) {\n return parentOpacity;\n }\n\n var parents = !_p.data.parent ? null : ele.parents();\n\n if (parents) {\n for (var i = 0; i < parents.length; i++) {\n var parent = parents[i];\n var opacity = parent.pstyle('opacity').value;\n parentOpacity = opacity * parentOpacity;\n }\n }\n\n return parentOpacity;\n }\n },\n transparent: function transparent() {\n var cy = this.cy();\n\n if (!cy.styleEnabled()) {\n return false;\n }\n\n var ele = this[0];\n var hasCompoundNodes = ele.cy().hasCompoundNodes();\n\n if (ele) {\n if (!hasCompoundNodes) {\n return ele.pstyle('opacity').value === 0;\n } else {\n return ele.effectiveOpacity() === 0;\n }\n }\n },\n backgrounding: function backgrounding() {\n var cy = this.cy();\n\n if (!cy.styleEnabled()) {\n return false;\n }\n\n var ele = this[0];\n return ele._private.backgrounding ? true : false;\n }\n};\n\nfunction checkCompound(ele, parentOk) {\n var _p = ele._private;\n var parents = _p.data.parent ? ele.parents() : null;\n\n if (parents) {\n for (var i = 0; i < parents.length; i++) {\n var parent = parents[i];\n\n if (!parentOk(parent)) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction defineDerivedStateFunction(specs) {\n var ok = specs.ok;\n var edgeOkViaNode = specs.edgeOkViaNode || specs.ok;\n var parentOk = specs.parentOk || specs.ok;\n return function () {\n var cy = this.cy();\n\n if (!cy.styleEnabled()) {\n return true;\n }\n\n var ele = this[0];\n var hasCompoundNodes = cy.hasCompoundNodes();\n\n if (ele) {\n var _p = ele._private;\n\n if (!ok(ele)) {\n return false;\n }\n\n if (ele.isNode()) {\n return !hasCompoundNodes || checkCompound(ele, parentOk);\n } else {\n var src = _p.source;\n var tgt = _p.target;\n return edgeOkViaNode(src) && (!hasCompoundNodes || checkCompound(src, edgeOkViaNode)) && (src === tgt || edgeOkViaNode(tgt) && (!hasCompoundNodes || checkCompound(tgt, edgeOkViaNode)));\n }\n }\n };\n}\n\nvar eleTakesUpSpace = cacheStyleFunction('eleTakesUpSpace', function (ele) {\n return ele.pstyle('display').value === 'element' && ele.width() !== 0 && (ele.isNode() ? ele.height() !== 0 : true);\n});\nelesfn$r.takesUpSpace = cachePrototypeStyleFunction('takesUpSpace', defineDerivedStateFunction({\n ok: eleTakesUpSpace\n}));\nvar eleInteractive = cacheStyleFunction('eleInteractive', function (ele) {\n return ele.pstyle('events').value === 'yes' && ele.pstyle('visibility').value === 'visible' && eleTakesUpSpace(ele);\n});\nvar parentInteractive = cacheStyleFunction('parentInteractive', function (parent) {\n return parent.pstyle('visibility').value === 'visible' && eleTakesUpSpace(parent);\n});\nelesfn$r.interactive = cachePrototypeStyleFunction('interactive', defineDerivedStateFunction({\n ok: eleInteractive,\n parentOk: parentInteractive,\n edgeOkViaNode: eleTakesUpSpace\n}));\n\nelesfn$r.noninteractive = function () {\n var ele = this[0];\n\n if (ele) {\n return !ele.interactive();\n }\n};\n\nvar eleVisible = cacheStyleFunction('eleVisible', function (ele) {\n return ele.pstyle('visibility').value === 'visible' && ele.pstyle('opacity').pfValue !== 0 && eleTakesUpSpace(ele);\n});\nvar edgeVisibleViaNode = eleTakesUpSpace;\nelesfn$r.visible = cachePrototypeStyleFunction('visible', defineDerivedStateFunction({\n ok: eleVisible,\n edgeOkViaNode: edgeVisibleViaNode\n}));\n\nelesfn$r.hidden = function () {\n var ele = this[0];\n\n if (ele) {\n return !ele.visible();\n }\n};\n\nelesfn$r.isBundledBezier = cachePrototypeStyleFunction('isBundledBezier', function () {\n if (!this.cy().styleEnabled()) {\n return false;\n }\n\n return !this.removed() && this.pstyle('curve-style').value === 'bezier' && this.takesUpSpace();\n});\nelesfn$r.bypass = elesfn$r.css = elesfn$r.style;\nelesfn$r.renderedCss = elesfn$r.renderedStyle;\nelesfn$r.removeBypass = elesfn$r.removeCss = elesfn$r.removeStyle;\nelesfn$r.pstyle = elesfn$r.parsedStyle;\n\nvar elesfn$s = {};\n\nfunction defineSwitchFunction(params) {\n return function () {\n var args = arguments;\n var changedEles = []; // e.g. cy.nodes().select( data, handler )\n\n if (args.length === 2) {\n var data = args[0];\n var handler = args[1];\n this.on(params.event, data, handler);\n } // e.g. cy.nodes().select( handler )\n else if (args.length === 1 && fn(args[0])) {\n var _handler = args[0];\n this.on(params.event, _handler);\n } // e.g. cy.nodes().select()\n // e.g. (private) cy.nodes().select(['tapselect'])\n else if (args.length === 0 || args.length === 1 && array(args[0])) {\n var addlEvents = args.length === 1 ? args[0] : null;\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var able = !params.ableField || ele._private[params.ableField];\n var changed = ele._private[params.field] != params.value;\n\n if (params.overrideAble) {\n var overrideAble = params.overrideAble(ele);\n\n if (overrideAble !== undefined) {\n able = overrideAble;\n\n if (!overrideAble) {\n return this;\n } // to save cycles assume not able for all on override\n\n }\n }\n\n if (able) {\n ele._private[params.field] = params.value;\n\n if (changed) {\n changedEles.push(ele);\n }\n }\n }\n\n var changedColl = this.spawn(changedEles);\n changedColl.updateStyle(); // change of state => possible change of style\n\n changedColl.emit(params.event);\n\n if (addlEvents) {\n changedColl.emit(addlEvents);\n }\n }\n\n return this;\n };\n}\n\nfunction defineSwitchSet(params) {\n elesfn$s[params.field] = function () {\n var ele = this[0];\n\n if (ele) {\n if (params.overrideField) {\n var val = params.overrideField(ele);\n\n if (val !== undefined) {\n return val;\n }\n }\n\n return ele._private[params.field];\n }\n };\n\n elesfn$s[params.on] = defineSwitchFunction({\n event: params.on,\n field: params.field,\n ableField: params.ableField,\n overrideAble: params.overrideAble,\n value: true\n });\n elesfn$s[params.off] = defineSwitchFunction({\n event: params.off,\n field: params.field,\n ableField: params.ableField,\n overrideAble: params.overrideAble,\n value: false\n });\n}\n\ndefineSwitchSet({\n field: 'locked',\n overrideField: function overrideField(ele) {\n return ele.cy().autolock() ? true : undefined;\n },\n on: 'lock',\n off: 'unlock'\n});\ndefineSwitchSet({\n field: 'grabbable',\n overrideField: function overrideField(ele) {\n return ele.cy().autoungrabify() || ele.pannable() ? false : undefined;\n },\n on: 'grabify',\n off: 'ungrabify'\n});\ndefineSwitchSet({\n field: 'selected',\n ableField: 'selectable',\n overrideAble: function overrideAble(ele) {\n return ele.cy().autounselectify() ? false : undefined;\n },\n on: 'select',\n off: 'unselect'\n});\ndefineSwitchSet({\n field: 'selectable',\n overrideField: function overrideField(ele) {\n return ele.cy().autounselectify() ? false : undefined;\n },\n on: 'selectify',\n off: 'unselectify'\n});\nelesfn$s.deselect = elesfn$s.unselect;\n\nelesfn$s.grabbed = function () {\n var ele = this[0];\n\n if (ele) {\n return ele._private.grabbed;\n }\n};\n\ndefineSwitchSet({\n field: 'active',\n on: 'activate',\n off: 'unactivate'\n});\ndefineSwitchSet({\n field: 'pannable',\n on: 'panify',\n off: 'unpanify'\n});\n\nelesfn$s.inactive = function () {\n var ele = this[0];\n\n if (ele) {\n return !ele._private.active;\n }\n};\n\nvar elesfn$t = {}; // DAG functions\n////////////////\n\nvar defineDagExtremity = function defineDagExtremity(params) {\n return function dagExtremityImpl(selector) {\n var eles = this;\n var ret = [];\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n\n if (!ele.isNode()) {\n continue;\n }\n\n var disqualified = false;\n var edges = ele.connectedEdges();\n\n for (var j = 0; j < edges.length; j++) {\n var edge = edges[j];\n var src = edge.source();\n var tgt = edge.target();\n\n if (params.noIncomingEdges && tgt === ele && src !== ele || params.noOutgoingEdges && src === ele && tgt !== ele) {\n disqualified = true;\n break;\n }\n }\n\n if (!disqualified) {\n ret.push(ele);\n }\n }\n\n return this.spawn(ret, {\n unique: true\n }).filter(selector);\n };\n};\n\nvar defineDagOneHop = function defineDagOneHop(params) {\n return function (selector) {\n var eles = this;\n var oEles = [];\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n\n if (!ele.isNode()) {\n continue;\n }\n\n var edges = ele.connectedEdges();\n\n for (var j = 0; j < edges.length; j++) {\n var edge = edges[j];\n var src = edge.source();\n var tgt = edge.target();\n\n if (params.outgoing && src === ele) {\n oEles.push(edge);\n oEles.push(tgt);\n } else if (params.incoming && tgt === ele) {\n oEles.push(edge);\n oEles.push(src);\n }\n }\n }\n\n return this.spawn(oEles, {\n unique: true\n }).filter(selector);\n };\n};\n\nvar defineDagAllHops = function defineDagAllHops(params) {\n return function (selector) {\n var eles = this;\n var sEles = [];\n var sElesIds = {};\n\n for (;;) {\n var next = params.outgoing ? eles.outgoers() : eles.incomers();\n\n if (next.length === 0) {\n break;\n } // done if none left\n\n\n var newNext = false;\n\n for (var i = 0; i < next.length; i++) {\n var n = next[i];\n var nid = n.id();\n\n if (!sElesIds[nid]) {\n sElesIds[nid] = true;\n sEles.push(n);\n newNext = true;\n }\n }\n\n if (!newNext) {\n break;\n } // done if touched all outgoers already\n\n\n eles = next;\n }\n\n return this.spawn(sEles, {\n unique: true\n }).filter(selector);\n };\n};\n\nelesfn$t.clearTraversalCache = function () {\n for (var i = 0; i < this.length; i++) {\n this[i]._private.traversalCache = null;\n }\n};\n\nextend(elesfn$t, {\n // get the root nodes in the DAG\n roots: defineDagExtremity({\n noIncomingEdges: true\n }),\n // get the leaf nodes in the DAG\n leaves: defineDagExtremity({\n noOutgoingEdges: true\n }),\n // normally called children in graph theory\n // these nodes =edges=> outgoing nodes\n outgoers: cache(defineDagOneHop({\n outgoing: true\n }), 'outgoers'),\n // aka DAG descendants\n successors: defineDagAllHops({\n outgoing: true\n }),\n // normally called parents in graph theory\n // these nodes <=edges= incoming nodes\n incomers: cache(defineDagOneHop({\n incoming: true\n }), 'incomers'),\n // aka DAG ancestors\n predecessors: defineDagAllHops({\n incoming: true\n })\n}); // Neighbourhood functions\n//////////////////////////\n\nextend(elesfn$t, {\n neighborhood: cache(function (selector) {\n var elements = [];\n var nodes = this.nodes();\n\n for (var i = 0; i < nodes.length; i++) {\n // for all nodes\n var node = nodes[i];\n var connectedEdges = node.connectedEdges(); // for each connected edge, add the edge and the other node\n\n for (var j = 0; j < connectedEdges.length; j++) {\n var edge = connectedEdges[j];\n var src = edge.source();\n var tgt = edge.target();\n var otherNode = node === src ? tgt : src; // need check in case of loop\n\n if (otherNode.length > 0) {\n elements.push(otherNode[0]); // add node 1 hop away\n } // add connected edge\n\n\n elements.push(edge[0]);\n }\n }\n\n return this.spawn(elements, {\n unique: true\n }).filter(selector);\n }, 'neighborhood'),\n closedNeighborhood: function closedNeighborhood(selector) {\n return this.neighborhood().add(this).filter(selector);\n },\n openNeighborhood: function openNeighborhood(selector) {\n return this.neighborhood(selector);\n }\n}); // aliases\n\nelesfn$t.neighbourhood = elesfn$t.neighborhood;\nelesfn$t.closedNeighbourhood = elesfn$t.closedNeighborhood;\nelesfn$t.openNeighbourhood = elesfn$t.openNeighborhood; // Edge functions\n/////////////////\n\nextend(elesfn$t, {\n source: cache(function sourceImpl(selector) {\n var ele = this[0];\n var src;\n\n if (ele) {\n src = ele._private.source || ele.cy().collection();\n }\n\n return src && selector ? src.filter(selector) : src;\n }, 'source'),\n target: cache(function targetImpl(selector) {\n var ele = this[0];\n var tgt;\n\n if (ele) {\n tgt = ele._private.target || ele.cy().collection();\n }\n\n return tgt && selector ? tgt.filter(selector) : tgt;\n }, 'target'),\n sources: defineSourceFunction({\n attr: 'source'\n }),\n targets: defineSourceFunction({\n attr: 'target'\n })\n});\n\nfunction defineSourceFunction(params) {\n return function sourceImpl(selector) {\n var sources = [];\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var src = ele._private[params.attr];\n\n if (src) {\n sources.push(src);\n }\n }\n\n return this.spawn(sources, {\n unique: true\n }).filter(selector);\n };\n}\n\nextend(elesfn$t, {\n edgesWith: cache(defineEdgesWithFunction(), 'edgesWith'),\n edgesTo: cache(defineEdgesWithFunction({\n thisIsSrc: true\n }), 'edgesTo')\n});\n\nfunction defineEdgesWithFunction(params) {\n return function edgesWithImpl(otherNodes) {\n var elements = [];\n var cy = this._private.cy;\n var p = params || {}; // get elements if a selector is specified\n\n if (string(otherNodes)) {\n otherNodes = cy.$(otherNodes);\n }\n\n for (var h = 0; h < otherNodes.length; h++) {\n var edges = otherNodes[h]._private.edges;\n\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n var edgeData = edge._private.data;\n var thisToOther = this.hasElementWithId(edgeData.source) && otherNodes.hasElementWithId(edgeData.target);\n var otherToThis = otherNodes.hasElementWithId(edgeData.source) && this.hasElementWithId(edgeData.target);\n var edgeConnectsThisAndOther = thisToOther || otherToThis;\n\n if (!edgeConnectsThisAndOther) {\n continue;\n }\n\n if (p.thisIsSrc || p.thisIsTgt) {\n if (p.thisIsSrc && !thisToOther) {\n continue;\n }\n\n if (p.thisIsTgt && !otherToThis) {\n continue;\n }\n }\n\n elements.push(edge);\n }\n }\n\n return this.spawn(elements, {\n unique: true\n });\n };\n}\n\nextend(elesfn$t, {\n connectedEdges: cache(function (selector) {\n var retEles = [];\n var eles = this;\n\n for (var i = 0; i < eles.length; i++) {\n var node = eles[i];\n\n if (!node.isNode()) {\n continue;\n }\n\n var edges = node._private.edges;\n\n for (var j = 0; j < edges.length; j++) {\n var edge = edges[j];\n retEles.push(edge);\n }\n }\n\n return this.spawn(retEles, {\n unique: true\n }).filter(selector);\n }, 'connectedEdges'),\n connectedNodes: cache(function (selector) {\n var retEles = [];\n var eles = this;\n\n for (var i = 0; i < eles.length; i++) {\n var edge = eles[i];\n\n if (!edge.isEdge()) {\n continue;\n }\n\n retEles.push(edge.source()[0]);\n retEles.push(edge.target()[0]);\n }\n\n return this.spawn(retEles, {\n unique: true\n }).filter(selector);\n }, 'connectedNodes'),\n parallelEdges: cache(defineParallelEdgesFunction(), 'parallelEdges'),\n codirectedEdges: cache(defineParallelEdgesFunction({\n codirected: true\n }), 'codirectedEdges')\n});\n\nfunction defineParallelEdgesFunction(params) {\n var defaults = {\n codirected: false\n };\n params = extend({}, defaults, params);\n return function parallelEdgesImpl(selector) {\n // micro-optimised for renderer\n var elements = [];\n var edges = this.edges();\n var p = params; // look at all the edges in the collection\n\n for (var i = 0; i < edges.length; i++) {\n var edge1 = edges[i];\n var edge1_p = edge1._private;\n var src1 = edge1_p.source;\n var srcid1 = src1._private.data.id;\n var tgtid1 = edge1_p.data.target;\n var srcEdges1 = src1._private.edges; // look at edges connected to the src node of this edge\n\n for (var j = 0; j < srcEdges1.length; j++) {\n var edge2 = srcEdges1[j];\n var edge2data = edge2._private.data;\n var tgtid2 = edge2data.target;\n var srcid2 = edge2data.source;\n var codirected = tgtid2 === tgtid1 && srcid2 === srcid1;\n var oppdirected = srcid1 === tgtid2 && tgtid1 === srcid2;\n\n if (p.codirected && codirected || !p.codirected && (codirected || oppdirected)) {\n elements.push(edge2);\n }\n }\n }\n\n return this.spawn(elements, {\n unique: true\n }).filter(selector);\n };\n} // Misc functions\n/////////////////\n\n\nextend(elesfn$t, {\n components: function components(root) {\n var self = this;\n var cy = self.cy();\n var visited = cy.collection();\n var unvisited = root == null ? self.nodes() : root.nodes();\n var components = [];\n\n if (root != null && unvisited.empty()) {\n // root may contain only edges\n unvisited = root.sources(); // doesn't matter which node to use (undirected), so just use the source sides\n }\n\n var visitInComponent = function visitInComponent(node, component) {\n visited.merge(node);\n unvisited.unmerge(node);\n component.merge(node);\n };\n\n if (unvisited.empty()) {\n return self.spawn();\n }\n\n var _loop = function _loop() {\n // each iteration yields a component\n var cmpt = cy.collection();\n components.push(cmpt);\n var root = unvisited[0];\n visitInComponent(root, cmpt);\n self.bfs({\n directed: false,\n roots: root,\n visit: function visit(v) {\n return visitInComponent(v, cmpt);\n }\n });\n cmpt.forEach(function (node) {\n node.connectedEdges().forEach(function (e) {\n // connectedEdges() usually cached\n if (self.has(e) && cmpt.has(e.source()) && cmpt.has(e.target())) {\n // has() is cheap\n cmpt.merge(e); // forEach() only considers nodes -- sets N at call time\n }\n });\n });\n };\n\n do {\n _loop();\n } while (unvisited.length > 0);\n\n return components;\n },\n component: function component() {\n var ele = this[0];\n return ele.cy().mutableElements().components(ele)[0];\n }\n});\nelesfn$t.componentsOf = elesfn$t.components;\n\nvar idFactory = {\n generate: function generate(cy, element, tryThisId) {\n var id = tryThisId != null ? tryThisId : uuid();\n\n while (cy.hasElementWithId(id)) {\n id = uuid();\n }\n\n return id;\n }\n}; // represents a set of nodes, edges, or both together\n\nvar Collection = function Collection(cy, elements, options) {\n if (cy === undefined || !core(cy)) {\n error('A collection must have a reference to the core');\n return;\n }\n\n var map = new Map$1();\n var createdElements = false;\n\n if (!elements) {\n elements = [];\n } else if (elements.length > 0 && plainObject(elements[0]) && !element(elements[0])) {\n createdElements = true; // make elements from json and restore all at once later\n\n var eles = [];\n var elesIds = new Set$1();\n\n for (var i = 0, l = elements.length; i < l; i++) {\n var json = elements[i];\n\n if (json.data == null) {\n json.data = {};\n }\n\n var _data = json.data; // make sure newly created elements have valid ids\n\n if (_data.id == null) {\n _data.id = idFactory.generate(cy, json);\n } else if (cy.hasElementWithId(_data.id) || elesIds.has(_data.id)) {\n continue; // can't create element if prior id already exists\n }\n\n var ele = new Element(cy, json, false);\n eles.push(ele);\n elesIds.add(_data.id);\n }\n\n elements = eles;\n }\n\n this.length = 0;\n\n for (var _i = 0, _l = elements.length; _i < _l; _i++) {\n var element$1 = elements[_i][0]; // [0] in case elements is an array of collections, rather than array of elements\n\n if (element$1 == null) {\n continue;\n }\n\n var id = element$1._private.data.id;\n\n if (options == null || options.unique && !map.has(id)) {\n map.set(id, {\n index: this.length,\n ele: element$1\n });\n this[this.length] = element$1;\n this.length++;\n }\n }\n\n this._private = {\n cy: cy,\n map: map\n }; // restore the elements if we created them from json\n\n if (createdElements) {\n this.restore();\n }\n}; // Functions\n////////////////////////////////////////////////////////////////////////////////////////////////////\n// keep the prototypes in sync (an element has the same functions as a collection)\n// and use elefn and elesfn as shorthands to the prototypes\n\n\nvar elesfn$u = Element.prototype = Collection.prototype;\n\nelesfn$u.instanceString = function () {\n return 'collection';\n};\n\nelesfn$u.spawn = function (cy, eles, opts) {\n if (!core(cy)) {\n // cy is optional\n opts = eles;\n eles = cy;\n cy = this.cy();\n }\n\n return new Collection(cy, eles, opts);\n};\n\nelesfn$u.spawnSelf = function () {\n return this.spawn(this);\n};\n\nelesfn$u.cy = function () {\n return this._private.cy;\n};\n\nelesfn$u.renderer = function () {\n return this._private.cy.renderer();\n};\n\nelesfn$u.element = function () {\n return this[0];\n};\n\nelesfn$u.collection = function () {\n if (collection(this)) {\n return this;\n } else {\n // an element\n return new Collection(this._private.cy, [this]);\n }\n};\n\nelesfn$u.unique = function () {\n return new Collection(this._private.cy, this, {\n unique: true\n });\n};\n\nelesfn$u.hasElementWithId = function (id) {\n id = '' + id; // id must be string\n\n return this._private.map.has(id);\n};\n\nelesfn$u.getElementById = function (id) {\n id = '' + id; // id must be string\n\n var cy = this._private.cy;\n\n var entry = this._private.map.get(id);\n\n return entry ? entry.ele : new Collection(cy); // get ele or empty collection\n};\n\nelesfn$u.$id = elesfn$u.getElementById;\n\nelesfn$u.poolIndex = function () {\n var cy = this._private.cy;\n var eles = cy._private.elements;\n var id = this[0]._private.data.id;\n return eles._private.map.get(id).index;\n};\n\nelesfn$u.indexOf = function (ele) {\n var id = ele[0]._private.data.id;\n return this._private.map.get(id).index;\n};\n\nelesfn$u.indexOfId = function (id) {\n id = '' + id; // id must be string\n\n return this._private.map.get(id).index;\n};\n\nelesfn$u.json = function (obj) {\n var ele = this.element();\n var cy = this.cy();\n\n if (ele == null && obj) {\n return this;\n } // can't set to no eles\n\n\n if (ele == null) {\n return undefined;\n } // can't get from no eles\n\n\n var p = ele._private;\n\n if (plainObject(obj)) {\n // set\n cy.startBatch();\n\n if (obj.data) {\n ele.data(obj.data);\n var _data2 = p.data;\n\n if (ele.isEdge()) {\n // source and target are immutable via data()\n var move = false;\n var spec = {};\n var src = obj.data.source;\n var tgt = obj.data.target;\n\n if (src != null && src != _data2.source) {\n spec.source = '' + src; // id must be string\n\n move = true;\n }\n\n if (tgt != null && tgt != _data2.target) {\n spec.target = '' + tgt; // id must be string\n\n move = true;\n }\n\n if (move) {\n ele = ele.move(spec);\n }\n } else {\n // parent is immutable via data()\n var newParentValSpecd = 'parent' in obj.data;\n var parent = obj.data.parent;\n\n if (newParentValSpecd && (parent != null || _data2.parent != null) && parent != _data2.parent) {\n if (parent === undefined) {\n // can't set undefined imperatively, so use null\n parent = null;\n }\n\n if (parent != null) {\n parent = '' + parent; // id must be string\n }\n\n ele = ele.move({\n parent: parent\n });\n }\n }\n }\n\n if (obj.position) {\n ele.position(obj.position);\n } // ignore group -- immutable\n\n\n var checkSwitch = function checkSwitch(k, trueFnName, falseFnName) {\n var obj_k = obj[k];\n\n if (obj_k != null && obj_k !== p[k]) {\n if (obj_k) {\n ele[trueFnName]();\n } else {\n ele[falseFnName]();\n }\n }\n };\n\n checkSwitch('removed', 'remove', 'restore');\n checkSwitch('selected', 'select', 'unselect');\n checkSwitch('selectable', 'selectify', 'unselectify');\n checkSwitch('locked', 'lock', 'unlock');\n checkSwitch('grabbable', 'grabify', 'ungrabify');\n checkSwitch('pannable', 'panify', 'unpanify');\n\n if (obj.classes != null) {\n ele.classes(obj.classes);\n }\n\n cy.endBatch();\n return this;\n } else if (obj === undefined) {\n // get\n var json = {\n data: copy(p.data),\n position: copy(p.position),\n group: p.group,\n removed: p.removed,\n selected: p.selected,\n selectable: p.selectable,\n locked: p.locked,\n grabbable: p.grabbable,\n pannable: p.pannable,\n classes: null\n };\n json.classes = '';\n var i = 0;\n p.classes.forEach(function (cls) {\n return json.classes += i++ === 0 ? cls : ' ' + cls;\n });\n return json;\n }\n};\n\nelesfn$u.jsons = function () {\n var jsons = [];\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var json = ele.json();\n jsons.push(json);\n }\n\n return jsons;\n};\n\nelesfn$u.clone = function () {\n var cy = this.cy();\n var elesArr = [];\n\n for (var i = 0; i < this.length; i++) {\n var ele = this[i];\n var json = ele.json();\n var clone = new Element(cy, json, false); // NB no restore\n\n elesArr.push(clone);\n }\n\n return new Collection(cy, elesArr);\n};\n\nelesfn$u.copy = elesfn$u.clone;\n\nelesfn$u.restore = function () {\n var notifyRenderer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var addToPool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var self = this;\n var cy = self.cy();\n var cy_p = cy._private; // create arrays of nodes and edges, since we need to\n // restore the nodes first\n\n var nodes = [];\n var edges = [];\n var elements;\n\n for (var _i2 = 0, l = self.length; _i2 < l; _i2++) {\n var ele = self[_i2];\n\n if (addToPool && !ele.removed()) {\n // don't need to handle this ele\n continue;\n } // keep nodes first in the array and edges after\n\n\n if (ele.isNode()) {\n // put to front of array if node\n nodes.push(ele);\n } else {\n // put to end of array if edge\n edges.push(ele);\n }\n }\n\n elements = nodes.concat(edges);\n var i;\n\n var removeFromElements = function removeFromElements() {\n elements.splice(i, 1);\n i--;\n }; // now, restore each element\n\n\n for (i = 0; i < elements.length; i++) {\n var _ele = elements[i];\n var _private = _ele._private;\n var _data3 = _private.data; // the traversal cache should start fresh when ele is added\n\n _ele.clearTraversalCache(); // set id and validate\n\n\n if (!addToPool && !_private.removed) ; else if (_data3.id === undefined) {\n _data3.id = idFactory.generate(cy, _ele);\n } else if (number(_data3.id)) {\n _data3.id = '' + _data3.id; // now it's a string\n } else if (emptyString(_data3.id) || !string(_data3.id)) {\n error('Can not create element with invalid string ID `' + _data3.id + '`'); // can't create element if it has empty string as id or non-string id\n\n removeFromElements();\n continue;\n } else if (cy.hasElementWithId(_data3.id)) {\n error('Can not create second element with ID `' + _data3.id + '`'); // can't create element if one already has that id\n\n removeFromElements();\n continue;\n }\n\n var id = _data3.id; // id is finalised, now let's keep a ref\n\n if (_ele.isNode()) {\n // extra checks for nodes\n var pos = _private.position; // make sure the nodes have a defined position\n\n if (pos.x == null) {\n pos.x = 0;\n }\n\n if (pos.y == null) {\n pos.y = 0;\n }\n }\n\n if (_ele.isEdge()) {\n // extra checks for edges\n var edge = _ele;\n var fields = ['source', 'target'];\n var fieldsLength = fields.length;\n var badSourceOrTarget = false;\n\n for (var j = 0; j < fieldsLength; j++) {\n var field = fields[j];\n var val = _data3[field];\n\n if (number(val)) {\n val = _data3[field] = '' + _data3[field]; // now string\n }\n\n if (val == null || val === '') {\n // can't create if source or target is not defined properly\n error('Can not create edge `' + id + '` with unspecified ' + field);\n badSourceOrTarget = true;\n } else if (!cy.hasElementWithId(val)) {\n // can't create edge if one of its nodes doesn't exist\n error('Can not create edge `' + id + '` with nonexistant ' + field + ' `' + val + '`');\n badSourceOrTarget = true;\n }\n }\n\n if (badSourceOrTarget) {\n removeFromElements();\n continue;\n } // can't create this\n\n\n var src = cy.getElementById(_data3.source);\n var tgt = cy.getElementById(_data3.target); // only one edge in node if loop\n\n if (src.same(tgt)) {\n src._private.edges.push(edge);\n } else {\n src._private.edges.push(edge);\n\n tgt._private.edges.push(edge);\n }\n\n edge._private.source = src;\n edge._private.target = tgt;\n } // if is edge\n // create mock ids / indexes maps for element so it can be used like collections\n\n\n _private.map = new Map$1();\n\n _private.map.set(id, {\n ele: _ele,\n index: 0\n });\n\n _private.removed = false;\n\n if (addToPool) {\n cy.addToPool(_ele);\n }\n } // for each element\n // do compound node sanity checks\n\n\n for (var _i3 = 0; _i3 < nodes.length; _i3++) {\n // each node\n var node = nodes[_i3];\n var _data4 = node._private.data;\n\n if (number(_data4.parent)) {\n // then automake string\n _data4.parent = '' + _data4.parent;\n }\n\n var parentId = _data4.parent;\n var specifiedParent = parentId != null;\n\n if (specifiedParent) {\n var parent = cy.getElementById(parentId);\n\n if (parent.empty()) {\n // non-existant parent; just remove it\n _data4.parent = undefined;\n } else {\n var selfAsParent = false;\n var ancestor = parent;\n\n while (!ancestor.empty()) {\n if (node.same(ancestor)) {\n // mark self as parent and remove from data\n selfAsParent = true;\n _data4.parent = undefined; // remove parent reference\n // exit or we loop forever\n\n break;\n }\n\n ancestor = ancestor.parent();\n }\n\n if (!selfAsParent) {\n // connect with children\n parent[0]._private.children.push(node);\n\n node._private.parent = parent[0]; // let the core know we have a compound graph\n\n cy_p.hasCompoundNodes = true;\n }\n } // else\n\n } // if specified parent\n\n } // for each node\n\n\n if (elements.length > 0) {\n var restored = new Collection(cy, elements);\n\n for (var _i4 = 0; _i4 < restored.length; _i4++) {\n var _ele2 = restored[_i4];\n\n if (_ele2.isNode()) {\n continue;\n } // adding an edge invalidates the traversal caches for the parallel edges\n\n\n _ele2.parallelEdges().clearTraversalCache(); // adding an edge invalidates the traversal cache for the connected nodes\n\n\n _ele2.source().clearTraversalCache();\n\n _ele2.target().clearTraversalCache();\n }\n\n var toUpdateStyle;\n\n if (cy_p.hasCompoundNodes) {\n toUpdateStyle = cy.collection().merge(restored).merge(restored.connectedNodes()).merge(restored.parent());\n } else {\n toUpdateStyle = restored;\n }\n\n toUpdateStyle.dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(notifyRenderer);\n\n if (notifyRenderer) {\n restored.emitAndNotify('add');\n } else if (addToPool) {\n restored.emit('add');\n }\n }\n\n return self; // chainability\n};\n\nelesfn$u.removed = function () {\n var ele = this[0];\n return ele && ele._private.removed;\n};\n\nelesfn$u.inside = function () {\n var ele = this[0];\n return ele && !ele._private.removed;\n};\n\nelesfn$u.remove = function () {\n var notifyRenderer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var removeFromPool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var self = this;\n var elesToRemove = [];\n var elesToRemoveIds = {};\n var cy = self._private.cy; // add connected edges\n\n function addConnectedEdges(node) {\n var edges = node._private.edges;\n\n for (var i = 0; i < edges.length; i++) {\n add(edges[i]);\n }\n } // add descendant nodes\n\n\n function addChildren(node) {\n var children = node._private.children;\n\n for (var i = 0; i < children.length; i++) {\n add(children[i]);\n }\n }\n\n function add(ele) {\n var alreadyAdded = elesToRemoveIds[ele.id()];\n\n if (removeFromPool && ele.removed() || alreadyAdded) {\n return;\n } else {\n elesToRemoveIds[ele.id()] = true;\n }\n\n if (ele.isNode()) {\n elesToRemove.push(ele); // nodes are removed last\n\n addConnectedEdges(ele);\n addChildren(ele);\n } else {\n elesToRemove.unshift(ele); // edges are removed first\n }\n } // make the list of elements to remove\n // (may be removing more than specified due to connected edges etc)\n\n\n for (var i = 0, l = self.length; i < l; i++) {\n var ele = self[i];\n add(ele);\n }\n\n function removeEdgeRef(node, edge) {\n var connectedEdges = node._private.edges;\n removeFromArray(connectedEdges, edge); // removing an edges invalidates the traversal cache for its nodes\n\n node.clearTraversalCache();\n }\n\n function removeParallelRef(pllEdge) {\n // removing an edge invalidates the traversal caches for the parallel edges\n pllEdge.clearTraversalCache();\n }\n\n var alteredParents = [];\n alteredParents.ids = {};\n\n function removeChildRef(parent, ele) {\n ele = ele[0];\n parent = parent[0];\n var children = parent._private.children;\n var pid = parent.id();\n removeFromArray(children, ele); // remove parent => child ref\n\n ele._private.parent = null; // remove child => parent ref\n\n if (!alteredParents.ids[pid]) {\n alteredParents.ids[pid] = true;\n alteredParents.push(parent);\n }\n }\n\n self.dirtyCompoundBoundsCache();\n\n if (removeFromPool) {\n cy.removeFromPool(elesToRemove); // remove from core pool\n }\n\n for (var _i5 = 0; _i5 < elesToRemove.length; _i5++) {\n var _ele3 = elesToRemove[_i5];\n\n if (_ele3.isEdge()) {\n // remove references to this edge in its connected nodes\n var src = _ele3.source()[0];\n\n var tgt = _ele3.target()[0];\n\n removeEdgeRef(src, _ele3);\n removeEdgeRef(tgt, _ele3);\n\n var pllEdges = _ele3.parallelEdges();\n\n for (var j = 0; j < pllEdges.length; j++) {\n var pllEdge = pllEdges[j];\n removeParallelRef(pllEdge);\n\n if (pllEdge.isBundledBezier()) {\n pllEdge.dirtyBoundingBoxCache();\n }\n }\n } else {\n // remove reference to parent\n var parent = _ele3.parent();\n\n if (parent.length !== 0) {\n removeChildRef(parent, _ele3);\n }\n }\n\n if (removeFromPool) {\n // mark as removed\n _ele3._private.removed = true;\n }\n } // check to see if we have a compound graph or not\n\n\n var elesStillInside = cy._private.elements;\n cy._private.hasCompoundNodes = false;\n\n for (var _i6 = 0; _i6 < elesStillInside.length; _i6++) {\n var _ele4 = elesStillInside[_i6];\n\n if (_ele4.isParent()) {\n cy._private.hasCompoundNodes = true;\n break;\n }\n }\n\n var removedElements = new Collection(this.cy(), elesToRemove);\n\n if (removedElements.size() > 0) {\n // must manually notify since trigger won't do this automatically once removed\n if (notifyRenderer) {\n removedElements.emitAndNotify('remove');\n } else if (removeFromPool) {\n removedElements.emit('remove');\n }\n } // the parents who were modified by the removal need their style updated\n\n\n for (var _i7 = 0; _i7 < alteredParents.length; _i7++) {\n var _ele5 = alteredParents[_i7];\n\n if (!removeFromPool || !_ele5.removed()) {\n _ele5.updateStyle();\n }\n }\n\n return removedElements;\n};\n\nelesfn$u.move = function (struct) {\n var cy = this._private.cy;\n var eles = this; // just clean up refs, caches, etc. in the same way as when removing and then restoring\n // (our calls to remove/restore do not remove from the graph or make events)\n\n var notifyRenderer = false;\n var modifyPool = false;\n\n var toString = function toString(id) {\n return id == null ? id : '' + id;\n }; // id must be string\n\n\n if (struct.source !== undefined || struct.target !== undefined) {\n var srcId = toString(struct.source);\n var tgtId = toString(struct.target);\n var srcExists = srcId != null && cy.hasElementWithId(srcId);\n var tgtExists = tgtId != null && cy.hasElementWithId(tgtId);\n\n if (srcExists || tgtExists) {\n cy.batch(function () {\n // avoid duplicate style updates\n eles.remove(notifyRenderer, modifyPool); // clean up refs etc.\n\n eles.emitAndNotify('moveout');\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var _data5 = ele._private.data;\n\n if (ele.isEdge()) {\n if (srcExists) {\n _data5.source = srcId;\n }\n\n if (tgtExists) {\n _data5.target = tgtId;\n }\n }\n }\n\n eles.restore(notifyRenderer, modifyPool); // make new refs, style, etc.\n });\n eles.emitAndNotify('move');\n }\n } else if (struct.parent !== undefined) {\n // move node to new parent\n var parentId = toString(struct.parent);\n var parentExists = parentId === null || cy.hasElementWithId(parentId);\n\n if (parentExists) {\n var pidToAssign = parentId === null ? undefined : parentId;\n cy.batch(function () {\n // avoid duplicate style updates\n var updated = eles.remove(notifyRenderer, modifyPool); // clean up refs etc.\n\n updated.emitAndNotify('moveout');\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var _data6 = ele._private.data;\n\n if (ele.isNode()) {\n _data6.parent = pidToAssign;\n }\n }\n\n updated.restore(notifyRenderer, modifyPool); // make new refs, style, etc.\n });\n eles.emitAndNotify('move');\n }\n }\n\n return this;\n};\n\n[elesfn$c, elesfn$d, elesfn$e, elesfn$f, elesfn$g, data$1, elesfn$i, dimensions, elesfn$m, elesfn$n, elesfn$o, elesfn$p, elesfn$q, elesfn$r, elesfn$s, elesfn$t].forEach(function (props) {\n extend(elesfn$u, props);\n});\n\nvar corefn = {\n add: function add(opts) {\n var elements;\n var cy = this; // add the elements\n\n if (elementOrCollection(opts)) {\n var eles = opts;\n\n if (eles._private.cy === cy) {\n // same instance => just restore\n elements = eles.restore();\n } else {\n // otherwise, copy from json\n var jsons = [];\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n jsons.push(ele.json());\n }\n\n elements = new Collection(cy, jsons);\n }\n } // specify an array of options\n else if (array(opts)) {\n var _jsons = opts;\n elements = new Collection(cy, _jsons);\n } // specify via opts.nodes and opts.edges\n else if (plainObject(opts) && (array(opts.nodes) || array(opts.edges))) {\n var elesByGroup = opts;\n var _jsons2 = [];\n var grs = ['nodes', 'edges'];\n\n for (var _i = 0, il = grs.length; _i < il; _i++) {\n var group = grs[_i];\n var elesArray = elesByGroup[group];\n\n if (array(elesArray)) {\n for (var j = 0, jl = elesArray.length; j < jl; j++) {\n var json = extend({\n group: group\n }, elesArray[j]);\n\n _jsons2.push(json);\n }\n }\n }\n\n elements = new Collection(cy, _jsons2);\n } // specify options for one element\n else {\n var _json = opts;\n elements = new Element(cy, _json).collection();\n }\n\n return elements;\n },\n remove: function remove(collection) {\n if (elementOrCollection(collection)) ; else if (string(collection)) {\n var selector = collection;\n collection = this.$(selector);\n }\n\n return collection.remove();\n }\n};\n\n/* global Float32Array */\n\n/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */\nfunction generateCubicBezier(mX1, mY1, mX2, mY2) {\n var NEWTON_ITERATIONS = 4,\n NEWTON_MIN_SLOPE = 0.001,\n SUBDIVISION_PRECISION = 0.0000001,\n SUBDIVISION_MAX_ITERATIONS = 10,\n kSplineTableSize = 11,\n kSampleStepSize = 1.0 / (kSplineTableSize - 1.0),\n float32ArraySupported = typeof Float32Array !== 'undefined';\n /* Must contain four arguments. */\n\n if (arguments.length !== 4) {\n return false;\n }\n /* Arguments must be numbers. */\n\n\n for (var i = 0; i < 4; ++i) {\n if (typeof arguments[i] !== \"number\" || isNaN(arguments[i]) || !isFinite(arguments[i])) {\n return false;\n }\n }\n /* X values must be in the [0, 1] range. */\n\n\n mX1 = Math.min(mX1, 1);\n mX2 = Math.min(mX2, 1);\n mX1 = Math.max(mX1, 0);\n mX2 = Math.max(mX2, 0);\n var mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n\n function A(aA1, aA2) {\n return 1.0 - 3.0 * aA2 + 3.0 * aA1;\n }\n\n function B(aA1, aA2) {\n return 3.0 * aA2 - 6.0 * aA1;\n }\n\n function C(aA1) {\n return 3.0 * aA1;\n }\n\n function calcBezier(aT, aA1, aA2) {\n return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT;\n }\n\n function getSlope(aT, aA1, aA2) {\n return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1);\n }\n\n function newtonRaphsonIterate(aX, aGuessT) {\n for (var _i = 0; _i < NEWTON_ITERATIONS; ++_i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n\n if (currentSlope === 0.0) {\n return aGuessT;\n }\n\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n\n return aGuessT;\n }\n\n function calcSampleValues() {\n for (var _i2 = 0; _i2 < kSplineTableSize; ++_i2) {\n mSampleValues[_i2] = calcBezier(_i2 * kSampleStepSize, mX1, mX2);\n }\n }\n\n function binarySubdivide(aX, aA, aB) {\n var currentX,\n currentT,\n i = 0;\n\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n\n if (currentX > 0.0) {\n aB = currentT;\n } else {\n aA = currentT;\n }\n } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);\n\n return currentT;\n }\n\n function getTForX(aX) {\n var intervalStart = 0.0,\n currentSample = 1,\n lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && mSampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n var dist = (aX - mSampleValues[currentSample]) / (mSampleValues[currentSample + 1] - mSampleValues[currentSample]),\n guessForT = intervalStart + dist * kSampleStepSize,\n initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= NEWTON_MIN_SLOPE) {\n return newtonRaphsonIterate(aX, guessForT);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize);\n }\n }\n\n var _precomputed = false;\n\n function precompute() {\n _precomputed = true;\n\n if (mX1 !== mY1 || mX2 !== mY2) {\n calcSampleValues();\n }\n }\n\n var f = function f(aX) {\n if (!_precomputed) {\n precompute();\n }\n\n if (mX1 === mY1 && mX2 === mY2) {\n return aX;\n }\n\n if (aX === 0) {\n return 0;\n }\n\n if (aX === 1) {\n return 1;\n }\n\n return calcBezier(getTForX(aX), mY1, mY2);\n };\n\n f.getControlPoints = function () {\n return [{\n x: mX1,\n y: mY1\n }, {\n x: mX2,\n y: mY2\n }];\n };\n\n var str = \"generateBezier(\" + [mX1, mY1, mX2, mY2] + \")\";\n\n f.toString = function () {\n return str;\n };\n\n return f;\n}\n\n/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */\n\n/* Given a tension, friction, and duration, a simulation at 60FPS will first run without a defined duration in order to calculate the full path. A second pass\n then adjusts the time delta -- using the relation between actual time and duration -- to calculate the path for the duration-constrained animation. */\nvar generateSpringRK4 = function () {\n function springAccelerationForState(state) {\n return -state.tension * state.x - state.friction * state.v;\n }\n\n function springEvaluateStateWithDerivative(initialState, dt, derivative) {\n var state = {\n x: initialState.x + derivative.dx * dt,\n v: initialState.v + derivative.dv * dt,\n tension: initialState.tension,\n friction: initialState.friction\n };\n return {\n dx: state.v,\n dv: springAccelerationForState(state)\n };\n }\n\n function springIntegrateState(state, dt) {\n var a = {\n dx: state.v,\n dv: springAccelerationForState(state)\n },\n b = springEvaluateStateWithDerivative(state, dt * 0.5, a),\n c = springEvaluateStateWithDerivative(state, dt * 0.5, b),\n d = springEvaluateStateWithDerivative(state, dt, c),\n dxdt = 1.0 / 6.0 * (a.dx + 2.0 * (b.dx + c.dx) + d.dx),\n dvdt = 1.0 / 6.0 * (a.dv + 2.0 * (b.dv + c.dv) + d.dv);\n state.x = state.x + dxdt * dt;\n state.v = state.v + dvdt * dt;\n return state;\n }\n\n return function springRK4Factory(tension, friction, duration) {\n var initState = {\n x: -1,\n v: 0,\n tension: null,\n friction: null\n },\n path = [0],\n time_lapsed = 0,\n tolerance = 1 / 10000,\n DT = 16 / 1000,\n have_duration,\n dt,\n last_state;\n tension = parseFloat(tension) || 500;\n friction = parseFloat(friction) || 20;\n duration = duration || null;\n initState.tension = tension;\n initState.friction = friction;\n have_duration = duration !== null;\n /* Calculate the actual time it takes for this animation to complete with the provided conditions. */\n\n if (have_duration) {\n /* Run the simulation without a duration. */\n time_lapsed = springRK4Factory(tension, friction);\n /* Compute the adjusted time delta. */\n\n dt = time_lapsed / duration * DT;\n } else {\n dt = DT;\n }\n\n for (;;) {\n /* Next/step function .*/\n last_state = springIntegrateState(last_state || initState, dt);\n /* Store the position. */\n\n path.push(1 + last_state.x);\n time_lapsed += 16;\n /* If the change threshold is reached, break. */\n\n if (!(Math.abs(last_state.x) > tolerance && Math.abs(last_state.v) > tolerance)) {\n break;\n }\n }\n /* If duration is not defined, return the actual time required for completing this animation. Otherwise, return a closure that holds the\n computed path and returns a snapshot of the position according to a given percentComplete. */\n\n\n return !have_duration ? time_lapsed : function (percentComplete) {\n return path[percentComplete * (path.length - 1) | 0];\n };\n };\n}();\n\nvar cubicBezier = function cubicBezier(t1, p1, t2, p2) {\n var bezier = generateCubicBezier(t1, p1, t2, p2);\n return function (start, end, percent) {\n return start + (end - start) * bezier(percent);\n };\n};\n\nvar easings = {\n 'linear': function linear(start, end, percent) {\n return start + (end - start) * percent;\n },\n // default easings\n 'ease': cubicBezier(0.25, 0.1, 0.25, 1),\n 'ease-in': cubicBezier(0.42, 0, 1, 1),\n 'ease-out': cubicBezier(0, 0, 0.58, 1),\n 'ease-in-out': cubicBezier(0.42, 0, 0.58, 1),\n // sine\n 'ease-in-sine': cubicBezier(0.47, 0, 0.745, 0.715),\n 'ease-out-sine': cubicBezier(0.39, 0.575, 0.565, 1),\n 'ease-in-out-sine': cubicBezier(0.445, 0.05, 0.55, 0.95),\n // quad\n 'ease-in-quad': cubicBezier(0.55, 0.085, 0.68, 0.53),\n 'ease-out-quad': cubicBezier(0.25, 0.46, 0.45, 0.94),\n 'ease-in-out-quad': cubicBezier(0.455, 0.03, 0.515, 0.955),\n // cubic\n 'ease-in-cubic': cubicBezier(0.55, 0.055, 0.675, 0.19),\n 'ease-out-cubic': cubicBezier(0.215, 0.61, 0.355, 1),\n 'ease-in-out-cubic': cubicBezier(0.645, 0.045, 0.355, 1),\n // quart\n 'ease-in-quart': cubicBezier(0.895, 0.03, 0.685, 0.22),\n 'ease-out-quart': cubicBezier(0.165, 0.84, 0.44, 1),\n 'ease-in-out-quart': cubicBezier(0.77, 0, 0.175, 1),\n // quint\n 'ease-in-quint': cubicBezier(0.755, 0.05, 0.855, 0.06),\n 'ease-out-quint': cubicBezier(0.23, 1, 0.32, 1),\n 'ease-in-out-quint': cubicBezier(0.86, 0, 0.07, 1),\n // expo\n 'ease-in-expo': cubicBezier(0.95, 0.05, 0.795, 0.035),\n 'ease-out-expo': cubicBezier(0.19, 1, 0.22, 1),\n 'ease-in-out-expo': cubicBezier(1, 0, 0, 1),\n // circ\n 'ease-in-circ': cubicBezier(0.6, 0.04, 0.98, 0.335),\n 'ease-out-circ': cubicBezier(0.075, 0.82, 0.165, 1),\n 'ease-in-out-circ': cubicBezier(0.785, 0.135, 0.15, 0.86),\n // user param easings...\n 'spring': function spring(tension, friction, duration) {\n if (duration === 0) {\n // can't get a spring w/ duration 0\n return easings.linear; // duration 0 => jump to end so impl doesn't matter\n }\n\n var spring = generateSpringRK4(tension, friction, duration);\n return function (start, end, percent) {\n return start + (end - start) * spring(percent);\n };\n },\n 'cubic-bezier': cubicBezier\n};\n\nfunction getEasedValue(type, start, end, percent, easingFn) {\n if (percent === 1) {\n return end;\n }\n\n if (start === end) {\n return end;\n }\n\n var val = easingFn(start, end, percent);\n\n if (type == null) {\n return val;\n }\n\n if (type.roundValue || type.color) {\n val = Math.round(val);\n }\n\n if (type.min !== undefined) {\n val = Math.max(val, type.min);\n }\n\n if (type.max !== undefined) {\n val = Math.min(val, type.max);\n }\n\n return val;\n}\n\nfunction getValue(prop, spec) {\n if (prop.pfValue != null || prop.value != null) {\n if (prop.pfValue != null && (spec == null || spec.type.units !== '%')) {\n return prop.pfValue;\n } else {\n return prop.value;\n }\n } else {\n return prop;\n }\n}\n\nfunction ease(startProp, endProp, percent, easingFn, propSpec) {\n var type = propSpec != null ? propSpec.type : null;\n\n if (percent < 0) {\n percent = 0;\n } else if (percent > 1) {\n percent = 1;\n }\n\n var start = getValue(startProp, propSpec);\n var end = getValue(endProp, propSpec);\n\n if (number(start) && number(end)) {\n return getEasedValue(type, start, end, percent, easingFn);\n } else if (array(start) && array(end)) {\n var easedArr = [];\n\n for (var i = 0; i < end.length; i++) {\n var si = start[i];\n var ei = end[i];\n\n if (si != null && ei != null) {\n var val = getEasedValue(type, si, ei, percent, easingFn);\n easedArr.push(val);\n } else {\n easedArr.push(ei);\n }\n }\n\n return easedArr;\n }\n\n return undefined;\n}\n\nfunction step(self, ani, now, isCore) {\n var isEles = !isCore;\n var _p = self._private;\n var ani_p = ani._private;\n var pEasing = ani_p.easing;\n var startTime = ani_p.startTime;\n var cy = isCore ? self : self.cy();\n var style = cy.style();\n\n if (!ani_p.easingImpl) {\n if (pEasing == null) {\n // use default\n ani_p.easingImpl = easings['linear'];\n } else {\n // then define w/ name\n var easingVals;\n\n if (string(pEasing)) {\n var easingProp = style.parse('transition-timing-function', pEasing);\n easingVals = easingProp.value;\n } else {\n // then assume preparsed array\n easingVals = pEasing;\n }\n\n var name, args;\n\n if (string(easingVals)) {\n name = easingVals;\n args = [];\n } else {\n name = easingVals[1];\n args = easingVals.slice(2).map(function (n) {\n return +n;\n });\n }\n\n if (args.length > 0) {\n // create with args\n if (name === 'spring') {\n args.push(ani_p.duration); // need duration to generate spring\n }\n\n ani_p.easingImpl = easings[name].apply(null, args);\n } else {\n // static impl by name\n ani_p.easingImpl = easings[name];\n }\n }\n }\n\n var easing = ani_p.easingImpl;\n var percent;\n\n if (ani_p.duration === 0) {\n percent = 1;\n } else {\n percent = (now - startTime) / ani_p.duration;\n }\n\n if (ani_p.applying) {\n percent = ani_p.progress;\n }\n\n if (percent < 0) {\n percent = 0;\n } else if (percent > 1) {\n percent = 1;\n }\n\n if (ani_p.delay == null) {\n // then update\n var startPos = ani_p.startPosition;\n var endPos = ani_p.position;\n\n if (endPos && isEles && !self.locked()) {\n var newPos = {};\n\n if (valid(startPos.x, endPos.x)) {\n newPos.x = ease(startPos.x, endPos.x, percent, easing);\n }\n\n if (valid(startPos.y, endPos.y)) {\n newPos.y = ease(startPos.y, endPos.y, percent, easing);\n }\n\n self.position(newPos);\n }\n\n var startPan = ani_p.startPan;\n var endPan = ani_p.pan;\n var pan = _p.pan;\n var animatingPan = endPan != null && isCore;\n\n if (animatingPan) {\n if (valid(startPan.x, endPan.x)) {\n pan.x = ease(startPan.x, endPan.x, percent, easing);\n }\n\n if (valid(startPan.y, endPan.y)) {\n pan.y = ease(startPan.y, endPan.y, percent, easing);\n }\n\n self.emit('pan');\n }\n\n var startZoom = ani_p.startZoom;\n var endZoom = ani_p.zoom;\n var animatingZoom = endZoom != null && isCore;\n\n if (animatingZoom) {\n if (valid(startZoom, endZoom)) {\n _p.zoom = bound(_p.minZoom, ease(startZoom, endZoom, percent, easing), _p.maxZoom);\n }\n\n self.emit('zoom');\n }\n\n if (animatingPan || animatingZoom) {\n self.emit('viewport');\n }\n\n var props = ani_p.style;\n\n if (props && props.length > 0 && isEles) {\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n var _name = prop.name;\n var end = prop;\n var start = ani_p.startStyle[_name];\n var propSpec = style.properties[start.name];\n var easedVal = ease(start, end, percent, easing, propSpec);\n style.overrideBypass(self, _name, easedVal);\n } // for props\n\n\n self.emit('style');\n } // if\n\n }\n\n ani_p.progress = percent;\n return percent;\n}\n\nfunction valid(start, end) {\n if (start == null || end == null) {\n return false;\n }\n\n if (number(start) && number(end)) {\n return true;\n } else if (start && end) {\n return true;\n }\n\n return false;\n}\n\nfunction startAnimation(self, ani, now, isCore) {\n var ani_p = ani._private;\n ani_p.started = true;\n ani_p.startTime = now - ani_p.progress * ani_p.duration;\n}\n\nfunction stepAll(now, cy) {\n var eles = cy._private.aniEles;\n var doneEles = [];\n\n function stepOne(ele, isCore) {\n var _p = ele._private;\n var current = _p.animation.current;\n var queue = _p.animation.queue;\n var ranAnis = false; // if nothing currently animating, get something from the queue\n\n if (current.length === 0) {\n var next = queue.shift();\n\n if (next) {\n current.push(next);\n }\n }\n\n var callbacks = function callbacks(_callbacks) {\n for (var j = _callbacks.length - 1; j >= 0; j--) {\n var cb = _callbacks[j];\n cb();\n }\n\n _callbacks.splice(0, _callbacks.length);\n }; // step and remove if done\n\n\n for (var i = current.length - 1; i >= 0; i--) {\n var ani = current[i];\n var ani_p = ani._private;\n\n if (ani_p.stopped) {\n current.splice(i, 1);\n ani_p.hooked = false;\n ani_p.playing = false;\n ani_p.started = false;\n callbacks(ani_p.frames);\n continue;\n }\n\n if (!ani_p.playing && !ani_p.applying) {\n continue;\n } // an apply() while playing shouldn't do anything\n\n\n if (ani_p.playing && ani_p.applying) {\n ani_p.applying = false;\n }\n\n if (!ani_p.started) {\n startAnimation(ele, ani, now);\n }\n\n step(ele, ani, now, isCore);\n\n if (ani_p.applying) {\n ani_p.applying = false;\n }\n\n callbacks(ani_p.frames);\n\n if (ani_p.step != null) {\n ani_p.step(now);\n }\n\n if (ani.completed()) {\n current.splice(i, 1);\n ani_p.hooked = false;\n ani_p.playing = false;\n ani_p.started = false;\n callbacks(ani_p.completes);\n }\n\n ranAnis = true;\n }\n\n if (!isCore && current.length === 0 && queue.length === 0) {\n doneEles.push(ele);\n }\n\n return ranAnis;\n } // stepElement\n // handle all eles\n\n\n var ranEleAni = false;\n\n for (var e = 0; e < eles.length; e++) {\n var ele = eles[e];\n var handledThisEle = stepOne(ele);\n ranEleAni = ranEleAni || handledThisEle;\n } // each element\n\n\n var ranCoreAni = stepOne(cy, true); // notify renderer\n\n if (ranEleAni || ranCoreAni) {\n if (eles.length > 0) {\n cy.notify('draw', eles);\n } else {\n cy.notify('draw');\n }\n } // remove elements from list of currently animating if its queues are empty\n\n\n eles.unmerge(doneEles);\n cy.emit('step');\n} // stepAll\n\nvar corefn$1 = {\n // pull in animation functions\n animate: define$3.animate(),\n animation: define$3.animation(),\n animated: define$3.animated(),\n clearQueue: define$3.clearQueue(),\n delay: define$3.delay(),\n delayAnimation: define$3.delayAnimation(),\n stop: define$3.stop(),\n addToAnimationPool: function addToAnimationPool(eles) {\n var cy = this;\n\n if (!cy.styleEnabled()) {\n return;\n } // save cycles when no style used\n\n\n cy._private.aniEles.merge(eles);\n },\n stopAnimationLoop: function stopAnimationLoop() {\n this._private.animationsRunning = false;\n },\n startAnimationLoop: function startAnimationLoop() {\n var cy = this;\n cy._private.animationsRunning = true;\n\n if (!cy.styleEnabled()) {\n return;\n } // save cycles when no style used\n // NB the animation loop will exec in headless environments if style enabled\n // and explicit cy.destroy() is necessary to stop the loop\n\n\n function headlessStep() {\n if (!cy._private.animationsRunning) {\n return;\n }\n\n requestAnimationFrame(function animationStep(now) {\n stepAll(now, cy);\n headlessStep();\n });\n }\n\n var renderer = cy.renderer();\n\n if (renderer && renderer.beforeRender) {\n // let the renderer schedule animations\n renderer.beforeRender(function rendererAnimationStep(willDraw, now) {\n stepAll(now, cy);\n }, renderer.beforeRenderPriorities.animations);\n } else {\n // manage the animation loop ourselves\n headlessStep(); // first call\n }\n }\n};\n\nvar emitterOptions$1 = {\n qualifierCompare: function qualifierCompare(selector1, selector2) {\n if (selector1 == null || selector2 == null) {\n return selector1 == null && selector2 == null;\n } else {\n return selector1.sameText(selector2);\n }\n },\n eventMatches: function eventMatches(cy, listener, eventObj) {\n var selector = listener.qualifier;\n\n if (selector != null) {\n return cy !== eventObj.target && element(eventObj.target) && selector.matches(eventObj.target);\n }\n\n return true;\n },\n addEventFields: function addEventFields(cy, evt) {\n evt.cy = cy;\n evt.target = cy;\n },\n callbackContext: function callbackContext(cy, listener, eventObj) {\n return listener.qualifier != null ? eventObj.target : cy;\n }\n};\n\nvar argSelector$1 = function argSelector(arg) {\n if (string(arg)) {\n return new Selector(arg);\n } else {\n return arg;\n }\n};\n\nvar elesfn$v = {\n createEmitter: function createEmitter() {\n var _p = this._private;\n\n if (!_p.emitter) {\n _p.emitter = new Emitter(emitterOptions$1, this);\n }\n\n return this;\n },\n emitter: function emitter() {\n return this._private.emitter;\n },\n on: function on(events, selector, callback) {\n this.emitter().on(events, argSelector$1(selector), callback);\n return this;\n },\n removeListener: function removeListener(events, selector, callback) {\n this.emitter().removeListener(events, argSelector$1(selector), callback);\n return this;\n },\n removeAllListeners: function removeAllListeners() {\n this.emitter().removeAllListeners();\n return this;\n },\n one: function one(events, selector, callback) {\n this.emitter().one(events, argSelector$1(selector), callback);\n return this;\n },\n once: function once(events, selector, callback) {\n this.emitter().one(events, argSelector$1(selector), callback);\n return this;\n },\n emit: function emit(events, extraParams) {\n this.emitter().emit(events, extraParams);\n return this;\n },\n emitAndNotify: function emitAndNotify(event, eles) {\n this.emit(event);\n this.notify(event, eles);\n return this;\n }\n};\ndefine$3.eventAliasesOn(elesfn$v);\n\nvar corefn$2 = {\n png: function png(options) {\n var renderer = this._private.renderer;\n options = options || {};\n return renderer.png(options);\n },\n jpg: function jpg(options) {\n var renderer = this._private.renderer;\n options = options || {};\n options.bg = options.bg || '#fff';\n return renderer.jpg(options);\n }\n};\ncorefn$2.jpeg = corefn$2.jpg;\n\nvar corefn$3 = {\n layout: function layout(options) {\n var cy = this;\n\n if (options == null) {\n error('Layout options must be specified to make a layout');\n return;\n }\n\n if (options.name == null) {\n error('A `name` must be specified to make a layout');\n return;\n }\n\n var name = options.name;\n var Layout = cy.extension('layout', name);\n\n if (Layout == null) {\n error('No such layout `' + name + '` found. Did you forget to import it and `cytoscape.use()` it?');\n return;\n }\n\n var eles;\n\n if (string(options.eles)) {\n eles = cy.$(options.eles);\n } else {\n eles = options.eles != null ? options.eles : cy.$();\n }\n\n var layout = new Layout(extend({}, options, {\n cy: cy,\n eles: eles\n }));\n return layout;\n }\n};\ncorefn$3.createLayout = corefn$3.makeLayout = corefn$3.layout;\n\nvar corefn$4 = {\n notify: function notify(eventName, eventEles) {\n var _p = this._private;\n\n if (this.batching()) {\n _p.batchNotifications = _p.batchNotifications || {};\n var eles = _p.batchNotifications[eventName] = _p.batchNotifications[eventName] || this.collection();\n\n if (eventEles != null) {\n eles.merge(eventEles);\n }\n\n return; // notifications are disabled during batching\n }\n\n if (!_p.notificationsEnabled) {\n return;\n } // exit on disabled\n\n\n var renderer = this.renderer(); // exit if destroy() called on core or renderer in between frames #1499 #1528\n\n if (this.destroyed() || !renderer) {\n return;\n }\n\n renderer.notify(eventName, eventEles);\n },\n notifications: function notifications(bool) {\n var p = this._private;\n\n if (bool === undefined) {\n return p.notificationsEnabled;\n } else {\n p.notificationsEnabled = bool ? true : false;\n }\n\n return this;\n },\n noNotifications: function noNotifications(callback) {\n this.notifications(false);\n callback();\n this.notifications(true);\n },\n batching: function batching() {\n return this._private.batchCount > 0;\n },\n startBatch: function startBatch() {\n var _p = this._private;\n\n if (_p.batchCount == null) {\n _p.batchCount = 0;\n }\n\n if (_p.batchCount === 0) {\n _p.batchStyleEles = this.collection();\n _p.batchNotifications = {};\n }\n\n _p.batchCount++;\n return this;\n },\n endBatch: function endBatch() {\n var _p = this._private;\n\n if (_p.batchCount === 0) {\n return this;\n }\n\n _p.batchCount--;\n\n if (_p.batchCount === 0) {\n // update style for dirty eles\n _p.batchStyleEles.updateStyle();\n\n var renderer = this.renderer(); // notify the renderer of queued eles and event types\n\n Object.keys(_p.batchNotifications).forEach(function (eventName) {\n var eles = _p.batchNotifications[eventName];\n\n if (eles.empty()) {\n renderer.notify(eventName);\n } else {\n renderer.notify(eventName, eles);\n }\n });\n }\n\n return this;\n },\n batch: function batch(callback) {\n this.startBatch();\n callback();\n this.endBatch();\n return this;\n },\n // for backwards compatibility\n batchData: function batchData(map) {\n var cy = this;\n return this.batch(function () {\n var ids = Object.keys(map);\n\n for (var i = 0; i < ids.length; i++) {\n var id = ids[i];\n var data = map[id];\n var ele = cy.getElementById(id);\n ele.data(data);\n }\n });\n }\n};\n\nvar rendererDefaults = defaults({\n hideEdgesOnViewport: false,\n textureOnViewport: false,\n motionBlur: false,\n motionBlurOpacity: 0.05,\n pixelRatio: undefined,\n desktopTapThreshold: 4,\n touchTapThreshold: 8,\n wheelSensitivity: 1,\n debug: false,\n showFps: false\n});\nvar corefn$5 = {\n renderTo: function renderTo(context, zoom, pan, pxRatio) {\n var r = this._private.renderer;\n r.renderTo(context, zoom, pan, pxRatio);\n return this;\n },\n renderer: function renderer() {\n return this._private.renderer;\n },\n forceRender: function forceRender() {\n this.notify('draw');\n return this;\n },\n resize: function resize() {\n this.invalidateSize();\n this.emitAndNotify('resize');\n return this;\n },\n initRenderer: function initRenderer(options) {\n var cy = this;\n var RendererProto = cy.extension('renderer', options.name);\n\n if (RendererProto == null) {\n error(\"Can not initialise: No such renderer `\".concat(options.name, \"` found. Did you forget to import it and `cytoscape.use()` it?\"));\n return;\n }\n\n if (options.wheelSensitivity !== undefined) {\n warn(\"You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.\");\n }\n\n var rOpts = rendererDefaults(options);\n rOpts.cy = cy;\n cy._private.renderer = new RendererProto(rOpts);\n this.notify('init');\n },\n destroyRenderer: function destroyRenderer() {\n var cy = this;\n cy.notify('destroy'); // destroy the renderer\n\n var domEle = cy.container();\n\n if (domEle) {\n domEle._cyreg = null;\n\n while (domEle.childNodes.length > 0) {\n domEle.removeChild(domEle.childNodes[0]);\n }\n }\n\n cy._private.renderer = null; // to be extra safe, remove the ref\n\n cy.mutableElements().forEach(function (ele) {\n var _p = ele._private;\n _p.rscratch = {};\n _p.rstyle = {};\n _p.animation.current = [];\n _p.animation.queue = [];\n });\n },\n onRender: function onRender(fn) {\n return this.on('render', fn);\n },\n offRender: function offRender(fn) {\n return this.off('render', fn);\n }\n};\ncorefn$5.invalidateDimensions = corefn$5.resize;\n\nvar corefn$6 = {\n // get a collection\n // - empty collection on no args\n // - collection of elements in the graph on selector arg\n // - guarantee a returned collection when elements or collection specified\n collection: function collection(eles, opts) {\n if (string(eles)) {\n return this.$(eles);\n } else if (elementOrCollection(eles)) {\n return eles.collection();\n } else if (array(eles)) {\n return new Collection(this, eles, opts);\n }\n\n return new Collection(this);\n },\n nodes: function nodes(selector) {\n var nodes = this.$(function (ele) {\n return ele.isNode();\n });\n\n if (selector) {\n return nodes.filter(selector);\n }\n\n return nodes;\n },\n edges: function edges(selector) {\n var edges = this.$(function (ele) {\n return ele.isEdge();\n });\n\n if (selector) {\n return edges.filter(selector);\n }\n\n return edges;\n },\n // search the graph like jQuery\n $: function $(selector) {\n var eles = this._private.elements;\n\n if (selector) {\n return eles.filter(selector);\n } else {\n return eles.spawnSelf();\n }\n },\n mutableElements: function mutableElements() {\n return this._private.elements;\n }\n}; // aliases\n\ncorefn$6.elements = corefn$6.filter = corefn$6.$;\n\nvar styfn = {}; // keys for style blocks, e.g. ttfftt\n\nvar TRUE = 't';\nvar FALSE = 'f'; // (potentially expensive calculation)\n// apply the style to the element based on\n// - its bypass\n// - what selectors match it\n\nstyfn.apply = function (eles) {\n var self = this;\n var _p = self._private;\n var cy = _p.cy;\n var updatedEles = cy.collection();\n\n if (_p.newStyle) {\n // clear style caches\n _p.contextStyles = {};\n _p.propDiffs = {};\n self.cleanElements(eles, true);\n }\n\n for (var ie = 0; ie < eles.length; ie++) {\n var ele = eles[ie];\n var cxtMeta = self.getContextMeta(ele);\n\n if (cxtMeta.empty) {\n continue;\n }\n\n var cxtStyle = self.getContextStyle(cxtMeta);\n var app = self.applyContextStyle(cxtMeta, cxtStyle, ele);\n\n if (!_p.newStyle) {\n self.updateTransitions(ele, app.diffProps);\n }\n\n var hintsDiff = self.updateStyleHints(ele);\n\n if (hintsDiff) {\n updatedEles.merge(ele);\n }\n } // for elements\n\n\n _p.newStyle = false;\n return updatedEles;\n};\n\nstyfn.getPropertiesDiff = function (oldCxtKey, newCxtKey) {\n var self = this;\n var cache = self._private.propDiffs = self._private.propDiffs || {};\n var dualCxtKey = oldCxtKey + '-' + newCxtKey;\n var cachedVal = cache[dualCxtKey];\n\n if (cachedVal) {\n return cachedVal;\n }\n\n var diffProps = [];\n var addedProp = {};\n\n for (var i = 0; i < self.length; i++) {\n var cxt = self[i];\n var oldHasCxt = oldCxtKey[i] === TRUE;\n var newHasCxt = newCxtKey[i] === TRUE;\n var cxtHasDiffed = oldHasCxt !== newHasCxt;\n var cxtHasMappedProps = cxt.mappedProperties.length > 0;\n\n if (cxtHasDiffed || newHasCxt && cxtHasMappedProps) {\n var props = void 0;\n\n if (cxtHasDiffed && cxtHasMappedProps) {\n props = cxt.properties; // suffices b/c mappedProperties is a subset of properties\n } else if (cxtHasDiffed) {\n props = cxt.properties; // need to check them all\n } else if (cxtHasMappedProps) {\n props = cxt.mappedProperties; // only need to check mapped\n }\n\n for (var j = 0; j < props.length; j++) {\n var prop = props[j];\n var name = prop.name; // if a later context overrides this property, then the fact that this context has switched/diffed doesn't matter\n // (semi expensive check since it makes this function O(n^2) on context length, but worth it since overall result\n // is cached)\n\n var laterCxtOverrides = false;\n\n for (var k = i + 1; k < self.length; k++) {\n var laterCxt = self[k];\n var hasLaterCxt = newCxtKey[k] === TRUE;\n\n if (!hasLaterCxt) {\n continue;\n } // can't override unless the context is active\n\n\n laterCxtOverrides = laterCxt.properties[prop.name] != null;\n\n if (laterCxtOverrides) {\n break;\n } // exit early as long as one later context overrides\n\n }\n\n if (!addedProp[name] && !laterCxtOverrides) {\n addedProp[name] = true;\n diffProps.push(name);\n }\n } // for props\n\n } // if\n\n } // for contexts\n\n\n cache[dualCxtKey] = diffProps;\n return diffProps;\n};\n\nstyfn.getContextMeta = function (ele) {\n var self = this;\n var cxtKey = '';\n var diffProps;\n var prevKey = ele._private.styleCxtKey || '';\n\n if (self._private.newStyle) {\n prevKey = ''; // since we need to apply all style if a fresh stylesheet\n } // get the cxt key\n\n\n for (var i = 0; i < self.length; i++) {\n var context = self[i];\n var contextSelectorMatches = context.selector && context.selector.matches(ele); // NB: context.selector may be null for 'core'\n\n if (contextSelectorMatches) {\n cxtKey += TRUE;\n } else {\n cxtKey += FALSE;\n }\n } // for context\n\n\n diffProps = self.getPropertiesDiff(prevKey, cxtKey);\n ele._private.styleCxtKey = cxtKey;\n return {\n key: cxtKey,\n diffPropNames: diffProps,\n empty: diffProps.length === 0\n };\n}; // gets a computed ele style object based on matched contexts\n\n\nstyfn.getContextStyle = function (cxtMeta) {\n var cxtKey = cxtMeta.key;\n var self = this;\n var cxtStyles = this._private.contextStyles = this._private.contextStyles || {}; // if already computed style, returned cached copy\n\n if (cxtStyles[cxtKey]) {\n return cxtStyles[cxtKey];\n }\n\n var style = {\n _private: {\n key: cxtKey\n }\n };\n\n for (var i = 0; i < self.length; i++) {\n var cxt = self[i];\n var hasCxt = cxtKey[i] === TRUE;\n\n if (!hasCxt) {\n continue;\n }\n\n for (var j = 0; j < cxt.properties.length; j++) {\n var prop = cxt.properties[j];\n style[prop.name] = prop;\n }\n }\n\n cxtStyles[cxtKey] = style;\n return style;\n};\n\nstyfn.applyContextStyle = function (cxtMeta, cxtStyle, ele) {\n var self = this;\n var diffProps = cxtMeta.diffPropNames;\n var retDiffProps = {};\n var types = self.types;\n\n for (var i = 0; i < diffProps.length; i++) {\n var diffPropName = diffProps[i];\n var cxtProp = cxtStyle[diffPropName];\n var eleProp = ele.pstyle(diffPropName);\n\n if (!cxtProp) {\n // no context prop means delete\n if (!eleProp) {\n continue; // no existing prop means nothing needs to be removed\n // nb affects initial application on mapped values like control-point-distances\n } else if (eleProp.bypass) {\n cxtProp = {\n name: diffPropName,\n deleteBypassed: true\n };\n } else {\n cxtProp = {\n name: diffPropName,\n \"delete\": true\n };\n }\n } // save cycles when the context prop doesn't need to be applied\n\n\n if (eleProp === cxtProp) {\n continue;\n } // save cycles when a mapped context prop doesn't need to be applied\n\n\n if (cxtProp.mapped === types.fn // context prop is function mapper\n && eleProp != null // some props can be null even by default (e.g. a prop that overrides another one)\n && eleProp.mapping != null // ele prop is a concrete value from from a mapper\n && eleProp.mapping.value === cxtProp.value // the current prop on the ele is a flat prop value for the function mapper\n ) {\n // NB don't write to cxtProp, as it's shared among eles (stored in stylesheet)\n var mapping = eleProp.mapping; // can write to mapping, as it's a per-ele copy\n\n var fnValue = mapping.fnValue = cxtProp.value(ele); // temporarily cache the value in case of a miss\n\n if (fnValue === mapping.prevFnValue) {\n continue;\n }\n }\n\n var retDiffProp = retDiffProps[diffPropName] = {\n prev: eleProp\n };\n self.applyParsedProperty(ele, cxtProp);\n retDiffProp.next = ele.pstyle(diffPropName);\n\n if (retDiffProp.next && retDiffProp.next.bypass) {\n retDiffProp.next = retDiffProp.next.bypassed;\n }\n }\n\n return {\n diffProps: retDiffProps\n };\n};\n\nstyfn.updateStyleHints = function (ele) {\n var _p = ele._private;\n var self = this;\n var propNames = self.propertyGroupNames;\n var propGrKeys = self.propertyGroupKeys;\n\n var propHash = function propHash(ele, propNames, seedKey) {\n return self.getPropertiesHash(ele, propNames, seedKey);\n };\n\n var oldStyleKey = _p.styleKey;\n\n if (ele.removed()) {\n return false;\n }\n\n var isNode = _p.group === 'nodes'; // get the style key hashes per prop group\n // but lazily -- only use non-default prop values to reduce the number of hashes\n //\n\n var overriddenStyles = ele._private.style;\n propNames = Object.keys(overriddenStyles);\n\n for (var i = 0; i < propGrKeys.length; i++) {\n var grKey = propGrKeys[i];\n _p.styleKeys[grKey] = [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT];\n }\n\n var updateGrKey1 = function updateGrKey1(val, grKey) {\n return _p.styleKeys[grKey][0] = hashInt(val, _p.styleKeys[grKey][0]);\n };\n\n var updateGrKey2 = function updateGrKey2(val, grKey) {\n return _p.styleKeys[grKey][1] = hashIntAlt(val, _p.styleKeys[grKey][1]);\n };\n\n var updateGrKey = function updateGrKey(val, grKey) {\n updateGrKey1(val, grKey);\n updateGrKey2(val, grKey);\n };\n\n var updateGrKeyWStr = function updateGrKeyWStr(strVal, grKey) {\n for (var j = 0; j < strVal.length; j++) {\n var ch = strVal.charCodeAt(j);\n updateGrKey1(ch, grKey);\n updateGrKey2(ch, grKey);\n }\n }; // - hashing works on 32 bit ints b/c we use bitwise ops\n // - small numbers get cut off (e.g. 0.123 is seen as 0 by the hashing function)\n // - raise up small numbers so more significant digits are seen by hashing\n // - make small numbers larger than a normal value to avoid collisions\n // - works in practice and it's relatively cheap\n\n\n var N = 2000000000;\n\n var cleanNum = function cleanNum(val) {\n return -128 < val && val < 128 && Math.floor(val) !== val ? N - (val * 1024 | 0) : val;\n };\n\n for (var _i = 0; _i < propNames.length; _i++) {\n var name = propNames[_i];\n var parsedProp = overriddenStyles[name];\n\n if (parsedProp == null) {\n continue;\n }\n\n var propInfo = this.properties[name];\n var type = propInfo.type;\n var _grKey = propInfo.groupKey;\n var normalizedNumberVal = void 0;\n\n if (propInfo.hashOverride != null) {\n normalizedNumberVal = propInfo.hashOverride(ele, parsedProp);\n } else if (parsedProp.pfValue != null) {\n normalizedNumberVal = parsedProp.pfValue;\n } // might not be a number if it allows enums\n\n\n var numberVal = propInfo.enums == null ? parsedProp.value : null;\n var haveNormNum = normalizedNumberVal != null;\n var haveUnitedNum = numberVal != null;\n var haveNum = haveNormNum || haveUnitedNum;\n var units = parsedProp.units; // numbers are cheaper to hash than strings\n // 1 hash op vs n hash ops (for length n string)\n\n if (type.number && haveNum) {\n var v = haveNormNum ? normalizedNumberVal : numberVal;\n\n if (type.multiple) {\n for (var _i2 = 0; _i2 < v.length; _i2++) {\n updateGrKey(cleanNum(v[_i2]), _grKey);\n }\n } else {\n updateGrKey(cleanNum(v), _grKey);\n }\n\n if (!haveNormNum && units != null) {\n updateGrKeyWStr(units, _grKey);\n }\n } else {\n updateGrKeyWStr(parsedProp.strValue, _grKey);\n }\n } // overall style key\n //\n\n\n var hash = [DEFAULT_HASH_SEED, DEFAULT_HASH_SEED_ALT];\n\n for (var _i3 = 0; _i3 < propGrKeys.length; _i3++) {\n var _grKey2 = propGrKeys[_i3];\n var grHash = _p.styleKeys[_grKey2];\n hash[0] = hashInt(grHash[0], hash[0]);\n hash[1] = hashIntAlt(grHash[1], hash[1]);\n }\n\n _p.styleKey = combineHashes(hash[0], hash[1]); // label dims\n //\n\n var sk = _p.styleKeys;\n _p.labelDimsKey = combineHashesArray(sk.labelDimensions);\n var labelKeys = propHash(ele, ['label'], sk.labelDimensions);\n _p.labelKey = combineHashesArray(labelKeys);\n _p.labelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, labelKeys));\n\n if (!isNode) {\n var sourceLabelKeys = propHash(ele, ['source-label'], sk.labelDimensions);\n _p.sourceLabelKey = combineHashesArray(sourceLabelKeys);\n _p.sourceLabelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, sourceLabelKeys));\n var targetLabelKeys = propHash(ele, ['target-label'], sk.labelDimensions);\n _p.targetLabelKey = combineHashesArray(targetLabelKeys);\n _p.targetLabelStyleKey = combineHashesArray(hashArrays(sk.commonLabel, targetLabelKeys));\n } // node\n //\n\n\n if (isNode) {\n var _p$styleKeys = _p.styleKeys,\n nodeBody = _p$styleKeys.nodeBody,\n nodeBorder = _p$styleKeys.nodeBorder,\n backgroundImage = _p$styleKeys.backgroundImage,\n compound = _p$styleKeys.compound,\n pie = _p$styleKeys.pie;\n var nodeKeys = [nodeBorder, backgroundImage, compound, pie].reduce(hashArrays, nodeBody);\n _p.nodeKey = combineHashesArray(nodeKeys);\n _p.hasPie = pie[0] !== DEFAULT_HASH_SEED && pie[1] !== DEFAULT_HASH_SEED_ALT;\n }\n\n return oldStyleKey !== _p.styleKey;\n};\n\nstyfn.clearStyleHints = function (ele) {\n var _p = ele._private;\n _p.styleKeys = {};\n _p.styleKey = null;\n _p.labelKey = null;\n _p.labelStyleKey = null;\n _p.sourceLabelKey = null;\n _p.sourceLabelStyleKey = null;\n _p.targetLabelKey = null;\n _p.targetLabelStyleKey = null;\n _p.nodeKey = null;\n _p.hasPie = null;\n}; // apply a property to the style (for internal use)\n// returns whether application was successful\n//\n// now, this function flattens the property, and here's how:\n//\n// for parsedProp:{ bypass: true, deleteBypass: true }\n// no property is generated, instead the bypass property in the\n// element's style is replaced by what's pointed to by the `bypassed`\n// field in the bypass property (i.e. restoring the property the\n// bypass was overriding)\n//\n// for parsedProp:{ mapped: truthy }\n// the generated flattenedProp:{ mapping: prop }\n//\n// for parsedProp:{ bypass: true }\n// the generated flattenedProp:{ bypassed: parsedProp }\n\n\nstyfn.applyParsedProperty = function (ele, parsedProp) {\n var self = this;\n var prop = parsedProp;\n var style = ele._private.style;\n var flatProp;\n var types = self.types;\n var type = self.properties[prop.name].type;\n var propIsBypass = prop.bypass;\n var origProp = style[prop.name];\n var origPropIsBypass = origProp && origProp.bypass;\n var _p = ele._private;\n var flatPropMapping = 'mapping';\n\n var getVal = function getVal(p) {\n if (p == null) {\n return null;\n } else if (p.pfValue != null) {\n return p.pfValue;\n } else {\n return p.value;\n }\n };\n\n var checkTriggers = function checkTriggers() {\n var fromVal = getVal(origProp);\n var toVal = getVal(prop);\n self.checkTriggers(ele, prop.name, fromVal, toVal);\n }; // edge sanity checks to prevent the client from making serious mistakes\n\n\n if (parsedProp.name === 'curve-style' && ele.isEdge() && ( // loops must be bundled beziers\n parsedProp.value !== 'bezier' && ele.isLoop() || // edges connected to compound nodes can not be haystacks\n parsedProp.value === 'haystack' && (ele.source().isParent() || ele.target().isParent()))) {\n prop = parsedProp = this.parse(parsedProp.name, 'bezier', propIsBypass);\n }\n\n if (prop[\"delete\"]) {\n // delete the property and use the default value on falsey value\n style[prop.name] = undefined;\n checkTriggers();\n return true;\n }\n\n if (prop.deleteBypassed) {\n // delete the property that the\n if (!origProp) {\n checkTriggers();\n return true; // can't delete if no prop\n } else if (origProp.bypass) {\n // delete bypassed\n origProp.bypassed = undefined;\n checkTriggers();\n return true;\n } else {\n return false; // we're unsuccessful deleting the bypassed\n }\n } // check if we need to delete the current bypass\n\n\n if (prop.deleteBypass) {\n // then this property is just here to indicate we need to delete\n if (!origProp) {\n checkTriggers();\n return true; // property is already not defined\n } else if (origProp.bypass) {\n // then replace the bypass property with the original\n // because the bypassed property was already applied (and therefore parsed), we can just replace it (no reapplying necessary)\n style[prop.name] = origProp.bypassed;\n checkTriggers();\n return true;\n } else {\n return false; // we're unsuccessful deleting the bypass\n }\n }\n\n var printMappingErr = function printMappingErr() {\n warn('Do not assign mappings to elements without corresponding data (i.e. ele `' + ele.id() + '` has no mapping for property `' + prop.name + '` with data field `' + prop.field + '`); try a `[' + prop.field + ']` selector to limit scope to elements with `' + prop.field + '` defined');\n }; // put the property in the style objects\n\n\n switch (prop.mapped) {\n // flatten the property if mapped\n case types.mapData:\n {\n // flatten the field (e.g. data.foo.bar)\n var fields = prop.field.split('.');\n var fieldVal = _p.data;\n\n for (var i = 0; i < fields.length && fieldVal; i++) {\n var field = fields[i];\n fieldVal = fieldVal[field];\n }\n\n if (fieldVal == null) {\n printMappingErr();\n return false;\n }\n\n var percent;\n\n if (!number(fieldVal)) {\n // then don't apply and fall back on the existing style\n warn('Do not use continuous mappers without specifying numeric data (i.e. `' + prop.field + ': ' + fieldVal + '` for `' + ele.id() + '` is non-numeric)');\n return false;\n } else {\n var fieldWidth = prop.fieldMax - prop.fieldMin;\n\n if (fieldWidth === 0) {\n // safety check -- not strictly necessary as no props of zero range should be passed here\n percent = 0;\n } else {\n percent = (fieldVal - prop.fieldMin) / fieldWidth;\n }\n } // make sure to bound percent value\n\n\n if (percent < 0) {\n percent = 0;\n } else if (percent > 1) {\n percent = 1;\n }\n\n if (type.color) {\n var r1 = prop.valueMin[0];\n var r2 = prop.valueMax[0];\n var g1 = prop.valueMin[1];\n var g2 = prop.valueMax[1];\n var b1 = prop.valueMin[2];\n var b2 = prop.valueMax[2];\n var a1 = prop.valueMin[3] == null ? 1 : prop.valueMin[3];\n var a2 = prop.valueMax[3] == null ? 1 : prop.valueMax[3];\n var clr = [Math.round(r1 + (r2 - r1) * percent), Math.round(g1 + (g2 - g1) * percent), Math.round(b1 + (b2 - b1) * percent), Math.round(a1 + (a2 - a1) * percent)];\n flatProp = {\n // colours are simple, so just create the flat property instead of expensive string parsing\n bypass: prop.bypass,\n // we're a bypass if the mapping property is a bypass\n name: prop.name,\n value: clr,\n strValue: 'rgb(' + clr[0] + ', ' + clr[1] + ', ' + clr[2] + ')'\n };\n } else if (type.number) {\n var calcValue = prop.valueMin + (prop.valueMax - prop.valueMin) * percent;\n flatProp = this.parse(prop.name, calcValue, prop.bypass, flatPropMapping);\n } else {\n return false; // can only map to colours and numbers\n }\n\n if (!flatProp) {\n // if we can't flatten the property, then don't apply the property and fall back on the existing style\n printMappingErr();\n return false;\n }\n\n flatProp.mapping = prop; // keep a reference to the mapping\n\n prop = flatProp; // the flattened (mapped) property is the one we want\n\n break;\n }\n // direct mapping\n\n case types.data:\n {\n // flatten the field (e.g. data.foo.bar)\n var _fields = prop.field.split('.');\n\n var _fieldVal = _p.data;\n\n for (var _i4 = 0; _i4 < _fields.length && _fieldVal; _i4++) {\n var _field = _fields[_i4];\n _fieldVal = _fieldVal[_field];\n }\n\n if (_fieldVal != null) {\n flatProp = this.parse(prop.name, _fieldVal, prop.bypass, flatPropMapping);\n }\n\n if (!flatProp) {\n // if we can't flatten the property, then don't apply and fall back on the existing style\n printMappingErr();\n return false;\n }\n\n flatProp.mapping = prop; // keep a reference to the mapping\n\n prop = flatProp; // the flattened (mapped) property is the one we want\n\n break;\n }\n\n case types.fn:\n {\n var fn = prop.value;\n var fnRetVal = prop.fnValue != null ? prop.fnValue : fn(ele); // check for cached value before calling function\n\n prop.prevFnValue = fnRetVal;\n\n if (fnRetVal == null) {\n warn('Custom function mappers may not return null (i.e. `' + prop.name + '` for ele `' + ele.id() + '` is null)');\n return false;\n }\n\n flatProp = this.parse(prop.name, fnRetVal, prop.bypass, flatPropMapping);\n\n if (!flatProp) {\n warn('Custom function mappers may not return invalid values for the property type (i.e. `' + prop.name + '` for ele `' + ele.id() + '` is invalid)');\n return false;\n }\n\n flatProp.mapping = copy(prop); // keep a reference to the mapping\n\n prop = flatProp; // the flattened (mapped) property is the one we want\n\n break;\n }\n\n case undefined:\n break;\n // just set the property\n\n default:\n return false;\n // not a valid mapping\n } // if the property is a bypass property, then link the resultant property to the original one\n\n\n if (propIsBypass) {\n if (origPropIsBypass) {\n // then this bypass overrides the existing one\n prop.bypassed = origProp.bypassed; // steal bypassed prop from old bypass\n } else {\n // then link the orig prop to the new bypass\n prop.bypassed = origProp;\n }\n\n style[prop.name] = prop; // and set\n } else {\n // prop is not bypass\n if (origPropIsBypass) {\n // then keep the orig prop (since it's a bypass) and link to the new prop\n origProp.bypassed = prop;\n } else {\n // then just replace the old prop with the new one\n style[prop.name] = prop;\n }\n }\n\n checkTriggers();\n return true;\n};\n\nstyfn.cleanElements = function (eles, keepBypasses) {\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n this.clearStyleHints(ele);\n ele.dirtyCompoundBoundsCache();\n ele.dirtyBoundingBoxCache();\n\n if (!keepBypasses) {\n ele._private.style = {};\n } else {\n var style = ele._private.style;\n var propNames = Object.keys(style);\n\n for (var j = 0; j < propNames.length; j++) {\n var propName = propNames[j];\n var eleProp = style[propName];\n\n if (eleProp != null) {\n if (eleProp.bypass) {\n eleProp.bypassed = null;\n } else {\n style[propName] = null;\n }\n }\n }\n }\n }\n}; // updates the visual style for all elements (useful for manual style modification after init)\n\n\nstyfn.update = function () {\n var cy = this._private.cy;\n var eles = cy.mutableElements();\n eles.updateStyle();\n}; // diffProps : { name => { prev, next } }\n\n\nstyfn.updateTransitions = function (ele, diffProps) {\n var self = this;\n var _p = ele._private;\n var props = ele.pstyle('transition-property').value;\n var duration = ele.pstyle('transition-duration').pfValue;\n var delay = ele.pstyle('transition-delay').pfValue;\n\n if (props.length > 0 && duration > 0) {\n var style = {}; // build up the style to animate towards\n\n var anyPrev = false;\n\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n var styProp = ele.pstyle(prop);\n var diffProp = diffProps[prop];\n\n if (!diffProp) {\n continue;\n }\n\n var prevProp = diffProp.prev;\n var fromProp = prevProp;\n var toProp = diffProp.next != null ? diffProp.next : styProp;\n var diff = false;\n var initVal = void 0;\n var initDt = 0.000001; // delta time % value for initVal (allows animating out of init zero opacity)\n\n if (!fromProp) {\n continue;\n } // consider px values\n\n\n if (number(fromProp.pfValue) && number(toProp.pfValue)) {\n diff = toProp.pfValue - fromProp.pfValue; // nonzero is truthy\n\n initVal = fromProp.pfValue + initDt * diff; // consider numerical values\n } else if (number(fromProp.value) && number(toProp.value)) {\n diff = toProp.value - fromProp.value; // nonzero is truthy\n\n initVal = fromProp.value + initDt * diff; // consider colour values\n } else if (array(fromProp.value) && array(toProp.value)) {\n diff = fromProp.value[0] !== toProp.value[0] || fromProp.value[1] !== toProp.value[1] || fromProp.value[2] !== toProp.value[2];\n initVal = fromProp.strValue;\n } // the previous value is good for an animation only if it's different\n\n\n if (diff) {\n style[prop] = toProp.strValue; // to val\n\n this.applyBypass(ele, prop, initVal); // from val\n\n anyPrev = true;\n }\n } // end if props allow ani\n // can't transition if there's nothing previous to transition from\n\n\n if (!anyPrev) {\n return;\n }\n\n _p.transitioning = true;\n new Promise$1(function (resolve) {\n if (delay > 0) {\n ele.delayAnimation(delay).play().promise().then(resolve);\n } else {\n resolve();\n }\n }).then(function () {\n return ele.animation({\n style: style,\n duration: duration,\n easing: ele.pstyle('transition-timing-function').value,\n queue: false\n }).play().promise();\n }).then(function () {\n // if( !isBypass ){\n self.removeBypasses(ele, props);\n ele.emitAndNotify('style'); // }\n\n _p.transitioning = false;\n });\n } else if (_p.transitioning) {\n this.removeBypasses(ele, props);\n ele.emitAndNotify('style');\n _p.transitioning = false;\n }\n};\n\nstyfn.checkTrigger = function (ele, name, fromValue, toValue, getTrigger, onTrigger) {\n var prop = this.properties[name];\n var triggerCheck = getTrigger(prop);\n\n if (triggerCheck != null && triggerCheck(fromValue, toValue)) {\n onTrigger(prop);\n }\n};\n\nstyfn.checkZOrderTrigger = function (ele, name, fromValue, toValue) {\n var _this = this;\n\n this.checkTrigger(ele, name, fromValue, toValue, function (prop) {\n return prop.triggersZOrder;\n }, function () {\n _this._private.cy.notify('zorder', ele);\n });\n};\n\nstyfn.checkBoundsTrigger = function (ele, name, fromValue, toValue) {\n this.checkTrigger(ele, name, fromValue, toValue, function (prop) {\n return prop.triggersBounds;\n }, function (prop) {\n ele.dirtyCompoundBoundsCache();\n ele.dirtyBoundingBoxCache(); // if the prop change makes the bb of pll bezier edges invalid,\n // then dirty the pll edge bb cache as well\n\n if ( // only for beziers -- so performance of other edges isn't affected\n (ele.pstyle('curve-style').value === 'bezier' // already a bezier\n // was just now changed to or from a bezier:\n || name === 'curve-style' && (fromValue === 'bezier' || toValue === 'bezier')) && prop.triggersBoundsOfParallelBeziers) {\n ele.parallelEdges().forEach(function (pllEdge) {\n if (pllEdge.isBundledBezier()) {\n pllEdge.dirtyBoundingBoxCache();\n }\n });\n }\n });\n};\n\nstyfn.checkTriggers = function (ele, name, fromValue, toValue) {\n ele.dirtyStyleCache();\n this.checkZOrderTrigger(ele, name, fromValue, toValue);\n this.checkBoundsTrigger(ele, name, fromValue, toValue);\n};\n\nvar styfn$1 = {}; // bypasses are applied to an existing style on an element, and just tacked on temporarily\n// returns true iff application was successful for at least 1 specified property\n\nstyfn$1.applyBypass = function (eles, name, value, updateTransitions) {\n var self = this;\n var props = [];\n var isBypass = true; // put all the properties (can specify one or many) in an array after parsing them\n\n if (name === '*' || name === '**') {\n // apply to all property names\n if (value !== undefined) {\n for (var i = 0; i < self.properties.length; i++) {\n var prop = self.properties[i];\n var _name = prop.name;\n var parsedProp = this.parse(_name, value, true);\n\n if (parsedProp) {\n props.push(parsedProp);\n }\n }\n }\n } else if (string(name)) {\n // then parse the single property\n var _parsedProp = this.parse(name, value, true);\n\n if (_parsedProp) {\n props.push(_parsedProp);\n }\n } else if (plainObject(name)) {\n // then parse each property\n var specifiedProps = name;\n updateTransitions = value;\n var names = Object.keys(specifiedProps);\n\n for (var _i = 0; _i < names.length; _i++) {\n var _name2 = names[_i];\n var _value = specifiedProps[_name2];\n\n if (_value === undefined) {\n // try camel case name too\n _value = specifiedProps[dash2camel(_name2)];\n }\n\n if (_value !== undefined) {\n var _parsedProp2 = this.parse(_name2, _value, true);\n\n if (_parsedProp2) {\n props.push(_parsedProp2);\n }\n }\n }\n } else {\n // can't do anything without well defined properties\n return false;\n } // we've failed if there are no valid properties\n\n\n if (props.length === 0) {\n return false;\n } // now, apply the bypass properties on the elements\n\n\n var ret = false; // return true if at least one succesful bypass applied\n\n for (var _i2 = 0; _i2 < eles.length; _i2++) {\n // for each ele\n var ele = eles[_i2];\n var diffProps = {};\n var diffProp = void 0;\n\n for (var j = 0; j < props.length; j++) {\n // for each prop\n var _prop = props[j];\n\n if (updateTransitions) {\n var prevProp = ele.pstyle(_prop.name);\n diffProp = diffProps[_prop.name] = {\n prev: prevProp\n };\n }\n\n ret = this.applyParsedProperty(ele, _prop) || ret;\n\n if (updateTransitions) {\n diffProp.next = ele.pstyle(_prop.name);\n }\n } // for props\n\n\n if (ret) {\n this.updateStyleHints(ele);\n }\n\n if (updateTransitions) {\n this.updateTransitions(ele, diffProps, isBypass);\n }\n } // for eles\n\n\n return ret;\n}; // only useful in specific cases like animation\n\n\nstyfn$1.overrideBypass = function (eles, name, value) {\n name = camel2dash(name);\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var prop = ele._private.style[name];\n var type = this.properties[name].type;\n var isColor = type.color;\n var isMulti = type.mutiple;\n var oldValue = !prop ? null : prop.pfValue != null ? prop.pfValue : prop.value;\n\n if (!prop || !prop.bypass) {\n // need a bypass if one doesn't exist\n this.applyBypass(ele, name, value);\n } else {\n prop.value = value;\n\n if (prop.pfValue != null) {\n prop.pfValue = value;\n }\n\n if (isColor) {\n prop.strValue = 'rgb(' + value.join(',') + ')';\n } else if (isMulti) {\n prop.strValue = value.join(' ');\n } else {\n prop.strValue = '' + value;\n }\n\n this.updateStyleHints(ele);\n }\n\n this.checkTriggers(ele, name, oldValue, value);\n }\n};\n\nstyfn$1.removeAllBypasses = function (eles, updateTransitions) {\n return this.removeBypasses(eles, this.propertyNames, updateTransitions);\n};\n\nstyfn$1.removeBypasses = function (eles, props, updateTransitions) {\n var isBypass = true;\n\n for (var j = 0; j < eles.length; j++) {\n var ele = eles[j];\n var diffProps = {};\n\n for (var i = 0; i < props.length; i++) {\n var name = props[i];\n var prop = this.properties[name];\n var prevProp = ele.pstyle(prop.name);\n\n if (!prevProp || !prevProp.bypass) {\n // if a bypass doesn't exist for the prop, nothing needs to be removed\n continue;\n }\n\n var value = ''; // empty => remove bypass\n\n var parsedProp = this.parse(name, value, true);\n var diffProp = diffProps[prop.name] = {\n prev: prevProp\n };\n this.applyParsedProperty(ele, parsedProp);\n diffProp.next = ele.pstyle(prop.name);\n } // for props\n\n\n this.updateStyleHints(ele);\n\n if (updateTransitions) {\n this.updateTransitions(ele, diffProps, isBypass);\n }\n } // for eles\n\n};\n\nvar styfn$2 = {}; // gets what an em size corresponds to in pixels relative to a dom element\n\nstyfn$2.getEmSizeInPixels = function () {\n var px = this.containerCss('font-size');\n\n if (px != null) {\n return parseFloat(px);\n } else {\n return 1; // for headless\n }\n}; // gets css property from the core container\n\n\nstyfn$2.containerCss = function (propName) {\n var cy = this._private.cy;\n var domElement = cy.container();\n\n if (window$1 && domElement && window$1.getComputedStyle) {\n return window$1.getComputedStyle(domElement).getPropertyValue(propName);\n }\n};\n\nvar styfn$3 = {}; // gets the rendered style for an element\n\nstyfn$3.getRenderedStyle = function (ele, prop) {\n if (prop) {\n return this.getStylePropertyValue(ele, prop, true);\n } else {\n return this.getRawStyle(ele, true);\n }\n}; // gets the raw style for an element\n\n\nstyfn$3.getRawStyle = function (ele, isRenderedVal) {\n var self = this;\n ele = ele[0]; // insure it's an element\n\n if (ele) {\n var rstyle = {};\n\n for (var i = 0; i < self.properties.length; i++) {\n var prop = self.properties[i];\n var val = self.getStylePropertyValue(ele, prop.name, isRenderedVal);\n\n if (val != null) {\n rstyle[prop.name] = val;\n rstyle[dash2camel(prop.name)] = val;\n }\n }\n\n return rstyle;\n }\n};\n\nstyfn$3.getIndexedStyle = function (ele, property, subproperty, index) {\n var pstyle = ele.pstyle(property)[subproperty][index];\n return pstyle != null ? pstyle : ele.cy().style().getDefaultProperty(property)[subproperty][0];\n};\n\nstyfn$3.getStylePropertyValue = function (ele, propName, isRenderedVal) {\n var self = this;\n ele = ele[0]; // insure it's an element\n\n if (ele) {\n var prop = self.properties[propName];\n\n if (prop.alias) {\n prop = prop.pointsTo;\n }\n\n var type = prop.type;\n var styleProp = ele.pstyle(prop.name);\n\n if (styleProp) {\n var value = styleProp.value,\n units = styleProp.units,\n strValue = styleProp.strValue;\n\n if (isRenderedVal && type.number && value != null && number(value)) {\n var zoom = ele.cy().zoom();\n\n var getRenderedValue = function getRenderedValue(val) {\n return val * zoom;\n };\n\n var getValueStringWithUnits = function getValueStringWithUnits(val, units) {\n return getRenderedValue(val) + units;\n };\n\n var isArrayValue = array(value);\n var haveUnits = isArrayValue ? units.every(function (u) {\n return u != null;\n }) : units != null;\n\n if (haveUnits) {\n if (isArrayValue) {\n return value.map(function (v, i) {\n return getValueStringWithUnits(v, units[i]);\n }).join(' ');\n } else {\n return getValueStringWithUnits(value, units);\n }\n } else {\n if (isArrayValue) {\n return value.map(function (v) {\n return string(v) ? v : '' + getRenderedValue(v);\n }).join(' ');\n } else {\n return '' + getRenderedValue(value);\n }\n }\n } else if (strValue != null) {\n return strValue;\n }\n }\n\n return null;\n }\n};\n\nstyfn$3.getAnimationStartStyle = function (ele, aniProps) {\n var rstyle = {};\n\n for (var i = 0; i < aniProps.length; i++) {\n var aniProp = aniProps[i];\n var name = aniProp.name;\n var styleProp = ele.pstyle(name);\n\n if (styleProp !== undefined) {\n // then make a prop of it\n if (plainObject(styleProp)) {\n styleProp = this.parse(name, styleProp.strValue);\n } else {\n styleProp = this.parse(name, styleProp);\n }\n }\n\n if (styleProp) {\n rstyle[name] = styleProp;\n }\n }\n\n return rstyle;\n};\n\nstyfn$3.getPropsList = function (propsObj) {\n var self = this;\n var rstyle = [];\n var style = propsObj;\n var props = self.properties;\n\n if (style) {\n var names = Object.keys(style);\n\n for (var i = 0; i < names.length; i++) {\n var name = names[i];\n var val = style[name];\n var prop = props[name] || props[camel2dash(name)];\n var styleProp = this.parse(prop.name, val);\n\n if (styleProp) {\n rstyle.push(styleProp);\n }\n }\n }\n\n return rstyle;\n};\n\nstyfn$3.getNonDefaultPropertiesHash = function (ele, propNames, seed) {\n var hash = seed.slice();\n var name, val, strVal, chVal;\n var i, j;\n\n for (i = 0; i < propNames.length; i++) {\n name = propNames[i];\n val = ele.pstyle(name, false);\n\n if (val == null) {\n continue;\n } else if (val.pfValue != null) {\n hash[0] = hashInt(chVal, hash[0]);\n hash[1] = hashIntAlt(chVal, hash[1]);\n } else {\n strVal = val.strValue;\n\n for (j = 0; j < strVal.length; j++) {\n chVal = strVal.charCodeAt(j);\n hash[0] = hashInt(chVal, hash[0]);\n hash[1] = hashIntAlt(chVal, hash[1]);\n }\n }\n }\n\n return hash;\n};\n\nstyfn$3.getPropertiesHash = styfn$3.getNonDefaultPropertiesHash;\n\nvar styfn$4 = {};\n\nstyfn$4.appendFromJson = function (json) {\n var style = this;\n\n for (var i = 0; i < json.length; i++) {\n var context = json[i];\n var selector = context.selector;\n var props = context.style || context.css;\n var names = Object.keys(props);\n style.selector(selector); // apply selector\n\n for (var j = 0; j < names.length; j++) {\n var name = names[j];\n var value = props[name];\n style.css(name, value); // apply property\n }\n }\n\n return style;\n}; // accessible cy.style() function\n\n\nstyfn$4.fromJson = function (json) {\n var style = this;\n style.resetToDefault();\n style.appendFromJson(json);\n return style;\n}; // get json from cy.style() api\n\n\nstyfn$4.json = function () {\n var json = [];\n\n for (var i = this.defaultLength; i < this.length; i++) {\n var cxt = this[i];\n var selector = cxt.selector;\n var props = cxt.properties;\n var css = {};\n\n for (var j = 0; j < props.length; j++) {\n var prop = props[j];\n css[prop.name] = prop.strValue;\n }\n\n json.push({\n selector: !selector ? 'core' : selector.toString(),\n style: css\n });\n }\n\n return json;\n};\n\nvar styfn$5 = {};\n\nstyfn$5.appendFromString = function (string) {\n var self = this;\n var style = this;\n var remaining = '' + string;\n var selAndBlockStr;\n var blockRem;\n var propAndValStr; // remove comments from the style string\n\n remaining = remaining.replace(/[/][*](\\s|.)+?[*][/]/g, '');\n\n function removeSelAndBlockFromRemaining() {\n // remove the parsed selector and block from the remaining text to parse\n if (remaining.length > selAndBlockStr.length) {\n remaining = remaining.substr(selAndBlockStr.length);\n } else {\n remaining = '';\n }\n }\n\n function removePropAndValFromRem() {\n // remove the parsed property and value from the remaining block text to parse\n if (blockRem.length > propAndValStr.length) {\n blockRem = blockRem.substr(propAndValStr.length);\n } else {\n blockRem = '';\n }\n }\n\n for (;;) {\n var nothingLeftToParse = remaining.match(/^\\s*$/);\n\n if (nothingLeftToParse) {\n break;\n }\n\n var selAndBlock = remaining.match(/^\\s*((?:.|\\s)+?)\\s*\\{((?:.|\\s)+?)\\}/);\n\n if (!selAndBlock) {\n warn('Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: ' + remaining);\n break;\n }\n\n selAndBlockStr = selAndBlock[0]; // parse the selector\n\n var selectorStr = selAndBlock[1];\n\n if (selectorStr !== 'core') {\n var selector = new Selector(selectorStr);\n\n if (selector.invalid) {\n warn('Skipping parsing of block: Invalid selector found in string stylesheet: ' + selectorStr); // skip this selector and block\n\n removeSelAndBlockFromRemaining();\n continue;\n }\n } // parse the block of properties and values\n\n\n var blockStr = selAndBlock[2];\n var invalidBlock = false;\n blockRem = blockStr;\n var props = [];\n\n for (;;) {\n var _nothingLeftToParse = blockRem.match(/^\\s*$/);\n\n if (_nothingLeftToParse) {\n break;\n }\n\n var propAndVal = blockRem.match(/^\\s*(.+?)\\s*:\\s*(.+?)\\s*;/);\n\n if (!propAndVal) {\n warn('Skipping parsing of block: Invalid formatting of style property and value definitions found in:' + blockStr);\n invalidBlock = true;\n break;\n }\n\n propAndValStr = propAndVal[0];\n var propStr = propAndVal[1];\n var valStr = propAndVal[2];\n var prop = self.properties[propStr];\n\n if (!prop) {\n warn('Skipping property: Invalid property name in: ' + propAndValStr); // skip this property in the block\n\n removePropAndValFromRem();\n continue;\n }\n\n var parsedProp = style.parse(propStr, valStr);\n\n if (!parsedProp) {\n warn('Skipping property: Invalid property definition in: ' + propAndValStr); // skip this property in the block\n\n removePropAndValFromRem();\n continue;\n }\n\n props.push({\n name: propStr,\n val: valStr\n });\n removePropAndValFromRem();\n }\n\n if (invalidBlock) {\n removeSelAndBlockFromRemaining();\n break;\n } // put the parsed block in the style\n\n\n style.selector(selectorStr);\n\n for (var i = 0; i < props.length; i++) {\n var _prop = props[i];\n style.css(_prop.name, _prop.val);\n }\n\n removeSelAndBlockFromRemaining();\n }\n\n return style;\n};\n\nstyfn$5.fromString = function (string) {\n var style = this;\n style.resetToDefault();\n style.appendFromString(string);\n return style;\n};\n\nvar styfn$6 = {};\n\n(function () {\n var number = number$1;\n var rgba = rgbaNoBackRefs;\n var hsla = hslaNoBackRefs;\n var hex3$1 = hex3;\n var hex6$1 = hex6;\n\n var data = function data(prefix) {\n return '^' + prefix + '\\\\s*\\\\(\\\\s*([\\\\w\\\\.]+)\\\\s*\\\\)$';\n };\n\n var mapData = function mapData(prefix) {\n var mapArg = number + '|\\\\w+|' + rgba + '|' + hsla + '|' + hex3$1 + '|' + hex6$1;\n return '^' + prefix + '\\\\s*\\\\(([\\\\w\\\\.]+)\\\\s*\\\\,\\\\s*(' + number + ')\\\\s*\\\\,\\\\s*(' + number + ')\\\\s*,\\\\s*(' + mapArg + ')\\\\s*\\\\,\\\\s*(' + mapArg + ')\\\\)$';\n };\n\n var urlRegexes = ['^url\\\\s*\\\\(\\\\s*[\\'\"]?(.+?)[\\'\"]?\\\\s*\\\\)$', '^(none)$', '^(.+)$']; // each visual style property has a type and needs to be validated according to it\n\n styfn$6.types = {\n time: {\n number: true,\n min: 0,\n units: 's|ms',\n implicitUnits: 'ms'\n },\n percent: {\n number: true,\n min: 0,\n max: 100,\n units: '%',\n implicitUnits: '%'\n },\n percentages: {\n number: true,\n min: 0,\n max: 100,\n units: '%',\n implicitUnits: '%',\n multiple: true\n },\n zeroOneNumber: {\n number: true,\n min: 0,\n max: 1,\n unitless: true\n },\n zeroOneNumbers: {\n number: true,\n min: 0,\n max: 1,\n unitless: true,\n multiple: true\n },\n nOneOneNumber: {\n number: true,\n min: -1,\n max: 1,\n unitless: true\n },\n nonNegativeInt: {\n number: true,\n min: 0,\n integer: true,\n unitless: true\n },\n position: {\n enums: ['parent', 'origin']\n },\n nodeSize: {\n number: true,\n min: 0,\n enums: ['label']\n },\n number: {\n number: true,\n unitless: true\n },\n numbers: {\n number: true,\n unitless: true,\n multiple: true\n },\n positiveNumber: {\n number: true,\n unitless: true,\n min: 0,\n strictMin: true\n },\n size: {\n number: true,\n min: 0\n },\n bidirectionalSize: {\n number: true\n },\n // allows negative\n bidirectionalSizeMaybePercent: {\n number: true,\n allowPercent: true\n },\n // allows negative\n bidirectionalSizes: {\n number: true,\n multiple: true\n },\n // allows negative\n sizeMaybePercent: {\n number: true,\n min: 0,\n allowPercent: true\n },\n axisDirection: {\n enums: ['horizontal', 'leftward', 'rightward', 'vertical', 'upward', 'downward', 'auto']\n },\n paddingRelativeTo: {\n enums: ['width', 'height', 'average', 'min', 'max']\n },\n bgWH: {\n number: true,\n min: 0,\n allowPercent: true,\n enums: ['auto'],\n multiple: true\n },\n bgPos: {\n number: true,\n allowPercent: true,\n multiple: true\n },\n bgRelativeTo: {\n enums: ['inner', 'include-padding'],\n multiple: true\n },\n bgRepeat: {\n enums: ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'],\n multiple: true\n },\n bgFit: {\n enums: ['none', 'contain', 'cover'],\n multiple: true\n },\n bgCrossOrigin: {\n enums: ['anonymous', 'use-credentials'],\n multiple: true\n },\n bgClip: {\n enums: ['none', 'node'],\n multiple: true\n },\n color: {\n color: true\n },\n colors: {\n color: true,\n multiple: true\n },\n fill: {\n enums: ['solid', 'linear-gradient', 'radial-gradient']\n },\n bool: {\n enums: ['yes', 'no']\n },\n lineStyle: {\n enums: ['solid', 'dotted', 'dashed']\n },\n lineCap: {\n enums: ['butt', 'round', 'square']\n },\n borderStyle: {\n enums: ['solid', 'dotted', 'dashed', 'double']\n },\n curveStyle: {\n enums: ['bezier', 'unbundled-bezier', 'haystack', 'segments', 'straight', 'taxi']\n },\n fontFamily: {\n regex: '^([\\\\w- \\\\\"]+(?:\\\\s*,\\\\s*[\\\\w- \\\\\"]+)*)$'\n },\n fontStyle: {\n enums: ['italic', 'normal', 'oblique']\n },\n fontWeight: {\n enums: ['normal', 'bold', 'bolder', 'lighter', '100', '200', '300', '400', '500', '600', '800', '900', 100, 200, 300, 400, 500, 600, 700, 800, 900]\n },\n textDecoration: {\n enums: ['none', 'underline', 'overline', 'line-through']\n },\n textTransform: {\n enums: ['none', 'uppercase', 'lowercase']\n },\n textWrap: {\n enums: ['none', 'wrap', 'ellipsis']\n },\n textOverflowWrap: {\n enums: ['whitespace', 'anywhere']\n },\n textBackgroundShape: {\n enums: ['rectangle', 'roundrectangle', 'round-rectangle']\n },\n nodeShape: {\n enums: ['rectangle', 'roundrectangle', 'round-rectangle', 'cutrectangle', 'cut-rectangle', 'bottomroundrectangle', 'bottom-round-rectangle', 'barrel', 'ellipse', 'triangle', 'round-triangle', 'square', 'pentagon', 'round-pentagon', 'hexagon', 'round-hexagon', 'concavehexagon', 'concave-hexagon', 'heptagon', 'round-heptagon', 'octagon', 'round-octagon', 'tag', 'round-tag', 'star', 'diamond', 'round-diamond', 'vee', 'rhomboid', 'polygon']\n },\n compoundIncludeLabels: {\n enums: ['include', 'exclude']\n },\n arrowShape: {\n enums: ['tee', 'triangle', 'triangle-tee', 'circle-triangle', 'triangle-cross', 'triangle-backcurve', 'vee', 'square', 'circle', 'diamond', 'chevron', 'none']\n },\n arrowFill: {\n enums: ['filled', 'hollow']\n },\n display: {\n enums: ['element', 'none']\n },\n visibility: {\n enums: ['hidden', 'visible']\n },\n zCompoundDepth: {\n enums: ['bottom', 'orphan', 'auto', 'top']\n },\n zIndexCompare: {\n enums: ['auto', 'manual']\n },\n valign: {\n enums: ['top', 'center', 'bottom']\n },\n halign: {\n enums: ['left', 'center', 'right']\n },\n justification: {\n enums: ['left', 'center', 'right', 'auto']\n },\n text: {\n string: true\n },\n data: {\n mapping: true,\n regex: data('data')\n },\n layoutData: {\n mapping: true,\n regex: data('layoutData')\n },\n scratch: {\n mapping: true,\n regex: data('scratch')\n },\n mapData: {\n mapping: true,\n regex: mapData('mapData')\n },\n mapLayoutData: {\n mapping: true,\n regex: mapData('mapLayoutData')\n },\n mapScratch: {\n mapping: true,\n regex: mapData('mapScratch')\n },\n fn: {\n mapping: true,\n fn: true\n },\n url: {\n regexes: urlRegexes,\n singleRegexMatchValue: true\n },\n urls: {\n regexes: urlRegexes,\n singleRegexMatchValue: true,\n multiple: true\n },\n propList: {\n propList: true\n },\n angle: {\n number: true,\n units: 'deg|rad',\n implicitUnits: 'rad'\n },\n textRotation: {\n number: true,\n units: 'deg|rad',\n implicitUnits: 'rad',\n enums: ['none', 'autorotate']\n },\n polygonPointList: {\n number: true,\n multiple: true,\n evenMultiple: true,\n min: -1,\n max: 1,\n unitless: true\n },\n edgeDistances: {\n enums: ['intersection', 'node-position']\n },\n edgeEndpoint: {\n number: true,\n multiple: true,\n units: '%|px|em|deg|rad',\n implicitUnits: 'px',\n enums: ['inside-to-node', 'outside-to-node', 'outside-to-node-or-label', 'outside-to-line', 'outside-to-line-or-label'],\n singleEnum: true,\n validate: function validate(valArr, unitsArr) {\n switch (valArr.length) {\n case 2:\n // can be % or px only\n return unitsArr[0] !== 'deg' && unitsArr[0] !== 'rad' && unitsArr[1] !== 'deg' && unitsArr[1] !== 'rad';\n\n case 1:\n // can be enum, deg, or rad only\n return string(valArr[0]) || unitsArr[0] === 'deg' || unitsArr[0] === 'rad';\n\n default:\n return false;\n }\n }\n },\n easing: {\n regexes: ['^(spring)\\\\s*\\\\(\\\\s*(' + number + ')\\\\s*,\\\\s*(' + number + ')\\\\s*\\\\)$', '^(cubic-bezier)\\\\s*\\\\(\\\\s*(' + number + ')\\\\s*,\\\\s*(' + number + ')\\\\s*,\\\\s*(' + number + ')\\\\s*,\\\\s*(' + number + ')\\\\s*\\\\)$'],\n enums: ['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'ease-in-sine', 'ease-out-sine', 'ease-in-out-sine', 'ease-in-quad', 'ease-out-quad', 'ease-in-out-quad', 'ease-in-cubic', 'ease-out-cubic', 'ease-in-out-cubic', 'ease-in-quart', 'ease-out-quart', 'ease-in-out-quart', 'ease-in-quint', 'ease-out-quint', 'ease-in-out-quint', 'ease-in-expo', 'ease-out-expo', 'ease-in-out-expo', 'ease-in-circ', 'ease-out-circ', 'ease-in-out-circ']\n },\n gradientDirection: {\n enums: ['to-bottom', 'to-top', 'to-left', 'to-right', 'to-bottom-right', 'to-bottom-left', 'to-top-right', 'to-top-left', 'to-right-bottom', 'to-left-bottom', 'to-right-top', 'to-left-top']\n },\n boundsExpansion: {\n number: true,\n multiple: true,\n min: 0,\n validate: function validate(valArr) {\n var length = valArr.length;\n return length === 1 || length === 2 || length === 4;\n }\n }\n };\n var diff = {\n zeroNonZero: function zeroNonZero(val1, val2) {\n if ((val1 == null || val2 == null) && val1 !== val2) {\n return true; // null cases could represent any value\n }\n\n if (val1 == 0 && val2 != 0) {\n return true;\n } else if (val1 != 0 && val2 == 0) {\n return true;\n } else {\n return false;\n }\n },\n any: function any(val1, val2) {\n return val1 != val2;\n },\n emptyNonEmpty: function emptyNonEmpty(str1, str2) {\n var empty1 = emptyString(str1);\n var empty2 = emptyString(str2);\n return empty1 && !empty2 || !empty1 && empty2;\n }\n }; // define visual style properties\n //\n // - n.b. adding a new group of props may require updates to updateStyleHints()\n // - adding new props to an existing group gets handled automatically\n\n var t = styfn$6.types;\n var mainLabel = [{\n name: 'label',\n type: t.text,\n triggersBounds: diff.any,\n triggersZOrder: diff.emptyNonEmpty\n }, {\n name: 'text-rotation',\n type: t.textRotation,\n triggersBounds: diff.any\n }, {\n name: 'text-margin-x',\n type: t.bidirectionalSize,\n triggersBounds: diff.any\n }, {\n name: 'text-margin-y',\n type: t.bidirectionalSize,\n triggersBounds: diff.any\n }];\n var sourceLabel = [{\n name: 'source-label',\n type: t.text,\n triggersBounds: diff.any\n }, {\n name: 'source-text-rotation',\n type: t.textRotation,\n triggersBounds: diff.any\n }, {\n name: 'source-text-margin-x',\n type: t.bidirectionalSize,\n triggersBounds: diff.any\n }, {\n name: 'source-text-margin-y',\n type: t.bidirectionalSize,\n triggersBounds: diff.any\n }, {\n name: 'source-text-offset',\n type: t.size,\n triggersBounds: diff.any\n }];\n var targetLabel = [{\n name: 'target-label',\n type: t.text,\n triggersBounds: diff.any\n }, {\n name: 'target-text-rotation',\n type: t.textRotation,\n triggersBounds: diff.any\n }, {\n name: 'target-text-margin-x',\n type: t.bidirectionalSize,\n triggersBounds: diff.any\n }, {\n name: 'target-text-margin-y',\n type: t.bidirectionalSize,\n triggersBounds: diff.any\n }, {\n name: 'target-text-offset',\n type: t.size,\n triggersBounds: diff.any\n }];\n var labelDimensions = [{\n name: 'font-family',\n type: t.fontFamily,\n triggersBounds: diff.any\n }, {\n name: 'font-style',\n type: t.fontStyle,\n triggersBounds: diff.any\n }, {\n name: 'font-weight',\n type: t.fontWeight,\n triggersBounds: diff.any\n }, {\n name: 'font-size',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'text-transform',\n type: t.textTransform,\n triggersBounds: diff.any\n }, {\n name: 'text-wrap',\n type: t.textWrap,\n triggersBounds: diff.any\n }, {\n name: 'text-overflow-wrap',\n type: t.textOverflowWrap,\n triggersBounds: diff.any\n }, {\n name: 'text-max-width',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'text-outline-width',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'line-height',\n type: t.positiveNumber,\n triggersBounds: diff.any\n }];\n var commonLabel = [{\n name: 'text-valign',\n type: t.valign,\n triggersBounds: diff.any\n }, {\n name: 'text-halign',\n type: t.halign,\n triggersBounds: diff.any\n }, {\n name: 'color',\n type: t.color\n }, {\n name: 'text-outline-color',\n type: t.color\n }, {\n name: 'text-outline-opacity',\n type: t.zeroOneNumber\n }, {\n name: 'text-background-color',\n type: t.color\n }, {\n name: 'text-background-opacity',\n type: t.zeroOneNumber\n }, {\n name: 'text-background-padding',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'text-border-opacity',\n type: t.zeroOneNumber\n }, {\n name: 'text-border-color',\n type: t.color\n }, {\n name: 'text-border-width',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'text-border-style',\n type: t.borderStyle,\n triggersBounds: diff.any\n }, {\n name: 'text-background-shape',\n type: t.textBackgroundShape,\n triggersBounds: diff.any\n }, {\n name: 'text-justification',\n type: t.justification\n }];\n var behavior = [{\n name: 'events',\n type: t.bool\n }, {\n name: 'text-events',\n type: t.bool\n }];\n var visibility = [{\n name: 'display',\n type: t.display,\n triggersZOrder: diff.any,\n triggersBounds: diff.any,\n triggersBoundsOfParallelBeziers: true\n }, {\n name: 'visibility',\n type: t.visibility,\n triggersZOrder: diff.any\n }, {\n name: 'opacity',\n type: t.zeroOneNumber,\n triggersZOrder: diff.zeroNonZero\n }, {\n name: 'text-opacity',\n type: t.zeroOneNumber\n }, {\n name: 'min-zoomed-font-size',\n type: t.size\n }, {\n name: 'z-compound-depth',\n type: t.zCompoundDepth,\n triggersZOrder: diff.any\n }, {\n name: 'z-index-compare',\n type: t.zIndexCompare,\n triggersZOrder: diff.any\n }, {\n name: 'z-index',\n type: t.nonNegativeInt,\n triggersZOrder: diff.any\n }];\n var overlay = [{\n name: 'overlay-padding',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'overlay-color',\n type: t.color\n }, {\n name: 'overlay-opacity',\n type: t.zeroOneNumber,\n triggersBounds: diff.zeroNonZero\n }];\n var transition = [{\n name: 'transition-property',\n type: t.propList\n }, {\n name: 'transition-duration',\n type: t.time\n }, {\n name: 'transition-delay',\n type: t.time\n }, {\n name: 'transition-timing-function',\n type: t.easing\n }];\n\n var nodeSizeHashOverride = function nodeSizeHashOverride(ele, parsedProp) {\n if (parsedProp.value === 'label') {\n return -ele.poolIndex(); // no hash key hits is using label size (hitrate for perf probably low anyway)\n } else {\n return parsedProp.pfValue;\n }\n };\n\n var nodeBody = [{\n name: 'height',\n type: t.nodeSize,\n triggersBounds: diff.any,\n hashOverride: nodeSizeHashOverride\n }, {\n name: 'width',\n type: t.nodeSize,\n triggersBounds: diff.any,\n hashOverride: nodeSizeHashOverride\n }, {\n name: 'shape',\n type: t.nodeShape,\n triggersBounds: diff.any\n }, {\n name: 'shape-polygon-points',\n type: t.polygonPointList,\n triggersBounds: diff.any\n }, {\n name: 'background-color',\n type: t.color\n }, {\n name: 'background-fill',\n type: t.fill\n }, {\n name: 'background-opacity',\n type: t.zeroOneNumber\n }, {\n name: 'background-blacken',\n type: t.nOneOneNumber\n }, {\n name: 'background-gradient-stop-colors',\n type: t.colors\n }, {\n name: 'background-gradient-stop-positions',\n type: t.percentages\n }, {\n name: 'background-gradient-direction',\n type: t.gradientDirection\n }, {\n name: 'padding',\n type: t.sizeMaybePercent,\n triggersBounds: diff.any\n }, {\n name: 'padding-relative-to',\n type: t.paddingRelativeTo,\n triggersBounds: diff.any\n }, {\n name: 'bounds-expansion',\n type: t.boundsExpansion,\n triggersBounds: diff.any\n }];\n var nodeBorder = [{\n name: 'border-color',\n type: t.color\n }, {\n name: 'border-opacity',\n type: t.zeroOneNumber\n }, {\n name: 'border-width',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'border-style',\n type: t.borderStyle\n }];\n var backgroundImage = [{\n name: 'background-image',\n type: t.urls\n }, {\n name: 'background-image-crossorigin',\n type: t.bgCrossOrigin\n }, {\n name: 'background-image-opacity',\n type: t.zeroOneNumbers\n }, {\n name: 'background-position-x',\n type: t.bgPos\n }, {\n name: 'background-position-y',\n type: t.bgPos\n }, {\n name: 'background-width-relative-to',\n type: t.bgRelativeTo\n }, {\n name: 'background-height-relative-to',\n type: t.bgRelativeTo\n }, {\n name: 'background-repeat',\n type: t.bgRepeat\n }, {\n name: 'background-fit',\n type: t.bgFit\n }, {\n name: 'background-clip',\n type: t.bgClip\n }, {\n name: 'background-width',\n type: t.bgWH\n }, {\n name: 'background-height',\n type: t.bgWH\n }, {\n name: 'background-offset-x',\n type: t.bgPos\n }, {\n name: 'background-offset-y',\n type: t.bgPos\n }];\n var compound = [{\n name: 'position',\n type: t.position,\n triggersBounds: diff.any\n }, {\n name: 'compound-sizing-wrt-labels',\n type: t.compoundIncludeLabels,\n triggersBounds: diff.any\n }, {\n name: 'min-width',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'min-width-bias-left',\n type: t.sizeMaybePercent,\n triggersBounds: diff.any\n }, {\n name: 'min-width-bias-right',\n type: t.sizeMaybePercent,\n triggersBounds: diff.any\n }, {\n name: 'min-height',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'min-height-bias-top',\n type: t.sizeMaybePercent,\n triggersBounds: diff.any\n }, {\n name: 'min-height-bias-bottom',\n type: t.sizeMaybePercent,\n triggersBounds: diff.any\n }];\n var edgeLine = [{\n name: 'line-style',\n type: t.lineStyle\n }, {\n name: 'line-color',\n type: t.color\n }, {\n name: 'line-fill',\n type: t.fill\n }, {\n name: 'line-cap',\n type: t.lineCap\n }, {\n name: 'line-dash-pattern',\n type: t.numbers\n }, {\n name: 'line-dash-offset',\n type: t.number\n }, {\n name: 'line-gradient-stop-colors',\n type: t.colors\n }, {\n name: 'line-gradient-stop-positions',\n type: t.percentages\n }, {\n name: 'curve-style',\n type: t.curveStyle,\n triggersBounds: diff.any,\n triggersBoundsOfParallelBeziers: true\n }, {\n name: 'haystack-radius',\n type: t.zeroOneNumber,\n triggersBounds: diff.any\n }, {\n name: 'source-endpoint',\n type: t.edgeEndpoint,\n triggersBounds: diff.any\n }, {\n name: 'target-endpoint',\n type: t.edgeEndpoint,\n triggersBounds: diff.any\n }, {\n name: 'control-point-step-size',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'control-point-distances',\n type: t.bidirectionalSizes,\n triggersBounds: diff.any\n }, {\n name: 'control-point-weights',\n type: t.numbers,\n triggersBounds: diff.any\n }, {\n name: 'segment-distances',\n type: t.bidirectionalSizes,\n triggersBounds: diff.any\n }, {\n name: 'segment-weights',\n type: t.numbers,\n triggersBounds: diff.any\n }, {\n name: 'taxi-turn',\n type: t.bidirectionalSizeMaybePercent,\n triggersBounds: diff.any\n }, {\n name: 'taxi-turn-min-distance',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'taxi-direction',\n type: t.axisDirection,\n triggersBounds: diff.any\n }, {\n name: 'edge-distances',\n type: t.edgeDistances,\n triggersBounds: diff.any\n }, {\n name: 'arrow-scale',\n type: t.positiveNumber,\n triggersBounds: diff.any\n }, {\n name: 'loop-direction',\n type: t.angle,\n triggersBounds: diff.any\n }, {\n name: 'loop-sweep',\n type: t.angle,\n triggersBounds: diff.any\n }, {\n name: 'source-distance-from-node',\n type: t.size,\n triggersBounds: diff.any\n }, {\n name: 'target-distance-from-node',\n type: t.size,\n triggersBounds: diff.any\n }];\n var ghost = [{\n name: 'ghost',\n type: t.bool,\n triggersBounds: diff.any\n }, {\n name: 'ghost-offset-x',\n type: t.bidirectionalSize,\n triggersBounds: diff.any\n }, {\n name: 'ghost-offset-y',\n type: t.bidirectionalSize,\n triggersBounds: diff.any\n }, {\n name: 'ghost-opacity',\n type: t.zeroOneNumber\n }];\n var core = [{\n name: 'selection-box-color',\n type: t.color\n }, {\n name: 'selection-box-opacity',\n type: t.zeroOneNumber\n }, {\n name: 'selection-box-border-color',\n type: t.color\n }, {\n name: 'selection-box-border-width',\n type: t.size\n }, {\n name: 'active-bg-color',\n type: t.color\n }, {\n name: 'active-bg-opacity',\n type: t.zeroOneNumber\n }, {\n name: 'active-bg-size',\n type: t.size\n }, {\n name: 'outside-texture-bg-color',\n type: t.color\n }, {\n name: 'outside-texture-bg-opacity',\n type: t.zeroOneNumber\n }]; // pie backgrounds for nodes\n\n var pie = [];\n styfn$6.pieBackgroundN = 16; // because the pie properties are numbered, give access to a constant N (for renderer use)\n\n pie.push({\n name: 'pie-size',\n type: t.sizeMaybePercent\n });\n\n for (var i = 1; i <= styfn$6.pieBackgroundN; i++) {\n pie.push({\n name: 'pie-' + i + '-background-color',\n type: t.color\n });\n pie.push({\n name: 'pie-' + i + '-background-size',\n type: t.percent\n });\n pie.push({\n name: 'pie-' + i + '-background-opacity',\n type: t.zeroOneNumber\n });\n } // edge arrows\n\n\n var edgeArrow = [];\n var arrowPrefixes = styfn$6.arrowPrefixes = ['source', 'mid-source', 'target', 'mid-target'];\n [{\n name: 'arrow-shape',\n type: t.arrowShape,\n triggersBounds: diff.any\n }, {\n name: 'arrow-color',\n type: t.color\n }, {\n name: 'arrow-fill',\n type: t.arrowFill\n }].forEach(function (prop) {\n arrowPrefixes.forEach(function (prefix) {\n var name = prefix + '-' + prop.name;\n var type = prop.type,\n triggersBounds = prop.triggersBounds;\n edgeArrow.push({\n name: name,\n type: type,\n triggersBounds: triggersBounds\n });\n });\n }, {});\n var props = styfn$6.properties = [].concat(behavior, transition, visibility, overlay, ghost, commonLabel, labelDimensions, mainLabel, sourceLabel, targetLabel, nodeBody, nodeBorder, backgroundImage, pie, compound, edgeLine, edgeArrow, core);\n var propGroups = styfn$6.propertyGroups = {\n // common to all eles\n behavior: behavior,\n transition: transition,\n visibility: visibility,\n overlay: overlay,\n ghost: ghost,\n // labels\n commonLabel: commonLabel,\n labelDimensions: labelDimensions,\n mainLabel: mainLabel,\n sourceLabel: sourceLabel,\n targetLabel: targetLabel,\n // node props\n nodeBody: nodeBody,\n nodeBorder: nodeBorder,\n backgroundImage: backgroundImage,\n pie: pie,\n compound: compound,\n // edge props\n edgeLine: edgeLine,\n edgeArrow: edgeArrow,\n core: core\n };\n var propGroupNames = styfn$6.propertyGroupNames = {};\n var propGroupKeys = styfn$6.propertyGroupKeys = Object.keys(propGroups);\n propGroupKeys.forEach(function (key) {\n propGroupNames[key] = propGroups[key].map(function (prop) {\n return prop.name;\n });\n propGroups[key].forEach(function (prop) {\n return prop.groupKey = key;\n });\n }); // define aliases\n\n var aliases = styfn$6.aliases = [{\n name: 'content',\n pointsTo: 'label'\n }, {\n name: 'control-point-distance',\n pointsTo: 'control-point-distances'\n }, {\n name: 'control-point-weight',\n pointsTo: 'control-point-weights'\n }, {\n name: 'edge-text-rotation',\n pointsTo: 'text-rotation'\n }, {\n name: 'padding-left',\n pointsTo: 'padding'\n }, {\n name: 'padding-right',\n pointsTo: 'padding'\n }, {\n name: 'padding-top',\n pointsTo: 'padding'\n }, {\n name: 'padding-bottom',\n pointsTo: 'padding'\n }]; // list of property names\n\n styfn$6.propertyNames = props.map(function (p) {\n return p.name;\n }); // allow access of properties by name ( e.g. style.properties.height )\n\n for (var _i = 0; _i < props.length; _i++) {\n var prop = props[_i];\n props[prop.name] = prop; // allow lookup by name\n } // map aliases\n\n\n for (var _i2 = 0; _i2 < aliases.length; _i2++) {\n var alias = aliases[_i2];\n var pointsToProp = props[alias.pointsTo];\n var aliasProp = {\n name: alias.name,\n alias: true,\n pointsTo: pointsToProp\n }; // add alias prop for parsing\n\n props.push(aliasProp);\n props[alias.name] = aliasProp; // allow lookup by name\n }\n})();\n\nstyfn$6.getDefaultProperty = function (name) {\n return this.getDefaultProperties()[name];\n};\n\nstyfn$6.getDefaultProperties = function () {\n var _p = this._private;\n\n if (_p.defaultProperties != null) {\n return _p.defaultProperties;\n }\n\n var rawProps = extend({\n // core props\n 'selection-box-color': '#ddd',\n 'selection-box-opacity': 0.65,\n 'selection-box-border-color': '#aaa',\n 'selection-box-border-width': 1,\n 'active-bg-color': 'black',\n 'active-bg-opacity': 0.15,\n 'active-bg-size': 30,\n 'outside-texture-bg-color': '#000',\n 'outside-texture-bg-opacity': 0.125,\n // common node/edge props\n 'events': 'yes',\n 'text-events': 'no',\n 'text-valign': 'top',\n 'text-halign': 'center',\n 'text-justification': 'auto',\n 'line-height': 1,\n 'color': '#000',\n 'text-outline-color': '#000',\n 'text-outline-width': 0,\n 'text-outline-opacity': 1,\n 'text-opacity': 1,\n 'text-decoration': 'none',\n 'text-transform': 'none',\n 'text-wrap': 'none',\n 'text-overflow-wrap': 'whitespace',\n 'text-max-width': 9999,\n 'text-background-color': '#000',\n 'text-background-opacity': 0,\n 'text-background-shape': 'rectangle',\n 'text-background-padding': 0,\n 'text-border-opacity': 0,\n 'text-border-width': 0,\n 'text-border-style': 'solid',\n 'text-border-color': '#000',\n 'font-family': 'Helvetica Neue, Helvetica, sans-serif',\n 'font-style': 'normal',\n 'font-weight': 'normal',\n 'font-size': 16,\n 'min-zoomed-font-size': 0,\n 'text-rotation': 'none',\n 'source-text-rotation': 'none',\n 'target-text-rotation': 'none',\n 'visibility': 'visible',\n 'display': 'element',\n 'opacity': 1,\n 'z-compound-depth': 'auto',\n 'z-index-compare': 'auto',\n 'z-index': 0,\n 'label': '',\n 'text-margin-x': 0,\n 'text-margin-y': 0,\n 'source-label': '',\n 'source-text-offset': 0,\n 'source-text-margin-x': 0,\n 'source-text-margin-y': 0,\n 'target-label': '',\n 'target-text-offset': 0,\n 'target-text-margin-x': 0,\n 'target-text-margin-y': 0,\n 'overlay-opacity': 0,\n 'overlay-color': '#000',\n 'overlay-padding': 10,\n 'transition-property': 'none',\n 'transition-duration': 0,\n 'transition-delay': 0,\n 'transition-timing-function': 'linear',\n // node props\n 'background-blacken': 0,\n 'background-color': '#999',\n 'background-fill': 'solid',\n 'background-opacity': 1,\n 'background-image': 'none',\n 'background-image-crossorigin': 'anonymous',\n 'background-image-opacity': 1,\n 'background-position-x': '50%',\n 'background-position-y': '50%',\n 'background-offset-x': 0,\n 'background-offset-y': 0,\n 'background-width-relative-to': 'include-padding',\n 'background-height-relative-to': 'include-padding',\n 'background-repeat': 'no-repeat',\n 'background-fit': 'none',\n 'background-clip': 'node',\n 'background-width': 'auto',\n 'background-height': 'auto',\n 'border-color': '#000',\n 'border-opacity': 1,\n 'border-width': 0,\n 'border-style': 'solid',\n 'height': 30,\n 'width': 30,\n 'shape': 'ellipse',\n 'shape-polygon-points': '-1, -1, 1, -1, 1, 1, -1, 1',\n 'bounds-expansion': 0,\n // node gradient\n 'background-gradient-direction': 'to-bottom',\n 'background-gradient-stop-colors': '#999',\n 'background-gradient-stop-positions': '0%',\n // ghost props\n 'ghost': 'no',\n 'ghost-offset-y': 0,\n 'ghost-offset-x': 0,\n 'ghost-opacity': 0,\n // compound props\n 'padding': 0,\n 'padding-relative-to': 'width',\n 'position': 'origin',\n 'compound-sizing-wrt-labels': 'include',\n 'min-width': 0,\n 'min-width-bias-left': 0,\n 'min-width-bias-right': 0,\n 'min-height': 0,\n 'min-height-bias-top': 0,\n 'min-height-bias-bottom': 0\n }, {\n // node pie bg\n 'pie-size': '100%'\n }, [{\n name: 'pie-{{i}}-background-color',\n value: 'black'\n }, {\n name: 'pie-{{i}}-background-size',\n value: '0%'\n }, {\n name: 'pie-{{i}}-background-opacity',\n value: 1\n }].reduce(function (css, prop) {\n for (var i = 1; i <= styfn$6.pieBackgroundN; i++) {\n var name = prop.name.replace('{{i}}', i);\n var val = prop.value;\n css[name] = val;\n }\n\n return css;\n }, {}), {\n // edge props\n 'line-style': 'solid',\n 'line-color': '#999',\n 'line-fill': 'solid',\n 'line-cap': 'butt',\n 'line-gradient-stop-colors': '#999',\n 'line-gradient-stop-positions': '0%',\n 'control-point-step-size': 40,\n 'control-point-weights': 0.5,\n 'segment-weights': 0.5,\n 'segment-distances': 20,\n 'taxi-turn': '50%',\n 'taxi-turn-min-distance': 10,\n 'taxi-direction': 'auto',\n 'edge-distances': 'intersection',\n 'curve-style': 'haystack',\n 'haystack-radius': 0,\n 'arrow-scale': 1,\n 'loop-direction': '-45deg',\n 'loop-sweep': '-90deg',\n 'source-distance-from-node': 0,\n 'target-distance-from-node': 0,\n 'source-endpoint': 'outside-to-node',\n 'target-endpoint': 'outside-to-node',\n 'line-dash-pattern': [6, 3],\n 'line-dash-offset': 0\n }, [{\n name: 'arrow-shape',\n value: 'none'\n }, {\n name: 'arrow-color',\n value: '#999'\n }, {\n name: 'arrow-fill',\n value: 'filled'\n }].reduce(function (css, prop) {\n styfn$6.arrowPrefixes.forEach(function (prefix) {\n var name = prefix + '-' + prop.name;\n var val = prop.value;\n css[name] = val;\n });\n return css;\n }, {}));\n var parsedProps = {};\n\n for (var i = 0; i < this.properties.length; i++) {\n var prop = this.properties[i];\n\n if (prop.pointsTo) {\n continue;\n }\n\n var name = prop.name;\n var val = rawProps[name];\n var parsedProp = this.parse(name, val);\n parsedProps[name] = parsedProp;\n }\n\n _p.defaultProperties = parsedProps;\n return _p.defaultProperties;\n};\n\nstyfn$6.addDefaultStylesheet = function () {\n this.selector(':parent').css({\n 'shape': 'rectangle',\n 'padding': 10,\n 'background-color': '#eee',\n 'border-color': '#ccc',\n 'border-width': 1\n }).selector('edge').css({\n 'width': 3\n }).selector(':loop').css({\n 'curve-style': 'bezier'\n }).selector('edge:compound').css({\n 'curve-style': 'bezier',\n 'source-endpoint': 'outside-to-line',\n 'target-endpoint': 'outside-to-line'\n }).selector(':selected').css({\n 'background-color': '#0169D9',\n 'line-color': '#0169D9',\n 'source-arrow-color': '#0169D9',\n 'target-arrow-color': '#0169D9',\n 'mid-source-arrow-color': '#0169D9',\n 'mid-target-arrow-color': '#0169D9'\n }).selector(':parent:selected').css({\n 'background-color': '#CCE1F9',\n 'border-color': '#aec8e5'\n }).selector(':active').css({\n 'overlay-color': 'black',\n 'overlay-padding': 10,\n 'overlay-opacity': 0.25\n });\n this.defaultLength = this.length;\n};\n\nvar styfn$7 = {}; // a caching layer for property parsing\n\nstyfn$7.parse = function (name, value, propIsBypass, propIsFlat) {\n var self = this; // function values can't be cached in all cases, and there isn't much benefit of caching them anyway\n\n if (fn(value)) {\n return self.parseImplWarn(name, value, propIsBypass, propIsFlat);\n }\n\n var flatKey = propIsFlat === 'mapping' || propIsFlat === true || propIsFlat === false || propIsFlat == null ? 'dontcare' : propIsFlat;\n var bypassKey = propIsBypass ? 't' : 'f';\n var valueKey = '' + value;\n var argHash = hashStrings(name, valueKey, bypassKey, flatKey);\n var propCache = self.propCache = self.propCache || [];\n var ret;\n\n if (!(ret = propCache[argHash])) {\n ret = propCache[argHash] = self.parseImplWarn(name, value, propIsBypass, propIsFlat);\n } // - bypasses can't be shared b/c the value can be changed by animations or otherwise overridden\n // - mappings can't be shared b/c mappings are per-element\n\n\n if (propIsBypass || propIsFlat === 'mapping') {\n // need a copy since props are mutated later in their lifecycles\n ret = copy(ret);\n\n if (ret) {\n ret.value = copy(ret.value); // because it could be an array, e.g. colour\n }\n }\n\n return ret;\n};\n\nstyfn$7.parseImplWarn = function (name, value, propIsBypass, propIsFlat) {\n var prop = this.parseImpl(name, value, propIsBypass, propIsFlat);\n\n if (!prop && value != null) {\n warn(\"The style property `\".concat(name, \": \").concat(value, \"` is invalid\"));\n }\n\n return prop;\n}; // parse a property; return null on invalid; return parsed property otherwise\n// fields :\n// - name : the name of the property\n// - value : the parsed, native-typed value of the property\n// - strValue : a string value that represents the property value in valid css\n// - bypass : true iff the property is a bypass property\n\n\nstyfn$7.parseImpl = function (name, value, propIsBypass, propIsFlat) {\n var self = this;\n name = camel2dash(name); // make sure the property name is in dash form (e.g. 'property-name' not 'propertyName')\n\n var property = self.properties[name];\n var passedValue = value;\n var types = self.types;\n\n if (!property) {\n return null;\n } // return null on property of unknown name\n\n\n if (value === undefined) {\n return null;\n } // can't assign undefined\n // the property may be an alias\n\n\n if (property.alias) {\n property = property.pointsTo;\n name = property.name;\n }\n\n var valueIsString = string(value);\n\n if (valueIsString) {\n // trim the value to make parsing easier\n value = value.trim();\n }\n\n var type = property.type;\n\n if (!type) {\n return null;\n } // no type, no luck\n // check if bypass is null or empty string (i.e. indication to delete bypass property)\n\n\n if (propIsBypass && (value === '' || value === null)) {\n return {\n name: name,\n value: value,\n bypass: true,\n deleteBypass: true\n };\n } // check if value is a function used as a mapper\n\n\n if (fn(value)) {\n return {\n name: name,\n value: value,\n strValue: 'fn',\n mapped: types.fn,\n bypass: propIsBypass\n };\n } // check if value is mapped\n\n\n var data, mapData;\n\n if (!valueIsString || propIsFlat || value.length < 7 || value[1] !== 'a') ; else if (value.length >= 7 && value[0] === 'd' && (data = new RegExp(types.data.regex).exec(value))) {\n if (propIsBypass) {\n return false;\n } // mappers not allowed in bypass\n\n\n var mapped = types.data;\n return {\n name: name,\n value: data,\n strValue: '' + value,\n mapped: mapped,\n field: data[1],\n bypass: propIsBypass\n };\n } else if (value.length >= 10 && value[0] === 'm' && (mapData = new RegExp(types.mapData.regex).exec(value))) {\n if (propIsBypass) {\n return false;\n } // mappers not allowed in bypass\n\n\n if (type.multiple) {\n return false;\n } // impossible to map to num\n\n\n var _mapped = types.mapData; // we can map only if the type is a colour or a number\n\n if (!(type.color || type.number)) {\n return false;\n }\n\n var valueMin = this.parse(name, mapData[4]); // parse to validate\n\n if (!valueMin || valueMin.mapped) {\n return false;\n } // can't be invalid or mapped\n\n\n var valueMax = this.parse(name, mapData[5]); // parse to validate\n\n if (!valueMax || valueMax.mapped) {\n return false;\n } // can't be invalid or mapped\n // check if valueMin and valueMax are the same\n\n\n if (valueMin.pfValue === valueMax.pfValue || valueMin.strValue === valueMax.strValue) {\n warn('`' + name + ': ' + value + '` is not a valid mapper because the output range is zero; converting to `' + name + ': ' + valueMin.strValue + '`');\n return this.parse(name, valueMin.strValue); // can't make much of a mapper without a range\n } else if (type.color) {\n var c1 = valueMin.value;\n var c2 = valueMax.value;\n var same = c1[0] === c2[0] // red\n && c1[1] === c2[1] // green\n && c1[2] === c2[2] // blue\n && ( // optional alpha\n c1[3] === c2[3] // same alpha outright\n || (c1[3] == null || c1[3] === 1) && ( // full opacity for colour 1?\n c2[3] == null || c2[3] === 1) // full opacity for colour 2?\n );\n\n if (same) {\n return false;\n } // can't make a mapper without a range\n\n }\n\n return {\n name: name,\n value: mapData,\n strValue: '' + value,\n mapped: _mapped,\n field: mapData[1],\n fieldMin: parseFloat(mapData[2]),\n // min & max are numeric\n fieldMax: parseFloat(mapData[3]),\n valueMin: valueMin.value,\n valueMax: valueMax.value,\n bypass: propIsBypass\n };\n }\n\n if (type.multiple && propIsFlat !== 'multiple') {\n var vals;\n\n if (valueIsString) {\n vals = value.split(/\\s+/);\n } else if (array(value)) {\n vals = value;\n } else {\n vals = [value];\n }\n\n if (type.evenMultiple && vals.length % 2 !== 0) {\n return null;\n }\n\n var valArr = [];\n var unitsArr = [];\n var pfValArr = [];\n var strVal = '';\n var hasEnum = false;\n\n for (var i = 0; i < vals.length; i++) {\n var p = self.parse(name, vals[i], propIsBypass, 'multiple');\n hasEnum = hasEnum || string(p.value);\n valArr.push(p.value);\n pfValArr.push(p.pfValue != null ? p.pfValue : p.value);\n unitsArr.push(p.units);\n strVal += (i > 0 ? ' ' : '') + p.strValue;\n }\n\n if (type.validate && !type.validate(valArr, unitsArr)) {\n return null;\n }\n\n if (type.singleEnum && hasEnum) {\n if (valArr.length === 1 && string(valArr[0])) {\n return {\n name: name,\n value: valArr[0],\n strValue: valArr[0],\n bypass: propIsBypass\n };\n } else {\n return null;\n }\n }\n\n return {\n name: name,\n value: valArr,\n pfValue: pfValArr,\n strValue: strVal,\n bypass: propIsBypass,\n units: unitsArr\n };\n } // several types also allow enums\n\n\n var checkEnums = function checkEnums() {\n for (var _i = 0; _i < type.enums.length; _i++) {\n var en = type.enums[_i];\n\n if (en === value) {\n return {\n name: name,\n value: value,\n strValue: '' + value,\n bypass: propIsBypass\n };\n }\n }\n\n return null;\n }; // check the type and return the appropriate object\n\n\n if (type.number) {\n var units;\n var implicitUnits = 'px'; // not set => px\n\n if (type.units) {\n // use specified units if set\n units = type.units;\n }\n\n if (type.implicitUnits) {\n implicitUnits = type.implicitUnits;\n }\n\n if (!type.unitless) {\n if (valueIsString) {\n var unitsRegex = 'px|em' + (type.allowPercent ? '|\\\\%' : '');\n\n if (units) {\n unitsRegex = units;\n } // only allow explicit units if so set\n\n\n var match = value.match('^(' + number$1 + ')(' + unitsRegex + ')?' + '$');\n\n if (match) {\n value = match[1];\n units = match[2] || implicitUnits;\n }\n } else if (!units || type.implicitUnits) {\n units = implicitUnits; // implicitly px if unspecified\n }\n }\n\n value = parseFloat(value); // if not a number and enums not allowed, then the value is invalid\n\n if (isNaN(value) && type.enums === undefined) {\n return null;\n } // check if this number type also accepts special keywords in place of numbers\n // (i.e. `left`, `auto`, etc)\n\n\n if (isNaN(value) && type.enums !== undefined) {\n value = passedValue;\n return checkEnums();\n } // check if value must be an integer\n\n\n if (type.integer && !integer(value)) {\n return null;\n } // check value is within range\n\n\n if (type.min !== undefined && (value < type.min || type.strictMin && value === type.min) || type.max !== undefined && (value > type.max || type.strictMax && value === type.max)) {\n return null;\n }\n\n var ret = {\n name: name,\n value: value,\n strValue: '' + value + (units ? units : ''),\n units: units,\n bypass: propIsBypass\n }; // normalise value in pixels\n\n if (type.unitless || units !== 'px' && units !== 'em') {\n ret.pfValue = value;\n } else {\n ret.pfValue = units === 'px' || !units ? value : this.getEmSizeInPixels() * value;\n } // normalise value in ms\n\n\n if (units === 'ms' || units === 's') {\n ret.pfValue = units === 'ms' ? value : 1000 * value;\n } // normalise value in rad\n\n\n if (units === 'deg' || units === 'rad') {\n ret.pfValue = units === 'rad' ? value : deg2rad(value);\n } // normalize value in %\n\n\n if (units === '%') {\n ret.pfValue = value / 100;\n }\n\n return ret;\n } else if (type.propList) {\n var props = [];\n var propsStr = '' + value;\n\n if (propsStr === 'none') ; else {\n // go over each prop\n var propsSplit = propsStr.split(/\\s*,\\s*|\\s+/);\n\n for (var _i2 = 0; _i2 < propsSplit.length; _i2++) {\n var propName = propsSplit[_i2].trim();\n\n if (self.properties[propName]) {\n props.push(propName);\n } else {\n warn('`' + propName + '` is not a valid property name');\n }\n }\n\n if (props.length === 0) {\n return null;\n }\n }\n\n return {\n name: name,\n value: props,\n strValue: props.length === 0 ? 'none' : props.join(' '),\n bypass: propIsBypass\n };\n } else if (type.color) {\n var tuple = color2tuple(value);\n\n if (!tuple) {\n return null;\n }\n\n return {\n name: name,\n value: tuple,\n pfValue: tuple,\n strValue: 'rgb(' + tuple[0] + ',' + tuple[1] + ',' + tuple[2] + ')',\n // n.b. no spaces b/c of multiple support\n bypass: propIsBypass\n };\n } else if (type.regex || type.regexes) {\n // first check enums\n if (type.enums) {\n var enumProp = checkEnums();\n\n if (enumProp) {\n return enumProp;\n }\n }\n\n var regexes = type.regexes ? type.regexes : [type.regex];\n\n for (var _i3 = 0; _i3 < regexes.length; _i3++) {\n var regex = new RegExp(regexes[_i3]); // make a regex from the type string\n\n var m = regex.exec(value);\n\n if (m) {\n // regex matches\n return {\n name: name,\n value: type.singleRegexMatchValue ? m[1] : m,\n strValue: '' + value,\n bypass: propIsBypass\n };\n }\n }\n\n return null; // didn't match any\n } else if (type.string) {\n // just return\n return {\n name: name,\n value: '' + value,\n strValue: '' + value,\n bypass: propIsBypass\n };\n } else if (type.enums) {\n // check enums last because it's a combo type in others\n return checkEnums();\n } else {\n return null; // not a type we can handle\n }\n};\n\nvar Style = function Style(cy) {\n if (!(this instanceof Style)) {\n return new Style(cy);\n }\n\n if (!core(cy)) {\n error('A style must have a core reference');\n return;\n }\n\n this._private = {\n cy: cy,\n coreStyle: {}\n };\n this.length = 0;\n this.resetToDefault();\n};\n\nvar styfn$8 = Style.prototype;\n\nstyfn$8.instanceString = function () {\n return 'style';\n}; // remove all contexts\n\n\nstyfn$8.clear = function () {\n for (var i = 0; i < this.length; i++) {\n this[i] = undefined;\n }\n\n this.length = 0;\n var _p = this._private;\n _p.newStyle = true;\n return this; // chaining\n};\n\nstyfn$8.resetToDefault = function () {\n this.clear();\n this.addDefaultStylesheet();\n return this;\n}; // builds a style object for the 'core' selector\n\n\nstyfn$8.core = function (propName) {\n return this._private.coreStyle[propName] || this.getDefaultProperty(propName);\n}; // create a new context from the specified selector string and switch to that context\n\n\nstyfn$8.selector = function (selectorStr) {\n // 'core' is a special case and does not need a selector\n var selector = selectorStr === 'core' ? null : new Selector(selectorStr);\n var i = this.length++; // new context means new index\n\n this[i] = {\n selector: selector,\n properties: [],\n mappedProperties: [],\n index: i\n };\n return this; // chaining\n}; // add one or many css rules to the current context\n\n\nstyfn$8.css = function () {\n var self = this;\n var args = arguments;\n\n if (args.length === 1) {\n var map = args[0];\n\n for (var i = 0; i < self.properties.length; i++) {\n var prop = self.properties[i];\n var mapVal = map[prop.name];\n\n if (mapVal === undefined) {\n mapVal = map[dash2camel(prop.name)];\n }\n\n if (mapVal !== undefined) {\n this.cssRule(prop.name, mapVal);\n }\n }\n } else if (args.length === 2) {\n this.cssRule(args[0], args[1]);\n } // do nothing if args are invalid\n\n\n return this; // chaining\n};\n\nstyfn$8.style = styfn$8.css; // add a single css rule to the current context\n\nstyfn$8.cssRule = function (name, value) {\n // name-value pair\n var property = this.parse(name, value); // add property to current context if valid\n\n if (property) {\n var i = this.length - 1;\n this[i].properties.push(property);\n this[i].properties[property.name] = property; // allow access by name as well\n\n if (property.name.match(/pie-(\\d+)-background-size/) && property.value) {\n this._private.hasPie = true;\n }\n\n if (property.mapped) {\n this[i].mappedProperties.push(property);\n } // add to core style if necessary\n\n\n var currentSelectorIsCore = !this[i].selector;\n\n if (currentSelectorIsCore) {\n this._private.coreStyle[property.name] = property;\n }\n }\n\n return this; // chaining\n};\n\nstyfn$8.append = function (style) {\n if (stylesheet(style)) {\n style.appendToStyle(this);\n } else if (array(style)) {\n this.appendFromJson(style);\n } else if (string(style)) {\n this.appendFromString(style);\n } // you probably wouldn't want to append a Style, since you'd duplicate the default parts\n\n\n return this;\n}; // static function\n\n\nStyle.fromJson = function (cy, json) {\n var style = new Style(cy);\n style.fromJson(json);\n return style;\n};\n\nStyle.fromString = function (cy, string) {\n return new Style(cy).fromString(string);\n};\n\n[styfn, styfn$1, styfn$2, styfn$3, styfn$4, styfn$5, styfn$6, styfn$7].forEach(function (props) {\n extend(styfn$8, props);\n});\nStyle.types = styfn$8.types;\nStyle.properties = styfn$8.properties;\nStyle.propertyGroups = styfn$8.propertyGroups;\nStyle.propertyGroupNames = styfn$8.propertyGroupNames;\nStyle.propertyGroupKeys = styfn$8.propertyGroupKeys;\n\nvar corefn$7 = {\n style: function style(newStyle) {\n if (newStyle) {\n var s = this.setStyle(newStyle);\n s.update();\n }\n\n return this._private.style;\n },\n setStyle: function setStyle(style) {\n var _p = this._private;\n\n if (stylesheet(style)) {\n _p.style = style.generateStyle(this);\n } else if (array(style)) {\n _p.style = Style.fromJson(this, style);\n } else if (string(style)) {\n _p.style = Style.fromString(this, style);\n } else {\n _p.style = Style(this);\n }\n\n return _p.style;\n }\n};\n\nvar defaultSelectionType = 'single';\nvar corefn$8 = {\n autolock: function autolock(bool) {\n if (bool !== undefined) {\n this._private.autolock = bool ? true : false;\n } else {\n return this._private.autolock;\n }\n\n return this; // chaining\n },\n autoungrabify: function autoungrabify(bool) {\n if (bool !== undefined) {\n this._private.autoungrabify = bool ? true : false;\n } else {\n return this._private.autoungrabify;\n }\n\n return this; // chaining\n },\n autounselectify: function autounselectify(bool) {\n if (bool !== undefined) {\n this._private.autounselectify = bool ? true : false;\n } else {\n return this._private.autounselectify;\n }\n\n return this; // chaining\n },\n selectionType: function selectionType(selType) {\n var _p = this._private;\n\n if (_p.selectionType == null) {\n _p.selectionType = defaultSelectionType;\n }\n\n if (selType !== undefined) {\n if (selType === 'additive' || selType === 'single') {\n _p.selectionType = selType;\n }\n } else {\n return _p.selectionType;\n }\n\n return this;\n },\n panningEnabled: function panningEnabled(bool) {\n if (bool !== undefined) {\n this._private.panningEnabled = bool ? true : false;\n } else {\n return this._private.panningEnabled;\n }\n\n return this; // chaining\n },\n userPanningEnabled: function userPanningEnabled(bool) {\n if (bool !== undefined) {\n this._private.userPanningEnabled = bool ? true : false;\n } else {\n return this._private.userPanningEnabled;\n }\n\n return this; // chaining\n },\n zoomingEnabled: function zoomingEnabled(bool) {\n if (bool !== undefined) {\n this._private.zoomingEnabled = bool ? true : false;\n } else {\n return this._private.zoomingEnabled;\n }\n\n return this; // chaining\n },\n userZoomingEnabled: function userZoomingEnabled(bool) {\n if (bool !== undefined) {\n this._private.userZoomingEnabled = bool ? true : false;\n } else {\n return this._private.userZoomingEnabled;\n }\n\n return this; // chaining\n },\n boxSelectionEnabled: function boxSelectionEnabled(bool) {\n if (bool !== undefined) {\n this._private.boxSelectionEnabled = bool ? true : false;\n } else {\n return this._private.boxSelectionEnabled;\n }\n\n return this; // chaining\n },\n pan: function pan() {\n var args = arguments;\n var pan = this._private.pan;\n var dim, val, dims, x, y;\n\n switch (args.length) {\n case 0:\n // .pan()\n return pan;\n\n case 1:\n if (string(args[0])) {\n // .pan('x')\n dim = args[0];\n return pan[dim];\n } else if (plainObject(args[0])) {\n // .pan({ x: 0, y: 100 })\n if (!this._private.panningEnabled) {\n return this;\n }\n\n dims = args[0];\n x = dims.x;\n y = dims.y;\n\n if (number(x)) {\n pan.x = x;\n }\n\n if (number(y)) {\n pan.y = y;\n }\n\n this.emit('pan viewport');\n }\n\n break;\n\n case 2:\n // .pan('x', 100)\n if (!this._private.panningEnabled) {\n return this;\n }\n\n dim = args[0];\n val = args[1];\n\n if ((dim === 'x' || dim === 'y') && number(val)) {\n pan[dim] = val;\n }\n\n this.emit('pan viewport');\n break;\n // invalid\n }\n\n this.notify('viewport');\n return this; // chaining\n },\n panBy: function panBy(arg0, arg1) {\n var args = arguments;\n var pan = this._private.pan;\n var dim, val, dims, x, y;\n\n if (!this._private.panningEnabled) {\n return this;\n }\n\n switch (args.length) {\n case 1:\n if (plainObject(arg0)) {\n // .panBy({ x: 0, y: 100 })\n dims = args[0];\n x = dims.x;\n y = dims.y;\n\n if (number(x)) {\n pan.x += x;\n }\n\n if (number(y)) {\n pan.y += y;\n }\n\n this.emit('pan viewport');\n }\n\n break;\n\n case 2:\n // .panBy('x', 100)\n dim = arg0;\n val = arg1;\n\n if ((dim === 'x' || dim === 'y') && number(val)) {\n pan[dim] += val;\n }\n\n this.emit('pan viewport');\n break;\n // invalid\n }\n\n this.notify('viewport');\n return this; // chaining\n },\n fit: function fit(elements, padding) {\n var viewportState = this.getFitViewport(elements, padding);\n\n if (viewportState) {\n var _p = this._private;\n _p.zoom = viewportState.zoom;\n _p.pan = viewportState.pan;\n this.emit('pan zoom viewport');\n this.notify('viewport');\n }\n\n return this; // chaining\n },\n getFitViewport: function getFitViewport(elements, padding) {\n if (number(elements) && padding === undefined) {\n // elements is optional\n padding = elements;\n elements = undefined;\n }\n\n if (!this._private.panningEnabled || !this._private.zoomingEnabled) {\n return;\n }\n\n var bb;\n\n if (string(elements)) {\n var sel = elements;\n elements = this.$(sel);\n } else if (boundingBox(elements)) {\n // assume bb\n var bbe = elements;\n bb = {\n x1: bbe.x1,\n y1: bbe.y1,\n x2: bbe.x2,\n y2: bbe.y2\n };\n bb.w = bb.x2 - bb.x1;\n bb.h = bb.y2 - bb.y1;\n } else if (!elementOrCollection(elements)) {\n elements = this.mutableElements();\n }\n\n if (elementOrCollection(elements) && elements.empty()) {\n return;\n } // can't fit to nothing\n\n\n bb = bb || elements.boundingBox();\n var w = this.width();\n var h = this.height();\n var zoom;\n padding = number(padding) ? padding : 0;\n\n if (!isNaN(w) && !isNaN(h) && w > 0 && h > 0 && !isNaN(bb.w) && !isNaN(bb.h) && bb.w > 0 && bb.h > 0) {\n zoom = Math.min((w - 2 * padding) / bb.w, (h - 2 * padding) / bb.h); // crop zoom\n\n zoom = zoom > this._private.maxZoom ? this._private.maxZoom : zoom;\n zoom = zoom < this._private.minZoom ? this._private.minZoom : zoom;\n var pan = {\n // now pan to middle\n x: (w - zoom * (bb.x1 + bb.x2)) / 2,\n y: (h - zoom * (bb.y1 + bb.y2)) / 2\n };\n return {\n zoom: zoom,\n pan: pan\n };\n }\n\n return;\n },\n zoomRange: function zoomRange(min, max) {\n var _p = this._private;\n\n if (max == null) {\n var opts = min;\n min = opts.min;\n max = opts.max;\n }\n\n if (number(min) && number(max) && min <= max) {\n _p.minZoom = min;\n _p.maxZoom = max;\n } else if (number(min) && max === undefined && min <= _p.maxZoom) {\n _p.minZoom = min;\n } else if (number(max) && min === undefined && max >= _p.minZoom) {\n _p.maxZoom = max;\n }\n\n return this;\n },\n minZoom: function minZoom(zoom) {\n if (zoom === undefined) {\n return this._private.minZoom;\n } else {\n return this.zoomRange({\n min: zoom\n });\n }\n },\n maxZoom: function maxZoom(zoom) {\n if (zoom === undefined) {\n return this._private.maxZoom;\n } else {\n return this.zoomRange({\n max: zoom\n });\n }\n },\n getZoomedViewport: function getZoomedViewport(params) {\n var _p = this._private;\n var currentPan = _p.pan;\n var currentZoom = _p.zoom;\n var pos; // in rendered px\n\n var zoom;\n var bail = false;\n\n if (!_p.zoomingEnabled) {\n // zooming disabled\n bail = true;\n }\n\n if (number(params)) {\n // then set the zoom\n zoom = params;\n } else if (plainObject(params)) {\n // then zoom about a point\n zoom = params.level;\n\n if (params.position != null) {\n pos = modelToRenderedPosition(params.position, currentZoom, currentPan);\n } else if (params.renderedPosition != null) {\n pos = params.renderedPosition;\n }\n\n if (pos != null && !_p.panningEnabled) {\n // panning disabled\n bail = true;\n }\n } // crop zoom\n\n\n zoom = zoom > _p.maxZoom ? _p.maxZoom : zoom;\n zoom = zoom < _p.minZoom ? _p.minZoom : zoom; // can't zoom with invalid params\n\n if (bail || !number(zoom) || zoom === currentZoom || pos != null && (!number(pos.x) || !number(pos.y))) {\n return null;\n }\n\n if (pos != null) {\n // set zoom about position\n var pan1 = currentPan;\n var zoom1 = currentZoom;\n var zoom2 = zoom;\n var pan2 = {\n x: -zoom2 / zoom1 * (pos.x - pan1.x) + pos.x,\n y: -zoom2 / zoom1 * (pos.y - pan1.y) + pos.y\n };\n return {\n zoomed: true,\n panned: true,\n zoom: zoom2,\n pan: pan2\n };\n } else {\n // just set the zoom\n return {\n zoomed: true,\n panned: false,\n zoom: zoom,\n pan: currentPan\n };\n }\n },\n zoom: function zoom(params) {\n if (params === undefined) {\n // get\n return this._private.zoom;\n } else {\n // set\n var vp = this.getZoomedViewport(params);\n var _p = this._private;\n\n if (vp == null || !vp.zoomed) {\n return this;\n }\n\n _p.zoom = vp.zoom;\n\n if (vp.panned) {\n _p.pan.x = vp.pan.x;\n _p.pan.y = vp.pan.y;\n }\n\n this.emit('zoom' + (vp.panned ? ' pan' : '') + ' viewport');\n this.notify('viewport');\n return this; // chaining\n }\n },\n viewport: function viewport(opts) {\n var _p = this._private;\n var zoomDefd = true;\n var panDefd = true;\n var events = []; // to trigger\n\n var zoomFailed = false;\n var panFailed = false;\n\n if (!opts) {\n return this;\n }\n\n if (!number(opts.zoom)) {\n zoomDefd = false;\n }\n\n if (!plainObject(opts.pan)) {\n panDefd = false;\n }\n\n if (!zoomDefd && !panDefd) {\n return this;\n }\n\n if (zoomDefd) {\n var z = opts.zoom;\n\n if (z < _p.minZoom || z > _p.maxZoom || !_p.zoomingEnabled) {\n zoomFailed = true;\n } else {\n _p.zoom = z;\n events.push('zoom');\n }\n }\n\n if (panDefd && (!zoomFailed || !opts.cancelOnFailedZoom) && _p.panningEnabled) {\n var p = opts.pan;\n\n if (number(p.x)) {\n _p.pan.x = p.x;\n panFailed = false;\n }\n\n if (number(p.y)) {\n _p.pan.y = p.y;\n panFailed = false;\n }\n\n if (!panFailed) {\n events.push('pan');\n }\n }\n\n if (events.length > 0) {\n events.push('viewport');\n this.emit(events.join(' '));\n this.notify('viewport');\n }\n\n return this; // chaining\n },\n center: function center(elements) {\n var pan = this.getCenterPan(elements);\n\n if (pan) {\n this._private.pan = pan;\n this.emit('pan viewport');\n this.notify('viewport');\n }\n\n return this; // chaining\n },\n getCenterPan: function getCenterPan(elements, zoom) {\n if (!this._private.panningEnabled) {\n return;\n }\n\n if (string(elements)) {\n var selector = elements;\n elements = this.mutableElements().filter(selector);\n } else if (!elementOrCollection(elements)) {\n elements = this.mutableElements();\n }\n\n if (elements.length === 0) {\n return;\n } // can't centre pan to nothing\n\n\n var bb = elements.boundingBox();\n var w = this.width();\n var h = this.height();\n zoom = zoom === undefined ? this._private.zoom : zoom;\n var pan = {\n // middle\n x: (w - zoom * (bb.x1 + bb.x2)) / 2,\n y: (h - zoom * (bb.y1 + bb.y2)) / 2\n };\n return pan;\n },\n reset: function reset() {\n if (!this._private.panningEnabled || !this._private.zoomingEnabled) {\n return this;\n }\n\n this.viewport({\n pan: {\n x: 0,\n y: 0\n },\n zoom: 1\n });\n return this; // chaining\n },\n invalidateSize: function invalidateSize() {\n this._private.sizeCache = null;\n },\n size: function size() {\n var _p = this._private;\n var container = _p.container;\n return _p.sizeCache = _p.sizeCache || (container ? function () {\n var style = window$1.getComputedStyle(container);\n\n var val = function val(name) {\n return parseFloat(style.getPropertyValue(name));\n };\n\n return {\n width: container.clientWidth - val('padding-left') - val('padding-right'),\n height: container.clientHeight - val('padding-top') - val('padding-bottom')\n };\n }() : {\n // fallback if no container (not 0 b/c can be used for dividing etc)\n width: 1,\n height: 1\n });\n },\n width: function width() {\n return this.size().width;\n },\n height: function height() {\n return this.size().height;\n },\n extent: function extent() {\n var pan = this._private.pan;\n var zoom = this._private.zoom;\n var rb = this.renderedExtent();\n var b = {\n x1: (rb.x1 - pan.x) / zoom,\n x2: (rb.x2 - pan.x) / zoom,\n y1: (rb.y1 - pan.y) / zoom,\n y2: (rb.y2 - pan.y) / zoom\n };\n b.w = b.x2 - b.x1;\n b.h = b.y2 - b.y1;\n return b;\n },\n renderedExtent: function renderedExtent() {\n var width = this.width();\n var height = this.height();\n return {\n x1: 0,\n y1: 0,\n x2: width,\n y2: height,\n w: width,\n h: height\n };\n }\n}; // aliases\n\ncorefn$8.centre = corefn$8.center; // backwards compatibility\n\ncorefn$8.autolockNodes = corefn$8.autolock;\ncorefn$8.autoungrabifyNodes = corefn$8.autoungrabify;\n\nvar fn$6 = {\n data: define$3.data({\n field: 'data',\n bindingEvent: 'data',\n allowBinding: true,\n allowSetting: true,\n settingEvent: 'data',\n settingTriggersEvent: true,\n triggerFnName: 'trigger',\n allowGetting: true\n }),\n removeData: define$3.removeData({\n field: 'data',\n event: 'data',\n triggerFnName: 'trigger',\n triggerEvent: true\n }),\n scratch: define$3.data({\n field: 'scratch',\n bindingEvent: 'scratch',\n allowBinding: true,\n allowSetting: true,\n settingEvent: 'scratch',\n settingTriggersEvent: true,\n triggerFnName: 'trigger',\n allowGetting: true\n }),\n removeScratch: define$3.removeData({\n field: 'scratch',\n event: 'scratch',\n triggerFnName: 'trigger',\n triggerEvent: true\n })\n}; // aliases\n\nfn$6.attr = fn$6.data;\nfn$6.removeAttr = fn$6.removeData;\n\nvar Core = function Core(opts) {\n var cy = this;\n opts = extend({}, opts);\n var container = opts.container; // allow for passing a wrapped jquery object\n // e.g. cytoscape({ container: $('#cy') })\n\n if (container && !htmlElement(container) && htmlElement(container[0])) {\n container = container[0];\n }\n\n var reg = container ? container._cyreg : null; // e.g. already registered some info (e.g. readies) via jquery\n\n reg = reg || {};\n\n if (reg && reg.cy) {\n reg.cy.destroy();\n reg = {}; // old instance => replace reg completely\n }\n\n var readies = reg.readies = reg.readies || [];\n\n if (container) {\n container._cyreg = reg;\n } // make sure container assoc'd reg points to this cy\n\n\n reg.cy = cy;\n var head = window$1 !== undefined && container !== undefined && !opts.headless;\n var options = opts;\n options.layout = extend({\n name: head ? 'grid' : 'null'\n }, options.layout);\n options.renderer = extend({\n name: head ? 'canvas' : 'null'\n }, options.renderer);\n\n var defVal = function defVal(def, val, altVal) {\n if (val !== undefined) {\n return val;\n } else if (altVal !== undefined) {\n return altVal;\n } else {\n return def;\n }\n };\n\n var _p = this._private = {\n container: container,\n // html dom ele container\n ready: false,\n // whether ready has been triggered\n options: options,\n // cached options\n elements: new Collection(this),\n // elements in the graph\n listeners: [],\n // list of listeners\n aniEles: new Collection(this),\n // elements being animated\n data: {},\n // data for the core\n scratch: {},\n // scratch object for core\n layout: null,\n renderer: null,\n destroyed: false,\n // whether destroy was called\n notificationsEnabled: true,\n // whether notifications are sent to the renderer\n minZoom: 1e-50,\n maxZoom: 1e50,\n zoomingEnabled: defVal(true, options.zoomingEnabled),\n userZoomingEnabled: defVal(true, options.userZoomingEnabled),\n panningEnabled: defVal(true, options.panningEnabled),\n userPanningEnabled: defVal(true, options.userPanningEnabled),\n boxSelectionEnabled: defVal(true, options.boxSelectionEnabled),\n autolock: defVal(false, options.autolock, options.autolockNodes),\n autoungrabify: defVal(false, options.autoungrabify, options.autoungrabifyNodes),\n autounselectify: defVal(false, options.autounselectify),\n styleEnabled: options.styleEnabled === undefined ? head : options.styleEnabled,\n zoom: number(options.zoom) ? options.zoom : 1,\n pan: {\n x: plainObject(options.pan) && number(options.pan.x) ? options.pan.x : 0,\n y: plainObject(options.pan) && number(options.pan.y) ? options.pan.y : 0\n },\n animation: {\n // object for currently-running animations\n current: [],\n queue: []\n },\n hasCompoundNodes: false\n };\n\n this.createEmitter(); // set selection type\n\n this.selectionType(options.selectionType); // init zoom bounds\n\n this.zoomRange({\n min: options.minZoom,\n max: options.maxZoom\n });\n\n var loadExtData = function loadExtData(extData, next) {\n var anyIsPromise = extData.some(promise);\n\n if (anyIsPromise) {\n return Promise$1.all(extData).then(next); // load all data asynchronously, then exec rest of init\n } else {\n next(extData); // exec synchronously for convenience\n }\n }; // start with the default stylesheet so we have something before loading an external stylesheet\n\n\n if (_p.styleEnabled) {\n cy.setStyle([]);\n } // create the renderer\n\n\n var rendererOptions = extend({}, options, options.renderer); // allow rendering hints in top level options\n\n cy.initRenderer(rendererOptions);\n\n var setElesAndLayout = function setElesAndLayout(elements, onload, ondone) {\n cy.notifications(false); // remove old elements\n\n var oldEles = cy.mutableElements();\n\n if (oldEles.length > 0) {\n oldEles.remove();\n }\n\n if (elements != null) {\n if (plainObject(elements) || array(elements)) {\n cy.add(elements);\n }\n }\n\n cy.one('layoutready', function (e) {\n cy.notifications(true);\n cy.emit(e); // we missed this event by turning notifications off, so pass it on\n\n cy.one('load', onload);\n cy.emitAndNotify('load');\n }).one('layoutstop', function () {\n cy.one('done', ondone);\n cy.emit('done');\n });\n var layoutOpts = extend({}, cy._private.options.layout);\n layoutOpts.eles = cy.elements();\n cy.layout(layoutOpts).run();\n };\n\n loadExtData([options.style, options.elements], function (thens) {\n var initStyle = thens[0];\n var initEles = thens[1]; // init style\n\n if (_p.styleEnabled) {\n cy.style().append(initStyle);\n } // initial load\n\n\n setElesAndLayout(initEles, function () {\n // onready\n cy.startAnimationLoop();\n _p.ready = true; // if a ready callback is specified as an option, the bind it\n\n if (fn(options.ready)) {\n cy.on('ready', options.ready);\n } // bind all the ready handlers registered before creating this instance\n\n\n for (var i = 0; i < readies.length; i++) {\n var fn$1 = readies[i];\n cy.on('ready', fn$1);\n }\n\n if (reg) {\n reg.readies = [];\n } // clear b/c we've bound them all and don't want to keep it around in case a new core uses the same div etc\n\n\n cy.emit('ready');\n }, options.done);\n });\n};\n\nvar corefn$9 = Core.prototype; // short alias\n\nextend(corefn$9, {\n instanceString: function instanceString() {\n return 'core';\n },\n isReady: function isReady() {\n return this._private.ready;\n },\n destroyed: function destroyed() {\n return this._private.destroyed;\n },\n ready: function ready(fn) {\n if (this.isReady()) {\n this.emitter().emit('ready', [], fn); // just calls fn as though triggered via ready event\n } else {\n this.on('ready', fn);\n }\n\n return this;\n },\n destroy: function destroy() {\n var cy = this;\n if (cy.destroyed()) return;\n cy.stopAnimationLoop();\n cy.destroyRenderer();\n this.emit('destroy');\n cy._private.destroyed = true;\n return cy;\n },\n hasElementWithId: function hasElementWithId(id) {\n return this._private.elements.hasElementWithId(id);\n },\n getElementById: function getElementById(id) {\n return this._private.elements.getElementById(id);\n },\n hasCompoundNodes: function hasCompoundNodes() {\n return this._private.hasCompoundNodes;\n },\n headless: function headless() {\n return this._private.renderer.isHeadless();\n },\n styleEnabled: function styleEnabled() {\n return this._private.styleEnabled;\n },\n addToPool: function addToPool(eles) {\n this._private.elements.merge(eles);\n\n return this; // chaining\n },\n removeFromPool: function removeFromPool(eles) {\n this._private.elements.unmerge(eles);\n\n return this;\n },\n container: function container() {\n return this._private.container || null;\n },\n mount: function mount(container) {\n if (container == null) {\n return;\n }\n\n var cy = this;\n var _p = cy._private;\n var options = _p.options;\n\n if (!htmlElement(container) && htmlElement(container[0])) {\n container = container[0];\n }\n\n cy.stopAnimationLoop();\n cy.destroyRenderer();\n _p.container = container;\n _p.styleEnabled = true;\n cy.invalidateSize();\n cy.initRenderer(extend({}, options, options.renderer, {\n // allow custom renderer name to be re-used, otherwise use canvas\n name: options.renderer.name === 'null' ? 'canvas' : options.renderer.name\n }));\n cy.startAnimationLoop();\n cy.style(options.style);\n cy.emit('mount');\n return cy;\n },\n unmount: function unmount() {\n var cy = this;\n cy.stopAnimationLoop();\n cy.destroyRenderer();\n cy.initRenderer({\n name: 'null'\n });\n cy.emit('unmount');\n return cy;\n },\n options: function options() {\n return copy(this._private.options);\n },\n json: function json(obj) {\n var cy = this;\n var _p = cy._private;\n var eles = cy.mutableElements();\n\n var getFreshRef = function getFreshRef(ele) {\n return cy.getElementById(ele.id());\n };\n\n if (plainObject(obj)) {\n // set\n cy.startBatch();\n\n if (obj.elements) {\n var idInJson = {};\n\n var updateEles = function updateEles(jsons, gr) {\n var toAdd = [];\n var toMod = [];\n\n for (var i = 0; i < jsons.length; i++) {\n var json = jsons[i];\n var id = '' + json.data.id; // id must be string\n\n var ele = cy.getElementById(id);\n idInJson[id] = true;\n\n if (ele.length !== 0) {\n // existing element should be updated\n toMod.push({\n ele: ele,\n json: json\n });\n } else {\n // otherwise should be added\n if (gr) {\n json.group = gr;\n toAdd.push(json);\n } else {\n toAdd.push(json);\n }\n }\n }\n\n cy.add(toAdd);\n\n for (var _i = 0; _i < toMod.length; _i++) {\n var _toMod$_i = toMod[_i],\n _ele = _toMod$_i.ele,\n _json = _toMod$_i.json;\n\n _ele.json(_json);\n }\n };\n\n if (array(obj.elements)) {\n // elements: []\n updateEles(obj.elements);\n } else {\n // elements: { nodes: [], edges: [] }\n var grs = ['nodes', 'edges'];\n\n for (var i = 0; i < grs.length; i++) {\n var gr = grs[i];\n var elements = obj.elements[gr];\n\n if (array(elements)) {\n updateEles(elements, gr);\n }\n }\n }\n\n var parentsToRemove = cy.collection();\n eles.filter(function (ele) {\n return !idInJson[ele.id()];\n }).forEach(function (ele) {\n if (ele.isParent()) {\n parentsToRemove.merge(ele);\n } else {\n ele.remove();\n }\n }); // so that children are not removed w/parent\n\n parentsToRemove.forEach(function (ele) {\n return ele.children().move({\n parent: null\n });\n }); // intermediate parents may be moved by prior line, so make sure we remove by fresh refs\n\n parentsToRemove.forEach(function (ele) {\n return getFreshRef(ele).remove();\n });\n }\n\n if (obj.style) {\n cy.style(obj.style);\n }\n\n if (obj.zoom != null && obj.zoom !== _p.zoom) {\n cy.zoom(obj.zoom);\n }\n\n if (obj.pan) {\n if (obj.pan.x !== _p.pan.x || obj.pan.y !== _p.pan.y) {\n cy.pan(obj.pan);\n }\n }\n\n if (obj.data) {\n cy.data(obj.data);\n }\n\n var fields = ['minZoom', 'maxZoom', 'zoomingEnabled', 'userZoomingEnabled', 'panningEnabled', 'userPanningEnabled', 'boxSelectionEnabled', 'autolock', 'autoungrabify', 'autounselectify'];\n\n for (var _i2 = 0; _i2 < fields.length; _i2++) {\n var f = fields[_i2];\n\n if (obj[f] != null) {\n cy[f](obj[f]);\n }\n }\n\n cy.endBatch();\n return this; // chaining\n } else {\n // get\n var flat = !!obj;\n var json = {};\n\n if (flat) {\n json.elements = this.elements().map(function (ele) {\n return ele.json();\n });\n } else {\n json.elements = {};\n eles.forEach(function (ele) {\n var group = ele.group();\n\n if (!json.elements[group]) {\n json.elements[group] = [];\n }\n\n json.elements[group].push(ele.json());\n });\n }\n\n if (this._private.styleEnabled) {\n json.style = cy.style().json();\n }\n\n json.data = copy(cy.data());\n var options = _p.options;\n json.zoomingEnabled = _p.zoomingEnabled;\n json.userZoomingEnabled = _p.userZoomingEnabled;\n json.zoom = _p.zoom;\n json.minZoom = _p.minZoom;\n json.maxZoom = _p.maxZoom;\n json.panningEnabled = _p.panningEnabled;\n json.userPanningEnabled = _p.userPanningEnabled;\n json.pan = copy(_p.pan);\n json.boxSelectionEnabled = _p.boxSelectionEnabled;\n json.renderer = copy(options.renderer);\n json.hideEdgesOnViewport = options.hideEdgesOnViewport;\n json.textureOnViewport = options.textureOnViewport;\n json.wheelSensitivity = options.wheelSensitivity;\n json.motionBlur = options.motionBlur;\n return json;\n }\n }\n});\ncorefn$9.$id = corefn$9.getElementById;\n[corefn, corefn$1, elesfn$v, corefn$2, corefn$3, corefn$4, corefn$5, corefn$6, corefn$7, corefn$8, fn$6].forEach(function (props) {\n extend(corefn$9, props);\n});\n\n/* eslint-disable no-unused-vars */\n\nvar defaults$9 = {\n fit: true,\n // whether to fit the viewport to the graph\n directed: false,\n // whether the tree is directed downwards (or edges can point in any direction if false)\n padding: 30,\n // padding on fit\n circle: false,\n // put depths in concentric circles if true, put depths top down if false\n grid: false,\n // whether to create an even grid into which the DAG is placed (circle:false only)\n spacingFactor: 1.75,\n // positive spacing factor, larger => more space between nodes (N.B. n/a if causes overlap)\n boundingBox: undefined,\n // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n avoidOverlap: true,\n // prevents node overlap, may overflow boundingBox if not enough space\n nodeDimensionsIncludeLabels: false,\n // Excludes the label when calculating node bounding boxes for the layout algorithm\n roots: undefined,\n // the roots of the trees\n maximal: false,\n // whether to shift nodes down their natural BFS depths in order to avoid upwards edges (DAGS only)\n animate: false,\n // whether to transition the node positions\n animationDuration: 500,\n // duration of animation in ms if enabled\n animationEasing: undefined,\n // easing of animation if enabled,\n animateFilter: function animateFilter(node, i) {\n return true;\n },\n // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts\n ready: undefined,\n // callback on layoutready\n stop: undefined,\n // callback on layoutstop\n transform: function transform(node, position) {\n return position;\n } // transform a given node position. Useful for changing flow direction in discrete layouts\n\n};\n/* eslint-enable */\n\nvar getInfo = function getInfo(ele) {\n return ele.scratch('breadthfirst');\n};\n\nvar setInfo = function setInfo(ele, obj) {\n return ele.scratch('breadthfirst', obj);\n};\n\nfunction BreadthFirstLayout(options) {\n this.options = extend({}, defaults$9, options);\n}\n\nBreadthFirstLayout.prototype.run = function () {\n var params = this.options;\n var options = params;\n var cy = params.cy;\n var eles = options.eles;\n var nodes = eles.nodes().filter(function (n) {\n return !n.isParent();\n });\n var graph = eles;\n var directed = options.directed;\n var maximal = options.maximal || options.maximalAdjustments > 0; // maximalAdjustments for compat. w/ old code\n\n var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n x1: 0,\n y1: 0,\n w: cy.width(),\n h: cy.height()\n });\n var roots;\n\n if (elementOrCollection(options.roots)) {\n roots = options.roots;\n } else if (array(options.roots)) {\n var rootsArray = [];\n\n for (var i = 0; i < options.roots.length; i++) {\n var id = options.roots[i];\n var ele = cy.getElementById(id);\n rootsArray.push(ele);\n }\n\n roots = cy.collection(rootsArray);\n } else if (string(options.roots)) {\n roots = cy.$(options.roots);\n } else {\n if (directed) {\n roots = nodes.roots();\n } else {\n var components = eles.components();\n roots = cy.collection();\n\n var _loop = function _loop(_i) {\n var comp = components[_i];\n var maxDegree = comp.maxDegree(false);\n var compRoots = comp.filter(function (ele) {\n return ele.degree(false) === maxDegree;\n });\n roots = roots.add(compRoots);\n };\n\n for (var _i = 0; _i < components.length; _i++) {\n _loop(_i);\n }\n }\n }\n\n var depths = [];\n var foundByBfs = {};\n\n var addToDepth = function addToDepth(ele, d) {\n if (depths[d] == null) {\n depths[d] = [];\n }\n\n var i = depths[d].length;\n depths[d].push(ele);\n setInfo(ele, {\n index: i,\n depth: d\n });\n };\n\n var changeDepth = function changeDepth(ele, newDepth) {\n var _getInfo = getInfo(ele),\n depth = _getInfo.depth,\n index = _getInfo.index;\n\n depths[depth][index] = null;\n addToDepth(ele, newDepth);\n }; // find the depths of the nodes\n\n\n graph.bfs({\n roots: roots,\n directed: options.directed,\n visit: function visit(node, edge, pNode, i, depth) {\n var ele = node[0];\n var id = ele.id();\n addToDepth(ele, depth);\n foundByBfs[id] = true;\n }\n }); // check for nodes not found by bfs\n\n var orphanNodes = [];\n\n for (var _i2 = 0; _i2 < nodes.length; _i2++) {\n var _ele = nodes[_i2];\n\n if (foundByBfs[_ele.id()]) {\n continue;\n } else {\n orphanNodes.push(_ele);\n }\n } // assign the nodes a depth and index\n\n\n var assignDepthsAt = function assignDepthsAt(i) {\n var eles = depths[i];\n\n for (var j = 0; j < eles.length; j++) {\n var _ele2 = eles[j];\n\n if (_ele2 == null) {\n eles.splice(j, 1);\n j--;\n continue;\n }\n\n setInfo(_ele2, {\n depth: i,\n index: j\n });\n }\n };\n\n var assignDepths = function assignDepths() {\n for (var _i3 = 0; _i3 < depths.length; _i3++) {\n assignDepthsAt(_i3);\n }\n };\n\n var adjustMaximally = function adjustMaximally(ele, shifted) {\n var eInfo = getInfo(ele);\n var incomers = ele.incomers().filter(function (el) {\n return el.isNode() && eles.has(el);\n });\n var maxDepth = -1;\n var id = ele.id();\n\n for (var k = 0; k < incomers.length; k++) {\n var incmr = incomers[k];\n var iInfo = getInfo(incmr);\n maxDepth = Math.max(maxDepth, iInfo.depth);\n }\n\n if (eInfo.depth <= maxDepth) {\n if (shifted[id]) {\n return null;\n }\n\n changeDepth(ele, maxDepth + 1);\n shifted[id] = true;\n return true;\n }\n\n return false;\n }; // for the directed case, try to make the edges all go down (i.e. depth i => depth i + 1)\n\n\n if (directed && maximal) {\n var Q = [];\n var shifted = {};\n\n var enqueue = function enqueue(n) {\n return Q.push(n);\n };\n\n var dequeue = function dequeue() {\n return Q.shift();\n };\n\n nodes.forEach(function (n) {\n return Q.push(n);\n });\n\n while (Q.length > 0) {\n var _ele3 = dequeue();\n\n var didShift = adjustMaximally(_ele3, shifted);\n\n if (didShift) {\n _ele3.outgoers().filter(function (el) {\n return el.isNode() && eles.has(el);\n }).forEach(enqueue);\n } else if (didShift === null) {\n warn('Detected double maximal shift for node `' + _ele3.id() + '`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.');\n break; // exit on failure\n }\n }\n }\n\n assignDepths(); // clear holes\n // find min distance we need to leave between nodes\n\n var minDistance = 0;\n\n if (options.avoidOverlap) {\n for (var _i4 = 0; _i4 < nodes.length; _i4++) {\n var n = nodes[_i4];\n var nbb = n.layoutDimensions(options);\n var w = nbb.w;\n var h = nbb.h;\n minDistance = Math.max(minDistance, w, h);\n }\n } // get the weighted percent for an element based on its connectivity to other levels\n\n\n var cachedWeightedPercent = {};\n\n var getWeightedPercent = function getWeightedPercent(ele) {\n if (cachedWeightedPercent[ele.id()]) {\n return cachedWeightedPercent[ele.id()];\n }\n\n var eleDepth = getInfo(ele).depth;\n var neighbors = ele.neighborhood();\n var percent = 0;\n var samples = 0;\n\n for (var _i5 = 0; _i5 < neighbors.length; _i5++) {\n var neighbor = neighbors[_i5];\n\n if (neighbor.isEdge() || neighbor.isParent() || !nodes.has(neighbor)) {\n continue;\n }\n\n var bf = getInfo(neighbor);\n var index = bf.index;\n var depth = bf.depth; // unassigned neighbours shouldn't affect the ordering\n\n if (index == null || depth == null) {\n continue;\n }\n\n var nDepth = depths[depth].length;\n\n if (depth < eleDepth) {\n // only get influenced by elements above\n percent += index / nDepth;\n samples++;\n }\n }\n\n samples = Math.max(1, samples);\n percent = percent / samples;\n\n if (samples === 0) {\n // put lone nodes at the start\n percent = 0;\n }\n\n cachedWeightedPercent[ele.id()] = percent;\n return percent;\n }; // rearrange the indices in each depth level based on connectivity\n\n\n var sortFn = function sortFn(a, b) {\n var apct = getWeightedPercent(a);\n var bpct = getWeightedPercent(b);\n var diff = apct - bpct;\n\n if (diff === 0) {\n return ascending(a.id(), b.id()); // make sure sort doesn't have don't-care comparisons\n } else {\n return diff;\n }\n }; // sort each level to make connected nodes closer\n\n\n for (var _i6 = 0; _i6 < depths.length; _i6++) {\n depths[_i6].sort(sortFn);\n\n assignDepthsAt(_i6);\n } // assign orphan nodes to a new top-level depth\n\n\n var orphanDepth = [];\n\n for (var _i7 = 0; _i7 < orphanNodes.length; _i7++) {\n orphanDepth.push(orphanNodes[_i7]);\n }\n\n depths.unshift(orphanDepth);\n assignDepths();\n var biggestDepthSize = 0;\n\n for (var _i8 = 0; _i8 < depths.length; _i8++) {\n biggestDepthSize = Math.max(depths[_i8].length, biggestDepthSize);\n }\n\n var center = {\n x: bb.x1 + bb.w / 2,\n y: bb.x1 + bb.h / 2\n };\n var maxDepthSize = depths.reduce(function (max, eles) {\n return Math.max(max, eles.length);\n }, 0);\n\n var getPosition = function getPosition(ele) {\n var _getInfo2 = getInfo(ele),\n depth = _getInfo2.depth,\n index = _getInfo2.index;\n\n var depthSize = depths[depth].length;\n var distanceX = Math.max(bb.w / ((options.grid ? maxDepthSize : depthSize) + 1), minDistance);\n var distanceY = Math.max(bb.h / (depths.length + 1), minDistance);\n var radiusStepSize = Math.min(bb.w / 2 / depths.length, bb.h / 2 / depths.length);\n radiusStepSize = Math.max(radiusStepSize, minDistance);\n\n if (!options.circle) {\n var epos = {\n x: center.x + (index + 1 - (depthSize + 1) / 2) * distanceX,\n y: (depth + 1) * distanceY\n };\n return epos;\n } else {\n var radius = radiusStepSize * depth + radiusStepSize - (depths.length > 0 && depths[0].length <= 3 ? radiusStepSize / 2 : 0);\n var theta = 2 * Math.PI / depths[depth].length * index;\n\n if (depth === 0 && depths[0].length === 1) {\n radius = 1;\n }\n\n return {\n x: center.x + radius * Math.cos(theta),\n y: center.y + radius * Math.sin(theta)\n };\n }\n };\n\n nodes.layoutPositions(this, options, getPosition);\n return this; // chaining\n};\n\nvar defaults$a = {\n fit: true,\n // whether to fit the viewport to the graph\n padding: 30,\n // the padding on fit\n boundingBox: undefined,\n // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n avoidOverlap: true,\n // prevents node overlap, may overflow boundingBox and radius if not enough space\n nodeDimensionsIncludeLabels: false,\n // Excludes the label when calculating node bounding boxes for the layout algorithm\n spacingFactor: undefined,\n // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n radius: undefined,\n // the radius of the circle\n startAngle: 3 / 2 * Math.PI,\n // where nodes start in radians\n sweep: undefined,\n // how many radians should be between the first and last node (defaults to full circle)\n clockwise: true,\n // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)\n sort: undefined,\n // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }\n animate: false,\n // whether to transition the node positions\n animationDuration: 500,\n // duration of animation in ms if enabled\n animationEasing: undefined,\n // easing of animation if enabled\n animateFilter: function animateFilter(node, i) {\n return true;\n },\n // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts\n ready: undefined,\n // callback on layoutready\n stop: undefined,\n // callback on layoutstop\n transform: function transform(node, position) {\n return position;\n } // transform a given node position. Useful for changing flow direction in discrete layouts \n\n};\n\nfunction CircleLayout(options) {\n this.options = extend({}, defaults$a, options);\n}\n\nCircleLayout.prototype.run = function () {\n var params = this.options;\n var options = params;\n var cy = params.cy;\n var eles = options.eles;\n var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise;\n var nodes = eles.nodes().not(':parent');\n\n if (options.sort) {\n nodes = nodes.sort(options.sort);\n }\n\n var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n x1: 0,\n y1: 0,\n w: cy.width(),\n h: cy.height()\n });\n var center = {\n x: bb.x1 + bb.w / 2,\n y: bb.y1 + bb.h / 2\n };\n var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / nodes.length : options.sweep;\n var dTheta = sweep / Math.max(1, nodes.length - 1);\n var r;\n var minDistance = 0;\n\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n var nbb = n.layoutDimensions(options);\n var w = nbb.w;\n var h = nbb.h;\n minDistance = Math.max(minDistance, w, h);\n }\n\n if (number(options.radius)) {\n r = options.radius;\n } else if (nodes.length <= 1) {\n r = 0;\n } else {\n r = Math.min(bb.h, bb.w) / 2 - minDistance;\n } // calculate the radius\n\n\n if (nodes.length > 1 && options.avoidOverlap) {\n // but only if more than one node (can't overlap)\n minDistance *= 1.75; // just to have some nice spacing\n\n var dcos = Math.cos(dTheta) - Math.cos(0);\n var dsin = Math.sin(dTheta) - Math.sin(0);\n var rMin = Math.sqrt(minDistance * minDistance / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping\n\n r = Math.max(rMin, r);\n }\n\n var getPos = function getPos(ele, i) {\n var theta = options.startAngle + i * dTheta * (clockwise ? 1 : -1);\n var rx = r * Math.cos(theta);\n var ry = r * Math.sin(theta);\n var pos = {\n x: center.x + rx,\n y: center.y + ry\n };\n return pos;\n };\n\n nodes.layoutPositions(this, options, getPos);\n return this; // chaining\n};\n\nvar defaults$b = {\n fit: true,\n // whether to fit the viewport to the graph\n padding: 30,\n // the padding on fit\n startAngle: 3 / 2 * Math.PI,\n // where nodes start in radians\n sweep: undefined,\n // how many radians should be between the first and last node (defaults to full circle)\n clockwise: true,\n // whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false)\n equidistant: false,\n // whether levels have an equal radial distance betwen them, may cause bounding box overflow\n minNodeSpacing: 10,\n // min spacing between outside of nodes (used for radius adjustment)\n boundingBox: undefined,\n // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n avoidOverlap: true,\n // prevents node overlap, may overflow boundingBox if not enough space\n nodeDimensionsIncludeLabels: false,\n // Excludes the label when calculating node bounding boxes for the layout algorithm\n height: undefined,\n // height of layout area (overrides container height)\n width: undefined,\n // width of layout area (overrides container width)\n spacingFactor: undefined,\n // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n concentric: function concentric(node) {\n // returns numeric value for each node, placing higher nodes in levels towards the centre\n return node.degree();\n },\n levelWidth: function levelWidth(nodes) {\n // the letiation of concentric values in each level\n return nodes.maxDegree() / 4;\n },\n animate: false,\n // whether to transition the node positions\n animationDuration: 500,\n // duration of animation in ms if enabled\n animationEasing: undefined,\n // easing of animation if enabled\n animateFilter: function animateFilter(node, i) {\n return true;\n },\n // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts\n ready: undefined,\n // callback on layoutready\n stop: undefined,\n // callback on layoutstop\n transform: function transform(node, position) {\n return position;\n } // transform a given node position. Useful for changing flow direction in discrete layouts\n\n};\n\nfunction ConcentricLayout(options) {\n this.options = extend({}, defaults$b, options);\n}\n\nConcentricLayout.prototype.run = function () {\n var params = this.options;\n var options = params;\n var clockwise = options.counterclockwise !== undefined ? !options.counterclockwise : options.clockwise;\n var cy = params.cy;\n var eles = options.eles;\n var nodes = eles.nodes().not(':parent');\n var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n x1: 0,\n y1: 0,\n w: cy.width(),\n h: cy.height()\n });\n var center = {\n x: bb.x1 + bb.w / 2,\n y: bb.y1 + bb.h / 2\n };\n var nodeValues = []; // { node, value }\n\n var maxNodeSize = 0;\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var value = void 0; // calculate the node value\n\n value = options.concentric(node);\n nodeValues.push({\n value: value,\n node: node\n }); // for style mapping\n\n node._private.scratch.concentric = value;\n } // in case we used the `concentric` in style\n\n\n nodes.updateStyle(); // calculate max size now based on potentially updated mappers\n\n for (var _i = 0; _i < nodes.length; _i++) {\n var _node = nodes[_i];\n\n var nbb = _node.layoutDimensions(options);\n\n maxNodeSize = Math.max(maxNodeSize, nbb.w, nbb.h);\n } // sort node values in descreasing order\n\n\n nodeValues.sort(function (a, b) {\n return b.value - a.value;\n });\n var levelWidth = options.levelWidth(nodes); // put the values into levels\n\n var levels = [[]];\n var currentLevel = levels[0];\n\n for (var _i2 = 0; _i2 < nodeValues.length; _i2++) {\n var val = nodeValues[_i2];\n\n if (currentLevel.length > 0) {\n var diff = Math.abs(currentLevel[0].value - val.value);\n\n if (diff >= levelWidth) {\n currentLevel = [];\n levels.push(currentLevel);\n }\n }\n\n currentLevel.push(val);\n } // create positions from levels\n\n\n var minDist = maxNodeSize + options.minNodeSpacing; // min dist between nodes\n\n if (!options.avoidOverlap) {\n // then strictly constrain to bb\n var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1;\n var maxR = Math.min(bb.w, bb.h) / 2 - minDist;\n var rStep = maxR / (levels.length + firstLvlHasMulti ? 1 : 0);\n minDist = Math.min(minDist, rStep);\n } // find the metrics for each level\n\n\n var r = 0;\n\n for (var _i3 = 0; _i3 < levels.length; _i3++) {\n var level = levels[_i3];\n var sweep = options.sweep === undefined ? 2 * Math.PI - 2 * Math.PI / level.length : options.sweep;\n var dTheta = level.dTheta = sweep / Math.max(1, level.length - 1); // calculate the radius\n\n if (level.length > 1 && options.avoidOverlap) {\n // but only if more than one node (can't overlap)\n var dcos = Math.cos(dTheta) - Math.cos(0);\n var dsin = Math.sin(dTheta) - Math.sin(0);\n var rMin = Math.sqrt(minDist * minDist / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping\n\n r = Math.max(rMin, r);\n }\n\n level.r = r;\n r += minDist;\n }\n\n if (options.equidistant) {\n var rDeltaMax = 0;\n var _r = 0;\n\n for (var _i4 = 0; _i4 < levels.length; _i4++) {\n var _level = levels[_i4];\n var rDelta = _level.r - _r;\n rDeltaMax = Math.max(rDeltaMax, rDelta);\n }\n\n _r = 0;\n\n for (var _i5 = 0; _i5 < levels.length; _i5++) {\n var _level2 = levels[_i5];\n\n if (_i5 === 0) {\n _r = _level2.r;\n }\n\n _level2.r = _r;\n _r += rDeltaMax;\n }\n } // calculate the node positions\n\n\n var pos = {}; // id => position\n\n for (var _i6 = 0; _i6 < levels.length; _i6++) {\n var _level3 = levels[_i6];\n var _dTheta = _level3.dTheta;\n var _r2 = _level3.r;\n\n for (var j = 0; j < _level3.length; j++) {\n var _val = _level3[j];\n var theta = options.startAngle + (clockwise ? 1 : -1) * _dTheta * j;\n var p = {\n x: center.x + _r2 * Math.cos(theta),\n y: center.y + _r2 * Math.sin(theta)\n };\n pos[_val.node.id()] = p;\n }\n } // position the nodes\n\n\n nodes.layoutPositions(this, options, function (ele) {\n var id = ele.id();\n return pos[id];\n });\n return this; // chaining\n};\n\n/*\nThe CoSE layout was written by Gerardo Huck.\nhttps://www.linkedin.com/in/gerardohuck/\n\nBased on the following article:\nhttp://dl.acm.org/citation.cfm?id=1498047\n\nModifications tracked on Github.\n*/\nvar DEBUG;\n/**\n * @brief : default layout options\n */\n\nvar defaults$c = {\n // Called on `layoutready`\n ready: function ready() {},\n // Called on `layoutstop`\n stop: function stop() {},\n // Whether to animate while running the layout\n // true : Animate continuously as the layout is running\n // false : Just show the end result\n // 'end' : Animate with the end result, from the initial positions to the end positions\n animate: true,\n // Easing of the animation for animate:'end'\n animationEasing: undefined,\n // The duration of the animation for animate:'end'\n animationDuration: undefined,\n // A function that determines whether the node should be animated\n // All nodes animated by default on animate enabled\n // Non-animated nodes are positioned immediately when the layout starts\n animateFilter: function animateFilter(node, i) {\n return true;\n },\n // The layout animates only after this many milliseconds for animate:true\n // (prevents flashing on fast runs)\n animationThreshold: 250,\n // Number of iterations between consecutive screen positions update\n refresh: 20,\n // Whether to fit the network view after when done\n fit: true,\n // Padding on fit\n padding: 30,\n // Constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n boundingBox: undefined,\n // Excludes the label when calculating node bounding boxes for the layout algorithm\n nodeDimensionsIncludeLabels: false,\n // Randomize the initial positions of the nodes (true) or use existing positions (false)\n randomize: false,\n // Extra spacing between components in non-compound graphs\n componentSpacing: 40,\n // Node repulsion (non overlapping) multiplier\n nodeRepulsion: function nodeRepulsion(node) {\n return 2048;\n },\n // Node repulsion (overlapping) multiplier\n nodeOverlap: 4,\n // Ideal edge (non nested) length\n idealEdgeLength: function idealEdgeLength(edge) {\n return 32;\n },\n // Divisor to compute edge forces\n edgeElasticity: function edgeElasticity(edge) {\n return 32;\n },\n // Nesting factor (multiplier) to compute ideal edge length for nested edges\n nestingFactor: 1.2,\n // Gravity force (constant)\n gravity: 1,\n // Maximum number of iterations to perform\n numIter: 1000,\n // Initial temperature (maximum node displacement)\n initialTemp: 1000,\n // Cooling factor (how the temperature is reduced between consecutive iterations\n coolingFactor: 0.99,\n // Lower temperature threshold (below this point the layout will end)\n minTemp: 1.0\n};\n/**\n * @brief : constructor\n * @arg options : object containing layout options\n */\n\nfunction CoseLayout(options) {\n this.options = extend({}, defaults$c, options);\n this.options.layout = this;\n}\n/**\n * @brief : runs the layout\n */\n\n\nCoseLayout.prototype.run = function () {\n var options = this.options;\n var cy = options.cy;\n var layout = this;\n layout.stopped = false;\n\n if (options.animate === true || options.animate === false) {\n layout.emit({\n type: 'layoutstart',\n layout: layout\n });\n } // Set DEBUG - Global variable\n\n\n if (true === options.debug) {\n DEBUG = true;\n } else {\n DEBUG = false;\n } // Initialize layout info\n\n\n var layoutInfo = createLayoutInfo(cy, layout, options); // Show LayoutInfo contents if debugging\n\n if (DEBUG) {\n printLayoutInfo(layoutInfo);\n } // If required, randomize node positions\n\n\n if (options.randomize) {\n randomizePositions(layoutInfo);\n }\n\n var startTime = performanceNow();\n\n var refresh = function refresh() {\n refreshPositions(layoutInfo, cy, options); // Fit the graph if necessary\n\n if (true === options.fit) {\n cy.fit(options.padding);\n }\n };\n\n var mainLoop = function mainLoop(i) {\n if (layout.stopped || i >= options.numIter) {\n // logDebug(\"Layout manually stopped. Stopping computation in step \" + i);\n return false;\n } // Do one step in the phisical simulation\n\n\n step$1(layoutInfo, options); // Update temperature\n\n layoutInfo.temperature = layoutInfo.temperature * options.coolingFactor; // logDebug(\"New temperature: \" + layoutInfo.temperature);\n\n if (layoutInfo.temperature < options.minTemp) {\n // logDebug(\"Temperature drop below minimum threshold. Stopping computation in step \" + i);\n return false;\n }\n\n return true;\n };\n\n var done = function done() {\n if (options.animate === true || options.animate === false) {\n refresh(); // Layout has finished\n\n layout.one('layoutstop', options.stop);\n layout.emit({\n type: 'layoutstop',\n layout: layout\n });\n } else {\n var nodes = options.eles.nodes();\n var getScaledPos = getScaleInBoundsFn(layoutInfo, options, nodes);\n nodes.layoutPositions(layout, options, getScaledPos);\n }\n };\n\n var i = 0;\n var loopRet = true;\n\n if (options.animate === true) {\n var frame = function frame() {\n var f = 0;\n\n while (loopRet && f < options.refresh) {\n loopRet = mainLoop(i);\n i++;\n f++;\n }\n\n if (!loopRet) {\n // it's done\n separateComponents(layoutInfo, options);\n done();\n } else {\n var now = performanceNow();\n\n if (now - startTime >= options.animationThreshold) {\n refresh();\n }\n\n requestAnimationFrame(frame);\n }\n };\n\n frame();\n } else {\n while (loopRet) {\n loopRet = mainLoop(i);\n i++;\n }\n\n separateComponents(layoutInfo, options);\n done();\n }\n\n return this; // chaining\n};\n/**\n * @brief : called on continuous layouts to stop them before they finish\n */\n\n\nCoseLayout.prototype.stop = function () {\n this.stopped = true;\n\n if (this.thread) {\n this.thread.stop();\n }\n\n this.emit('layoutstop');\n return this; // chaining\n};\n\nCoseLayout.prototype.destroy = function () {\n if (this.thread) {\n this.thread.stop();\n }\n\n return this; // chaining\n};\n/**\n * @brief : Creates an object which is contains all the data\n * used in the layout process\n * @arg cy : cytoscape.js object\n * @return : layoutInfo object initialized\n */\n\n\nvar createLayoutInfo = function createLayoutInfo(cy, layout, options) {\n // Shortcut\n var edges = options.eles.edges();\n var nodes = options.eles.nodes();\n var layoutInfo = {\n isCompound: cy.hasCompoundNodes(),\n layoutNodes: [],\n idToIndex: {},\n nodeSize: nodes.size(),\n graphSet: [],\n indexToGraph: [],\n layoutEdges: [],\n edgeSize: edges.size(),\n temperature: options.initialTemp,\n clientWidth: cy.width(),\n clientHeight: cy.width(),\n boundingBox: makeBoundingBox(options.boundingBox ? options.boundingBox : {\n x1: 0,\n y1: 0,\n w: cy.width(),\n h: cy.height()\n })\n };\n var components = options.eles.components();\n var id2cmptId = {};\n\n for (var i = 0; i < components.length; i++) {\n var component = components[i];\n\n for (var j = 0; j < component.length; j++) {\n var node = component[j];\n id2cmptId[node.id()] = i;\n }\n } // Iterate over all nodes, creating layout nodes\n\n\n for (var i = 0; i < layoutInfo.nodeSize; i++) {\n var n = nodes[i];\n var nbb = n.layoutDimensions(options);\n var tempNode = {};\n tempNode.isLocked = n.locked();\n tempNode.id = n.data('id');\n tempNode.parentId = n.data('parent');\n tempNode.cmptId = id2cmptId[n.id()];\n tempNode.children = [];\n tempNode.positionX = n.position('x');\n tempNode.positionY = n.position('y');\n tempNode.offsetX = 0;\n tempNode.offsetY = 0;\n tempNode.height = nbb.w;\n tempNode.width = nbb.h;\n tempNode.maxX = tempNode.positionX + tempNode.width / 2;\n tempNode.minX = tempNode.positionX - tempNode.width / 2;\n tempNode.maxY = tempNode.positionY + tempNode.height / 2;\n tempNode.minY = tempNode.positionY - tempNode.height / 2;\n tempNode.padLeft = parseFloat(n.style('padding'));\n tempNode.padRight = parseFloat(n.style('padding'));\n tempNode.padTop = parseFloat(n.style('padding'));\n tempNode.padBottom = parseFloat(n.style('padding')); // forces\n\n tempNode.nodeRepulsion = fn(options.nodeRepulsion) ? options.nodeRepulsion(n) : options.nodeRepulsion; // Add new node\n\n layoutInfo.layoutNodes.push(tempNode); // Add entry to id-index map\n\n layoutInfo.idToIndex[tempNode.id] = i;\n } // Inline implementation of a queue, used for traversing the graph in BFS order\n\n\n var queue = [];\n var start = 0; // Points to the start the queue\n\n var end = -1; // Points to the end of the queue\n\n var tempGraph = []; // Second pass to add child information and\n // initialize queue for hierarchical traversal\n\n for (var i = 0; i < layoutInfo.nodeSize; i++) {\n var n = layoutInfo.layoutNodes[i];\n var p_id = n.parentId; // Check if node n has a parent node\n\n if (null != p_id) {\n // Add node Id to parent's list of children\n layoutInfo.layoutNodes[layoutInfo.idToIndex[p_id]].children.push(n.id);\n } else {\n // If a node doesn't have a parent, then it's in the root graph\n queue[++end] = n.id;\n tempGraph.push(n.id);\n }\n } // Add root graph to graphSet\n\n\n layoutInfo.graphSet.push(tempGraph); // Traverse the graph, level by level,\n\n while (start <= end) {\n // Get the node to visit and remove it from queue\n var node_id = queue[start++];\n var node_ix = layoutInfo.idToIndex[node_id];\n var node = layoutInfo.layoutNodes[node_ix];\n var children = node.children;\n\n if (children.length > 0) {\n // Add children nodes as a new graph to graph set\n layoutInfo.graphSet.push(children); // Add children to que queue to be visited\n\n for (var i = 0; i < children.length; i++) {\n queue[++end] = children[i];\n }\n }\n } // Create indexToGraph map\n\n\n for (var i = 0; i < layoutInfo.graphSet.length; i++) {\n var graph = layoutInfo.graphSet[i];\n\n for (var j = 0; j < graph.length; j++) {\n var index = layoutInfo.idToIndex[graph[j]];\n layoutInfo.indexToGraph[index] = i;\n }\n } // Iterate over all edges, creating Layout Edges\n\n\n for (var i = 0; i < layoutInfo.edgeSize; i++) {\n var e = edges[i];\n var tempEdge = {};\n tempEdge.id = e.data('id');\n tempEdge.sourceId = e.data('source');\n tempEdge.targetId = e.data('target'); // Compute ideal length\n\n var idealLength = fn(options.idealEdgeLength) ? options.idealEdgeLength(e) : options.idealEdgeLength;\n var elasticity = fn(options.edgeElasticity) ? options.edgeElasticity(e) : options.edgeElasticity; // Check if it's an inter graph edge\n\n var sourceIx = layoutInfo.idToIndex[tempEdge.sourceId];\n var targetIx = layoutInfo.idToIndex[tempEdge.targetId];\n var sourceGraph = layoutInfo.indexToGraph[sourceIx];\n var targetGraph = layoutInfo.indexToGraph[targetIx];\n\n if (sourceGraph != targetGraph) {\n // Find lowest common graph ancestor\n var lca = findLCA(tempEdge.sourceId, tempEdge.targetId, layoutInfo); // Compute sum of node depths, relative to lca graph\n\n var lcaGraph = layoutInfo.graphSet[lca];\n var depth = 0; // Source depth\n\n var tempNode = layoutInfo.layoutNodes[sourceIx];\n\n while (-1 === lcaGraph.indexOf(tempNode.id)) {\n tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]];\n depth++;\n } // Target depth\n\n\n tempNode = layoutInfo.layoutNodes[targetIx];\n\n while (-1 === lcaGraph.indexOf(tempNode.id)) {\n tempNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[tempNode.parentId]];\n depth++;\n } // logDebug('LCA of nodes ' + tempEdge.sourceId + ' and ' + tempEdge.targetId +\n // \". Index: \" + lca + \" Contents: \" + lcaGraph.toString() +\n // \". Depth: \" + depth);\n // Update idealLength\n\n\n idealLength *= depth * options.nestingFactor;\n }\n\n tempEdge.idealLength = idealLength;\n tempEdge.elasticity = elasticity;\n layoutInfo.layoutEdges.push(tempEdge);\n } // Finally, return layoutInfo object\n\n\n return layoutInfo;\n};\n/**\n * @brief : This function finds the index of the lowest common\n * graph ancestor between 2 nodes in the subtree\n * (from the graph hierarchy induced tree) whose\n * root is graphIx\n *\n * @arg node1: node1's ID\n * @arg node2: node2's ID\n * @arg layoutInfo: layoutInfo object\n *\n */\n\n\nvar findLCA = function findLCA(node1, node2, layoutInfo) {\n // Find their common ancester, starting from the root graph\n var res = findLCA_aux(node1, node2, 0, layoutInfo);\n\n if (2 > res.count) {\n // If aux function couldn't find the common ancester,\n // then it is the root graph\n return 0;\n } else {\n return res.graph;\n }\n};\n/**\n * @brief : Auxiliary function used for LCA computation\n *\n * @arg node1 : node1's ID\n * @arg node2 : node2's ID\n * @arg graphIx : subgraph index\n * @arg layoutInfo : layoutInfo object\n *\n * @return : object of the form {count: X, graph: Y}, where:\n * X is the number of ancesters (max: 2) found in\n * graphIx (and it's subgraphs),\n * Y is the graph index of the lowest graph containing\n * all X nodes\n */\n\n\nvar findLCA_aux = function findLCA_aux(node1, node2, graphIx, layoutInfo) {\n var graph = layoutInfo.graphSet[graphIx]; // If both nodes belongs to graphIx\n\n if (-1 < graph.indexOf(node1) && -1 < graph.indexOf(node2)) {\n return {\n count: 2,\n graph: graphIx\n };\n } // Make recursive calls for all subgraphs\n\n\n var c = 0;\n\n for (var i = 0; i < graph.length; i++) {\n var nodeId = graph[i];\n var nodeIx = layoutInfo.idToIndex[nodeId];\n var children = layoutInfo.layoutNodes[nodeIx].children; // If the node has no child, skip it\n\n if (0 === children.length) {\n continue;\n }\n\n var childGraphIx = layoutInfo.indexToGraph[layoutInfo.idToIndex[children[0]]];\n var result = findLCA_aux(node1, node2, childGraphIx, layoutInfo);\n\n if (0 === result.count) {\n // Neither node1 nor node2 are present in this subgraph\n continue;\n } else if (1 === result.count) {\n // One of (node1, node2) is present in this subgraph\n c++;\n\n if (2 === c) {\n // We've already found both nodes, no need to keep searching\n break;\n }\n } else {\n // Both nodes are present in this subgraph\n return result;\n }\n }\n\n return {\n count: c,\n graph: graphIx\n };\n};\n/**\n * @brief: printsLayoutInfo into js console\n * Only used for debbuging\n */\n\n\nif (false) { var printLayoutInfo; }\n/**\n * @brief : Randomizes the position of all nodes\n */\n\n\nvar randomizePositions = function randomizePositions(layoutInfo, cy) {\n var width = layoutInfo.clientWidth;\n var height = layoutInfo.clientHeight;\n\n for (var i = 0; i < layoutInfo.nodeSize; i++) {\n var n = layoutInfo.layoutNodes[i]; // No need to randomize compound nodes or locked nodes\n\n if (0 === n.children.length && !n.isLocked) {\n n.positionX = Math.random() * width;\n n.positionY = Math.random() * height;\n }\n }\n};\n\nvar getScaleInBoundsFn = function getScaleInBoundsFn(layoutInfo, options, nodes) {\n var bb = layoutInfo.boundingBox;\n var coseBB = {\n x1: Infinity,\n x2: -Infinity,\n y1: Infinity,\n y2: -Infinity\n };\n\n if (options.boundingBox) {\n nodes.forEach(function (node) {\n var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[node.data('id')]];\n coseBB.x1 = Math.min(coseBB.x1, lnode.positionX);\n coseBB.x2 = Math.max(coseBB.x2, lnode.positionX);\n coseBB.y1 = Math.min(coseBB.y1, lnode.positionY);\n coseBB.y2 = Math.max(coseBB.y2, lnode.positionY);\n });\n coseBB.w = coseBB.x2 - coseBB.x1;\n coseBB.h = coseBB.y2 - coseBB.y1;\n }\n\n return function (ele, i) {\n var lnode = layoutInfo.layoutNodes[layoutInfo.idToIndex[ele.data('id')]];\n\n if (options.boundingBox) {\n // then add extra bounding box constraint\n var pctX = (lnode.positionX - coseBB.x1) / coseBB.w;\n var pctY = (lnode.positionY - coseBB.y1) / coseBB.h;\n return {\n x: bb.x1 + pctX * bb.w,\n y: bb.y1 + pctY * bb.h\n };\n } else {\n return {\n x: lnode.positionX,\n y: lnode.positionY\n };\n }\n };\n};\n/**\n * @brief : Updates the positions of nodes in the network\n * @arg layoutInfo : LayoutInfo object\n * @arg cy : Cytoscape object\n * @arg options : Layout options\n */\n\n\nvar refreshPositions = function refreshPositions(layoutInfo, cy, options) {\n // var s = 'Refreshing positions';\n // logDebug(s);\n var layout = options.layout;\n var nodes = options.eles.nodes();\n var getScaledPos = getScaleInBoundsFn(layoutInfo, options, nodes);\n nodes.positions(getScaledPos); // Trigger layoutReady only on first call\n\n if (true !== layoutInfo.ready) {\n // s = 'Triggering layoutready';\n // logDebug(s);\n layoutInfo.ready = true;\n layout.one('layoutready', options.ready);\n layout.emit({\n type: 'layoutready',\n layout: this\n });\n }\n};\n/**\n * @brief : Logs a debug message in JS console, if DEBUG is ON\n */\n// var logDebug = function(text) {\n// if (DEBUG) {\n// console.debug(text);\n// }\n// };\n\n/**\n * @brief : Performs one iteration of the physical simulation\n * @arg layoutInfo : LayoutInfo object already initialized\n * @arg cy : Cytoscape object\n * @arg options : Layout options\n */\n\n\nvar step$1 = function step(layoutInfo, options, _step) {\n // var s = \"\\n\\n###############################\";\n // s += \"\\nSTEP: \" + step;\n // s += \"\\n###############################\\n\";\n // logDebug(s);\n // Calculate node repulsions\n calculateNodeForces(layoutInfo, options); // Calculate edge forces\n\n calculateEdgeForces(layoutInfo); // Calculate gravity forces\n\n calculateGravityForces(layoutInfo, options); // Propagate forces from parent to child\n\n propagateForces(layoutInfo); // Update positions based on calculated forces\n\n updatePositions(layoutInfo);\n};\n/**\n * @brief : Computes the node repulsion forces\n */\n\n\nvar calculateNodeForces = function calculateNodeForces(layoutInfo, options) {\n // Go through each of the graphs in graphSet\n // Nodes only repel each other if they belong to the same graph\n // var s = 'calculateNodeForces';\n // logDebug(s);\n for (var i = 0; i < layoutInfo.graphSet.length; i++) {\n var graph = layoutInfo.graphSet[i];\n var numNodes = graph.length; // s = \"Set: \" + graph.toString();\n // logDebug(s);\n // Now get all the pairs of nodes\n // Only get each pair once, (A, B) = (B, A)\n\n for (var j = 0; j < numNodes; j++) {\n var node1 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]];\n\n for (var k = j + 1; k < numNodes; k++) {\n var node2 = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[k]]];\n nodeRepulsion(node1, node2, layoutInfo, options);\n }\n }\n }\n};\n\nvar randomDistance = function randomDistance(max) {\n return -max + 2 * max * Math.random();\n};\n/**\n * @brief : Compute the node repulsion forces between a pair of nodes\n */\n\n\nvar nodeRepulsion = function nodeRepulsion(node1, node2, layoutInfo, options) {\n // var s = \"Node repulsion. Node1: \" + node1.id + \" Node2: \" + node2.id;\n var cmptId1 = node1.cmptId;\n var cmptId2 = node2.cmptId;\n\n if (cmptId1 !== cmptId2 && !layoutInfo.isCompound) {\n return;\n } // Get direction of line connecting both node centers\n\n\n var directionX = node2.positionX - node1.positionX;\n var directionY = node2.positionY - node1.positionY;\n var maxRandDist = 1; // s += \"\\ndirectionX: \" + directionX + \", directionY: \" + directionY;\n // If both centers are the same, apply a random force\n\n if (0 === directionX && 0 === directionY) {\n directionX = randomDistance(maxRandDist);\n directionY = randomDistance(maxRandDist);\n }\n\n var overlap = nodesOverlap(node1, node2, directionX, directionY);\n\n if (overlap > 0) {\n // s += \"\\nNodes DO overlap.\";\n // s += \"\\nOverlap: \" + overlap;\n // If nodes overlap, repulsion force is proportional\n // to the overlap\n var force = options.nodeOverlap * overlap; // Compute the module and components of the force vector\n\n var distance = Math.sqrt(directionX * directionX + directionY * directionY); // s += \"\\nDistance: \" + distance;\n\n var forceX = force * directionX / distance;\n var forceY = force * directionY / distance;\n } else {\n // s += \"\\nNodes do NOT overlap.\";\n // If there's no overlap, force is inversely proportional\n // to squared distance\n // Get clipping points for both nodes\n var point1 = findClippingPoint(node1, directionX, directionY);\n var point2 = findClippingPoint(node2, -1 * directionX, -1 * directionY); // Use clipping points to compute distance\n\n var distanceX = point2.x - point1.x;\n var distanceY = point2.y - point1.y;\n var distanceSqr = distanceX * distanceX + distanceY * distanceY;\n var distance = Math.sqrt(distanceSqr); // s += \"\\nDistance: \" + distance;\n // Compute the module and components of the force vector\n\n var force = (node1.nodeRepulsion + node2.nodeRepulsion) / distanceSqr;\n var forceX = force * distanceX / distance;\n var forceY = force * distanceY / distance;\n } // Apply force\n\n\n if (!node1.isLocked) {\n node1.offsetX -= forceX;\n node1.offsetY -= forceY;\n }\n\n if (!node2.isLocked) {\n node2.offsetX += forceX;\n node2.offsetY += forceY;\n } // s += \"\\nForceX: \" + forceX + \" ForceY: \" + forceY;\n // logDebug(s);\n\n\n return;\n};\n/**\n * @brief : Determines whether two nodes overlap or not\n * @return : Amount of overlapping (0 => no overlap)\n */\n\n\nvar nodesOverlap = function nodesOverlap(node1, node2, dX, dY) {\n if (dX > 0) {\n var overlapX = node1.maxX - node2.minX;\n } else {\n var overlapX = node2.maxX - node1.minX;\n }\n\n if (dY > 0) {\n var overlapY = node1.maxY - node2.minY;\n } else {\n var overlapY = node2.maxY - node1.minY;\n }\n\n if (overlapX >= 0 && overlapY >= 0) {\n return Math.sqrt(overlapX * overlapX + overlapY * overlapY);\n } else {\n return 0;\n }\n};\n/**\n * @brief : Finds the point in which an edge (direction dX, dY) intersects\n * the rectangular bounding box of it's source/target node\n */\n\n\nvar findClippingPoint = function findClippingPoint(node, dX, dY) {\n // Shorcuts\n var X = node.positionX;\n var Y = node.positionY;\n var H = node.height || 1;\n var W = node.width || 1;\n var dirSlope = dY / dX;\n var nodeSlope = H / W; // var s = 'Computing clipping point of node ' + node.id +\n // \" . Height: \" + H + \", Width: \" + W +\n // \"\\nDirection \" + dX + \", \" + dY;\n //\n // Compute intersection\n\n var res = {}; // Case: Vertical direction (up)\n\n if (0 === dX && 0 < dY) {\n res.x = X; // s += \"\\nUp direction\";\n\n res.y = Y + H / 2;\n return res;\n } // Case: Vertical direction (down)\n\n\n if (0 === dX && 0 > dY) {\n res.x = X;\n res.y = Y + H / 2; // s += \"\\nDown direction\";\n\n return res;\n } // Case: Intersects the right border\n\n\n if (0 < dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) {\n res.x = X + W / 2;\n res.y = Y + W * dY / 2 / dX; // s += \"\\nRightborder\";\n\n return res;\n } // Case: Intersects the left border\n\n\n if (0 > dX && -1 * nodeSlope <= dirSlope && dirSlope <= nodeSlope) {\n res.x = X - W / 2;\n res.y = Y - W * dY / 2 / dX; // s += \"\\nLeftborder\";\n\n return res;\n } // Case: Intersects the top border\n\n\n if (0 < dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) {\n res.x = X + H * dX / 2 / dY;\n res.y = Y + H / 2; // s += \"\\nTop border\";\n\n return res;\n } // Case: Intersects the bottom border\n\n\n if (0 > dY && (dirSlope <= -1 * nodeSlope || dirSlope >= nodeSlope)) {\n res.x = X - H * dX / 2 / dY;\n res.y = Y - H / 2; // s += \"\\nBottom border\";\n\n return res;\n } // s += \"\\nClipping point found at \" + res.x + \", \" + res.y;\n // logDebug(s);\n\n\n return res;\n};\n/**\n * @brief : Calculates all edge forces\n */\n\n\nvar calculateEdgeForces = function calculateEdgeForces(layoutInfo, options) {\n // Iterate over all edges\n for (var i = 0; i < layoutInfo.edgeSize; i++) {\n // Get edge, source & target nodes\n var edge = layoutInfo.layoutEdges[i];\n var sourceIx = layoutInfo.idToIndex[edge.sourceId];\n var source = layoutInfo.layoutNodes[sourceIx];\n var targetIx = layoutInfo.idToIndex[edge.targetId];\n var target = layoutInfo.layoutNodes[targetIx]; // Get direction of line connecting both node centers\n\n var directionX = target.positionX - source.positionX;\n var directionY = target.positionY - source.positionY; // If both centers are the same, do nothing.\n // A random force has already been applied as node repulsion\n\n if (0 === directionX && 0 === directionY) {\n continue;\n } // Get clipping points for both nodes\n\n\n var point1 = findClippingPoint(source, directionX, directionY);\n var point2 = findClippingPoint(target, -1 * directionX, -1 * directionY);\n var lx = point2.x - point1.x;\n var ly = point2.y - point1.y;\n var l = Math.sqrt(lx * lx + ly * ly);\n var force = Math.pow(edge.idealLength - l, 2) / edge.elasticity;\n\n if (0 !== l) {\n var forceX = force * lx / l;\n var forceY = force * ly / l;\n } else {\n var forceX = 0;\n var forceY = 0;\n } // Add this force to target and source nodes\n\n\n if (!source.isLocked) {\n source.offsetX += forceX;\n source.offsetY += forceY;\n }\n\n if (!target.isLocked) {\n target.offsetX -= forceX;\n target.offsetY -= forceY;\n } // var s = 'Edge force between nodes ' + source.id + ' and ' + target.id;\n // s += \"\\nDistance: \" + l + \" Force: (\" + forceX + \", \" + forceY + \")\";\n // logDebug(s);\n\n }\n};\n/**\n * @brief : Computes gravity forces for all nodes\n */\n\n\nvar calculateGravityForces = function calculateGravityForces(layoutInfo, options) {\n var distThreshold = 1; // var s = 'calculateGravityForces';\n // logDebug(s);\n\n for (var i = 0; i < layoutInfo.graphSet.length; i++) {\n var graph = layoutInfo.graphSet[i];\n var numNodes = graph.length; // s = \"Set: \" + graph.toString();\n // logDebug(s);\n // Compute graph center\n\n if (0 === i) {\n var centerX = layoutInfo.clientHeight / 2;\n var centerY = layoutInfo.clientWidth / 2;\n } else {\n // Get Parent node for this graph, and use its position as center\n var temp = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[0]]];\n var parent = layoutInfo.layoutNodes[layoutInfo.idToIndex[temp.parentId]];\n var centerX = parent.positionX;\n var centerY = parent.positionY;\n } // s = \"Center found at: \" + centerX + \", \" + centerY;\n // logDebug(s);\n // Apply force to all nodes in graph\n\n\n for (var j = 0; j < numNodes; j++) {\n var node = layoutInfo.layoutNodes[layoutInfo.idToIndex[graph[j]]]; // s = \"Node: \" + node.id;\n\n if (node.isLocked) {\n continue;\n }\n\n var dx = centerX - node.positionX;\n var dy = centerY - node.positionY;\n var d = Math.sqrt(dx * dx + dy * dy);\n\n if (d > distThreshold) {\n var fx = options.gravity * dx / d;\n var fy = options.gravity * dy / d;\n node.offsetX += fx;\n node.offsetY += fy; // s += \": Applied force: \" + fx + \", \" + fy;\n } // s += \": skypped since it's too close to center\";\n // logDebug(s);\n\n }\n }\n};\n/**\n * @brief : This function propagates the existing offsets from\n * parent nodes to its descendents.\n * @arg layoutInfo : layoutInfo Object\n * @arg cy : cytoscape Object\n * @arg options : Layout options\n */\n\n\nvar propagateForces = function propagateForces(layoutInfo, options) {\n // Inline implementation of a queue, used for traversing the graph in BFS order\n var queue = [];\n var start = 0; // Points to the start the queue\n\n var end = -1; // Points to the end of the queue\n // logDebug('propagateForces');\n // Start by visiting the nodes in the root graph\n\n queue.push.apply(queue, layoutInfo.graphSet[0]);\n end += layoutInfo.graphSet[0].length; // Traverse the graph, level by level,\n\n while (start <= end) {\n // Get the node to visit and remove it from queue\n var nodeId = queue[start++];\n var nodeIndex = layoutInfo.idToIndex[nodeId];\n var node = layoutInfo.layoutNodes[nodeIndex];\n var children = node.children; // We only need to process the node if it's compound\n\n if (0 < children.length && !node.isLocked) {\n var offX = node.offsetX;\n var offY = node.offsetY; // var s = \"Propagating offset from parent node : \" + node.id +\n // \". OffsetX: \" + offX + \". OffsetY: \" + offY;\n // s += \"\\n Children: \" + children.toString();\n // logDebug(s);\n\n for (var i = 0; i < children.length; i++) {\n var childNode = layoutInfo.layoutNodes[layoutInfo.idToIndex[children[i]]]; // Propagate offset\n\n childNode.offsetX += offX;\n childNode.offsetY += offY; // Add children to queue to be visited\n\n queue[++end] = children[i];\n } // Reset parent offsets\n\n\n node.offsetX = 0;\n node.offsetY = 0;\n }\n }\n};\n/**\n * @brief : Updates the layout model positions, based on\n * the accumulated forces\n */\n\n\nvar updatePositions = function updatePositions(layoutInfo, options) {\n // var s = 'Updating positions';\n // logDebug(s);\n // Reset boundaries for compound nodes\n for (var i = 0; i < layoutInfo.nodeSize; i++) {\n var n = layoutInfo.layoutNodes[i];\n\n if (0 < n.children.length) {\n // logDebug(\"Resetting boundaries of compound node: \" + n.id);\n n.maxX = undefined;\n n.minX = undefined;\n n.maxY = undefined;\n n.minY = undefined;\n }\n }\n\n for (var i = 0; i < layoutInfo.nodeSize; i++) {\n var n = layoutInfo.layoutNodes[i];\n\n if (0 < n.children.length || n.isLocked) {\n // No need to set compound or locked node position\n // logDebug(\"Skipping position update of node: \" + n.id);\n continue;\n } // s = \"Node: \" + n.id + \" Previous position: (\" +\n // n.positionX + \", \" + n.positionY + \").\";\n // Limit displacement in order to improve stability\n\n\n var tempForce = limitForce(n.offsetX, n.offsetY, layoutInfo.temperature);\n n.positionX += tempForce.x;\n n.positionY += tempForce.y;\n n.offsetX = 0;\n n.offsetY = 0;\n n.minX = n.positionX - n.width;\n n.maxX = n.positionX + n.width;\n n.minY = n.positionY - n.height;\n n.maxY = n.positionY + n.height; // s += \" New Position: (\" + n.positionX + \", \" + n.positionY + \").\";\n // logDebug(s);\n // Update ancestry boudaries\n\n updateAncestryBoundaries(n, layoutInfo);\n } // Update size, position of compund nodes\n\n\n for (var i = 0; i < layoutInfo.nodeSize; i++) {\n var n = layoutInfo.layoutNodes[i];\n\n if (0 < n.children.length && !n.isLocked) {\n n.positionX = (n.maxX + n.minX) / 2;\n n.positionY = (n.maxY + n.minY) / 2;\n n.width = n.maxX - n.minX;\n n.height = n.maxY - n.minY; // s = \"Updating position, size of compound node \" + n.id;\n // s += \"\\nPositionX: \" + n.positionX + \", PositionY: \" + n.positionY;\n // s += \"\\nWidth: \" + n.width + \", Height: \" + n.height;\n // logDebug(s);\n }\n }\n};\n/**\n * @brief : Limits a force (forceX, forceY) to be not\n * greater (in modulo) than max.\n 8 Preserves force direction.\n */\n\n\nvar limitForce = function limitForce(forceX, forceY, max) {\n // var s = \"Limiting force: (\" + forceX + \", \" + forceY + \"). Max: \" + max;\n var force = Math.sqrt(forceX * forceX + forceY * forceY);\n\n if (force > max) {\n var res = {\n x: max * forceX / force,\n y: max * forceY / force\n };\n } else {\n var res = {\n x: forceX,\n y: forceY\n };\n } // s += \".\\nResult: (\" + res.x + \", \" + res.y + \")\";\n // logDebug(s);\n\n\n return res;\n};\n/**\n * @brief : Function used for keeping track of compound node\n * sizes, since they should bound all their subnodes.\n */\n\n\nvar updateAncestryBoundaries = function updateAncestryBoundaries(node, layoutInfo) {\n // var s = \"Propagating new position/size of node \" + node.id;\n var parentId = node.parentId;\n\n if (null == parentId) {\n // If there's no parent, we are done\n // s += \". No parent node.\";\n // logDebug(s);\n return;\n } // Get Parent Node\n\n\n var p = layoutInfo.layoutNodes[layoutInfo.idToIndex[parentId]];\n var flag = false; // MaxX\n\n if (null == p.maxX || node.maxX + p.padRight > p.maxX) {\n p.maxX = node.maxX + p.padRight;\n flag = true; // s += \"\\nNew maxX for parent node \" + p.id + \": \" + p.maxX;\n } // MinX\n\n\n if (null == p.minX || node.minX - p.padLeft < p.minX) {\n p.minX = node.minX - p.padLeft;\n flag = true; // s += \"\\nNew minX for parent node \" + p.id + \": \" + p.minX;\n } // MaxY\n\n\n if (null == p.maxY || node.maxY + p.padBottom > p.maxY) {\n p.maxY = node.maxY + p.padBottom;\n flag = true; // s += \"\\nNew maxY for parent node \" + p.id + \": \" + p.maxY;\n } // MinY\n\n\n if (null == p.minY || node.minY - p.padTop < p.minY) {\n p.minY = node.minY - p.padTop;\n flag = true; // s += \"\\nNew minY for parent node \" + p.id + \": \" + p.minY;\n } // If updated boundaries, propagate changes upward\n\n\n if (flag) {\n // logDebug(s);\n return updateAncestryBoundaries(p, layoutInfo);\n } // s += \". No changes in boundaries/position of parent node \" + p.id;\n // logDebug(s);\n\n\n return;\n};\n\nvar separateComponents = function separateComponents(layoutInfo, options) {\n var nodes = layoutInfo.layoutNodes;\n var components = [];\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var cid = node.cmptId;\n var component = components[cid] = components[cid] || [];\n component.push(node);\n }\n\n var totalA = 0;\n\n for (var i = 0; i < components.length; i++) {\n var c = components[i];\n\n if (!c) {\n continue;\n }\n\n c.x1 = Infinity;\n c.x2 = -Infinity;\n c.y1 = Infinity;\n c.y2 = -Infinity;\n\n for (var j = 0; j < c.length; j++) {\n var n = c[j];\n c.x1 = Math.min(c.x1, n.positionX - n.width / 2);\n c.x2 = Math.max(c.x2, n.positionX + n.width / 2);\n c.y1 = Math.min(c.y1, n.positionY - n.height / 2);\n c.y2 = Math.max(c.y2, n.positionY + n.height / 2);\n }\n\n c.w = c.x2 - c.x1;\n c.h = c.y2 - c.y1;\n totalA += c.w * c.h;\n }\n\n components.sort(function (c1, c2) {\n return c2.w * c2.h - c1.w * c1.h;\n });\n var x = 0;\n var y = 0;\n var usedW = 0;\n var rowH = 0;\n var maxRowW = Math.sqrt(totalA) * layoutInfo.clientWidth / layoutInfo.clientHeight;\n\n for (var i = 0; i < components.length; i++) {\n var c = components[i];\n\n if (!c) {\n continue;\n }\n\n for (var j = 0; j < c.length; j++) {\n var n = c[j];\n\n if (!n.isLocked) {\n n.positionX += x - c.x1;\n n.positionY += y - c.y1;\n }\n }\n\n x += c.w + options.componentSpacing;\n usedW += c.w + options.componentSpacing;\n rowH = Math.max(rowH, c.h);\n\n if (usedW > maxRowW) {\n y += rowH + options.componentSpacing;\n x = 0;\n usedW = 0;\n rowH = 0;\n }\n }\n};\n\nvar defaults$d = {\n fit: true,\n // whether to fit the viewport to the graph\n padding: 30,\n // padding used on fit\n boundingBox: undefined,\n // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n avoidOverlap: true,\n // prevents node overlap, may overflow boundingBox if not enough space\n avoidOverlapPadding: 10,\n // extra spacing around nodes when avoidOverlap: true\n nodeDimensionsIncludeLabels: false,\n // Excludes the label when calculating node bounding boxes for the layout algorithm\n spacingFactor: undefined,\n // Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up\n condense: false,\n // uses all available space on false, uses minimal space on true\n rows: undefined,\n // force num of rows in the grid\n cols: undefined,\n // force num of columns in the grid\n position: function position(node) {},\n // returns { row, col } for element\n sort: undefined,\n // a sorting function to order the nodes; e.g. function(a, b){ return a.data('weight') - b.data('weight') }\n animate: false,\n // whether to transition the node positions\n animationDuration: 500,\n // duration of animation in ms if enabled\n animationEasing: undefined,\n // easing of animation if enabled\n animateFilter: function animateFilter(node, i) {\n return true;\n },\n // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts\n ready: undefined,\n // callback on layoutready\n stop: undefined,\n // callback on layoutstop\n transform: function transform(node, position) {\n return position;\n } // transform a given node position. Useful for changing flow direction in discrete layouts \n\n};\n\nfunction GridLayout(options) {\n this.options = extend({}, defaults$d, options);\n}\n\nGridLayout.prototype.run = function () {\n var params = this.options;\n var options = params;\n var cy = params.cy;\n var eles = options.eles;\n var nodes = eles.nodes().not(':parent');\n\n if (options.sort) {\n nodes = nodes.sort(options.sort);\n }\n\n var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n x1: 0,\n y1: 0,\n w: cy.width(),\n h: cy.height()\n });\n\n if (bb.h === 0 || bb.w === 0) {\n nodes.layoutPositions(this, options, function (ele) {\n return {\n x: bb.x1,\n y: bb.y1\n };\n });\n } else {\n // width/height * splits^2 = cells where splits is number of times to split width\n var cells = nodes.size();\n var splits = Math.sqrt(cells * bb.h / bb.w);\n var rows = Math.round(splits);\n var cols = Math.round(bb.w / bb.h * splits);\n\n var small = function small(val) {\n if (val == null) {\n return Math.min(rows, cols);\n } else {\n var min = Math.min(rows, cols);\n\n if (min == rows) {\n rows = val;\n } else {\n cols = val;\n }\n }\n };\n\n var large = function large(val) {\n if (val == null) {\n return Math.max(rows, cols);\n } else {\n var max = Math.max(rows, cols);\n\n if (max == rows) {\n rows = val;\n } else {\n cols = val;\n }\n }\n };\n\n var oRows = options.rows;\n var oCols = options.cols != null ? options.cols : options.columns; // if rows or columns were set in options, use those values\n\n if (oRows != null && oCols != null) {\n rows = oRows;\n cols = oCols;\n } else if (oRows != null && oCols == null) {\n rows = oRows;\n cols = Math.ceil(cells / rows);\n } else if (oRows == null && oCols != null) {\n cols = oCols;\n rows = Math.ceil(cells / cols);\n } // otherwise use the automatic values and adjust accordingly\n // if rounding was up, see if we can reduce rows or columns\n else if (cols * rows > cells) {\n var sm = small();\n var lg = large(); // reducing the small side takes away the most cells, so try it first\n\n if ((sm - 1) * lg >= cells) {\n small(sm - 1);\n } else if ((lg - 1) * sm >= cells) {\n large(lg - 1);\n }\n } else {\n // if rounding was too low, add rows or columns\n while (cols * rows < cells) {\n var _sm = small();\n\n var _lg = large(); // try to add to larger side first (adds less in multiplication)\n\n\n if ((_lg + 1) * _sm >= cells) {\n large(_lg + 1);\n } else {\n small(_sm + 1);\n }\n }\n }\n\n var cellWidth = bb.w / cols;\n var cellHeight = bb.h / rows;\n\n if (options.condense) {\n cellWidth = 0;\n cellHeight = 0;\n }\n\n if (options.avoidOverlap) {\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n var pos = node._private.position;\n\n if (pos.x == null || pos.y == null) {\n // for bb\n pos.x = 0;\n pos.y = 0;\n }\n\n var nbb = node.layoutDimensions(options);\n var p = options.avoidOverlapPadding;\n var w = nbb.w + p;\n var h = nbb.h + p;\n cellWidth = Math.max(cellWidth, w);\n cellHeight = Math.max(cellHeight, h);\n }\n }\n\n var cellUsed = {}; // e.g. 'c-0-2' => true\n\n var used = function used(row, col) {\n return cellUsed['c-' + row + '-' + col] ? true : false;\n };\n\n var use = function use(row, col) {\n cellUsed['c-' + row + '-' + col] = true;\n }; // to keep track of current cell position\n\n\n var row = 0;\n var col = 0;\n\n var moveToNextCell = function moveToNextCell() {\n col++;\n\n if (col >= cols) {\n col = 0;\n row++;\n }\n }; // get a cache of all the manual positions\n\n\n var id2manPos = {};\n\n for (var _i = 0; _i < nodes.length; _i++) {\n var _node = nodes[_i];\n var rcPos = options.position(_node);\n\n if (rcPos && (rcPos.row !== undefined || rcPos.col !== undefined)) {\n // must have at least row or col def'd\n var _pos = {\n row: rcPos.row,\n col: rcPos.col\n };\n\n if (_pos.col === undefined) {\n // find unused col\n _pos.col = 0;\n\n while (used(_pos.row, _pos.col)) {\n _pos.col++;\n }\n } else if (_pos.row === undefined) {\n // find unused row\n _pos.row = 0;\n\n while (used(_pos.row, _pos.col)) {\n _pos.row++;\n }\n }\n\n id2manPos[_node.id()] = _pos;\n use(_pos.row, _pos.col);\n }\n }\n\n var getPos = function getPos(element, i) {\n var x, y;\n\n if (element.locked() || element.isParent()) {\n return false;\n } // see if we have a manual position set\n\n\n var rcPos = id2manPos[element.id()];\n\n if (rcPos) {\n x = rcPos.col * cellWidth + cellWidth / 2 + bb.x1;\n y = rcPos.row * cellHeight + cellHeight / 2 + bb.y1;\n } else {\n // otherwise set automatically\n while (used(row, col)) {\n moveToNextCell();\n }\n\n x = col * cellWidth + cellWidth / 2 + bb.x1;\n y = row * cellHeight + cellHeight / 2 + bb.y1;\n use(row, col);\n moveToNextCell();\n }\n\n return {\n x: x,\n y: y\n };\n };\n\n nodes.layoutPositions(this, options, getPos);\n }\n\n return this; // chaining\n};\n\nvar defaults$e = {\n ready: function ready() {},\n // on layoutready\n stop: function stop() {} // on layoutstop\n\n}; // constructor\n// options : object containing layout options\n\nfunction NullLayout(options) {\n this.options = extend({}, defaults$e, options);\n} // runs the layout\n\n\nNullLayout.prototype.run = function () {\n var options = this.options;\n var eles = options.eles; // elements to consider in the layout\n\n var layout = this; // cy is automatically populated for us in the constructor\n // (disable eslint for next line as this serves as example layout code to external developers)\n // eslint-disable-next-line no-unused-vars\n\n var cy = options.cy;\n layout.emit('layoutstart'); // puts all nodes at (0, 0)\n // n.b. most layouts would use layoutPositions(), instead of positions() and manual events\n\n eles.nodes().positions(function () {\n return {\n x: 0,\n y: 0\n };\n }); // trigger layoutready when each node has had its position set at least once\n\n layout.one('layoutready', options.ready);\n layout.emit('layoutready'); // trigger layoutstop when the layout stops (e.g. finishes)\n\n layout.one('layoutstop', options.stop);\n layout.emit('layoutstop');\n return this; // chaining\n}; // called on continuous layouts to stop them before they finish\n\n\nNullLayout.prototype.stop = function () {\n return this; // chaining\n};\n\nvar defaults$f = {\n positions: undefined,\n // map of (node id) => (position obj); or function(node){ return somPos; }\n zoom: undefined,\n // the zoom level to set (prob want fit = false if set)\n pan: undefined,\n // the pan level to set (prob want fit = false if set)\n fit: true,\n // whether to fit to viewport\n padding: 30,\n // padding on fit\n animate: false,\n // whether to transition the node positions\n animationDuration: 500,\n // duration of animation in ms if enabled\n animationEasing: undefined,\n // easing of animation if enabled\n animateFilter: function animateFilter(node, i) {\n return true;\n },\n // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts\n ready: undefined,\n // callback on layoutready\n stop: undefined,\n // callback on layoutstop\n transform: function transform(node, position) {\n return position;\n } // transform a given node position. Useful for changing flow direction in discrete layouts\n\n};\n\nfunction PresetLayout(options) {\n this.options = extend({}, defaults$f, options);\n}\n\nPresetLayout.prototype.run = function () {\n var options = this.options;\n var eles = options.eles;\n var nodes = eles.nodes();\n var posIsFn = fn(options.positions);\n\n function getPosition(node) {\n if (options.positions == null) {\n return copyPosition(node.position());\n }\n\n if (posIsFn) {\n return options.positions(node);\n }\n\n var pos = options.positions[node._private.data.id];\n\n if (pos == null) {\n return null;\n }\n\n return pos;\n }\n\n nodes.layoutPositions(this, options, function (node, i) {\n var position = getPosition(node);\n\n if (node.locked() || position == null) {\n return false;\n }\n\n return position;\n });\n return this; // chaining\n};\n\nvar defaults$g = {\n fit: true,\n // whether to fit to viewport\n padding: 30,\n // fit padding\n boundingBox: undefined,\n // constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }\n animate: false,\n // whether to transition the node positions\n animationDuration: 500,\n // duration of animation in ms if enabled\n animationEasing: undefined,\n // easing of animation if enabled\n animateFilter: function animateFilter(node, i) {\n return true;\n },\n // a function that determines whether the node should be animated. All nodes animated by default on animate enabled. Non-animated nodes are positioned immediately when the layout starts\n ready: undefined,\n // callback on layoutready\n stop: undefined,\n // callback on layoutstop\n transform: function transform(node, position) {\n return position;\n } // transform a given node position. Useful for changing flow direction in discrete layouts \n\n};\n\nfunction RandomLayout(options) {\n this.options = extend({}, defaults$g, options);\n}\n\nRandomLayout.prototype.run = function () {\n var options = this.options;\n var cy = options.cy;\n var eles = options.eles;\n var nodes = eles.nodes().not(':parent');\n var bb = makeBoundingBox(options.boundingBox ? options.boundingBox : {\n x1: 0,\n y1: 0,\n w: cy.width(),\n h: cy.height()\n });\n\n var getPos = function getPos(node, i) {\n return {\n x: bb.x1 + Math.round(Math.random() * bb.w),\n y: bb.y1 + Math.round(Math.random() * bb.h)\n };\n };\n\n nodes.layoutPositions(this, options, getPos);\n return this; // chaining\n};\n\nvar layout = [{\n name: 'breadthfirst',\n impl: BreadthFirstLayout\n}, {\n name: 'circle',\n impl: CircleLayout\n}, {\n name: 'concentric',\n impl: ConcentricLayout\n}, {\n name: 'cose',\n impl: CoseLayout\n}, {\n name: 'grid',\n impl: GridLayout\n}, {\n name: 'null',\n impl: NullLayout\n}, {\n name: 'preset',\n impl: PresetLayout\n}, {\n name: 'random',\n impl: RandomLayout\n}];\n\nfunction NullRenderer(options) {\n this.options = options;\n this.notifications = 0; // for testing\n}\n\nvar noop$1 = function noop() {};\n\nvar throwImgErr = function throwImgErr() {\n throw new Error('A headless instance can not render images');\n};\n\nNullRenderer.prototype = {\n recalculateRenderedStyle: noop$1,\n notify: function notify() {\n this.notifications++;\n },\n init: noop$1,\n isHeadless: function isHeadless() {\n return true;\n },\n png: throwImgErr,\n jpg: throwImgErr\n};\n\nvar BRp = {};\nBRp.arrowShapeWidth = 0.3;\n\nBRp.registerArrowShapes = function () {\n var arrowShapes = this.arrowShapes = {};\n var renderer = this; // Contract for arrow shapes:\n // 0, 0 is arrow tip\n // (0, 1) is direction towards node\n // (1, 0) is right\n //\n // functional api:\n // collide: check x, y in shape\n // roughCollide: called before collide, no false negatives\n // draw: draw\n // spacing: dist(arrowTip, nodeBoundary)\n // gap: dist(edgeTip, nodeBoundary), edgeTip may != arrowTip\n\n var bbCollide = function bbCollide(x, y, size, angle, translation, edgeWidth, padding) {\n var x1 = translation.x - size / 2 - padding;\n var x2 = translation.x + size / 2 + padding;\n var y1 = translation.y - size / 2 - padding;\n var y2 = translation.y + size / 2 + padding;\n var inside = x1 <= x && x <= x2 && y1 <= y && y <= y2;\n return inside;\n };\n\n var transform = function transform(x, y, size, angle, translation) {\n var xRotated = x * Math.cos(angle) - y * Math.sin(angle);\n var yRotated = x * Math.sin(angle) + y * Math.cos(angle);\n var xScaled = xRotated * size;\n var yScaled = yRotated * size;\n var xTranslated = xScaled + translation.x;\n var yTranslated = yScaled + translation.y;\n return {\n x: xTranslated,\n y: yTranslated\n };\n };\n\n var transformPoints = function transformPoints(pts, size, angle, translation) {\n var retPts = [];\n\n for (var i = 0; i < pts.length; i += 2) {\n var x = pts[i];\n var y = pts[i + 1];\n retPts.push(transform(x, y, size, angle, translation));\n }\n\n return retPts;\n };\n\n var pointsToArr = function pointsToArr(pts) {\n var ret = [];\n\n for (var i = 0; i < pts.length; i++) {\n var p = pts[i];\n ret.push(p.x, p.y);\n }\n\n return ret;\n };\n\n var standardGap = function standardGap(edge) {\n return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').pfValue * 2;\n };\n\n var defineArrowShape = function defineArrowShape(name, defn) {\n if (string(defn)) {\n defn = arrowShapes[defn];\n }\n\n arrowShapes[name] = extend({\n name: name,\n points: [-0.15, -0.3, 0.15, -0.3, 0.15, 0.3, -0.15, 0.3],\n collide: function collide(x, y, size, angle, translation, padding) {\n var points = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation));\n var inside = pointInsidePolygonPoints(x, y, points);\n return inside;\n },\n roughCollide: bbCollide,\n draw: function draw(context, size, angle, translation) {\n var points = transformPoints(this.points, size, angle, translation);\n renderer.arrowShapeImpl('polygon')(context, points);\n },\n spacing: function spacing(edge) {\n return 0;\n },\n gap: standardGap\n }, defn);\n };\n\n defineArrowShape('none', {\n collide: falsify,\n roughCollide: falsify,\n draw: noop,\n spacing: zeroify,\n gap: zeroify\n });\n defineArrowShape('triangle', {\n points: [-0.15, -0.3, 0, 0, 0.15, -0.3]\n });\n defineArrowShape('arrow', 'triangle');\n defineArrowShape('triangle-backcurve', {\n points: arrowShapes['triangle'].points,\n controlPoint: [0, -0.15],\n roughCollide: bbCollide,\n draw: function draw(context, size, angle, translation, edgeWidth) {\n var ptsTrans = transformPoints(this.points, size, angle, translation);\n var ctrlPt = this.controlPoint;\n var ctrlPtTrans = transform(ctrlPt[0], ctrlPt[1], size, angle, translation);\n renderer.arrowShapeImpl(this.name)(context, ptsTrans, ctrlPtTrans);\n },\n gap: function gap(edge) {\n return standardGap(edge) * 0.8;\n }\n });\n defineArrowShape('triangle-tee', {\n points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],\n pointsTee: [-0.15, -0.4, -0.15, -0.5, 0.15, -0.5, 0.15, -0.4],\n collide: function collide(x, y, size, angle, translation, edgeWidth, padding) {\n var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation));\n var teePts = pointsToArr(transformPoints(this.pointsTee, size + 2 * padding, angle, translation));\n var inside = pointInsidePolygonPoints(x, y, triPts) || pointInsidePolygonPoints(x, y, teePts);\n return inside;\n },\n draw: function draw(context, size, angle, translation, edgeWidth) {\n var triPts = transformPoints(this.points, size, angle, translation);\n var teePts = transformPoints(this.pointsTee, size, angle, translation);\n renderer.arrowShapeImpl(this.name)(context, triPts, teePts);\n }\n });\n defineArrowShape('circle-triangle', {\n radius: 0.15,\n pointsTr: [0, -0.15, 0.15, -0.45, -0.15, -0.45, 0, -0.15],\n collide: function collide(x, y, size, angle, translation, edgeWidth, padding) {\n var t = translation;\n var circleInside = Math.pow(t.x - x, 2) + Math.pow(t.y - y, 2) <= Math.pow((size + 2 * padding) * this.radius, 2);\n var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation));\n return pointInsidePolygonPoints(x, y, triPts) || circleInside;\n },\n draw: function draw(context, size, angle, translation, edgeWidth) {\n var triPts = transformPoints(this.pointsTr, size, angle, translation);\n renderer.arrowShapeImpl(this.name)(context, triPts, translation.x, translation.y, this.radius * size);\n },\n spacing: function spacing(edge) {\n return renderer.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.radius;\n }\n });\n defineArrowShape('triangle-cross', {\n points: [0, 0, 0.15, -0.3, -0.15, -0.3, 0, 0],\n baseCrossLinePts: [-0.15, -0.4, // first half of the rectangle\n -0.15, -0.4, 0.15, -0.4, // second half of the rectangle\n 0.15, -0.4],\n crossLinePts: function crossLinePts(size, edgeWidth) {\n // shift points so that the distance between the cross points matches edge width\n var p = this.baseCrossLinePts.slice();\n var shiftFactor = edgeWidth / size;\n var y0 = 3;\n var y1 = 5;\n p[y0] = p[y0] - shiftFactor;\n p[y1] = p[y1] - shiftFactor;\n return p;\n },\n collide: function collide(x, y, size, angle, translation, edgeWidth, padding) {\n var triPts = pointsToArr(transformPoints(this.points, size + 2 * padding, angle, translation));\n var teePts = pointsToArr(transformPoints(this.crossLinePts(size, edgeWidth), size + 2 * padding, angle, translation));\n var inside = pointInsidePolygonPoints(x, y, triPts) || pointInsidePolygonPoints(x, y, teePts);\n return inside;\n },\n draw: function draw(context, size, angle, translation, edgeWidth) {\n var triPts = transformPoints(this.points, size, angle, translation);\n var crossLinePts = transformPoints(this.crossLinePts(size, edgeWidth), size, angle, translation);\n renderer.arrowShapeImpl(this.name)(context, triPts, crossLinePts);\n }\n });\n defineArrowShape('vee', {\n points: [-0.15, -0.3, 0, 0, 0.15, -0.3, 0, -0.15],\n gap: function gap(edge) {\n return standardGap(edge) * 0.525;\n }\n });\n defineArrowShape('circle', {\n radius: 0.15,\n collide: function collide(x, y, size, angle, translation, edgeWidth, padding) {\n var t = translation;\n var inside = Math.pow(t.x - x, 2) + Math.pow(t.y - y, 2) <= Math.pow((size + 2 * padding) * this.radius, 2);\n return inside;\n },\n draw: function draw(context, size, angle, translation, edgeWidth) {\n renderer.arrowShapeImpl(this.name)(context, translation.x, translation.y, this.radius * size);\n },\n spacing: function spacing(edge) {\n return renderer.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.radius;\n }\n });\n defineArrowShape('tee', {\n points: [-0.15, 0, -0.15, -0.1, 0.15, -0.1, 0.15, 0],\n spacing: function spacing(edge) {\n return 1;\n },\n gap: function gap(edge) {\n return 1;\n }\n });\n defineArrowShape('square', {\n points: [-0.15, 0.00, 0.15, 0.00, 0.15, -0.3, -0.15, -0.3]\n });\n defineArrowShape('diamond', {\n points: [-0.15, -0.15, 0, -0.3, 0.15, -0.15, 0, 0],\n gap: function gap(edge) {\n return edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').value;\n }\n });\n defineArrowShape('chevron', {\n points: [0, 0, -0.15, -0.15, -0.1, -0.2, 0, -0.1, 0.1, -0.2, 0.15, -0.15],\n gap: function gap(edge) {\n return 0.95 * edge.pstyle('width').pfValue * edge.pstyle('arrow-scale').value;\n }\n });\n};\n\nvar BRp$1 = {}; // Project mouse\n\nBRp$1.projectIntoViewport = function (clientX, clientY) {\n var cy = this.cy;\n var offsets = this.findContainerClientCoords();\n var offsetLeft = offsets[0];\n var offsetTop = offsets[1];\n var scale = offsets[4];\n var pan = cy.pan();\n var zoom = cy.zoom();\n var x = ((clientX - offsetLeft) / scale - pan.x) / zoom;\n var y = ((clientY - offsetTop) / scale - pan.y) / zoom;\n return [x, y];\n};\n\nBRp$1.findContainerClientCoords = function () {\n if (this.containerBB) {\n return this.containerBB;\n }\n\n var container = this.container;\n var rect = container.getBoundingClientRect();\n var style = window$1.getComputedStyle(container);\n\n var styleValue = function styleValue(name) {\n return parseFloat(style.getPropertyValue(name));\n };\n\n var padding = {\n left: styleValue('padding-left'),\n right: styleValue('padding-right'),\n top: styleValue('padding-top'),\n bottom: styleValue('padding-bottom')\n };\n var border = {\n left: styleValue('border-left-width'),\n right: styleValue('border-right-width'),\n top: styleValue('border-top-width'),\n bottom: styleValue('border-bottom-width')\n };\n var clientWidth = container.clientWidth;\n var clientHeight = container.clientHeight;\n var paddingHor = padding.left + padding.right;\n var paddingVer = padding.top + padding.bottom;\n var borderHor = border.left + border.right;\n var scale = rect.width / (clientWidth + borderHor);\n var unscaledW = clientWidth - paddingHor;\n var unscaledH = clientHeight - paddingVer;\n var left = rect.left + padding.left + border.left;\n var top = rect.top + padding.top + border.top;\n return this.containerBB = [left, top, unscaledW, unscaledH, scale];\n};\n\nBRp$1.invalidateContainerClientCoordsCache = function () {\n this.containerBB = null;\n};\n\nBRp$1.findNearestElement = function (x, y, interactiveElementsOnly, isTouch) {\n return this.findNearestElements(x, y, interactiveElementsOnly, isTouch)[0];\n};\n\nBRp$1.findNearestElements = function (x, y, interactiveElementsOnly, isTouch) {\n var self = this;\n var r = this;\n var eles = r.getCachedZSortedEles();\n var near = []; // 1 node max, 1 edge max\n\n var zoom = r.cy.zoom();\n var hasCompounds = r.cy.hasCompoundNodes();\n var edgeThreshold = (isTouch ? 24 : 8) / zoom;\n var nodeThreshold = (isTouch ? 8 : 2) / zoom;\n var labelThreshold = (isTouch ? 8 : 2) / zoom;\n var minSqDist = Infinity;\n var nearEdge;\n var nearNode;\n\n if (interactiveElementsOnly) {\n eles = eles.interactive;\n }\n\n function addEle(ele, sqDist) {\n if (ele.isNode()) {\n if (nearNode) {\n return; // can't replace node\n } else {\n nearNode = ele;\n near.push(ele);\n }\n }\n\n if (ele.isEdge() && (sqDist == null || sqDist < minSqDist)) {\n if (nearEdge) {\n // then replace existing edge\n // can replace only if same z-index\n if (nearEdge.pstyle('z-compound-depth').value === ele.pstyle('z-compound-depth').value && nearEdge.pstyle('z-compound-depth').value === ele.pstyle('z-compound-depth').value) {\n for (var i = 0; i < near.length; i++) {\n if (near[i].isEdge()) {\n near[i] = ele;\n nearEdge = ele;\n minSqDist = sqDist != null ? sqDist : minSqDist;\n break;\n }\n }\n }\n } else {\n near.push(ele);\n nearEdge = ele;\n minSqDist = sqDist != null ? sqDist : minSqDist;\n }\n }\n }\n\n function checkNode(node) {\n var width = node.outerWidth() + 2 * nodeThreshold;\n var height = node.outerHeight() + 2 * nodeThreshold;\n var hw = width / 2;\n var hh = height / 2;\n var pos = node.position();\n\n if (pos.x - hw <= x && x <= pos.x + hw // bb check x\n && pos.y - hh <= y && y <= pos.y + hh // bb check y\n ) {\n var shape = r.nodeShapes[self.getNodeShape(node)];\n\n if (shape.checkPoint(x, y, 0, width, height, pos.x, pos.y)) {\n addEle(node, 0);\n return true;\n }\n }\n }\n\n function checkEdge(edge) {\n var _p = edge._private;\n var rs = _p.rscratch;\n var styleWidth = edge.pstyle('width').pfValue;\n var scale = edge.pstyle('arrow-scale').value;\n var width = styleWidth / 2 + edgeThreshold; // more like a distance radius from centre\n\n var widthSq = width * width;\n var width2 = width * 2;\n var src = _p.source;\n var tgt = _p.target;\n var sqDist;\n\n if (rs.edgeType === 'segments' || rs.edgeType === 'straight' || rs.edgeType === 'haystack') {\n var pts = rs.allpts;\n\n for (var i = 0; i + 3 < pts.length; i += 2) {\n if (inLineVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], width2) && widthSq > (sqDist = sqdistToFiniteLine(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3]))) {\n addEle(edge, sqDist);\n return true;\n }\n }\n } else if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') {\n var pts = rs.allpts;\n\n for (var i = 0; i + 5 < rs.allpts.length; i += 4) {\n if (inBezierVicinity(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5], width2) && widthSq > (sqDist = sqdistToQuadraticBezier(x, y, pts[i], pts[i + 1], pts[i + 2], pts[i + 3], pts[i + 4], pts[i + 5]))) {\n addEle(edge, sqDist);\n return true;\n }\n }\n } // if we're close to the edge but didn't hit it, maybe we hit its arrows\n\n\n var src = src || _p.source;\n var tgt = tgt || _p.target;\n var arSize = self.getArrowWidth(styleWidth, scale);\n var arrows = [{\n name: 'source',\n x: rs.arrowStartX,\n y: rs.arrowStartY,\n angle: rs.srcArrowAngle\n }, {\n name: 'target',\n x: rs.arrowEndX,\n y: rs.arrowEndY,\n angle: rs.tgtArrowAngle\n }, {\n name: 'mid-source',\n x: rs.midX,\n y: rs.midY,\n angle: rs.midsrcArrowAngle\n }, {\n name: 'mid-target',\n x: rs.midX,\n y: rs.midY,\n angle: rs.midtgtArrowAngle\n }];\n\n for (var i = 0; i < arrows.length; i++) {\n var ar = arrows[i];\n var shape = r.arrowShapes[edge.pstyle(ar.name + '-arrow-shape').value];\n var edgeWidth = edge.pstyle('width').pfValue;\n\n if (shape.roughCollide(x, y, arSize, ar.angle, {\n x: ar.x,\n y: ar.y\n }, edgeWidth, edgeThreshold) && shape.collide(x, y, arSize, ar.angle, {\n x: ar.x,\n y: ar.y\n }, edgeWidth, edgeThreshold)) {\n addEle(edge);\n return true;\n }\n } // for compound graphs, hitting edge may actually want a connected node instead (b/c edge may have greater z-index precedence)\n\n\n if (hasCompounds && near.length > 0) {\n checkNode(src);\n checkNode(tgt);\n }\n }\n\n function preprop(obj, name, pre) {\n return getPrefixedProperty(obj, name, pre);\n }\n\n function checkLabel(ele, prefix) {\n var _p = ele._private;\n var th = labelThreshold;\n var prefixDash;\n\n if (prefix) {\n prefixDash = prefix + '-';\n } else {\n prefixDash = '';\n }\n\n ele.boundingBox();\n var bb = _p.labelBounds[prefix || 'main'];\n var text = ele.pstyle(prefixDash + 'label').value;\n var eventsEnabled = ele.pstyle('text-events').strValue === 'yes';\n\n if (!eventsEnabled || !text) {\n return;\n }\n\n var rstyle = _p.rstyle;\n var lx = preprop(rstyle, 'labelX', prefix);\n var ly = preprop(rstyle, 'labelY', prefix);\n var theta = preprop(_p.rscratch, 'labelAngle', prefix);\n var lx1 = bb.x1 - th;\n var lx2 = bb.x2 + th;\n var ly1 = bb.y1 - th;\n var ly2 = bb.y2 + th;\n\n if (theta) {\n var cos = Math.cos(theta);\n var sin = Math.sin(theta);\n\n var rotate = function rotate(x, y) {\n x = x - lx;\n y = y - ly;\n return {\n x: x * cos - y * sin + lx,\n y: x * sin + y * cos + ly\n };\n };\n\n var px1y1 = rotate(lx1, ly1);\n var px1y2 = rotate(lx1, ly2);\n var px2y1 = rotate(lx2, ly1);\n var px2y2 = rotate(lx2, ly2);\n var points = [px1y1.x, px1y1.y, px2y1.x, px2y1.y, px2y2.x, px2y2.y, px1y2.x, px1y2.y];\n\n if (pointInsidePolygonPoints(x, y, points)) {\n addEle(ele);\n return true;\n }\n } else {\n // do a cheaper bb check\n if (inBoundingBox(bb, x, y)) {\n addEle(ele);\n return true;\n }\n }\n }\n\n for (var i = eles.length - 1; i >= 0; i--) {\n // reverse order for precedence\n var ele = eles[i];\n\n if (ele.isNode()) {\n checkNode(ele) || checkLabel(ele);\n } else {\n // then edge\n checkEdge(ele) || checkLabel(ele) || checkLabel(ele, 'source') || checkLabel(ele, 'target');\n }\n }\n\n return near;\n}; // 'Give me everything from this box'\n\n\nBRp$1.getAllInBox = function (x1, y1, x2, y2) {\n var eles = this.getCachedZSortedEles().interactive;\n var box = [];\n var x1c = Math.min(x1, x2);\n var x2c = Math.max(x1, x2);\n var y1c = Math.min(y1, y2);\n var y2c = Math.max(y1, y2);\n x1 = x1c;\n x2 = x2c;\n y1 = y1c;\n y2 = y2c;\n var boxBb = makeBoundingBox({\n x1: x1,\n y1: y1,\n x2: x2,\n y2: y2\n });\n\n for (var e = 0; e < eles.length; e++) {\n var ele = eles[e];\n\n if (ele.isNode()) {\n var node = ele;\n var nodeBb = node.boundingBox({\n includeNodes: true,\n includeEdges: false,\n includeLabels: false\n });\n\n if (boundingBoxesIntersect(boxBb, nodeBb) && !boundingBoxInBoundingBox(nodeBb, boxBb)) {\n box.push(node);\n }\n } else {\n var edge = ele;\n var _p = edge._private;\n var rs = _p.rscratch;\n\n if (rs.startX != null && rs.startY != null && !inBoundingBox(boxBb, rs.startX, rs.startY)) {\n continue;\n }\n\n if (rs.endX != null && rs.endY != null && !inBoundingBox(boxBb, rs.endX, rs.endY)) {\n continue;\n }\n\n if (rs.edgeType === 'bezier' || rs.edgeType === 'multibezier' || rs.edgeType === 'self' || rs.edgeType === 'compound' || rs.edgeType === 'segments' || rs.edgeType === 'haystack') {\n var pts = _p.rstyle.bezierPts || _p.rstyle.linePts || _p.rstyle.haystackPts;\n var allInside = true;\n\n for (var i = 0; i < pts.length; i++) {\n if (!pointInBoundingBox(boxBb, pts[i])) {\n allInside = false;\n break;\n }\n }\n\n if (allInside) {\n box.push(edge);\n }\n } else if (rs.edgeType === 'haystack' || rs.edgeType === 'straight') {\n box.push(edge);\n }\n }\n }\n\n return box;\n};\n\nvar BRp$2 = {};\n\nBRp$2.calculateArrowAngles = function (edge) {\n var rs = edge._private.rscratch;\n var isHaystack = rs.edgeType === 'haystack';\n var isBezier = rs.edgeType === 'bezier';\n var isMultibezier = rs.edgeType === 'multibezier';\n var isSegments = rs.edgeType === 'segments';\n var isCompound = rs.edgeType === 'compound';\n var isSelf = rs.edgeType === 'self'; // Displacement gives direction for arrowhead orientation\n\n var dispX, dispY;\n var startX, startY, endX, endY, midX, midY;\n\n if (isHaystack) {\n startX = rs.haystackPts[0];\n startY = rs.haystackPts[1];\n endX = rs.haystackPts[2];\n endY = rs.haystackPts[3];\n } else {\n startX = rs.arrowStartX;\n startY = rs.arrowStartY;\n endX = rs.arrowEndX;\n endY = rs.arrowEndY;\n }\n\n midX = rs.midX;\n midY = rs.midY; // source\n //\n\n if (isSegments) {\n dispX = startX - rs.segpts[0];\n dispY = startY - rs.segpts[1];\n } else if (isMultibezier || isCompound || isSelf || isBezier) {\n var pts = rs.allpts;\n var bX = qbezierAt(pts[0], pts[2], pts[4], 0.1);\n var bY = qbezierAt(pts[1], pts[3], pts[5], 0.1);\n dispX = startX - bX;\n dispY = startY - bY;\n } else {\n dispX = startX - midX;\n dispY = startY - midY;\n }\n\n rs.srcArrowAngle = getAngleFromDisp(dispX, dispY); // mid target\n //\n\n var midX = rs.midX;\n var midY = rs.midY;\n\n if (isHaystack) {\n midX = (startX + endX) / 2;\n midY = (startY + endY) / 2;\n }\n\n dispX = endX - startX;\n dispY = endY - startY;\n\n if (isSegments) {\n var pts = rs.allpts;\n\n if (pts.length / 2 % 2 === 0) {\n var i2 = pts.length / 2;\n var i1 = i2 - 2;\n dispX = pts[i2] - pts[i1];\n dispY = pts[i2 + 1] - pts[i1 + 1];\n } else {\n var i2 = pts.length / 2 - 1;\n var i1 = i2 - 2;\n var i3 = i2 + 2;\n dispX = pts[i2] - pts[i1];\n dispY = pts[i2 + 1] - pts[i1 + 1];\n }\n } else if (isMultibezier || isCompound || isSelf) {\n var pts = rs.allpts;\n var cpts = rs.ctrlpts;\n var bp0x, bp0y;\n var bp1x, bp1y;\n\n if (cpts.length / 2 % 2 === 0) {\n var p0 = pts.length / 2 - 1; // startpt\n\n var ic = p0 + 2;\n var p1 = ic + 2;\n bp0x = qbezierAt(pts[p0], pts[ic], pts[p1], 0.0);\n bp0y = qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0);\n bp1x = qbezierAt(pts[p0], pts[ic], pts[p1], 0.0001);\n bp1y = qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.0001);\n } else {\n var ic = pts.length / 2 - 1; // ctrpt\n\n var p0 = ic - 2; // startpt\n\n var p1 = ic + 2; // endpt\n\n bp0x = qbezierAt(pts[p0], pts[ic], pts[p1], 0.4999);\n bp0y = qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.4999);\n bp1x = qbezierAt(pts[p0], pts[ic], pts[p1], 0.5);\n bp1y = qbezierAt(pts[p0 + 1], pts[ic + 1], pts[p1 + 1], 0.5);\n }\n\n dispX = bp1x - bp0x;\n dispY = bp1y - bp0y;\n }\n\n rs.midtgtArrowAngle = getAngleFromDisp(dispX, dispY);\n rs.midDispX = dispX;\n rs.midDispY = dispY; // mid source\n //\n\n dispX *= -1;\n dispY *= -1;\n\n if (isSegments) {\n var pts = rs.allpts;\n\n if (pts.length / 2 % 2 === 0) ; else {\n var i2 = pts.length / 2 - 1;\n var i3 = i2 + 2;\n dispX = -(pts[i3] - pts[i2]);\n dispY = -(pts[i3 + 1] - pts[i2 + 1]);\n }\n }\n\n rs.midsrcArrowAngle = getAngleFromDisp(dispX, dispY); // target\n //\n\n if (isSegments) {\n dispX = endX - rs.segpts[rs.segpts.length - 2];\n dispY = endY - rs.segpts[rs.segpts.length - 1];\n } else if (isMultibezier || isCompound || isSelf || isBezier) {\n var pts = rs.allpts;\n var l = pts.length;\n var bX = qbezierAt(pts[l - 6], pts[l - 4], pts[l - 2], 0.9);\n var bY = qbezierAt(pts[l - 5], pts[l - 3], pts[l - 1], 0.9);\n dispX = endX - bX;\n dispY = endY - bY;\n } else {\n dispX = endX - midX;\n dispY = endY - midY;\n }\n\n rs.tgtArrowAngle = getAngleFromDisp(dispX, dispY);\n};\n\nBRp$2.getArrowWidth = BRp$2.getArrowHeight = function (edgeWidth, scale) {\n var cache = this.arrowWidthCache = this.arrowWidthCache || {};\n var cachedVal = cache[edgeWidth + ', ' + scale];\n\n if (cachedVal) {\n return cachedVal;\n }\n\n cachedVal = Math.max(Math.pow(edgeWidth * 13.37, 0.9), 29) * scale;\n cache[edgeWidth + ', ' + scale] = cachedVal;\n return cachedVal;\n};\n\nvar BRp$3 = {};\n\nBRp$3.findHaystackPoints = function (edges) {\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n var _p = edge._private;\n var rs = _p.rscratch;\n\n if (!rs.haystack) {\n var angle = Math.random() * 2 * Math.PI;\n rs.source = {\n x: Math.cos(angle),\n y: Math.sin(angle)\n };\n angle = Math.random() * 2 * Math.PI;\n rs.target = {\n x: Math.cos(angle),\n y: Math.sin(angle)\n };\n }\n\n var src = _p.source;\n var tgt = _p.target;\n var srcPos = src.position();\n var tgtPos = tgt.position();\n var srcW = src.width();\n var tgtW = tgt.width();\n var srcH = src.height();\n var tgtH = tgt.height();\n var radius = edge.pstyle('haystack-radius').value;\n var halfRadius = radius / 2; // b/c have to half width/height\n\n rs.haystackPts = rs.allpts = [rs.source.x * srcW * halfRadius + srcPos.x, rs.source.y * srcH * halfRadius + srcPos.y, rs.target.x * tgtW * halfRadius + tgtPos.x, rs.target.y * tgtH * halfRadius + tgtPos.y];\n rs.midX = (rs.allpts[0] + rs.allpts[2]) / 2;\n rs.midY = (rs.allpts[1] + rs.allpts[3]) / 2; // always override as haystack in case set to different type previously\n\n rs.edgeType = 'haystack';\n rs.haystack = true;\n this.storeEdgeProjections(edge);\n this.calculateArrowAngles(edge);\n this.recalculateEdgeLabelProjections(edge);\n this.calculateLabelAngles(edge);\n }\n};\n\nBRp$3.findSegmentsPoints = function (edge, pairInfo) {\n // Segments (multiple straight lines)\n var rs = edge._private.rscratch;\n var posPts = pairInfo.posPts,\n intersectionPts = pairInfo.intersectionPts,\n vectorNormInverse = pairInfo.vectorNormInverse;\n var edgeDistances = edge.pstyle('edge-distances').value;\n var segmentWs = edge.pstyle('segment-weights');\n var segmentDs = edge.pstyle('segment-distances');\n var segmentsN = Math.min(segmentWs.pfValue.length, segmentDs.pfValue.length);\n rs.edgeType = 'segments';\n rs.segpts = [];\n\n for (var s = 0; s < segmentsN; s++) {\n var w = segmentWs.pfValue[s];\n var d = segmentDs.pfValue[s];\n var w1 = 1 - w;\n var w2 = w;\n var midptPts = edgeDistances === 'node-position' ? posPts : intersectionPts;\n var adjustedMidpt = {\n x: midptPts.x1 * w1 + midptPts.x2 * w2,\n y: midptPts.y1 * w1 + midptPts.y2 * w2\n };\n rs.segpts.push(adjustedMidpt.x + vectorNormInverse.x * d, adjustedMidpt.y + vectorNormInverse.y * d);\n }\n};\n\nBRp$3.findLoopPoints = function (edge, pairInfo, i, edgeIsUnbundled) {\n // Self-edge\n var rs = edge._private.rscratch;\n var dirCounts = pairInfo.dirCounts,\n srcPos = pairInfo.srcPos;\n var ctrlptDists = edge.pstyle('control-point-distances');\n var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined;\n var loopDir = edge.pstyle('loop-direction').pfValue;\n var loopSwp = edge.pstyle('loop-sweep').pfValue;\n var stepSize = edge.pstyle('control-point-step-size').pfValue;\n rs.edgeType = 'self';\n var j = i;\n var loopDist = stepSize;\n\n if (edgeIsUnbundled) {\n j = 0;\n loopDist = ctrlptDist;\n }\n\n var loopAngle = loopDir - Math.PI / 2;\n var outAngle = loopAngle - loopSwp / 2;\n var inAngle = loopAngle + loopSwp / 2; // increase by step size for overlapping loops, keyed on direction and sweep values\n\n var dc = String(loopDir + '_' + loopSwp);\n j = dirCounts[dc] === undefined ? dirCounts[dc] = 0 : ++dirCounts[dc];\n rs.ctrlpts = [srcPos.x + Math.cos(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(outAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.x + Math.cos(inAngle) * 1.4 * loopDist * (j / 3 + 1), srcPos.y + Math.sin(inAngle) * 1.4 * loopDist * (j / 3 + 1)];\n};\n\nBRp$3.findCompoundLoopPoints = function (edge, pairInfo, i, edgeIsUnbundled) {\n // Compound edge\n var rs = edge._private.rscratch;\n rs.edgeType = 'compound';\n var srcPos = pairInfo.srcPos,\n tgtPos = pairInfo.tgtPos,\n srcW = pairInfo.srcW,\n srcH = pairInfo.srcH,\n tgtW = pairInfo.tgtW,\n tgtH = pairInfo.tgtH;\n var stepSize = edge.pstyle('control-point-step-size').pfValue;\n var ctrlptDists = edge.pstyle('control-point-distances');\n var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined;\n var j = i;\n var loopDist = stepSize;\n\n if (edgeIsUnbundled) {\n j = 0;\n loopDist = ctrlptDist;\n }\n\n var loopW = 50;\n var loopaPos = {\n x: srcPos.x - srcW / 2,\n y: srcPos.y - srcH / 2\n };\n var loopbPos = {\n x: tgtPos.x - tgtW / 2,\n y: tgtPos.y - tgtH / 2\n };\n var loopPos = {\n x: Math.min(loopaPos.x, loopbPos.x),\n y: Math.min(loopaPos.y, loopbPos.y)\n }; // avoids cases with impossible beziers\n\n var minCompoundStretch = 0.5;\n var compoundStretchA = Math.max(minCompoundStretch, Math.log(srcW * 0.01));\n var compoundStretchB = Math.max(minCompoundStretch, Math.log(tgtW * 0.01));\n rs.ctrlpts = [loopPos.x, loopPos.y - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchA, loopPos.x - (1 + Math.pow(loopW, 1.12) / 100) * loopDist * (j / 3 + 1) * compoundStretchB, loopPos.y];\n};\n\nBRp$3.findStraightEdgePoints = function (edge) {\n // Straight edge within bundle\n edge._private.rscratch.edgeType = 'straight';\n};\n\nBRp$3.findBezierPoints = function (edge, pairInfo, i, edgeIsUnbundled, edgeIsSwapped) {\n var rs = edge._private.rscratch;\n var vectorNormInverse = pairInfo.vectorNormInverse,\n posPts = pairInfo.posPts,\n intersectionPts = pairInfo.intersectionPts;\n var edgeDistances = edge.pstyle('edge-distances').value;\n var stepSize = edge.pstyle('control-point-step-size').pfValue;\n var ctrlptDists = edge.pstyle('control-point-distances');\n var ctrlptWs = edge.pstyle('control-point-weights');\n var bezierN = ctrlptDists && ctrlptWs ? Math.min(ctrlptDists.value.length, ctrlptWs.value.length) : 1;\n var ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[0] : undefined;\n var ctrlptWeight = ctrlptWs.value[0]; // (Multi)bezier\n\n var multi = edgeIsUnbundled;\n rs.edgeType = multi ? 'multibezier' : 'bezier';\n rs.ctrlpts = [];\n\n for (var b = 0; b < bezierN; b++) {\n var normctrlptDist = (0.5 - pairInfo.eles.length / 2 + i) * stepSize * (edgeIsSwapped ? -1 : 1);\n var manctrlptDist = void 0;\n var sign = signum(normctrlptDist);\n\n if (multi) {\n ctrlptDist = ctrlptDists ? ctrlptDists.pfValue[b] : stepSize; // fall back on step size\n\n ctrlptWeight = ctrlptWs.value[b];\n }\n\n if (edgeIsUnbundled) {\n // multi or single unbundled\n manctrlptDist = ctrlptDist;\n } else {\n manctrlptDist = ctrlptDist !== undefined ? sign * ctrlptDist : undefined;\n }\n\n var distanceFromMidpoint = manctrlptDist !== undefined ? manctrlptDist : normctrlptDist;\n var w1 = 1 - ctrlptWeight;\n var w2 = ctrlptWeight;\n var midptPts = edgeDistances === 'node-position' ? posPts : intersectionPts;\n var adjustedMidpt = {\n x: midptPts.x1 * w1 + midptPts.x2 * w2,\n y: midptPts.y1 * w1 + midptPts.y2 * w2\n };\n rs.ctrlpts.push(adjustedMidpt.x + vectorNormInverse.x * distanceFromMidpoint, adjustedMidpt.y + vectorNormInverse.y * distanceFromMidpoint);\n }\n};\n\nBRp$3.findTaxiPoints = function (edge, pairInfo) {\n // Taxicab geometry with two turns maximum\n var rs = edge._private.rscratch;\n rs.edgeType = 'segments';\n var VERTICAL = 'vertical';\n var HORIZONTAL = 'horizontal';\n var LEFTWARD = 'leftward';\n var RIGHTWARD = 'rightward';\n var DOWNWARD = 'downward';\n var UPWARD = 'upward';\n var AUTO = 'auto';\n var posPts = pairInfo.posPts,\n srcW = pairInfo.srcW,\n srcH = pairInfo.srcH,\n tgtW = pairInfo.tgtW,\n tgtH = pairInfo.tgtH;\n var edgeDistances = edge.pstyle('edge-distances').value;\n var dIncludesNodeBody = edgeDistances !== 'node-position';\n var taxiDir = edge.pstyle('taxi-direction').value;\n var rawTaxiDir = taxiDir; // unprocessed value\n\n var taxiTurn = edge.pstyle('taxi-turn');\n var turnIsPercent = taxiTurn.units === '%';\n var taxiTurnPfVal = taxiTurn.pfValue;\n var turnIsNegative = taxiTurnPfVal < 0; // i.e. from target side\n\n var minD = edge.pstyle('taxi-turn-min-distance').pfValue;\n var dw = dIncludesNodeBody ? (srcW + tgtW) / 2 : 0;\n var dh = dIncludesNodeBody ? (srcH + tgtH) / 2 : 0;\n var pdx = posPts.x2 - posPts.x1;\n var pdy = posPts.y2 - posPts.y1; // take away the effective w/h from the magnitude of the delta value\n\n var subDWH = function subDWH(dxy, dwh) {\n if (dxy > 0) {\n return Math.max(dxy - dwh, 0);\n } else {\n return Math.min(dxy + dwh, 0);\n }\n };\n\n var dx = subDWH(pdx, dw);\n var dy = subDWH(pdy, dh);\n var isExplicitDir = false;\n\n if (rawTaxiDir === AUTO) {\n taxiDir = Math.abs(dx) > Math.abs(dy) ? HORIZONTAL : VERTICAL;\n } else if (rawTaxiDir === UPWARD || rawTaxiDir === DOWNWARD) {\n taxiDir = VERTICAL;\n isExplicitDir = true;\n } else if (rawTaxiDir === LEFTWARD || rawTaxiDir === RIGHTWARD) {\n taxiDir = HORIZONTAL;\n isExplicitDir = true;\n }\n\n var isVert = taxiDir === VERTICAL;\n var l = isVert ? dy : dx;\n var pl = isVert ? pdy : pdx;\n var sgnL = signum(pl);\n var forcedDir = false;\n\n if (!(isExplicitDir && (turnIsPercent || turnIsNegative)) // forcing in this case would cause weird growing in the opposite direction\n && (rawTaxiDir === DOWNWARD && pl < 0 || rawTaxiDir === UPWARD && pl > 0 || rawTaxiDir === LEFTWARD && pl > 0 || rawTaxiDir === RIGHTWARD && pl < 0)) {\n sgnL *= -1;\n l = sgnL * Math.abs(l);\n forcedDir = true;\n }\n\n var d;\n\n if (turnIsPercent) {\n var p = taxiTurnPfVal < 0 ? 1 + taxiTurnPfVal : taxiTurnPfVal;\n d = p * l;\n } else {\n var k = taxiTurnPfVal < 0 ? l : 0;\n d = k + taxiTurnPfVal * sgnL;\n }\n\n var getIsTooClose = function getIsTooClose(d) {\n return Math.abs(d) < minD || Math.abs(d) >= Math.abs(l);\n };\n\n var isTooCloseSrc = getIsTooClose(d);\n var isTooCloseTgt = getIsTooClose(Math.abs(l) - Math.abs(d));\n var isTooClose = isTooCloseSrc || isTooCloseTgt;\n\n if (isTooClose && !forcedDir) {\n // non-ideal routing\n if (isVert) {\n // vertical fallbacks\n var lShapeInsideSrc = Math.abs(pl) <= srcH / 2;\n var lShapeInsideTgt = Math.abs(pdx) <= tgtW / 2;\n\n if (lShapeInsideSrc) {\n // horizontal Z-shape (direction not respected)\n var x = (posPts.x1 + posPts.x2) / 2;\n var y1 = posPts.y1,\n y2 = posPts.y2;\n rs.segpts = [x, y1, x, y2];\n } else if (lShapeInsideTgt) {\n // vertical Z-shape (distance not respected)\n var y = (posPts.y1 + posPts.y2) / 2;\n var x1 = posPts.x1,\n x2 = posPts.x2;\n rs.segpts = [x1, y, x2, y];\n } else {\n // L-shape fallback (turn distance not respected, but works well with tree siblings)\n rs.segpts = [posPts.x1, posPts.y2];\n }\n } else {\n // horizontal fallbacks\n var _lShapeInsideSrc = Math.abs(pl) <= srcW / 2;\n\n var _lShapeInsideTgt = Math.abs(pdy) <= tgtH / 2;\n\n if (_lShapeInsideSrc) {\n // vertical Z-shape (direction not respected)\n var _y = (posPts.y1 + posPts.y2) / 2;\n\n var _x = posPts.x1,\n _x2 = posPts.x2;\n rs.segpts = [_x, _y, _x2, _y];\n } else if (_lShapeInsideTgt) {\n // horizontal Z-shape (turn distance not respected)\n var _x3 = (posPts.x1 + posPts.x2) / 2;\n\n var _y2 = posPts.y1,\n _y3 = posPts.y2;\n rs.segpts = [_x3, _y2, _x3, _y3];\n } else {\n // L-shape (turn distance not respected, but works well for tree siblings)\n rs.segpts = [posPts.x2, posPts.y1];\n }\n }\n } else {\n // ideal routing\n if (isVert) {\n var _y4 = posPts.y1 + d + (dIncludesNodeBody ? srcH / 2 * sgnL : 0);\n\n var _x4 = posPts.x1,\n _x5 = posPts.x2;\n rs.segpts = [_x4, _y4, _x5, _y4];\n } else {\n // horizontal\n var _x6 = posPts.x1 + d + (dIncludesNodeBody ? srcW / 2 * sgnL : 0);\n\n var _y5 = posPts.y1,\n _y6 = posPts.y2;\n rs.segpts = [_x6, _y5, _x6, _y6];\n }\n }\n};\n\nBRp$3.tryToCorrectInvalidPoints = function (edge, pairInfo) {\n var rs = edge._private.rscratch; // can only correct beziers for now...\n\n if (rs.edgeType === 'bezier') {\n var srcPos = pairInfo.srcPos,\n tgtPos = pairInfo.tgtPos,\n srcW = pairInfo.srcW,\n srcH = pairInfo.srcH,\n tgtW = pairInfo.tgtW,\n tgtH = pairInfo.tgtH,\n srcShape = pairInfo.srcShape,\n tgtShape = pairInfo.tgtShape;\n var badStart = !number(rs.startX) || !number(rs.startY);\n var badAStart = !number(rs.arrowStartX) || !number(rs.arrowStartY);\n var badEnd = !number(rs.endX) || !number(rs.endY);\n var badAEnd = !number(rs.arrowEndX) || !number(rs.arrowEndY);\n var minCpADistFactor = 3;\n var arrowW = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth;\n var minCpADist = minCpADistFactor * arrowW;\n var startACpDist = dist({\n x: rs.ctrlpts[0],\n y: rs.ctrlpts[1]\n }, {\n x: rs.startX,\n y: rs.startY\n });\n var closeStartACp = startACpDist < minCpADist;\n var endACpDist = dist({\n x: rs.ctrlpts[0],\n y: rs.ctrlpts[1]\n }, {\n x: rs.endX,\n y: rs.endY\n });\n var closeEndACp = endACpDist < minCpADist;\n var overlapping = false;\n\n if (badStart || badAStart || closeStartACp) {\n overlapping = true; // project control point along line from src centre to outside the src shape\n // (otherwise intersection will yield nothing)\n\n var cpD = {\n // delta\n x: rs.ctrlpts[0] - srcPos.x,\n y: rs.ctrlpts[1] - srcPos.y\n };\n var cpL = Math.sqrt(cpD.x * cpD.x + cpD.y * cpD.y); // length of line\n\n var cpM = {\n // normalised delta\n x: cpD.x / cpL,\n y: cpD.y / cpL\n };\n var radius = Math.max(srcW, srcH);\n var cpProj = {\n // *2 radius guarantees outside shape\n x: rs.ctrlpts[0] + cpM.x * 2 * radius,\n y: rs.ctrlpts[1] + cpM.y * 2 * radius\n };\n var srcCtrlPtIntn = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, cpProj.x, cpProj.y, 0);\n\n if (closeStartACp) {\n rs.ctrlpts[0] = rs.ctrlpts[0] + cpM.x * (minCpADist - startACpDist);\n rs.ctrlpts[1] = rs.ctrlpts[1] + cpM.y * (minCpADist - startACpDist);\n } else {\n rs.ctrlpts[0] = srcCtrlPtIntn[0] + cpM.x * minCpADist;\n rs.ctrlpts[1] = srcCtrlPtIntn[1] + cpM.y * minCpADist;\n }\n }\n\n if (badEnd || badAEnd || closeEndACp) {\n overlapping = true; // project control point along line from tgt centre to outside the tgt shape\n // (otherwise intersection will yield nothing)\n\n var _cpD = {\n // delta\n x: rs.ctrlpts[0] - tgtPos.x,\n y: rs.ctrlpts[1] - tgtPos.y\n };\n\n var _cpL = Math.sqrt(_cpD.x * _cpD.x + _cpD.y * _cpD.y); // length of line\n\n\n var _cpM = {\n // normalised delta\n x: _cpD.x / _cpL,\n y: _cpD.y / _cpL\n };\n\n var _radius = Math.max(srcW, srcH);\n\n var _cpProj = {\n // *2 radius guarantees outside shape\n x: rs.ctrlpts[0] + _cpM.x * 2 * _radius,\n y: rs.ctrlpts[1] + _cpM.y * 2 * _radius\n };\n var tgtCtrlPtIntn = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, _cpProj.x, _cpProj.y, 0);\n\n if (closeEndACp) {\n rs.ctrlpts[0] = rs.ctrlpts[0] + _cpM.x * (minCpADist - endACpDist);\n rs.ctrlpts[1] = rs.ctrlpts[1] + _cpM.y * (minCpADist - endACpDist);\n } else {\n rs.ctrlpts[0] = tgtCtrlPtIntn[0] + _cpM.x * minCpADist;\n rs.ctrlpts[1] = tgtCtrlPtIntn[1] + _cpM.y * minCpADist;\n }\n }\n\n if (overlapping) {\n // recalc endpts\n this.findEndpoints(edge);\n }\n }\n};\n\nBRp$3.storeAllpts = function (edge) {\n var rs = edge._private.rscratch;\n\n if (rs.edgeType === 'multibezier' || rs.edgeType === 'bezier' || rs.edgeType === 'self' || rs.edgeType === 'compound') {\n rs.allpts = [];\n rs.allpts.push(rs.startX, rs.startY);\n\n for (var b = 0; b + 1 < rs.ctrlpts.length; b += 2) {\n // ctrl pt itself\n rs.allpts.push(rs.ctrlpts[b], rs.ctrlpts[b + 1]); // the midpt between ctrlpts as intermediate destination pts\n\n if (b + 3 < rs.ctrlpts.length) {\n rs.allpts.push((rs.ctrlpts[b] + rs.ctrlpts[b + 2]) / 2, (rs.ctrlpts[b + 1] + rs.ctrlpts[b + 3]) / 2);\n }\n }\n\n rs.allpts.push(rs.endX, rs.endY);\n var m, mt;\n\n if (rs.ctrlpts.length / 2 % 2 === 0) {\n m = rs.allpts.length / 2 - 1;\n rs.midX = rs.allpts[m];\n rs.midY = rs.allpts[m + 1];\n } else {\n m = rs.allpts.length / 2 - 3;\n mt = 0.5;\n rs.midX = qbezierAt(rs.allpts[m], rs.allpts[m + 2], rs.allpts[m + 4], mt);\n rs.midY = qbezierAt(rs.allpts[m + 1], rs.allpts[m + 3], rs.allpts[m + 5], mt);\n }\n } else if (rs.edgeType === 'straight') {\n // need to calc these after endpts\n rs.allpts = [rs.startX, rs.startY, rs.endX, rs.endY]; // default midpt for labels etc\n\n rs.midX = (rs.startX + rs.endX + rs.arrowStartX + rs.arrowEndX) / 4;\n rs.midY = (rs.startY + rs.endY + rs.arrowStartY + rs.arrowEndY) / 4;\n } else if (rs.edgeType === 'segments') {\n rs.allpts = [];\n rs.allpts.push(rs.startX, rs.startY);\n rs.allpts.push.apply(rs.allpts, rs.segpts);\n rs.allpts.push(rs.endX, rs.endY);\n\n if (rs.segpts.length % 4 === 0) {\n var i2 = rs.segpts.length / 2;\n var i1 = i2 - 2;\n rs.midX = (rs.segpts[i1] + rs.segpts[i2]) / 2;\n rs.midY = (rs.segpts[i1 + 1] + rs.segpts[i2 + 1]) / 2;\n } else {\n var _i = rs.segpts.length / 2 - 1;\n\n rs.midX = rs.segpts[_i];\n rs.midY = rs.segpts[_i + 1];\n }\n }\n};\n\nBRp$3.checkForInvalidEdgeWarning = function (edge) {\n var rs = edge[0]._private.rscratch;\n\n if (rs.nodesOverlap || number(rs.startX) && number(rs.startY) && number(rs.endX) && number(rs.endY)) {\n rs.loggedErr = false;\n } else {\n if (!rs.loggedErr) {\n rs.loggedErr = true;\n warn('Edge `' + edge.id() + '` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap.');\n }\n }\n};\n\nBRp$3.findEdgeControlPoints = function (edges) {\n var _this = this;\n\n if (!edges || edges.length === 0) {\n return;\n }\n\n var r = this;\n var cy = r.cy;\n var hasCompounds = cy.hasCompoundNodes();\n var hashTable = {\n map: new Map$1(),\n get: function get(pairId) {\n var map2 = this.map.get(pairId[0]);\n\n if (map2 != null) {\n return map2.get(pairId[1]);\n } else {\n return null;\n }\n },\n set: function set(pairId, val) {\n var map2 = this.map.get(pairId[0]);\n\n if (map2 == null) {\n map2 = new Map$1();\n this.map.set(pairId[0], map2);\n }\n\n map2.set(pairId[1], val);\n }\n };\n var pairIds = [];\n var haystackEdges = []; // create a table of edge (src, tgt) => list of edges between them\n\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n var _p = edge._private;\n var curveStyle = edge.pstyle('curve-style').value; // ignore edges who are not to be displayed\n // they shouldn't take up space\n\n if (edge.removed() || !edge.takesUpSpace()) {\n continue;\n }\n\n if (curveStyle === 'haystack') {\n haystackEdges.push(edge);\n continue;\n }\n\n var edgeIsUnbundled = curveStyle === 'unbundled-bezier' || curveStyle === 'segments' || curveStyle === 'straight' || curveStyle === 'taxi';\n var edgeIsBezier = curveStyle === 'unbundled-bezier' || curveStyle === 'bezier';\n var src = _p.source;\n var tgt = _p.target;\n var srcIndex = src.poolIndex();\n var tgtIndex = tgt.poolIndex();\n var pairId = [srcIndex, tgtIndex].sort();\n var tableEntry = hashTable.get(pairId);\n\n if (tableEntry == null) {\n tableEntry = {\n eles: []\n };\n hashTable.set(pairId, tableEntry);\n pairIds.push(pairId);\n }\n\n tableEntry.eles.push(edge);\n\n if (edgeIsUnbundled) {\n tableEntry.hasUnbundled = true;\n }\n\n if (edgeIsBezier) {\n tableEntry.hasBezier = true;\n }\n } // for each pair (src, tgt), create the ctrl pts\n // Nested for loop is OK; total number of iterations for both loops = edgeCount\n\n\n var _loop = function _loop(p) {\n var pairId = pairIds[p];\n var pairInfo = hashTable.get(pairId);\n var swappedpairInfo = void 0;\n\n if (!pairInfo.hasUnbundled) {\n var pllEdges = pairInfo.eles[0].parallelEdges().filter(function (e) {\n return e.isBundledBezier();\n });\n clearArray(pairInfo.eles);\n pllEdges.forEach(function (edge) {\n return pairInfo.eles.push(edge);\n }); // for each pair id, the edges should be sorted by index\n\n pairInfo.eles.sort(function (edge1, edge2) {\n return edge1.poolIndex() - edge2.poolIndex();\n });\n }\n\n var firstEdge = pairInfo.eles[0];\n var src = firstEdge.source();\n var tgt = firstEdge.target(); // make sure src/tgt distinction is consistent w.r.t. pairId\n\n if (src.poolIndex() > tgt.poolIndex()) {\n var temp = src;\n src = tgt;\n tgt = temp;\n }\n\n var srcPos = pairInfo.srcPos = src.position();\n var tgtPos = pairInfo.tgtPos = tgt.position();\n var srcW = pairInfo.srcW = src.outerWidth();\n var srcH = pairInfo.srcH = src.outerHeight();\n var tgtW = pairInfo.tgtW = tgt.outerWidth();\n var tgtH = pairInfo.tgtH = tgt.outerHeight();\n\n var srcShape = pairInfo.srcShape = r.nodeShapes[_this.getNodeShape(src)];\n\n var tgtShape = pairInfo.tgtShape = r.nodeShapes[_this.getNodeShape(tgt)];\n\n pairInfo.dirCounts = {\n 'north': 0,\n 'west': 0,\n 'south': 0,\n 'east': 0,\n 'northwest': 0,\n 'southwest': 0,\n 'northeast': 0,\n 'southeast': 0\n };\n\n for (var _i2 = 0; _i2 < pairInfo.eles.length; _i2++) {\n var _edge = pairInfo.eles[_i2];\n var rs = _edge[0]._private.rscratch;\n\n var _curveStyle = _edge.pstyle('curve-style').value;\n\n var _edgeIsUnbundled = _curveStyle === 'unbundled-bezier' || _curveStyle === 'segments' || _curveStyle === 'taxi'; // whether the normalised pair order is the reverse of the edge's src-tgt order\n\n\n var edgeIsSwapped = !src.same(_edge.source());\n\n if (!pairInfo.calculatedIntersection && src !== tgt && (pairInfo.hasBezier || pairInfo.hasUnbundled)) {\n pairInfo.calculatedIntersection = true; // pt outside src shape to calc distance/displacement from src to tgt\n\n var srcOutside = srcShape.intersectLine(srcPos.x, srcPos.y, srcW, srcH, tgtPos.x, tgtPos.y, 0);\n var srcIntn = pairInfo.srcIntn = srcOutside; // pt outside tgt shape to calc distance/displacement from src to tgt\n\n var tgtOutside = tgtShape.intersectLine(tgtPos.x, tgtPos.y, tgtW, tgtH, srcPos.x, srcPos.y, 0);\n var tgtIntn = pairInfo.tgtIntn = tgtOutside;\n var intersectionPts = pairInfo.intersectionPts = {\n x1: srcOutside[0],\n x2: tgtOutside[0],\n y1: srcOutside[1],\n y2: tgtOutside[1]\n };\n var posPts = pairInfo.posPts = {\n x1: srcPos.x,\n x2: tgtPos.x,\n y1: srcPos.y,\n y2: tgtPos.y\n };\n var dy = tgtOutside[1] - srcOutside[1];\n var dx = tgtOutside[0] - srcOutside[0];\n var l = Math.sqrt(dx * dx + dy * dy);\n var vector = pairInfo.vector = {\n x: dx,\n y: dy\n };\n var vectorNorm = pairInfo.vectorNorm = {\n x: vector.x / l,\n y: vector.y / l\n };\n var vectorNormInverse = {\n x: -vectorNorm.y,\n y: vectorNorm.x\n }; // if node shapes overlap, then no ctrl pts to draw\n\n pairInfo.nodesOverlap = !number(l) || tgtShape.checkPoint(srcOutside[0], srcOutside[1], 0, tgtW, tgtH, tgtPos.x, tgtPos.y) || srcShape.checkPoint(tgtOutside[0], tgtOutside[1], 0, srcW, srcH, srcPos.x, srcPos.y);\n pairInfo.vectorNormInverse = vectorNormInverse;\n swappedpairInfo = {\n nodesOverlap: pairInfo.nodesOverlap,\n dirCounts: pairInfo.dirCounts,\n calculatedIntersection: true,\n hasBezier: pairInfo.hasBezier,\n hasUnbundled: pairInfo.hasUnbundled,\n eles: pairInfo.eles,\n srcPos: tgtPos,\n tgtPos: srcPos,\n srcW: tgtW,\n srcH: tgtH,\n tgtW: srcW,\n tgtH: srcH,\n srcIntn: tgtIntn,\n tgtIntn: srcIntn,\n srcShape: tgtShape,\n tgtShape: srcShape,\n posPts: {\n x1: posPts.x2,\n y1: posPts.y2,\n x2: posPts.x1,\n y2: posPts.y1\n },\n intersectionPts: {\n x1: intersectionPts.x2,\n y1: intersectionPts.y2,\n x2: intersectionPts.x1,\n y2: intersectionPts.y1\n },\n vector: {\n x: -vector.x,\n y: -vector.y\n },\n vectorNorm: {\n x: -vectorNorm.x,\n y: -vectorNorm.y\n },\n vectorNormInverse: {\n x: -vectorNormInverse.x,\n y: -vectorNormInverse.y\n }\n };\n }\n\n var passedPairInfo = edgeIsSwapped ? swappedpairInfo : pairInfo;\n rs.nodesOverlap = passedPairInfo.nodesOverlap;\n rs.srcIntn = passedPairInfo.srcIntn;\n rs.tgtIntn = passedPairInfo.tgtIntn;\n\n if (hasCompounds && (src.isParent() || src.isChild() || tgt.isParent() || tgt.isChild()) && (src.parents().anySame(tgt) || tgt.parents().anySame(src) || src.same(tgt) && src.isParent())) {\n _this.findCompoundLoopPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled);\n } else if (src === tgt) {\n _this.findLoopPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled);\n } else if (_curveStyle === 'segments') {\n _this.findSegmentsPoints(_edge, passedPairInfo);\n } else if (_curveStyle === 'taxi') {\n _this.findTaxiPoints(_edge, passedPairInfo);\n } else if (_curveStyle === 'straight' || !_edgeIsUnbundled && pairInfo.eles.length % 2 === 1 && _i2 === Math.floor(pairInfo.eles.length / 2)) {\n _this.findStraightEdgePoints(_edge);\n } else {\n _this.findBezierPoints(_edge, passedPairInfo, _i2, _edgeIsUnbundled, edgeIsSwapped);\n }\n\n _this.findEndpoints(_edge);\n\n _this.tryToCorrectInvalidPoints(_edge, passedPairInfo);\n\n _this.checkForInvalidEdgeWarning(_edge);\n\n _this.storeAllpts(_edge);\n\n _this.storeEdgeProjections(_edge);\n\n _this.calculateArrowAngles(_edge);\n\n _this.recalculateEdgeLabelProjections(_edge);\n\n _this.calculateLabelAngles(_edge);\n } // for pair edges\n\n };\n\n for (var p = 0; p < pairIds.length; p++) {\n _loop(p);\n } // for pair ids\n // haystacks avoid the expense of pairInfo stuff (intersections etc.)\n\n\n this.findHaystackPoints(haystackEdges);\n};\n\nfunction getPts(pts) {\n var retPts = [];\n\n if (pts == null) {\n return;\n }\n\n for (var i = 0; i < pts.length; i += 2) {\n var x = pts[i];\n var y = pts[i + 1];\n retPts.push({\n x: x,\n y: y\n });\n }\n\n return retPts;\n}\n\nBRp$3.getSegmentPoints = function (edge) {\n var rs = edge[0]._private.rscratch;\n var type = rs.edgeType;\n\n if (type === 'segments') {\n this.recalculateRenderedStyle(edge);\n return getPts(rs.segpts);\n }\n};\n\nBRp$3.getControlPoints = function (edge) {\n var rs = edge[0]._private.rscratch;\n var type = rs.edgeType;\n\n if (type === 'bezier' || type === 'multibezier' || type === 'self' || type === 'compound') {\n this.recalculateRenderedStyle(edge);\n return getPts(rs.ctrlpts);\n }\n};\n\nBRp$3.getEdgeMidpoint = function (edge) {\n var rs = edge[0]._private.rscratch;\n this.recalculateRenderedStyle(edge);\n return {\n x: rs.midX,\n y: rs.midY\n };\n};\n\nvar BRp$4 = {};\n\nBRp$4.manualEndptToPx = function (node, prop) {\n var r = this;\n var npos = node.position();\n var w = node.outerWidth();\n var h = node.outerHeight();\n\n if (prop.value.length === 2) {\n var p = [prop.pfValue[0], prop.pfValue[1]];\n\n if (prop.units[0] === '%') {\n p[0] = p[0] * w;\n }\n\n if (prop.units[1] === '%') {\n p[1] = p[1] * h;\n }\n\n p[0] += npos.x;\n p[1] += npos.y;\n return p;\n } else {\n var angle = prop.pfValue[0];\n angle = -Math.PI / 2 + angle; // start at 12 o'clock\n\n var l = 2 * Math.max(w, h);\n var _p = [npos.x + Math.cos(angle) * l, npos.y + Math.sin(angle) * l];\n return r.nodeShapes[this.getNodeShape(node)].intersectLine(npos.x, npos.y, w, h, _p[0], _p[1], 0);\n }\n};\n\nBRp$4.findEndpoints = function (edge) {\n var r = this;\n var intersect;\n var source = edge.source()[0];\n var target = edge.target()[0];\n var srcPos = source.position();\n var tgtPos = target.position();\n var tgtArShape = edge.pstyle('target-arrow-shape').value;\n var srcArShape = edge.pstyle('source-arrow-shape').value;\n var tgtDist = edge.pstyle('target-distance-from-node').pfValue;\n var srcDist = edge.pstyle('source-distance-from-node').pfValue;\n var curveStyle = edge.pstyle('curve-style').value;\n var rs = edge._private.rscratch;\n var et = rs.edgeType;\n var taxi = curveStyle === 'taxi';\n var self = et === 'self' || et === 'compound';\n var bezier = et === 'bezier' || et === 'multibezier' || self;\n var multi = et !== 'bezier';\n var lines = et === 'straight' || et === 'segments';\n var segments = et === 'segments';\n var hasEndpts = bezier || multi || lines;\n var overrideEndpts = self || taxi;\n var srcManEndpt = edge.pstyle('source-endpoint');\n var srcManEndptVal = overrideEndpts ? 'outside-to-node' : srcManEndpt.value;\n var tgtManEndpt = edge.pstyle('target-endpoint');\n var tgtManEndptVal = overrideEndpts ? 'outside-to-node' : tgtManEndpt.value;\n rs.srcManEndpt = srcManEndpt;\n rs.tgtManEndpt = tgtManEndpt;\n var p1; // last known point of edge on target side\n\n var p2; // last known point of edge on source side\n\n var p1_i; // point to intersect with target shape\n\n var p2_i; // point to intersect with source shape\n\n if (bezier) {\n var cpStart = [rs.ctrlpts[0], rs.ctrlpts[1]];\n var cpEnd = multi ? [rs.ctrlpts[rs.ctrlpts.length - 2], rs.ctrlpts[rs.ctrlpts.length - 1]] : cpStart;\n p1 = cpEnd;\n p2 = cpStart;\n } else if (lines) {\n var srcArrowFromPt = !segments ? [tgtPos.x, tgtPos.y] : rs.segpts.slice(0, 2);\n var tgtArrowFromPt = !segments ? [srcPos.x, srcPos.y] : rs.segpts.slice(rs.segpts.length - 2);\n p1 = tgtArrowFromPt;\n p2 = srcArrowFromPt;\n }\n\n if (tgtManEndptVal === 'inside-to-node') {\n intersect = [tgtPos.x, tgtPos.y];\n } else if (tgtManEndpt.units) {\n intersect = this.manualEndptToPx(target, tgtManEndpt);\n } else if (tgtManEndptVal === 'outside-to-line') {\n intersect = rs.tgtIntn; // use cached value from ctrlpt calc\n } else {\n if (tgtManEndptVal === 'outside-to-node' || tgtManEndptVal === 'outside-to-node-or-label') {\n p1_i = p1;\n } else if (tgtManEndptVal === 'outside-to-line' || tgtManEndptVal === 'outside-to-line-or-label') {\n p1_i = [srcPos.x, srcPos.y];\n }\n\n intersect = r.nodeShapes[this.getNodeShape(target)].intersectLine(tgtPos.x, tgtPos.y, target.outerWidth(), target.outerHeight(), p1_i[0], p1_i[1], 0);\n\n if (tgtManEndptVal === 'outside-to-node-or-label' || tgtManEndptVal === 'outside-to-line-or-label') {\n var trs = target._private.rscratch;\n var lw = trs.labelWidth;\n var lh = trs.labelHeight;\n var lx = trs.labelX;\n var ly = trs.labelY;\n var lw2 = lw / 2;\n var lh2 = lh / 2;\n var va = target.pstyle('text-valign').value;\n\n if (va === 'top') {\n ly -= lh2;\n } else if (va === 'bottom') {\n ly += lh2;\n }\n\n var ha = target.pstyle('text-halign').value;\n\n if (ha === 'left') {\n lx -= lw2;\n } else if (ha === 'right') {\n lx += lw2;\n }\n\n var labelIntersect = polygonIntersectLine(p1_i[0], p1_i[1], [lx - lw2, ly - lh2, lx + lw2, ly - lh2, lx + lw2, ly + lh2, lx - lw2, ly + lh2], tgtPos.x, tgtPos.y);\n\n if (labelIntersect.length > 0) {\n var refPt = srcPos;\n var intSqdist = sqdist(refPt, array2point(intersect));\n var labIntSqdist = sqdist(refPt, array2point(labelIntersect));\n var minSqDist = intSqdist;\n\n if (labIntSqdist < intSqdist) {\n intersect = labelIntersect;\n minSqDist = labIntSqdist;\n }\n\n if (labelIntersect.length > 2) {\n var labInt2SqDist = sqdist(refPt, {\n x: labelIntersect[2],\n y: labelIntersect[3]\n });\n\n if (labInt2SqDist < minSqDist) {\n intersect = [labelIntersect[2], labelIntersect[3]];\n }\n }\n }\n }\n }\n\n var arrowEnd = shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].spacing(edge) + tgtDist);\n var edgeEnd = shortenIntersection(intersect, p1, r.arrowShapes[tgtArShape].gap(edge) + tgtDist);\n rs.endX = edgeEnd[0];\n rs.endY = edgeEnd[1];\n rs.arrowEndX = arrowEnd[0];\n rs.arrowEndY = arrowEnd[1];\n\n if (srcManEndptVal === 'inside-to-node') {\n intersect = [srcPos.x, srcPos.y];\n } else if (srcManEndpt.units) {\n intersect = this.manualEndptToPx(source, srcManEndpt);\n } else if (srcManEndptVal === 'outside-to-line') {\n intersect = rs.srcIntn; // use cached value from ctrlpt calc\n } else {\n if (srcManEndptVal === 'outside-to-node' || srcManEndptVal === 'outside-to-node-or-label') {\n p2_i = p2;\n } else if (srcManEndptVal === 'outside-to-line' || srcManEndptVal === 'outside-to-line-or-label') {\n p2_i = [tgtPos.x, tgtPos.y];\n }\n\n intersect = r.nodeShapes[this.getNodeShape(source)].intersectLine(srcPos.x, srcPos.y, source.outerWidth(), source.outerHeight(), p2_i[0], p2_i[1], 0);\n\n if (srcManEndptVal === 'outside-to-node-or-label' || srcManEndptVal === 'outside-to-line-or-label') {\n var srs = source._private.rscratch;\n var _lw = srs.labelWidth;\n var _lh = srs.labelHeight;\n var _lx = srs.labelX;\n var _ly = srs.labelY;\n\n var _lw2 = _lw / 2;\n\n var _lh2 = _lh / 2;\n\n var _va = source.pstyle('text-valign').value;\n\n if (_va === 'top') {\n _ly -= _lh2;\n } else if (_va === 'bottom') {\n _ly += _lh2;\n }\n\n var _ha = source.pstyle('text-halign').value;\n\n if (_ha === 'left') {\n _lx -= _lw2;\n } else if (_ha === 'right') {\n _lx += _lw2;\n }\n\n var _labelIntersect = polygonIntersectLine(p2_i[0], p2_i[1], [_lx - _lw2, _ly - _lh2, _lx + _lw2, _ly - _lh2, _lx + _lw2, _ly + _lh2, _lx - _lw2, _ly + _lh2], srcPos.x, srcPos.y);\n\n if (_labelIntersect.length > 0) {\n var _refPt = tgtPos;\n\n var _intSqdist = sqdist(_refPt, array2point(intersect));\n\n var _labIntSqdist = sqdist(_refPt, array2point(_labelIntersect));\n\n var _minSqDist = _intSqdist;\n\n if (_labIntSqdist < _intSqdist) {\n intersect = [_labelIntersect[0], _labelIntersect[1]];\n _minSqDist = _labIntSqdist;\n }\n\n if (_labelIntersect.length > 2) {\n var _labInt2SqDist = sqdist(_refPt, {\n x: _labelIntersect[2],\n y: _labelIntersect[3]\n });\n\n if (_labInt2SqDist < _minSqDist) {\n intersect = [_labelIntersect[2], _labelIntersect[3]];\n }\n }\n }\n }\n }\n\n var arrowStart = shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].spacing(edge) + srcDist);\n var edgeStart = shortenIntersection(intersect, p2, r.arrowShapes[srcArShape].gap(edge) + srcDist);\n rs.startX = edgeStart[0];\n rs.startY = edgeStart[1];\n rs.arrowStartX = arrowStart[0];\n rs.arrowStartY = arrowStart[1];\n\n if (hasEndpts) {\n if (!number(rs.startX) || !number(rs.startY) || !number(rs.endX) || !number(rs.endY)) {\n rs.badLine = true;\n } else {\n rs.badLine = false;\n }\n }\n};\n\nBRp$4.getSourceEndpoint = function (edge) {\n var rs = edge[0]._private.rscratch;\n this.recalculateRenderedStyle(edge);\n\n switch (rs.edgeType) {\n case 'haystack':\n return {\n x: rs.haystackPts[0],\n y: rs.haystackPts[1]\n };\n\n default:\n return {\n x: rs.arrowStartX,\n y: rs.arrowStartY\n };\n }\n};\n\nBRp$4.getTargetEndpoint = function (edge) {\n var rs = edge[0]._private.rscratch;\n this.recalculateRenderedStyle(edge);\n\n switch (rs.edgeType) {\n case 'haystack':\n return {\n x: rs.haystackPts[2],\n y: rs.haystackPts[3]\n };\n\n default:\n return {\n x: rs.arrowEndX,\n y: rs.arrowEndY\n };\n }\n};\n\nvar BRp$5 = {};\n\nfunction pushBezierPts(r, edge, pts) {\n var qbezierAt$1 = function qbezierAt$1(p1, p2, p3, t) {\n return qbezierAt(p1, p2, p3, t);\n };\n\n var _p = edge._private;\n var bpts = _p.rstyle.bezierPts;\n\n for (var i = 0; i < r.bezierProjPcts.length; i++) {\n var p = r.bezierProjPcts[i];\n bpts.push({\n x: qbezierAt$1(pts[0], pts[2], pts[4], p),\n y: qbezierAt$1(pts[1], pts[3], pts[5], p)\n });\n }\n}\n\nBRp$5.storeEdgeProjections = function (edge) {\n var _p = edge._private;\n var rs = _p.rscratch;\n var et = rs.edgeType; // clear the cached points state\n\n _p.rstyle.bezierPts = null;\n _p.rstyle.linePts = null;\n _p.rstyle.haystackPts = null;\n\n if (et === 'multibezier' || et === 'bezier' || et === 'self' || et === 'compound') {\n _p.rstyle.bezierPts = [];\n\n for (var i = 0; i + 5 < rs.allpts.length; i += 4) {\n pushBezierPts(this, edge, rs.allpts.slice(i, i + 6));\n }\n } else if (et === 'segments') {\n var lpts = _p.rstyle.linePts = [];\n\n for (var i = 0; i + 1 < rs.allpts.length; i += 2) {\n lpts.push({\n x: rs.allpts[i],\n y: rs.allpts[i + 1]\n });\n }\n } else if (et === 'haystack') {\n var hpts = rs.haystackPts;\n _p.rstyle.haystackPts = [{\n x: hpts[0],\n y: hpts[1]\n }, {\n x: hpts[2],\n y: hpts[3]\n }];\n }\n\n _p.rstyle.arrowWidth = this.getArrowWidth(edge.pstyle('width').pfValue, edge.pstyle('arrow-scale').value) * this.arrowShapeWidth;\n};\n\nBRp$5.recalculateEdgeProjections = function (edges) {\n this.findEdgeControlPoints(edges);\n};\n\nvar BRp$6 = {};\n\nBRp$6.recalculateNodeLabelProjection = function (node) {\n var content = node.pstyle('label').strValue;\n\n if (emptyString(content)) {\n return;\n }\n\n var textX, textY;\n var _p = node._private;\n var nodeWidth = node.width();\n var nodeHeight = node.height();\n var padding = node.padding();\n var nodePos = node.position();\n var textHalign = node.pstyle('text-halign').strValue;\n var textValign = node.pstyle('text-valign').strValue;\n var rs = _p.rscratch;\n var rstyle = _p.rstyle;\n\n switch (textHalign) {\n case 'left':\n textX = nodePos.x - nodeWidth / 2 - padding;\n break;\n\n case 'right':\n textX = nodePos.x + nodeWidth / 2 + padding;\n break;\n\n default:\n // e.g. center\n textX = nodePos.x;\n }\n\n switch (textValign) {\n case 'top':\n textY = nodePos.y - nodeHeight / 2 - padding;\n break;\n\n case 'bottom':\n textY = nodePos.y + nodeHeight / 2 + padding;\n break;\n\n default:\n // e.g. middle\n textY = nodePos.y;\n }\n\n rs.labelX = textX;\n rs.labelY = textY;\n rstyle.labelX = textX;\n rstyle.labelY = textY;\n this.applyLabelDimensions(node);\n};\n\nvar lineAngleFromDelta = function lineAngleFromDelta(dx, dy) {\n var angle = Math.atan(dy / dx);\n\n if (dx === 0 && angle < 0) {\n angle = angle * -1;\n }\n\n return angle;\n};\n\nvar lineAngle = function lineAngle(p0, p1) {\n var dx = p1.x - p0.x;\n var dy = p1.y - p0.y;\n return lineAngleFromDelta(dx, dy);\n};\n\nvar bezierAngle = function bezierAngle(p0, p1, p2, t) {\n var t0 = bound(0, t - 0.001, 1);\n var t1 = bound(0, t + 0.001, 1);\n var lp0 = qbezierPtAt(p0, p1, p2, t0);\n var lp1 = qbezierPtAt(p0, p1, p2, t1);\n return lineAngle(lp0, lp1);\n};\n\nBRp$6.recalculateEdgeLabelProjections = function (edge) {\n var p;\n var _p = edge._private;\n var rs = _p.rscratch;\n var r = this;\n var content = {\n mid: edge.pstyle('label').strValue,\n source: edge.pstyle('source-label').strValue,\n target: edge.pstyle('target-label').strValue\n };\n\n if (content.mid || content.source || content.target) ; else {\n return; // no labels => no calcs\n } // add center point to style so bounding box calculations can use it\n //\n\n\n p = {\n x: rs.midX,\n y: rs.midY\n };\n\n var setRs = function setRs(propName, prefix, value) {\n setPrefixedProperty(_p.rscratch, propName, prefix, value);\n setPrefixedProperty(_p.rstyle, propName, prefix, value);\n };\n\n setRs('labelX', null, p.x);\n setRs('labelY', null, p.y);\n var midAngle = lineAngleFromDelta(rs.midDispX, rs.midDispY);\n setRs('labelAutoAngle', null, midAngle);\n\n var createControlPointInfo = function createControlPointInfo() {\n if (createControlPointInfo.cache) {\n return createControlPointInfo.cache;\n } // use cache so only 1x per edge\n\n\n var ctrlpts = []; // store each ctrlpt info init\n\n for (var i = 0; i + 5 < rs.allpts.length; i += 4) {\n var p0 = {\n x: rs.allpts[i],\n y: rs.allpts[i + 1]\n };\n var p1 = {\n x: rs.allpts[i + 2],\n y: rs.allpts[i + 3]\n }; // ctrlpt\n\n var p2 = {\n x: rs.allpts[i + 4],\n y: rs.allpts[i + 5]\n };\n ctrlpts.push({\n p0: p0,\n p1: p1,\n p2: p2,\n startDist: 0,\n length: 0,\n segments: []\n });\n }\n\n var bpts = _p.rstyle.bezierPts;\n var nProjs = r.bezierProjPcts.length;\n\n function addSegment(cp, p0, p1, t0, t1) {\n var length = dist(p0, p1);\n var prevSegment = cp.segments[cp.segments.length - 1];\n var segment = {\n p0: p0,\n p1: p1,\n t0: t0,\n t1: t1,\n startDist: prevSegment ? prevSegment.startDist + prevSegment.length : 0,\n length: length\n };\n cp.segments.push(segment);\n cp.length += length;\n } // update each ctrlpt with segment info\n\n\n for (var _i = 0; _i < ctrlpts.length; _i++) {\n var cp = ctrlpts[_i];\n var prevCp = ctrlpts[_i - 1];\n\n if (prevCp) {\n cp.startDist = prevCp.startDist + prevCp.length;\n }\n\n addSegment(cp, cp.p0, bpts[_i * nProjs], 0, r.bezierProjPcts[0]); // first\n\n for (var j = 0; j < nProjs - 1; j++) {\n addSegment(cp, bpts[_i * nProjs + j], bpts[_i * nProjs + j + 1], r.bezierProjPcts[j], r.bezierProjPcts[j + 1]);\n }\n\n addSegment(cp, bpts[_i * nProjs + nProjs - 1], cp.p2, r.bezierProjPcts[nProjs - 1], 1); // last\n }\n\n return createControlPointInfo.cache = ctrlpts;\n };\n\n var calculateEndProjection = function calculateEndProjection(prefix) {\n var angle;\n var isSrc = prefix === 'source';\n\n if (!content[prefix]) {\n return;\n }\n\n var offset = edge.pstyle(prefix + '-text-offset').pfValue;\n\n switch (rs.edgeType) {\n case 'self':\n case 'compound':\n case 'bezier':\n case 'multibezier':\n {\n var cps = createControlPointInfo();\n var selected;\n var startDist = 0;\n var totalDist = 0; // find the segment we're on\n\n for (var i = 0; i < cps.length; i++) {\n var _cp = cps[isSrc ? i : cps.length - 1 - i];\n\n for (var j = 0; j < _cp.segments.length; j++) {\n var _seg = _cp.segments[isSrc ? j : _cp.segments.length - 1 - j];\n var lastSeg = i === cps.length - 1 && j === _cp.segments.length - 1;\n startDist = totalDist;\n totalDist += _seg.length;\n\n if (totalDist >= offset || lastSeg) {\n selected = {\n cp: _cp,\n segment: _seg\n };\n break;\n }\n }\n\n if (selected) {\n break;\n }\n }\n\n var cp = selected.cp;\n var seg = selected.segment;\n var tSegment = (offset - startDist) / seg.length;\n var segDt = seg.t1 - seg.t0;\n var t = isSrc ? seg.t0 + segDt * tSegment : seg.t1 - segDt * tSegment;\n t = bound(0, t, 1);\n p = qbezierPtAt(cp.p0, cp.p1, cp.p2, t);\n angle = bezierAngle(cp.p0, cp.p1, cp.p2, t);\n break;\n }\n\n case 'straight':\n case 'segments':\n case 'haystack':\n {\n var d = 0,\n di,\n d0;\n var p0, p1;\n var l = rs.allpts.length;\n\n for (var _i2 = 0; _i2 + 3 < l; _i2 += 2) {\n if (isSrc) {\n p0 = {\n x: rs.allpts[_i2],\n y: rs.allpts[_i2 + 1]\n };\n p1 = {\n x: rs.allpts[_i2 + 2],\n y: rs.allpts[_i2 + 3]\n };\n } else {\n p0 = {\n x: rs.allpts[l - 2 - _i2],\n y: rs.allpts[l - 1 - _i2]\n };\n p1 = {\n x: rs.allpts[l - 4 - _i2],\n y: rs.allpts[l - 3 - _i2]\n };\n }\n\n di = dist(p0, p1);\n d0 = d;\n d += di;\n\n if (d >= offset) {\n break;\n }\n }\n\n var pD = offset - d0;\n\n var _t = pD / di;\n\n _t = bound(0, _t, 1);\n p = lineAt(p0, p1, _t);\n angle = lineAngle(p0, p1);\n break;\n }\n }\n\n setRs('labelX', prefix, p.x);\n setRs('labelY', prefix, p.y);\n setRs('labelAutoAngle', prefix, angle);\n };\n\n calculateEndProjection('source');\n calculateEndProjection('target');\n this.applyLabelDimensions(edge);\n};\n\nBRp$6.applyLabelDimensions = function (ele) {\n this.applyPrefixedLabelDimensions(ele);\n\n if (ele.isEdge()) {\n this.applyPrefixedLabelDimensions(ele, 'source');\n this.applyPrefixedLabelDimensions(ele, 'target');\n }\n};\n\nBRp$6.applyPrefixedLabelDimensions = function (ele, prefix) {\n var _p = ele._private;\n var text = this.getLabelText(ele, prefix);\n var labelDims = this.calculateLabelDimensions(ele, text);\n var lineHeight = ele.pstyle('line-height').pfValue;\n var textWrap = ele.pstyle('text-wrap').strValue;\n var lines = getPrefixedProperty(_p.rscratch, 'labelWrapCachedLines', prefix) || [];\n var numLines = textWrap !== 'wrap' ? 1 : Math.max(lines.length, 1);\n var normPerLineHeight = labelDims.height / numLines;\n var labelLineHeight = normPerLineHeight * lineHeight;\n var width = labelDims.width;\n var height = labelDims.height + (numLines - 1) * (lineHeight - 1) * normPerLineHeight;\n setPrefixedProperty(_p.rstyle, 'labelWidth', prefix, width);\n setPrefixedProperty(_p.rscratch, 'labelWidth', prefix, width);\n setPrefixedProperty(_p.rstyle, 'labelHeight', prefix, height);\n setPrefixedProperty(_p.rscratch, 'labelHeight', prefix, height);\n setPrefixedProperty(_p.rscratch, 'labelLineHeight', prefix, labelLineHeight);\n};\n\nBRp$6.getLabelText = function (ele, prefix) {\n var _p = ele._private;\n var pfd = prefix ? prefix + '-' : '';\n var text = ele.pstyle(pfd + 'label').strValue;\n var textTransform = ele.pstyle('text-transform').value;\n\n var rscratch = function rscratch(propName, value) {\n if (value) {\n setPrefixedProperty(_p.rscratch, propName, prefix, value);\n return value;\n } else {\n return getPrefixedProperty(_p.rscratch, propName, prefix);\n }\n }; // for empty text, skip all processing\n\n\n if (!text) {\n return '';\n }\n\n if (textTransform == 'none') ; else if (textTransform == 'uppercase') {\n text = text.toUpperCase();\n } else if (textTransform == 'lowercase') {\n text = text.toLowerCase();\n }\n\n var wrapStyle = ele.pstyle('text-wrap').value;\n\n if (wrapStyle === 'wrap') {\n var labelKey = rscratch('labelKey'); // save recalc if the label is the same as before\n\n if (labelKey != null && rscratch('labelWrapKey') === labelKey) {\n return rscratch('labelWrapCachedText');\n }\n\n var zwsp = \"\\u200B\";\n var lines = text.split('\\n');\n var maxW = ele.pstyle('text-max-width').pfValue;\n var overflow = ele.pstyle('text-overflow-wrap').value;\n var overflowAny = overflow === 'anywhere';\n var wrappedLines = [];\n var wordsRegex = /[\\s\\u200b]+/;\n var wordSeparator = overflowAny ? '' : ' ';\n\n for (var l = 0; l < lines.length; l++) {\n var line = lines[l];\n var lineDims = this.calculateLabelDimensions(ele, line);\n var lineW = lineDims.width;\n\n if (overflowAny) {\n var processedLine = line.split('').join(zwsp);\n line = processedLine;\n }\n\n if (lineW > maxW) {\n // line is too long\n var words = line.split(wordsRegex);\n var subline = '';\n\n for (var w = 0; w < words.length; w++) {\n var word = words[w];\n var testLine = subline.length === 0 ? word : subline + wordSeparator + word;\n var testDims = this.calculateLabelDimensions(ele, testLine);\n var testW = testDims.width;\n\n if (testW <= maxW) {\n // word fits on current line\n subline += word + wordSeparator;\n } else {\n // word starts new line\n if (subline) {\n wrappedLines.push(subline);\n }\n\n subline = word + wordSeparator;\n }\n } // if there's remaining text, put it in a wrapped line\n\n\n if (!subline.match(/^[\\s\\u200b]+$/)) {\n wrappedLines.push(subline);\n }\n } else {\n // line is already short enough\n wrappedLines.push(line);\n }\n } // for\n\n\n rscratch('labelWrapCachedLines', wrappedLines);\n text = rscratch('labelWrapCachedText', wrappedLines.join('\\n'));\n rscratch('labelWrapKey', labelKey);\n } else if (wrapStyle === 'ellipsis') {\n var _maxW = ele.pstyle('text-max-width').pfValue;\n var ellipsized = '';\n var ellipsis = \"\\u2026\";\n var incLastCh = false;\n\n for (var i = 0; i < text.length; i++) {\n var widthWithNextCh = this.calculateLabelDimensions(ele, ellipsized + text[i] + ellipsis).width;\n\n if (widthWithNextCh > _maxW) {\n break;\n }\n\n ellipsized += text[i];\n\n if (i === text.length - 1) {\n incLastCh = true;\n }\n }\n\n if (!incLastCh) {\n ellipsized += ellipsis;\n }\n\n return ellipsized;\n } // if ellipsize\n\n\n return text;\n};\n\nBRp$6.getLabelJustification = function (ele) {\n var justification = ele.pstyle('text-justification').strValue;\n var textHalign = ele.pstyle('text-halign').strValue;\n\n if (justification === 'auto') {\n if (ele.isNode()) {\n switch (textHalign) {\n case 'left':\n return 'right';\n\n case 'right':\n return 'left';\n\n default:\n return 'center';\n }\n } else {\n return 'center';\n }\n } else {\n return justification;\n }\n};\n\nBRp$6.calculateLabelDimensions = function (ele, text) {\n var r = this;\n var cacheKey = hashString(text, ele._private.labelDimsKey);\n var cache = r.labelDimCache || (r.labelDimCache = []);\n var existingVal = cache[cacheKey];\n\n if (existingVal != null) {\n return existingVal;\n }\n\n var sizeMult = 1; // increase the scale to increase accuracy w.r.t. zoomed text\n\n var fStyle = ele.pstyle('font-style').strValue;\n var size = sizeMult * ele.pstyle('font-size').pfValue + 'px';\n var family = ele.pstyle('font-family').strValue;\n var weight = ele.pstyle('font-weight').strValue;\n var div = this.labelCalcDiv;\n\n if (!div) {\n div = this.labelCalcDiv = document.createElement('div'); // eslint-disable-line no-undef\n\n document.body.appendChild(div); // eslint-disable-line no-undef\n }\n\n var ds = div.style; // from ele style\n\n ds.fontFamily = family;\n ds.fontStyle = fStyle;\n ds.fontSize = size;\n ds.fontWeight = weight; // forced style\n\n ds.position = 'absolute';\n ds.left = '-9999px';\n ds.top = '-9999px';\n ds.zIndex = '-1';\n ds.visibility = 'hidden';\n ds.pointerEvents = 'none';\n ds.padding = '0';\n ds.lineHeight = '1'; // - newlines must be taken into account for text-wrap:wrap\n // - since spaces are not collapsed, each space must be taken into account\n\n ds.whiteSpace = 'pre'; // put label content in div\n\n div.textContent = text;\n return cache[cacheKey] = {\n width: Math.ceil(div.clientWidth / sizeMult),\n height: Math.ceil(div.clientHeight / sizeMult)\n };\n};\n\nBRp$6.calculateLabelAngle = function (ele, prefix) {\n var _p = ele._private;\n var rs = _p.rscratch;\n var isEdge = ele.isEdge();\n var prefixDash = prefix ? prefix + '-' : '';\n var rot = ele.pstyle(prefixDash + 'text-rotation');\n var rotStr = rot.strValue;\n\n if (rotStr === 'none') {\n return 0;\n } else if (isEdge && rotStr === 'autorotate') {\n return rs.labelAutoAngle;\n } else if (rotStr === 'autorotate') {\n return 0;\n } else {\n return rot.pfValue;\n }\n};\n\nBRp$6.calculateLabelAngles = function (ele) {\n var r = this;\n var isEdge = ele.isEdge();\n var _p = ele._private;\n var rs = _p.rscratch;\n rs.labelAngle = r.calculateLabelAngle(ele);\n\n if (isEdge) {\n rs.sourceLabelAngle = r.calculateLabelAngle(ele, 'source');\n rs.targetLabelAngle = r.calculateLabelAngle(ele, 'target');\n }\n};\n\nvar BRp$7 = {};\nvar TOO_SMALL_CUT_RECT = 28;\nvar warnedCutRect = false;\n\nBRp$7.getNodeShape = function (node) {\n var r = this;\n var shape = node.pstyle('shape').value;\n\n if (shape === 'cutrectangle' && (node.width() < TOO_SMALL_CUT_RECT || node.height() < TOO_SMALL_CUT_RECT)) {\n if (!warnedCutRect) {\n warn('The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead');\n warnedCutRect = true;\n }\n\n return 'rectangle';\n }\n\n if (node.isParent()) {\n if (shape === 'rectangle' || shape === 'roundrectangle' || shape === 'round-rectangle' || shape === 'cutrectangle' || shape === 'cut-rectangle' || shape === 'barrel') {\n return shape;\n } else {\n return 'rectangle';\n }\n }\n\n if (shape === 'polygon') {\n var points = node.pstyle('shape-polygon-points').value;\n return r.nodeShapes.makePolygon(points).name;\n }\n\n return shape;\n};\n\nvar BRp$8 = {};\n\nBRp$8.registerCalculationListeners = function () {\n var cy = this.cy;\n var elesToUpdate = cy.collection();\n var r = this;\n\n var enqueue = function enqueue(eles) {\n var dirtyStyleCaches = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n elesToUpdate.merge(eles);\n\n if (dirtyStyleCaches) {\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var _p = ele._private;\n var rstyle = _p.rstyle;\n rstyle.clean = false;\n rstyle.cleanConnected = false;\n }\n }\n };\n\n r.binder(cy).on('bounds.* dirty.*', function onDirtyBounds(e) {\n var ele = e.target;\n enqueue(ele);\n }).on('style.* background.*', function onDirtyStyle(e) {\n var ele = e.target;\n enqueue(ele, false);\n });\n\n var updateEleCalcs = function updateEleCalcs(willDraw) {\n if (willDraw) {\n var fns = r.onUpdateEleCalcsFns;\n\n for (var i = 0; i < elesToUpdate.length; i++) {\n var ele = elesToUpdate[i];\n var rstyle = ele._private.rstyle;\n\n if (ele.isNode() && !rstyle.cleanConnected) {\n enqueue(ele.connectedEdges());\n rstyle.cleanConnected = true;\n }\n }\n\n if (fns) {\n for (var _i = 0; _i < fns.length; _i++) {\n var fn = fns[_i];\n fn(willDraw, elesToUpdate);\n }\n }\n\n r.recalculateRenderedStyle(elesToUpdate);\n elesToUpdate = cy.collection();\n }\n };\n\n r.flushRenderedStyleQueue = function () {\n updateEleCalcs(true);\n };\n\n r.beforeRender(updateEleCalcs, r.beforeRenderPriorities.eleCalcs);\n};\n\nBRp$8.onUpdateEleCalcs = function (fn) {\n var fns = this.onUpdateEleCalcsFns = this.onUpdateEleCalcsFns || [];\n fns.push(fn);\n};\n\nBRp$8.recalculateRenderedStyle = function (eles, useCache) {\n var isCleanConnected = function isCleanConnected(ele) {\n return ele._private.rstyle.cleanConnected;\n };\n\n var edges = [];\n var nodes = []; // the renderer can't be used for calcs when destroyed, e.g. ele.boundingBox()\n\n if (this.destroyed) {\n return;\n } // use cache by default for perf\n\n\n if (useCache === undefined) {\n useCache = true;\n }\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var _p = ele._private;\n var rstyle = _p.rstyle; // an edge may be implicitly dirty b/c of one of its connected nodes\n // (and a request for recalc may come in between frames)\n\n if (ele.isEdge() && (!isCleanConnected(ele.source()) || !isCleanConnected(ele.target()))) {\n rstyle.clean = false;\n } // only update if dirty and in graph\n\n\n if (useCache && rstyle.clean || ele.removed()) {\n continue;\n } // only update if not display: none\n\n\n if (ele.pstyle('display').value === 'none') {\n continue;\n }\n\n if (_p.group === 'nodes') {\n nodes.push(ele);\n } else {\n // edges\n edges.push(ele);\n }\n\n rstyle.clean = true;\n } // update node data from projections\n\n\n for (var _i2 = 0; _i2 < nodes.length; _i2++) {\n var _ele = nodes[_i2];\n var _p2 = _ele._private;\n var _rstyle = _p2.rstyle;\n\n var pos = _ele.position();\n\n this.recalculateNodeLabelProjection(_ele);\n _rstyle.nodeX = pos.x;\n _rstyle.nodeY = pos.y;\n _rstyle.nodeW = _ele.pstyle('width').pfValue;\n _rstyle.nodeH = _ele.pstyle('height').pfValue;\n }\n\n this.recalculateEdgeProjections(edges); // update edge data from projections\n\n for (var _i3 = 0; _i3 < edges.length; _i3++) {\n var _ele2 = edges[_i3];\n var _p3 = _ele2._private;\n var _rstyle2 = _p3.rstyle;\n var rs = _p3.rscratch; // update rstyle positions\n\n _rstyle2.srcX = rs.arrowStartX;\n _rstyle2.srcY = rs.arrowStartY;\n _rstyle2.tgtX = rs.arrowEndX;\n _rstyle2.tgtY = rs.arrowEndY;\n _rstyle2.midX = rs.midX;\n _rstyle2.midY = rs.midY;\n _rstyle2.labelAngle = rs.labelAngle;\n _rstyle2.sourceLabelAngle = rs.sourceLabelAngle;\n _rstyle2.targetLabelAngle = rs.targetLabelAngle;\n }\n};\n\nvar BRp$9 = {};\n\nBRp$9.updateCachedGrabbedEles = function () {\n var eles = this.cachedZSortedEles;\n\n if (!eles) {\n // just let this be recalculated on the next z sort tick\n return;\n }\n\n eles.drag = [];\n eles.nondrag = [];\n var grabTargets = [];\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var rs = ele._private.rscratch;\n\n if (ele.grabbed() && !ele.isParent()) {\n grabTargets.push(ele);\n } else if (rs.inDragLayer) {\n eles.drag.push(ele);\n } else {\n eles.nondrag.push(ele);\n }\n } // put the grab target nodes last so it's on top of its neighbourhood\n\n\n for (var i = 0; i < grabTargets.length; i++) {\n var ele = grabTargets[i];\n eles.drag.push(ele);\n }\n};\n\nBRp$9.invalidateCachedZSortedEles = function () {\n this.cachedZSortedEles = null;\n};\n\nBRp$9.getCachedZSortedEles = function (forceRecalc) {\n if (forceRecalc || !this.cachedZSortedEles) {\n var eles = this.cy.mutableElements().toArray();\n eles.sort(zIndexSort);\n eles.interactive = eles.filter(function (ele) {\n return ele.interactive();\n });\n this.cachedZSortedEles = eles;\n this.updateCachedGrabbedEles();\n } else {\n eles = this.cachedZSortedEles;\n }\n\n return eles;\n};\n\nvar BRp$a = {};\n[BRp$1, BRp$2, BRp$3, BRp$4, BRp$5, BRp$6, BRp$7, BRp$8, BRp$9].forEach(function (props) {\n extend(BRp$a, props);\n});\n\nvar BRp$b = {};\n\nBRp$b.getCachedImage = function (url, crossOrigin, onLoad) {\n var r = this;\n var imageCache = r.imageCache = r.imageCache || {};\n var cache = imageCache[url];\n\n if (cache) {\n if (!cache.image.complete) {\n cache.image.addEventListener('load', onLoad);\n }\n\n return cache.image;\n } else {\n cache = imageCache[url] = imageCache[url] || {};\n var image = cache.image = new Image(); // eslint-disable-line no-undef\n\n image.addEventListener('load', onLoad);\n image.addEventListener('error', function () {\n image.error = true;\n }); // #1582 safari doesn't load data uris with crossOrigin properly\n // https://bugs.webkit.org/show_bug.cgi?id=123978\n\n var dataUriPrefix = 'data:';\n var isDataUri = url.substring(0, dataUriPrefix.length).toLowerCase() === dataUriPrefix;\n\n if (!isDataUri) {\n image.crossOrigin = crossOrigin; // prevent tainted canvas\n }\n\n image.src = url;\n return image;\n }\n};\n\nvar BRp$c = {};\n/* global document, window, ResizeObserver, MutationObserver */\n\nBRp$c.registerBinding = function (target, event, handler, useCapture) {\n // eslint-disable-line no-unused-vars\n var args = Array.prototype.slice.apply(arguments, [1]); // copy\n\n var b = this.binder(target);\n return b.on.apply(b, args);\n};\n\nBRp$c.binder = function (tgt) {\n var r = this;\n var tgtIsDom = tgt === window || tgt === document || tgt === document.body || domElement(tgt);\n\n if (r.supportsPassiveEvents == null) {\n // from https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection\n var supportsPassive = false;\n\n try {\n var opts = Object.defineProperty({}, 'passive', {\n get: function get() {\n supportsPassive = true;\n return true;\n }\n });\n window.addEventListener('test', null, opts);\n } catch (err) {// not supported\n }\n\n r.supportsPassiveEvents = supportsPassive;\n }\n\n var on = function on(event, handler, useCapture) {\n var args = Array.prototype.slice.call(arguments);\n\n if (tgtIsDom && r.supportsPassiveEvents) {\n // replace useCapture w/ opts obj\n args[2] = {\n capture: useCapture != null ? useCapture : false,\n passive: false,\n once: false\n };\n }\n\n r.bindings.push({\n target: tgt,\n args: args\n });\n (tgt.addEventListener || tgt.on).apply(tgt, args);\n return this;\n };\n\n return {\n on: on,\n addEventListener: on,\n addListener: on,\n bind: on\n };\n};\n\nBRp$c.nodeIsDraggable = function (node) {\n return node && node.isNode() && !node.locked() && node.grabbable();\n};\n\nBRp$c.nodeIsGrabbable = function (node) {\n return this.nodeIsDraggable(node) && node.interactive();\n};\n\nBRp$c.load = function () {\n var r = this;\n\n var isSelected = function isSelected(ele) {\n return ele.selected();\n };\n\n var triggerEvents = function triggerEvents(target, names, e, position) {\n if (target == null) {\n target = r.cy;\n }\n\n for (var i = 0; i < names.length; i++) {\n var name = names[i];\n target.emit({\n originalEvent: e,\n type: name,\n position: position\n });\n }\n };\n\n var isMultSelKeyDown = function isMultSelKeyDown(e) {\n return e.shiftKey || e.metaKey || e.ctrlKey; // maybe e.altKey\n };\n\n var allowPanningPassthrough = function allowPanningPassthrough(down, downs) {\n var allowPassthrough = true;\n\n if (r.cy.hasCompoundNodes() && down && down.pannable()) {\n // a grabbable compound node below the ele => no passthrough panning\n for (var i = 0; downs && i < downs.length; i++) {\n var down = downs[i];\n\n if (down.isNode() && down.isParent()) {\n allowPassthrough = false;\n break;\n }\n }\n } else {\n allowPassthrough = true;\n }\n\n return allowPassthrough;\n };\n\n var setGrabbed = function setGrabbed(ele) {\n ele[0]._private.grabbed = true;\n };\n\n var setFreed = function setFreed(ele) {\n ele[0]._private.grabbed = false;\n };\n\n var setInDragLayer = function setInDragLayer(ele) {\n ele[0]._private.rscratch.inDragLayer = true;\n };\n\n var setOutDragLayer = function setOutDragLayer(ele) {\n ele[0]._private.rscratch.inDragLayer = false;\n };\n\n var setGrabTarget = function setGrabTarget(ele) {\n ele[0]._private.rscratch.isGrabTarget = true;\n };\n\n var removeGrabTarget = function removeGrabTarget(ele) {\n ele[0]._private.rscratch.isGrabTarget = false;\n };\n\n var addToDragList = function addToDragList(ele, opts) {\n var list = opts.addToList;\n var listHasEle = list.has(ele);\n\n if (!listHasEle) {\n list.merge(ele);\n setGrabbed(ele);\n }\n }; // helper function to determine which child nodes and inner edges\n // of a compound node to be dragged as well as the grabbed and selected nodes\n\n\n var addDescendantsToDrag = function addDescendantsToDrag(node, opts) {\n if (!node.cy().hasCompoundNodes()) {\n return;\n }\n\n if (opts.inDragLayer == null && opts.addToList == null) {\n return;\n } // nothing to do\n\n\n var innerNodes = node.descendants();\n\n if (opts.inDragLayer) {\n innerNodes.forEach(setInDragLayer);\n innerNodes.connectedEdges().forEach(setInDragLayer);\n }\n\n if (opts.addToList) {\n opts.addToList.unmerge(innerNodes);\n }\n }; // adds the given nodes and its neighbourhood to the drag layer\n\n\n var addNodesToDrag = function addNodesToDrag(nodes, opts) {\n opts = opts || {};\n var hasCompoundNodes = nodes.cy().hasCompoundNodes();\n\n if (opts.inDragLayer) {\n nodes.forEach(setInDragLayer);\n nodes.neighborhood().stdFilter(function (ele) {\n return !hasCompoundNodes || ele.isEdge();\n }).forEach(setInDragLayer);\n }\n\n if (opts.addToList) {\n nodes.forEach(function (ele) {\n addToDragList(ele, opts);\n });\n }\n\n addDescendantsToDrag(nodes, opts); // always add to drag\n // also add nodes and edges related to the topmost ancestor\n\n updateAncestorsInDragLayer(nodes, {\n inDragLayer: opts.inDragLayer\n });\n r.updateCachedGrabbedEles();\n };\n\n var addNodeToDrag = addNodesToDrag;\n\n var freeDraggedElements = function freeDraggedElements(grabbedEles) {\n if (!grabbedEles) {\n return;\n } // just go over all elements rather than doing a bunch of (possibly expensive) traversals\n\n\n r.getCachedZSortedEles().forEach(function (ele) {\n setFreed(ele);\n setOutDragLayer(ele);\n removeGrabTarget(ele);\n });\n r.updateCachedGrabbedEles();\n }; // helper function to determine which ancestor nodes and edges should go\n // to the drag layer (or should be removed from drag layer).\n\n\n var updateAncestorsInDragLayer = function updateAncestorsInDragLayer(node, opts) {\n if (opts.inDragLayer == null && opts.addToList == null) {\n return;\n } // nothing to do\n\n\n if (!node.cy().hasCompoundNodes()) {\n return;\n } // find top-level parent\n\n\n var parent = node.ancestors().orphans(); // no parent node: no nodes to add to the drag layer\n\n if (parent.same(node)) {\n return;\n }\n\n var nodes = parent.descendants().spawnSelf().merge(parent).unmerge(node).unmerge(node.descendants());\n var edges = nodes.connectedEdges();\n\n if (opts.inDragLayer) {\n edges.forEach(setInDragLayer);\n nodes.forEach(setInDragLayer);\n }\n\n if (opts.addToList) {\n nodes.forEach(function (ele) {\n addToDragList(ele, opts);\n });\n }\n };\n\n var blurActiveDomElement = function blurActiveDomElement() {\n if (document.activeElement != null && document.activeElement.blur != null) {\n document.activeElement.blur();\n }\n };\n\n var haveMutationsApi = typeof MutationObserver !== 'undefined';\n var haveResizeObserverApi = typeof ResizeObserver !== 'undefined'; // watch for when the cy container is removed from the dom\n\n if (haveMutationsApi) {\n r.removeObserver = new MutationObserver(function (mutns) {\n // eslint-disable-line no-undef\n for (var i = 0; i < mutns.length; i++) {\n var mutn = mutns[i];\n var rNodes = mutn.removedNodes;\n\n if (rNodes) {\n for (var j = 0; j < rNodes.length; j++) {\n var rNode = rNodes[j];\n\n if (rNode === r.container) {\n r.destroy();\n break;\n }\n }\n }\n }\n });\n\n if (r.container.parentNode) {\n r.removeObserver.observe(r.container.parentNode, {\n childList: true\n });\n }\n } else {\n r.registerBinding(r.container, 'DOMNodeRemoved', function (e) {\n // eslint-disable-line no-unused-vars\n r.destroy();\n });\n }\n\n var onResize = util(function () {\n r.cy.resize();\n }, 100);\n\n if (haveMutationsApi) {\n r.styleObserver = new MutationObserver(onResize); // eslint-disable-line no-undef\n\n r.styleObserver.observe(r.container, {\n attributes: true\n });\n } // auto resize\n\n\n r.registerBinding(window, 'resize', onResize); // eslint-disable-line no-undef\n\n if (haveResizeObserverApi) {\n r.resizeObserver = new ResizeObserver(onResize); // eslint-disable-line no-undef\n\n r.resizeObserver.observe(r.container);\n }\n\n var forEachUp = function forEachUp(domEle, fn) {\n while (domEle != null) {\n fn(domEle);\n domEle = domEle.parentNode;\n }\n };\n\n var invalidateCoords = function invalidateCoords() {\n r.invalidateContainerClientCoordsCache();\n };\n\n forEachUp(r.container, function (domEle) {\n r.registerBinding(domEle, 'transitionend', invalidateCoords);\n r.registerBinding(domEle, 'animationend', invalidateCoords);\n r.registerBinding(domEle, 'scroll', invalidateCoords);\n }); // stop right click menu from appearing on cy\n\n r.registerBinding(r.container, 'contextmenu', function (e) {\n e.preventDefault();\n });\n\n var inBoxSelection = function inBoxSelection() {\n return r.selection[4] !== 0;\n };\n\n var eventInContainer = function eventInContainer(e) {\n // save cycles if mouse events aren't to be captured\n var containerPageCoords = r.findContainerClientCoords();\n var x = containerPageCoords[0];\n var y = containerPageCoords[1];\n var width = containerPageCoords[2];\n var height = containerPageCoords[3];\n var positions = e.touches ? e.touches : [e];\n var atLeastOnePosInside = false;\n\n for (var i = 0; i < positions.length; i++) {\n var p = positions[i];\n\n if (x <= p.clientX && p.clientX <= x + width && y <= p.clientY && p.clientY <= y + height) {\n atLeastOnePosInside = true;\n break;\n }\n }\n\n if (!atLeastOnePosInside) {\n return false;\n }\n\n var container = r.container;\n var target = e.target;\n var tParent = target.parentNode;\n var containerIsTarget = false;\n\n while (tParent) {\n if (tParent === container) {\n containerIsTarget = true;\n break;\n }\n\n tParent = tParent.parentNode;\n }\n\n if (!containerIsTarget) {\n return false;\n } // if target is outisde cy container, then this event is not for us\n\n\n return true;\n }; // Primary key\n\n\n r.registerBinding(r.container, 'mousedown', function mousedownHandler(e) {\n if (!eventInContainer(e)) {\n return;\n }\n\n e.preventDefault();\n blurActiveDomElement();\n r.hoverData.capture = true;\n r.hoverData.which = e.which;\n var cy = r.cy;\n var gpos = [e.clientX, e.clientY];\n var pos = r.projectIntoViewport(gpos[0], gpos[1]);\n var select = r.selection;\n var nears = r.findNearestElements(pos[0], pos[1], true, false);\n var near = nears[0];\n var draggedElements = r.dragData.possibleDragElements;\n r.hoverData.mdownPos = pos;\n r.hoverData.mdownGPos = gpos;\n\n var checkForTaphold = function checkForTaphold() {\n r.hoverData.tapholdCancelled = false;\n clearTimeout(r.hoverData.tapholdTimeout);\n r.hoverData.tapholdTimeout = setTimeout(function () {\n if (r.hoverData.tapholdCancelled) {\n return;\n } else {\n var ele = r.hoverData.down;\n\n if (ele) {\n ele.emit({\n originalEvent: e,\n type: 'taphold',\n position: {\n x: pos[0],\n y: pos[1]\n }\n });\n } else {\n cy.emit({\n originalEvent: e,\n type: 'taphold',\n position: {\n x: pos[0],\n y: pos[1]\n }\n });\n }\n }\n }, r.tapholdDuration);\n }; // Right click button\n\n\n if (e.which == 3) {\n r.hoverData.cxtStarted = true;\n var cxtEvt = {\n originalEvent: e,\n type: 'cxttapstart',\n position: {\n x: pos[0],\n y: pos[1]\n }\n };\n\n if (near) {\n near.activate();\n near.emit(cxtEvt);\n r.hoverData.down = near;\n } else {\n cy.emit(cxtEvt);\n }\n\n r.hoverData.downTime = new Date().getTime();\n r.hoverData.cxtDragged = false; // Primary button\n } else if (e.which == 1) {\n if (near) {\n near.activate();\n } // Element dragging\n\n\n {\n // If something is under the cursor and it is draggable, prepare to grab it\n if (near != null) {\n if (r.nodeIsGrabbable(near)) {\n var makeEvent = function makeEvent(type) {\n return {\n originalEvent: e,\n type: type,\n position: {\n x: pos[0],\n y: pos[1]\n }\n };\n };\n\n var triggerGrab = function triggerGrab(ele) {\n ele.emit(makeEvent('grab'));\n };\n\n setGrabTarget(near);\n\n if (!near.selected()) {\n draggedElements = r.dragData.possibleDragElements = cy.collection();\n addNodeToDrag(near, {\n addToList: draggedElements\n });\n near.emit(makeEvent('grabon')).emit(makeEvent('grab'));\n } else {\n draggedElements = r.dragData.possibleDragElements = cy.collection();\n var selectedNodes = cy.$(function (ele) {\n return ele.isNode() && ele.selected() && r.nodeIsGrabbable(ele);\n });\n addNodesToDrag(selectedNodes, {\n addToList: draggedElements\n });\n near.emit(makeEvent('grabon'));\n selectedNodes.forEach(triggerGrab);\n }\n\n r.redrawHint('eles', true);\n r.redrawHint('drag', true);\n }\n }\n\n r.hoverData.down = near;\n r.hoverData.downs = nears;\n r.hoverData.downTime = new Date().getTime();\n }\n triggerEvents(near, ['mousedown', 'tapstart', 'vmousedown'], e, {\n x: pos[0],\n y: pos[1]\n });\n\n if (near == null) {\n select[4] = 1;\n r.data.bgActivePosistion = {\n x: pos[0],\n y: pos[1]\n };\n r.redrawHint('select', true);\n r.redraw();\n } else if (near.pannable()) {\n select[4] = 1; // for future pan\n }\n\n checkForTaphold();\n } // Initialize selection box coordinates\n\n\n select[0] = select[2] = pos[0];\n select[1] = select[3] = pos[1];\n }, false);\n r.registerBinding(window, 'mousemove', function mousemoveHandler(e) {\n // eslint-disable-line no-undef\n var capture = r.hoverData.capture;\n\n if (!capture && !eventInContainer(e)) {\n return;\n }\n\n var preventDefault = false;\n var cy = r.cy;\n var zoom = cy.zoom();\n var gpos = [e.clientX, e.clientY];\n var pos = r.projectIntoViewport(gpos[0], gpos[1]);\n var mdownPos = r.hoverData.mdownPos;\n var mdownGPos = r.hoverData.mdownGPos;\n var select = r.selection;\n var near = null;\n\n if (!r.hoverData.draggingEles && !r.hoverData.dragging && !r.hoverData.selecting) {\n near = r.findNearestElement(pos[0], pos[1], true, false);\n }\n\n var last = r.hoverData.last;\n var down = r.hoverData.down;\n var disp = [pos[0] - select[2], pos[1] - select[3]];\n var draggedElements = r.dragData.possibleDragElements;\n var isOverThresholdDrag;\n\n if (mdownGPos) {\n var dx = gpos[0] - mdownGPos[0];\n var dx2 = dx * dx;\n var dy = gpos[1] - mdownGPos[1];\n var dy2 = dy * dy;\n var dist2 = dx2 + dy2;\n r.hoverData.isOverThresholdDrag = isOverThresholdDrag = dist2 >= r.desktopTapThreshold2;\n }\n\n var multSelKeyDown = isMultSelKeyDown(e);\n\n if (isOverThresholdDrag) {\n r.hoverData.tapholdCancelled = true;\n }\n\n var updateDragDelta = function updateDragDelta() {\n var dragDelta = r.hoverData.dragDelta = r.hoverData.dragDelta || [];\n\n if (dragDelta.length === 0) {\n dragDelta.push(disp[0]);\n dragDelta.push(disp[1]);\n } else {\n dragDelta[0] += disp[0];\n dragDelta[1] += disp[1];\n }\n };\n\n preventDefault = true;\n triggerEvents(near, ['mousemove', 'vmousemove', 'tapdrag'], e, {\n x: pos[0],\n y: pos[1]\n });\n\n var goIntoBoxMode = function goIntoBoxMode() {\n r.data.bgActivePosistion = undefined;\n\n if (!r.hoverData.selecting) {\n cy.emit({\n originalEvent: e,\n type: 'boxstart',\n position: {\n x: pos[0],\n y: pos[1]\n }\n });\n }\n\n select[4] = 1;\n r.hoverData.selecting = true;\n r.redrawHint('select', true);\n r.redraw();\n }; // trigger context drag if rmouse down\n\n\n if (r.hoverData.which === 3) {\n // but only if over threshold\n if (isOverThresholdDrag) {\n var cxtEvt = {\n originalEvent: e,\n type: 'cxtdrag',\n position: {\n x: pos[0],\n y: pos[1]\n }\n };\n\n if (down) {\n down.emit(cxtEvt);\n } else {\n cy.emit(cxtEvt);\n }\n\n r.hoverData.cxtDragged = true;\n\n if (!r.hoverData.cxtOver || near !== r.hoverData.cxtOver) {\n if (r.hoverData.cxtOver) {\n r.hoverData.cxtOver.emit({\n originalEvent: e,\n type: 'cxtdragout',\n position: {\n x: pos[0],\n y: pos[1]\n }\n });\n }\n\n r.hoverData.cxtOver = near;\n\n if (near) {\n near.emit({\n originalEvent: e,\n type: 'cxtdragover',\n position: {\n x: pos[0],\n y: pos[1]\n }\n });\n }\n }\n } // Check if we are drag panning the entire graph\n\n } else if (r.hoverData.dragging) {\n preventDefault = true;\n\n if (cy.panningEnabled() && cy.userPanningEnabled()) {\n var deltaP;\n\n if (r.hoverData.justStartedPan) {\n var mdPos = r.hoverData.mdownPos;\n deltaP = {\n x: (pos[0] - mdPos[0]) * zoom,\n y: (pos[1] - mdPos[1]) * zoom\n };\n r.hoverData.justStartedPan = false;\n } else {\n deltaP = {\n x: disp[0] * zoom,\n y: disp[1] * zoom\n };\n }\n\n cy.panBy(deltaP);\n r.hoverData.dragged = true;\n } // Needs reproject due to pan changing viewport\n\n\n pos = r.projectIntoViewport(e.clientX, e.clientY); // Checks primary button down & out of time & mouse not moved much\n } else if (select[4] == 1 && (down == null || down.pannable())) {\n if (isOverThresholdDrag) {\n if (!r.hoverData.dragging && cy.boxSelectionEnabled() && (multSelKeyDown || !cy.panningEnabled() || !cy.userPanningEnabled())) {\n goIntoBoxMode();\n } else if (!r.hoverData.selecting && cy.panningEnabled() && cy.userPanningEnabled()) {\n var allowPassthrough = allowPanningPassthrough(down, r.hoverData.downs);\n\n if (allowPassthrough) {\n r.hoverData.dragging = true;\n r.hoverData.justStartedPan = true;\n select[4] = 0;\n r.data.bgActivePosistion = array2point(mdownPos);\n r.redrawHint('select', true);\n r.redraw();\n }\n }\n\n if (down && down.pannable() && down.active()) {\n down.unactivate();\n }\n }\n } else {\n if (down && down.pannable() && down.active()) {\n down.unactivate();\n }\n\n if ((!down || !down.grabbed()) && near != last) {\n if (last) {\n triggerEvents(last, ['mouseout', 'tapdragout'], e, {\n x: pos[0],\n y: pos[1]\n });\n }\n\n if (near) {\n triggerEvents(near, ['mouseover', 'tapdragover'], e, {\n x: pos[0],\n y: pos[1]\n });\n }\n\n r.hoverData.last = near;\n }\n\n if (down) {\n if (isOverThresholdDrag) {\n // then we can take action\n if (cy.boxSelectionEnabled() && multSelKeyDown) {\n // then selection overrides\n if (down && down.grabbed()) {\n freeDraggedElements(draggedElements);\n down.emit('freeon');\n draggedElements.emit('free');\n\n if (r.dragData.didDrag) {\n down.emit('dragfreeon');\n draggedElements.emit('dragfree');\n }\n }\n\n goIntoBoxMode();\n } else if (down && down.grabbed() && r.nodeIsDraggable(down)) {\n // drag node\n var justStartedDrag = !r.dragData.didDrag;\n\n if (justStartedDrag) {\n r.redrawHint('eles', true);\n }\n\n r.dragData.didDrag = true; // indicate that we actually did drag the node\n\n var toTrigger = cy.collection(); // now, add the elements to the drag layer if not done already\n\n if (!r.hoverData.draggingEles) {\n addNodesToDrag(draggedElements, {\n inDragLayer: true\n });\n }\n\n var totalShift = {\n x: 0,\n y: 0\n };\n\n if (number(disp[0]) && number(disp[1])) {\n totalShift.x += disp[0];\n totalShift.y += disp[1];\n\n if (justStartedDrag) {\n var dragDelta = r.hoverData.dragDelta;\n\n if (dragDelta && number(dragDelta[0]) && number(dragDelta[1])) {\n totalShift.x += dragDelta[0];\n totalShift.y += dragDelta[1];\n }\n }\n }\n\n for (var i = 0; i < draggedElements.length; i++) {\n var dEle = draggedElements[i];\n\n if (r.nodeIsDraggable(dEle) && dEle.grabbed()) {\n toTrigger.merge(dEle);\n }\n }\n\n r.hoverData.draggingEles = true;\n toTrigger.silentShift(totalShift).emit('position drag');\n r.redrawHint('drag', true);\n r.redraw();\n }\n } else {\n // otherwise save drag delta for when we actually start dragging so the relative grab pos is constant\n updateDragDelta();\n }\n } // prevent the dragging from triggering text selection on the page\n\n\n preventDefault = true;\n }\n\n select[2] = pos[0];\n select[3] = pos[1];\n\n if (preventDefault) {\n if (e.stopPropagation) e.stopPropagation();\n if (e.preventDefault) e.preventDefault();\n return false;\n }\n }, false);\n r.registerBinding(window, 'mouseup', function mouseupHandler(e) {\n // eslint-disable-line no-undef\n var capture = r.hoverData.capture;\n\n if (!capture) {\n return;\n }\n\n r.hoverData.capture = false;\n var cy = r.cy;\n var pos = r.projectIntoViewport(e.clientX, e.clientY);\n var select = r.selection;\n var near = r.findNearestElement(pos[0], pos[1], true, false);\n var draggedElements = r.dragData.possibleDragElements;\n var down = r.hoverData.down;\n var multSelKeyDown = isMultSelKeyDown(e);\n\n if (r.data.bgActivePosistion) {\n r.redrawHint('select', true);\n r.redraw();\n }\n\n r.hoverData.tapholdCancelled = true;\n r.data.bgActivePosistion = undefined; // not active bg now\n\n if (down) {\n down.unactivate();\n }\n\n if (r.hoverData.which === 3) {\n var cxtEvt = {\n originalEvent: e,\n type: 'cxttapend',\n position: {\n x: pos[0],\n y: pos[1]\n }\n };\n\n if (down) {\n down.emit(cxtEvt);\n } else {\n cy.emit(cxtEvt);\n }\n\n if (!r.hoverData.cxtDragged) {\n var cxtTap = {\n originalEvent: e,\n type: 'cxttap',\n position: {\n x: pos[0],\n y: pos[1]\n }\n };\n\n if (down) {\n down.emit(cxtTap);\n } else {\n cy.emit(cxtTap);\n }\n }\n\n r.hoverData.cxtDragged = false;\n r.hoverData.which = null;\n } else if (r.hoverData.which === 1) {\n triggerEvents(near, ['mouseup', 'tapend', 'vmouseup'], e, {\n x: pos[0],\n y: pos[1]\n });\n\n if (!r.dragData.didDrag // didn't move a node around\n && !r.hoverData.dragged // didn't pan\n && !r.hoverData.selecting // not box selection\n && !r.hoverData.isOverThresholdDrag // didn't move too much\n ) {\n triggerEvents(down, ['click', 'tap', 'vclick'], e, {\n x: pos[0],\n y: pos[1]\n });\n } // Deselect all elements if nothing is currently under the mouse cursor and we aren't dragging something\n\n\n if (down == null && // not mousedown on node\n !r.dragData.didDrag // didn't move the node around\n && !r.hoverData.selecting // not box selection\n && !r.hoverData.dragged // didn't pan\n && !isMultSelKeyDown(e)) {\n cy.$(isSelected).unselect(['tapunselect']);\n\n if (draggedElements.length > 0) {\n r.redrawHint('eles', true);\n }\n\n r.dragData.possibleDragElements = draggedElements = cy.collection();\n } // Single selection\n\n\n if (near == down && !r.dragData.didDrag && !r.hoverData.selecting) {\n if (near != null && near._private.selectable) {\n if (r.hoverData.dragging) ; else if (cy.selectionType() === 'additive' || multSelKeyDown) {\n if (near.selected()) {\n near.unselect(['tapunselect']);\n } else {\n near.select(['tapselect']);\n }\n } else {\n if (!multSelKeyDown) {\n cy.$(isSelected).unmerge(near).unselect(['tapunselect']);\n near.select(['tapselect']);\n }\n }\n\n r.redrawHint('eles', true);\n }\n }\n\n if (r.hoverData.selecting) {\n var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3]));\n r.redrawHint('select', true);\n\n if (box.length > 0) {\n r.redrawHint('eles', true);\n }\n\n cy.emit({\n type: 'boxend',\n originalEvent: e,\n position: {\n x: pos[0],\n y: pos[1]\n }\n });\n\n var eleWouldBeSelected = function eleWouldBeSelected(ele) {\n return ele.selectable() && !ele.selected();\n };\n\n if (cy.selectionType() === 'additive') {\n box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect');\n } else {\n if (!multSelKeyDown) {\n cy.$(isSelected).unmerge(box).unselect();\n }\n\n box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect');\n } // always need redraw in case eles unselectable\n\n\n r.redraw();\n } // Cancel drag pan\n\n\n if (r.hoverData.dragging) {\n r.hoverData.dragging = false;\n r.redrawHint('select', true);\n r.redrawHint('eles', true);\n r.redraw();\n }\n\n if (!select[4]) {\n r.redrawHint('drag', true);\n r.redrawHint('eles', true);\n var downWasGrabbed = down && down.grabbed();\n freeDraggedElements(draggedElements);\n\n if (downWasGrabbed) {\n down.emit('freeon');\n draggedElements.emit('free');\n\n if (r.dragData.didDrag) {\n down.emit('dragfreeon');\n draggedElements.emit('dragfree');\n }\n }\n }\n } // else not right mouse\n\n\n select[4] = 0;\n r.hoverData.down = null;\n r.hoverData.cxtStarted = false;\n r.hoverData.draggingEles = false;\n r.hoverData.selecting = false;\n r.hoverData.isOverThresholdDrag = false;\n r.dragData.didDrag = false;\n r.hoverData.dragged = false;\n r.hoverData.dragDelta = [];\n r.hoverData.mdownPos = null;\n r.hoverData.mdownGPos = null;\n }, false);\n\n var wheelHandler = function wheelHandler(e) {\n if (r.scrollingPage) {\n return;\n } // while scrolling, ignore wheel-to-zoom\n\n\n var cy = r.cy;\n var zoom = cy.zoom();\n var pan = cy.pan();\n var pos = r.projectIntoViewport(e.clientX, e.clientY);\n var rpos = [pos[0] * zoom + pan.x, pos[1] * zoom + pan.y];\n\n if (r.hoverData.draggingEles || r.hoverData.dragging || r.hoverData.cxtStarted || inBoxSelection()) {\n // if pan dragging or cxt dragging, wheel movements make no zoom\n e.preventDefault();\n return;\n }\n\n if (cy.panningEnabled() && cy.userPanningEnabled() && cy.zoomingEnabled() && cy.userZoomingEnabled()) {\n e.preventDefault();\n r.data.wheelZooming = true;\n clearTimeout(r.data.wheelTimeout);\n r.data.wheelTimeout = setTimeout(function () {\n r.data.wheelZooming = false;\n r.redrawHint('eles', true);\n r.redraw();\n }, 150);\n var diff;\n\n if (e.deltaY != null) {\n diff = e.deltaY / -250;\n } else if (e.wheelDeltaY != null) {\n diff = e.wheelDeltaY / 1000;\n } else {\n diff = e.wheelDelta / 1000;\n }\n\n diff = diff * r.wheelSensitivity;\n var needsWheelFix = e.deltaMode === 1;\n\n if (needsWheelFix) {\n // fixes slow wheel events on ff/linux and ff/windows\n diff *= 33;\n }\n\n var newZoom = cy.zoom() * Math.pow(10, diff);\n\n if (e.type === 'gesturechange') {\n newZoom = r.gestureStartZoom * e.scale;\n }\n\n cy.zoom({\n level: newZoom,\n renderedPosition: {\n x: rpos[0],\n y: rpos[1]\n }\n });\n }\n }; // Functions to help with whether mouse wheel should trigger zooming\n // --\n\n\n r.registerBinding(r.container, 'wheel', wheelHandler, true); // disable nonstandard wheel events\n // r.registerBinding(r.container, 'mousewheel', wheelHandler, true);\n // r.registerBinding(r.container, 'DOMMouseScroll', wheelHandler, true);\n // r.registerBinding(r.container, 'MozMousePixelScroll', wheelHandler, true); // older firefox\n\n r.registerBinding(window, 'scroll', function scrollHandler(e) {\n // eslint-disable-line no-unused-vars\n r.scrollingPage = true;\n clearTimeout(r.scrollingPageTimeout);\n r.scrollingPageTimeout = setTimeout(function () {\n r.scrollingPage = false;\n }, 250);\n }, true); // desktop safari pinch to zoom start\n\n r.registerBinding(r.container, 'gesturestart', function gestureStartHandler(e) {\n r.gestureStartZoom = r.cy.zoom();\n\n if (!r.hasTouchStarted) {\n // don't affect touch devices like iphone\n e.preventDefault();\n }\n }, true);\n r.registerBinding(r.container, 'gesturechange', function (e) {\n if (!r.hasTouchStarted) {\n // don't affect touch devices like iphone\n wheelHandler(e);\n }\n }, true); // Functions to help with handling mouseout/mouseover on the Cytoscape container\n // Handle mouseout on Cytoscape container\n\n r.registerBinding(r.container, 'mouseout', function mouseOutHandler(e) {\n var pos = r.projectIntoViewport(e.clientX, e.clientY);\n r.cy.emit({\n originalEvent: e,\n type: 'mouseout',\n position: {\n x: pos[0],\n y: pos[1]\n }\n });\n }, false);\n r.registerBinding(r.container, 'mouseover', function mouseOverHandler(e) {\n var pos = r.projectIntoViewport(e.clientX, e.clientY);\n r.cy.emit({\n originalEvent: e,\n type: 'mouseover',\n position: {\n x: pos[0],\n y: pos[1]\n }\n });\n }, false);\n var f1x1, f1y1, f2x1, f2y1; // starting points for pinch-to-zoom\n\n var distance1, distance1Sq; // initial distance between finger 1 and finger 2 for pinch-to-zoom\n\n var center1, modelCenter1; // center point on start pinch to zoom\n\n var offsetLeft, offsetTop;\n var containerWidth, containerHeight;\n var twoFingersStartInside;\n\n var distance = function distance(x1, y1, x2, y2) {\n return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n };\n\n var distanceSq = function distanceSq(x1, y1, x2, y2) {\n return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);\n };\n\n var touchstartHandler;\n r.registerBinding(r.container, 'touchstart', touchstartHandler = function touchstartHandler(e) {\n r.hasTouchStarted = true;\n\n if (!eventInContainer(e)) {\n return;\n }\n\n blurActiveDomElement();\n r.touchData.capture = true;\n r.data.bgActivePosistion = undefined;\n var cy = r.cy;\n var now = r.touchData.now;\n var earlier = r.touchData.earlier;\n\n if (e.touches[0]) {\n var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n now[0] = pos[0];\n now[1] = pos[1];\n }\n\n if (e.touches[1]) {\n var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);\n now[2] = pos[0];\n now[3] = pos[1];\n }\n\n if (e.touches[2]) {\n var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);\n now[4] = pos[0];\n now[5] = pos[1];\n } // record starting points for pinch-to-zoom\n\n\n if (e.touches[1]) {\n r.touchData.singleTouchMoved = true;\n freeDraggedElements(r.dragData.touchDragEles);\n var offsets = r.findContainerClientCoords();\n offsetLeft = offsets[0];\n offsetTop = offsets[1];\n containerWidth = offsets[2];\n containerHeight = offsets[3];\n f1x1 = e.touches[0].clientX - offsetLeft;\n f1y1 = e.touches[0].clientY - offsetTop;\n f2x1 = e.touches[1].clientX - offsetLeft;\n f2y1 = e.touches[1].clientY - offsetTop;\n twoFingersStartInside = 0 <= f1x1 && f1x1 <= containerWidth && 0 <= f2x1 && f2x1 <= containerWidth && 0 <= f1y1 && f1y1 <= containerHeight && 0 <= f2y1 && f2y1 <= containerHeight;\n var pan = cy.pan();\n var zoom = cy.zoom();\n distance1 = distance(f1x1, f1y1, f2x1, f2y1);\n distance1Sq = distanceSq(f1x1, f1y1, f2x1, f2y1);\n center1 = [(f1x1 + f2x1) / 2, (f1y1 + f2y1) / 2];\n modelCenter1 = [(center1[0] - pan.x) / zoom, (center1[1] - pan.y) / zoom]; // consider context tap\n\n var cxtDistThreshold = 200;\n var cxtDistThresholdSq = cxtDistThreshold * cxtDistThreshold;\n\n if (distance1Sq < cxtDistThresholdSq && !e.touches[2]) {\n var near1 = r.findNearestElement(now[0], now[1], true, true);\n var near2 = r.findNearestElement(now[2], now[3], true, true);\n\n if (near1 && near1.isNode()) {\n near1.activate().emit({\n originalEvent: e,\n type: 'cxttapstart',\n position: {\n x: now[0],\n y: now[1]\n }\n });\n r.touchData.start = near1;\n } else if (near2 && near2.isNode()) {\n near2.activate().emit({\n originalEvent: e,\n type: 'cxttapstart',\n position: {\n x: now[0],\n y: now[1]\n }\n });\n r.touchData.start = near2;\n } else {\n cy.emit({\n originalEvent: e,\n type: 'cxttapstart',\n position: {\n x: now[0],\n y: now[1]\n }\n });\n }\n\n if (r.touchData.start) {\n r.touchData.start._private.grabbed = false;\n }\n\n r.touchData.cxt = true;\n r.touchData.cxtDragged = false;\n r.data.bgActivePosistion = undefined;\n r.redraw();\n return;\n }\n }\n\n if (e.touches[2]) {\n // ignore\n // safari on ios pans the page otherwise (normally you should be able to preventdefault on touchmove...)\n if (cy.boxSelectionEnabled()) {\n e.preventDefault();\n }\n } else if (e.touches[1]) ; else if (e.touches[0]) {\n var nears = r.findNearestElements(now[0], now[1], true, true);\n var near = nears[0];\n\n if (near != null) {\n near.activate();\n r.touchData.start = near;\n r.touchData.starts = nears;\n\n if (r.nodeIsGrabbable(near)) {\n var draggedEles = r.dragData.touchDragEles = cy.collection();\n var selectedNodes = null;\n r.redrawHint('eles', true);\n r.redrawHint('drag', true);\n\n if (near.selected()) {\n // reset drag elements, since near will be added again\n selectedNodes = cy.$(function (ele) {\n return ele.selected() && r.nodeIsGrabbable(ele);\n });\n addNodesToDrag(selectedNodes, {\n addToList: draggedEles\n });\n } else {\n addNodeToDrag(near, {\n addToList: draggedEles\n });\n }\n\n setGrabTarget(near);\n\n var makeEvent = function makeEvent(type) {\n return {\n originalEvent: e,\n type: type,\n position: {\n x: now[0],\n y: now[1]\n }\n };\n };\n\n near.emit(makeEvent('grabon'));\n\n if (selectedNodes) {\n selectedNodes.forEach(function (n) {\n n.emit(makeEvent('grab'));\n });\n } else {\n near.emit(makeEvent('grab'));\n }\n }\n }\n\n triggerEvents(near, ['touchstart', 'tapstart', 'vmousedown'], e, {\n x: now[0],\n y: now[1]\n });\n\n if (near == null) {\n r.data.bgActivePosistion = {\n x: pos[0],\n y: pos[1]\n };\n r.redrawHint('select', true);\n r.redraw();\n } // Tap, taphold\n // -----\n\n\n r.touchData.singleTouchMoved = false;\n r.touchData.singleTouchStartTime = +new Date();\n clearTimeout(r.touchData.tapholdTimeout);\n r.touchData.tapholdTimeout = setTimeout(function () {\n if (r.touchData.singleTouchMoved === false && !r.pinching // if pinching, then taphold unselect shouldn't take effect\n && !r.touchData.selecting // box selection shouldn't allow taphold through\n ) {\n triggerEvents(r.touchData.start, ['taphold'], e, {\n x: now[0],\n y: now[1]\n });\n }\n }, r.tapholdDuration);\n }\n\n if (e.touches.length >= 1) {\n var sPos = r.touchData.startPosition = [];\n\n for (var i = 0; i < now.length; i++) {\n sPos[i] = earlier[i] = now[i];\n }\n\n var touch0 = e.touches[0];\n r.touchData.startGPosition = [touch0.clientX, touch0.clientY];\n }\n }, false);\n var touchmoveHandler;\n r.registerBinding(window, 'touchmove', touchmoveHandler = function touchmoveHandler(e) {\n // eslint-disable-line no-undef\n var capture = r.touchData.capture;\n\n if (!capture && !eventInContainer(e)) {\n return;\n }\n\n var select = r.selection;\n var cy = r.cy;\n var now = r.touchData.now;\n var earlier = r.touchData.earlier;\n var zoom = cy.zoom();\n\n if (e.touches[0]) {\n var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n now[0] = pos[0];\n now[1] = pos[1];\n }\n\n if (e.touches[1]) {\n var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);\n now[2] = pos[0];\n now[3] = pos[1];\n }\n\n if (e.touches[2]) {\n var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);\n now[4] = pos[0];\n now[5] = pos[1];\n }\n\n var startGPos = r.touchData.startGPosition;\n var isOverThresholdDrag;\n\n if (capture && e.touches[0] && startGPos) {\n var disp = [];\n\n for (var j = 0; j < now.length; j++) {\n disp[j] = now[j] - earlier[j];\n }\n\n var dx = e.touches[0].clientX - startGPos[0];\n var dx2 = dx * dx;\n var dy = e.touches[0].clientY - startGPos[1];\n var dy2 = dy * dy;\n var dist2 = dx2 + dy2;\n isOverThresholdDrag = dist2 >= r.touchTapThreshold2;\n } // context swipe cancelling\n\n\n if (capture && r.touchData.cxt) {\n e.preventDefault();\n var f1x2 = e.touches[0].clientX - offsetLeft,\n f1y2 = e.touches[0].clientY - offsetTop;\n var f2x2 = e.touches[1].clientX - offsetLeft,\n f2y2 = e.touches[1].clientY - offsetTop; // var distance2 = distance( f1x2, f1y2, f2x2, f2y2 );\n\n var distance2Sq = distanceSq(f1x2, f1y2, f2x2, f2y2);\n var factorSq = distance2Sq / distance1Sq;\n var distThreshold = 150;\n var distThresholdSq = distThreshold * distThreshold;\n var factorThreshold = 1.5;\n var factorThresholdSq = factorThreshold * factorThreshold; // cancel ctx gestures if the distance b/t the fingers increases\n\n if (factorSq >= factorThresholdSq || distance2Sq >= distThresholdSq) {\n r.touchData.cxt = false;\n r.data.bgActivePosistion = undefined;\n r.redrawHint('select', true);\n var cxtEvt = {\n originalEvent: e,\n type: 'cxttapend',\n position: {\n x: now[0],\n y: now[1]\n }\n };\n\n if (r.touchData.start) {\n r.touchData.start.unactivate().emit(cxtEvt);\n r.touchData.start = null;\n } else {\n cy.emit(cxtEvt);\n }\n }\n } // context swipe\n\n\n if (capture && r.touchData.cxt) {\n var cxtEvt = {\n originalEvent: e,\n type: 'cxtdrag',\n position: {\n x: now[0],\n y: now[1]\n }\n };\n r.data.bgActivePosistion = undefined;\n r.redrawHint('select', true);\n\n if (r.touchData.start) {\n r.touchData.start.emit(cxtEvt);\n } else {\n cy.emit(cxtEvt);\n }\n\n if (r.touchData.start) {\n r.touchData.start._private.grabbed = false;\n }\n\n r.touchData.cxtDragged = true;\n var near = r.findNearestElement(now[0], now[1], true, true);\n\n if (!r.touchData.cxtOver || near !== r.touchData.cxtOver) {\n if (r.touchData.cxtOver) {\n r.touchData.cxtOver.emit({\n originalEvent: e,\n type: 'cxtdragout',\n position: {\n x: now[0],\n y: now[1]\n }\n });\n }\n\n r.touchData.cxtOver = near;\n\n if (near) {\n near.emit({\n originalEvent: e,\n type: 'cxtdragover',\n position: {\n x: now[0],\n y: now[1]\n }\n });\n }\n } // box selection\n\n } else if (capture && e.touches[2] && cy.boxSelectionEnabled()) {\n e.preventDefault();\n r.data.bgActivePosistion = undefined;\n this.lastThreeTouch = +new Date();\n\n if (!r.touchData.selecting) {\n cy.emit({\n originalEvent: e,\n type: 'boxstart',\n position: {\n x: now[0],\n y: now[1]\n }\n });\n }\n\n r.touchData.selecting = true;\n r.touchData.didSelect = true;\n select[4] = 1;\n\n if (!select || select.length === 0 || select[0] === undefined) {\n select[0] = (now[0] + now[2] + now[4]) / 3;\n select[1] = (now[1] + now[3] + now[5]) / 3;\n select[2] = (now[0] + now[2] + now[4]) / 3 + 1;\n select[3] = (now[1] + now[3] + now[5]) / 3 + 1;\n } else {\n select[2] = (now[0] + now[2] + now[4]) / 3;\n select[3] = (now[1] + now[3] + now[5]) / 3;\n }\n\n r.redrawHint('select', true);\n r.redraw(); // pinch to zoom\n } else if (capture && e.touches[1] && !r.touchData.didSelect // don't allow box selection to degrade to pinch-to-zoom\n && cy.zoomingEnabled() && cy.panningEnabled() && cy.userZoomingEnabled() && cy.userPanningEnabled()) {\n // two fingers => pinch to zoom\n e.preventDefault();\n r.data.bgActivePosistion = undefined;\n r.redrawHint('select', true);\n var draggedEles = r.dragData.touchDragEles;\n\n if (draggedEles) {\n r.redrawHint('drag', true);\n\n for (var i = 0; i < draggedEles.length; i++) {\n var de_p = draggedEles[i]._private;\n de_p.grabbed = false;\n de_p.rscratch.inDragLayer = false;\n }\n }\n\n var _start = r.touchData.start; // (x2, y2) for fingers 1 and 2\n\n var f1x2 = e.touches[0].clientX - offsetLeft,\n f1y2 = e.touches[0].clientY - offsetTop;\n var f2x2 = e.touches[1].clientX - offsetLeft,\n f2y2 = e.touches[1].clientY - offsetTop;\n var distance2 = distance(f1x2, f1y2, f2x2, f2y2); // var distance2Sq = distanceSq( f1x2, f1y2, f2x2, f2y2 );\n // var factor = Math.sqrt( distance2Sq ) / Math.sqrt( distance1Sq );\n\n var factor = distance2 / distance1;\n\n if (twoFingersStartInside) {\n // delta finger1\n var df1x = f1x2 - f1x1;\n var df1y = f1y2 - f1y1; // delta finger 2\n\n var df2x = f2x2 - f2x1;\n var df2y = f2y2 - f2y1; // translation is the normalised vector of the two fingers movement\n // i.e. so pinching cancels out and moving together pans\n\n var tx = (df1x + df2x) / 2;\n var ty = (df1y + df2y) / 2; // now calculate the zoom\n\n var zoom1 = cy.zoom();\n var zoom2 = zoom1 * factor;\n var pan1 = cy.pan(); // the model center point converted to the current rendered pos\n\n var ctrx = modelCenter1[0] * zoom1 + pan1.x;\n var ctry = modelCenter1[1] * zoom1 + pan1.y;\n var pan2 = {\n x: -zoom2 / zoom1 * (ctrx - pan1.x - tx) + ctrx,\n y: -zoom2 / zoom1 * (ctry - pan1.y - ty) + ctry\n }; // remove dragged eles\n\n if (_start && _start.active()) {\n var draggedEles = r.dragData.touchDragEles;\n freeDraggedElements(draggedEles);\n r.redrawHint('drag', true);\n r.redrawHint('eles', true);\n\n _start.unactivate().emit('freeon');\n\n draggedEles.emit('free');\n\n if (r.dragData.didDrag) {\n _start.emit('dragfreeon');\n\n draggedEles.emit('dragfree');\n }\n }\n\n cy.viewport({\n zoom: zoom2,\n pan: pan2,\n cancelOnFailedZoom: true\n });\n distance1 = distance2;\n f1x1 = f1x2;\n f1y1 = f1y2;\n f2x1 = f2x2;\n f2y1 = f2y2;\n r.pinching = true;\n } // Re-project\n\n\n if (e.touches[0]) {\n var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n now[0] = pos[0];\n now[1] = pos[1];\n }\n\n if (e.touches[1]) {\n var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);\n now[2] = pos[0];\n now[3] = pos[1];\n }\n\n if (e.touches[2]) {\n var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);\n now[4] = pos[0];\n now[5] = pos[1];\n }\n } else if (e.touches[0] && !r.touchData.didSelect // don't allow box selection to degrade to single finger events like panning\n ) {\n var start = r.touchData.start;\n var last = r.touchData.last;\n var near;\n\n if (!r.hoverData.draggingEles && !r.swipePanning) {\n near = r.findNearestElement(now[0], now[1], true, true);\n }\n\n if (capture && start != null) {\n e.preventDefault();\n } // dragging nodes\n\n\n if (capture && start != null && r.nodeIsDraggable(start)) {\n if (isOverThresholdDrag) {\n // then dragging can happen\n var draggedEles = r.dragData.touchDragEles;\n var justStartedDrag = !r.dragData.didDrag;\n\n if (justStartedDrag) {\n addNodesToDrag(draggedEles, {\n inDragLayer: true\n });\n }\n\n r.dragData.didDrag = true;\n var totalShift = {\n x: 0,\n y: 0\n };\n\n if (number(disp[0]) && number(disp[1])) {\n totalShift.x += disp[0];\n totalShift.y += disp[1];\n\n if (justStartedDrag) {\n r.redrawHint('eles', true);\n var dragDelta = r.touchData.dragDelta;\n\n if (dragDelta && number(dragDelta[0]) && number(dragDelta[1])) {\n totalShift.x += dragDelta[0];\n totalShift.y += dragDelta[1];\n }\n }\n }\n\n r.hoverData.draggingEles = true;\n draggedEles.silentShift(totalShift).emit('position drag');\n r.redrawHint('drag', true);\n\n if (r.touchData.startPosition[0] == earlier[0] && r.touchData.startPosition[1] == earlier[1]) {\n r.redrawHint('eles', true);\n }\n\n r.redraw();\n } else {\n // otherise keep track of drag delta for later\n var dragDelta = r.touchData.dragDelta = r.touchData.dragDelta || [];\n\n if (dragDelta.length === 0) {\n dragDelta.push(disp[0]);\n dragDelta.push(disp[1]);\n } else {\n dragDelta[0] += disp[0];\n dragDelta[1] += disp[1];\n }\n }\n } // touchmove\n\n\n {\n triggerEvents(start || near, ['touchmove', 'tapdrag', 'vmousemove'], e, {\n x: now[0],\n y: now[1]\n });\n\n if ((!start || !start.grabbed()) && near != last) {\n if (last) {\n last.emit({\n originalEvent: e,\n type: 'tapdragout',\n position: {\n x: now[0],\n y: now[1]\n }\n });\n }\n\n if (near) {\n near.emit({\n originalEvent: e,\n type: 'tapdragover',\n position: {\n x: now[0],\n y: now[1]\n }\n });\n }\n }\n\n r.touchData.last = near;\n } // check to cancel taphold\n\n if (capture) {\n for (var i = 0; i < now.length; i++) {\n if (now[i] && r.touchData.startPosition[i] && isOverThresholdDrag) {\n r.touchData.singleTouchMoved = true;\n }\n }\n } // panning\n\n\n if (capture && (start == null || start.pannable()) && cy.panningEnabled() && cy.userPanningEnabled()) {\n var allowPassthrough = allowPanningPassthrough(start, r.touchData.starts);\n\n if (allowPassthrough) {\n e.preventDefault();\n\n if (!r.data.bgActivePosistion) {\n r.data.bgActivePosistion = array2point(r.touchData.startPosition);\n }\n\n if (r.swipePanning) {\n cy.panBy({\n x: disp[0] * zoom,\n y: disp[1] * zoom\n });\n } else if (isOverThresholdDrag) {\n r.swipePanning = true;\n cy.panBy({\n x: dx * zoom,\n y: dy * zoom\n });\n\n if (start) {\n start.unactivate();\n r.redrawHint('select', true);\n r.touchData.start = null;\n }\n }\n } // Re-project\n\n\n var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n now[0] = pos[0];\n now[1] = pos[1];\n }\n }\n\n for (var j = 0; j < now.length; j++) {\n earlier[j] = now[j];\n } // the active bg indicator should be removed when making a swipe that is neither for dragging nodes or panning\n\n\n if (capture && e.touches.length > 0 && !r.hoverData.draggingEles && !r.swipePanning && r.data.bgActivePosistion != null) {\n r.data.bgActivePosistion = undefined;\n r.redrawHint('select', true);\n r.redraw();\n }\n }, false);\n var touchcancelHandler;\n r.registerBinding(window, 'touchcancel', touchcancelHandler = function touchcancelHandler(e) {\n // eslint-disable-line no-unused-vars\n var start = r.touchData.start;\n r.touchData.capture = false;\n\n if (start) {\n start.unactivate();\n }\n });\n var touchendHandler;\n r.registerBinding(window, 'touchend', touchendHandler = function touchendHandler(e) {\n // eslint-disable-line no-unused-vars\n var start = r.touchData.start;\n var capture = r.touchData.capture;\n\n if (capture) {\n if (e.touches.length === 0) {\n r.touchData.capture = false;\n }\n\n e.preventDefault();\n } else {\n return;\n }\n\n var select = r.selection;\n r.swipePanning = false;\n r.hoverData.draggingEles = false;\n var cy = r.cy;\n var zoom = cy.zoom();\n var now = r.touchData.now;\n var earlier = r.touchData.earlier;\n\n if (e.touches[0]) {\n var pos = r.projectIntoViewport(e.touches[0].clientX, e.touches[0].clientY);\n now[0] = pos[0];\n now[1] = pos[1];\n }\n\n if (e.touches[1]) {\n var pos = r.projectIntoViewport(e.touches[1].clientX, e.touches[1].clientY);\n now[2] = pos[0];\n now[3] = pos[1];\n }\n\n if (e.touches[2]) {\n var pos = r.projectIntoViewport(e.touches[2].clientX, e.touches[2].clientY);\n now[4] = pos[0];\n now[5] = pos[1];\n }\n\n if (start) {\n start.unactivate();\n }\n\n var ctxTapend;\n\n if (r.touchData.cxt) {\n ctxTapend = {\n originalEvent: e,\n type: 'cxttapend',\n position: {\n x: now[0],\n y: now[1]\n }\n };\n\n if (start) {\n start.emit(ctxTapend);\n } else {\n cy.emit(ctxTapend);\n }\n\n if (!r.touchData.cxtDragged) {\n var ctxTap = {\n originalEvent: e,\n type: 'cxttap',\n position: {\n x: now[0],\n y: now[1]\n }\n };\n\n if (start) {\n start.emit(ctxTap);\n } else {\n cy.emit(ctxTap);\n }\n }\n\n if (r.touchData.start) {\n r.touchData.start._private.grabbed = false;\n }\n\n r.touchData.cxt = false;\n r.touchData.start = null;\n r.redraw();\n return;\n } // no more box selection if we don't have three fingers\n\n\n if (!e.touches[2] && cy.boxSelectionEnabled() && r.touchData.selecting) {\n r.touchData.selecting = false;\n var box = cy.collection(r.getAllInBox(select[0], select[1], select[2], select[3]));\n select[0] = undefined;\n select[1] = undefined;\n select[2] = undefined;\n select[3] = undefined;\n select[4] = 0;\n r.redrawHint('select', true);\n cy.emit({\n type: 'boxend',\n originalEvent: e,\n position: {\n x: now[0],\n y: now[1]\n }\n });\n\n var eleWouldBeSelected = function eleWouldBeSelected(ele) {\n return ele.selectable() && !ele.selected();\n };\n\n box.emit('box').stdFilter(eleWouldBeSelected).select().emit('boxselect');\n\n if (box.nonempty()) {\n r.redrawHint('eles', true);\n }\n\n r.redraw();\n }\n\n if (start != null) {\n start.unactivate();\n }\n\n if (e.touches[2]) {\n r.data.bgActivePosistion = undefined;\n r.redrawHint('select', true);\n } else if (e.touches[1]) ; else if (e.touches[0]) ; else if (!e.touches[0]) {\n r.data.bgActivePosistion = undefined;\n r.redrawHint('select', true);\n var draggedEles = r.dragData.touchDragEles;\n\n if (start != null) {\n var startWasGrabbed = start._private.grabbed;\n freeDraggedElements(draggedEles);\n r.redrawHint('drag', true);\n r.redrawHint('eles', true);\n\n if (startWasGrabbed) {\n start.emit('freeon');\n draggedEles.emit('free');\n\n if (r.dragData.didDrag) {\n start.emit('dragfreeon');\n draggedEles.emit('dragfree');\n }\n }\n\n triggerEvents(start, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, {\n x: now[0],\n y: now[1]\n });\n start.unactivate();\n r.touchData.start = null;\n } else {\n var near = r.findNearestElement(now[0], now[1], true, true);\n triggerEvents(near, ['touchend', 'tapend', 'vmouseup', 'tapdragout'], e, {\n x: now[0],\n y: now[1]\n });\n }\n\n var dx = r.touchData.startPosition[0] - now[0];\n var dx2 = dx * dx;\n var dy = r.touchData.startPosition[1] - now[1];\n var dy2 = dy * dy;\n var dist2 = dx2 + dy2;\n var rdist2 = dist2 * zoom * zoom; // Tap event, roughly same as mouse click event for touch\n\n if (!r.touchData.singleTouchMoved) {\n if (!start) {\n cy.$(':selected').unselect(['tapunselect']);\n }\n\n triggerEvents(start, ['tap', 'vclick'], e, {\n x: now[0],\n y: now[1]\n });\n } // Prepare to select the currently touched node, only if it hasn't been dragged past a certain distance\n\n\n if (start != null && !r.dragData.didDrag // didn't drag nodes around\n && start._private.selectable && rdist2 < r.touchTapThreshold2 && !r.pinching // pinch to zoom should not affect selection\n ) {\n if (cy.selectionType() === 'single') {\n cy.$(isSelected).unmerge(start).unselect(['tapunselect']);\n start.select(['tapselect']);\n } else {\n if (start.selected()) {\n start.unselect(['tapunselect']);\n } else {\n start.select(['tapselect']);\n }\n }\n\n r.redrawHint('eles', true);\n }\n\n r.touchData.singleTouchMoved = true;\n }\n\n for (var j = 0; j < now.length; j++) {\n earlier[j] = now[j];\n }\n\n r.dragData.didDrag = false; // reset for next touchstart\n\n if (e.touches.length === 0) {\n r.touchData.dragDelta = [];\n r.touchData.startPosition = null;\n r.touchData.startGPosition = null;\n r.touchData.didSelect = false;\n }\n\n if (e.touches.length < 2) {\n if (e.touches.length === 1) {\n // the old start global pos'n may not be the same finger that remains\n r.touchData.startGPosition = [e.touches[0].clientX, e.touches[0].clientY];\n }\n\n r.pinching = false;\n r.redrawHint('eles', true);\n r.redraw();\n } //r.redraw();\n\n }, false); // fallback compatibility layer for ms pointer events\n\n if (typeof TouchEvent === 'undefined') {\n var pointers = [];\n\n var makeTouch = function makeTouch(e) {\n return {\n clientX: e.clientX,\n clientY: e.clientY,\n force: 1,\n identifier: e.pointerId,\n pageX: e.pageX,\n pageY: e.pageY,\n radiusX: e.width / 2,\n radiusY: e.height / 2,\n screenX: e.screenX,\n screenY: e.screenY,\n target: e.target\n };\n };\n\n var makePointer = function makePointer(e) {\n return {\n event: e,\n touch: makeTouch(e)\n };\n };\n\n var addPointer = function addPointer(e) {\n pointers.push(makePointer(e));\n };\n\n var removePointer = function removePointer(e) {\n for (var i = 0; i < pointers.length; i++) {\n var p = pointers[i];\n\n if (p.event.pointerId === e.pointerId) {\n pointers.splice(i, 1);\n return;\n }\n }\n };\n\n var updatePointer = function updatePointer(e) {\n var p = pointers.filter(function (p) {\n return p.event.pointerId === e.pointerId;\n })[0];\n p.event = e;\n p.touch = makeTouch(e);\n };\n\n var addTouchesToEvent = function addTouchesToEvent(e) {\n e.touches = pointers.map(function (p) {\n return p.touch;\n });\n };\n\n var pointerIsMouse = function pointerIsMouse(e) {\n return e.pointerType === 'mouse' || e.pointerType === 4;\n };\n\n r.registerBinding(r.container, 'pointerdown', function (e) {\n if (pointerIsMouse(e)) {\n return;\n } // mouse already handled\n\n\n e.preventDefault();\n addPointer(e);\n addTouchesToEvent(e);\n touchstartHandler(e);\n });\n r.registerBinding(r.container, 'pointerup', function (e) {\n if (pointerIsMouse(e)) {\n return;\n } // mouse already handled\n\n\n removePointer(e);\n addTouchesToEvent(e);\n touchendHandler(e);\n });\n r.registerBinding(r.container, 'pointercancel', function (e) {\n if (pointerIsMouse(e)) {\n return;\n } // mouse already handled\n\n\n removePointer(e);\n addTouchesToEvent(e);\n touchcancelHandler(e);\n });\n r.registerBinding(r.container, 'pointermove', function (e) {\n if (pointerIsMouse(e)) {\n return;\n } // mouse already handled\n\n\n e.preventDefault();\n updatePointer(e);\n addTouchesToEvent(e);\n touchmoveHandler(e);\n });\n }\n};\n\nvar BRp$d = {};\n\nBRp$d.generatePolygon = function (name, points) {\n return this.nodeShapes[name] = {\n renderer: this,\n name: name,\n points: points,\n draw: function draw(context, centerX, centerY, width, height) {\n this.renderer.nodeShapeImpl('polygon', context, centerX, centerY, width, height, this.points);\n },\n intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) {\n return polygonIntersectLine(x, y, this.points, nodeX, nodeY, width / 2, height / 2, padding);\n },\n checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) {\n return pointInsidePolygon(x, y, this.points, centerX, centerY, width, height, [0, -1], padding);\n }\n };\n};\n\nBRp$d.generateEllipse = function () {\n return this.nodeShapes['ellipse'] = {\n renderer: this,\n name: 'ellipse',\n draw: function draw(context, centerX, centerY, width, height) {\n this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height);\n },\n intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) {\n return intersectLineEllipse(x, y, nodeX, nodeY, width / 2 + padding, height / 2 + padding);\n },\n checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) {\n return checkInEllipse(x, y, width, height, centerX, centerY, padding);\n }\n };\n};\n\nBRp$d.generateRoundPolygon = function (name, points) {\n // Pre-compute control points\n // Since these points depend on the radius length (which in turns depend on the width/height of the node) we will only pre-compute\n // the unit vectors.\n // For simplicity the layout will be:\n // [ p0, UnitVectorP0P1, p1, UniVectorP1P2, ..., pn, UnitVectorPnP0 ]\n var allPoints = new Array(points.length * 2);\n\n for (var i = 0; i < points.length / 2; i++) {\n var sourceIndex = i * 2;\n var destIndex = void 0;\n\n if (i < points.length / 2 - 1) {\n destIndex = (i + 1) * 2;\n } else {\n destIndex = 0;\n }\n\n allPoints[i * 4] = points[sourceIndex];\n allPoints[i * 4 + 1] = points[sourceIndex + 1];\n var xDest = points[destIndex] - points[sourceIndex];\n var yDest = points[destIndex + 1] - points[sourceIndex + 1];\n var norm = Math.sqrt(xDest * xDest + yDest * yDest);\n allPoints[i * 4 + 2] = xDest / norm;\n allPoints[i * 4 + 3] = yDest / norm;\n }\n\n return this.nodeShapes[name] = {\n renderer: this,\n name: name,\n points: allPoints,\n draw: function draw(context, centerX, centerY, width, height) {\n this.renderer.nodeShapeImpl('round-polygon', context, centerX, centerY, width, height, this.points);\n },\n intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) {\n return roundPolygonIntersectLine(x, y, this.points, nodeX, nodeY, width, height);\n },\n checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) {\n return pointInsideRoundPolygon(x, y, this.points, centerX, centerY, width, height);\n }\n };\n};\n\nBRp$d.generateRoundRectangle = function () {\n return this.nodeShapes['round-rectangle'] = this.nodeShapes['roundrectangle'] = {\n renderer: this,\n name: 'round-rectangle',\n points: generateUnitNgonPointsFitToSquare(4, 0),\n draw: function draw(context, centerX, centerY, width, height) {\n this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height);\n },\n intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) {\n return roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding);\n },\n checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) {\n var cornerRadius = getRoundRectangleRadius(width, height);\n var diam = cornerRadius * 2; // Check hBox\n\n if (pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) {\n return true;\n } // Check vBox\n\n\n if (pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) {\n return true;\n } // Check top left quarter circle\n\n\n if (checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY - height / 2 + cornerRadius, padding)) {\n return true;\n } // Check top right quarter circle\n\n\n if (checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY - height / 2 + cornerRadius, padding)) {\n return true;\n } // Check bottom right quarter circle\n\n\n if (checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) {\n return true;\n } // Check bottom left quarter circle\n\n\n if (checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) {\n return true;\n }\n\n return false;\n }\n };\n};\n\nBRp$d.generateCutRectangle = function () {\n return this.nodeShapes['cut-rectangle'] = this.nodeShapes['cutrectangle'] = {\n renderer: this,\n name: 'cut-rectangle',\n cornerLength: getCutRectangleCornerLength(),\n points: generateUnitNgonPointsFitToSquare(4, 0),\n draw: function draw(context, centerX, centerY, width, height) {\n this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height);\n },\n generateCutTrianglePts: function generateCutTrianglePts(width, height, centerX, centerY) {\n var cl = this.cornerLength;\n var hh = height / 2;\n var hw = width / 2;\n var xBegin = centerX - hw;\n var xEnd = centerX + hw;\n var yBegin = centerY - hh;\n var yEnd = centerY + hh; // points are in clockwise order, inner (imaginary) triangle pt on [4, 5]\n\n return {\n topLeft: [xBegin, yBegin + cl, xBegin + cl, yBegin, xBegin + cl, yBegin + cl],\n topRight: [xEnd - cl, yBegin, xEnd, yBegin + cl, xEnd - cl, yBegin + cl],\n bottomRight: [xEnd, yEnd - cl, xEnd - cl, yEnd, xEnd - cl, yEnd - cl],\n bottomLeft: [xBegin + cl, yEnd, xBegin, yEnd - cl, xBegin + cl, yEnd - cl]\n };\n },\n intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) {\n var cPts = this.generateCutTrianglePts(width + 2 * padding, height + 2 * padding, nodeX, nodeY);\n var pts = [].concat.apply([], [cPts.topLeft.splice(0, 4), cPts.topRight.splice(0, 4), cPts.bottomRight.splice(0, 4), cPts.bottomLeft.splice(0, 4)]);\n return polygonIntersectLine(x, y, pts, nodeX, nodeY);\n },\n checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) {\n // Check hBox\n if (pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * this.cornerLength, [0, -1], padding)) {\n return true;\n } // Check vBox\n\n\n if (pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * this.cornerLength, height, [0, -1], padding)) {\n return true;\n }\n\n var cutTrianglePts = this.generateCutTrianglePts(width, height, centerX, centerY);\n return pointInsidePolygonPoints(x, y, cutTrianglePts.topLeft) || pointInsidePolygonPoints(x, y, cutTrianglePts.topRight) || pointInsidePolygonPoints(x, y, cutTrianglePts.bottomRight) || pointInsidePolygonPoints(x, y, cutTrianglePts.bottomLeft);\n }\n };\n};\n\nBRp$d.generateBarrel = function () {\n return this.nodeShapes['barrel'] = {\n renderer: this,\n name: 'barrel',\n points: generateUnitNgonPointsFitToSquare(4, 0),\n draw: function draw(context, centerX, centerY, width, height) {\n this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height);\n },\n intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) {\n // use two fixed t values for the bezier curve approximation\n var t0 = 0.15;\n var t1 = 0.5;\n var t2 = 0.85;\n var bPts = this.generateBarrelBezierPts(width + 2 * padding, height + 2 * padding, nodeX, nodeY);\n\n var approximateBarrelCurvePts = function approximateBarrelCurvePts(pts) {\n // approximate curve pts based on the two t values\n var m0 = qbezierPtAt({\n x: pts[0],\n y: pts[1]\n }, {\n x: pts[2],\n y: pts[3]\n }, {\n x: pts[4],\n y: pts[5]\n }, t0);\n var m1 = qbezierPtAt({\n x: pts[0],\n y: pts[1]\n }, {\n x: pts[2],\n y: pts[3]\n }, {\n x: pts[4],\n y: pts[5]\n }, t1);\n var m2 = qbezierPtAt({\n x: pts[0],\n y: pts[1]\n }, {\n x: pts[2],\n y: pts[3]\n }, {\n x: pts[4],\n y: pts[5]\n }, t2);\n return [pts[0], pts[1], m0.x, m0.y, m1.x, m1.y, m2.x, m2.y, pts[4], pts[5]];\n };\n\n var pts = [].concat(approximateBarrelCurvePts(bPts.topLeft), approximateBarrelCurvePts(bPts.topRight), approximateBarrelCurvePts(bPts.bottomRight), approximateBarrelCurvePts(bPts.bottomLeft));\n return polygonIntersectLine(x, y, pts, nodeX, nodeY);\n },\n generateBarrelBezierPts: function generateBarrelBezierPts(width, height, centerX, centerY) {\n var hh = height / 2;\n var hw = width / 2;\n var xBegin = centerX - hw;\n var xEnd = centerX + hw;\n var yBegin = centerY - hh;\n var yEnd = centerY + hh;\n var curveConstants = getBarrelCurveConstants(width, height);\n var hOffset = curveConstants.heightOffset;\n var wOffset = curveConstants.widthOffset;\n var ctrlPtXOffset = curveConstants.ctrlPtOffsetPct * width; // points are in clockwise order, inner (imaginary) control pt on [4, 5]\n\n var pts = {\n topLeft: [xBegin, yBegin + hOffset, xBegin + ctrlPtXOffset, yBegin, xBegin + wOffset, yBegin],\n topRight: [xEnd - wOffset, yBegin, xEnd - ctrlPtXOffset, yBegin, xEnd, yBegin + hOffset],\n bottomRight: [xEnd, yEnd - hOffset, xEnd - ctrlPtXOffset, yEnd, xEnd - wOffset, yEnd],\n bottomLeft: [xBegin + wOffset, yEnd, xBegin + ctrlPtXOffset, yEnd, xBegin, yEnd - hOffset]\n };\n pts.topLeft.isTop = true;\n pts.topRight.isTop = true;\n pts.bottomLeft.isBottom = true;\n pts.bottomRight.isBottom = true;\n return pts;\n },\n checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) {\n var curveConstants = getBarrelCurveConstants(width, height);\n var hOffset = curveConstants.heightOffset;\n var wOffset = curveConstants.widthOffset; // Check hBox\n\n if (pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - 2 * hOffset, [0, -1], padding)) {\n return true;\n } // Check vBox\n\n\n if (pointInsidePolygon(x, y, this.points, centerX, centerY, width - 2 * wOffset, height, [0, -1], padding)) {\n return true;\n }\n\n var barrelCurvePts = this.generateBarrelBezierPts(width, height, centerX, centerY);\n\n var getCurveT = function getCurveT(x, y, curvePts) {\n var x0 = curvePts[4];\n var x1 = curvePts[2];\n var x2 = curvePts[0];\n var y0 = curvePts[5]; // var y1 = curvePts[ 3 ];\n\n var y2 = curvePts[1];\n var xMin = Math.min(x0, x2);\n var xMax = Math.max(x0, x2);\n var yMin = Math.min(y0, y2);\n var yMax = Math.max(y0, y2);\n\n if (xMin <= x && x <= xMax && yMin <= y && y <= yMax) {\n var coeff = bezierPtsToQuadCoeff(x0, x1, x2);\n var roots = solveQuadratic(coeff[0], coeff[1], coeff[2], x);\n var validRoots = roots.filter(function (r) {\n return 0 <= r && r <= 1;\n });\n\n if (validRoots.length > 0) {\n return validRoots[0];\n }\n }\n\n return null;\n };\n\n var curveRegions = Object.keys(barrelCurvePts);\n\n for (var i = 0; i < curveRegions.length; i++) {\n var corner = curveRegions[i];\n var cornerPts = barrelCurvePts[corner];\n var t = getCurveT(x, y, cornerPts);\n\n if (t == null) {\n continue;\n }\n\n var y0 = cornerPts[5];\n var y1 = cornerPts[3];\n var y2 = cornerPts[1];\n var bezY = qbezierAt(y0, y1, y2, t);\n\n if (cornerPts.isTop && bezY <= y) {\n return true;\n }\n\n if (cornerPts.isBottom && y <= bezY) {\n return true;\n }\n }\n\n return false;\n }\n };\n};\n\nBRp$d.generateBottomRoundrectangle = function () {\n return this.nodeShapes['bottom-round-rectangle'] = this.nodeShapes['bottomroundrectangle'] = {\n renderer: this,\n name: 'bottom-round-rectangle',\n points: generateUnitNgonPointsFitToSquare(4, 0),\n draw: function draw(context, centerX, centerY, width, height) {\n this.renderer.nodeShapeImpl(this.name, context, centerX, centerY, width, height);\n },\n intersectLine: function intersectLine(nodeX, nodeY, width, height, x, y, padding) {\n var topStartX = nodeX - (width / 2 + padding);\n var topStartY = nodeY - (height / 2 + padding);\n var topEndY = topStartY;\n var topEndX = nodeX + (width / 2 + padding);\n var topIntersections = finiteLinesIntersect(x, y, nodeX, nodeY, topStartX, topStartY, topEndX, topEndY, false);\n\n if (topIntersections.length > 0) {\n return topIntersections;\n }\n\n return roundRectangleIntersectLine(x, y, nodeX, nodeY, width, height, padding);\n },\n checkPoint: function checkPoint(x, y, padding, width, height, centerX, centerY) {\n var cornerRadius = getRoundRectangleRadius(width, height);\n var diam = 2 * cornerRadius; // Check hBox\n\n if (pointInsidePolygon(x, y, this.points, centerX, centerY, width, height - diam, [0, -1], padding)) {\n return true;\n } // Check vBox\n\n\n if (pointInsidePolygon(x, y, this.points, centerX, centerY, width - diam, height, [0, -1], padding)) {\n return true;\n } // check non-rounded top side\n\n\n var outerWidth = width / 2 + 2 * padding;\n var outerHeight = height / 2 + 2 * padding;\n var points = [centerX - outerWidth, centerY - outerHeight, centerX - outerWidth, centerY, centerX + outerWidth, centerY, centerX + outerWidth, centerY - outerHeight];\n\n if (pointInsidePolygonPoints(x, y, points)) {\n return true;\n } // Check bottom right quarter circle\n\n\n if (checkInEllipse(x, y, diam, diam, centerX + width / 2 - cornerRadius, centerY + height / 2 - cornerRadius, padding)) {\n return true;\n } // Check bottom left quarter circle\n\n\n if (checkInEllipse(x, y, diam, diam, centerX - width / 2 + cornerRadius, centerY + height / 2 - cornerRadius, padding)) {\n return true;\n }\n\n return false;\n }\n };\n};\n\nBRp$d.registerNodeShapes = function () {\n var nodeShapes = this.nodeShapes = {};\n var renderer = this;\n this.generateEllipse();\n this.generatePolygon('triangle', generateUnitNgonPointsFitToSquare(3, 0));\n this.generateRoundPolygon('round-triangle', generateUnitNgonPointsFitToSquare(3, 0));\n this.generatePolygon('rectangle', generateUnitNgonPointsFitToSquare(4, 0));\n nodeShapes['square'] = nodeShapes['rectangle'];\n this.generateRoundRectangle();\n this.generateCutRectangle();\n this.generateBarrel();\n this.generateBottomRoundrectangle();\n {\n var diamondPoints = [0, 1, 1, 0, 0, -1, -1, 0];\n this.generatePolygon('diamond', diamondPoints);\n this.generateRoundPolygon('round-diamond', diamondPoints);\n }\n this.generatePolygon('pentagon', generateUnitNgonPointsFitToSquare(5, 0));\n this.generateRoundPolygon('round-pentagon', generateUnitNgonPointsFitToSquare(5, 0));\n this.generatePolygon('hexagon', generateUnitNgonPointsFitToSquare(6, 0));\n this.generateRoundPolygon('round-hexagon', generateUnitNgonPointsFitToSquare(6, 0));\n this.generatePolygon('heptagon', generateUnitNgonPointsFitToSquare(7, 0));\n this.generateRoundPolygon('round-heptagon', generateUnitNgonPointsFitToSquare(7, 0));\n this.generatePolygon('octagon', generateUnitNgonPointsFitToSquare(8, 0));\n this.generateRoundPolygon('round-octagon', generateUnitNgonPointsFitToSquare(8, 0));\n var star5Points = new Array(20);\n {\n var outerPoints = generateUnitNgonPoints(5, 0);\n var innerPoints = generateUnitNgonPoints(5, Math.PI / 5); // Outer radius is 1; inner radius of star is smaller\n\n var innerRadius = 0.5 * (3 - Math.sqrt(5));\n innerRadius *= 1.57;\n\n for (var i = 0; i < innerPoints.length / 2; i++) {\n innerPoints[i * 2] *= innerRadius;\n innerPoints[i * 2 + 1] *= innerRadius;\n }\n\n for (var i = 0; i < 20 / 4; i++) {\n star5Points[i * 4] = outerPoints[i * 2];\n star5Points[i * 4 + 1] = outerPoints[i * 2 + 1];\n star5Points[i * 4 + 2] = innerPoints[i * 2];\n star5Points[i * 4 + 3] = innerPoints[i * 2 + 1];\n }\n }\n star5Points = fitPolygonToSquare(star5Points);\n this.generatePolygon('star', star5Points);\n this.generatePolygon('vee', [-1, -1, 0, -0.333, 1, -1, 0, 1]);\n this.generatePolygon('rhomboid', [-1, -1, 0.333, -1, 1, 1, -0.333, 1]);\n this.nodeShapes['concavehexagon'] = this.generatePolygon('concave-hexagon', [-1, -0.95, -0.75, 0, -1, 0.95, 1, 0.95, 0.75, 0, 1, -0.95]);\n {\n var tagPoints = [-1, -1, 0.25, -1, 1, 0, 0.25, 1, -1, 1];\n this.generatePolygon('tag', tagPoints);\n this.generateRoundPolygon('round-tag', tagPoints);\n }\n\n nodeShapes.makePolygon = function (points) {\n // use caching on user-specified polygons so they are as fast as native shapes\n var key = points.join('$');\n var name = 'polygon-' + key;\n var shape;\n\n if (shape = this[name]) {\n // got cached shape\n return shape;\n } // create and cache new shape\n\n\n return renderer.generatePolygon(name, points);\n };\n};\n\nvar BRp$e = {};\n\nBRp$e.timeToRender = function () {\n return this.redrawTotalTime / this.redrawCount;\n};\n\nBRp$e.redraw = function (options) {\n options = options || staticEmptyObject();\n var r = this;\n\n if (r.averageRedrawTime === undefined) {\n r.averageRedrawTime = 0;\n }\n\n if (r.lastRedrawTime === undefined) {\n r.lastRedrawTime = 0;\n }\n\n if (r.lastDrawTime === undefined) {\n r.lastDrawTime = 0;\n }\n\n r.requestedFrame = true;\n r.renderOptions = options;\n};\n\nBRp$e.beforeRender = function (fn, priority) {\n // the renderer can't add tick callbacks when destroyed\n if (this.destroyed) {\n return;\n }\n\n if (priority == null) {\n error('Priority is not optional for beforeRender');\n }\n\n var cbs = this.beforeRenderCallbacks;\n cbs.push({\n fn: fn,\n priority: priority\n }); // higher priority callbacks executed first\n\n cbs.sort(function (a, b) {\n return b.priority - a.priority;\n });\n};\n\nvar beforeRenderCallbacks = function beforeRenderCallbacks(r, willDraw, startTime) {\n var cbs = r.beforeRenderCallbacks;\n\n for (var i = 0; i < cbs.length; i++) {\n cbs[i].fn(willDraw, startTime);\n }\n};\n\nBRp$e.startRenderLoop = function () {\n var r = this;\n var cy = r.cy;\n\n if (r.renderLoopStarted) {\n return;\n } else {\n r.renderLoopStarted = true;\n }\n\n var renderFn = function renderFn(requestTime) {\n if (r.destroyed) {\n return;\n }\n\n if (cy.batching()) ; else if (r.requestedFrame && !r.skipFrame) {\n beforeRenderCallbacks(r, true, requestTime);\n var startTime = performanceNow();\n r.render(r.renderOptions);\n var endTime = r.lastDrawTime = performanceNow();\n\n if (r.averageRedrawTime === undefined) {\n r.averageRedrawTime = endTime - startTime;\n }\n\n if (r.redrawCount === undefined) {\n r.redrawCount = 0;\n }\n\n r.redrawCount++;\n\n if (r.redrawTotalTime === undefined) {\n r.redrawTotalTime = 0;\n }\n\n var duration = endTime - startTime;\n r.redrawTotalTime += duration;\n r.lastRedrawTime = duration; // use a weighted average with a bias from the previous average so we don't spike so easily\n\n r.averageRedrawTime = r.averageRedrawTime / 2 + duration / 2;\n r.requestedFrame = false;\n } else {\n beforeRenderCallbacks(r, false, requestTime);\n }\n\n r.skipFrame = false;\n requestAnimationFrame(renderFn);\n };\n\n requestAnimationFrame(renderFn);\n};\n\nvar BaseRenderer = function BaseRenderer(options) {\n this.init(options);\n};\n\nvar BR = BaseRenderer;\nvar BRp$f = BR.prototype;\nBRp$f.clientFunctions = ['redrawHint', 'render', 'renderTo', 'matchCanvasSize', 'nodeShapeImpl', 'arrowShapeImpl'];\n\nBRp$f.init = function (options) {\n var r = this;\n r.options = options;\n r.cy = options.cy;\n var ctr = r.container = options.cy.container(); // prepend a stylesheet in the head such that\n\n if (window$1) {\n var document = window$1.document;\n var head = document.head;\n var stylesheetId = '__________cytoscape_stylesheet';\n var className = '__________cytoscape_container';\n var stylesheetAlreadyExists = document.getElementById(stylesheetId) != null;\n\n if (ctr.className.indexOf(className) < 0) {\n ctr.className = (ctr.className || '') + ' ' + className;\n }\n\n if (!stylesheetAlreadyExists) {\n var stylesheet = document.createElement('style');\n stylesheet.id = stylesheetId;\n stylesheet.innerHTML = '.' + className + ' { position: relative; }';\n head.insertBefore(stylesheet, head.children[0]); // first so lowest priority\n }\n\n var computedStyle = window$1.getComputedStyle(ctr);\n var position = computedStyle.getPropertyValue('position');\n\n if (position === 'static') {\n warn('A Cytoscape container has style position:static and so can not use UI extensions properly');\n }\n }\n\n r.selection = [undefined, undefined, undefined, undefined, 0]; // Coordinates for selection box, plus enabled flag\n\n r.bezierProjPcts = [0.05, 0.225, 0.4, 0.5, 0.6, 0.775, 0.95]; //--Pointer-related data\n\n r.hoverData = {\n down: null,\n last: null,\n downTime: null,\n triggerMode: null,\n dragging: false,\n initialPan: [null, null],\n capture: false\n };\n r.dragData = {\n possibleDragElements: []\n };\n r.touchData = {\n start: null,\n capture: false,\n // These 3 fields related to tap, taphold events\n startPosition: [null, null, null, null, null, null],\n singleTouchStartTime: null,\n singleTouchMoved: true,\n now: [null, null, null, null, null, null],\n earlier: [null, null, null, null, null, null]\n };\n r.redraws = 0;\n r.showFps = options.showFps;\n r.debug = options.debug;\n r.hideEdgesOnViewport = options.hideEdgesOnViewport;\n r.textureOnViewport = options.textureOnViewport;\n r.wheelSensitivity = options.wheelSensitivity;\n r.motionBlurEnabled = options.motionBlur; // on by default\n\n r.forcedPixelRatio = number(options.pixelRatio) ? options.pixelRatio : null;\n r.motionBlur = options.motionBlur; // for initial kick off\n\n r.motionBlurOpacity = options.motionBlurOpacity;\n r.motionBlurTransparency = 1 - r.motionBlurOpacity;\n r.motionBlurPxRatio = 1;\n r.mbPxRBlurry = 1; //0.8;\n\n r.minMbLowQualFrames = 4;\n r.fullQualityMb = false;\n r.clearedForMotionBlur = [];\n r.desktopTapThreshold = options.desktopTapThreshold;\n r.desktopTapThreshold2 = options.desktopTapThreshold * options.desktopTapThreshold;\n r.touchTapThreshold = options.touchTapThreshold;\n r.touchTapThreshold2 = options.touchTapThreshold * options.touchTapThreshold;\n r.tapholdDuration = 500;\n r.bindings = [];\n r.beforeRenderCallbacks = [];\n r.beforeRenderPriorities = {\n // higher priority execs before lower one\n animations: 400,\n eleCalcs: 300,\n eleTxrDeq: 200,\n lyrTxrDeq: 150,\n lyrTxrSkip: 100\n };\n r.registerNodeShapes();\n r.registerArrowShapes();\n r.registerCalculationListeners();\n};\n\nBRp$f.notify = function (eventName, eles) {\n var r = this;\n var cy = r.cy; // the renderer can't be notified after it's destroyed\n\n if (this.destroyed) {\n return;\n }\n\n if (eventName === 'init') {\n r.load();\n return;\n }\n\n if (eventName === 'destroy') {\n r.destroy();\n return;\n }\n\n if (eventName === 'add' || eventName === 'remove' || eventName === 'move' && cy.hasCompoundNodes() || eventName === 'load' || eventName === 'zorder' || eventName === 'mount') {\n r.invalidateCachedZSortedEles();\n }\n\n if (eventName === 'viewport') {\n r.redrawHint('select', true);\n }\n\n if (eventName === 'load' || eventName === 'resize' || eventName === 'mount') {\n r.invalidateContainerClientCoordsCache();\n r.matchCanvasSize(r.container);\n }\n\n r.redrawHint('eles', true);\n r.redrawHint('drag', true);\n this.startRenderLoop();\n this.redraw();\n};\n\nBRp$f.destroy = function () {\n var r = this;\n r.destroyed = true;\n r.cy.stopAnimationLoop();\n\n for (var i = 0; i < r.bindings.length; i++) {\n var binding = r.bindings[i];\n var b = binding;\n var tgt = b.target;\n (tgt.off || tgt.removeEventListener).apply(tgt, b.args);\n }\n\n r.bindings = [];\n r.beforeRenderCallbacks = [];\n r.onUpdateEleCalcsFns = [];\n\n if (r.removeObserver) {\n r.removeObserver.disconnect();\n }\n\n if (r.styleObserver) {\n r.styleObserver.disconnect();\n }\n\n if (r.resizeObserver) {\n r.resizeObserver.disconnect();\n }\n\n if (r.labelCalcDiv) {\n try {\n document.body.removeChild(r.labelCalcDiv); // eslint-disable-line no-undef\n } catch (e) {// ie10 issue #1014\n }\n }\n};\n\nBRp$f.isHeadless = function () {\n return false;\n};\n\n[BRp, BRp$a, BRp$b, BRp$c, BRp$d, BRp$e].forEach(function (props) {\n extend(BRp$f, props);\n});\n\nvar fullFpsTime = 1000 / 60; // assume 60 frames per second\n\nvar defs = {\n setupDequeueing: function setupDequeueing(opts) {\n return function setupDequeueingImpl() {\n var self = this;\n var r = this.renderer;\n\n if (self.dequeueingSetup) {\n return;\n } else {\n self.dequeueingSetup = true;\n }\n\n var queueRedraw = util(function () {\n r.redrawHint('eles', true);\n r.redrawHint('drag', true);\n r.redraw();\n }, opts.deqRedrawThreshold);\n\n var dequeue = function dequeue(willDraw, frameStartTime) {\n var startTime = performanceNow();\n var avgRenderTime = r.averageRedrawTime;\n var renderTime = r.lastRedrawTime;\n var deqd = [];\n var extent = r.cy.extent();\n var pixelRatio = r.getPixelRatio(); // if we aren't in a tick that causes a draw, then the rendered style\n // queue won't automatically be flushed before dequeueing starts\n\n if (!willDraw) {\n r.flushRenderedStyleQueue();\n }\n\n while (true) {\n // eslint-disable-line no-constant-condition\n var now = performanceNow();\n var duration = now - startTime;\n var frameDuration = now - frameStartTime;\n\n if (renderTime < fullFpsTime) {\n // if we're rendering faster than the ideal fps, then do dequeueing\n // during all of the remaining frame time\n var timeAvailable = fullFpsTime - (willDraw ? avgRenderTime : 0);\n\n if (frameDuration >= opts.deqFastCost * timeAvailable) {\n break;\n }\n } else {\n if (willDraw) {\n if (duration >= opts.deqCost * renderTime || duration >= opts.deqAvgCost * avgRenderTime) {\n break;\n }\n } else if (frameDuration >= opts.deqNoDrawCost * fullFpsTime) {\n break;\n }\n }\n\n var thisDeqd = opts.deq(self, pixelRatio, extent);\n\n if (thisDeqd.length > 0) {\n for (var i = 0; i < thisDeqd.length; i++) {\n deqd.push(thisDeqd[i]);\n }\n } else {\n break;\n }\n } // callbacks on dequeue\n\n\n if (deqd.length > 0) {\n opts.onDeqd(self, deqd);\n\n if (!willDraw && opts.shouldRedraw(self, deqd, pixelRatio, extent)) {\n queueRedraw();\n }\n }\n };\n\n var priority = opts.priority || noop;\n r.beforeRender(dequeue, priority(self));\n };\n }\n};\n\n// Uses keys so elements may share the same cache.\n\nvar ElementTextureCacheLookup =\n/*#__PURE__*/\nfunction () {\n function ElementTextureCacheLookup(getKey) {\n var doesEleInvalidateKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : falsify;\n\n _classCallCheck(this, ElementTextureCacheLookup);\n\n this.idsByKey = new Map$1();\n this.keyForId = new Map$1();\n this.cachesByLvl = new Map$1();\n this.lvls = [];\n this.getKey = getKey;\n this.doesEleInvalidateKey = doesEleInvalidateKey;\n }\n\n _createClass(ElementTextureCacheLookup, [{\n key: \"getIdsFor\",\n value: function getIdsFor(key) {\n if (key == null) {\n error(\"Can not get id list for null key\");\n }\n\n var idsByKey = this.idsByKey;\n var ids = this.idsByKey.get(key);\n\n if (!ids) {\n ids = new Set$1();\n idsByKey.set(key, ids);\n }\n\n return ids;\n }\n }, {\n key: \"addIdForKey\",\n value: function addIdForKey(key, id) {\n if (key != null) {\n this.getIdsFor(key).add(id);\n }\n }\n }, {\n key: \"deleteIdForKey\",\n value: function deleteIdForKey(key, id) {\n if (key != null) {\n this.getIdsFor(key)[\"delete\"](id);\n }\n }\n }, {\n key: \"getNumberOfIdsForKey\",\n value: function getNumberOfIdsForKey(key) {\n if (key == null) {\n return 0;\n } else {\n return this.getIdsFor(key).size;\n }\n }\n }, {\n key: \"updateKeyMappingFor\",\n value: function updateKeyMappingFor(ele) {\n var id = ele.id();\n var prevKey = this.keyForId.get(id);\n var currKey = this.getKey(ele);\n this.deleteIdForKey(prevKey, id);\n this.addIdForKey(currKey, id);\n this.keyForId.set(id, currKey);\n }\n }, {\n key: \"deleteKeyMappingFor\",\n value: function deleteKeyMappingFor(ele) {\n var id = ele.id();\n var prevKey = this.keyForId.get(id);\n this.deleteIdForKey(prevKey, id);\n this.keyForId[\"delete\"](id);\n }\n }, {\n key: \"keyHasChangedFor\",\n value: function keyHasChangedFor(ele) {\n var id = ele.id();\n var prevKey = this.keyForId.get(id);\n var newKey = this.getKey(ele);\n return prevKey !== newKey;\n }\n }, {\n key: \"isInvalid\",\n value: function isInvalid(ele) {\n return this.keyHasChangedFor(ele) || this.doesEleInvalidateKey(ele);\n }\n }, {\n key: \"getCachesAt\",\n value: function getCachesAt(lvl) {\n var cachesByLvl = this.cachesByLvl,\n lvls = this.lvls;\n var caches = cachesByLvl.get(lvl);\n\n if (!caches) {\n caches = new Map$1();\n cachesByLvl.set(lvl, caches);\n lvls.push(lvl);\n }\n\n return caches;\n }\n }, {\n key: \"getCache\",\n value: function getCache(key, lvl) {\n return this.getCachesAt(lvl).get(key);\n }\n }, {\n key: \"get\",\n value: function get(ele, lvl) {\n var key = this.getKey(ele);\n var cache = this.getCache(key, lvl); // getting for an element may need to add to the id list b/c eles can share keys\n\n if (cache != null) {\n this.updateKeyMappingFor(ele);\n }\n\n return cache;\n }\n }, {\n key: \"getForCachedKey\",\n value: function getForCachedKey(ele, lvl) {\n var key = this.keyForId.get(ele.id()); // n.b. use cached key, not newly computed key\n\n var cache = this.getCache(key, lvl);\n return cache;\n }\n }, {\n key: \"hasCache\",\n value: function hasCache(key, lvl) {\n return this.getCachesAt(lvl).has(key);\n }\n }, {\n key: \"has\",\n value: function has(ele, lvl) {\n var key = this.getKey(ele);\n return this.hasCache(key, lvl);\n }\n }, {\n key: \"setCache\",\n value: function setCache(key, lvl, cache) {\n cache.key = key;\n this.getCachesAt(lvl).set(key, cache);\n }\n }, {\n key: \"set\",\n value: function set(ele, lvl, cache) {\n var key = this.getKey(ele);\n this.setCache(key, lvl, cache);\n this.updateKeyMappingFor(ele);\n }\n }, {\n key: \"deleteCache\",\n value: function deleteCache(key, lvl) {\n this.getCachesAt(lvl)[\"delete\"](key);\n }\n }, {\n key: \"delete\",\n value: function _delete(ele, lvl) {\n var key = this.getKey(ele);\n this.deleteCache(key, lvl);\n }\n }, {\n key: \"invalidateKey\",\n value: function invalidateKey(key) {\n var _this = this;\n\n this.lvls.forEach(function (lvl) {\n return _this.deleteCache(key, lvl);\n });\n } // returns true if no other eles reference the invalidated cache (n.b. other eles may need the cache with the same key)\n\n }, {\n key: \"invalidate\",\n value: function invalidate(ele) {\n var id = ele.id();\n var key = this.keyForId.get(id); // n.b. use stored key rather than current (potential key)\n\n this.deleteKeyMappingFor(ele);\n var entireKeyInvalidated = this.doesEleInvalidateKey(ele);\n\n if (entireKeyInvalidated) {\n // clear mapping for current key\n this.invalidateKey(key);\n }\n\n return entireKeyInvalidated || this.getNumberOfIdsForKey(key) === 0;\n }\n }]);\n\n return ElementTextureCacheLookup;\n}();\n\nvar minTxrH = 25; // the size of the texture cache for small height eles (special case)\n\nvar txrStepH = 50; // the min size of the regular cache, and the size it increases with each step up\n\nvar minLvl = -4; // when scaling smaller than that we don't need to re-render\n\nvar maxLvl = 3; // when larger than this scale just render directly (caching is not helpful)\n\nvar maxZoom = 7.99; // beyond this zoom level, layered textures are not used\n\nvar eleTxrSpacing = 8; // spacing between elements on textures to avoid blitting overlaps\n\nvar defTxrWidth = 1024; // default/minimum texture width\n\nvar maxTxrW = 1024; // the maximum width of a texture\n\nvar maxTxrH = 1024; // the maximum height of a texture\n\nvar minUtility = 0.2; // if usage of texture is less than this, it is retired\n\nvar maxFullness = 0.8; // fullness of texture after which queue removal is checked\n\nvar maxFullnessChecks = 10; // dequeued after this many checks\n\nvar deqCost = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame\n\nvar deqAvgCost = 0.1; // % of add'l rendering cost compared to average overall redraw time\n\nvar deqNoDrawCost = 0.9; // % of avg frame time that can be used for dequeueing when not drawing\n\nvar deqFastCost = 0.9; // % of frame time to be used when >60fps\n\nvar deqRedrawThreshold = 100; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile\n\nvar maxDeqSize = 1; // number of eles to dequeue and render at higher texture in each batch\n\nvar getTxrReasons = {\n dequeue: 'dequeue',\n downscale: 'downscale',\n highQuality: 'highQuality'\n};\nvar initDefaults = defaults({\n getKey: null,\n doesEleInvalidateKey: falsify,\n drawElement: null,\n getBoundingBox: null,\n getRotationPoint: null,\n getRotationOffset: null,\n isVisible: trueify,\n allowEdgeTxrCaching: true,\n allowParentTxrCaching: true\n});\n\nvar ElementTextureCache = function ElementTextureCache(renderer, initOptions) {\n var self = this;\n self.renderer = renderer;\n self.onDequeues = [];\n var opts = initDefaults(initOptions);\n extend(self, opts);\n self.lookup = new ElementTextureCacheLookup(opts.getKey, opts.doesEleInvalidateKey);\n self.setupDequeueing();\n};\n\nvar ETCp = ElementTextureCache.prototype;\nETCp.reasons = getTxrReasons; // the list of textures in which new subtextures for elements can be placed\n\nETCp.getTextureQueue = function (txrH) {\n var self = this;\n self.eleImgCaches = self.eleImgCaches || {};\n return self.eleImgCaches[txrH] = self.eleImgCaches[txrH] || [];\n}; // the list of usused textures which can be recycled (in use in texture queue)\n\n\nETCp.getRetiredTextureQueue = function (txrH) {\n var self = this;\n var rtxtrQs = self.eleImgCaches.retired = self.eleImgCaches.retired || {};\n var rtxtrQ = rtxtrQs[txrH] = rtxtrQs[txrH] || [];\n return rtxtrQ;\n}; // queue of element draw requests at different scale levels\n\n\nETCp.getElementQueue = function () {\n var self = this;\n var q = self.eleCacheQueue = self.eleCacheQueue || new Heap(function (a, b) {\n return b.reqs - a.reqs;\n });\n return q;\n}; // queue of element draw requests at different scale levels (element id lookup)\n\n\nETCp.getElementKeyToQueue = function () {\n var self = this;\n var k2q = self.eleKeyToCacheQueue = self.eleKeyToCacheQueue || {};\n return k2q;\n};\n\nETCp.getElement = function (ele, bb, pxRatio, lvl, reason) {\n var self = this;\n var r = this.renderer;\n var zoom = r.cy.zoom();\n var lookup = this.lookup;\n\n if (bb.w === 0 || bb.h === 0 || isNaN(bb.w) || isNaN(bb.h) || !ele.visible()) {\n return null;\n }\n\n if (!self.allowEdgeTxrCaching && ele.isEdge() || !self.allowParentTxrCaching && ele.isParent()) {\n return null;\n }\n\n if (lvl == null) {\n lvl = Math.ceil(log2(zoom * pxRatio));\n }\n\n if (lvl < minLvl) {\n lvl = minLvl;\n } else if (zoom >= maxZoom || lvl > maxLvl) {\n return null;\n }\n\n var scale = Math.pow(2, lvl);\n var eleScaledH = bb.h * scale;\n var eleScaledW = bb.w * scale;\n var scaledLabelShown = r.eleTextBiggerThanMin(ele, scale);\n\n if (!this.isVisible(ele, scaledLabelShown)) {\n return null;\n }\n\n var eleCache = lookup.get(ele, lvl); // if this get was on an unused/invalidated cache, then restore the texture usage metric\n\n if (eleCache && eleCache.invalidated) {\n eleCache.invalidated = false;\n eleCache.texture.invalidatedWidth -= eleCache.width;\n }\n\n if (eleCache) {\n return eleCache;\n }\n\n var txrH; // which texture height this ele belongs to\n\n if (eleScaledH <= minTxrH) {\n txrH = minTxrH;\n } else if (eleScaledH <= txrStepH) {\n txrH = txrStepH;\n } else {\n txrH = Math.ceil(eleScaledH / txrStepH) * txrStepH;\n }\n\n if (eleScaledH > maxTxrH || eleScaledW > maxTxrW) {\n return null; // caching large elements is not efficient\n }\n\n var txrQ = self.getTextureQueue(txrH); // first try the second last one in case it has space at the end\n\n var txr = txrQ[txrQ.length - 2];\n\n var addNewTxr = function addNewTxr() {\n return self.recycleTexture(txrH, eleScaledW) || self.addTexture(txrH, eleScaledW);\n }; // try the last one if there is no second last one\n\n\n if (!txr) {\n txr = txrQ[txrQ.length - 1];\n } // if the last one doesn't exist, we need a first one\n\n\n if (!txr) {\n txr = addNewTxr();\n } // if there's no room in the current texture, we need a new one\n\n\n if (txr.width - txr.usedWidth < eleScaledW) {\n txr = addNewTxr();\n }\n\n var scalableFrom = function scalableFrom(otherCache) {\n return otherCache && otherCache.scaledLabelShown === scaledLabelShown;\n };\n\n var deqing = reason && reason === getTxrReasons.dequeue;\n var highQualityReq = reason && reason === getTxrReasons.highQuality;\n var downscaleReq = reason && reason === getTxrReasons.downscale;\n var higherCache; // the nearest cache with a higher level\n\n for (var l = lvl + 1; l <= maxLvl; l++) {\n var c = lookup.get(ele, l);\n\n if (c) {\n higherCache = c;\n break;\n }\n }\n\n var oneUpCache = higherCache && higherCache.level === lvl + 1 ? higherCache : null;\n\n var downscale = function downscale() {\n txr.context.drawImage(oneUpCache.texture.canvas, oneUpCache.x, 0, oneUpCache.width, oneUpCache.height, txr.usedWidth, 0, eleScaledW, eleScaledH);\n }; // reset ele area in texture\n\n\n txr.context.setTransform(1, 0, 0, 1, 0, 0);\n txr.context.clearRect(txr.usedWidth, 0, eleScaledW, txrH);\n\n if (scalableFrom(oneUpCache)) {\n // then we can relatively cheaply rescale the existing image w/o rerendering\n downscale();\n } else if (scalableFrom(higherCache)) {\n // then use the higher cache for now and queue the next level down\n // to cheaply scale towards the smaller level\n if (highQualityReq) {\n for (var _l = higherCache.level; _l > lvl; _l--) {\n oneUpCache = self.getElement(ele, bb, pxRatio, _l, getTxrReasons.downscale);\n }\n\n downscale();\n } else {\n self.queueElement(ele, higherCache.level - 1);\n return higherCache;\n }\n } else {\n var lowerCache; // the nearest cache with a lower level\n\n if (!deqing && !highQualityReq && !downscaleReq) {\n for (var _l2 = lvl - 1; _l2 >= minLvl; _l2--) {\n var _c = lookup.get(ele, _l2);\n\n if (_c) {\n lowerCache = _c;\n break;\n }\n }\n }\n\n if (scalableFrom(lowerCache)) {\n // then use the lower quality cache for now and queue the better one for later\n self.queueElement(ele, lvl);\n return lowerCache;\n }\n\n txr.context.translate(txr.usedWidth, 0);\n txr.context.scale(scale, scale);\n this.drawElement(txr.context, ele, bb, scaledLabelShown, false);\n txr.context.scale(1 / scale, 1 / scale);\n txr.context.translate(-txr.usedWidth, 0);\n }\n\n eleCache = {\n x: txr.usedWidth,\n texture: txr,\n level: lvl,\n scale: scale,\n width: eleScaledW,\n height: eleScaledH,\n scaledLabelShown: scaledLabelShown\n };\n txr.usedWidth += Math.ceil(eleScaledW + eleTxrSpacing);\n txr.eleCaches.push(eleCache);\n lookup.set(ele, lvl, eleCache);\n self.checkTextureFullness(txr);\n return eleCache;\n};\n\nETCp.invalidateElements = function (eles) {\n for (var i = 0; i < eles.length; i++) {\n this.invalidateElement(eles[i]);\n }\n};\n\nETCp.invalidateElement = function (ele) {\n var self = this;\n var lookup = self.lookup;\n var caches = [];\n var invalid = lookup.isInvalid(ele);\n\n if (!invalid) {\n return; // override the invalidation request if the element key has not changed\n }\n\n for (var lvl = minLvl; lvl <= maxLvl; lvl++) {\n var cache = lookup.getForCachedKey(ele, lvl);\n\n if (cache) {\n caches.push(cache);\n }\n }\n\n var noOtherElesUseCache = lookup.invalidate(ele);\n\n if (noOtherElesUseCache) {\n for (var i = 0; i < caches.length; i++) {\n var _cache = caches[i];\n var txr = _cache.texture; // remove space from the texture it belongs to\n\n txr.invalidatedWidth += _cache.width; // mark the cache as invalidated\n\n _cache.invalidated = true; // retire the texture if its utility is low\n\n self.checkTextureUtility(txr);\n }\n } // remove from queue since the old req was for the old state\n\n\n self.removeFromQueue(ele);\n};\n\nETCp.checkTextureUtility = function (txr) {\n // invalidate all entries in the cache if the cache size is small\n if (txr.invalidatedWidth >= minUtility * txr.width) {\n this.retireTexture(txr);\n }\n};\n\nETCp.checkTextureFullness = function (txr) {\n // if texture has been mostly filled and passed over several times, remove\n // it from the queue so we don't need to waste time looking at it to put new things\n var self = this;\n var txrQ = self.getTextureQueue(txr.height);\n\n if (txr.usedWidth / txr.width > maxFullness && txr.fullnessChecks >= maxFullnessChecks) {\n removeFromArray(txrQ, txr);\n } else {\n txr.fullnessChecks++;\n }\n};\n\nETCp.retireTexture = function (txr) {\n var self = this;\n var txrH = txr.height;\n var txrQ = self.getTextureQueue(txrH);\n var lookup = this.lookup; // retire the texture from the active / searchable queue:\n\n removeFromArray(txrQ, txr);\n txr.retired = true; // remove the refs from the eles to the caches:\n\n var eleCaches = txr.eleCaches;\n\n for (var i = 0; i < eleCaches.length; i++) {\n var eleCache = eleCaches[i];\n lookup.deleteCache(eleCache.key, eleCache.level);\n }\n\n clearArray(eleCaches); // add the texture to a retired queue so it can be recycled in future:\n\n var rtxtrQ = self.getRetiredTextureQueue(txrH);\n rtxtrQ.push(txr);\n};\n\nETCp.addTexture = function (txrH, minW) {\n var self = this;\n var txrQ = self.getTextureQueue(txrH);\n var txr = {};\n txrQ.push(txr);\n txr.eleCaches = [];\n txr.height = txrH;\n txr.width = Math.max(defTxrWidth, minW);\n txr.usedWidth = 0;\n txr.invalidatedWidth = 0;\n txr.fullnessChecks = 0;\n txr.canvas = self.renderer.makeOffscreenCanvas(txr.width, txr.height);\n txr.context = txr.canvas.getContext('2d');\n return txr;\n};\n\nETCp.recycleTexture = function (txrH, minW) {\n var self = this;\n var txrQ = self.getTextureQueue(txrH);\n var rtxtrQ = self.getRetiredTextureQueue(txrH);\n\n for (var i = 0; i < rtxtrQ.length; i++) {\n var txr = rtxtrQ[i];\n\n if (txr.width >= minW) {\n txr.retired = false;\n txr.usedWidth = 0;\n txr.invalidatedWidth = 0;\n txr.fullnessChecks = 0;\n clearArray(txr.eleCaches);\n txr.context.setTransform(1, 0, 0, 1, 0, 0);\n txr.context.clearRect(0, 0, txr.width, txr.height);\n removeFromArray(rtxtrQ, txr);\n txrQ.push(txr);\n return txr;\n }\n }\n};\n\nETCp.queueElement = function (ele, lvl) {\n var self = this;\n var q = self.getElementQueue();\n var k2q = self.getElementKeyToQueue();\n var key = this.getKey(ele);\n var existingReq = k2q[key];\n\n if (existingReq) {\n // use the max lvl b/c in between lvls are cheap to make\n existingReq.level = Math.max(existingReq.level, lvl);\n existingReq.eles.merge(ele);\n existingReq.reqs++;\n q.updateItem(existingReq);\n } else {\n var req = {\n eles: ele.spawn().merge(ele),\n level: lvl,\n reqs: 1,\n key: key\n };\n q.push(req);\n k2q[key] = req;\n }\n};\n\nETCp.dequeue = function (pxRatio\n/*, extent*/\n) {\n var self = this;\n var q = self.getElementQueue();\n var k2q = self.getElementKeyToQueue();\n var dequeued = [];\n var lookup = self.lookup;\n\n for (var i = 0; i < maxDeqSize; i++) {\n if (q.size() > 0) {\n var req = q.pop();\n var key = req.key;\n var ele = req.eles[0]; // all eles have the same key\n\n var cacheExists = lookup.hasCache(ele, req.level); // clear out the key to req lookup\n\n k2q[key] = null; // dequeueing isn't necessary with an existing cache\n\n if (cacheExists) {\n continue;\n }\n\n dequeued.push(req);\n var bb = self.getBoundingBox(ele);\n self.getElement(ele, bb, pxRatio, req.level, getTxrReasons.dequeue);\n } else {\n break;\n }\n }\n\n return dequeued;\n};\n\nETCp.removeFromQueue = function (ele) {\n var self = this;\n var q = self.getElementQueue();\n var k2q = self.getElementKeyToQueue();\n var key = this.getKey(ele);\n var req = k2q[key];\n\n if (req != null) {\n if (req.eles.length === 1) {\n // remove if last ele in the req\n // bring to front of queue\n req.reqs = MAX_INT;\n q.updateItem(req);\n q.pop(); // remove from queue\n\n k2q[key] = null; // remove from lookup map\n } else {\n // otherwise just remove ele from req\n req.eles.unmerge(ele);\n }\n }\n};\n\nETCp.onDequeue = function (fn) {\n this.onDequeues.push(fn);\n};\n\nETCp.offDequeue = function (fn) {\n removeFromArray(this.onDequeues, fn);\n};\n\nETCp.setupDequeueing = defs.setupDequeueing({\n deqRedrawThreshold: deqRedrawThreshold,\n deqCost: deqCost,\n deqAvgCost: deqAvgCost,\n deqNoDrawCost: deqNoDrawCost,\n deqFastCost: deqFastCost,\n deq: function deq(self, pxRatio, extent) {\n return self.dequeue(pxRatio, extent);\n },\n onDeqd: function onDeqd(self, deqd) {\n for (var i = 0; i < self.onDequeues.length; i++) {\n var fn = self.onDequeues[i];\n fn(deqd);\n }\n },\n shouldRedraw: function shouldRedraw(self, deqd, pxRatio, extent) {\n for (var i = 0; i < deqd.length; i++) {\n var eles = deqd[i].eles;\n\n for (var j = 0; j < eles.length; j++) {\n var bb = eles[j].boundingBox();\n\n if (boundingBoxesIntersect(bb, extent)) {\n return true;\n }\n }\n }\n\n return false;\n },\n priority: function priority(self) {\n return self.renderer.beforeRenderPriorities.eleTxrDeq;\n }\n});\n\nvar defNumLayers = 1; // default number of layers to use\n\nvar minLvl$1 = -4; // when scaling smaller than that we don't need to re-render\n\nvar maxLvl$1 = 2; // when larger than this scale just render directly (caching is not helpful)\n\nvar maxZoom$1 = 3.99; // beyond this zoom level, layered textures are not used\n\nvar deqRedrawThreshold$1 = 50; // time to batch redraws together from dequeueing to allow more dequeueing calcs to happen in the meanwhile\n\nvar refineEleDebounceTime = 50; // time to debounce sharper ele texture updates\n\nvar deqCost$1 = 0.15; // % of add'l rendering cost allowed for dequeuing ele caches each frame\n\nvar deqAvgCost$1 = 0.1; // % of add'l rendering cost compared to average overall redraw time\n\nvar deqNoDrawCost$1 = 0.9; // % of avg frame time that can be used for dequeueing when not drawing\n\nvar deqFastCost$1 = 0.9; // % of frame time to be used when >60fps\n\nvar maxDeqSize$1 = 1; // number of eles to dequeue and render at higher texture in each batch\n\nvar invalidThreshold = 250; // time threshold for disabling b/c of invalidations\n\nvar maxLayerArea = 4000 * 4000; // layers can't be bigger than this\n\nvar useHighQualityEleTxrReqs = true; // whether to use high quality ele txr requests (generally faster and cheaper in the longterm)\n// var log = function(){ console.log.apply( console, arguments ); };\n\nvar LayeredTextureCache = function LayeredTextureCache(renderer) {\n var self = this;\n var r = self.renderer = renderer;\n var cy = r.cy;\n self.layersByLevel = {}; // e.g. 2 => [ layer1, layer2, ..., layerN ]\n\n self.firstGet = true;\n self.lastInvalidationTime = performanceNow() - 2 * invalidThreshold;\n self.skipping = false;\n self.eleTxrDeqs = cy.collection();\n self.scheduleElementRefinement = util(function () {\n self.refineElementTextures(self.eleTxrDeqs);\n self.eleTxrDeqs.unmerge(self.eleTxrDeqs);\n }, refineEleDebounceTime);\n r.beforeRender(function (willDraw, now) {\n if (now - self.lastInvalidationTime <= invalidThreshold) {\n self.skipping = true;\n } else {\n self.skipping = false;\n }\n }, r.beforeRenderPriorities.lyrTxrSkip);\n\n var qSort = function qSort(a, b) {\n return b.reqs - a.reqs;\n };\n\n self.layersQueue = new Heap(qSort);\n self.setupDequeueing();\n};\n\nvar LTCp = LayeredTextureCache.prototype;\nvar layerIdPool = 0;\nvar MAX_INT$1 = Math.pow(2, 53) - 1;\n\nLTCp.makeLayer = function (bb, lvl) {\n var scale = Math.pow(2, lvl);\n var w = Math.ceil(bb.w * scale);\n var h = Math.ceil(bb.h * scale);\n var canvas = this.renderer.makeOffscreenCanvas(w, h);\n var layer = {\n id: layerIdPool = ++layerIdPool % MAX_INT$1,\n bb: bb,\n level: lvl,\n width: w,\n height: h,\n canvas: canvas,\n context: canvas.getContext('2d'),\n eles: [],\n elesQueue: [],\n reqs: 0\n }; // log('make layer %s with w %s and h %s and lvl %s', layer.id, layer.width, layer.height, layer.level);\n\n var cxt = layer.context;\n var dx = -layer.bb.x1;\n var dy = -layer.bb.y1; // do the transform on creation to save cycles (it's the same for all eles)\n\n cxt.scale(scale, scale);\n cxt.translate(dx, dy);\n return layer;\n};\n\nLTCp.getLayers = function (eles, pxRatio, lvl) {\n var self = this;\n var r = self.renderer;\n var cy = r.cy;\n var zoom = cy.zoom();\n var firstGet = self.firstGet;\n self.firstGet = false; // log('--\\nget layers with %s eles', eles.length);\n //log eles.map(function(ele){ return ele.id() }) );\n\n if (lvl == null) {\n lvl = Math.ceil(log2(zoom * pxRatio));\n\n if (lvl < minLvl$1) {\n lvl = minLvl$1;\n } else if (zoom >= maxZoom$1 || lvl > maxLvl$1) {\n return null;\n }\n }\n\n self.validateLayersElesOrdering(lvl, eles);\n var layersByLvl = self.layersByLevel;\n var scale = Math.pow(2, lvl);\n var layers = layersByLvl[lvl] = layersByLvl[lvl] || [];\n var bb;\n var lvlComplete = self.levelIsComplete(lvl, eles);\n var tmpLayers;\n\n var checkTempLevels = function checkTempLevels() {\n var canUseAsTmpLvl = function canUseAsTmpLvl(l) {\n self.validateLayersElesOrdering(l, eles);\n\n if (self.levelIsComplete(l, eles)) {\n tmpLayers = layersByLvl[l];\n return true;\n }\n };\n\n var checkLvls = function checkLvls(dir) {\n if (tmpLayers) {\n return;\n }\n\n for (var l = lvl + dir; minLvl$1 <= l && l <= maxLvl$1; l += dir) {\n if (canUseAsTmpLvl(l)) {\n break;\n }\n }\n };\n\n checkLvls(+1);\n checkLvls(-1); // remove the invalid layers; they will be replaced as needed later in this function\n\n for (var i = layers.length - 1; i >= 0; i--) {\n var layer = layers[i];\n\n if (layer.invalid) {\n removeFromArray(layers, layer);\n }\n }\n };\n\n if (!lvlComplete) {\n // if the current level is incomplete, then use the closest, best quality layerset temporarily\n // and later queue the current layerset so we can get the proper quality level soon\n checkTempLevels();\n } else {\n // log('level complete, using existing layers\\n--');\n return layers;\n }\n\n var getBb = function getBb() {\n if (!bb) {\n bb = makeBoundingBox();\n\n for (var i = 0; i < eles.length; i++) {\n updateBoundingBox(bb, eles[i].boundingBox());\n }\n }\n\n return bb;\n };\n\n var makeLayer = function makeLayer(opts) {\n opts = opts || {};\n var after = opts.after;\n getBb();\n var area = bb.w * scale * (bb.h * scale);\n\n if (area > maxLayerArea) {\n return null;\n }\n\n var layer = self.makeLayer(bb, lvl);\n\n if (after != null) {\n var index = layers.indexOf(after) + 1;\n layers.splice(index, 0, layer);\n } else if (opts.insert === undefined || opts.insert) {\n // no after specified => first layer made so put at start\n layers.unshift(layer);\n } // if( tmpLayers ){\n //self.queueLayer( layer );\n // }\n\n\n return layer;\n };\n\n if (self.skipping && !firstGet) {\n // log('skip layers');\n return null;\n } // log('do layers');\n\n\n var layer = null;\n var maxElesPerLayer = eles.length / defNumLayers;\n var allowLazyQueueing = !firstGet;\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n var rs = ele._private.rscratch;\n var caches = rs.imgLayerCaches = rs.imgLayerCaches || {}; // log('look at ele', ele.id());\n\n var existingLayer = caches[lvl];\n\n if (existingLayer) {\n // reuse layer for later eles\n // log('reuse layer for', ele.id());\n layer = existingLayer;\n continue;\n }\n\n if (!layer || layer.eles.length >= maxElesPerLayer || !boundingBoxInBoundingBox(layer.bb, ele.boundingBox())) {\n // log('make new layer for ele %s', ele.id());\n layer = makeLayer({\n insert: true,\n after: layer\n }); // if now layer can be built then we can't use layers at this level\n\n if (!layer) {\n return null;\n } // log('new layer with id %s', layer.id);\n\n }\n\n if (tmpLayers || allowLazyQueueing) {\n // log('queue ele %s in layer %s', ele.id(), layer.id);\n self.queueLayer(layer, ele);\n } else {\n // log('draw ele %s in layer %s', ele.id(), layer.id);\n self.drawEleInLayer(layer, ele, lvl, pxRatio);\n }\n\n layer.eles.push(ele);\n caches[lvl] = layer;\n } // log('--');\n\n\n if (tmpLayers) {\n // then we only queued the current layerset and can't draw it yet\n return tmpLayers;\n }\n\n if (allowLazyQueueing) {\n // log('lazy queue level', lvl);\n return null;\n }\n\n return layers;\n}; // a layer may want to use an ele cache of a higher level to avoid blurriness\n// so the layer level might not equal the ele level\n\n\nLTCp.getEleLevelForLayerLevel = function (lvl, pxRatio) {\n return lvl;\n};\n\nLTCp.drawEleInLayer = function (layer, ele, lvl, pxRatio) {\n var self = this;\n var r = this.renderer;\n var context = layer.context;\n var bb = ele.boundingBox();\n\n if (bb.w === 0 || bb.h === 0 || !ele.visible()) {\n return;\n }\n\n lvl = self.getEleLevelForLayerLevel(lvl, pxRatio);\n\n {\n r.setImgSmoothing(context, false);\n }\n\n {\n r.drawCachedElement(context, ele, null, null, lvl, useHighQualityEleTxrReqs);\n }\n\n {\n r.setImgSmoothing(context, true);\n }\n};\n\nLTCp.levelIsComplete = function (lvl, eles) {\n var self = this;\n var layers = self.layersByLevel[lvl];\n\n if (!layers || layers.length === 0) {\n return false;\n }\n\n var numElesInLayers = 0;\n\n for (var i = 0; i < layers.length; i++) {\n var layer = layers[i]; // if there are any eles needed to be drawn yet, the level is not complete\n\n if (layer.reqs > 0) {\n return false;\n } // if the layer is invalid, the level is not complete\n\n\n if (layer.invalid) {\n return false;\n }\n\n numElesInLayers += layer.eles.length;\n } // we should have exactly the number of eles passed in to be complete\n\n\n if (numElesInLayers !== eles.length) {\n return false;\n }\n\n return true;\n};\n\nLTCp.validateLayersElesOrdering = function (lvl, eles) {\n var layers = this.layersByLevel[lvl];\n\n if (!layers) {\n return;\n } // if in a layer the eles are not in the same order, then the layer is invalid\n // (i.e. there is an ele in between the eles in the layer)\n\n\n for (var i = 0; i < layers.length; i++) {\n var layer = layers[i];\n var offset = -1; // find the offset\n\n for (var j = 0; j < eles.length; j++) {\n if (layer.eles[0] === eles[j]) {\n offset = j;\n break;\n }\n }\n\n if (offset < 0) {\n // then the layer has nonexistant elements and is invalid\n this.invalidateLayer(layer);\n continue;\n } // the eles in the layer must be in the same continuous order, else the layer is invalid\n\n\n var o = offset;\n\n for (var j = 0; j < layer.eles.length; j++) {\n if (layer.eles[j] !== eles[o + j]) {\n // log('invalidate based on ordering', layer.id);\n this.invalidateLayer(layer);\n break;\n }\n }\n }\n};\n\nLTCp.updateElementsInLayers = function (eles, update) {\n var self = this;\n var isEles = element(eles[0]); // collect udpated elements (cascaded from the layers) and update each\n // layer itself along the way\n\n for (var i = 0; i < eles.length; i++) {\n var req = isEles ? null : eles[i];\n var ele = isEles ? eles[i] : eles[i].ele;\n var rs = ele._private.rscratch;\n var caches = rs.imgLayerCaches = rs.imgLayerCaches || {};\n\n for (var l = minLvl$1; l <= maxLvl$1; l++) {\n var layer = caches[l];\n\n if (!layer) {\n continue;\n } // if update is a request from the ele cache, then it affects only\n // the matching level\n\n\n if (req && self.getEleLevelForLayerLevel(layer.level) !== req.level) {\n continue;\n }\n\n update(layer, ele, req);\n }\n }\n};\n\nLTCp.haveLayers = function () {\n var self = this;\n var haveLayers = false;\n\n for (var l = minLvl$1; l <= maxLvl$1; l++) {\n var layers = self.layersByLevel[l];\n\n if (layers && layers.length > 0) {\n haveLayers = true;\n break;\n }\n }\n\n return haveLayers;\n};\n\nLTCp.invalidateElements = function (eles) {\n var self = this;\n\n if (eles.length === 0) {\n return;\n }\n\n self.lastInvalidationTime = performanceNow(); // log('update invalidate layer time from eles');\n\n if (eles.length === 0 || !self.haveLayers()) {\n return;\n }\n\n self.updateElementsInLayers(eles, function invalAssocLayers(layer, ele, req) {\n self.invalidateLayer(layer);\n });\n};\n\nLTCp.invalidateLayer = function (layer) {\n // log('update invalidate layer time');\n this.lastInvalidationTime = performanceNow();\n\n if (layer.invalid) {\n return;\n } // save cycles\n\n\n var lvl = layer.level;\n var eles = layer.eles;\n var layers = this.layersByLevel[lvl]; // log('invalidate layer', layer.id );\n\n removeFromArray(layers, layer); // layer.eles = [];\n\n layer.elesQueue = [];\n layer.invalid = true;\n\n if (layer.replacement) {\n layer.replacement.invalid = true;\n }\n\n for (var i = 0; i < eles.length; i++) {\n var caches = eles[i]._private.rscratch.imgLayerCaches;\n\n if (caches) {\n caches[lvl] = null;\n }\n }\n};\n\nLTCp.refineElementTextures = function (eles) {\n var self = this; // log('refine', eles.length);\n\n self.updateElementsInLayers(eles, function refineEachEle(layer, ele, req) {\n var rLyr = layer.replacement;\n\n if (!rLyr) {\n rLyr = layer.replacement = self.makeLayer(layer.bb, layer.level);\n rLyr.replaces = layer;\n rLyr.eles = layer.eles; // log('make replacement layer %s for %s with level %s', rLyr.id, layer.id, rLyr.level);\n }\n\n if (!rLyr.reqs) {\n for (var i = 0; i < rLyr.eles.length; i++) {\n self.queueLayer(rLyr, rLyr.eles[i]);\n } // log('queue replacement layer refinement', rLyr.id);\n\n }\n });\n};\n\nLTCp.enqueueElementRefinement = function (ele) {\n\n this.eleTxrDeqs.merge(ele);\n this.scheduleElementRefinement();\n};\n\nLTCp.queueLayer = function (layer, ele) {\n var self = this;\n var q = self.layersQueue;\n var elesQ = layer.elesQueue;\n var hasId = elesQ.hasId = elesQ.hasId || {}; // if a layer is going to be replaced, queuing is a waste of time\n\n if (layer.replacement) {\n return;\n }\n\n if (ele) {\n if (hasId[ele.id()]) {\n return;\n }\n\n elesQ.push(ele);\n hasId[ele.id()] = true;\n }\n\n if (layer.reqs) {\n layer.reqs++;\n q.updateItem(layer);\n } else {\n layer.reqs = 1;\n q.push(layer);\n }\n};\n\nLTCp.dequeue = function (pxRatio) {\n var self = this;\n var q = self.layersQueue;\n var deqd = [];\n var eleDeqs = 0;\n\n while (eleDeqs < maxDeqSize$1) {\n if (q.size() === 0) {\n break;\n }\n\n var layer = q.peek(); // if a layer has been or will be replaced, then don't waste time with it\n\n if (layer.replacement) {\n // log('layer %s in queue skipped b/c it already has a replacement', layer.id);\n q.pop();\n continue;\n } // if this is a replacement layer that has been superceded, then forget it\n\n\n if (layer.replaces && layer !== layer.replaces.replacement) {\n // log('layer is no longer the most uptodate replacement; dequeued', layer.id)\n q.pop();\n continue;\n }\n\n if (layer.invalid) {\n // log('replacement layer %s is invalid; dequeued', layer.id);\n q.pop();\n continue;\n }\n\n var ele = layer.elesQueue.shift();\n\n if (ele) {\n // log('dequeue layer %s', layer.id);\n self.drawEleInLayer(layer, ele, layer.level, pxRatio);\n eleDeqs++;\n }\n\n if (deqd.length === 0) {\n // we need only one entry in deqd to queue redrawing etc\n deqd.push(true);\n } // if the layer has all its eles done, then remove from the queue\n\n\n if (layer.elesQueue.length === 0) {\n q.pop();\n layer.reqs = 0; // log('dequeue of layer %s complete', layer.id);\n // when a replacement layer is dequeued, it replaces the old layer in the level\n\n if (layer.replaces) {\n self.applyLayerReplacement(layer);\n }\n\n self.requestRedraw();\n }\n }\n\n return deqd;\n};\n\nLTCp.applyLayerReplacement = function (layer) {\n var self = this;\n var layersInLevel = self.layersByLevel[layer.level];\n var replaced = layer.replaces;\n var index = layersInLevel.indexOf(replaced); // if the replaced layer is not in the active list for the level, then replacing\n // refs would be a mistake (i.e. overwriting the true active layer)\n\n if (index < 0 || replaced.invalid) {\n // log('replacement layer would have no effect', layer.id);\n return;\n }\n\n layersInLevel[index] = layer; // replace level ref\n // replace refs in eles\n\n for (var i = 0; i < layer.eles.length; i++) {\n var _p = layer.eles[i]._private;\n var cache = _p.imgLayerCaches = _p.imgLayerCaches || {};\n\n if (cache) {\n cache[layer.level] = layer;\n }\n } // log('apply replacement layer %s over %s', layer.id, replaced.id);\n\n\n self.requestRedraw();\n};\n\nLTCp.requestRedraw = util(function () {\n var r = this.renderer;\n r.redrawHint('eles', true);\n r.redrawHint('drag', true);\n r.redraw();\n}, 100);\nLTCp.setupDequeueing = defs.setupDequeueing({\n deqRedrawThreshold: deqRedrawThreshold$1,\n deqCost: deqCost$1,\n deqAvgCost: deqAvgCost$1,\n deqNoDrawCost: deqNoDrawCost$1,\n deqFastCost: deqFastCost$1,\n deq: function deq(self, pxRatio) {\n return self.dequeue(pxRatio);\n },\n onDeqd: noop,\n shouldRedraw: trueify,\n priority: function priority(self) {\n return self.renderer.beforeRenderPriorities.lyrTxrDeq;\n }\n});\n\nvar CRp = {};\nvar impl;\n\nfunction polygon(context, points) {\n for (var i = 0; i < points.length; i++) {\n var pt = points[i];\n context.lineTo(pt.x, pt.y);\n }\n}\n\nfunction triangleBackcurve(context, points, controlPoint) {\n var firstPt;\n\n for (var i = 0; i < points.length; i++) {\n var pt = points[i];\n\n if (i === 0) {\n firstPt = pt;\n }\n\n context.lineTo(pt.x, pt.y);\n }\n\n context.quadraticCurveTo(controlPoint.x, controlPoint.y, firstPt.x, firstPt.y);\n}\n\nfunction triangleTee(context, trianglePoints, teePoints) {\n if (context.beginPath) {\n context.beginPath();\n }\n\n var triPts = trianglePoints;\n\n for (var i = 0; i < triPts.length; i++) {\n var pt = triPts[i];\n context.lineTo(pt.x, pt.y);\n }\n\n var teePts = teePoints;\n var firstTeePt = teePoints[0];\n context.moveTo(firstTeePt.x, firstTeePt.y);\n\n for (var i = 1; i < teePts.length; i++) {\n var pt = teePts[i];\n context.lineTo(pt.x, pt.y);\n }\n\n if (context.closePath) {\n context.closePath();\n }\n}\n\nfunction circleTriangle(context, trianglePoints, rx, ry, r) {\n if (context.beginPath) {\n context.beginPath();\n }\n\n context.arc(rx, ry, r, 0, Math.PI * 2, false);\n var triPts = trianglePoints;\n var firstTrPt = triPts[0];\n context.moveTo(firstTrPt.x, firstTrPt.y);\n\n for (var i = 0; i < triPts.length; i++) {\n var pt = triPts[i];\n context.lineTo(pt.x, pt.y);\n }\n\n if (context.closePath) {\n context.closePath();\n }\n}\n\nfunction circle(context, rx, ry, r) {\n context.arc(rx, ry, r, 0, Math.PI * 2, false);\n}\n\nCRp.arrowShapeImpl = function (name) {\n return (impl || (impl = {\n 'polygon': polygon,\n 'triangle-backcurve': triangleBackcurve,\n 'triangle-tee': triangleTee,\n 'circle-triangle': circleTriangle,\n 'triangle-cross': triangleTee,\n 'circle': circle\n }))[name];\n};\n\nvar CRp$1 = {};\n\nCRp$1.drawElement = function (context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity) {\n var r = this;\n\n if (ele.isNode()) {\n r.drawNode(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity);\n } else {\n r.drawEdge(context, ele, shiftToOriginWithBb, showLabel, showOverlay, showOpacity);\n }\n};\n\nCRp$1.drawElementOverlay = function (context, ele) {\n var r = this;\n\n if (ele.isNode()) {\n r.drawNodeOverlay(context, ele);\n } else {\n r.drawEdgeOverlay(context, ele);\n }\n};\n\nCRp$1.drawCachedElementPortion = function (context, ele, eleTxrCache, pxRatio, lvl, reason, getRotation, getOpacity) {\n var r = this;\n var bb = eleTxrCache.getBoundingBox(ele);\n\n if (bb.w === 0 || bb.h === 0) {\n return;\n } // ignore zero size case\n\n\n var eleCache = eleTxrCache.getElement(ele, bb, pxRatio, lvl, reason);\n\n if (eleCache != null) {\n var opacity = getOpacity(r, ele);\n\n if (opacity === 0) {\n return;\n }\n\n var theta = getRotation(r, ele);\n var x1 = bb.x1,\n y1 = bb.y1,\n w = bb.w,\n h = bb.h;\n var x, y, sx, sy, smooth;\n\n if (theta !== 0) {\n var rotPt = eleTxrCache.getRotationPoint(ele);\n sx = rotPt.x;\n sy = rotPt.y;\n context.translate(sx, sy);\n context.rotate(theta);\n smooth = r.getImgSmoothing(context);\n\n if (!smooth) {\n r.setImgSmoothing(context, true);\n }\n\n var off = eleTxrCache.getRotationOffset(ele);\n x = off.x;\n y = off.y;\n } else {\n x = x1;\n y = y1;\n }\n\n var oldGlobalAlpha;\n\n if (opacity !== 1) {\n oldGlobalAlpha = context.globalAlpha;\n context.globalAlpha = oldGlobalAlpha * opacity;\n }\n\n context.drawImage(eleCache.texture.canvas, eleCache.x, 0, eleCache.width, eleCache.height, x, y, w, h);\n\n if (opacity !== 1) {\n context.globalAlpha = oldGlobalAlpha;\n }\n\n if (theta !== 0) {\n context.rotate(-theta);\n context.translate(-sx, -sy);\n\n if (!smooth) {\n r.setImgSmoothing(context, false);\n }\n }\n } else {\n eleTxrCache.drawElement(context, ele); // direct draw fallback\n }\n};\n\nvar getZeroRotation = function getZeroRotation() {\n return 0;\n};\n\nvar getLabelRotation = function getLabelRotation(r, ele) {\n return r.getTextAngle(ele, null);\n};\n\nvar getSourceLabelRotation = function getSourceLabelRotation(r, ele) {\n return r.getTextAngle(ele, 'source');\n};\n\nvar getTargetLabelRotation = function getTargetLabelRotation(r, ele) {\n return r.getTextAngle(ele, 'target');\n};\n\nvar getOpacity = function getOpacity(r, ele) {\n return ele.effectiveOpacity();\n};\n\nvar getTextOpacity = function getTextOpacity(e, ele) {\n return ele.pstyle('text-opacity').pfValue * ele.effectiveOpacity();\n};\n\nCRp$1.drawCachedElement = function (context, ele, pxRatio, extent, lvl, requestHighQuality) {\n var r = this;\n var _r$data = r.data,\n eleTxrCache = _r$data.eleTxrCache,\n lblTxrCache = _r$data.lblTxrCache,\n slbTxrCache = _r$data.slbTxrCache,\n tlbTxrCache = _r$data.tlbTxrCache;\n var bb = ele.boundingBox();\n var reason = requestHighQuality === true ? eleTxrCache.reasons.highQuality : null;\n\n if (bb.w === 0 || bb.h === 0 || !ele.visible()) {\n return;\n }\n\n if (!extent || boundingBoxesIntersect(bb, extent)) {\n var isEdge = ele.isEdge();\n\n var badLine = ele.element()._private.rscratch.badLine;\n\n r.drawCachedElementPortion(context, ele, eleTxrCache, pxRatio, lvl, reason, getZeroRotation, getOpacity);\n\n if (!isEdge || !badLine) {\n r.drawCachedElementPortion(context, ele, lblTxrCache, pxRatio, lvl, reason, getLabelRotation, getTextOpacity);\n }\n\n if (isEdge && !badLine) {\n r.drawCachedElementPortion(context, ele, slbTxrCache, pxRatio, lvl, reason, getSourceLabelRotation, getTextOpacity);\n r.drawCachedElementPortion(context, ele, tlbTxrCache, pxRatio, lvl, reason, getTargetLabelRotation, getTextOpacity);\n }\n\n r.drawElementOverlay(context, ele);\n }\n};\n\nCRp$1.drawElements = function (context, eles) {\n var r = this;\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n r.drawElement(context, ele);\n }\n};\n\nCRp$1.drawCachedElements = function (context, eles, pxRatio, extent) {\n var r = this;\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n r.drawCachedElement(context, ele, pxRatio, extent);\n }\n};\n\nCRp$1.drawCachedNodes = function (context, eles, pxRatio, extent) {\n var r = this;\n\n for (var i = 0; i < eles.length; i++) {\n var ele = eles[i];\n\n if (!ele.isNode()) {\n continue;\n }\n\n r.drawCachedElement(context, ele, pxRatio, extent);\n }\n};\n\nCRp$1.drawLayeredElements = function (context, eles, pxRatio, extent) {\n var r = this;\n var layers = r.data.lyrTxrCache.getLayers(eles, pxRatio);\n\n if (layers) {\n for (var i = 0; i < layers.length; i++) {\n var layer = layers[i];\n var bb = layer.bb;\n\n if (bb.w === 0 || bb.h === 0) {\n continue;\n }\n\n context.drawImage(layer.canvas, bb.x1, bb.y1, bb.w, bb.h);\n }\n } else {\n // fall back on plain caching if no layers\n r.drawCachedElements(context, eles, pxRatio, extent);\n }\n};\n\n/* global Path2D */\nvar CRp$2 = {};\n\nCRp$2.drawEdge = function (context, edge, shiftToOriginWithBb) {\n var drawLabel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var shouldDrawOverlay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var shouldDrawOpacity = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n var r = this;\n var rs = edge._private.rscratch;\n\n if (shouldDrawOpacity && !edge.visible()) {\n return;\n } // if bezier ctrl pts can not be calculated, then die\n\n\n if (rs.badLine || rs.allpts == null || isNaN(rs.allpts[0])) {\n // isNaN in case edge is impossible and browser bugs (e.g. safari)\n return;\n }\n\n var bb;\n\n if (shiftToOriginWithBb) {\n bb = shiftToOriginWithBb;\n context.translate(-bb.x1, -bb.y1);\n }\n\n var opacity = shouldDrawOpacity ? edge.pstyle('opacity').value : 1;\n var lineStyle = edge.pstyle('line-style').value;\n var edgeWidth = edge.pstyle('width').pfValue;\n var lineCap = edge.pstyle('line-cap').value;\n\n var drawLine = function drawLine() {\n var strokeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity;\n context.lineWidth = edgeWidth;\n context.lineCap = lineCap;\n r.eleStrokeStyle(context, edge, strokeOpacity);\n r.drawEdgePath(edge, context, rs.allpts, lineStyle);\n context.lineCap = 'butt'; // reset for other drawing functions\n };\n\n var drawOverlay = function drawOverlay() {\n if (!shouldDrawOverlay) {\n return;\n }\n\n r.drawEdgeOverlay(context, edge);\n };\n\n var drawArrows = function drawArrows() {\n var arrowOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : opacity;\n r.drawArrowheads(context, edge, arrowOpacity);\n };\n\n var drawText = function drawText() {\n r.drawElementText(context, edge, null, drawLabel);\n };\n\n context.lineJoin = 'round';\n var ghost = edge.pstyle('ghost').value === 'yes';\n\n if (ghost) {\n var gx = edge.pstyle('ghost-offset-x').pfValue;\n var gy = edge.pstyle('ghost-offset-y').pfValue;\n var ghostOpacity = edge.pstyle('ghost-opacity').value;\n var effectiveGhostOpacity = opacity * ghostOpacity;\n context.translate(gx, gy);\n drawLine(effectiveGhostOpacity);\n drawArrows(effectiveGhostOpacity);\n context.translate(-gx, -gy);\n }\n\n drawLine();\n drawArrows();\n drawOverlay();\n drawText();\n\n if (shiftToOriginWithBb) {\n context.translate(bb.x1, bb.y1);\n }\n};\n\nCRp$2.drawEdgeOverlay = function (context, edge) {\n if (!edge.visible()) {\n return;\n }\n\n var overlayOpacity = edge.pstyle('overlay-opacity').value;\n\n if (overlayOpacity === 0) {\n return;\n }\n\n var r = this;\n var usePaths = r.usePaths();\n var rs = edge._private.rscratch;\n var overlayPadding = edge.pstyle('overlay-padding').pfValue;\n var overlayWidth = 2 * overlayPadding;\n var overlayColor = edge.pstyle('overlay-color').value;\n context.lineWidth = overlayWidth;\n\n if (rs.edgeType === 'self' && !usePaths) {\n context.lineCap = 'butt';\n } else {\n context.lineCap = 'round';\n }\n\n r.colorStrokeStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], overlayOpacity);\n r.drawEdgePath(edge, context, rs.allpts, 'solid');\n};\n\nCRp$2.drawEdgePath = function (edge, context, pts, type) {\n var rs = edge._private.rscratch;\n var canvasCxt = context;\n var path;\n var pathCacheHit = false;\n var usePaths = this.usePaths();\n var lineDashPattern = edge.pstyle('line-dash-pattern').pfValue;\n var lineDashOffset = edge.pstyle('line-dash-offset').pfValue;\n\n if (usePaths) {\n var pathCacheKey = pts.join('$');\n var keyMatches = rs.pathCacheKey && rs.pathCacheKey === pathCacheKey;\n\n if (keyMatches) {\n path = context = rs.pathCache;\n pathCacheHit = true;\n } else {\n path = context = new Path2D();\n rs.pathCacheKey = pathCacheKey;\n rs.pathCache = path;\n }\n }\n\n if (canvasCxt.setLineDash) {\n // for very outofdate browsers\n switch (type) {\n case 'dotted':\n canvasCxt.setLineDash([1, 1]);\n break;\n\n case 'dashed':\n canvasCxt.setLineDash(lineDashPattern);\n canvasCxt.lineDashOffset = lineDashOffset;\n break;\n\n case 'solid':\n canvasCxt.setLineDash([]);\n break;\n }\n }\n\n if (!pathCacheHit && !rs.badLine) {\n if (context.beginPath) {\n context.beginPath();\n }\n\n context.moveTo(pts[0], pts[1]);\n\n switch (rs.edgeType) {\n case 'bezier':\n case 'self':\n case 'compound':\n case 'multibezier':\n for (var i = 2; i + 3 < pts.length; i += 4) {\n context.quadraticCurveTo(pts[i], pts[i + 1], pts[i + 2], pts[i + 3]);\n }\n\n break;\n\n case 'straight':\n case 'segments':\n case 'haystack':\n for (var _i = 2; _i + 1 < pts.length; _i += 2) {\n context.lineTo(pts[_i], pts[_i + 1]);\n }\n\n break;\n }\n }\n\n context = canvasCxt;\n\n if (usePaths) {\n context.stroke(path);\n } else {\n context.stroke();\n } // reset any line dashes\n\n\n if (context.setLineDash) {\n // for very outofdate browsers\n context.setLineDash([]);\n }\n};\n\nCRp$2.drawArrowheads = function (context, edge, opacity) {\n var rs = edge._private.rscratch;\n var isHaystack = rs.edgeType === 'haystack';\n\n if (!isHaystack) {\n this.drawArrowhead(context, edge, 'source', rs.arrowStartX, rs.arrowStartY, rs.srcArrowAngle, opacity);\n }\n\n this.drawArrowhead(context, edge, 'mid-target', rs.midX, rs.midY, rs.midtgtArrowAngle, opacity);\n this.drawArrowhead(context, edge, 'mid-source', rs.midX, rs.midY, rs.midsrcArrowAngle, opacity);\n\n if (!isHaystack) {\n this.drawArrowhead(context, edge, 'target', rs.arrowEndX, rs.arrowEndY, rs.tgtArrowAngle, opacity);\n }\n};\n\nCRp$2.drawArrowhead = function (context, edge, prefix, x, y, angle, opacity) {\n if (isNaN(x) || x == null || isNaN(y) || y == null || isNaN(angle) || angle == null) {\n return;\n }\n\n var self = this;\n var arrowShape = edge.pstyle(prefix + '-arrow-shape').value;\n\n if (arrowShape === 'none') {\n return;\n }\n\n var arrowClearFill = edge.pstyle(prefix + '-arrow-fill').value === 'hollow' ? 'both' : 'filled';\n var arrowFill = edge.pstyle(prefix + '-arrow-fill').value;\n var edgeWidth = edge.pstyle('width').pfValue;\n var edgeOpacity = edge.pstyle('opacity').value;\n\n if (opacity === undefined) {\n opacity = edgeOpacity;\n }\n\n var gco = context.globalCompositeOperation;\n\n if (opacity !== 1 || arrowFill === 'hollow') {\n // then extra clear is needed\n context.globalCompositeOperation = 'destination-out';\n self.colorFillStyle(context, 255, 255, 255, 1);\n self.colorStrokeStyle(context, 255, 255, 255, 1);\n self.drawArrowShape(edge, context, arrowClearFill, edgeWidth, arrowShape, x, y, angle);\n context.globalCompositeOperation = gco;\n } // otherwise, the opaque arrow clears it for free :)\n\n\n var color = edge.pstyle(prefix + '-arrow-color').value;\n self.colorFillStyle(context, color[0], color[1], color[2], opacity);\n self.colorStrokeStyle(context, color[0], color[1], color[2], opacity);\n self.drawArrowShape(edge, context, arrowFill, edgeWidth, arrowShape, x, y, angle);\n};\n\nCRp$2.drawArrowShape = function (edge, context, fill, edgeWidth, shape, x, y, angle) {\n var r = this;\n var usePaths = this.usePaths() && shape !== 'triangle-cross';\n var pathCacheHit = false;\n var path;\n var canvasContext = context;\n var translation = {\n x: x,\n y: y\n };\n var scale = edge.pstyle('arrow-scale').value;\n var size = this.getArrowWidth(edgeWidth, scale);\n var shapeImpl = r.arrowShapes[shape];\n\n if (usePaths) {\n var cache = r.arrowPathCache = r.arrowPathCache || [];\n var key = hashString(shape);\n var cachedPath = cache[key];\n\n if (cachedPath != null) {\n path = context = cachedPath;\n pathCacheHit = true;\n } else {\n path = context = new Path2D();\n cache[key] = path;\n }\n }\n\n if (!pathCacheHit) {\n if (context.beginPath) {\n context.beginPath();\n }\n\n if (usePaths) {\n // store in the path cache with values easily manipulated later\n shapeImpl.draw(context, 1, 0, {\n x: 0,\n y: 0\n }, 1);\n } else {\n shapeImpl.draw(context, size, angle, translation, edgeWidth);\n }\n\n if (context.closePath) {\n context.closePath();\n }\n }\n\n context = canvasContext;\n\n if (usePaths) {\n // set transform to arrow position/orientation\n context.translate(x, y);\n context.rotate(angle);\n context.scale(size, size);\n }\n\n if (fill === 'filled' || fill === 'both') {\n if (usePaths) {\n context.fill(path);\n } else {\n context.fill();\n }\n }\n\n if (fill === 'hollow' || fill === 'both') {\n context.lineWidth = (shapeImpl.matchEdgeWidth ? edgeWidth : 1) / (usePaths ? size : 1);\n context.lineJoin = 'miter';\n\n if (usePaths) {\n context.stroke(path);\n } else {\n context.stroke();\n }\n }\n\n if (usePaths) {\n // reset transform by applying inverse\n context.scale(1 / size, 1 / size);\n context.rotate(-angle);\n context.translate(-x, -y);\n }\n};\n\nvar CRp$3 = {};\n\nCRp$3.safeDrawImage = function (context, img, ix, iy, iw, ih, x, y, w, h) {\n // detect problematic cases for old browsers with bad images (cheaper than try-catch)\n if (iw <= 0 || ih <= 0 || w <= 0 || h <= 0) {\n return;\n }\n\n context.drawImage(img, ix, iy, iw, ih, x, y, w, h);\n};\n\nCRp$3.drawInscribedImage = function (context, img, node, index, nodeOpacity) {\n var r = this;\n var pos = node.position();\n var nodeX = pos.x;\n var nodeY = pos.y;\n var styleObj = node.cy().style();\n var getIndexedStyle = styleObj.getIndexedStyle.bind(styleObj);\n var fit = getIndexedStyle(node, 'background-fit', 'value', index);\n var repeat = getIndexedStyle(node, 'background-repeat', 'value', index);\n var nodeW = node.width();\n var nodeH = node.height();\n var paddingX2 = node.padding() * 2;\n var nodeTW = nodeW + (getIndexedStyle(node, 'background-width-relative-to', 'value', index) === 'inner' ? 0 : paddingX2);\n var nodeTH = nodeH + (getIndexedStyle(node, 'background-height-relative-to', 'value', index) === 'inner' ? 0 : paddingX2);\n var rs = node._private.rscratch;\n var clip = getIndexedStyle(node, 'background-clip', 'value', index);\n var shouldClip = clip === 'node';\n var imgOpacity = getIndexedStyle(node, 'background-image-opacity', 'value', index) * nodeOpacity;\n var imgW = img.width || img.cachedW;\n var imgH = img.height || img.cachedH; // workaround for broken browsers like ie\n\n if (null == imgW || null == imgH) {\n document.body.appendChild(img); // eslint-disable-line no-undef\n\n imgW = img.cachedW = img.width || img.offsetWidth;\n imgH = img.cachedH = img.height || img.offsetHeight;\n document.body.removeChild(img); // eslint-disable-line no-undef\n }\n\n var w = imgW;\n var h = imgH;\n\n if (getIndexedStyle(node, 'background-width', 'value', index) !== 'auto') {\n if (getIndexedStyle(node, 'background-width', 'units', index) === '%') {\n w = getIndexedStyle(node, 'background-width', 'pfValue', index) * nodeTW;\n } else {\n w = getIndexedStyle(node, 'background-width', 'pfValue', index);\n }\n }\n\n if (getIndexedStyle(node, 'background-height', 'value', index) !== 'auto') {\n if (getIndexedStyle(node, 'background-height', 'units', index) === '%') {\n h = getIndexedStyle(node, 'background-height', 'pfValue', index) * nodeTH;\n } else {\n h = getIndexedStyle(node, 'background-height', 'pfValue', index);\n }\n }\n\n if (w === 0 || h === 0) {\n return; // no point in drawing empty image (and chrome is broken in this case)\n }\n\n if (fit === 'contain') {\n var scale = Math.min(nodeTW / w, nodeTH / h);\n w *= scale;\n h *= scale;\n } else if (fit === 'cover') {\n var scale = Math.max(nodeTW / w, nodeTH / h);\n w *= scale;\n h *= scale;\n }\n\n var x = nodeX - nodeTW / 2; // left\n\n var posXUnits = getIndexedStyle(node, 'background-position-x', 'units', index);\n var posXPfVal = getIndexedStyle(node, 'background-position-x', 'pfValue', index);\n\n if (posXUnits === '%') {\n x += (nodeTW - w) * posXPfVal;\n } else {\n x += posXPfVal;\n }\n\n var offXUnits = getIndexedStyle(node, 'background-offset-x', 'units', index);\n var offXPfVal = getIndexedStyle(node, 'background-offset-x', 'pfValue', index);\n\n if (offXUnits === '%') {\n x += (nodeTW - w) * offXPfVal;\n } else {\n x += offXPfVal;\n }\n\n var y = nodeY - nodeTH / 2; // top\n\n var posYUnits = getIndexedStyle(node, 'background-position-y', 'units', index);\n var posYPfVal = getIndexedStyle(node, 'background-position-y', 'pfValue', index);\n\n if (posYUnits === '%') {\n y += (nodeTH - h) * posYPfVal;\n } else {\n y += posYPfVal;\n }\n\n var offYUnits = getIndexedStyle(node, 'background-offset-y', 'units', index);\n var offYPfVal = getIndexedStyle(node, 'background-offset-y', 'pfValue', index);\n\n if (offYUnits === '%') {\n y += (nodeTH - h) * offYPfVal;\n } else {\n y += offYPfVal;\n }\n\n if (rs.pathCache) {\n x -= nodeX;\n y -= nodeY;\n nodeX = 0;\n nodeY = 0;\n }\n\n var gAlpha = context.globalAlpha;\n context.globalAlpha = imgOpacity;\n\n if (repeat === 'no-repeat') {\n if (shouldClip) {\n context.save();\n\n if (rs.pathCache) {\n context.clip(rs.pathCache);\n } else {\n r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH);\n context.clip();\n }\n }\n\n r.safeDrawImage(context, img, 0, 0, imgW, imgH, x, y, w, h);\n\n if (shouldClip) {\n context.restore();\n }\n } else {\n var pattern = context.createPattern(img, repeat);\n context.fillStyle = pattern;\n r.nodeShapes[r.getNodeShape(node)].draw(context, nodeX, nodeY, nodeTW, nodeTH);\n context.translate(x, y);\n context.fill();\n context.translate(-x, -y);\n }\n\n context.globalAlpha = gAlpha;\n};\n\nvar CRp$4 = {};\n\nCRp$4.eleTextBiggerThanMin = function (ele, scale) {\n if (!scale) {\n var zoom = ele.cy().zoom();\n var pxRatio = this.getPixelRatio();\n var lvl = Math.ceil(log2(zoom * pxRatio)); // the effective texture level\n\n scale = Math.pow(2, lvl);\n }\n\n var computedSize = ele.pstyle('font-size').pfValue * scale;\n var minSize = ele.pstyle('min-zoomed-font-size').pfValue;\n\n if (computedSize < minSize) {\n return false;\n }\n\n return true;\n};\n\nCRp$4.drawElementText = function (context, ele, shiftToOriginWithBb, force, prefix) {\n var useEleOpacity = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n var r = this;\n\n if (force == null) {\n if (useEleOpacity && !r.eleTextBiggerThanMin(ele)) {\n return;\n }\n } else if (force === false) {\n return;\n }\n\n if (ele.isNode()) {\n var label = ele.pstyle('label');\n\n if (!label || !label.value) {\n return;\n }\n\n var justification = r.getLabelJustification(ele);\n context.textAlign = justification;\n context.textBaseline = 'bottom';\n } else {\n var badLine = ele.element()._private.rscratch.badLine;\n\n var _label = ele.pstyle('label');\n\n var srcLabel = ele.pstyle('source-label');\n var tgtLabel = ele.pstyle('target-label');\n\n if (badLine || (!_label || !_label.value) && (!srcLabel || !srcLabel.value) && (!tgtLabel || !tgtLabel.value)) {\n return;\n }\n\n context.textAlign = 'center';\n context.textBaseline = 'bottom';\n }\n\n var applyRotation = !shiftToOriginWithBb;\n var bb;\n\n if (shiftToOriginWithBb) {\n bb = shiftToOriginWithBb;\n context.translate(-bb.x1, -bb.y1);\n }\n\n if (prefix == null) {\n r.drawText(context, ele, null, applyRotation, useEleOpacity);\n\n if (ele.isEdge()) {\n r.drawText(context, ele, 'source', applyRotation, useEleOpacity);\n r.drawText(context, ele, 'target', applyRotation, useEleOpacity);\n }\n } else {\n r.drawText(context, ele, prefix, applyRotation, useEleOpacity);\n }\n\n if (shiftToOriginWithBb) {\n context.translate(bb.x1, bb.y1);\n }\n};\n\nCRp$4.getFontCache = function (context) {\n var cache;\n this.fontCaches = this.fontCaches || [];\n\n for (var i = 0; i < this.fontCaches.length; i++) {\n cache = this.fontCaches[i];\n\n if (cache.context === context) {\n return cache;\n }\n }\n\n cache = {\n context: context\n };\n this.fontCaches.push(cache);\n return cache;\n}; // set up canvas context with font\n// returns transformed text string\n\n\nCRp$4.setupTextStyle = function (context, ele) {\n var useEleOpacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n // Font style\n var labelStyle = ele.pstyle('font-style').strValue;\n var labelSize = ele.pstyle('font-size').pfValue + 'px';\n var labelFamily = ele.pstyle('font-family').strValue;\n var labelWeight = ele.pstyle('font-weight').strValue;\n var opacity = useEleOpacity ? ele.effectiveOpacity() * ele.pstyle('text-opacity').value : 1;\n var outlineOpacity = ele.pstyle('text-outline-opacity').value * opacity;\n var color = ele.pstyle('color').value;\n var outlineColor = ele.pstyle('text-outline-color').value;\n context.font = labelStyle + ' ' + labelWeight + ' ' + labelSize + ' ' + labelFamily;\n context.lineJoin = 'round'; // so text outlines aren't jagged\n\n this.colorFillStyle(context, color[0], color[1], color[2], opacity);\n this.colorStrokeStyle(context, outlineColor[0], outlineColor[1], outlineColor[2], outlineOpacity);\n}; // TODO ensure re-used\n\n\nfunction roundRect(ctx, x, y, width, height) {\n var radius = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 5;\n ctx.beginPath();\n ctx.moveTo(x + radius, y);\n ctx.lineTo(x + width - radius, y);\n ctx.quadraticCurveTo(x + width, y, x + width, y + radius);\n ctx.lineTo(x + width, y + height - radius);\n ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);\n ctx.lineTo(x + radius, y + height);\n ctx.quadraticCurveTo(x, y + height, x, y + height - radius);\n ctx.lineTo(x, y + radius);\n ctx.quadraticCurveTo(x, y, x + radius, y);\n ctx.closePath();\n ctx.fill();\n}\n\nCRp$4.getTextAngle = function (ele, prefix) {\n var theta;\n var _p = ele._private;\n var rscratch = _p.rscratch;\n var pdash = prefix ? prefix + '-' : '';\n var rotation = ele.pstyle(pdash + 'text-rotation');\n var textAngle = getPrefixedProperty(rscratch, 'labelAngle', prefix);\n\n if (rotation.strValue === 'autorotate') {\n theta = ele.isEdge() ? textAngle : 0;\n } else if (rotation.strValue === 'none') {\n theta = 0;\n } else {\n theta = rotation.pfValue;\n }\n\n return theta;\n};\n\nCRp$4.drawText = function (context, ele, prefix) {\n var applyRotation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var useEleOpacity = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var _p = ele._private;\n var rscratch = _p.rscratch;\n var parentOpacity = useEleOpacity ? ele.effectiveOpacity() : 1;\n\n if (useEleOpacity && (parentOpacity === 0 || ele.pstyle('text-opacity').value === 0)) {\n return;\n } // use 'main' as an alias for the main label (i.e. null prefix)\n\n\n if (prefix === 'main') {\n prefix = null;\n }\n\n var textX = getPrefixedProperty(rscratch, 'labelX', prefix);\n var textY = getPrefixedProperty(rscratch, 'labelY', prefix);\n var orgTextX, orgTextY; // used for rotation\n\n var text = this.getLabelText(ele, prefix);\n\n if (text != null && text !== '' && !isNaN(textX) && !isNaN(textY)) {\n this.setupTextStyle(context, ele, useEleOpacity);\n var pdash = prefix ? prefix + '-' : '';\n var textW = getPrefixedProperty(rscratch, 'labelWidth', prefix);\n var textH = getPrefixedProperty(rscratch, 'labelHeight', prefix);\n var marginX = ele.pstyle(pdash + 'text-margin-x').pfValue;\n var marginY = ele.pstyle(pdash + 'text-margin-y').pfValue;\n var isEdge = ele.isEdge();\n var halign = ele.pstyle('text-halign').value;\n var valign = ele.pstyle('text-valign').value;\n\n if (isEdge) {\n halign = 'center';\n valign = 'center';\n }\n\n textX += marginX;\n textY += marginY;\n var theta;\n\n if (!applyRotation) {\n theta = 0;\n } else {\n theta = this.getTextAngle(ele, prefix);\n }\n\n if (theta !== 0) {\n orgTextX = textX;\n orgTextY = textY;\n context.translate(orgTextX, orgTextY);\n context.rotate(theta);\n textX = 0;\n textY = 0;\n }\n\n switch (valign) {\n case 'top':\n break;\n\n case 'center':\n textY += textH / 2;\n break;\n\n case 'bottom':\n textY += textH;\n break;\n }\n\n var backgroundOpacity = ele.pstyle('text-background-opacity').value;\n var borderOpacity = ele.pstyle('text-border-opacity').value;\n var textBorderWidth = ele.pstyle('text-border-width').pfValue;\n var backgroundPadding = ele.pstyle('text-background-padding').pfValue;\n\n if (backgroundOpacity > 0 || textBorderWidth > 0 && borderOpacity > 0) {\n var bgX = textX - backgroundPadding;\n\n switch (halign) {\n case 'left':\n bgX -= textW;\n break;\n\n case 'center':\n bgX -= textW / 2;\n break;\n }\n\n var bgY = textY - textH - backgroundPadding;\n var bgW = textW + 2 * backgroundPadding;\n var bgH = textH + 2 * backgroundPadding;\n\n if (backgroundOpacity > 0) {\n var textFill = context.fillStyle;\n var textBackgroundColor = ele.pstyle('text-background-color').value;\n context.fillStyle = 'rgba(' + textBackgroundColor[0] + ',' + textBackgroundColor[1] + ',' + textBackgroundColor[2] + ',' + backgroundOpacity * parentOpacity + ')';\n var styleShape = ele.pstyle('text-background-shape').strValue;\n\n if (styleShape.indexOf('round') === 0) {\n roundRect(context, bgX, bgY, bgW, bgH, 2);\n } else {\n context.fillRect(bgX, bgY, bgW, bgH);\n }\n\n context.fillStyle = textFill;\n }\n\n if (textBorderWidth > 0 && borderOpacity > 0) {\n var textStroke = context.strokeStyle;\n var textLineWidth = context.lineWidth;\n var textBorderColor = ele.pstyle('text-border-color').value;\n var textBorderStyle = ele.pstyle('text-border-style').value;\n context.strokeStyle = 'rgba(' + textBorderColor[0] + ',' + textBorderColor[1] + ',' + textBorderColor[2] + ',' + borderOpacity * parentOpacity + ')';\n context.lineWidth = textBorderWidth;\n\n if (context.setLineDash) {\n // for very outofdate browsers\n switch (textBorderStyle) {\n case 'dotted':\n context.setLineDash([1, 1]);\n break;\n\n case 'dashed':\n context.setLineDash([4, 2]);\n break;\n\n case 'double':\n context.lineWidth = textBorderWidth / 4; // 50% reserved for white between the two borders\n\n context.setLineDash([]);\n break;\n\n case 'solid':\n context.setLineDash([]);\n break;\n }\n }\n\n context.strokeRect(bgX, bgY, bgW, bgH);\n\n if (textBorderStyle === 'double') {\n var whiteWidth = textBorderWidth / 2;\n context.strokeRect(bgX + whiteWidth, bgY + whiteWidth, bgW - whiteWidth * 2, bgH - whiteWidth * 2);\n }\n\n if (context.setLineDash) {\n // for very outofdate browsers\n context.setLineDash([]);\n }\n\n context.lineWidth = textLineWidth;\n context.strokeStyle = textStroke;\n }\n }\n\n var lineWidth = 2 * ele.pstyle('text-outline-width').pfValue; // *2 b/c the stroke is drawn centred on the middle\n\n if (lineWidth > 0) {\n context.lineWidth = lineWidth;\n }\n\n if (ele.pstyle('text-wrap').value === 'wrap') {\n var lines = getPrefixedProperty(rscratch, 'labelWrapCachedLines', prefix);\n var lineHeight = getPrefixedProperty(rscratch, 'labelLineHeight', prefix);\n var halfTextW = textW / 2;\n var justification = this.getLabelJustification(ele);\n\n if (justification === 'auto') ; else if (halign === 'left') {\n // auto justification : right\n if (justification === 'left') {\n textX += -textW;\n } else if (justification === 'center') {\n textX += -halfTextW;\n } // else same as auto\n\n } else if (halign === 'center') {\n // auto justfication : center\n if (justification === 'left') {\n textX += -halfTextW;\n } else if (justification === 'right') {\n textX += halfTextW;\n } // else same as auto\n\n } else if (halign === 'right') {\n // auto justification : left\n if (justification === 'center') {\n textX += halfTextW;\n } else if (justification === 'right') {\n textX += textW;\n } // else same as auto\n\n }\n\n switch (valign) {\n case 'top':\n textY -= (lines.length - 1) * lineHeight;\n break;\n\n case 'center':\n case 'bottom':\n textY -= (lines.length - 1) * lineHeight;\n break;\n }\n\n for (var l = 0; l < lines.length; l++) {\n if (lineWidth > 0) {\n context.strokeText(lines[l], textX, textY);\n }\n\n context.fillText(lines[l], textX, textY);\n textY += lineHeight;\n }\n } else {\n if (lineWidth > 0) {\n context.strokeText(text, textX, textY);\n }\n\n context.fillText(text, textX, textY);\n }\n\n if (theta !== 0) {\n context.rotate(-theta);\n context.translate(-orgTextX, -orgTextY);\n }\n }\n};\n\n/* global Path2D */\nvar CRp$5 = {};\n\nCRp$5.drawNode = function (context, node, shiftToOriginWithBb) {\n var drawLabel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n var shouldDrawOverlay = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var shouldDrawOpacity = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n var r = this;\n var nodeWidth, nodeHeight;\n var _p = node._private;\n var rs = _p.rscratch;\n var pos = node.position();\n\n if (!number(pos.x) || !number(pos.y)) {\n return; // can't draw node with undefined position\n }\n\n if (shouldDrawOpacity && !node.visible()) {\n return;\n }\n\n var eleOpacity = shouldDrawOpacity ? node.effectiveOpacity() : 1;\n var usePaths = r.usePaths();\n var path;\n var pathCacheHit = false;\n var padding = node.padding();\n nodeWidth = node.width() + 2 * padding;\n nodeHeight = node.height() + 2 * padding; //\n // setup shift\n\n var bb;\n\n if (shiftToOriginWithBb) {\n bb = shiftToOriginWithBb;\n context.translate(-bb.x1, -bb.y1);\n } //\n // load bg image\n\n\n var bgImgProp = node.pstyle('background-image');\n var urls = bgImgProp.value;\n var urlDefined = new Array(urls.length);\n var image = new Array(urls.length);\n var numImages = 0;\n\n for (var i = 0; i < urls.length; i++) {\n var url = urls[i];\n var defd = urlDefined[i] = url != null && url !== 'none';\n\n if (defd) {\n var bgImgCrossOrigin = node.cy().style().getIndexedStyle(node, 'background-image-crossorigin', 'value', i);\n numImages++; // get image, and if not loaded then ask to redraw when later loaded\n\n image[i] = r.getCachedImage(url, bgImgCrossOrigin, function () {\n _p.backgroundTimestamp = Date.now();\n node.emitAndNotify('background');\n });\n }\n } //\n // setup styles\n\n\n var darkness = node.pstyle('background-blacken').value;\n var borderWidth = node.pstyle('border-width').pfValue;\n var bgOpacity = node.pstyle('background-opacity').value * eleOpacity;\n var borderColor = node.pstyle('border-color').value;\n var borderStyle = node.pstyle('border-style').value;\n var borderOpacity = node.pstyle('border-opacity').value * eleOpacity;\n context.lineJoin = 'miter'; // so borders are square with the node shape\n\n var setupShapeColor = function setupShapeColor() {\n var bgOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : bgOpacity;\n r.eleFillStyle(context, node, bgOpy);\n };\n\n var setupBorderColor = function setupBorderColor() {\n var bdrOpy = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : borderOpacity;\n r.colorStrokeStyle(context, borderColor[0], borderColor[1], borderColor[2], bdrOpy);\n }; //\n // setup shape\n\n\n var styleShape = node.pstyle('shape').strValue;\n var shapePts = node.pstyle('shape-polygon-points').pfValue;\n\n if (usePaths) {\n context.translate(pos.x, pos.y);\n var pathCache = r.nodePathCache = r.nodePathCache || [];\n var key = hashStrings(styleShape === 'polygon' ? styleShape + ',' + shapePts.join(',') : styleShape, '' + nodeHeight, '' + nodeWidth);\n var cachedPath = pathCache[key];\n\n if (cachedPath != null) {\n path = cachedPath;\n pathCacheHit = true;\n rs.pathCache = path;\n } else {\n path = new Path2D();\n pathCache[key] = rs.pathCache = path;\n }\n }\n\n var drawShape = function drawShape() {\n if (!pathCacheHit) {\n var npos = pos;\n\n if (usePaths) {\n npos = {\n x: 0,\n y: 0\n };\n }\n\n r.nodeShapes[r.getNodeShape(node)].draw(path || context, npos.x, npos.y, nodeWidth, nodeHeight);\n }\n\n if (usePaths) {\n context.fill(path);\n } else {\n context.fill();\n }\n };\n\n var drawImages = function drawImages() {\n var nodeOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : eleOpacity;\n var prevBging = _p.backgrounding;\n var totalCompleted = 0;\n\n for (var _i = 0; _i < image.length; _i++) {\n if (urlDefined[_i] && image[_i].complete && !image[_i].error) {\n totalCompleted++;\n r.drawInscribedImage(context, image[_i], node, _i, nodeOpacity);\n }\n }\n\n _p.backgrounding = !(totalCompleted === numImages);\n\n if (prevBging !== _p.backgrounding) {\n // update style b/c :backgrounding state changed\n node.updateStyle(false);\n }\n };\n\n var drawPie = function drawPie() {\n var redrawShape = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var pieOpacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : eleOpacity;\n\n if (r.hasPie(node)) {\n r.drawPie(context, node, pieOpacity); // redraw/restore path if steps after pie need it\n\n if (redrawShape) {\n if (!usePaths) {\n r.nodeShapes[r.getNodeShape(node)].draw(context, pos.x, pos.y, nodeWidth, nodeHeight);\n }\n }\n }\n };\n\n var darken = function darken() {\n var darkenOpacity = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : eleOpacity;\n var opacity = (darkness > 0 ? darkness : -darkness) * darkenOpacity;\n var c = darkness > 0 ? 0 : 255;\n\n if (darkness !== 0) {\n r.colorFillStyle(context, c, c, c, opacity);\n\n if (usePaths) {\n context.fill(path);\n } else {\n context.fill();\n }\n }\n };\n\n var drawBorder = function drawBorder() {\n if (borderWidth > 0) {\n context.lineWidth = borderWidth;\n context.lineCap = 'butt';\n\n if (context.setLineDash) {\n // for very outofdate browsers\n switch (borderStyle) {\n case 'dotted':\n context.setLineDash([1, 1]);\n break;\n\n case 'dashed':\n context.setLineDash([4, 2]);\n break;\n\n case 'solid':\n case 'double':\n context.setLineDash([]);\n break;\n }\n }\n\n if (usePaths) {\n context.stroke(path);\n } else {\n context.stroke();\n }\n\n if (borderStyle === 'double') {\n context.lineWidth = borderWidth / 3;\n var gco = context.globalCompositeOperation;\n context.globalCompositeOperation = 'destination-out';\n\n if (usePaths) {\n context.stroke(path);\n } else {\n context.stroke();\n }\n\n context.globalCompositeOperation = gco;\n } // reset in case we changed the border style\n\n\n if (context.setLineDash) {\n // for very outofdate browsers\n context.setLineDash([]);\n }\n }\n };\n\n var drawOverlay = function drawOverlay() {\n if (shouldDrawOverlay) {\n r.drawNodeOverlay(context, node, pos, nodeWidth, nodeHeight);\n }\n };\n\n var drawText = function drawText() {\n r.drawElementText(context, node, null, drawLabel);\n };\n\n var ghost = node.pstyle('ghost').value === 'yes';\n\n if (ghost) {\n var gx = node.pstyle('ghost-offset-x').pfValue;\n var gy = node.pstyle('ghost-offset-y').pfValue;\n var ghostOpacity = node.pstyle('ghost-opacity').value;\n var effGhostOpacity = ghostOpacity * eleOpacity;\n context.translate(gx, gy);\n setupShapeColor(ghostOpacity * bgOpacity);\n drawShape();\n drawImages(effGhostOpacity);\n drawPie(darkness !== 0 || borderWidth !== 0);\n darken(effGhostOpacity);\n setupBorderColor(ghostOpacity * borderOpacity);\n drawBorder();\n context.translate(-gx, -gy);\n }\n\n setupShapeColor();\n drawShape();\n drawImages();\n drawPie(darkness !== 0 || borderWidth !== 0);\n darken();\n setupBorderColor();\n drawBorder();\n\n if (usePaths) {\n context.translate(-pos.x, -pos.y);\n }\n\n drawText();\n drawOverlay(); //\n // clean up shift\n\n if (shiftToOriginWithBb) {\n context.translate(bb.x1, bb.y1);\n }\n};\n\nCRp$5.drawNodeOverlay = function (context, node, pos, nodeWidth, nodeHeight) {\n var r = this;\n\n if (!node.visible()) {\n return;\n }\n\n var overlayPadding = node.pstyle('overlay-padding').pfValue;\n var overlayOpacity = node.pstyle('overlay-opacity').value;\n var overlayColor = node.pstyle('overlay-color').value;\n\n if (overlayOpacity > 0) {\n pos = pos || node.position();\n\n if (nodeWidth == null || nodeHeight == null) {\n var padding = node.padding();\n nodeWidth = node.width() + 2 * padding;\n nodeHeight = node.height() + 2 * padding;\n }\n\n r.colorFillStyle(context, overlayColor[0], overlayColor[1], overlayColor[2], overlayOpacity);\n r.nodeShapes['roundrectangle'].draw(context, pos.x, pos.y, nodeWidth + overlayPadding * 2, nodeHeight + overlayPadding * 2);\n context.fill();\n }\n}; // does the node have at least one pie piece?\n\n\nCRp$5.hasPie = function (node) {\n node = node[0]; // ensure ele ref\n\n return node._private.hasPie;\n};\n\nCRp$5.drawPie = function (context, node, nodeOpacity, pos) {\n node = node[0]; // ensure ele ref\n\n pos = pos || node.position();\n var cyStyle = node.cy().style();\n var pieSize = node.pstyle('pie-size');\n var x = pos.x;\n var y = pos.y;\n var nodeW = node.width();\n var nodeH = node.height();\n var radius = Math.min(nodeW, nodeH) / 2; // must fit in node\n\n var lastPercent = 0; // what % to continue drawing pie slices from on [0, 1]\n\n var usePaths = this.usePaths();\n\n if (usePaths) {\n x = 0;\n y = 0;\n }\n\n if (pieSize.units === '%') {\n radius = radius * pieSize.pfValue;\n } else if (pieSize.pfValue !== undefined) {\n radius = pieSize.pfValue / 2;\n }\n\n for (var i = 1; i <= cyStyle.pieBackgroundN; i++) {\n // 1..N\n var size = node.pstyle('pie-' + i + '-background-size').value;\n var color = node.pstyle('pie-' + i + '-background-color').value;\n var opacity = node.pstyle('pie-' + i + '-background-opacity').value * nodeOpacity;\n var percent = size / 100; // map integer range [0, 100] to [0, 1]\n // percent can't push beyond 1\n\n if (percent + lastPercent > 1) {\n percent = 1 - lastPercent;\n }\n\n var angleStart = 1.5 * Math.PI + 2 * Math.PI * lastPercent; // start at 12 o'clock and go clockwise\n\n var angleDelta = 2 * Math.PI * percent;\n var angleEnd = angleStart + angleDelta; // ignore if\n // - zero size\n // - we're already beyond the full circle\n // - adding the current slice would go beyond the full circle\n\n if (size === 0 || lastPercent >= 1 || lastPercent + percent > 1) {\n continue;\n }\n\n context.beginPath();\n context.moveTo(x, y);\n context.arc(x, y, radius, angleStart, angleEnd);\n context.closePath();\n this.colorFillStyle(context, color[0], color[1], color[2], opacity);\n context.fill();\n lastPercent += percent;\n }\n};\n\nvar CRp$6 = {};\nvar motionBlurDelay = 100; // var isFirefox = typeof InstallTrigger !== 'undefined';\n\nCRp$6.getPixelRatio = function () {\n var context = this.data.contexts[0];\n\n if (this.forcedPixelRatio != null) {\n return this.forcedPixelRatio;\n }\n\n var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;\n return (window.devicePixelRatio || 1) / backingStore; // eslint-disable-line no-undef\n};\n\nCRp$6.paintCache = function (context) {\n var caches = this.paintCaches = this.paintCaches || [];\n var needToCreateCache = true;\n var cache;\n\n for (var i = 0; i < caches.length; i++) {\n cache = caches[i];\n\n if (cache.context === context) {\n needToCreateCache = false;\n break;\n }\n }\n\n if (needToCreateCache) {\n cache = {\n context: context\n };\n caches.push(cache);\n }\n\n return cache;\n};\n\nCRp$6.createGradientStyleFor = function (context, shapeStyleName, ele, fill, opacity) {\n var gradientStyle;\n var usePaths = this.usePaths();\n var colors = ele.pstyle(shapeStyleName + '-gradient-stop-colors').value,\n positions = ele.pstyle(shapeStyleName + '-gradient-stop-positions').pfValue;\n\n if (fill === 'radial-gradient') {\n if (ele.isEdge()) {\n var start = ele.sourceEndpoint(),\n end = ele.targetEndpoint(),\n mid = ele.midpoint();\n var d1 = dist(start, mid);\n var d2 = dist(end, mid);\n gradientStyle = context.createRadialGradient(mid.x, mid.y, 0, mid.x, mid.y, Math.max(d1, d2));\n } else {\n var pos = usePaths ? {\n x: 0,\n y: 0\n } : ele.position(),\n width = ele.paddedWidth(),\n height = ele.paddedHeight();\n gradientStyle = context.createRadialGradient(pos.x, pos.y, 0, pos.x, pos.y, Math.max(width, height));\n }\n } else {\n if (ele.isEdge()) {\n var _start = ele.sourceEndpoint(),\n _end = ele.targetEndpoint();\n\n gradientStyle = context.createLinearGradient(_start.x, _start.y, _end.x, _end.y);\n } else {\n var _pos = usePaths ? {\n x: 0,\n y: 0\n } : ele.position(),\n _width = ele.paddedWidth(),\n _height = ele.paddedHeight(),\n halfWidth = _width / 2,\n halfHeight = _height / 2;\n\n var direction = ele.pstyle('background-gradient-direction').value;\n\n switch (direction) {\n case 'to-bottom':\n gradientStyle = context.createLinearGradient(_pos.x, _pos.y - halfHeight, _pos.x, _pos.y + halfHeight);\n break;\n\n case 'to-top':\n gradientStyle = context.createLinearGradient(_pos.x, _pos.y + halfHeight, _pos.x, _pos.y - halfHeight);\n break;\n\n case 'to-left':\n gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y, _pos.x - halfWidth, _pos.y);\n break;\n\n case 'to-right':\n gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y, _pos.x + halfWidth, _pos.y);\n break;\n\n case 'to-bottom-right':\n case 'to-right-bottom':\n gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y - halfHeight, _pos.x + halfWidth, _pos.y + halfHeight);\n break;\n\n case 'to-top-right':\n case 'to-right-top':\n gradientStyle = context.createLinearGradient(_pos.x - halfWidth, _pos.y + halfHeight, _pos.x + halfWidth, _pos.y - halfHeight);\n break;\n\n case 'to-bottom-left':\n case 'to-left-bottom':\n gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y - halfHeight, _pos.x - halfWidth, _pos.y + halfHeight);\n break;\n\n case 'to-top-left':\n case 'to-left-top':\n gradientStyle = context.createLinearGradient(_pos.x + halfWidth, _pos.y + halfHeight, _pos.x - halfWidth, _pos.y - halfHeight);\n break;\n }\n }\n }\n\n if (!gradientStyle) return null; // invalid gradient style\n\n var hasPositions = positions.length === colors.length;\n var length = colors.length;\n\n for (var i = 0; i < length; i++) {\n gradientStyle.addColorStop(hasPositions ? positions[i] : i / (length - 1), 'rgba(' + colors[i][0] + ',' + colors[i][1] + ',' + colors[i][2] + ',' + opacity + ')');\n }\n\n return gradientStyle;\n};\n\nCRp$6.gradientFillStyle = function (context, ele, fill, opacity) {\n var gradientStyle = this.createGradientStyleFor(context, 'background', ele, fill, opacity);\n if (!gradientStyle) return null; // error\n\n context.fillStyle = gradientStyle;\n};\n\nCRp$6.colorFillStyle = function (context, r, g, b, a) {\n context.fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; // turn off for now, seems context does its own caching\n // var cache = this.paintCache(context);\n // var fillStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n // if( cache.fillStyle !== fillStyle ){\n // context.fillStyle = cache.fillStyle = fillStyle;\n // }\n};\n\nCRp$6.eleFillStyle = function (context, ele, opacity) {\n var backgroundFill = ele.pstyle('background-fill').value;\n\n if (backgroundFill === 'linear-gradient' || backgroundFill === 'radial-gradient') {\n this.gradientFillStyle(context, ele, backgroundFill, opacity);\n } else {\n var backgroundColor = ele.pstyle('background-color').value;\n this.colorFillStyle(context, backgroundColor[0], backgroundColor[1], backgroundColor[2], opacity);\n }\n};\n\nCRp$6.gradientStrokeStyle = function (context, ele, fill, opacity) {\n var gradientStyle = this.createGradientStyleFor(context, 'line', ele, fill, opacity);\n if (!gradientStyle) return null; // error\n\n context.strokeStyle = gradientStyle;\n};\n\nCRp$6.colorStrokeStyle = function (context, r, g, b, a) {\n context.strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; // turn off for now, seems context does its own caching\n // var cache = this.paintCache(context);\n // var strokeStyle = 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n // if( cache.strokeStyle !== strokeStyle ){\n // context.strokeStyle = cache.strokeStyle = strokeStyle;\n // }\n};\n\nCRp$6.eleStrokeStyle = function (context, ele, opacity) {\n var lineFill = ele.pstyle('line-fill').value;\n\n if (lineFill === 'linear-gradient' || lineFill === 'radial-gradient') {\n this.gradientStrokeStyle(context, ele, lineFill, opacity);\n } else {\n var lineColor = ele.pstyle('line-color').value;\n this.colorStrokeStyle(context, lineColor[0], lineColor[1], lineColor[2], opacity);\n }\n}; // Resize canvas\n\n\nCRp$6.matchCanvasSize = function (container) {\n var r = this;\n var data = r.data;\n var bb = r.findContainerClientCoords();\n var width = bb[2];\n var height = bb[3];\n var pixelRatio = r.getPixelRatio();\n var mbPxRatio = r.motionBlurPxRatio;\n\n if (container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE] || container === r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG]) {\n pixelRatio = mbPxRatio;\n }\n\n var canvasWidth = width * pixelRatio;\n var canvasHeight = height * pixelRatio;\n var canvas;\n\n if (canvasWidth === r.canvasWidth && canvasHeight === r.canvasHeight) {\n return; // save cycles if same\n }\n\n r.fontCaches = null; // resizing resets the style\n\n var canvasContainer = data.canvasContainer;\n canvasContainer.style.width = width + 'px';\n canvasContainer.style.height = height + 'px';\n\n for (var i = 0; i < r.CANVAS_LAYERS; i++) {\n canvas = data.canvases[i];\n canvas.width = canvasWidth;\n canvas.height = canvasHeight;\n canvas.style.width = width + 'px';\n canvas.style.height = height + 'px';\n }\n\n for (var i = 0; i < r.BUFFER_COUNT; i++) {\n canvas = data.bufferCanvases[i];\n canvas.width = canvasWidth;\n canvas.height = canvasHeight;\n canvas.style.width = width + 'px';\n canvas.style.height = height + 'px';\n }\n\n r.textureMult = 1;\n\n if (pixelRatio <= 1) {\n canvas = data.bufferCanvases[r.TEXTURE_BUFFER];\n r.textureMult = 2;\n canvas.width = canvasWidth * r.textureMult;\n canvas.height = canvasHeight * r.textureMult;\n }\n\n r.canvasWidth = canvasWidth;\n r.canvasHeight = canvasHeight;\n};\n\nCRp$6.renderTo = function (cxt, zoom, pan, pxRatio) {\n this.render({\n forcedContext: cxt,\n forcedZoom: zoom,\n forcedPan: pan,\n drawAllLayers: true,\n forcedPxRatio: pxRatio\n });\n};\n\nCRp$6.render = function (options) {\n options = options || staticEmptyObject();\n var forcedContext = options.forcedContext;\n var drawAllLayers = options.drawAllLayers;\n var drawOnlyNodeLayer = options.drawOnlyNodeLayer;\n var forcedZoom = options.forcedZoom;\n var forcedPan = options.forcedPan;\n var r = this;\n var pixelRatio = options.forcedPxRatio === undefined ? this.getPixelRatio() : options.forcedPxRatio;\n var cy = r.cy;\n var data = r.data;\n var needDraw = data.canvasNeedsRedraw;\n var textureDraw = r.textureOnViewport && !forcedContext && (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming);\n var motionBlur = options.motionBlur !== undefined ? options.motionBlur : r.motionBlur;\n var mbPxRatio = r.motionBlurPxRatio;\n var hasCompoundNodes = cy.hasCompoundNodes();\n var inNodeDragGesture = r.hoverData.draggingEles;\n var inBoxSelection = r.hoverData.selecting || r.touchData.selecting ? true : false;\n motionBlur = motionBlur && !forcedContext && r.motionBlurEnabled && !inBoxSelection;\n var motionBlurFadeEffect = motionBlur;\n\n if (!forcedContext) {\n if (r.prevPxRatio !== pixelRatio) {\n r.invalidateContainerClientCoordsCache();\n r.matchCanvasSize(r.container);\n r.redrawHint('eles', true);\n r.redrawHint('drag', true);\n }\n\n r.prevPxRatio = pixelRatio;\n }\n\n if (!forcedContext && r.motionBlurTimeout) {\n clearTimeout(r.motionBlurTimeout);\n }\n\n if (motionBlur) {\n if (r.mbFrames == null) {\n r.mbFrames = 0;\n }\n\n r.mbFrames++;\n\n if (r.mbFrames < 3) {\n // need several frames before even high quality motionblur\n motionBlurFadeEffect = false;\n } // go to lower quality blurry frames when several m/b frames have been rendered (avoids flashing)\n\n\n if (r.mbFrames > r.minMbLowQualFrames) {\n //r.fullQualityMb = false;\n r.motionBlurPxRatio = r.mbPxRBlurry;\n }\n }\n\n if (r.clearingMotionBlur) {\n r.motionBlurPxRatio = 1;\n } // b/c drawToContext() may be async w.r.t. redraw(), keep track of last texture frame\n // because a rogue async texture frame would clear needDraw\n\n\n if (r.textureDrawLastFrame && !textureDraw) {\n needDraw[r.NODE] = true;\n needDraw[r.SELECT_BOX] = true;\n }\n\n var style = cy.style();\n var zoom = cy.zoom();\n var effectiveZoom = forcedZoom !== undefined ? forcedZoom : zoom;\n var pan = cy.pan();\n var effectivePan = {\n x: pan.x,\n y: pan.y\n };\n var vp = {\n zoom: zoom,\n pan: {\n x: pan.x,\n y: pan.y\n }\n };\n var prevVp = r.prevViewport;\n var viewportIsDiff = prevVp === undefined || vp.zoom !== prevVp.zoom || vp.pan.x !== prevVp.pan.x || vp.pan.y !== prevVp.pan.y; // we want the low quality motionblur only when the viewport is being manipulated etc (where it's not noticed)\n\n if (!viewportIsDiff && !(inNodeDragGesture && !hasCompoundNodes)) {\n r.motionBlurPxRatio = 1;\n }\n\n if (forcedPan) {\n effectivePan = forcedPan;\n } // apply pixel ratio\n\n\n effectiveZoom *= pixelRatio;\n effectivePan.x *= pixelRatio;\n effectivePan.y *= pixelRatio;\n var eles = r.getCachedZSortedEles();\n\n function mbclear(context, x, y, w, h) {\n var gco = context.globalCompositeOperation;\n context.globalCompositeOperation = 'destination-out';\n r.colorFillStyle(context, 255, 255, 255, r.motionBlurTransparency);\n context.fillRect(x, y, w, h);\n context.globalCompositeOperation = gco;\n }\n\n function setContextTransform(context, clear) {\n var ePan, eZoom, w, h;\n\n if (!r.clearingMotionBlur && (context === data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] || context === data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG])) {\n ePan = {\n x: pan.x * mbPxRatio,\n y: pan.y * mbPxRatio\n };\n eZoom = zoom * mbPxRatio;\n w = r.canvasWidth * mbPxRatio;\n h = r.canvasHeight * mbPxRatio;\n } else {\n ePan = effectivePan;\n eZoom = effectiveZoom;\n w = r.canvasWidth;\n h = r.canvasHeight;\n }\n\n context.setTransform(1, 0, 0, 1, 0, 0);\n\n if (clear === 'motionBlur') {\n mbclear(context, 0, 0, w, h);\n } else if (!forcedContext && (clear === undefined || clear)) {\n context.clearRect(0, 0, w, h);\n }\n\n if (!drawAllLayers) {\n context.translate(ePan.x, ePan.y);\n context.scale(eZoom, eZoom);\n }\n\n if (forcedPan) {\n context.translate(forcedPan.x, forcedPan.y);\n }\n\n if (forcedZoom) {\n context.scale(forcedZoom, forcedZoom);\n }\n }\n\n if (!textureDraw) {\n r.textureDrawLastFrame = false;\n }\n\n if (textureDraw) {\n r.textureDrawLastFrame = true;\n\n if (!r.textureCache) {\n r.textureCache = {};\n r.textureCache.bb = cy.mutableElements().boundingBox();\n r.textureCache.texture = r.data.bufferCanvases[r.TEXTURE_BUFFER];\n var cxt = r.data.bufferContexts[r.TEXTURE_BUFFER];\n cxt.setTransform(1, 0, 0, 1, 0, 0);\n cxt.clearRect(0, 0, r.canvasWidth * r.textureMult, r.canvasHeight * r.textureMult);\n r.render({\n forcedContext: cxt,\n drawOnlyNodeLayer: true,\n forcedPxRatio: pixelRatio * r.textureMult\n });\n var vp = r.textureCache.viewport = {\n zoom: cy.zoom(),\n pan: cy.pan(),\n width: r.canvasWidth,\n height: r.canvasHeight\n };\n vp.mpan = {\n x: (0 - vp.pan.x) / vp.zoom,\n y: (0 - vp.pan.y) / vp.zoom\n };\n }\n\n needDraw[r.DRAG] = false;\n needDraw[r.NODE] = false;\n var context = data.contexts[r.NODE];\n var texture = r.textureCache.texture;\n var vp = r.textureCache.viewport;\n context.setTransform(1, 0, 0, 1, 0, 0);\n\n if (motionBlur) {\n mbclear(context, 0, 0, vp.width, vp.height);\n } else {\n context.clearRect(0, 0, vp.width, vp.height);\n }\n\n var outsideBgColor = style.core('outside-texture-bg-color').value;\n var outsideBgOpacity = style.core('outside-texture-bg-opacity').value;\n r.colorFillStyle(context, outsideBgColor[0], outsideBgColor[1], outsideBgColor[2], outsideBgOpacity);\n context.fillRect(0, 0, vp.width, vp.height);\n var zoom = cy.zoom();\n setContextTransform(context, false);\n context.clearRect(vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio);\n context.drawImage(texture, vp.mpan.x, vp.mpan.y, vp.width / vp.zoom / pixelRatio, vp.height / vp.zoom / pixelRatio);\n } else if (r.textureOnViewport && !forcedContext) {\n // clear the cache since we don't need it\n r.textureCache = null;\n }\n\n var extent = cy.extent();\n var vpManip = r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles || r.cy.animated();\n var hideEdges = r.hideEdgesOnViewport && vpManip;\n var needMbClear = [];\n needMbClear[r.NODE] = !needDraw[r.NODE] && motionBlur && !r.clearedForMotionBlur[r.NODE] || r.clearingMotionBlur;\n\n if (needMbClear[r.NODE]) {\n r.clearedForMotionBlur[r.NODE] = true;\n }\n\n needMbClear[r.DRAG] = !needDraw[r.DRAG] && motionBlur && !r.clearedForMotionBlur[r.DRAG] || r.clearingMotionBlur;\n\n if (needMbClear[r.DRAG]) {\n r.clearedForMotionBlur[r.DRAG] = true;\n }\n\n if (needDraw[r.NODE] || drawAllLayers || drawOnlyNodeLayer || needMbClear[r.NODE]) {\n var useBuffer = motionBlur && !needMbClear[r.NODE] && mbPxRatio !== 1;\n var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_NODE] : data.contexts[r.NODE]);\n var clear = motionBlur && !useBuffer ? 'motionBlur' : undefined;\n setContextTransform(context, clear);\n\n if (hideEdges) {\n r.drawCachedNodes(context, eles.nondrag, pixelRatio, extent);\n } else {\n r.drawLayeredElements(context, eles.nondrag, pixelRatio, extent);\n }\n\n if (r.debug) {\n r.drawDebugPoints(context, eles.nondrag);\n }\n\n if (!drawAllLayers && !motionBlur) {\n needDraw[r.NODE] = false;\n }\n }\n\n if (!drawOnlyNodeLayer && (needDraw[r.DRAG] || drawAllLayers || needMbClear[r.DRAG])) {\n var useBuffer = motionBlur && !needMbClear[r.DRAG] && mbPxRatio !== 1;\n var context = forcedContext || (useBuffer ? r.data.bufferContexts[r.MOTIONBLUR_BUFFER_DRAG] : data.contexts[r.DRAG]);\n setContextTransform(context, motionBlur && !useBuffer ? 'motionBlur' : undefined);\n\n if (hideEdges) {\n r.drawCachedNodes(context, eles.drag, pixelRatio, extent);\n } else {\n r.drawCachedElements(context, eles.drag, pixelRatio, extent);\n }\n\n if (r.debug) {\n r.drawDebugPoints(context, eles.drag);\n }\n\n if (!drawAllLayers && !motionBlur) {\n needDraw[r.DRAG] = false;\n }\n }\n\n if (r.showFps || !drawOnlyNodeLayer && needDraw[r.SELECT_BOX] && !drawAllLayers) {\n var context = forcedContext || data.contexts[r.SELECT_BOX];\n setContextTransform(context);\n\n if (r.selection[4] == 1 && (r.hoverData.selecting || r.touchData.selecting)) {\n var zoom = r.cy.zoom();\n var borderWidth = style.core('selection-box-border-width').value / zoom;\n context.lineWidth = borderWidth;\n context.fillStyle = 'rgba(' + style.core('selection-box-color').value[0] + ',' + style.core('selection-box-color').value[1] + ',' + style.core('selection-box-color').value[2] + ',' + style.core('selection-box-opacity').value + ')';\n context.fillRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]);\n\n if (borderWidth > 0) {\n context.strokeStyle = 'rgba(' + style.core('selection-box-border-color').value[0] + ',' + style.core('selection-box-border-color').value[1] + ',' + style.core('selection-box-border-color').value[2] + ',' + style.core('selection-box-opacity').value + ')';\n context.strokeRect(r.selection[0], r.selection[1], r.selection[2] - r.selection[0], r.selection[3] - r.selection[1]);\n }\n }\n\n if (data.bgActivePosistion && !r.hoverData.selecting) {\n var zoom = r.cy.zoom();\n var pos = data.bgActivePosistion;\n context.fillStyle = 'rgba(' + style.core('active-bg-color').value[0] + ',' + style.core('active-bg-color').value[1] + ',' + style.core('active-bg-color').value[2] + ',' + style.core('active-bg-opacity').value + ')';\n context.beginPath();\n context.arc(pos.x, pos.y, style.core('active-bg-size').pfValue / zoom, 0, 2 * Math.PI);\n context.fill();\n }\n\n var timeToRender = r.lastRedrawTime;\n\n if (r.showFps && timeToRender) {\n timeToRender = Math.round(timeToRender);\n var fps = Math.round(1000 / timeToRender);\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.fillStyle = 'rgba(255, 0, 0, 0.75)';\n context.strokeStyle = 'rgba(255, 0, 0, 0.75)';\n context.lineWidth = 1;\n context.fillText('1 frame = ' + timeToRender + ' ms = ' + fps + ' fps', 0, 20);\n var maxFps = 60;\n context.strokeRect(0, 30, 250, 20);\n context.fillRect(0, 30, 250 * Math.min(fps / maxFps, 1), 20);\n }\n\n if (!drawAllLayers) {\n needDraw[r.SELECT_BOX] = false;\n }\n } // motionblur: blit rendered blurry frames\n\n\n if (motionBlur && mbPxRatio !== 1) {\n var cxtNode = data.contexts[r.NODE];\n var txtNode = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_NODE];\n var cxtDrag = data.contexts[r.DRAG];\n var txtDrag = r.data.bufferCanvases[r.MOTIONBLUR_BUFFER_DRAG];\n\n var drawMotionBlur = function drawMotionBlur(cxt, txt, needClear) {\n cxt.setTransform(1, 0, 0, 1, 0, 0);\n\n if (needClear || !motionBlurFadeEffect) {\n cxt.clearRect(0, 0, r.canvasWidth, r.canvasHeight);\n } else {\n mbclear(cxt, 0, 0, r.canvasWidth, r.canvasHeight);\n }\n\n var pxr = mbPxRatio;\n cxt.drawImage(txt, // img\n 0, 0, // sx, sy\n r.canvasWidth * pxr, r.canvasHeight * pxr, // sw, sh\n 0, 0, // x, y\n r.canvasWidth, r.canvasHeight // w, h\n );\n };\n\n if (needDraw[r.NODE] || needMbClear[r.NODE]) {\n drawMotionBlur(cxtNode, txtNode, needMbClear[r.NODE]);\n needDraw[r.NODE] = false;\n }\n\n if (needDraw[r.DRAG] || needMbClear[r.DRAG]) {\n drawMotionBlur(cxtDrag, txtDrag, needMbClear[r.DRAG]);\n needDraw[r.DRAG] = false;\n }\n }\n\n r.prevViewport = vp;\n\n if (r.clearingMotionBlur) {\n r.clearingMotionBlur = false;\n r.motionBlurCleared = true;\n r.motionBlur = true;\n }\n\n if (motionBlur) {\n r.motionBlurTimeout = setTimeout(function () {\n r.motionBlurTimeout = null;\n r.clearedForMotionBlur[r.NODE] = false;\n r.clearedForMotionBlur[r.DRAG] = false;\n r.motionBlur = false;\n r.clearingMotionBlur = !textureDraw;\n r.mbFrames = 0;\n needDraw[r.NODE] = true;\n needDraw[r.DRAG] = true;\n r.redraw();\n }, motionBlurDelay);\n }\n\n if (!forcedContext) {\n cy.emit('render');\n }\n};\n\nvar CRp$7 = {}; // @O Polygon drawing\n\nCRp$7.drawPolygonPath = function (context, x, y, width, height, points) {\n var halfW = width / 2;\n var halfH = height / 2;\n\n if (context.beginPath) {\n context.beginPath();\n }\n\n context.moveTo(x + halfW * points[0], y + halfH * points[1]);\n\n for (var i = 1; i < points.length / 2; i++) {\n context.lineTo(x + halfW * points[i * 2], y + halfH * points[i * 2 + 1]);\n }\n\n context.closePath();\n};\n\nCRp$7.drawRoundPolygonPath = function (context, x, y, width, height, points) {\n var halfW = width / 2;\n var halfH = height / 2;\n var cornerRadius = getRoundPolygonRadius(width, height);\n\n if (context.beginPath) {\n context.beginPath();\n }\n\n for (var _i = 0; _i < points.length / 4; _i++) {\n var sourceUv = void 0,\n destUv = void 0;\n\n if (_i === 0) {\n sourceUv = points.length - 2;\n } else {\n sourceUv = _i * 4 - 2;\n }\n\n destUv = _i * 4 + 2;\n var px = x + halfW * points[_i * 4];\n var py = y + halfH * points[_i * 4 + 1];\n var cosTheta = -points[sourceUv] * points[destUv] - points[sourceUv + 1] * points[destUv + 1];\n var offset = cornerRadius / Math.tan(Math.acos(cosTheta) / 2);\n var cp0x = px - offset * points[sourceUv];\n var cp0y = py - offset * points[sourceUv + 1];\n var cp1x = px + offset * points[destUv];\n var cp1y = py + offset * points[destUv + 1];\n\n if (_i === 0) {\n context.moveTo(cp0x, cp0y);\n } else {\n context.lineTo(cp0x, cp0y);\n }\n\n context.arcTo(px, py, cp1x, cp1y, cornerRadius);\n }\n\n context.closePath();\n}; // Round rectangle drawing\n\n\nCRp$7.drawRoundRectanglePath = function (context, x, y, width, height) {\n var halfWidth = width / 2;\n var halfHeight = height / 2;\n var cornerRadius = getRoundRectangleRadius(width, height);\n\n if (context.beginPath) {\n context.beginPath();\n } // Start at top middle\n\n\n context.moveTo(x, y - halfHeight); // Arc from middle top to right side\n\n context.arcTo(x + halfWidth, y - halfHeight, x + halfWidth, y, cornerRadius); // Arc from right side to bottom\n\n context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius); // Arc from bottom to left side\n\n context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius); // Arc from left side to topBorder\n\n context.arcTo(x - halfWidth, y - halfHeight, x, y - halfHeight, cornerRadius); // Join line\n\n context.lineTo(x, y - halfHeight);\n context.closePath();\n};\n\nCRp$7.drawBottomRoundRectanglePath = function (context, x, y, width, height) {\n var halfWidth = width / 2;\n var halfHeight = height / 2;\n var cornerRadius = getRoundRectangleRadius(width, height);\n\n if (context.beginPath) {\n context.beginPath();\n } // Start at top middle\n\n\n context.moveTo(x, y - halfHeight);\n context.lineTo(x + halfWidth, y - halfHeight);\n context.lineTo(x + halfWidth, y);\n context.arcTo(x + halfWidth, y + halfHeight, x, y + halfHeight, cornerRadius);\n context.arcTo(x - halfWidth, y + halfHeight, x - halfWidth, y, cornerRadius);\n context.lineTo(x - halfWidth, y - halfHeight);\n context.lineTo(x, y - halfHeight);\n context.closePath();\n};\n\nCRp$7.drawCutRectanglePath = function (context, x, y, width, height) {\n var halfWidth = width / 2;\n var halfHeight = height / 2;\n var cornerLength = getCutRectangleCornerLength();\n\n if (context.beginPath) {\n context.beginPath();\n }\n\n context.moveTo(x - halfWidth + cornerLength, y - halfHeight);\n context.lineTo(x + halfWidth - cornerLength, y - halfHeight);\n context.lineTo(x + halfWidth, y - halfHeight + cornerLength);\n context.lineTo(x + halfWidth, y + halfHeight - cornerLength);\n context.lineTo(x + halfWidth - cornerLength, y + halfHeight);\n context.lineTo(x - halfWidth + cornerLength, y + halfHeight);\n context.lineTo(x - halfWidth, y + halfHeight - cornerLength);\n context.lineTo(x - halfWidth, y - halfHeight + cornerLength);\n context.closePath();\n};\n\nCRp$7.drawBarrelPath = function (context, x, y, width, height) {\n var halfWidth = width / 2;\n var halfHeight = height / 2;\n var xBegin = x - halfWidth;\n var xEnd = x + halfWidth;\n var yBegin = y - halfHeight;\n var yEnd = y + halfHeight;\n var barrelCurveConstants = getBarrelCurveConstants(width, height);\n var wOffset = barrelCurveConstants.widthOffset;\n var hOffset = barrelCurveConstants.heightOffset;\n var ctrlPtXOffset = barrelCurveConstants.ctrlPtOffsetPct * wOffset;\n\n if (context.beginPath) {\n context.beginPath();\n }\n\n context.moveTo(xBegin, yBegin + hOffset);\n context.lineTo(xBegin, yEnd - hOffset);\n context.quadraticCurveTo(xBegin + ctrlPtXOffset, yEnd, xBegin + wOffset, yEnd);\n context.lineTo(xEnd - wOffset, yEnd);\n context.quadraticCurveTo(xEnd - ctrlPtXOffset, yEnd, xEnd, yEnd - hOffset);\n context.lineTo(xEnd, yBegin + hOffset);\n context.quadraticCurveTo(xEnd - ctrlPtXOffset, yBegin, xEnd - wOffset, yBegin);\n context.lineTo(xBegin + wOffset, yBegin);\n context.quadraticCurveTo(xBegin + ctrlPtXOffset, yBegin, xBegin, yBegin + hOffset);\n context.closePath();\n};\n\nvar sin0 = Math.sin(0);\nvar cos0 = Math.cos(0);\nvar sin = {};\nvar cos = {};\nvar ellipseStepSize = Math.PI / 40;\n\nfor (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) {\n sin[i] = Math.sin(i);\n cos[i] = Math.cos(i);\n}\n\nCRp$7.drawEllipsePath = function (context, centerX, centerY, width, height) {\n if (context.beginPath) {\n context.beginPath();\n }\n\n if (context.ellipse) {\n context.ellipse(centerX, centerY, width / 2, height / 2, 0, 0, 2 * Math.PI);\n } else {\n var xPos, yPos;\n var rw = width / 2;\n var rh = height / 2;\n\n for (var i = 0 * Math.PI; i < 2 * Math.PI; i += ellipseStepSize) {\n xPos = centerX - rw * sin[i] * sin0 + rw * cos[i] * cos0;\n yPos = centerY + rh * cos[i] * sin0 + rh * sin[i] * cos0;\n\n if (i === 0) {\n context.moveTo(xPos, yPos);\n } else {\n context.lineTo(xPos, yPos);\n }\n }\n }\n\n context.closePath();\n};\n\n/* global atob, ArrayBuffer, Uint8Array, Blob */\nvar CRp$8 = {};\n\nCRp$8.createBuffer = function (w, h) {\n var buffer = document.createElement('canvas'); // eslint-disable-line no-undef\n\n buffer.width = w;\n buffer.height = h;\n return [buffer, buffer.getContext('2d')];\n};\n\nCRp$8.bufferCanvasImage = function (options) {\n var cy = this.cy;\n var eles = cy.mutableElements();\n var bb = eles.boundingBox();\n var ctrRect = this.findContainerClientCoords();\n var width = options.full ? Math.ceil(bb.w) : ctrRect[2];\n var height = options.full ? Math.ceil(bb.h) : ctrRect[3];\n var specdMaxDims = number(options.maxWidth) || number(options.maxHeight);\n var pxRatio = this.getPixelRatio();\n var scale = 1;\n\n if (options.scale !== undefined) {\n width *= options.scale;\n height *= options.scale;\n scale = options.scale;\n } else if (specdMaxDims) {\n var maxScaleW = Infinity;\n var maxScaleH = Infinity;\n\n if (number(options.maxWidth)) {\n maxScaleW = scale * options.maxWidth / width;\n }\n\n if (number(options.maxHeight)) {\n maxScaleH = scale * options.maxHeight / height;\n }\n\n scale = Math.min(maxScaleW, maxScaleH);\n width *= scale;\n height *= scale;\n }\n\n if (!specdMaxDims) {\n width *= pxRatio;\n height *= pxRatio;\n scale *= pxRatio;\n }\n\n var buffCanvas = document.createElement('canvas'); // eslint-disable-line no-undef\n\n buffCanvas.width = width;\n buffCanvas.height = height;\n buffCanvas.style.width = width + 'px';\n buffCanvas.style.height = height + 'px';\n var buffCxt = buffCanvas.getContext('2d'); // Rasterize the layers, but only if container has nonzero size\n\n if (width > 0 && height > 0) {\n buffCxt.clearRect(0, 0, width, height);\n buffCxt.globalCompositeOperation = 'source-over';\n var zsortedEles = this.getCachedZSortedEles();\n\n if (options.full) {\n // draw the full bounds of the graph\n buffCxt.translate(-bb.x1 * scale, -bb.y1 * scale);\n buffCxt.scale(scale, scale);\n this.drawElements(buffCxt, zsortedEles);\n buffCxt.scale(1 / scale, 1 / scale);\n buffCxt.translate(bb.x1 * scale, bb.y1 * scale);\n } else {\n // draw the current view\n var pan = cy.pan();\n var translation = {\n x: pan.x * scale,\n y: pan.y * scale\n };\n scale *= cy.zoom();\n buffCxt.translate(translation.x, translation.y);\n buffCxt.scale(scale, scale);\n this.drawElements(buffCxt, zsortedEles);\n buffCxt.scale(1 / scale, 1 / scale);\n buffCxt.translate(-translation.x, -translation.y);\n } // need to fill bg at end like this in order to fill cleared transparent pixels in jpgs\n\n\n if (options.bg) {\n buffCxt.globalCompositeOperation = 'destination-over';\n buffCxt.fillStyle = options.bg;\n buffCxt.rect(0, 0, width, height);\n buffCxt.fill();\n }\n }\n\n return buffCanvas;\n};\n\nfunction b64ToBlob(b64, mimeType) {\n var bytes = atob(b64);\n var buff = new ArrayBuffer(bytes.length);\n var buffUint8 = new Uint8Array(buff);\n\n for (var i = 0; i < bytes.length; i++) {\n buffUint8[i] = bytes.charCodeAt(i);\n }\n\n return new Blob([buff], {\n type: mimeType\n });\n}\n\nfunction b64UriToB64(b64uri) {\n var i = b64uri.indexOf(',');\n return b64uri.substr(i + 1);\n}\n\nfunction output(options, canvas, mimeType) {\n var getB64Uri = function getB64Uri() {\n return canvas.toDataURL(mimeType, options.quality);\n };\n\n switch (options.output) {\n case 'blob-promise':\n return new Promise$1(function (resolve, reject) {\n try {\n canvas.toBlob(function (blob) {\n if (blob != null) {\n resolve(blob);\n } else {\n reject(new Error('`canvas.toBlob()` sent a null value in its callback'));\n }\n }, mimeType, options.quality);\n } catch (err) {\n reject(err);\n }\n });\n\n case 'blob':\n return b64ToBlob(b64UriToB64(getB64Uri()), mimeType);\n\n case 'base64':\n return b64UriToB64(getB64Uri());\n\n case 'base64uri':\n default:\n return getB64Uri();\n }\n}\n\nCRp$8.png = function (options) {\n return output(options, this.bufferCanvasImage(options), 'image/png');\n};\n\nCRp$8.jpg = function (options) {\n return output(options, this.bufferCanvasImage(options), 'image/jpeg');\n};\n\nvar CRp$9 = {};\n\nCRp$9.nodeShapeImpl = function (name, context, centerX, centerY, width, height, points) {\n switch (name) {\n case 'ellipse':\n return this.drawEllipsePath(context, centerX, centerY, width, height);\n\n case 'polygon':\n return this.drawPolygonPath(context, centerX, centerY, width, height, points);\n\n case 'round-polygon':\n return this.drawRoundPolygonPath(context, centerX, centerY, width, height, points);\n\n case 'roundrectangle':\n case 'round-rectangle':\n return this.drawRoundRectanglePath(context, centerX, centerY, width, height);\n\n case 'cutrectangle':\n case 'cut-rectangle':\n return this.drawCutRectanglePath(context, centerX, centerY, width, height);\n\n case 'bottomroundrectangle':\n case 'bottom-round-rectangle':\n return this.drawBottomRoundRectanglePath(context, centerX, centerY, width, height);\n\n case 'barrel':\n return this.drawBarrelPath(context, centerX, centerY, width, height);\n }\n};\n\nvar CR = CanvasRenderer;\nvar CRp$a = CanvasRenderer.prototype;\nCRp$a.CANVAS_LAYERS = 3; //\n\nCRp$a.SELECT_BOX = 0;\nCRp$a.DRAG = 1;\nCRp$a.NODE = 2;\nCRp$a.BUFFER_COUNT = 3; //\n\nCRp$a.TEXTURE_BUFFER = 0;\nCRp$a.MOTIONBLUR_BUFFER_NODE = 1;\nCRp$a.MOTIONBLUR_BUFFER_DRAG = 2;\n\nfunction CanvasRenderer(options) {\n var r = this;\n r.data = {\n canvases: new Array(CRp$a.CANVAS_LAYERS),\n contexts: new Array(CRp$a.CANVAS_LAYERS),\n canvasNeedsRedraw: new Array(CRp$a.CANVAS_LAYERS),\n bufferCanvases: new Array(CRp$a.BUFFER_COUNT),\n bufferContexts: new Array(CRp$a.CANVAS_LAYERS)\n };\n var tapHlOffAttr = '-webkit-tap-highlight-color';\n var tapHlOffStyle = 'rgba(0,0,0,0)';\n r.data.canvasContainer = document.createElement('div'); // eslint-disable-line no-undef\n\n var containerStyle = r.data.canvasContainer.style;\n r.data.canvasContainer.style[tapHlOffAttr] = tapHlOffStyle;\n containerStyle.position = 'relative';\n containerStyle.zIndex = '0';\n containerStyle.overflow = 'hidden';\n var container = options.cy.container();\n container.appendChild(r.data.canvasContainer);\n container.style[tapHlOffAttr] = tapHlOffStyle;\n var styleMap = {\n '-webkit-user-select': 'none',\n '-moz-user-select': '-moz-none',\n 'user-select': 'none',\n '-webkit-tap-highlight-color': 'rgba(0,0,0,0)',\n 'outline-style': 'none'\n };\n\n if (ms()) {\n styleMap['-ms-touch-action'] = 'none';\n styleMap['touch-action'] = 'none';\n }\n\n for (var i = 0; i < CRp$a.CANVAS_LAYERS; i++) {\n var canvas = r.data.canvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef\n\n r.data.contexts[i] = canvas.getContext('2d');\n Object.keys(styleMap).forEach(function (k) {\n canvas.style[k] = styleMap[k];\n });\n canvas.style.position = 'absolute';\n canvas.setAttribute('data-id', 'layer' + i);\n canvas.style.zIndex = String(CRp$a.CANVAS_LAYERS - i);\n r.data.canvasContainer.appendChild(canvas);\n r.data.canvasNeedsRedraw[i] = false;\n }\n\n r.data.topCanvas = r.data.canvases[0];\n r.data.canvases[CRp$a.NODE].setAttribute('data-id', 'layer' + CRp$a.NODE + '-node');\n r.data.canvases[CRp$a.SELECT_BOX].setAttribute('data-id', 'layer' + CRp$a.SELECT_BOX + '-selectbox');\n r.data.canvases[CRp$a.DRAG].setAttribute('data-id', 'layer' + CRp$a.DRAG + '-drag');\n\n for (var i = 0; i < CRp$a.BUFFER_COUNT; i++) {\n r.data.bufferCanvases[i] = document.createElement('canvas'); // eslint-disable-line no-undef\n\n r.data.bufferContexts[i] = r.data.bufferCanvases[i].getContext('2d');\n r.data.bufferCanvases[i].style.position = 'absolute';\n r.data.bufferCanvases[i].setAttribute('data-id', 'buffer' + i);\n r.data.bufferCanvases[i].style.zIndex = String(-i - 1);\n r.data.bufferCanvases[i].style.visibility = 'hidden'; //r.data.canvasContainer.appendChild(r.data.bufferCanvases[i]);\n }\n\n r.pathsEnabled = true;\n var emptyBb = makeBoundingBox();\n\n var getBoxCenter = function getBoxCenter(bb) {\n return {\n x: (bb.x1 + bb.x2) / 2,\n y: (bb.y1 + bb.y2) / 2\n };\n };\n\n var getCenterOffset = function getCenterOffset(bb) {\n return {\n x: -bb.w / 2,\n y: -bb.h / 2\n };\n };\n\n var backgroundTimestampHasChanged = function backgroundTimestampHasChanged(ele) {\n var _p = ele[0]._private;\n var same = _p.oldBackgroundTimestamp === _p.backgroundTimestamp;\n return !same;\n };\n\n var getStyleKey = function getStyleKey(ele) {\n return ele[0]._private.nodeKey;\n };\n\n var getLabelKey = function getLabelKey(ele) {\n return ele[0]._private.labelStyleKey;\n };\n\n var getSourceLabelKey = function getSourceLabelKey(ele) {\n return ele[0]._private.sourceLabelStyleKey;\n };\n\n var getTargetLabelKey = function getTargetLabelKey(ele) {\n return ele[0]._private.targetLabelStyleKey;\n };\n\n var drawElement = function drawElement(context, ele, bb, scaledLabelShown, useEleOpacity) {\n return r.drawElement(context, ele, bb, false, false, useEleOpacity);\n };\n\n var drawLabel = function drawLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {\n return r.drawElementText(context, ele, bb, scaledLabelShown, 'main', useEleOpacity);\n };\n\n var drawSourceLabel = function drawSourceLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {\n return r.drawElementText(context, ele, bb, scaledLabelShown, 'source', useEleOpacity);\n };\n\n var drawTargetLabel = function drawTargetLabel(context, ele, bb, scaledLabelShown, useEleOpacity) {\n return r.drawElementText(context, ele, bb, scaledLabelShown, 'target', useEleOpacity);\n };\n\n var getElementBox = function getElementBox(ele) {\n ele.boundingBox();\n return ele[0]._private.bodyBounds;\n };\n\n var getLabelBox = function getLabelBox(ele) {\n ele.boundingBox();\n return ele[0]._private.labelBounds.main || emptyBb;\n };\n\n var getSourceLabelBox = function getSourceLabelBox(ele) {\n ele.boundingBox();\n return ele[0]._private.labelBounds.source || emptyBb;\n };\n\n var getTargetLabelBox = function getTargetLabelBox(ele) {\n ele.boundingBox();\n return ele[0]._private.labelBounds.target || emptyBb;\n };\n\n var isLabelVisibleAtScale = function isLabelVisibleAtScale(ele, scaledLabelShown) {\n return scaledLabelShown;\n };\n\n var getElementRotationPoint = function getElementRotationPoint(ele) {\n return getBoxCenter(getElementBox(ele));\n };\n\n var addTextMargin = function addTextMargin(prefix, pt, ele) {\n var pre = prefix ? prefix + '-' : '';\n return {\n x: pt.x + ele.pstyle(pre + 'text-margin-x').pfValue,\n y: pt.y + ele.pstyle(pre + 'text-margin-y').pfValue\n };\n };\n\n var getRsPt = function getRsPt(ele, x, y) {\n var rs = ele[0]._private.rscratch;\n return {\n x: rs[x],\n y: rs[y]\n };\n };\n\n var getLabelRotationPoint = function getLabelRotationPoint(ele) {\n return addTextMargin('', getRsPt(ele, 'labelX', 'labelY'), ele);\n };\n\n var getSourceLabelRotationPoint = function getSourceLabelRotationPoint(ele) {\n return addTextMargin('source', getRsPt(ele, 'sourceLabelX', 'sourceLabelY'), ele);\n };\n\n var getTargetLabelRotationPoint = function getTargetLabelRotationPoint(ele) {\n return addTextMargin('target', getRsPt(ele, 'targetLabelX', 'targetLabelY'), ele);\n };\n\n var getElementRotationOffset = function getElementRotationOffset(ele) {\n return getCenterOffset(getElementBox(ele));\n };\n\n var getSourceLabelRotationOffset = function getSourceLabelRotationOffset(ele) {\n return getCenterOffset(getSourceLabelBox(ele));\n };\n\n var getTargetLabelRotationOffset = function getTargetLabelRotationOffset(ele) {\n return getCenterOffset(getTargetLabelBox(ele));\n };\n\n var getLabelRotationOffset = function getLabelRotationOffset(ele) {\n var bb = getLabelBox(ele);\n var p = getCenterOffset(getLabelBox(ele));\n\n if (ele.isNode()) {\n switch (ele.pstyle('text-halign').value) {\n case 'left':\n p.x = -bb.w;\n break;\n\n case 'right':\n p.x = 0;\n break;\n }\n\n switch (ele.pstyle('text-valign').value) {\n case 'top':\n p.y = -bb.h;\n break;\n\n case 'bottom':\n p.y = 0;\n break;\n }\n }\n\n return p;\n };\n\n var eleTxrCache = r.data.eleTxrCache = new ElementTextureCache(r, {\n getKey: getStyleKey,\n doesEleInvalidateKey: backgroundTimestampHasChanged,\n drawElement: drawElement,\n getBoundingBox: getElementBox,\n getRotationPoint: getElementRotationPoint,\n getRotationOffset: getElementRotationOffset,\n allowEdgeTxrCaching: false,\n allowParentTxrCaching: false\n });\n var lblTxrCache = r.data.lblTxrCache = new ElementTextureCache(r, {\n getKey: getLabelKey,\n drawElement: drawLabel,\n getBoundingBox: getLabelBox,\n getRotationPoint: getLabelRotationPoint,\n getRotationOffset: getLabelRotationOffset,\n isVisible: isLabelVisibleAtScale\n });\n var slbTxrCache = r.data.slbTxrCache = new ElementTextureCache(r, {\n getKey: getSourceLabelKey,\n drawElement: drawSourceLabel,\n getBoundingBox: getSourceLabelBox,\n getRotationPoint: getSourceLabelRotationPoint,\n getRotationOffset: getSourceLabelRotationOffset,\n isVisible: isLabelVisibleAtScale\n });\n var tlbTxrCache = r.data.tlbTxrCache = new ElementTextureCache(r, {\n getKey: getTargetLabelKey,\n drawElement: drawTargetLabel,\n getBoundingBox: getTargetLabelBox,\n getRotationPoint: getTargetLabelRotationPoint,\n getRotationOffset: getTargetLabelRotationOffset,\n isVisible: isLabelVisibleAtScale\n });\n var lyrTxrCache = r.data.lyrTxrCache = new LayeredTextureCache(r);\n r.onUpdateEleCalcs(function invalidateTextureCaches(willDraw, eles) {\n // each cache should check for sub-key diff to see that the update affects that cache particularly\n eleTxrCache.invalidateElements(eles);\n lblTxrCache.invalidateElements(eles);\n slbTxrCache.invalidateElements(eles);\n tlbTxrCache.invalidateElements(eles); // any change invalidates the layers\n\n lyrTxrCache.invalidateElements(eles); // update the old bg timestamp so diffs can be done in the ele txr caches\n\n for (var _i = 0; _i < eles.length; _i++) {\n var _p = eles[_i]._private;\n _p.oldBackgroundTimestamp = _p.backgroundTimestamp;\n }\n });\n\n var refineInLayers = function refineInLayers(reqs) {\n for (var i = 0; i < reqs.length; i++) {\n lyrTxrCache.enqueueElementRefinement(reqs[i].ele);\n }\n };\n\n eleTxrCache.onDequeue(refineInLayers);\n lblTxrCache.onDequeue(refineInLayers);\n slbTxrCache.onDequeue(refineInLayers);\n tlbTxrCache.onDequeue(refineInLayers);\n}\n\nCRp$a.redrawHint = function (group, bool) {\n var r = this;\n\n switch (group) {\n case 'eles':\n r.data.canvasNeedsRedraw[CRp$a.NODE] = bool;\n break;\n\n case 'drag':\n r.data.canvasNeedsRedraw[CRp$a.DRAG] = bool;\n break;\n\n case 'select':\n r.data.canvasNeedsRedraw[CRp$a.SELECT_BOX] = bool;\n break;\n }\n}; // whether to use Path2D caching for drawing\n\n\nvar pathsImpld = typeof Path2D !== 'undefined';\n\nCRp$a.path2dEnabled = function (on) {\n if (on === undefined) {\n return this.pathsEnabled;\n }\n\n this.pathsEnabled = on ? true : false;\n};\n\nCRp$a.usePaths = function () {\n return pathsImpld && this.pathsEnabled;\n};\n\nCRp$a.setImgSmoothing = function (context, bool) {\n if (context.imageSmoothingEnabled != null) {\n context.imageSmoothingEnabled = bool;\n } else {\n context.webkitImageSmoothingEnabled = bool;\n context.mozImageSmoothingEnabled = bool;\n context.msImageSmoothingEnabled = bool;\n }\n};\n\nCRp$a.getImgSmoothing = function (context) {\n if (context.imageSmoothingEnabled != null) {\n return context.imageSmoothingEnabled;\n } else {\n return context.webkitImageSmoothingEnabled || context.mozImageSmoothingEnabled || context.msImageSmoothingEnabled;\n }\n};\n\nCRp$a.makeOffscreenCanvas = function (width, height) {\n var canvas;\n\n if ((typeof OffscreenCanvas === \"undefined\" ? \"undefined\" : _typeof(OffscreenCanvas)) !== ( \"undefined\" )) {\n canvas = new OffscreenCanvas(width, height);\n } else {\n canvas = document.createElement('canvas'); // eslint-disable-line no-undef\n\n canvas.width = width;\n canvas.height = height;\n }\n\n return canvas;\n};\n\n[CRp, CRp$1, CRp$2, CRp$3, CRp$4, CRp$5, CRp$6, CRp$7, CRp$8, CRp$9].forEach(function (props) {\n extend(CRp$a, props);\n});\n\nvar renderer = [{\n name: 'null',\n impl: NullRenderer\n}, {\n name: 'base',\n impl: BR\n}, {\n name: 'canvas',\n impl: CR\n}];\n\nvar incExts = [{\n type: 'layout',\n extensions: layout\n}, {\n type: 'renderer',\n extensions: renderer\n}];\n\nvar extensions = {}; // registered modules for extensions, indexed by name\n\nvar modules = {};\n\nfunction setExtension(type, name, registrant) {\n var ext = registrant;\n\n var overrideErr = function overrideErr(field) {\n error('Can not register `' + name + '` for `' + type + '` since `' + field + '` already exists in the prototype and can not be overridden');\n };\n\n if (type === 'core') {\n if (Core.prototype[name]) {\n return overrideErr(name);\n } else {\n Core.prototype[name] = registrant;\n }\n } else if (type === 'collection') {\n if (Collection.prototype[name]) {\n return overrideErr(name);\n } else {\n Collection.prototype[name] = registrant;\n }\n } else if (type === 'layout') {\n // fill in missing layout functions in the prototype\n var Layout = function Layout(options) {\n this.options = options;\n registrant.call(this, options); // make sure layout has _private for use w/ std apis like .on()\n\n if (!plainObject(this._private)) {\n this._private = {};\n }\n\n this._private.cy = options.cy;\n this._private.listeners = [];\n this.createEmitter();\n };\n\n var layoutProto = Layout.prototype = Object.create(registrant.prototype);\n var optLayoutFns = [];\n\n for (var i = 0; i < optLayoutFns.length; i++) {\n var fnName = optLayoutFns[i];\n\n layoutProto[fnName] = layoutProto[fnName] || function () {\n return this;\n };\n } // either .start() or .run() is defined, so autogen the other\n\n\n if (layoutProto.start && !layoutProto.run) {\n layoutProto.run = function () {\n this.start();\n return this;\n };\n } else if (!layoutProto.start && layoutProto.run) {\n layoutProto.start = function () {\n this.run();\n return this;\n };\n }\n\n var regStop = registrant.prototype.stop;\n\n layoutProto.stop = function () {\n var opts = this.options;\n\n if (opts && opts.animate) {\n var anis = this.animations;\n\n if (anis) {\n for (var _i = 0; _i < anis.length; _i++) {\n anis[_i].stop();\n }\n }\n }\n\n if (regStop) {\n regStop.call(this);\n } else {\n this.emit('layoutstop');\n }\n\n return this;\n };\n\n if (!layoutProto.destroy) {\n layoutProto.destroy = function () {\n return this;\n };\n }\n\n layoutProto.cy = function () {\n return this._private.cy;\n };\n\n var getCy = function getCy(layout) {\n return layout._private.cy;\n };\n\n var emitterOpts = {\n addEventFields: function addEventFields(layout, evt) {\n evt.layout = layout;\n evt.cy = getCy(layout);\n evt.target = layout;\n },\n bubble: function bubble() {\n return true;\n },\n parent: function parent(layout) {\n return getCy(layout);\n }\n };\n extend(layoutProto, {\n createEmitter: function createEmitter() {\n this._private.emitter = new Emitter(emitterOpts, this);\n return this;\n },\n emitter: function emitter() {\n return this._private.emitter;\n },\n on: function on(evt, cb) {\n this.emitter().on(evt, cb);\n return this;\n },\n one: function one(evt, cb) {\n this.emitter().one(evt, cb);\n return this;\n },\n once: function once(evt, cb) {\n this.emitter().one(evt, cb);\n return this;\n },\n removeListener: function removeListener(evt, cb) {\n this.emitter().removeListener(evt, cb);\n return this;\n },\n removeAllListeners: function removeAllListeners() {\n this.emitter().removeAllListeners();\n return this;\n },\n emit: function emit(evt, params) {\n this.emitter().emit(evt, params);\n return this;\n }\n });\n define$3.eventAliasesOn(layoutProto);\n ext = Layout; // replace with our wrapped layout\n } else if (type === 'renderer' && name !== 'null' && name !== 'base') {\n // user registered renderers inherit from base\n var BaseRenderer = getExtension('renderer', 'base');\n var bProto = BaseRenderer.prototype;\n var RegistrantRenderer = registrant;\n var rProto = registrant.prototype;\n\n var Renderer = function Renderer() {\n BaseRenderer.apply(this, arguments);\n RegistrantRenderer.apply(this, arguments);\n };\n\n var proto = Renderer.prototype;\n\n for (var pName in bProto) {\n var pVal = bProto[pName];\n var existsInR = rProto[pName] != null;\n\n if (existsInR) {\n return overrideErr(pName);\n }\n\n proto[pName] = pVal; // take impl from base\n }\n\n for (var _pName in rProto) {\n proto[_pName] = rProto[_pName]; // take impl from registrant\n }\n\n bProto.clientFunctions.forEach(function (name) {\n proto[name] = proto[name] || function () {\n error('Renderer does not implement `renderer.' + name + '()` on its prototype');\n };\n });\n ext = Renderer;\n }\n\n return setMap({\n map: extensions,\n keys: [type, name],\n value: ext\n });\n}\n\nfunction getExtension(type, name) {\n return getMap({\n map: extensions,\n keys: [type, name]\n });\n}\n\nfunction setModule(type, name, moduleType, moduleName, registrant) {\n return setMap({\n map: modules,\n keys: [type, name, moduleType, moduleName],\n value: registrant\n });\n}\n\nfunction getModule(type, name, moduleType, moduleName) {\n return getMap({\n map: modules,\n keys: [type, name, moduleType, moduleName]\n });\n}\n\nvar extension = function extension() {\n // e.g. extension('renderer', 'svg')\n if (arguments.length === 2) {\n return getExtension.apply(null, arguments);\n } // e.g. extension('renderer', 'svg', { ... })\n else if (arguments.length === 3) {\n return setExtension.apply(null, arguments);\n } // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse')\n else if (arguments.length === 4) {\n return getModule.apply(null, arguments);\n } // e.g. extension('renderer', 'svg', 'nodeShape', 'ellipse', { ... })\n else if (arguments.length === 5) {\n return setModule.apply(null, arguments);\n } else {\n error('Invalid extension access syntax');\n }\n}; // allows a core instance to access extensions internally\n\n\nCore.prototype.extension = extension; // included extensions\n\nincExts.forEach(function (group) {\n group.extensions.forEach(function (ext) {\n setExtension(group.type, ext.name, ext.impl);\n });\n});\n\n// (useful for init)\n\nvar Stylesheet = function Stylesheet() {\n if (!(this instanceof Stylesheet)) {\n return new Stylesheet();\n }\n\n this.length = 0;\n};\n\nvar sheetfn = Stylesheet.prototype;\n\nsheetfn.instanceString = function () {\n return 'stylesheet';\n}; // just store the selector to be parsed later\n\n\nsheetfn.selector = function (selector) {\n var i = this.length++;\n this[i] = {\n selector: selector,\n properties: []\n };\n return this; // chaining\n}; // just store the property to be parsed later\n\n\nsheetfn.css = function (name, value) {\n var i = this.length - 1;\n\n if (string(name)) {\n this[i].properties.push({\n name: name,\n value: value\n });\n } else if (plainObject(name)) {\n var map = name;\n var propNames = Object.keys(map);\n\n for (var j = 0; j < propNames.length; j++) {\n var key = propNames[j];\n var mapVal = map[key];\n\n if (mapVal == null) {\n continue;\n }\n\n var prop = Style.properties[key] || Style.properties[dash2camel(key)];\n\n if (prop == null) {\n continue;\n }\n\n var _name = prop.name;\n var _value = mapVal;\n this[i].properties.push({\n name: _name,\n value: _value\n });\n }\n }\n\n return this; // chaining\n};\n\nsheetfn.style = sheetfn.css; // generate a real style object from the dummy stylesheet\n\nsheetfn.generateStyle = function (cy) {\n var style = new Style(cy);\n return this.appendToStyle(style);\n}; // append a dummy stylesheet object on a real style object\n\n\nsheetfn.appendToStyle = function (style) {\n for (var i = 0; i < this.length; i++) {\n var context = this[i];\n var selector = context.selector;\n var props = context.properties;\n style.selector(selector); // apply selector\n\n for (var j = 0; j < props.length; j++) {\n var prop = props[j];\n style.css(prop.name, prop.value); // apply property\n }\n }\n\n return style;\n};\n\nvar version = \"3.15.1\";\n\nvar cytoscape = function cytoscape(options) {\n // if no options specified, use default\n if (options === undefined) {\n options = {};\n } // create instance\n\n\n if (plainObject(options)) {\n return new Core(options);\n } // allow for registration of extensions\n else if (string(options)) {\n return extension.apply(extension, arguments);\n }\n}; // e.g. cytoscape.use( require('cytoscape-foo'), bar )\n\n\ncytoscape.use = function (ext) {\n var args = Array.prototype.slice.call(arguments, 1); // args to pass to ext\n\n args.unshift(cytoscape); // cytoscape is first arg to ext\n\n ext.apply(null, args);\n return this;\n};\n\ncytoscape.warnings = function (bool) {\n return warnings(bool);\n}; // replaced by build system\n\n\ncytoscape.version = version; // expose public apis (mostly for extensions)\n\ncytoscape.stylesheet = cytoscape.Stylesheet = Stylesheet;\n\nmodule.exports = cytoscape;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../timers-browserify/main.js */ \"./node_modules/timers-browserify/main.js\").setImmediate))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9jeXRvc2NhcGUvZGlzdC9jeXRvc2NhcGUuY2pzLmpzPzQ0ZTEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVhOztBQUViLCtCQUErQixpRkFBaUY7O0FBRWhILDJCQUEyQixtQkFBTyxDQUFDLGdFQUFpQjtBQUNwRCwyQkFBMkIsbUJBQU8sQ0FBQywwQ0FBTTs7QUFFekM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEdBQUc7QUFDSDtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxpQkFBaUIsa0JBQWtCO0FBQ25DO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0wsR0FBRztBQUNIO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FB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1bmN0aW9uIChuKSB7XG4gICAgICAgICAgcmV0dXJuICFuLnNhbWUodikgJiYgbm9kZXMuaGFzKG4pO1xuICAgICAgICB9KTtcbiAgICAgICAgdmFyIHdJZCA9IHcuaWQoKTtcblxuICAgICAgICBpZiAody5sZW5ndGggIT09IDAgJiYgIVZbd0lkXSkge1xuICAgICAgICAgIHcgPSB3WzBdO1xuICAgICAgICAgIFEucHVzaCh3KTtcblxuICAgICAgICAgIGlmIChwYXJhbXMuYmZzKSB7XG4gICAgICAgICAgICBWW3dJZF0gPSB0cnVlO1xuICAgICAgICAgICAgY29ubmVjdGVkTm9kZXMucHVzaCh3KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb25uZWN0ZWRCeVt3SWRdID0gZTtcbiAgICAgICAgICBpZDJkZXB0aFt3SWRdID0gaWQyZGVwdGhbdklkXSArIDE7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9O1xuXG4gICAgX2xvb3A6IHdoaWxlIChRLmxlbmd0aCAhPT0gMCkge1xuICAgICAgdmFyIF9yZXQgPSBfbG9vcDIoKTtcblxuICAgICAgc3dpdGNoIChfcmV0KSB7XG4gICAgICAgIGNhc2UgXCJjb250aW51ZVwiOlxuICAgICAgICAgIGNvbnRpbnVlO1xuXG4gICAgICAgIGNhc2UgXCJicmVha1wiOlxuICAgICAgICAgIGJyZWFrIF9sb29wO1xuICAgICAgfVxuICAgIH1cblxuICAgIHZhciBjb25uZWN0ZWRFbGVzID0gY3kuY29sbGVjdGlvbigpO1xuXG4gICAgZm9yICh2YXIgX2kgPSAwOyBfaSA8IGNvbm5lY3RlZE5vZGVzLmxlbmd0aDsgX2krKykge1xuICAgICAgdmFyIG5vZGUgPSBjb25uZWN0ZWROb2Rlc1tfaV07XG4gICAgICB2YXIgZWRnZSA9IGNvbm5lY3RlZEJ5W25vZGUuaWQoKV07XG5cbiAgICAgIGlmIChlZGdlICE9IG51bGwpIHtcbiAgICAgICAgY29ubmVjdGVkRWxlcy5tZ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YmIpIHtcbiAgaWYgKGJiID09IG51bGwpIHtcbiAgICByZXR1cm4ge1xuICAgICAgeDE6IEluZmluaXR5LFxuICAgICAgeTE6IEluZmluaXR5LFxuICAgICAgeDI6IC1JbmZpbml0eSxcbiAgICAgIHkyOiAtSW5maW5pdHksXG4gICAgICB3OiAwLFxuICAgICAgaDogMFxuICAgIH07XG4gIH0gZWxzZSBpZiAoYmIueDEgIT0gbnVsbCAmJiBiYi55MSAhPSBudWxsKSB7XG4gICAgaWYgKGJiLngyICE9IG51bGwgJiYgYmIueTIgIT0gbnVsbCAmJiBiYi54MiA+PSBiYi54MSAmJiBiYi55MiA+PSBiYi55MSkge1xuICAgICAgcmV0dXJuIHtcbiAgICAgICAgeDE6IGJiLngxLFxuICAgICAgICB5MTogYmIueTEsXG4gICAgICAgIHgyOiBiYi54MixcbiAgICAgICAgeTI6IGJiLnkyLFxuICAgICAgICB3OiBiYi54MiAtIGJiLngxLFxuICAgICAgICBoOiBiYi55MiAtIGJiLnkxXG4gICAgICB9O1xuICAgIH0gZWxzZSBpZiAoYmIudyAhPSBudWxsICYmIGJiLmggIT0gbnVsbCAmJiBiYi53ID49IDAgJiYgYmIuaCA+PSAwKSB7XG4gICAgICByZXR1cm4ge1xuICAgICAgICB4MTogYmIueDEsXG4gICAgICAgIHkxOiBiYi55MSxcbiAgICAgICAgeDI6IGJiLngxICsgYmIudyxcbiAgICAgICAgeTI6IGJiLnkxICsgYmIuaCxcbiAgICAgICAgdzogYmIudyxcbiAgICAgICAgaDogYmIuaFxuICAgICAgfTtcbiAgICB9XG4gIH1cbn07XG52YXIgY29weUJvdW5kaW5nQm94ID0gZnVuY3Rpb24gY29weUJvdW5kaW5nQm94KGJiKSB7XG4gIHJldHVybiB7XG4gICAgeDE6IGJiLngxLFxuICAgIHgyOiBiYi54MixcbiAgICB3OiBiYi53LFxuICAgIHkxOiBiYi55MSxcbiAgICB5MjogYmIueTIsXG4gICAgaDogYmIuaFxuICB9O1xufTtcbnZhciBjb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luZGVncmVlO1xuICAgICAgICBpZiAobWF4T3V0ZGVncmVlIDwgX2N1cnJEZWdyZWUub3V0ZGVncmVlKSBtYXhPdXRkZWdyZWUgPSBfY3VyckRlZ3JlZS5vdXRkZWdyZWU7XG4gICAgICAgIGluZGVncmVlc1tpZF0gPSBfY3VyckRlZ3JlZS5pbmRlZ3JlZTtcbiAgICAgICAgb3V0ZGVncmVlc1tpZF0gPSBfY3VyckRlZ3JlZS5vdXRkZWdyZWU7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB7XG4gICAgICAgIGluZGVncmVlOiBmdW5jdGlvbiBpbmRlZ3JlZShub2RlKSB7XG4gICAgICAgICAgaWYgKG1heEluZGVncmVlID09IDApIHtcbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdHJpbmcobm9kZSkpIHtcbiAgICAgICAgICAgIC8vIGZyb20gaXMgYSBzZWxlY3RvciBzdHJpbmdcbiAgICAgICAgICAgIG5vZGUgPSBjeS5maWx0ZXIobm9kZSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIGluZGVncmVlc1tub2RlLmlkKCldIC8gbWF4SW5kZWdyZWU7XG4gICAgICAgIH0sXG4gICAgICAgIG91dGRlZ3JlZTogZnVuY3Rpb24gb3V0ZGVncmVlKG5vZGUpIHtcbiAgICAgICAgICBpZiAobWF4T3V0ZGVncmVlID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc3RyaW5nKG5vZGUpKSB7XG4gICAgICAgICAgICAvLyBmcm9tIGlzIGEgc2VsZWN0b3Igc3RyaW5nXG4gICAgICAgICAgICBub2RlID0gY3kuZmlsdGVyKG5vZGUpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBvdXRkZWdyZWVzW25vZGUuaWQoKV0gLyBtYXhPdXRkZWdyZWU7XG4gICAgICAgIH1cbiAgICA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2UgdG8gc1xuXG4gICAgICBRLnB1c2goc2lkKTtcblxuICAgICAgd2hpbGUgKCFRLmVtcHR5KCkpIHtcbiAgICAgICAgdmFyIF92ID0gUS5wb3AoKTtcblxuICAgICAgICBTLnB1c2goX3YpO1xuXG4gICAgICAgIGlmICh3ZWlnaHRlZCkge1xuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgQVtfdl0ubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIHZhciB3ID0gQVtfdl1bal07XG4gICAgICAgICAgICB2YXIgdkVsZSA9IGN5LmdldEVsZW1lbnRCeUlkKF92KTtcbiAgICAgICAgICAgIHZhciBlZGdlID0gdm9pZCAwO1xuXG4gICAgICAgICAgICBpZiAodkVsZS5lZGdlc1RvKHcpLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgZWRnZSA9IHZFbGUuZWRnZXNUbyh3KVswXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGVkZ2UgPSB3LmVkZ2VzVG8odkVsZSlbMF07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBlZGdlV2VpZ2h0ID0gd2VpZ2h0KGVkZ2UpO1xuICAgICAgICAgICAgdyA9IHcuaWQoKTtcblxuICAgICAgICAgICAgaWYgKGRbd10gPiBkW192XSArIGVkZ2VXZWlnaHQpIHtcbiAgICAgICAgICAgICAgZFt3XSA9IGRbX3ZdICsgZWRnZVdlaWdodDtcblxuICAgICAgICAgICAgICBpZiAoUS5ub2Rlcy5pbmRleE9mKHcpIDwgMCkge1xuICAgICAgICAgICAgICAgIC8vaWYgdyBpcyBub3QgaW4gUVxuICAgICAgICAgICAgICAgIFEucHVzaCh3KTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyB1cGRhdGUgcG9zaXRpb24gaWYgdyBpcyBpbiBRXG4gICAgICAgICAgICAgICAgUS51cGRhdGVJdGVtKHcpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgZ1t3XSA9IDA7XG4gICAgICAgICAgICAgIFBbd10gPSBbXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGRbd10gPT0gZFtfdl0gKyBlZGdlV2VpZ2h0KSB7XG4gICAgICAgICAgICAgIGdbd10gPSBnW3ddICsgZ1tfdl07XG4gICAgICAgICAgICAgIFBbd10ucHVzaChfdik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGZvciAodmFyIF9qID0gMDsgX2ogPCBBW192XS5sZW5ndGg7IF9qKyspIHtcbiAgICAgICAgICAgIHZhciBfdyA9IEFbX3ZdW19qXS5pZCgpO1xuXG4gICAgICAgICAgICBpZiAoZFtfd10gPT0gSW5maW5pdHkpIHtcbiAgICAgICAgICAgICAgUS5wdXNoKF93KTtcbiAgICAgICAgICAgICAgZFtfd10gPSBkW192XSArIDE7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChkW193XSA9PSBkW192XSArIDEpIHtcbiAgICAgICAgICAgICAgZ1tfd10gPSBnW193XSArIGdbX3ZdO1xuXG4gICAgICAgICAgICAgIFBbX3ddLnB1c2goX3YpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICB2YXIgZSA9IHt9O1xuXG4gICAgICBmb3IgKHZhciBfaTIgPSAwOyBfaTIgPCBWLmxlbmd0aDsgX2kyKyspIHtcbiAgICAgICAgZVtWW19pMl0uaWQoKV0gPSAwO1xuICAgICAgfVxuXG4gICAgICB3aGlsZSAoUy5sZW5ndGggPiAwKSB7XG4gICAgICAgIHZhciBfdzIgPSBTLnBvcCgpO1xuXG4gICAgICAgIGZvciAodmFyIF9qMiA9IDA7IF9qMiA8IFBbX3cyXS5sZW5ndGg7IF9qMisrKSB7XG4gICAgICAgICAgdmFyIF92MiA9IFBbX3cyXVtfajJdO1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biAgICAgICAgICBtYXhJID0gLTEsXG4gICAgICAgICAgQVMgPSAwLjA7XG5cbiAgICAgIGZvciAodmFyIF9qID0gMDsgX2ogPCBuOyBfaisrKSB7XG4gICAgICAgIG9sZFtfal0gPSBSW19pOCAqIG4gKyBfal07XG4gICAgICAgIEFTID0gQVtfaTggKiBuICsgX2pdICsgU1tfaTggKiBuICsgX2pdO1xuXG4gICAgICAgIGlmIChBUyA+PSBtYXgpIHtcbiAgICAgICAgICBtYXgyID0gbWF4O1xuICAgICAgICAgIG1heCA9IEFTO1xuICAgICAgICAgIG1heEkgPSBfajtcbiAgICAgICAgfSBlbHNlIGlmIChBUyA+IG1heDIpIHtcbiAgICAgICAgICBtYXgyID0gQVM7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgZm9yICh2YXIgX2oyID0gMDsgX2oyIDwgbjsgX2oyKyspIHtcbiAgICAgICAgUltfaTggKiBuICsgX2oyXSA9ICgxIC0gb3B0cy5kYW1waW5nKSAqIChTW19pOCAqIG4gKyBfajJdIC0gbWF4KSArIG9wdHMuZGFtcGluZyAqIG9sZFtfajJdO1xuICAgICAgfVxuXG4gICAgICBSW19pOCAqIG4gKyBtYXhJXSA9ICgxIC0gb3B0cy5kYW1waW5nKSAqIChTW19pOCAqIG4gKyBtYXhJXSAtIG1heDIpICsgb3B0cy5kYW1waW5nICogb2xkW21heEldO1xuICAgIH0gLy8gVXBkYXRlIEEgYXZhaWxhYmlsaXR5IG1hdHJpeFxuXG5cbiAgICBmb3IgKHZhciBfaTkgPSAwOyBfaTkgPCBuOyBfaTkrKykge1xuICAgICAgdmFyIHN1bSA9IDA7XG5cbiAgICAgIGZvciAodmFyIF9qMyA9IDA7IF9qMyA8IG47IF9qMysrKSB7XG4gICAgICAgIG9sZFtfajNdID0gQVtfajMgKiBuICsgX2k5XTtcbiAgICAgICAgUnBbX2ozXSA9IE1hdGgubWF4KDAsIFJbX2ozICogbiArIF9pOV0pO1xuICAgICAgICBzdW0gKz0gUn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nlcbiAgICAgICAgfTtcbiAgICAgIH0gLy8gb3ZlcnJpZGUgcGFuIHcvIGNlbnRlciBpZiBzZXRcblxuXG4gICAgICB2YXIgY2VudGVyID0gcHJvcGVydGllcy5jZW50ZXIgfHwgcHJvcGVydGllcy5jZW50cmU7XG5cbiAgICAgIGlmIChpc0NvcmUgJiYgY2VudGVyICE9IG51bGwpIHtcbiAgICAgICAgdmFyIGNlbnRlclBhbiA9IGN5LmdldENlbnRlclBhbihjZW50ZXIuZWxlcywgcHJvcGVydGllcy56b29tKTtcblxuICAgICAgICBpZiAoY2VudGVyUGFuICE9IG51bGwpIHtcbiAgICAgICAgICBwcm9wZXJ0aWVzLnBhbiA9IGNlbnRlclBhbjtcbiAgICAgICAgfVxuICAgICAgfSAvLyBvdmVycmlkZSBwYW4gJiB6b29tIHcvIGZpdCBpZiBzZXRcblxuXG4gICAgICBpZiAoaXNDb3JlICYmIHByb3BlcnRpZXMuZml0ICE9IG51bGwpIHtcbiAgICAgICAgdmFyIGZpdCA9IHByb3BlcnRpZXMuZml0O1xuICAgICAgICB2YXIgZml0VnAgPSBjeS5nZXRGaXRWaWV3cG9ydChmaXQuZWxlcyB8fCBmaXQuYm91bmRpbmdCb3gsIGZpdC5wYWRkaW5nKTtcblxuICAgICAgICBpZiAoZml0VnAgIT0gbnVsbCkge1xuICAgICAgICAgIHByb3BlcnRpZXMucGFuID0gZml0VnAucGFuO1xuICAgICAgICAgIHByb3BlcnRpZXMuem9vbSA9IGZpdFZwLnpvb207XG4gICAgICAgIH1cbiAgICAgIH0gLy8gb3ZlcnJpZGUgem9vbSAoJiBwb3RlbnRpYWxseSBwYW4pIHcvIHpvb20gb2JqIGlmIHNldFxuXG5cbiAgICAgIGlmIChpc0NvcmUgJiYgcGxhaW5PYmplY3QocHJvcGVydGllcy56b29tKSkge1xuICAgICAgICB2YXIgdnAgPSBjeS5nZXRab29tZWRWaWV3cG9ydChwcm9wZXJ0aWVzLnpvb20pO1xuXG4gICAgICAgIGlm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XTsgLy8gcHV0IGluIGFycmF5IGlmIG5vdCBhcnJheS1saWtlXG5cbiAgICAgIHZhciBzaW5nbGUgPSBzZWxmSXNBcnJheUxpa2UgPyBzZWxmWzBdIDogc2VsZjsgLy8gLmRhdGEoJ2ZvbycsIC4uLilcblxuICAgICAgaWYgKHN0cmluZyhuYW1lKSkge1xuICAgICAgICAvLyBzZXQgb3IgZ2V0IHByb3BlcnR5XG4gICAgICAgIC8vIC5kYXRhKCdmb28nKVxuICAgICAgICBpZiAocC5hbGxvd0dldHRpbmcgJiYgdmFsdWUgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIC8vIGdldFxuICAgICAgICAgIHZhciByZXQ7XG5cbiAgICAgICAgICBpZiAoc2luZ2xlKSB7XG4gICAgICAgICAgICBwLmJlZm9yZUdldChzaW5nbGUpO1xuICAgICAgICAgICAgcmV0ID0gc2luZ2xlLl9wcml2YXRlW3AuZmllbGRdW25hbWVdO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiByZXQ7IC8vIC5kYXRhKCdmb28nLCAnYmFyJylcbiAgICAgICAgfSBlbHNlIGlmIChwLmFsbG93U2V0dGluZyAmJiB2YWx1ZSAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgLy8gc2V0XG4gICAgICAgICAgdmFyIHZhbGlkID0gIXAuaW1tdXRhYmxlS2V5c1tuYW1lXTtcblxuICAgICAgICAgIGlmICh2YWxpZCkge1xuICAgICAgICAgICAgdmFyIGNoYW5nZSA9IF9kZWZpbmVQcm9wZXJ0eSh7fSwgbmFtZSwgdmFsdWUpO1xuXG4gICAgICAgICAgICBwLmJlZm9yZVNldChzZWxmLCBjaGFuZ2UpO1xuXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgbCA9IGFsbC5sZW5ndGg7IGkgPCBsOyBpKyspIHtcbiAgICAgICAgICAgICAgdmFyIGVsZSA9IGFsbFtpXTtcblxuICAgICAgICAgICAgICBpZiAocC5jYW5TZXQoZWxlKSkge1xuICAgICAgICAgICAgICAgIGVsZS5fcHJpdmF0ZVtwLmZpZWxkXVtuYW1lXSA9IHZhbHVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IC8vIHVwZGF0ZSBtYXBwZXJzIGlmIGFza2VkXG5cblxuICAgICAgICAgICAgaWYgKHAudXBkYXRlU3R5bGUpIHtcbiAgICAgICAgICAgICAgc2VsZi51cGRhdGVTdHlsZSgpO1xuICAgICAgICAgICAgfSAvLyBjYWxsIG9uU2V0IGNhbGxiYWNrXG5cblxuICAgICAgICAgICAgcC5vblNldChzZWxmKTtcblxuICAgICAgICAgICAgaWYgKHAuc2V0dGluZ1RyaWdnZXJzRXZlbnQpIHtcbiAgICAgICAgICAgICAgc2VsZltwLnRyaWdnZXJGbk5hbWVdKHAuc2V0dGluZ0V2ZW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gLy8gLmRhdGEoeyAnZm9vJzogJ2JhcicgfSlcblxuICAgICAgfSBlbHNlIGlmIChwLmFsbG93U2V0dGluZyAmJiBwbGFpbk9iamVjdChuYW1lKSkge1xuICAgICAgICAvLyBleHRlbmRcbiAgICAgICAgdmFyIG9iaiA9IG5hbWU7XG4gICAgICAgIHZhciBrLCB2O1xuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIHAuYmVmb3JlU2V0KHNlbGYsIG9iaik7XG5cbiAgICAgICAgZm9yICh2YXIgX2kgPSAwOyBfaSA8IGtleXMubGVuZ3RoOyBfaSsrKSB7XG4gICAgICAgICAgayA9IGtleXNbX2ldO1xuICAgICAgICAgIHYgPSBvYmpba107XG5cbiAgICAgICAgICB2YXIgX3ZhbGlkID0gIXAuaW1tdXRhYmxlS2V5c1trXTtcblxuICAgICAgICAgIGlmIChfdmFsaWQpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgYWxsLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgIHZhciBfZWxlID0gYWxsW2pdO1xuXG4gICAgICAgICAgICAgIGlmIChwLmNhblNldChfZWxlKSkge1xuICAgICAgICAgICAgICAgIF9lbGUuX3ByaXZhdGVbcC5maWVsZF1ba10gPSB2O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IC8vIHVwZGF0ZSBtYXBwZXJzIGlmIGFza2VkXG5cblxuICAgICAgICBpZiAocC51cGRhdGVTdHlsZSkge1xuICAgICAgICAgIHNlbGYudXBkYXRlU3R5bGUoKTtcbiAgICAgICAgfSAvLyBjYWxsIG9uU2V0IGNhbGxiYWNrXG5cblxuICAgICAgICBwLm9uU2V0KHNlbGYpO1xuXG4gICAgICAgIGlmIChwLnNldHRpbmdUcmlnZ2Vyc0V2ZW50KSB7XG4gICAgICAgICAgc2VsZltwLnRyaWdnZXJGbk5hbWVdKHAuc2V0dGluZ0V2ZW50KTtcbiAgICAgICAgfSAvLyAuZGF0YShmdW5jdGlvbigpeyAuLi4gfSlcblxuICAgICAgfSBlbHNlIGlmIChwLmFsbG93QmluZGluZyAmJiBmbihuYW1lKSkge1xuICAgICAgICAvLyBiaW5kIHRvIGV2ZW50XG4gICAgICAgIHZhciBmbiQxID0gbmFtZTtcbiAgICAgICAgc2VsZi5vbihwLmJpbmRpbmdFdmVudCwgZm4kMSk7IC8vIC5kYXRhKClcbiAgICAgIH0gZWxzZSBpZiAocC5hbGxvd0dldHRpbmcgJiYgbmFtZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIC8vIGdldCB3aG9sZSBvYmplY3RcbiAgICAgICAgdmFyIF9yZXQ7XG5cbiAgICAgICAgaWYgKHNpbmdsZSkge1xuICAgICAgICAgIHAuYmVmb3JlR2V0KHNpbmdsZSk7XG4gICAgICAgICAgX3JldCA9IHNpbmdsZS5fcHJpdmF0ZVtwLmZpZWxkXTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBfcmV0O1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AgfVxuICB9O1xuXG4gIHZhciBzcGFjZSA9IGZ1bmN0aW9uIHNwYWNlKHZhbCkge1xuICAgIHJldHVybiAnICcgKyB2YWwgKyAnICc7XG4gIH07XG5cbiAgdmFyIGNoZWNrVG9TdHJpbmcgPSBmdW5jdGlvbiBjaGVja1RvU3RyaW5nKGNoZWNrLCBzdWJqZWN0KSB7XG4gICAgdmFyIHR5cGUgPSBjaGVjay50eXBlLFxuICAgICAgICB2YWx1ZSA9IGNoZWNrLnZhbHVlO1xuXG4gICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICBjYXNlIFR5cGUuR1JPVVA6XG4gICAgICAgIHtcbiAgICAgICAgICB2YXIgZ3JvdXAgPSBjbGVhbih2YWx1ZSk7XG4gICAgICAgICAgcmV0dXJuIGdyb3VwLnN1YnN0cmluZygwLCBncm91cC5sZW5ndGggLSAxKTtcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIFR5cGUuREFUQV9DT01QQVJFOlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIGZpZWxkID0gY2hlY2suZmllbGQsXG4gICAgICAgICAgICAgIG9wZXJhdG9yID0gY2hlY2sub3BlcmF0b3I7XG4gICAgICAgICAgcmV0dXJuICdbJyArIGZpZWxkICsgc3BhY2UoY2xlYW4ob3BlcmF0b3IpKSArIGNsZWFuVmFsKHZhbHVlKSArICddJztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIFR5cGUuREFUQV9CT09MOlxuICAgICAgICB7XG4gICAgICAgICAgdmFyIF9vcGVyYXRvciA9IGNoZWNrLm9wZXJhdG9yLFxuICAgICAgICAgICAgICBfZmllbGQgPSBjaGVjay5maWVsZDtcbiAgICAgICAgICByZXR1cm4gJ1snICsgY2xlYW4oX29wZXJhdG9yKSArIF9maWVsZCArICddJztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlIFR5cGUuREFUQV9FWElTVDpcbiAgICAgICAge1xuICAgICAgICAgIHZhciBfZmllbGQyID0gY2hlY2suZmllbGQ7X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AgIHZhciBfZm4gPSBwb3M7XG4gICAgICB2YXIgY3kgPSB0aGlzLmN5KCk7XG4gICAgICBjeS5zdGFydEJhdGNoKCk7XG5cbiAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgZWxlID0gdGhpc1tpXTtcblxuICAgICAgICB2YXIgX3BvcyA9IHZvaWQgMDtcblxuICAgICAgICBpZiAoX3BvcyA9IF9mbihlbGUsIGkpKSB7XG4gICAgICAgICAgaWYgKHNpbGVudCkge1xuICAgICAgICAgICAgZWxlLnNpbGVudFBvc2l0aW9uKF9wb3MpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBlbGUucG9zaXRpb24oX3Bvcyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGN5LmVuZEJhdGNoKCk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHRoaXM7IC8vIGNoYWluaW5nXG4gIH0sXG4gIHNpbGVudFBvc2l0aW9uczogZnVuY3Rpb24gc2lsZW50UG9zaXRpb25zKHBvcykge1xuICAgIHJldHVybiB0aGlzLnBvc2l0aW9ucyhwb3MsIHRydWUpO1xuICB9LFxuICBzaGlmdDogZnVuY3Rpb24gc2hpZnQoZGltLCB2YWwsIHNpbGVudCkge1xuICAgIHZhciBkZWx0YTtcblxuICAgIGlmIChwbGFpbk9iamVjdChkaW0pKSB7XG4gICAgICBkZWx0YSA9IHtcbiAgICAgICAgeDogbnVtYmVyKGRpbS54KSA/IGRpbS54IDogMCxcbiAgICAgICAgeTogbnVtYmVyKGRpbS55KSA/IGRpbS55IDogMFxuICAgICAgfTtcbiAgICAgIHNpbGVudCA9IHZhbDtcbiAgICB9IGVsc2UgaWYgKHN0cmluZyhkaW0pICYmIG51bWJlcih2YWwpKSB7XG4gICAgICBkZWx0YSA9IHtcbiAgICAgICAgeDogMCxcbiAgICAgICAgeTogMFxuICAgICAgfTtcbiAgIC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gdG8gcmV0dXJuIHBvc2l0aW9uXG4gICAgICBpZiAoc2V0dGluZykge1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICB2YXIgX2VsZTIgPSB0aGlzW2ldO1xuICAgICAgICAgIHZhciBwYXJlbnQgPSBoYXNDb21wb3VuZE5vZGVzID8gX2VsZTIucGFyZW50KCkgOiBudWxsO1xuICAgICAgICAgIHZhciBoYXNQYXJlbnQgPSBwYXJlbnQgJiYgcGFyZW50Lmxlbmd0aCA+IDA7XG4gICAgICAgICAgdmFyIHJlbGF0aXZlVG9QYXJlbnQgPSBoYXNQYXJlbnQ7XG5cbiAgICAgICAgICBpZiAoaGFzUGFyZW50KSB7XG4gICAgICAgICAgICBwYXJlbnQgPSBwYXJlbnRbMF07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdmFyIG9yaWdpbiA9IHJlbGF0aXZlVG9QYXJlbnQgPyBwYXJlbnQucG9zaXRpb24oKSA6IHtcbiAgICAgICAgICAgIHg6IDAsXG4gICAgICAgICAgICB5OiAwXG4gICAgICAgICAgfTtcblxuICAgICAgICAgIGlmICh2YWwgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgLy8gc2V0IG9uZSBkaW1lbnNpb25cbiAgICAgICAgICAgIF9lbGUyLnBvc2l0aW9uKGRpbSwgdmFsICsgb3JpZ2luW2RpbV0pO1xuICAgICAgICAgIH0gZWxzZSBpZiAocHBvcyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAvLyBzZXQgd2hvbGUgcG9zaXRpb25cbiAgICAgICAgICAgIF9lbGUyLnBvc2l0aW9uKHtcbiAgICAgICAgICAgICAgeDogcHBvcy54ICsgb3JpZ2luLngsXG4gICAgICAgICAgICAgIHk6IHBwb3MueSArIG9yaWdpbi55XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vIGdldHRpbmdcbiAgICAgICAgdmFyIHBvcyA9IGVsZS5wb3NpdGlvbigpO1xuXG4gICAgICAgIHZhciBfcGFyZW50ID0gaGFzQ29tcG91bmROb2RlcyA/IGVsZS5wYXJlbnQoKSA6IG51bGw7XG5cbiAgICAgICAgdmFyIF9oYXNQYXJlbnQgPSBfcGFyZW50ICYmIF9wYXJlbnQubGVuZ3RoID4gMDtcblxuICAgICAgICB2YXIgX3JlbGF0aXZlVG9QYXJlbnQgPSBfaGFzUGFyZW50O1xuXG4gICAgICAgIGlmIChfaGFzUGFyZW50KSB7XG4gICAgICAgICAgX3BhcmVudCA9IF9wYXJlbnRbMF07XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgX29yaWdpbiA9IF9yZWxhdGl2ZVRvUGFyZW50ID8gX3BhcmVudC5wb3NpdGlvbigpIDoge1xuICAgICAgICAgIHg6IDAsXG4gICAgICAgICAgeTogMFxuICAgICAgICB9O1xuXG4gICAgICAgIHBwb3MgPSB7XG4gICAgICAgICAgeDogcG9zLnggLSBfb3JpZ2luLngsXG4gICAgICAgICAgeTogcG9zLnkgLSBfb3JpZ2luLnlcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoZGltID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAvLyB0aGVuIHJldHVybiB0aGUgd2hvbGUgcmVuZGVyZWQgcG9zaXRpb25cbiAgICAgICAgICByZXR1cm4gcHBvcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyB0aGVuIHJldHVybiB0aGUgc3BlY2lmaWVkIGRpbWVuc2lvblxuICAgICAgICAgIHJldHVybiBwcG9zW2RpbV07XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2UgaWYgKCFzZXR0aW5nKSB7XG4gICAgICByZXR1cm4gdW5kZWZpbmVkOyAvLyBmb3IgZW1wdHkgY29sbGVjdGlvbiBjYXNlXG4gICAgfVxuXG4gICAgcmV0dXJuIHRoaXM7IC8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ICogd2lkdGggOiBwYWRkaW5nT2JqZWN0LnBmVmFsdWUgKiBoZWlnaHQgOiAwO1xuXG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKHBhZGRpbmdPYmplY3QudW5pdHMgPT09ICdweCcpIHtcbiAgICAgICAgcmV0dXJuIHBhZGRpbmdPYmplY3QucGZWYWx1ZTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiAwO1xuICAgICAgfVxuICAgIH1cblxuICAgIHZhciBsZWZ0VmFsID0gbWluLndpZHRoLmxlZnQudmFsdWU7XG5cbiAgICBpZiAobWluLndpZHRoLmxlZnQudW5pdHMgPT09ICdweCcgJiYgbWluLndpZHRoLnZhbCA+IDApIHtcbiAgICAgIGxlZnRWYWwgPSBsZWZ0VmFsICogMTAwIC8gbWluLndpZHRoLnZhbDtcbiAgICB9XG5cbiAgICB2YXIgcmlnaHRWYWwgPSBtaW4ud2lkdGgucmlnaHQudmFsdWU7XG5cbiAgICBpZiAobWluLndpZHRoLnJpZ2h0LnVuaXRzID09PSAncHgnICYmIG1pbi53aWR0aC52YWwgPiAwKSB7XG4gICAgICByaWdodFZhbCA9IHJpZ2h0VmFsICogMTAwIC8gbWluLndpZHRoLnZhbDtcbiAgICB9XG5cbiAgICB2YXIgdG9wVmFsID0gbWluLmhlaWdodC50b3AudmFsdWU7XG5cbiAgICBpZiAobWluLmhlaWdodC50b3AudW5pdHMgPT09ICdweCcgJiYgbWluLmhlaWdodC52YWwgPiAwKSB7XG4gICAgICB0b3BWYWwgPSB0b3BWYWwgKiAxMDAgLyBtaW4uaGVpZ2h0LnZhbDtcbiAgICB9XG5cbiAgICB2YXIgYm90dG9tVmFsID0gbWluLmhlaWdodC5ib3R0b20udmFsdWU7XG5cbiAgICBpZiAobWluLmhlaWdodC5ib3R0b20udW5pdHMgPT09ICdweCcgJiYgbWluLmhlaWdodC52YWwgPiAwK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nKS5wZlZhbHVlO1xuICAgIHZhciBsaCA9IGxhYmVsSGVpZ2h0O1xuICAgIHZhciBsdyA9IGxhYmVsV2lkdGg7XG4gICAgdmFyIGx3XzIgPSBsdyAvIDI7XG4gICAgdmFyIGxoXzIgPSBsaCAvIDI7XG4gICAgdmFyIGx4MSwgbHgyLCBseTEsIGx5MjtcblxuICAgIGlmIChpc0VkZ2UpIHtcbiAgICAgIGx4MSA9IGxhYmVsWCAtIGx3XzI7XG4gICAgICBseDIgPSBsYWJlbFggKyBsd18yO1xuICAgICAgbHkxID0gbGFiZWxZIC0gbGhfMjtcbiAgICAgIGx5MiA9IGxhYmVsWSArIGxoXzI7XG4gICAgfSBlbHNlIHtcbiAgICAgIHN3aXRjaCAoaGFsaWduLnZhbHVlKSB7XG4gICAgICAgIGNhc2UgJ2xlZnQnOlxuICAgICAgICAgIGx4MSA9IGxhYmVsWCAtIGx3O1xuICAgICAgICAgIGx4MiA9IGxhYmVsWDtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdjZW50ZXInOlxuICAgICAgICAgIGx4MSA9IGxhYmVsWCAtIGx3XzI7XG4gICAgICAgICAgbHgyID0gbGFiZWxYICsgbHdfMjtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdyaWdodCc6XG4gICAgICAgICAgbHgxID0gbGFiZWxYO1xuICAgICAgICAgIGx4MiA9IGxhYmVsWCArIGx3O1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgfVxuXG4gICAgICBzd2l0Y2ggKHZhbGlnbi52YWx1ZSkge1xuICAgICAgICBjYXNlICd0b3AnOlxuICAgICAgICAgIGx5MSA9IGxhYmVsWSAtIGxoO1xuICAgICAgICAgIGx5MiA9IGxhYmVsWTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdjZW50ZXInOlxuICAgICAgICAgIGx5MSA9IGxhYmVsWSAtIGxoXzI7XG4gICAgICAgICAgbHkyID0gbGFiZWxZICsgbGhfMjt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lICdib3R0b20nOlxuICAgICAgICAgICAgeW8gPSBseTE7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICB2YXIgcm90YXRlID0gZnVuY3Rpb24gcm90YXRlKHgsIHkpIHtcbiAgICAgICAgeCA9IHggLSB4bztcbiAgICAgICAgeSA9IHkgLSB5bztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICB4OiB4ICogY29zIC0geSAqIHNpbiArIHhvLFxuICAgICAgICAgIHk6IHggKiBzaW4gKyB5ICogY29zICsgeW9cbiAgICAgICAgfTtcbiAgICAgIH07XG5cbiAgICAgIHZhciBweDF5MSA9IHJvdGF0ZShseDEsIGx5MSk7XG4gICAgICB2YXIgcHgxeTIgPSByb3RhdGUobHgxLCBseTIpO1xuICAgICAgdmFyIHB4MnkxID0gcm90YXRlKGx4MiwgbHkxKTtcbiAgICAgIHZhciBweDJ5MiA9IHJvdGF0ZShseDIsIGx5Mik7XG4gICAgICBseDEgPSBNYXRoLm1pbihweDF5MS54LCBweDF5Mi54LCBweDJ5MS54LCBweDJ5Mi54KTtcbiAgICAgIGx4MiA9IE1hdGgubWF4KHB4MXkxLngsIHB4MXkyLngsIHB4MnkxLngsIHB4MnkyLngpO1xuICAgICAgbHkxID0gTWF0aC5taW4ocHgxeTEueSwgcHgxeTIueSwgcHgyeTEueSwgcHgyeTIueSk7XG4gICAgICBseTIgPSBNYXRoLm1heChweDF5MS55LCBweDF5Mi55LCBweDJ5MS55LCBweDJ5Mi55KTtcbiAgICB9XG5cbiAgICB2YXIgYmJQcmVmaXhSb3QgPSBiYlByZWZpeCArICdSb3QnO1xuICAgIHZhciBiYlJvdCA9IGJic1tiYlByZWZpeFJvdF0gPSBiYnNbYmJQcmVmaXhSb3RdIHx8IHt9O1xuICAgIGJiUm90LngxID0gbHgxO1xuICAgIGJiUm90LnkxID0gbHkxO1xuICAgIGJiUm90LngyID0gbHgyO1xuICAgIGJiUm90LnkyID0gbHkyO1x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8vLy8vLy8vLy8vLy8vLy8vLy8vXG5cbiAgICAgICAgZXgxID0gTWF0aC5taW4ocnN0eWxlLnNyY1gsIHJzdHlsZS5taWRYLCByc3R5bGUudGd0WCk7XG4gICAgICAgIGV4MiA9IE1hdGgubWF4KHJzdHlsZS5zcmNYLCByc3R5bGUubWlkWCwgcnN0eWxlLnRndFgpO1xuICAgICAgICBleTEgPSBNYXRoLm1pbihyc3R5bGUuc3JjWSwgcnN0eWxlLm1pZFksIHJzdHlsZS50Z3RZKTtcbiAgICAgICAgZXkyID0gTWF0aC5tYXgocnN0eWxlLnNyY1ksIHJzdHlsZS5taWRZLCByc3R5bGUudGd0WSk7IC8vIHRha2UgaW50byBhY2NvdW50IGVkZ2Ugd2lkdGhcblxuICAgICAgICBleDEgLT0gd0hhbGY7XG4gICAgICAgIGV4MiArPSB3SGFsZjtcbiAgICAgICAgZXkxIC09IHdIYWxmO1xuICAgICAgICBleTIgKz0gd0hhbGY7XG4gICAgICAgIHVwZGF0ZUJvdW5kcyhib3VuZHMsIGV4MSwgZXkxLCBleDIsIGV5Mik7IC8vIHByZWNpc2UgZWRnZXNcbiAgICAgICAgLy8vLy8vLy8vLy8vLy8vL1xuXG4gICAgICAgIGlmIChjdXJ2ZVN0eWxlID09PSAnaGF5c3RhY2snKSB7XG4gICAgICAgICAgdmFyIGhwdHMgPSByc3R5bGUuaGF5c3RhY2tQdHM7XG5cbiAgICAgICAgICBpZiAoaHB0cyAmJiBocHRzLmxlbmd0aCA9PT0gMikge1xuICAgICAgICAgICAgZXgxID0gaHB0c1swXS54O1xuICAgICAgICAgICAgZXkxID0gaHB0c1swXS55O1xuICAgICAgICAgICAgZXgyID0gaHB0c1sxXS54O1xuICAgICAgICAgICAgZXkyID0gaHB0c1sxXS55O1xuXG4gICAgICAgICAgICBpZiAoZXgxID4gZXgyKSB7XG4gICAgICAgICAgICAgIHZhciB0ZW1wID0gZXgxO1xuICAgICAgICAgICAgICBleDEgPSBleDI7XG4gICAgICAgICAgICAgIGV4MiA9IHRlbXA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChleTEgPiBleTIpIHtcbiAgICAgICAgICAgICAgdmFyIF90ZW1wID0gZXkxO1xuICAgICAgICAgICAgICBleTEgPSBleTI7XG4gICAgICAgICAgICAgIGV5MiA9IF90ZW1wO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB1cGRhdGVCb3VuZHMoYm91bmRzLCBleDEgLSB3SGFsZiwgZXkxIC0gd0hhbGYsIGV4MiArIHdIYWxmLCBleTIgKyB3SGFsZik7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGN1cnZlU3R5bGUgPT09ICdiZXppZXInIHx8IGN1cnZlU3R5bGUgPT09ICd1bmJ1bmRsZWQtYmV6aWVyJyB8fCBjdXJ2ZVN0eWxlID09PSAnc2VnbWVudHMnIHx8IGN1cnZlU3R5bGUgPT09ICd0YXhpJykge1xuICAgICAgICAgIHZhciBwdHM7XG5cbiAgICAgICAgICBzd2l0Y2ggKGN1cnZlU3R5bGUpIHtcbiAgICAgICAgICAgIGNhc2UgJ2Jlemllcic6XG4gICAgICAgICAgICBjYXNlICd1bmJ1bmRsZWQtYmV6aWVyJzpcbiAgICAgICAgICAgICAgcHRzID0gcnN0eWxlLmJlemllclB0cztcbiAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgIGNhc2UgJ3NlZ21lbnRzJzpcbiAgICAgICAgICAgIGNhc2UgJ3RheGknOlxuICAgICAgICAgICAgICBwdHMgPSByc3R5bGUubGluZVB0cztcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHB0cyAhPSBudWxsKSB7XG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHB0cy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICB2YXIgcHQgPSBwdHNbal07XG4gICAgICAgICAgICAgIGV4MSA9IHB0LnggLSB3SGFsZjtcbiAgICAgICAgICAgICAgZXgyID0gcHQueCArIHdIYWxmO1xuICAgICAgICAgICAgICBleTEgPSBwdC55IC0gd0hhbGY7XG4gICAgICAgICAgICAgIGV5MiA9IHB0LnkgKyB3SGFsZjtcbiAgICAgICAgICAgICAgdXBkYXRlQm91bmRzKGJvdW5kcywgZXgxLCBleTEsIGV4MiwgZXkyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gLy8gYmV6aWVyLWxpa2Ugb3Igc2VnbWVudC1saWtlIGVkZ2VcblxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgLy8gaGVhZGxlc3Mgb3Igc3R5bGUgZGlzYWJsZWRcbiAgICAgICAgLy8gZmFsbGJhY2sgb24gc291cmNlIGFuZCB0YXJnZXQgcG9zaXRpb25zXG4gICAgICAgIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL1xuICAgICAgICB2YXIgbjEgPSBlbGUuc291cmNlKCk7XG4gICAgICAgIHZhciBuMXBvcyA9IG4xLnBvc2l0aW9uKCk7XG4gICAgICAgIHZhciBuMiA9IGVsZS50YXJnZXQoKTtcbiAgICAgICAgdmFyIG4ycG9zID0gbjIucG9zaXRpb24oKTtcbiAgICAgICAgZXgxID0gbjFwb3MueDtcbiAgICAgICAgZXgyID0gbjJwb3MueDtcbiAgICAgICAgZXkxID0gbjFwb3MueTtcbiAgICAgICAgZXkyID0gbjJwb3MueTtcblxuICAgICAgICBpZiAoZXgxID4gZXgyKSB7XG4gICAgICAgICAgdmFyIF90ZW1wMiA9IGV4MTtcbiAgICAgICAgICBleDEgPSBleDI7XG4gICAgICAgICAgZXgyID0gX3RlbXAyO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGV5MSA+IGV5Mikge1xuICAgICAgICAgIHZhciBfdGVtcDMgPSBleTE7XG4gICAgICAgICAgZXkxID0gZXkyO1xuICAgICAgICAgIGV5MiA9IF90ZW1wMztc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2RlLnBvc2l0aW9uKG5ld1Bvcyk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMuZml0KSB7XG4gICAgICAgIHZhciBmaXRBbmkgPSBjeS5hbmltYXRpb24oe1xuICAgICAgICAgIGZpdDoge1xuICAgICAgICAgICAgYm91bmRpbmdCb3g6IGxheW91dEVsZXMuYm91bmRpbmdCb3hBdChnZXRGaW5hbFBvcyksXG4gICAgICAgICAgICBwYWRkaW5nOiBvcHRpb25zLnBhZGRpbmdcbiAgICAgICAgICB9LFxuICAgICAgICAgIGR1cmF0aW9uOiBvcHRpb25zLmFuaW1hdGlvbkR1cmF0aW9uLFxuICAgICAgICAgIGVhc2luZzogb3B0aW9ucy5hbmltYXRpb25FYXNpbmdcbiAgICAgICAgfSk7XG4gICAgICAgIGxheW91dC5hbmltYXRpb25zLnB1c2goZml0QW5pKTtcbiAgICAgIH0gZWxzZSBpZiAob3B0aW9ucy56b29tICE9PSB1bmRlZmluZWQgJiYgb3B0aW9ucy5wYW4gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICB2YXIgem9vbVBhbkFuaSA9IGN5LmFuaW1hdGlvbih7XG4gICAgICAgICAgem9vbTogb3B0aW9ucy56b29tLFxuICAgICAgICAgIHBhbjogb3B0aW9ucy5wYW4sXG4gICAgICAgICAgZHVyYXRpb246IG9wdGlvbnMuYW5pbWF0aW9uRHVyYXRpb24sXG4gICAgICAgICAgZWFzaW5nOiBvcHRpb25zLmFuaW1hdGlvbkVhc2luZ1xuICAgICAgICB9KTtcbiAgICAgICAgbGF5b3V0LmFuaW1hdGlvbnMucHVzaCh6b29tUGFuQW5pKTtcbiAgICAgIH1cblxuICAgICAgbGF5b3V0LmFuaW1hdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAoYW5pKSB7XG4gICAgICAgIHJldHVybiBhbmkucGxheSgpO1xuICAgICAgfSk7XG4gICAgICBsYXlvdXQub25lKCdsYXlvdXRyZWFkeScsIG9wdGlvbnMucmVhZHkpO1xuICAgICAgbGF5b3V0LmVtaXQoe1xuICAgICAgICB0eXBlOiAnbGF5b3V0cmVhZHknLFxuICAgICAgICBsYXlvdXQ6IGxheW91dFxuICAgICAgfSk7XG4gICAgICBQcm9taXNlJDEuYWxsKGxheW91dC5hbmltYXRpb25zLm1hcChmdW5jdGlvbiAoYW5pKSB7XG4gICAgICAgIHJldHVybiBhbmkucHJvbWlzZSgpO1xuICAgICAgfSkpLnRoZW4oZnVuY3Rpb24gKCkge1xuICAgICAgICBsYXlvdXQub25lKCdsYXlvdXRzdG9wJywgb3B0aW9ucy5zdG9wKTtcbiAgICAgICAgbGF5b3V0LmVtaXQoe1xuICAgICAgICAgIHR5cGU6ICdsYXlvdXRzdG9wJyxcbiAgICAgICAgICBsYXlvdXQ6IGxheW91dFxuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgIH0gZWxzZSB7XG4gICAgICBub2Rlcy5wb3NpdGlvbnMoZ2V0RmluYWxQb3MpO1xuXG4gICAgICBpZiAob3B0aW9ucy5maXQpIHtcbiAgICAgICAgY3kuZml0KG9wdGlvbnMuZWxlcywgb3B0aW9ucy5wYWRkaW5nKTtcbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMuem9vbSAhPSBudWxsKSB7XG4gICAgICAgIGN5Lnpvb20ob3B0aW9ucy56b29tKTtcbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMucGFuKSB7XG4gICAgICAgIGN5LnBhbihvcHRpb25zLnBhbik7XG4gICAgICB9XG5cbiAgICAgIGxheW91dC5vbmUoJ2xheW91dHJlYWR5Jywgb3B0aW9ucy5yZWFkeSk7XG4gICAgICBsYXlvdXQuZW1pdCh7XG4gICAgICAgIHR5cGU6ICdsYXlvdXRyZWFkeScsXG4gICAgICAgIGxheW91dDogbGF5b3V0XG4gICAgICB9KTtcbiAgICAgIGxheW91dC5vbmUoJ2xheW91dHN0b3AnLCBvcHRpb25zLnN0b3ApO1xuICAgICAgbGF5b3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bnMpO1xuICAgICAgfVxuICAgIH0gLy8gc3BlY2lmeSBhbiBhcnJheSBvZiBvcHRpb25zXG4gICAgZWxzZSBpZiAoYXJyYXkob3B0cykpIHtcbiAgICAgICAgdmFyIF9qc29ucyA9IG9wdHM7XG4gICAgICAgIGVsZW1lbnRzID0gbmV3IENvbGxlY3Rpb24oY3ksIF9qc29ucyk7XG4gICAgICB9IC8vIHNwZWNpZnkgdmlhIG9wdHMubm9kZXMgYW5kIG9wdHMuZWRnZXNcbiAgICAgIGVsc2UgaWYgKHBsYWluT2JqZWN0KG9wdHMpICYmIChhcnJheShvcHRzLm5vZGVzKSB8fCBhcnJheShvcHRzLmVkZ2VzKSkpIHtcbiAgICAgICAgICB2YXIgZWxlc0J5R3JvdXAgPSBvcHRzO1xuICAgICAgICAgIHZhciBfanNvbnMyID0gW107XG4gICAgICAgICAgdmFyIGdycyA9IFsnbm9kZXMnLCAnZWRnZXMnXTtcblxuICAgICAgICAgIGZvciAodmFyIF9pID0gMCwgaWwgPSBncnMubGVuZ3RoOyBfaSA8IGlsOyBfaSsrKSB7XG4gICAgICAgICAgICB2YXIgZ3JvdXAgPSBncnNbX2ldO1xuICAgICAgICAgICAgdmFyIGVsZXNBcnJheSA9IGVsZXNCeUdyb3VwW2dyb3VwXTtcblxuICAgICAgICAgICAgaWYgKGFycmF5KGVsZXNBcnJheSkpIHtcbiAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDAsIGpsID0gZWxlc0FycmF5Lmxlbmd0aDsgaiA8IGpsOyBqKyspIHtcbiAgICAgICAgICAgICAgICB2YXIganNvbiA9IGV4dGVuZCh7XG4gICAgICAgICAgICAgICAgICBncm91cDogZ3JvdXBcbiAgICAgICAgICAgICAgICB9LCBlbGVzQXJyYXlbal0pO1xuXG4gICAgICAgICAgICAgICAgX2pzb25zMi5wdXNoKGpzb24pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZWxlbWV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nOiAnICsgZmllbGRWYWwgKyAnYCBmb3IgYCcgKyBlbGUuaWQoKSArICdgIGlzIG5vbi1udW1lcmljKScpO1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB2YXIgZmllbGRXaWR0aCA9IHByb3AuZmllbGRNYXggLSBwcm9wLmZpZWxkTWluO1xuXG4gICAgICAgICAgaWYgKGZpZWxkV2lkdGggPT09IDApIHtcbiAgICAgICAgICAgIC8vIHNhZmV0eSBjaGVjayAtLSBub3Qgc3RyaWN0bHkgbmVjZXNzYXJ5IGFzIG5vIHByb3BzIG9mIHplcm8gcmFuZ2Ugc2hvdWxkIGJlIHBhc3NlZCBoZXJlXG4gICAgICAgICAgICBwZXJjZW50ID0gMDtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcGVyY2VudCA9IChmaWVsZFZhbCAtIHByb3AuZmllbGRNaW4pIC8gZmllbGRXaWR0aDtcbiAgICAgICAgICB9XG4gICAgICAgIH0gLy8gbWFrZSBzdXJlIHRvIGJvdW5kIHBlcmNlbnQgdmFsdWVcblxuXG4gICAgICAgIGlmIChwZXJjZW50IDwgMCkge1xuICAgICAgICAgIHBlcmNlbnQgPSAwO1xuICAgICAgICB9IGVsc2UgaWYgKHBlcmNlbnQgPiAxKSB7XG4gICAgICAgICAgcGVyY2VudCA9IDE7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZS5jb2xvcikge1xuICAgICAgICAgIHZhciByMSA9IHByb3AudmFsdWVNaW5bMF07XG4gICAgICAgICAgdmFyIHIyID0gcHJvcC52YWx1ZU1heFswXTtcbiAgICAgICAgICB2YXIgZzEgPSBwcm9wLnZhbHVlTWluWzFdO1xuICAgICAgICAgIHZhciBnMiA9IHByb3AudmFsdWVNYXhbMV07XG4gICAgICAgICAgdmFyIGIxID0gcHJvcC52YWx1ZU1pblsyXTtcbiAgICAgICAgICB2YXIgYjIgPSBwcm9wLnZhbHVlTW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W50YWdlczoge1xuICAgICAgbnVtYmVyOiB0cnVlLFxuICAgICAgbWluOiAwLFxuICAgICAgbWF4OiAxMDAsXG4gICAgICB1bml0czogJyUnLFxuICAgICAgaW1wbGljaXRVbml0czogJyUnLFxuICAgICAgbXVsdGlwbGU6IHRydWVcbiAgICB9LFxuICAgIHplcm9PbmVOdW1iZXI6IHtcbiAgICAgIG51bWJlcjogdHJ1ZSxcbiAgICAgIG1pbjogMCxcbiAgICAgIG1heDogMSxcbiAgICAgIHVuaXRsZXNzOiB0cnVlXG4gICAgfSxcbiAgICB6ZXJvT25lTnVtYmVyczoge1xuICAgICAgbnVtYmVyOiB0cnVlLFxuICAgICAgbWluOiAwLFxuICAgICAgbWF4OiAxLFxuICAgICAgdW5pdGxlc3M6IHRydWUsXG4gICAgICBtdWx0aXBsZTogdHJ1ZVxuICAgIH0sXG4gICAgbk9uZU9uZU51bWJlcjoge1xuICAgICAgbnVtYmVyOiB0cnVlLFxuICAgICAgbWluOiAtMSxcbiAgICAgIG1heDogMSxcbiAgICAgIHVuaXRsZXNzOiB0cnVlXG4gICAgfSxcbiAgICBub25OZWdhdGl2ZUludDoge1xuICAgICAgbnVtYmVyOiB0cnVlLFxuICAgICAgbWluOiAwLFxuICAgICAgaW50ZWdlcjogdHJ1ZSxcbiAgICAgIHVuaXRsZXNzOiB0cnVlXG4gICAgfSxcbiAgICBwb3NpdGlvbjoge1xuICAgICAgZW51bXM6IFsncGFyZW50JywgJ29yaWdpbiddXG4gICAgfSxcbiAgICBub2RlU2l6ZToge1xuICAgICAgbnVtYmVyOiB0cnVlLFxuICAgICAgbWluOiAwLFxuICAgICAgZW51bXM6IFsnbGFiZWwnXVxuICAgIH0sXG4gICAgbnVtYmVyOiB7XG4gICAgICBudW1iZXI6IHRydWUsXG4gICAgICB1bml0bGVzczogdHJ1ZVxuICAgIH0sXG4gICAgbnVtYmVyczoge1xuICAgICAgbnVtYmVyOiB0cnVlLFxuICAgICAgdW5pdGxlc3M6IHRydWUs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VtYmVyOiB0cnVlLFxuICAgICAgbWluOiAwLFxuICAgICAgYWxsb3dQZXJjZW50OiB0cnVlLFxuICAgICAgZW51bXM6IFsnYXV0byddLFxuICAgICAgbXVsdGlwbGU6IHRydWVcbiAgICB9LFxuICAgIGJnUG9zOiB7XG4gICAgICBudW1iZXI6IHRydWUsXG4gICAgICBhbGxvd1BlcmNlbnQ6IHRydWUsXG4gICAgICBtdWx0aXBsZTogdHJ1ZVxuICAgIH0sXG4gICAgYmdSZWxhdGl2ZVRvOiB7XG4gICAgICBlbnVtczogWydpbm5lcicsICdpbmNsdWRlLXBhZGRpbmcnXSxcbiAgICAgIG11bHRpcGxlOiB0cnVlXG4gICAgfSxcbiAgICBiZ1JlcGVhdDoge1xuICAgICAgZW51bXM6IFsncmVwZWF0JywgJ3JlcGVhdC14JywgJ3JlcGVhdC15JywgJ25vLXJlcGVhdCddLFxuICAgICAgbXVsdGlwbGU6IHRydWVcbiAgICB9LFxuICAgIGJnRml0OiB7XG4gICAgICBlbnVtczogWydub25lJywgJ2NvbnRhaW4nLCAnY292ZXInXSxcbiAgICAgIG11bHRpcGxlOiB0cnVlXG4gICAgfSxcbiAgICBiZ0Nyb3NzT3JpZ2luOiB7XG4gICAgICBlbnVtczogWydhbm9ueW1vdXMnLCAndXNlLWNyZWRlbnRpYWxzJ10sXG4gICAgICBtdWx0aXBsZTogdHJ1ZVxuICAgIH0sXG4gICAgYmdDbGlwOiB7XG4gICAgICBlbnVtczogWydub25lJywgJ25vZGUnXSxcbiAgICAgIG11bHRpcGxlOiB0cnVlXG4gICAgfSxcbiAgICBjb2xvcjoge1xuICAgICAgY29sb3I6IHRydWVcbiAgICB9LFxuICAgIGNvbG9yczoge1xuICAgICAgY29sb3I6IHRydWUsXG4gICAgICBtdWx0aXBsZTogdHJ1ZVxuICAgIH0sXG4gICAgZmlsbDoge1xuICAgICAgZW51bXM6IFsnc29saWQnLCAnbGluZWFyLWdyYWRpZW50JywgJ3JhZGlhbC1ncmFkaWV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gICAgcmV0dXJuIHBhbjtcblxuICAgICAgY2FzZSAxOlxuICAgICAgICBpZiAoc3RyaW5nKGFyZ3NbMF0pKSB7XG4gICAgICAgICAgLy8gLnBhbigneCcpXG4gICAgICAgICAgZGltID0gYXJnc1swXTtcbiAgICAgICAgICByZXR1cm4gcGFuW2RpbV07XG4gICAgICAgIH0gZWxzZSBpZiAocGxhaW5PYmplY3QoYXJnc1swXSkpIHtcbiAgICAgICAgICAvLyAucGFuKHsgeDogMCwgeTogMTAwIH0pXG4gICAgICAgICAgaWYgKCF0aGlzLl9wcml2YXRlLnBhbm5pbmdFbmFibGVkKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBkaW1zID0gYXJnc1swXTtcbiAgICAgICAgICB4ID0gZGltcy54O1xuICAgICAgICAgIHkgPSBkaW1zLnk7XG5cbiAgICAgICAgICBpZiAobnVtYmVyKHgpKSB7XG4gICAgICAgICAgICBwYW4ueCA9IHg7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKG51bWJlcih5KSkge1xuICAgICAgICAgICAgcGFuLnkgPSB5O1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuZW1pdCgncGFuIHZpZXdwb3J0Jyk7XG4gICAgICAgIH1cblxuICAgICAgICBicmVhaztcblxuICAgICAgY2FzZSAyOlxuICAgICAgICAvLyAucGFuKCd4JywgMTAwKVxuICAgICAgICBpZiAoIXRoaXMuX3ByaXZhdGUucGFubmluZ0VuYWJsZWQpIHtcbiAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuXG4gICAgICAgIGRpbSA9IGFyZ3NbMF07XG4gICAgICAgIHZhbCA9IGFyZ3NbMV07XG5cbiAgICAgICAgaWYgKChkaW0gPT09ICd4JyB8fCBkaW0gPT09ICd5JykgJiYgbnVtYmVyKHZhbCkpIHtcbiAgICAgICAgICBwYW5bZGltXSA9IHZhbDtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuZW1pdCgncGFuIHZpZXdwb3J0Jyk7XG4gICAgICAgIGJyZWFrO1xuICAgICAgLy8gaW52YWxpZFxuICAgIH1cblxuICAgIHRoaXMubm90aWZ5KCd2aWV3cG9ydCcpO1xuICAgIHJldHVybiB0aGlzOyAvLyBjaGFpbmluZ1xuICB9LFxuICBwYW5CeTogZnVuY3Rpb24gcGFuQnkoYXJnMCwgYXJnMSkge1xuICAgIHZhciBhcmdzID0gYXJndW1lbnRzO1xuICAgIHZhciBwYW4gPSB0aGlzLl9wcml2YXRlLnBhbjtcbiAgICB2YXIgZGltLCB2YWwsIGRpbXMsIHgsIHk7XG5cbiAgICBpZiAoIXRoaXMuX3ByaXZhdGUucGFubmluZ0VuYWJsZWQpIHtcbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIHN3aXRjaCAoYXJncy5sZW5ndGgpIHtcbiAgICAgIGNhc2UgMTpcbiAgICAgICAgaWYgKHBsYWluT2JqZWN0KGFyZzApKSB7XG4gICAgICAgICAgLy8gLnBhbkJ5KHsgeDogMCwgeTogMTAwIH0pXG4gICAgICAgICAgZGltcyA9IGFyZ3NbMF07XG4gICAgICAgICAgeCA9IGRpbXMueDtcbiAgICAgICAgICB5ID0gZGltcy55O1xuXG4gICAgICAgICAgaWYgKG51bWJlcih4KSkge1xuICAgICAgICAgICAgcGFuLnggKz0geDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAobnVtYmVyKHkpKSB7XG4gICAgICAgICAgICBwYW4ueSArPSB5O1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuZW1pdCgncGFuIHZpZXdwb3J0Jyk7XG4gICAgICAgIH1cblxuICAgICAgICBicmVhaztcblxuICAgICAgY2FzZSAyOlxuICAgICAgICAvLyAucGFuQnkoJ3gnLCAxMDApXG4gICAgICAgIGRpbSA9IGFyZzA7XG4gICAgICAgIHZhbCA9IGFyZzE7XG5cbiAgICAgICAgaWYgKChkaW0gPT09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AgJiYgaCA+IDAgJiYgIWlzTmFOKGJiLncpICYmICFpc05hTihiYi5oKSAmJiBiYi53ID4gMCAmJiBiYi5oID4gMCkge1xuICAgICAgem9vbSA9IE1hdGgubWluKCh3IC0gMiAqIHBhZGRpbmcpIC8gYmIudywgKGggLSAyICogcGFkZGluZykgLyBiYi5oKTsgLy8gY3JvcCB6b29tXG5cbiAgICAgIHpvb20gPSB6b29tID4gdGhpcy5fcHJpdmF0ZS5tYXhab29tID8gdGhpcy5fcHJpdmF0ZS5tYXhab29tIDogem9vbTtcbiAgICAgIHpvb20gPSB6b29tIDwgdGhpcy5fcHJpdmF0ZS5taW5ab29tID8gdGhpcy5fcHJpdmF0ZS5taW5ab29tIDogem9vbTtcbiAgICAgIHZhciBwYW4gPSB7XG4gICAgICAgIC8vIG5vdyBwYW4gdG8gbWlkZGxlXG4gICAgICAgIHg6ICh3IC0gem9vbSAqIChiYi54MSArIGJiLngyKSkgLyAyLFxuICAgICAgICB5OiAoaCAtIHpvb20gKiAoYmIueTEgKyBiYi55MikpIC8gMlxuICAgICAgfTtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIHpvb206IHpvb20sXG4gICAgICAgIHBhbjogcGFuXG4gICAgICB9O1xuICAgIH1cblxuICAgIHJldHVybjtcbiAgfSxcbiAgem9vbVJhbmdlOiBmdW5jdGlvbiB6b29tUmFuZ2UobWluLCBtYXgpIHtcbiAgICB2YXIgX3AgPSB0aGlzLl9wcml2YXRlO1xuXG4gICAgaWYgKG1heCA9PSBudWxsKSB7XG4gICAgICB2YXIgb3B0cyA9IG1pbjtcbiAgICAgIG1pbiA9IG9wdHMubWluO1xuICAgICAgbWF4ID0gb3B0cy5tYXg7XG4gICAgfVxuXG4gICAgaWYgKG51bWJlcihtaW4pICYmIG51bWJlcihtYXgpICYmIG1pbiA8PSBtYXgpIHtcbiAgICAgIF9wLm1pblpvb20gPSBtaW47XG4gICAgICBfcC5tYXhab29tID0gbWF4O1xuICAgIH0gZWxzZSBpZiAobnVtYmVyKG1pbikgJiYgbWF4ID09PSB1bmRlZmluZWQgJiYgbWluIDw9IF9wLm1heFpvb20pIHtcbiAgICAgIF9wLm1pblpvb20gPSBtaW47XG4gICAgfSBlbHNlIGlmIChudW1iZXIobWF4KSAmJiBtaW4gPT09IHVuZGVmaW5lZCAmJiBtYXggPj0gX3AubWluWm9vbSkge1xuICAgICAgX3AubWF4Wm9vbSA9IG1heDtcbiAgICB9XG5cbiAgICByZXR1cm4gdGhpcztcbiAgfSxcbiAgbWluWm9vbTogZnVuY3Rpb24gbWluWm9vbSh6b29tKSB7XG4gICAgaWYgKHpvb20gPT09IHVuZGVmaW5lZCkge1xuICAgICAgcmV0dXJuIHRoaXMuX3ByaXZhdGUubWluWm9vbTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIHRoaXMuem9vbVJhbmdlKHtcbiAgICAgICAgbWluOiB6b29tXG4gICAgICB9KTtcbiAgICB9XG4gIH0sXG4gIG1heFpvb206IGZ1bmN0aW9uIG1heFpvb20oem9vbSkge1xuICAgIGlmICh6b29tID09PSB1bmRlZmluZWQpIHtcbiAgICAgIHJldHVybiB0aGlzLl9wcml2YXRlLm1heFpvb207XG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiB0aGlzLnpvb21SYW5nZSh7XG4gICAgICAgIG1heDogem9vbVxuICAgICAgfSk7XG4gICAgfVxuICB9LFxuICBnZXRab29tZWRWaWV3cG9ydDogZnVuY3Rpb24gZ2V0Wm9vbWVkVmlld3BvcnQocGFyYW1zKSB7XG4gICAgdmFyIF9wID0gdGhpcy5fcHJpdmF0ZTtcbiAgICB2YXIgY3VycmVudFBhbiA9IF9wLnBhbjtcbiAgICB2YXIgY3VycmVudFpvb20gPSBfcC56b29tO1xuICAgIHZhciBwb3M7IC8vIGluIHJlbmRlcmVkIHB4XG5cbiAgICB2YXIgem9vbTtcbiAgICB2YXIgYmFpbCA9IGZhbHNlO1xuXG4gICAgaWYgKCFfcC56b29taW5nRW5hYm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pIHtcbiAgICAgIHJldHVybiBudWxsO1xuICAgIH1cblxuICAgIGlmIChwb3MgIT0gbnVsbCkge1xuICAgICAgLy8gc2V0IHpvb20gYWJvdXQgcG9zaXRpb25cbiAgICAgIHZhciBwYW4xID0gY3VycmVudFBhbjtcbiAgICAgIHZhciB6b29tMSA9IGN1cnJlbnRab29tO1xuICAgICAgdmFyIHpvb20yID0gem9vbTtcbiAgICAgIHZhciBwYW4yID0ge1xuICAgICAgICB4OiAtem9vbTIgLyB6b29tMSAqIChwb3MueCAtIHBhbjEueCkgKyBwb3MueCxcbiAgICAgICAgeTogLXpvb20yIC8gem9vbTEgKiAocG9zLnkgLSBwYW4xLnkpICsgcG9zLnlcbiAgICAgIH07XG4gICAgICByZXR1cm4ge1xuICAgICAgICB6b29tZWQ6IHRydWUsXG4gICAgICAgIHBhbm5lZDogdHJ1ZSxcbiAgICAgICAgem9vbTogem9vbTIsXG4gICAgICAgIHBhbjogcGFuMlxuICAgICAgfTtcbiAgICB9IGVsc2Uge1xuICAgICAgLy8ganVzdCBzZXQgdGhlIHpvb21cbiAgICAgIHJldHVybiB7XG4gICAgICAgIHpvb21lZDogdHJ1ZSxcbiAgICAgICAgcGFubmVkOiBmYWxzZSxcbiAgICAgICAgem9vbTogem9vbSxcbiAgICAgICAgcGFuOiBjdXJyZW50UGFuXG4gICAgICB9O1xuICAgIH1cbiAgfSxcbiAgem9vbTogZnVuY3Rpb24gem9vbShwYXJhbXMpIHtcbiAgICBpZiAocGFyYW1zID09PSB1bmRlZmluZWQpIHtcbiAgICAgIC8vIGdldFxuICAgICAgcmV0dXJuIHRoaXMuX3ByaXZhdGUuem9vbTtcbiAgICB9IGVsc2Uge1xuICAgICAgLy8gc2V0XG4gICAgICB2YXIgdnAgPSB0aGlzLmdldFpvb21lZFZpZXdwb3J0KHBhcmFtcyk7XG4gICAgICB2YXIgX3AgPSB0aGlzLl9wcml2YXRlO1xuXG4gICAgICBpZiAodnAgPT0gbnVsbCB8fCAhdnAuem9vbWVkKSB7XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgfVxuXG4gICAgICBfcC56b29tID0gdnAuem9vbTtcblxuICAgICAgaWYgKHZwLnBhbm5lZCkge1xuICAgICAgICBfcC5wYW4ueCA9IHZwLnBhbi54O1xuICAgICAgICBfcC5wYW4ueSA9IHZwLnBhbi55O1xuICAgICAgfVxuXG4gICAgICB0aGlzLmVtaXQoJ3pvb20nICsgKHZwLnBhbm5lZCA/ICcgcGFuJyA6ICcnKSArICcgdmlld3BvcnQnKTtcbiAgICAgIHRoaXMubm90aWZ5KCd2aWV3cG9ydCcpO1xuICAgICAgcmV0dXJuIHRoaXM7IC8vIGNoYWluaW5nXG4gICAgfVxuICB9LFxuICB2aWV3cG9ydDogZnVuY3Rpb24gdmlld3BvcnQob3B0cykge1xuICAgIHZhciBfcCA9IHRoaXMuX3ByaXZhdGU7XG4gICAgdmFyIHpvb21EZWZkID0gdHJ1ZTtcbiAgICB2YXIgcGFuRGVmZCA9IHRydWU7XG4gICAgdmFyIGV2ZW50cyA9IFtdOyAvLyB0byB0cmlnZ2VyXG5cbiAgICB2YXIgem9vbUZhaWxlZCA9IGZhbHNlO1xuICAgIHZhciBwYW5GYWlsZWQgPSBmYWxzZTtcblxuICAgIGlmICghb3B0cykge1xuICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuXG4gICAgaWYgKCFudW1iZXIob3B0cy56b29tKSkge1xuICAgICAgem9vbURlZmQgPSBmYWxzZTtcbiAgICB9XG5cbiAgICBpZiAoIXBsYWluT2JqZWN0KG9wdHMucGFuKSkge1xuICAgICAgcGFuRGVmZCA9IGZhbHNlO1xuICAgIH1cblxuICAgIGlmICghem9vbURlZmQgJiYgIXBhbkRlZmQpIHtcbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIGlmICh6b29tRGVmZCkge1xuICAgICAgdmFyIHogPSBvcHRzLnpvb207XG5cbiAgICAgIGlmICh6IDwgX3AubWluWm9vbSB8fCB6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dGlvbiB1cGRhdGVFbGVzKGpzb25zLCBncikge1xuICAgICAgICAgIHZhciB0b0FkZCA9IFtdO1xuICAgICAgICAgIHZhciB0b01vZCA9IFtdO1xuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBqc29ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGpzb24gPSBqc29uc1tpXTtcbiAgICAgICAgICAgIHZhciBpZCA9ICcnICsganNvbi5kYXRhLmlkOyAvLyBpZCBtdXN0IGJlIHN0cmluZ1xuXG4gICAgICAgICAgICB2YXIgZWxlID0gY3kuZ2V0RWxlbWVudEJ5SWQoaWQpO1xuICAgICAgICAgICAgaWRJbkpzb25baWRdID0gdHJ1ZTtcblxuICAgICAgICAgICAgaWYgKGVsZS5sZW5ndGggIT09IDApIHtcbiAgICAgICAgICAgICAgLy8gZXhpc3RpbmcgZWxlbWVudCBzaG91bGQgYmUgdXBkYXRlZFxuICAgICAgICAgICAgICB0b01vZC5wdXNoKHtcbiAgICAgICAgICAgICAgICBlbGU6IGVsZSxcbiAgICAgICAgICAgICAgICBqc29uOiBqc29uXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgLy8gb3RoZXJ3aXNlIHNob3VsZCBiZSBhZGRlZFxuICAgICAgICAgICAgICBpZiAoZ3IpIHtcbiAgICAgICAgICAgICAgICBqc29uLmdyb3VwID0gZ3I7XG4gICAgICAgICAgICAgICAgdG9BZGQucHVzaChqc29uKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0b0FkZC5wdXNoKGpzb24pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY3kuYWRkKHRvQWRkKTtcblxuICAgICAgICAgIGZvciAodmFyIF9pID0gMDsgX2kgPCB0b01vZC5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgICAgIHZhciBfdG9Nb2QkX2kgPSB0b01vZFtfaV0sXG4gICAgICAgICAgICAgICAgX2VsZSA9IF90b01vZCRfaS5lbGUsXG4gICAgICAgICAgICAgICAgX2pzb24gPSBfdG9Nb2QkX2kuanNvbjtcblxuICAgICAgICAgICAgX2VsZS5qc29uKF9qc29uKTtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKGFycmF5KG9iai5lbGVtZW50cykpIHtcbiAgICAgICAgICAvLyBlbGVtZW50czogW11cbiAgICAgICAgICB1cGRhdGVFbGVzKG9iai5lbGVtZW50cyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gZWxlbWVudHM6IHsgbm9kZXM6IFtdLCBlZGdlczogW10gfVxuICAgICAgICAgIHZhciBncnMgPSBbJ25vZGVzJywgJ2VkZ2VzJ107XG5cbiAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGdycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIGdyID0gZ3JzW2ldO1xuICAgICAgICAgICAgdmFyIGVsZW1lbnRzID0gb2JqLmVsZW1lbnRzW2dyXTtcblxuICAgICAgICAgICAgaWYgKGFycmF5KGVsZW1lbnRzKSkge1xuICAgICAgICAgICAgICB1cGRhdGVFbGVzKGVsZW1lbnRzLCBncik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHBhcmVudHNUb1JlbW92ZSA9IGN5LmNvbGxlY3Rpb24oKTtcbiAgICAgICAgZWxlcy5maWx0ZXIoZnVuY3Rpb24gKGVsZSkge1xuICAgICAgICAgIHJldHVybiAhaWRJbkpzb25bZWxlLmlkKCldO1xuICAgICAgICB9KS5mb3JFYWNoKGZ1bmN0aW9uIChlbGUpIHtcbiAgICAgICAgICBpZiAoZWxlLmlzUGFyZW50KCkpIHtcbiAgICAgICAgICAgIHBhcmVudHNUb1JlbW92ZS5tZXJnZShlbGUpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBlbGUucmVtb3ZlKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTsgLy8gc28gdGhhdCBjaGlsZHJlbiBhcmUgbm90IHJlbW92ZWQgdy9wYXJlbnRcblxuICAgICAgICBwYXJlbnRzVG9SZW1vdmUuZm9yRWFjaChmdW5jdGlvbiAoZWxlKSB7XG4gICAgICAgICAgcmV0dXJuIGVsZS5jaGlsZHJlbigpLm1vdmUoe1xuICAgICAgICAgICAgcGFyZW50OiBudWxsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pOyAvLyBpbnRlcm1lZGlhdGUgcGFyZW50cyBtYXkgYmUgbW92ZWQgYnkgcHJpb3IgbGluZSwgc28gbWFrZSBzdXJlIHdlIHJlbW92ZSBieSBmcmVzaCByZWZzXG5cbiAgICAgICAgcGFyZW50c1RvUmVtb3ZlLmZvckVhY2goZnVuY3Rpb24gKGVsZSkge1xuICAgICAgICAgIHJldHVybiBnZXRGcmVzaFJlZihlbGUpLnJlbW92ZSgpO1xuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgICAgaWYgKG9iai5zdHlsZSkge1xuICAgICAgICBjeS5zdHlsZShvYmouc3R5bGUpO1xuICAgICAgfVxuXG4gICAgICBpZiAob2JqLnpvb20gIT0gbnVsbCAmJiBvYmouem9vbSAhPT0gX3Auem9vbSkge1xuICAgICAgICBjeS56b29tKG9iai56b29tKTtcbiAgICAgIH1cblxuICAgICAgaWYgKG9iai5wYW4pIHtcbiAgICAgICAgaWYgKG9iai5wYW4ueCAhPT0gX3AucGFuLnggfHwgb2JqLnBhbi55ICE9PSBfcC5wYW4ueSkge1xuICAgICAgICAgIGN5LnBhbihvYmoucGFuKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAob2JqLmRhdGEpIHtcbiAgICAgICAgY3kuZGF0YShvYmouZGF0YSk7XG4gICAgICB9XG5cbiAgICAgIHZhciBmaWVsZHMgPSBbJ21pblpvb20nLCAnbWF4Wm9vbScsICd6b29taW5nRW5hYmxlZCcsICd1c2VyWm9vbWluZ0VuYWJsZWQnLCAncGFubmluZ0VuYWJsZWQnLCAndXNlclBhbm5pbmdFbmFibGVkJywgJ2JveFNlbGVjdGlvbkVuYWJsZWQnLCAnYXV0b2xvY2snLCAnYXV0b3VuZ3JhYmlmeScsICdhdXRvdW5zZWxlY3RpZnknXTtcblxuICAgICAgZm9yICh2YXIgX2kyID0gMDsgX2kyIDwgZmllbGRzLmxlbmd0aDsgX2kyKyspIHtcbiAgICAgICAgdmFyIGYgPSBmaWVsZHNbX2kyXTtcblxuICAgICAgICBpZiAob2JqW2ZdICE9IG51bGwpIHtcbiAgICAgICAgICBjeVtmXShvYmpbZl0pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGN5LmVuZEJhdGNoKCk7XG4gICAgICByZXR1cm4gdGhpczsgLy8gY2hhaW5pbmdcbiAgICB9IGVsc2Uge1xuICAgICAgLy8gZ2V0XG4gICAgICB2YXIgZmxhdCA9ICEhb2JqO1xuICAgICAgdmFyIGpzb24gPSB7fTtcblxuICAgICAgaWYgKGZsYXQpIHtcbiAgICAgICAganNvbi5lbGVtZW50cyA9IHRoaXMuZWxlbWVudHMoKS5tYXAoZnVuY3Rpb24gKGVsZSkge1xuICAgICAgICAgIHJldHVybiBlbGUuanNvbigpO1xuICAgICAgICB9KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGpzb24uZWxlbWVudHMgPSB7fTtcbiAgICAgICAgZWxlcy5mb3JFYWNoKGZ1bmN0aW9uIChlbGUpIHtcbiAgICAgICAgICB2YXIgZ3JvdXAgPSBlbGUuZ3JvdXAoKTtcblxuICAgICAgICAgIGlmICghanNvbi5lbGVtZW50c1tncm91cF0pIHtcbiAgICAgICAgICAgIGpzb24uZWxlbWVudHNbZ3JvdXBdID0gW107XG4gICAgICAgICAgfVxuXG4gICAgICAgICAganNvbi5lbGVtZW50c1tncm91cF0ucHVzaChlbGUuanNvbigpKTtcbiAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIGlmICh0aGlzLl9wcml2YXRlLnN0eWxlRW5hYmxlZCkge1xuICAgICAgICBqc29uLnN0eWxlID0gY3kuc3R5bGUoKS5qc29uKCk7XG4gICAgICB9XG5cbiAgICAgIGpzb24uZGF0YSA9IGNvcHkoY3kuZGF0YSgpKTtcbiAgICAgIHZhciBvcHRpb25zID0gX3Aub3B0aW9ucztcbiAgICAgIGpzb24uem9vbWluZ0VuYWJsZWQgPSBfcC56b29taW5nRW5hYmxlZDtcbiAgICAgIGpzb24udXNlclpvb21pbmdFbmFibGVkID0gX3AudXNlclpvb21pbmdFbmFibGVkO1xuICAgICAganNvbi56b29tID0gX3Auem9vbTtcbiAgICAgIGpzb24ubWluWm9vbSA9IF9wLm1pblpvb207XG4gICAgICBqc29uLm1heFpvb20gPSBfcC5tYXhab29tO1xuICAgICAganNvbi5wYW5uaW5nRW5hYmxlZCA9IF9wLnBhbm5pbmdFbmFibGVkO1xuICAgICAganNvbi51c2VyUGFubmluZ0VuYWJsZWQgPSBfcC51c2VyUGFubmluZ0VuYWJsZWQ7XG4gICAgICBqc29uLnBhbiA9IGNvcHkoX3AucGFuKTtcbiAgICAgIGpzb24uYm94U2VsZWN0aW9uRW5hYmxlZCA9IF9wLmJveFNlbGVjdGlvbkVuYWJsZWQ7XG4gICAgICBqc29uLnJlbmRlcmVyID0gY29weShvcHRpb25zLnJlbmRlcmVyKTtcbiAgICAgIGpzb24uaGlkZUVkZ2VzT25WaWV3cG9ydCA9IG9wdGlvbnMuaGlkZUVkZ2VzT25WaWV3cG9ydDtcbiAgICAgIGpzb24udGV4dHVyZU9uVmlld3BvcnQgPSBvcHRpb25zLnRleHR1cmVPblZpZXdwb3J0O1xuICAgICAganNvbi53aGVlbFNlbnNpdGl2aXR5ID0gb3B0aW9ucy53aGVlbFNlbnNpdGl2aXR5O1xuICAgICAganNvbi5tb3Rpb25CbHVyID0gb3B0aW9ucy5tb3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Skge1xuICAgIHZhciBmcmFtZSA9IGZ1bmN0aW9uIGZyYW1lKCkge1xuICAgICAgdmFyIGYgPSAwO1xuXG4gICAgICB3aGlsZSAobG9vcFJldCAmJiBmIDwgb3B0aW9ucy5yZWZyZXNoKSB7XG4gICAgICAgIGxvb3BSZXQgPSBtYWluTG9vcChpKTtcbiAgICAgICAgaSsrO1xuICAgICAgICBmKys7XG4gICAgICB9XG5cbiAgICAgIGlmICghbG9vcFJldCkge1xuICAgICAgICAvLyBpdCdzIGRvbmVcbiAgICAgICAgc2VwYXJhdGVDb21wb25lbnRzKGxheW91dEluZm8sIG9wdGlvbnMpO1xuICAgICAgICBkb25lKCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICB2YXIgbm93ID0gcGVyZm9ybWFuY2VOb3coKTtcblxuICAgICAgICBpZiAobm93IC0gc3RhcnRUaW1lID49IG9wdGlvbnMuYW5pbWF0aW9uVGhyZXNob2xkKSB7XG4gICAgICAgICAgcmVmcmVzaCgpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmVxdWVzdEFuaW1hdGlvbkZyYW1lKGZyYW1lKTtcbiAgICAgIH1cbiAgICB9O1xuXG4gICAgZnJhbWUoKTtcbiAgfSBlbHNlIHtcbiAgICB3aGlsZSAobG9vcFJldCkge1xuICAgICAgbG9vcFJldCA9IG1haW5Mb29wKGkpO1xuICAgICAgaSsrO1xuICAgIH1cblxuICAgIHNlcGFyYXRlQ29tcG9uZW50cyhsYXlvdXRJbmZvLCBvcHRpb25zKTtcbiAgICBkb25lKCk7XG4gIH1cblxuICByZXR1cm4gdGhpczsgLy8gY2hhaW5pbmdcbn07XG4vKipcbiAqIEBicmllZiA6IGNhbGxlZCBvbiBjb250aW51b3VzIGxheW91dHMgdG8gc3RvcCB0aGVtIGJlZm9yZSB0aGV5IGZpbmlzaFxuICovXG5cblxuQ29zZUxheW91dC5wcm90b3R5cGUuc3RvcCA9IGZ1bmN0aW9uICgpIHtcbiAgdGhpcy5zdG9wcGVk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biAgcmV0dXJuO1xufTtcblxudmFyIHNlcGFyYXRlQ29tcG9uZW50cyA9IGZ1bmN0aW9uIHNlcGFyYXRlQ29tcG9uZW50cyhsYXlvdXRJbmZvLCBvcHRpb25zKSB7XG4gIHZhciBub2RlcyA9IGxheW91dEluZm8ubGF5b3V0Tm9kZXM7XG4gIHZhciBjb21wb25lbnRzID0gW107XG5cbiAgZm9yICh2YXIgaSA9IDA7IGkgPCBub2Rlcy5sZW5ndGg7IGkrKykge1xuICAgIHZhciBub2RlID0gbm9kZXNbaV07XG4gICAgdmFyIGNpZCA9IG5vZGUuY21wdElkO1xuICAgIHZhciBjb21wb25lbnQgPSBjb21wb25lbnRzW2NpZF0gPSBjb21wb25lbnRzW2NpZF0gfHwgW107XG4gICAgY29tcG9uZW50LnB1c2gobm9kZSk7XG4gIH1cblxuICB2YXIgdG90YWxBID0gMDtcblxuICBmb3IgKHZhciBpID0gMDsgaSA8IGNvbXBvbmVudHMubGVuZ3RoOyBpKyspIHtcbiAgICB2YXIgYyA9IGNvbXBvbmVudHNbaV07XG5cbiAgICBpZiAoIWMpIHtcbiAgICAgIGNvbnRpbnVlO1xuICAgIH1cblxuICAgIGMueDEgPSBJbmZpbml0eTtcbiAgICBjLngyID0gLUluZmluaXR5O1xuICAgIGMueTEgPSBJbmZpbml0eTtcbiAgICBjLnkyID0gLUluZmluaXR5O1xuXG4gICAgZm9yICh2YXIgaiA9IDA7IGogPCBjLmxlbmd0aDsgaisrKSB7XG4gICAgICB2YXIgbiA9IGNbal07XG4gICAgICBjLngxID0gTWF0aC5taW4oYy54MSwgbi5wb3NpdGlvblggLSBuLndpZHRoIC8gMik7XG4gICAgICBjLngyID0gTWF0aC5tYXgoYy54Miwgbi5wb3NpdGlvblggKyBuLndpZHRoIC8gMik7XG4gICAgICBjLnkxID0gTWF0aC5taW4oYy55MSwgbi5wb3NpdGlvblkgLSBuLmhlaWdodCAvIDIpO1xuICAgICAgYy55MiA9IE1hdGgubWF4KGMueTIsIG4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uICAgICAgICAgIF9wb3Mucm93ID0gMDtcblxuICAgICAgICAgIHdoaWxlICh1c2VkKF9wb3Mucm93LCBfcG9zLmNvbCkpIHtcbiAgICAgICAgICAgIF9wb3Mucm93Kys7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWQybWFuUG9zW19ub2RlLmlkKCldID0gX3BvcztcbiAgICAgICAgdXNlKF9wb3Mucm93LCBfcG9zLmNvbCk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgdmFyIGdldFBvcyA9IGZ1bmN0aW9uIGdldFBvcyhlbGVtZW50LCBpKSB7XG4gICAgICB2YXIgeCwgeTtcblxuICAgICAgaWYgKGVsZW1lbnQubG9ja2VkKCkgfHwgZWxlbWVudC5pc1BhcmVudCgpKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgIH0gLy8gc2VlIGlmIHdlIGhhdmUgYSBtYW51YWwgcG9zaXRpb24gc2V0XG5cblxuICAgICAgdmFyIHJjUG9zID0gaWQybWFuUG9zW2VsZW1lbnQuaWQoKV07XG5cbiAgICAgIGlmIChyY1Bvcykge1xuICAgICAgICB4ID0gcmNQb3MuY29sICogY2VsbFdpZHRoICsgY2VsbFdpZHRoIC8gMiArIGJiLngxO1xuICAgICAgICB5ID0gcmNQb3Mucm93ICogY2VsbEhlaWdodCArIGNlbGxIZWlnaHQgLyAyICsgYmIueTE7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBvdGhlcndpc2Ugc2V0IGF1dG9tYXRpY2FsbHlcbiAgICAgICAgd2hpbGUgKHVzZWQocm93LCBjb2wpKSB7XG4gICAgICAgICAgbW92ZVRvTmV4dENlbGwoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHggPSBjb2wgKiBjZWxsV2lkdGggKyBjZWxsV2lkdGggLyAyICsgYmIueDE7XG4gICAgICAgIHkgPSByb3cgKiBjZWxsSGVpZ2h0ICsgY2VsbEhlaWdodCAvIDIgKyBiYi55MTtcbiAgICAg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IGRpc3RhbmNlL2Rpc3BsYWNlbWVudCBmcm9tIHNyYyB0byB0Z3RcblxuICAgICAgICB2YXIgdGd0T3V0c2lkZSA9IHRndFNoYXBlLmludGVyc2VjdExpbmUodGd0UG9zLngsIHRndFBvcy55LCB0Z3RXLCB0Z3RILCBzcmNQb3MueCwgc3JjUG9zLnksIDApO1xuICAgICAgICB2YXIgdGd0SW50biA9IHBhaXJJbmZvLnRndEludG4gPSB0Z3RPdXRzaWRlO1xuICAgICAgICB2YXIgaW50ZXJzZWN0aW9uUHRzID0gcGFpckluZm8uaW50ZXJzZWN0aW9uUHRzID0ge1xuICAgICAgICAgIHgxOiBzcmNPdXRzaWRlWzBdLFxuICAgICAgICAgIHgyOiB0Z3RPdXRzaWRlWzBdLFxuICAgICAgICAgIHkxOiBzcmNPdXRzaWRlWzFdLFxuICAgICAgICAgIHkyOiB0Z3RPdXRzaWRlWzFdXG4gICAgICAgIH07XG4gICAgICAgIHZhciBwb3NQdHMgPSBwYWlySW5mby5wb3NQdHMgPSB7XG4gICAgICAgICAgeDE6IHNyY1Bvcy54LFxuICAgICAgICAgIHgyOiB0Z3RQb3MueCxcbiAgICAgICAgICB5MTogc3JjUG9zLnksXG4gICAgICAgICAgeTI6IHRndFBvcy55XG4gICAgICAgIH07XG4gICAgICAgIHZhciBkeSA9IHRndE91dHNpZGVbMV0gLSBzcmNPdXRzaWRlWzFdO1xuICAgICAgICB2YXIgZHggPSB0Z3RPdXRzaWRlWzBdIC0gc3JjT3V0c2lkZVswXTtcbiAgICAgICAgdmFyIGwgPSBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpO1xuICAgICAgICB2YXIgdmVjdG9yID0gcGFpckluZm8udmVjdG9yID0ge1xuICAgICAgICAgIHg6IGR4LFxuICAgICAgICAgIHk6IGR5XG4gICAgICAgIH07XG4gICAgICAgIHZhciB2ZWN0b3JOb3JtID0gcGFpckluZm8udmVjdG9yTm9ybSA9IHtcbiAgICAgICAgICB4OiB2ZWN0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VzogdGd0VyxcbiAgICAgICAgICBzcmNIOiB0Z3RILFxuICAgICAgICAgIHRndFc6IHNyY1csXG4gICAgICAgICAgdGd0SDogc3JjSCxcbiAgICAgICAgICBzcmNJbnRuOiB0Z3RJbnRuLFxuICAgICAgICAgIHRndEludG46IHNyY0ludG4sXG4gICAgICAgICAgc3JjU2hhcGU6IHRndFNoYXBlLFxuICAgICAgICAgIHRndFNoYXBlOiBzcmNTaGFwZSxcbiAgICAgICAgICBwb3NQdHM6IHtcbiAgICAgICAgICAgIHgxOiBwb3NQdHMueDIsXG4gICAgICAgICAgICB5MTogcG9zUHRzLnkyLFxuICAgICAgICAgICAgeDI6IHBvc1B0cy54MSxcbiAgICAgICAgICAgIHkyOiBwb3NQdHMueTFcbiAgICAgICAgICB9LFxuICAgICAgICAgIGludGVyc2VjdGlvblB0czoge1xuICAgICAgICAgICAgeDE6IGludGVyc2VjdGlvblB0cy54MixcbiAgICAgICAgICAgIHkxOiBpbnRlcnNlY3Rpb25QdHMueTIsXG4gICAgICAgICAgICB4MjogaW50ZXJzZWN0aW9uUHRzLngxLFxuICAgICAgICAgICAgeTI6IGludGVyc2VjdGlvblB0cy55MVxuICAgICAgICAgIH0sXG4gICAgICAgICAgdmVjdG9yOiB7XG4gICAgICAgICAgICB4OiAtdmVjdG9yLngsXG4gICAgICAgICAgICB5OiAtdmVjdG9yLnlcbiAgICAgICAgICB9LFxuICAgICAgICAgIHZlY3Rvck5vcm06IHtcbiAgICAgICAgICAgIHg6IC12ZWN0b3JOb3JtLngsXG4gICAgICAgICAgICB5OiAtdmVjdG9yTm9ybS55XG4gICAgICAgICAgfSxcbiAgICAgICAgICB2ZWN0b3JOb3JtSW52ZXJzZToge1xuICAgICAgICAgICAgeDogLXZlY3Rvck5vcm1JbnZlcnNlLngsXG4gICAgICAgICAgICB5OiAtdmVjdG9yTm9ybUludmVyc2UueVxuICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgIH1cblxuICAgICAgdmFyIHBhc3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scHRzW2kgKyAxXVxuICAgICAgfTtcbiAgICAgIHZhciBwMSA9IHtcbiAgICAgICAgeDogcnMuYWxscHRzW2kgKyAyXSxcbiAgICAgICAgeTogcnMuYWxscHRzW2kgKyAzXVxuICAgICAgfTsgLy8gY3RybHB0XG5cbiAgICAgIHZhciBwMiA9IHtcbiAgICAgICAgeDogcnMuYWxscHRzW2kgKyA0XSxcbiAgICAgICAgeTogcnMuYWxscHRzW2kgKyA1XVxuICAgICAgfTtcbiAgICAgIGN0cmxwdHMucHVzaCh7XG4gICAgICAgIHAwOiBwMCxcbiAgICAgICAgcDE6IHAxLFxuICAgICAgICBwMjogcDIsXG4gICAgICAgIHN0YXJ0RGlzdDogMCxcbiAgICAgICAgbGVuZ3RoOiAwLFxuICAgICAgICBzZWdtZW50czogW11cbiAgICAgIH0pO1xuICAgIH1cblxuICAgIHZhciBicHRzID0gX3AucnN0eWxlLmJlemllclB0cztcbiAgICB2YXIgblByb2pzID0gci5iZXppZXJQcm9qUGN0cy5sZW5ndGg7XG5cbiAgICBmdW5jdGlvbiBhZGRTZWdtZW50KGNwLCBwMCwgcDEsIHQwLCB0MSkge1xuICAgICAgdmFyIGxlbmd0aCA9IGRpc3QocDAsIHAxKTtcbiAgICAgIHZhciBwcmV2U2VnbWVudCA9IGNwLnNlZ21lbnRzW2NwLnNlZ21lbnRzLmxlbmd0aCAtIDFdO1xuICAgICAgdmFyIHNlZ21lbnQgPSB7XG4gICAgICAgIHAwOiBwMCxcbiAgICAgICAgcDE6IHAxLFxuICAgICAgICB0MDogdDAsXG4gICAgICAgIHQxOiB0MSxcbiAgICAgICAgc3RhcnREaXN0OiBwcmV2U2VnbWVudCA/IHByZXZTZWdtZW50LnN0YXJ0RGlzdCArIHByZXZTZWdtZW50Lmxlbmd0aCA6IDAsXG4gICAgICAgIGxlbmd0aDogbGVuZ3RoXG4gICAgICB9O1xuICAgICAgY3Auc2VnbWVudHMucHVzaChzZWdtZW50KTtcbiAgICAgIGNwLmxlbmd0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Sc7XG5cbiAgICBpZiAoIWNvbnRlbnRbcHJlZml4XSkge1xuICAgICAgcmV0dXJuO1xuICAgIH1cblxuICAgIHZhciBvZmZzZXQgPSBlZGdlLnBzdHlsZShwcmVmaXggKyAnLXRleHQtb2Zmc2V0JykucGZWYWx1ZTtcblxuICAgIHN3aXRjaCAocnMuZWRnZVR5cGUpIHtcbiAgICAgIGNhc2UgJ3NlbGYnOlxuICAgICAgY2FzZSAnY29tcG91bmQnOlxuICAgICAgY2FzZSAnYmV6aWVyJzpcbiAgICAgIGNhc2UgJ211bHRpYmV6aWVyJzpcbiAgICAgICAge1xuICAgICAgICAgIHZhciBjcHMgPSBjcmVhdGVDb250cm9sUG9pbnRJbmZvKCk7XG4gICAgICAgICAgdmFyIHNlbGVjdGVkO1xuICAgICAgICAgIHZhciBzdGFydERpc3QgPSAwO1xuICAgICAgICAgIHZhciB0b3RhbERpc3QgPSAwOyAvLyBmaW5kIHRoZSBzZWdtZW50IHdlJ3JlIG9uXG5cbiAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNwcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIF9jcCA9IGNwc1tpc1NyYyA/IGkgOiBjcHMubGVuZ3RoIC0gMSAtIGldO1xuXG4gICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IF9jcC5zZWdtZW50cy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICB2YXIgX3NlZyA9IF9jcC5zZWdtZW50c1tpc1NyYyA/IGogOiBfY3Auc2VnbWVudHMubGVuZ3RoIC0gMSAtIGpdO1xuICAgICAgICAgICAgICB2YXIgbGFzdFNlZyA9IGkgPT09IGNwcy5sZW5ndGggLSAxICYmIGogPT09IF9jcC5zZWdtZW50cy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICBzdGFydERpc3QgPSB0b3RhbERpc3Q7XG4gICAgICAgICAgICAgIHRvdGFsRGlzdCArPSBfc2VnLmxlbmd0aDtcblxuICAgICAgICAgICAgICBpZiAodG90YWxEaXN0ID49IG9mZnNldCB8fCBsYXN0U2VnKSB7XG4gICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSB7XG4gICAgICAgICAgICAgICAgICBjcDogX2NwLFxuICAgICAgICAgICAgICAgICAgc2VnbWVudDogX3NlZ1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHNlbGVjdGVkKSB7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBjcCA9IHNlbGVjdGVkLmNwO1xuICAgICAgICAgIHZhciBzZWcgPSBzZWxlY3RlZC5zZWdtZW50O1xuICAgICAgICAgIHZhciB0U2VnbWVudCA9IChvZmZzZXQgLSBzdGFydERpc3QpIC8gc2VnLmxlbmd0aDtcbiAgICAgICAgICB2YXIgc2VnRHQgPSBzZWcudDEgLSBzZWcudDA7XG4gICAgICAgICAgdmFyIHQgPSBpc1NyYyA/IHNlZy50MCArIHNlZ0R0ICogdFNlZ21lbnQgOiBzZWcudDEgLSBzZWdEdCAqIHRTZWdtZW50O1xuICAgICAgICAgIHQgPSBib3VuZCgwLCB0LCAxKTtcbiAgICAgICAgICBwID0gcWJlemllclB0QXQoY3AucDAsIGNwLnAxLCBjcC5wMiwgdCk7XG4gICAgICAgICAgYW5nbGUgPSBiZXppZXJBbmdsZShjcC5wMCwgY3AucDEsIGNwLnAyLCB0KTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICBjYXNlICdzdHJhaWdodCc6XG4gICAgICBjYXNlICdzZWdtZW50cyc6XG4gICAgICBjYXNlICdoYXlzdGFjayc6XG4gICAgICAgIHtcbiAgICAgICAgICB2YXIgZCA9IDAsXG4gICAgICAgICAgICAgIGRpLFxuICAgICAgICAgICAgICBkMDtcbiAgICAgICAgICB2YXIgcDAsIHAxO1xuICAgICAgICAgIHZhciBsID0gcnMuYWxscHRzLmxlbmd0aDtcblxuICAgICAgICAgIGZvciAodmFyIF9pMiA9IDA7IF9pMiArIDMgPCBsOyBfaTIgKz0gMikge1xuICAgICAgICAgICAgaWYgKGlzU3JjKSB7XG4gICAgICAgICAgICAgIHAwID0ge1xuICAgICAgICAgICAgICAgIHg6IHJzLmFsbHB0c1tfaTJdLFxuICAgICAgICAgICAgICAgIHk6IHJzLmFsbHB0c1tfaTIgKyAxXVxuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICBwMSA9IHtcbiAgICAgICAgICAgICAgICB4OiBycy5hbGxwdHNbX2kyICsgMl0sXG4gICAgICAgICAgICAgICAgeTogcnMuYWxscHRzW19pMiArIDNdXG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwMCA9IHtcbiAgICAgICAgICAgICAgICB4OiBycy5hbGxwdHNbbCAtIDIgLSBfaTJdLFxuICAgICAgICAgICAgICAgIHk6IHJzLmFsbHB0c1tsIC0gMSAtIF9pMl1cbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgcDEgPSB7XG4gICAgICAgICAgICAgICAgeDogcnMuYWxscHRzW2wgLSA0IC0gX2kyXSxcbiAgICAgICAgICAgICAgICB5OiBycy5hbGxwdHNbbCAtIDMgLSBfaTJdXG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGRpID0gZGlzdChwMCwgcDEpO1xuICAgICAgICAgICAgZDAgPSBkO1xuICAgICAgICAgICAgZCArPSBkaTtcblxuICAgICAgICAgICAgaWYgKGQgPj0gb2Zmc2V0KSB7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBwRCA9IG9mZnNldCAtIGQwO1xuXG4gICAgICAgICAgdmFyIF90ID0gcEQgLyBkaTtcbl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ZXcgTXV0YXRpb25PYnNlcnZlcihmdW5jdGlvbiAobXV0bnMpIHtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW5kZWZcbiAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbXV0bnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgdmFyIG11dG4gPSBtdXRuc1tpXTtcbiAgICAgICAgdmFyIHJOb2RlcyA9IG11dG4ucmVtb3ZlZE5vZGVzO1xuXG4gICAgICAgIGlmIChyTm9kZXMpIHtcbiAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHJOb2Rlcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgdmFyIHJOb2RlID0gck5vZGVzW2pdO1xuXG4gICAgICAgICAgICBpZiAock5vZGUgPT09IHIuY29udGFpbmVyKSB7XG4gICAgICAgICAgICAgIHIuZGVzdHJveSgpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcblxuICAgIGlmIChyLmNvbnRhaW5lci5wYXJlbnROb2RlKSB7XG4gICAgICByLnJlbW92ZU9ic2VydmVyLm9ic2VydmUoci5jb250YWluZXIucGFyZW50Tm9kZSwge1xuICAgICAgICBjaGlsZExpc3Q6IHRydWVcbiAgICAgIH0pO1xuICAgIH1cbiAgfSBlbHNlIHtcbiAgICByLnJlZ2lzdGVyQmluZGluZyhyLmNvbnRhaW5lciwgJ0RPTU5vZGVSZW1vdmVkJywgZnVuY3Rpb24gKGUpIHtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW51c2VkLXZhcnNcbiAgICAgIHIuZGVzdHJveSgpO1xuICAgIH0pO1xuICB9XG5cbiAgdmFyIG9uUmVzaXplID0gdXRpbChmdW5jdGlvbiAoKSB7XG4gICAgci5jeS5yZXNpemUoKTtcbiAgfSwgMTAwKTtcblxuICBpZiAoaGF2ZU11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WxsZWQpIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdmFyIGVsZSA9IHIuaG92ZXJEYXRhLmRvd247XG5cbiAgICAgICAgICBpZiAoZWxlKSB7XG4gICAgICAgICAgICBlbGUuZW1pdCh7XG4gICAgICAgICAgICAgIG9yaWdpbmFsRXZlbnQ6IGUsXG4gICAgICAgICAgICAgIHR5cGU6ICd0YXBob2xkJyxcbiAgICAgICAgICAgICAgcG9zaXRpb246IHtcbiAgICAgICAgICAgICAgICB4OiBwb3NbMF0sXG4gICAgICAgICAgICAgICAgeTogcG9zWzFdXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjeS5lbWl0KHtcbiAgICAgICAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgICAgICAgdHlwZTogJ3RhcGhvbGQnLFxuICAgICAgICAgICAgICBwb3NpdGlvbjoge1xuICAgICAgICAgICAgICAgIHg6IHBvc1swXSxcbiAgICAgICAgICAgICAgICB5OiBwb3NbMV1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9LCByLnRhcGhvbGREdXJhdGlvbik7XG4gICAgfTsgLy8gUmlnaHQgY2xpY2sgYnV0dG9uXG5cblxuICAgIGlmIChlLndoaWNoID09IDMpIHtcbiAgICAgIHIuaG92ZXJEYXRhLmN4dFN0YXJ0ZWQgPSB0cnVlO1xuICAgICAgdmFyIGN4dEV2dCA9IHtcbiAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgdHlwZTogJ2N4dHRhcHN0YXJ0JyxcbiAgICAgICAgcG9zaXRpb246IHtcbiAgICAgICAgICB4OiBwb3NbMF0sXG4gICAgICAgICAgeTogcG9zWzFdXG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIGlmIChuZWFyKSB7XG4gICAgICAgIG5lYXIuYWN0aXZhdGUoKTtcbiAgICAgICAgbmVhci5lbWl0KGN4dEV2dCk7XG4gICAgICAgIHIuaG92ZXJEYXRhLmRvd24gPSBuZWFyO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY3kuZW1pdChjeHRFdnQpO1xuICAgICAgfVxuXG4gICAgICByLmhvdmVyRGF0YS5kb3duVGltZSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xuICAgICAgci5ob3ZlckRhdGEuY3h0RHJhZ2dlZCA9IGZhbHNlOyAvLyBQcmltYXJ5IGJ1dHRvblxuICAgIH0gZWxzZSBpZiAoZS53aGljaCA9PSAxKSB7XG4gICAgICBpZiAobmVhcikge1xuICAgICAgICBuZWFyLmFjdGl2YXRlKCk7XG4gICAgICB9IC8vIEVsZW1lbnQgZHJhZ2dpbmdcblxuXG4gICAgICB7XG4gICAgICAgIC8vIElmIHNvbWV0aGluZyBpcyB1bmRlciB0aGUgY3Vyc29yIGFuZCBpdCBpcyBkcmFnZ2FibGUsIHByZXBhcmUgdG8gZ3JhYiBpdFxuICAgICAgICBpZiAobmVhciAhPSBudWxsKSB7XG4gICAgICAgICAgaWYgKHIubm9kZUlzR3JhYmJhYmxlKG5lYXIpKSB7XG4gICAgICAgICAgICB2YXIgbWFrZUV2ZW50ID0gZnVuY3Rpb24gbWFrZUV2ZW50KHR5cGUpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBvcmlnaW5hbEV2ZW50OiBlLFxuICAgICAgICAgICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgICAgICAgICAgcG9zaXRpb246IHtcbiAgICAgICAgICAgICAgICAgIHg6IHBvc1swXSxcbiAgICAgICAgICAgICAgICAgIHk6IHBvc1sxXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHZhciB0cmlnZ2VyR3JhYiA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biAgICAgICAgICAgICAgc2VsZWN0ZWROb2Rlcy5mb3JFYWNoKHRyaWdnZXJHcmFiKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgci5yZWRyYXdIaW50KCdlbGVzJywgdHJ1ZSk7XG4gICAgICAgICAgICByLnJlZHJhd0hpbnQoJ2RyYWcnLCB0cnVlKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByLmhvdmVyRGF0YS5kb3duID0gbmVhcjtcbiAgICAgICAgci5ob3ZlckRhdGEuZG93bnMgPSBuZWFycztcbiAgICAgICAgci5ob3ZlckRhdGEuZG93blRpbWUgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKTtcbiAgICAgIH1cbiAgICAgIHRyaWdnZXJFdmVudHMobmVhciwgWydtb3VzZWRvd24nLCAndGFwc3RhcnQnLCAndm1vdXNlZG93biddLCBlLCB7XG4gICAgICAgIHg6IHBvc1swXSxcbiAgICAgICAgeTogcG9zWzFdXG4gICAgICB9KTtcblxuICAgICAgaWYgKG5lYXIgPT0gbnVsbCkge1xuICAgICAgICBzZWxlY3RbNF0gPSAxO1xuICAgICAgICByLmRhdGEuYmdBY3RpdmVQb3Npc3Rpb24gPSB7XG4gICAgICAgICAgeDogcG9zWzBdLFxuICAgICAgICAgIHk6IHBvc1sxXVxuICAgICAgICB9O1xuICAgICAgICByLnJlZHJhd0hpbnQoJ3NlbGVjdCcsIHRydWUpO1xuICAgICAgICByLnJlZHJhdygpO1xuICAgICAgfSBlbHNlIGlmIChuZWFyLnBhbm5hYmxlKCkpIHtcbiAgICAgICAgc2VsZWN0WzRdID0gMTsgLy8gZm9yIGZ1dHVyZSBwYW5cbiAgICAgIH1cblxuICAgICAgY2hlY2tGb3JUYXBob2xkKCk7XG4gICAgfSAvLyBJbml0aWFsaXplIHNlbGVjdGlvbiBib3ggY29vcmRpbmF0ZXNcblxuXG4gICAgc2VsZWN0WzBdID0gc2VsZWN0WzJdID0gcG9zWzBdO1xuICAgIHNl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ID0ge1xuICAgICAgICAgIG9yaWdpbmFsRXZlbnQ6IGUsXG4gICAgICAgICAgdHlwZTogJ2N4dGRyYWcnLFxuICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICB4OiBwb3NbMF0sXG4gICAgICAgICAgICB5OiBwb3NbMV1cbiAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKGRvd24pIHtcbiAgICAgICAgICBkb3duLmVtaXQoY3h0RXZ0KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjeS5lbWl0KGN4dEV2dCk7XG4gICAgICAgIH1cblxuICAgICAgICByLmhvdmVyRGF0YS5jeHREcmFnZ2VkID0gdHJ1ZTtcblxuICAgICAgICBpZiAoIXIuaG92ZXJEYXRhLmN4dE92ZXIgfHwgbmVhciAhPT0gci5ob3ZlckRhdGEuY3h0T3Zlcikge1xuICAgICAgICAgIGlmIChyLmhvdmVyRGF0YS5jeHRPdmVyKSB7XG4gICAgICAgICAgICByLmhvdmVyRGF0YS5jeHRPdmVyLmVtaXQoe1xuICAgICAgICAgICAgICBvcmlnaW5hbEV2ZW50OiBlLFxuICAgICAgICAgICAgICB0eXBlOiAnY3h0ZHJhZ291dCcsXG4gICAgICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICAgICAgeDogcG9zWzBdLFxuICAgICAgICAgICAgICAgIHk6IHBvc1sxXVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByLmhvdmVyRGF0YS5jeHRPdmVyID0gbmVhcjtcblxuICAgICAgICAgIGlmIChuZWFyKSB7XG4gICAgICAgICAgICBuZWFyLmVtaXQoe1xuICAgICAgICAgICAgICBvcmlnaW5hbEV2ZW50OiBlLFxuICAgICAgICAgICAgICB0eXBlOiAnY3h0ZHJhZ292ZXInLFxuICAgICAgICAgICAgICBwb3NpdGlvbjoge1xuICAgICAgICAgICAgICAgIHg6IHBvc1swXSxcbiAgICAgICAgICAgICAgICB5OiBwb3NbMV1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IC8vIENoZWNrIGlmIHdlIGFyZSBkcmFnIHBhbm5pbmcgdGhlIGVudGlyZSBncmFwaFxuXG4gICAgfSBlbHNlIGlmIChyLmhvdmVyRGF0YS5kcmFnZ2luZykge1xuICAgICAgcHJldmVudERlZmF1bHQgPSB0cnVlO1xuXG4gICAgICBpZiAoY3kucGFubmluZ0VuYWJsZWQoKSAmJiBjeS51c2VyUGFubmluZ0VuYWJsZWQoKSkge1xuICAgICAgICB2YXIgZGVsdGFQO1xuXG4gICAgICAgIGlmIChyLmhvdmVyRGF0YS5qdXN0U3RhcnRlZFBhbikge1xuICAgICAgICAgIHZhciBtZFBvcyA9IHIuaG92ZXJEYXRhLm1kb3duUG9zO1xuICAgICAgICAgIGRlbHRhUCA9IHtcbiAgICAgICAgICAgIHg6IChwb3NbMF0gLSBtZFBvc1swXSkgKiB6b29tLFxuICAgICAgICAgICAgeTogKHBvc1sxXSAtIG1kUG9zWzFdKSAqIHpvb21cbiAgICAgICAgICB9O1xuICAgICAgICAgIHIuaG92ZXJEYXRhLmp1c3RTdGFydGVkUGFuID0gZmFsc2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZGVsdGFQID0ge1xuICAgICAgICAgICAgeDogZGlzcFswXSAqIHpvb20sXG4gICAgICAgICAgICB5OiBkaXNwWzFdICogem9vbVxuICAgICAgICAgIH07XG4gICAgICAgIH1cblxuICAgICAgICBjeS5wYW5CeShkZWx0YVApO1xuICAgICAgICByLmhvdmVyRGF0YS5kcmFnZ2VkID0gdHJ1ZTtcbiAgICAgIH0gLy8gTmVlZHMgcmVwcm9qZWN0IGR1ZSB0byBwYW4gY2hhbmdpbmcgdmlld3BvcnRcblxuXG4gICAgICBwb3MgPSByLnByb2plY3RJbnRvVmlld3BvcnQoZS5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uICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChkb3duICYmIGRvd24ucGFubmFibGUoKSAmJiBkb3duLmFjdGl2ZSgpKSB7XG4gICAgICAgICAgZG93bi51bmFjdGl2YXRlKCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKGRvd24gJiYgZG93bi5wYW5uYWJsZSgpICYmIGRvd24uYWN0aXZlKCkpIHtcbiAgICAgICAgZG93bi51bmFjdGl2YXRlKCk7XG4gICAgICB9XG5cbiAgICAgIGlmICgoIWRvd24gfHwgIWRvd24uZ3JhYmJlZCgpKSAmJiBuZWFyICE9IGxhc3QpIHtcbiAgICAgICAgaWYgKGxhc3QpIHtcbiAgICAgICAgICB0cmlnZ2VyRXZlbnRzKGxhc3QsIFsnbW91c2VvdXQnLCAndGFwZHJhZ291dCddLCBlLCB7XG4gICAgICAgICAgICB4OiBwb3NbMF0sXG4gICAgICAgICAgICB5OiBwb3NbMV1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChuZWFyKSB7XG4gICAgICAgICAgdHJpZ2dlckV2ZW50cyhuZWFyLCBbJ21vdXNlb3ZlcicsICd0YXBkcmFnb3ZlciddLCBlLCB7XG4gICAgICAgICAgICB4OiBwb3NbMF0sXG4gICAgICAgICAgICB5OiBwb3NbMV1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIHIuaG92ZXJEYXRhLmxhc3QgPSBuZWFyO1xuICAgICAgfVxuXG4gICAgICBpZiAoZG93bikge1xuICAgICAgICBpZiAoaXNPdmVyVGhyZXNob2xkRHJhZykge1xuICAgICAgICAgIC8vIHRoZW4gd2UgY2FuIHRha2UgYWN0aW9uXG4gICAgICAgICAgaWYgKGN5LmJveFNlbGVjdGlvbkVuYWJsZWQoKSAmJiBtdWx0U2VsS2V5RG93bikge1xuICAgICAgICAgICAgLy8gdGhlbiBzZWxlY3Rpb24gb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ICAgICAgICAgICAgaWYgKCFyLmhvdmVyRGF0YS5kcmFnZ2luZ0VsZXMpIHtcbiAgICAgICAgICAgICAgYWRkTm9kZXNUb0RyYWcoZHJhZ2dlZEVsZW1lbnRzLCB7XG4gICAgICAgICAgICAgICAgaW5EcmFnTGF5ZXI6IHRydWVcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciB0b3RhbFNoaWZ0ID0ge1xuICAgICAgICAgICAgICB4OiAwLFxuICAgICAgICAgICAgICB5OiAwXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBpZiAobnVtYmVyKGRpc3BbMF0pICYmIG51bWJlcihkaXNwWzFdKSkge1xuICAgICAgICAgICAgICB0b3RhbFNoaWZ0LnggKz0gZGlzcFswXTtcbiAgICAgICAgICAgICAgdG90YWxTaGlmdC55ICs9IGRpc3BbMV07XG5cbiAgICAgICAgICAgICAgaWYgKGp1c3RTdGFydGVkRHJhZykge1xuICAgICAgICAgICAgICAgIHZhciBkcmFnRGVsdGEgPSByLmhvdmVyRGF0YS5kcmFnRGVsdGE7XG5cbiAgICAgICAgICAgICAgICBpZiAoZHJhZ0RlbHRhICYmIG51bWJlcihkcmFnRGVsdGFbMF0pICYmIG51bWJlcihkcmFnRGVsdGFbMV0pKSB7XG4gICAgICAgICAgICAgICAgICB0b3RhbFNoaWZ0LnggKz0gZHJhZ0RlbHRhWzBdO1xuICAgICAgICAgICAgICAgICAgdG90YWxTaGlmdC55ICs9IGRyYWdEZWx0YVsxXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkcmFnZ2VkRWxlbWVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgdmFyIGRFbGUgPSBkcmFnZ2VkRWxlbWVudHNbaV07XG5cbiAgICAgICAgICAgICAgaWYgKHIubm9kZUlz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F0YS53aGljaCA9PT0gMykge1xuICAgICAgdmFyIGN4dEV2dCA9IHtcbiAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgdHlwZTogJ2N4dHRhcGVuZCcsXG4gICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgeDogcG9zWzBdLFxuICAgICAgICAgIHk6IHBvc1sxXVxuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICBpZiAoZG93bikge1xuICAgICAgICBkb3duLmVtaXQoY3h0RXZ0KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGN5LmVtaXQoY3h0RXZ0KTtcbiAgICAgIH1cblxuICAgICAgaWYgKCFyLmhvdmVyRGF0YS5jeHREcmFnZ2VkKSB7XG4gICAgICAgIHZhciBjeHRUYXAgPSB7XG4gICAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgICB0eXBlOiAnY3h0dGFwJyxcbiAgICAgICAgICBwb3NpdGlvbjoge1xuICAgICAgICAgICAgeDogcG9zWzBdLFxuICAgICAgICAgICAgeTogcG9zWzFdXG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChkb3duKSB7XG4gICAgICAgICAgZG93bi5lbWl0KGN4dFRhcCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY3kuZW1pdChjeHRUYXApO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHIuaG92ZXJEYXRhLmN4dERyYWdnZWQgPSBmYWxzZTtcbiAgICAgIHIuaG92ZXJEYXRhLndoaWNoID0gbnVsbDtcbiAgICB9IGVsc2UgaWYgKHIuaG92ZXJEYXRhLndoaWNoID09PSAxKSB7XG4gICAgICB0cmlnZ2VyRXZlbnRzKG5lYXIsIFsnbW91c2V1cCcsICd0YXBlbmQnLCAndm1vdXNldXAnXSwgZSwge1xuICAgICAgICB4OiBwb3NbMF0sXG4gICAgICAgIHk6IHBvc1sxXVxuICAgICAgfSk7XG5cbiA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GVjdGluZykge1xuICAgICAgICB2YXIgYm94ID0gY3kuY29sbGVjdGlvbihyLmdldEFsbEluQm94KHNlbGVjdFswXSwgc2VsZWN0WzFdLCBzZWxlY3RbMl0sIHNlbGVjdFszXSkpO1xuICAgICAgICByLnJlZHJhd0hpbnQoJ3NlbGVjdCcsIHRydWUpO1xuXG4gICAgICAgIGlmIChib3gubGVuZ3RoID4gMCkge1xuICAgICAgICAgIHIucmVkcmF3SGludCgnZWxlcycsIHRydWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgY3kuZW1pdCh7XG4gICAgICAgICAgdHlwZTogJ2JveGVuZCcsXG4gICAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgICBwb3NpdGlvbjoge1xuICAgICAgICAgICAgeDogcG9zWzBdLFxuICAgICAgICAgICAgeTogcG9zWzFdXG4gICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICB2YXIgZWxlV291bGRCZVNlbGVjdGVkID0gZnVuY3Rpb24gZWxlV291bGRCZVNlbGVjdGVkKGVsZSkge1xuICAgICAgICAgIHJldHVybiBlbGUuc2VsZWN0YWJsZSgpICYmICFlbGUuc2VsZWN0ZWQoKTtcbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoY3kuc2VsZWN0aW9uVHlwZSgpID09PSAnYWRkaXRpdmUnKSB7XG4gICAgICAgICAgYm94LmVtaXQoJ2JveCcpLnN0ZEZpbHRlcihlbGVXb3VsZEJlU2VsZWN0ZWQpLnNlbGVjdCgpLmVtaXQoJ2JveHNlbGVjdCcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghbXVsdFNlbEtleURvd24pIHtcbiAgICAgICAgICAgIGN5LiQoaXNTZWxlY3RlZCkudW5tZXJnZShib3gpLnVuc2VsZWN0KCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYm94LmVtaXQoJ2JveCcpLnN0ZEZpbHRlcihlbGVXb3VsZEJlU2VsZWN0ZWQpLnNlb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gICAgICAgICAgICAgeTogbm93WzFdXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgci50b3VjaERhdGEuc3RhcnQgPSBuZWFyMjtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjeS5lbWl0KHtcbiAgICAgICAgICAgIG9yaWdpbmFsRXZlbnQ6IGUsXG4gICAgICAgICAgICB0eXBlOiAnY3h0dGFwc3RhcnQnLFxuICAgICAgICAgICAgcG9zaXRpb246IHtcbiAgICAgICAgICAgICAgeDogbm93WzBdLFxuICAgICAgICAgICAgICB5OiBub3dbMV1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChyLnRvdWNoRGF0YS5zdGFydCkge1xuICAgICAgICAgIHIudG91Y2hEYXRhLnN0YXJ0Ll9wcml2YXRlLmdyYWJiZWQgPSBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHIudG91Y2hEYXRhLmN4dCA9IHRydWU7XG4gICAgICAgIHIudG91Y2hEYXRhLmN4dERyYWdnZWQgPSBmYWxzZTtcbiAgICAgICAgci5kYXRhLmJnQWN0aXZlUG9zaXN0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICByLnJlZHJhdygpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGUudG91Y2hlc1syXSkge1xuICAgICAgLy8gaWdub3JlXG4gICAgICAvLyBzYWZhcmkgb24gaW9zIHBhbnMgdGhlIHBhZ2Ugb3RoZXJ3aXNlIChub3JtYWxseSB5b3Ugc2hvdWxkIGJlIGFibGUgdG8gcHJldmVudGRlZmF1bHQgb24gdG91Y2htb3ZlLi4uKVxuICAgICAgaWYgKGN5LmJveFNlbGVjdGlvbkVuYWJsZWQoKSkge1xuICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmIChlLnRvdWNoZXNbMV0pIDsg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gICAgICAgICAgYWRkTm9kZVRvRHJhZyhuZWFyLCB7XG4gICAgICAgICAgICAgIGFkZFRvTGlzdDogZHJhZ2dlZEVsZXNcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHNldEdyYWJUYXJnZXQobmVhcik7XG5cbiAgICAgICAgICB2YXIgbWFrZUV2ZW50ID0gZnVuY3Rpb24gbWFrZUV2ZW50KHR5cGUpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIG9yaWdpbmFsRXZlbnQ6IGUsXG4gICAgICAgICAgICAgIHR5cGU6IHR5cGUsXG4gICAgICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICAgICAgeDogbm93WzBdLFxuICAgICAgICAgICAgICAgIHk6IG5vd1sxXVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICBuZWFyLmVtaXQobWFrZUV2ZW50KCdncmFib24nKSk7XG5cbiAgICAgICAgICBpZiAoc2VsZWN0ZWROb2Rlcykge1xuICAgICAgICAgICAgc2VsZWN0ZWROb2Rlcy5mb3JFYWNoKGZ1bmN0aW9uIChuKSB7XG4gICAgICAgICAgICAgIG4uZW1pdChtYWtlRXZlbnQoJ2dyYWInKSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbmVhci5lbWl0KG1ha2VFdmVudCgnZ3JhYicpKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgdHJpZ2dlckV2ZW50cyhuZWFyLCBbJ3RvdWNoc3RhcnQnLCAndGFwc3RhcnQnLCAndm1vdXNlZG93biddLCBlLCB7XG4gICAgICAgIHg6IG5vd1swXSxcbiAgICAgICAgeTogbm93WzFdXG4gICAgICB9KTtcblxuICAgICAgaWYgKG5lYXIgPT0gbnVsbCkge1xuICAgICAgICByLmRhdGEuYmdBY3RpdmVQb3Npc3Rpb24gPSB7XG4gICAgICAgICAgeDogcG9zWzBdLFxuICAgICAgICAgIHk6IHBvc1sxXVxuICAgICAgICB9O1xuICAgICAgICByLnJlZHJhd0hpbnQoJ3NlbGVjdCcsIHRydWUpO1xuICAgICAgICByLnJlZHJhdygpO1xuICAgICAgfSAvLyBUYXAsIHRhcGhvbGRcbiAgICAgIC8vIC0tLS0tXG5cblxuICAgICAgci50b3VjaERhdGEuc2luZ2xlVG91Y2hNb3ZlZCA9IGZhbHNlO1xuICAgICAgci50b3VjaERhdGEuc2luZ2xlVG91Y2hTdGFydFRpbWUgPSArbmV3IERhdGUoKTtcbiAgICAgIGNsZWFyVGltZW91dChyLnRvdWNoRGF0YS50YXBob2xkVGltZW91dCk7XG4gICAgICByLnRvdWNoRGF0YS50YXBob2xkVGltZW91dCA9IHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICBpZiAoci50b3VjaERhdGEuc2luZ2xlVG91Y2hNb3ZlZCA9PT0gZmFsc2UgJiYgIXIucGluY2hpbmcgLy8gaWYgcGluY2hpbmcsIHRoZW4gdGFwaG9sZCB1bnNlbGVjdCBzaG91bGRuJ3QgdGFrZSBlZmZlY3RcbiAgICAgICAgJiYgIXIudG91Y2hEYXRhLnNlbGVjdGluZyAvLyBib3ggc2VsZWN0aW9uIHNob3VsZG4ndCBhbGxvdyB0YXBob2xkIHRocm91Z2hcbiAgICAgICAgKSB7XG4gICAgICAgICAgICB0cmlnZ2VyRXZlbnRzKHIudG91Y2hEYXRhLnN0YXJ0LCBbJ3RhcGhvbGQnXSwgZSwge1xuICAgICAgICAgICAgICB4OiBub3dbMF0sXG4gICAgICAgICAgICAgIHk6IG5vd1sxXVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgfSwgci50YXBob2xkRHVyYXRpb24pO1xuICAgIH1cblxuICAgIGlmIChlLnRvdWNoZXMubGVuZ3RoID49IDEpIHtcbiAgICAgIHZhciBzUG9zID0gci50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kge1xuICAgICAgICByLnRvdWNoRGF0YS5jeHQgPSBmYWxzZTtcbiAgICAgICAgci5kYXRhLmJnQWN0aXZlUG9zaXN0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgICByLnJlZHJhd0hpbnQoJ3NlbGVjdCcsIHRydWUpO1xuICAgICAgICB2YXIgY3h0RXZ0ID0ge1xuICAgICAgICAgIG9yaWdpbmFsRXZlbnQ6IGUsXG4gICAgICAgICAgdHlwZTogJ2N4dHRhcGVuZCcsXG4gICAgICAgICAgcG9zaXRpb246IHtcbiAgICAgICAgICAgIHg6IG5vd1swXSxcbiAgICAgICAgICAgIHk6IG5vd1sxXVxuICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICBpZiAoci50b3VjaERhdGEuc3RhcnQpIHtcbiAgICAgICAgICByLnRvdWNoRGF0YS5zdGFydC51bmFjdGl2YXRlKCkuZW1pdChjeHRFdnQpO1xuICAgICAgICAgIHIudG91Y2hEYXRhLnN0YXJ0ID0gbnVsbDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjeS5lbWl0KGN4dEV2dCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IC8vIGNvbnRleHQgc3dpcGVcblxuXG4gICAgaWYgKGNhcHR1cmUgJiYgci50b3VjaERhdGEuY3h0KSB7XG4gICAgICB2YXIgY3h0RXZ0ID0ge1xuICAgICAgICBvcmlnaW5hbEV2ZW50OiBlLFxuICAgICAgICB0eXBlOiAnY3h0ZHJhZycsXG4gICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgeDogbm93WzBdLFxuICAgICAgICAgIHk6IG5vd1sxXVxuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgci5kYXRhLmJnQWN0aXZlUG9zaXN0aW9uID0gdW5kZWZpbmVkO1xuICAgICAgci5yZWRyYXdIaW50KCdzZWxlY3QnLCB0cnVlKTtcblxuICAgICAgaWYgKHIudG91Y2hEYXRhLnN0YXJ0KSB7XG4gICAgICAgIHIudG91Y2hEYXRhLnN0YXJ0LmVtaXQoY3h0RXZ0KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGN5LmVtaXQoY3h0RXZ0KTtcbiAgICAgIH1cblxuICAgICAgaWYgKHIudG91Y2hEYXRhLnN0YXJ0KSB7XG4gICAgICAgIHIudG91Y2hEYXRhLnN0YXJ0Ll9wcml2YXRlLmdyYWJiZWQgPSBmYWxzZTtcbiAgICAgIH1cblxuICAgICAgci50b3VjaERhdGEuY3h0RHJhZ2dlZCA9IHRydWU7XG4gICAgICB2YXIgbmVhciA9IHIuZmluZE5lYXJlc3RFbGVtZW50KG5vd1swXSwgbm93WzFdLCB0cnVlLCB0cnVlKTtcblxuICAgICAgaWYgKCFyLnRvdWNoRGF0YS5jeHRPdmVyIHx8IG5lYXIgIT09IHIudG91Y2hEYXRhLmN4dE92ZXIpIHtcbiAgICAgICAgaWYgKHIudG91Y2hEYXRhLmN4dE92ZXIpIHtcbiAgICAgICAgICByLnRvdWNoRGF0YS5jeHRPdmVyLmVtaXQoe1xuICAgICAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgICAgIHR5cGU6ICdjeHRkcmFnb3V0JyxcbiAgICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICAgIHg6IG5vd1swXSxcbiAgICAgICAgICAgICAgeTogbm93WzFdXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICByLnRvdWNoRGF0YS5jeHRPdmVyID0gbmVhcjtcblxuICAgICAgICBpZiAobmVhcikge1xuICAgICAgICAgIG5lYXIuZW1pdCh7XG4gICAgICAgICAgICBvcmlnaW5hbEV2ZW50OiBlLFxuICAgICAgICAgICAgdHlwZTogJ2N4dGRyYWdvdmVyJyxcbiAgICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICAgIHg6IG5vd1swXSxcbiAgICAgICAgICAgICAgeTogbm93WzFdXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0gLy8gYm94IHNlbGVjdGlvblxuXG4gICAgfSBlbHNlIGlmIChjYXB0dXJlICYmIGUudG91Y2hlc1syXSAmJiBjeS5ib3hTZWxlY3Rpb25FbmFibGVkKCkpIHtcbiAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgIHIuZGF0YS5iZ0FjdGl2ZVBvc2lzdGlvbiA9IHVuZGVmaW5lZDtcbiAgICAgIHRoaXMubGFzdFRocmVlVG91Y2ggPSArbmV3IERhdGUoKTtcblxuICAgICAgaWYgKCFyLnRvdWNoRGF0YS5zZWxlY3RpbmcpIHtcbiAgICAgICAgY3kuZW1pdCh7XG4gICAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgICB0eXBlOiAnYm94c3RhcnQnLFxuICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICB4OiBub3dbMF0sXG4gICAgICAgICAgICB5OiBub3dbMV1cbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfVxuXG4gICAgICByLnRvdWNoRGF0YS5zZWxlY3RpbmcgPSB0cnVlO1xuICAgICAgci50b3VjaERhdGEuZGlkU2VsZWN0ID0gdHJ1ZTtcbiAgICAgIHNlbGVjdFs0XSA9IDE7XG5cbiAgICAgIGlmICghc2VsZWN0IHx8IHNlbGVjdC5sZW5ndGggPT09IDAgfHwgc2VsZWN0WzBdID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgc2VsZWN0WzBdID0gKG5vd1swXSArIG5vd1syXSArIG5vd1s0XSkgLyAzO1xuICAgICAgICBzZWxlY3RbMV0gPSAobm93WzFdICsgbm93WzNdICsgbm93WzVdKSAvIDM7XG4gICAgICAgIHNlbGVjdFsyXSA9IChub3dbMF0gKyBub3dbMl0gKyBub3dbNF0pIC8gMyArIDE7XG4gICAgICAgIHNlbGVjdFszXSA9IChub3dbMV0gKyBub3dbM10gKyBub3db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Iubm9kZUlzRHJhZ2dhYmxlKHN0YXJ0KSkge1xuICAgICAgICAgIGlmIChpc092ZXJUaHJlc2hvbGREcmFnKSB7XG4gICAgICAgICAgICAvLyB0aGVuIGRyYWdnaW5nIGNhbiBoYXBwZW5cbiAgICAgICAgICAgIHZhciBkcmFnZ2VkRWxlcyA9IHIuZHJhZ0RhdGEudG91Y2hEcmFnRWxlcztcbiAgICAgICAgICAgIHZhciBqdXN0U3RhcnRlZERyYWcgPSAhci5kcmFnRGF0YS5kaWREcmFnO1xuXG4gICAgICAgICAgICBpZiAoanVzdFN0YXJ0ZWREcmFnKSB7XG4gICAgICAgICAgICAgIGFkZE5vZGVzVG9EcmFnKGRyYWdnZWRFbGVzLCB7XG4gICAgICAgICAgICAgICAgaW5EcmFnTGF5ZXI6IHRydWVcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHIuZHJhZ0RhdGEuZGlkRHJhZyA9IHRydWU7XG4gICAgICAgICAgICB2YXIgdG90YWxTaGlmdCA9IHtcbiAgICAgICAgICAgICAgeDogMCxcbiAgICAgICAgICAgICAgeTogMFxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgaWYgKG51bWJlcihkaXNwWzBdKSAmJiBudW1iZXIoZGlzcFsxXSkpIHtcbiAgICAgICAgICAgICAgdG90YWxTaGlmdC54ICs9IGRpc3BbMF07XG4gICAgICAgICAgICAgIHRvdGFsU2hpZnQueSArPSBkaXNwWzFdO1xuXG4gICAgICAgICAgICAgIGlmIChqdXN0U3RhcnRlZERyYWcpIHtcbiAgICAgICAgICAgICAgICByLnJlZHJhd0hpbnQoJ2VsZXMnLCB0cnVlKTtcbiAgICAgICAgICAgICAgICB2YXIgZHJhZ0RlbHRhID0gci50b3VjaERhdGEuZHJhZ0RlbHRhO1xuXG4gICAgICAgICAgICAgICAgaWYgKGRyYWdEZWx0YSAmJiBudW1iZXIoZHJhZ0RlbHRhWzBdKSAmJiBudW1iZXIoZHJhZ0RlbHRhWzFdKSkge1xuICAgICAgICAgICAgICAgICAgdG90YWxTaGlmdC54ICs9IGRyYWdEZWx0YVswXTtcbiAgICAgICAgICAgICAgICAgIHRvdGFsU2hpZnQueSArPSBkcmFnRGVsdGFbMV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHIuaG92ZXJEYXRhLmRyYWdnaW5nRWxlcyA9IHRydWU7XG4gICAgICAgICAgICBkcmFnZ2VkRWxlcy5zaWxlbnRTaGlmdCh0b3RhbFNoaWZ0KS5lbWl0KCdwb3NpdGlvbiBkcmFnJyk7XG4gICAgICAgICAgICByLnJlZHJhd0hpbnQoJ2RyYWcnLCB0cnVlKTtcblxuICAgICAgICAgICAgaWYgKHIudG91Y2hEYXRhLnN0YXJ0UG9zaXRpb25bMF0gPT0gZWFybGllclswXSAmJiByLnRvdWNoRGF0YS5zdGFydFBvc2l0aW9uWzFdID09IGVhcmxpZXJbMV0pIHtcbiAgICAgICAgICAgICAgci5yZWRyYXdIaW50KCdlbGVzJywgdHJ1ZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHIucmVkcmF3KCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIG90aGVyaXNlIGtlZXAgdHJhY2sgb2YgZHJhZyBkZWx0YSBmb3IgbGF0ZXJcbiAgICAgICAgICAgIHZhciBkcmFnRGVsdGEgPSByLnRvdWNoRGF0YS5kcmFnRGVsdGEgPSByLnRvdWNoRGF0YS5kcmFnRGVsdGEgfHwgW107XG5cbiAgICAgICAgICAgIGlmIChkcmFnRGVsdGEubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgIGRyYWdEZWx0YS5wdXNoKGRpc3BbMF0pO1xuICAgICAgICAgICAgICBkcmFnRGVsdGEucHVzaChkaXNwWzFdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGRyYWdEZWx0YVswXSArPSBkaXNwWzBdO1xuICAgICAgICAgICAgICBkcmFnRGVsdGFbMV0gKz0gZGlzcFsxXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gLy8gdG91Y2htb3ZlXG5cblxuICAgICAgICB7XG4gICAgICAgICAgdHJpZ2dlckV2ZW50cyhzdGFydCB8fCBuZWFyLCBbJ3RvdWNobW92ZScsICd0YXBkcmFnJywgJ3Ztb3VzZW1vdmUnXSwgZSwge1xuICAgICAgICAgICAgeDogbm93WzBdLFxuICAgICAgICAgICAgeTogbm93WzFdXG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBpZiAoKCFzdGFydCB8fCAhc3RhcnQuZ3JhYmJlZCgpKSAmJiBuZWFyICE9IGxhc3QpIHtcbiAgICAgICAgICAgIGlmIChsYXN0KSB7XG4gICAgICAgICAgICAgIGxhc3QuZW1pdCh7XG4gICAgICAgICAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGFwZHJhZ291dCcsXG4gICAgICAgICAgICAgICAgcG9zaXRpb246IHtcbiAgICAgICAgICAgICAgICAgIHg6IG5vd1swXSxcbiAgICAgICAgICAgICAgICAgIHk6IG5vd1sxXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChuZWFyKSB7XG4gICAgICAgICAgICAgIG5lYXIuZW1pdCh7XG4gICAgICAgICAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgICAgICAgICB0eXBlOiAndGFwZHJhZ292ZXInLFxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiB7XG4gICAgICAgICAgICAgICAgICB4OiBub3dbMF0sXG4gICAgICAgICAgICAgICAgICB5OiBub3dbMV1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHIudG91Y2hEYXRhLmxhc3QgPSBuZWFyO1xuICAgICAgICB9IC8vIGNoZWNrIHRvIGNhbmNlbCB0YXBob2xkXG5cbiAgICAgICAgaWYgKGNhcHR1cmUpIHtcbiAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG5vdy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKG5vd1tpXSAmJiByLnRvdWNoRGF0YS5zdGFydFBvc2l0aW9uW2ldICYmIGlzT3ZlclRocmVzaG9sZERyYWcpIHtcbiAgICAgICAgICAgICAgci50b3VjaERhdGEuc2luZ2xlVG91Y2hNb3ZlZCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IC8vIHBhbm5pbmdcblxuXG4gICAgICAgIGlmIChjYXB0dXJlICYmIChzdGFydCA9PSBudWxsIHx8IHN0YXJ0LnBhbm5hYmxlKCkpICYmIGN5LnBhbm5pbmdFbmFibGVkKCkgJiYgY3kudXNlclBhbm5pbmdFbmFibGVkKCkpIHtcbiAgICAgICAgICB2YXIgYWxsb3dQYXNzdGhyb3VnaCA9IGFsbG93UGFubmluZ1Bhc3N0aHJvdWdoKHN0YXJ0LCByLnRvdWNoRGF0YS5zdGFydHMpO1xuXG4gICAgICAgICAgaWYgKGFsbG93UGFzc3Rocm91Z2gpIHtcbiAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICAgICAgaWYgKCFyLmRhdGEuYmdBY3RpdmVQb3Npc3Rpb24pIHtcbiAgICAgICAgICAgICAgci5kYXRhLmJnQWN0aXZlUG9zaXN0aW9uID0gYXJyYXkycG9pbnQoci50b3VjaERhdGEuc3RhcnRQb3NpdGlvbik7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChyLnN3aXBlUGFubmluZykge1xuICAgICAgICAgICAgICBjeS5wYW5CeSh7XG4gICAgICAgICAgICAgICAgeDogZGlzcFswXSAqIHpvb20sXG4gICAgICAgICAgICAgICAgeTogZGlzcFsxXSAqIHpvb21cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzT3ZlclRocmVzaG9sZERyYWcpIHtcbiAgICAgICAgICAgICAgci5zd2lwZVBhbm5pbmcgPSB0cnVlO1xuICAgICAgICAgICAgICBjeS5wYW5CeSh7XG4gICAgICAgICAgICAgICAgeDogZHggKiB6b29tLFxuICAgICAgICAgICAgICAgIHk6IGR5ICogem9vbVxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICBpZiAoc3RhcnQpIHtcbiAgICAgICAgICAgICAgICBzdGFydC51bmFjdGl2YXRlKCk7XG4gICAgICAgICAgICAgICAgci5yZWRyYXdIaW50KCdzZWxlY3QnLCB0cnVlKTtcbiAgICAgICAgICAgICAgICByLnRvdWNoRGF0YS5zdGFydCA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IC8vIFJlLXByb2plY3RcblxuXG4gICAgICAgICAgdmFyIHBvcyA9IHIucHJvamVjdEludG9WaWV3cG9ydChlLnRvdWNoZXNbMF0uY2xpZW50WCwgZS50b3VjaGVzWzBdLmNsaWVudFkpO1xuICAgICAgICAgIG5vd1swXSA9IHBvc1swXTtcbiAgICAgICAgICBub3dbMV0gPSBwb3NbMV07XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgIGZvciAodmFyIGogPSAwOyBqIDwgbm93Lmxlbmd0aDsgaisrKSB7XG4gICAgICBlYXJsaWVyW2pdID0gbm93W2pdO1xuICAgIH0gLy8gdGhlIGFjdGl2ZSBiZyBpbmRpY2F0b3Igc2hvdWxkIGJlIHJlbW92ZWQgd2hlbiBtYWtpbmcgYSBzd2lwZSB0aGF0IGlzIG5laXRoZXIgZm9yIGRyYWdnaW5nIG5vZGVzIG9yIHBhbm5pbmdcblxuXG4gICAgaWYgKGNhcHR1cmUgJiYgZS50b3VjaGVzLmxlbm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Ckge1xuICAgICAgc3RhcnQudW5hY3RpdmF0ZSgpO1xuICAgIH1cblxuICAgIHZhciBjdHhUYXBlbmQ7XG5cbiAgICBpZiAoci50b3VjaERhdGEuY3h0KSB7XG4gICAgICBjdHhUYXBlbmQgPSB7XG4gICAgICAgIG9yaWdpbmFsRXZlbnQ6IGUsXG4gICAgICAgIHR5cGU6ICdjeHR0YXBlbmQnLFxuICAgICAgICBwb3NpdGlvbjoge1xuICAgICAgICAgIHg6IG5vd1swXSxcbiAgICAgICAgICB5OiBub3dbMV1cbiAgICAgICAgfVxuICAgICAgfTtcblxuICAgICAgaWYgKHN0YXJ0KSB7XG4gICAgICAgIHN0YXJ0LmVtaXQoY3R4VGFwZW5kKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGN5LmVtaXQoY3R4VGFwZW5kKTtcbiAgICAgIH1cblxuICAgICAgaWYgKCFyLnRvdWNoRGF0YS5jeHREcmFnZ2VkKSB7XG4gICAgICAgIHZhciBjdHhUYXAgPSB7XG4gICAgICAgICAgb3JpZ2luYWxFdmVudDogZSxcbiAgICAgICAgICB0eXBlOiAnY3h0dGFwJyxcbiAgICAgICAgICBwb3NpdGlvbjoge1xuICAgICAgICAgICAgeDogbm93WzBdLFxuICAgICAgICAgICAgeTogbm93WzFdXG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChzdGFydCkge1xuICAgICAgICAgIHN0YXJ0LmVtaXQoY3R4VGFwKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjeS5lbWl0KGN0eFRhcCk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHIudG91Y2hEYXRhLnN0YXJ0KSB7XG4gICAgICAgIHIudG91Y2hEYXRhLnN0YXJ0Ll9wcml2YXRlLmdyYWJiZWQgPSBmYWxzZTtcbiAgICAgIH1cblxuICAgICAgci50b3VjaERhdGEuY3h0ID0gZmFsc2U7XG4gICAgICByLnRvdWNoRGF0YS5zd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lIHR3byBmaXhlZCB0IHZhbHVlcyBmb3IgdGhlIGJlemllciBjdXJ2ZSBhcHByb3hpbWF0aW9uXG4gICAgICB2YXIgdDAgPSAwLjE1O1xuICAgICAgdmFyIHQxID0gMC41O1xuICAgICAgdmFyIHQyID0gMC44NTtcbiAgICAgIHZhciBiUHRzID0gdGhpcy5nZW5lcmF0ZUJhcnJlbEJlemllclB0cyh3aWR0aCArIDIgKiBwYWRkaW5nLCBoZWlnaHQgKyAyICogcGFkZGluZywgbm9kZVgsIG5vZGVZKTtcblxuICAgICAgdmFyIGFwcHJveGltYXRlQmFycmVsQ3VydmVQdHMgPSBmdW5jdGlvbiBhcHByb3hpbWF0ZUJhcnJlbEN1cnZlUHRzKHB0cykge1xuICAgICAgICAvLyBhcHByb3hpbWF0ZSBjdXJ2ZSBwdHMgYmFzZWQgb24gdGhlIHR3byB0IHZhbHVlc1xuICAgICAgICB2YXIgbTAgPSBxYmV6aWVyUHRBdCh7XG4gICAgICAgICAgeDogcHRzWzBdLFxuICAgICAgICAgIHk6IHB0c1sxXVxuICAgICAgICB9LCB7XG4gICAgICAgICAgeDogcHRzWzJdLFxuICAgICAgICAgIHk6IHB0c1szXVxuICAgICAgICB9LCB7XG4gICAgICAgICAgeDogcHRzWzRdLFxuICAgICAgICAgIHk6IHB0c1s1XVxuICAgICAgICB9LCB0MCk7XG4gICAgICAgIHZhciBtMSA9IHFiZXppZXJQdEF0KHtcbiAgICAgICAgICB4OiBwdHNbMF0sXG4gICAgICAgICAgeTogcHRzWzFdXG4gICAgICAgIH0sIHtcbiAgICAgICAgICB4OiBwdHNbMl0sXG4gICAgICAgICAgeTogcHRzWzNdXG4gICAgICAgIH0sIHtcbiAgICAgICAgICB4OiBwdHNbNF0sXG4gICAgICAgICAgeTogcHRzWzVdXG4gICAgICAgIH0sIHQxKTtcbiAgICAgICAgdmFyIG0yID0gcWJlemllclB0QXQoe1xuICAgICAgICAgIHg6IHB0c1swXSxcbiAgICAgICAgICB5OiBwdHN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dGlvbiA+PSBvcHRzLmRlcUZhc3RDb3N0ICogdGltZUF2YWlsYWJsZSkge1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHdpbGxEcmF3KSB7XG4gICAgICAgICAgICAgIGlmIChkdXJhdGlvbiA+PSBvcHRzLmRlcUNvc3QgKiByZW5kZXJUaW1lIHx8IGR1cmF0aW9uID49IG9wdHMuZGVxQXZnQ29zdCAqIGF2Z1JlbmRlclRpbWUpIHtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmIChmcmFtZUR1cmF0aW9uID49IG9wdHMuZGVxTm9EcmF3Q29zdCAqIGZ1bGxGcHNUaW1lKSB7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciB0aGlzRGVxZCA9IG9wdHMuZGVxKHNlbGYsIHBpeGVsUmF0aW8sIGV4dGVudCk7XG5cbiAgICAgICAgICBpZiAodGhpc0RlcWQubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzRGVxZC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICBkZXFkLnB1c2godGhpc0RlcWRbaV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH0gLy8gY2FsbGJhY2tzIG9uIGRlcXVldWVcblxuXG4gICAgICAgIGlmIChkZXFkLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICBvcHRzLm9uRGVxZChzZWxmLCBkZXFkKTtcblxuICAgICAgICAgIGlmICghd2lsbERyYXcgJiYgb3B0cy5zaG91bGRSZWRyYXcoc2VsZiwgZGVxZCwgcGl4ZWxSYXRpbywgZXh0Z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ZnNldCA9IGxpbmVEYXNoT2Zmc2V0O1xuICAgICAgICBicmVhaztcblxuICAgICAgY2FzZSAnc29saWQnOlxuICAgICAgICBjYW52YXNDeHQuc2V0TGluZURhc2goW10pO1xuICAgICAgICBicmVhaztcbiAgICB9XG4gIH1cblxuICBpZiAoIXBhdGhDYWNoZUhpdCAmJiAhcnMuYmFkTGluZSkge1xuICAgIGlmIChjb250ZXh0LmJlZ2luUGF0aCkge1xuICAgICAgY29udGV4dC5iZWdpblBhdGgoKTtcbiAgICB9XG5cbiAgICBjb250ZXh0Lm1vdmVUbyhwdHNbMF0sIHB0c1sxXSk7XG5cbiAgICBzd2l0Y2ggKHJzLmVkZ2VUeXBlKSB7XG4gICAgICBjYXNlICdiZXppZXInOlxuICAgICAgY2FzZSAnc2VsZic6XG4gICAgICBjYXNlICdjb21wb3VuZCc6XG4gICAgICBjYXNlICdtdWx0aWJlemllcic6XG4gICAgICAgIGZvciAodmFyIGkgPSAyOyBpICsgMyA8IHB0cy5sZW5ndGg7IGkgKz0gNCkge1xuICAgICAgICAgIGNvbnRleHQucXVhZHJhdGljQ3VydmVUbyhwdHNbaV0sIHB0c1tpICsgMV0sIHB0c1tpICsgMl0sIHB0c1tpICsgM10pO1xuICAgICAgICB9XG5cbiAgICAgICAgYnJlYWs7XG5cbiAgICAgIGNhc2UgJ3N0cmFpZ2h0JzpcbiAgICAgIGNhc2UgJ3NlZ21lbnRzJzpcbiAgICAgIGNhc2UgJ2hheXN0YWNrJzpcbiAgICAgICAgZm9yICh2YXIgX2kgPSAyOyBfaSArIDEgPCBwdHMubGVuZ3RoOyBfaSArPSAyKSB7XG4gICAgICAgICAgY29udGV4dC5saW5lVG8ocHRzW19pXSwgcHRzW19pICsgMV0pO1xuICAgICAgICB9XG5cbiAgICAgICAgYnJlYWs7XG4gICAgfVxuICB9XG5cbiAgY29udGV4dCA9IGNhbnZhc0N4dDtcblxuICBpZiAodXNlUGF0aHMpIHtcbiAgICBjb250ZXh0LnN0cm9rZ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JTdHlsZSkge1xuICAgICAgICAgICAgY2FzZSAnZG90dGVkJzpcbiAgICAgICAgICAgICAgY29udGV4dC5zZXRMaW5lRGFzaChbMSwgMV0pO1xuICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAnZGFzaGVkJzpcbiAgICAgICAgICAgICAgY29udGV4dC5zZXRMaW5lRGFzaChbNCwgMl0pO1xuICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAnZG91YmxlJzpcbiAgICAgICAgICAgICAgY29udGV4dC5saW5lV2lkdGggPSB0ZXh0Qm9yZGVyV2lkdGggLyA0OyAvLyA1MCUgcmVzZXJ2ZWQgZm9yIHdoaXRlIGJldHdlZW4gdGhlIHR3byBib3JkZXJzXG5cbiAgICAgICAgICAgICAgY29udGV4dC5zZXRMaW5lRGFzaChbXSk7XG4gICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICBjYXNlICdzb2xpZCc6XG4gICAgICAgICAgICAgIGNvbnRleHQuc2V0TGluZURhc2goW10pO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBjb250ZXh0LnN0cm9rZVJlY3QoYmdYLCBiZ1ksIGJnVywgYmdIKTtcblxuICAgICAgICBpZiAodGV4dEJvcmRlclN0eWxlID09PSAnZG91YmxlJykge1xuICAgICAgICAgIHZhciB3aGl0ZVdpZHRoID0gdGV4dEJvcmRlcldpZHRoIC8gMjtcbiAgICAgICAgICBjb250ZXh0LnN0cm9rZVJlY3QoYmdYICsgd2hpdGVXaWR0aCwgYmdZICsgd2hpdGVXaWR0aCwgYmdXIC0gd2hpdGVXaWR0aCAqIDIsIGJnSCAtIHdoaXRlV2lkdGggKiAyKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjb250ZXh0LnNldExpbmVEYXNoKSB7XG4gICAgICAgICAgLy8gZm9yIHZlcnkgb3V0b2ZkYXRlIGJyb3dzZXJzXG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4gMCAmJiBhcmd1bWVudHNbMF0gIT09IHVuZGVmaW5lZCA/IGFyZ3VtZW50c1swXSA6IGVsZU9wYWNpdHk7XG4gICAgdmFyIG9wYWNpdHkgPSAoZGFya25lc3MgPiAwID8gZGFya25lc3MgOiAtZGFya25lc3MpICogZGFya2VuT3BhY2l0eTtcbiAgICB2YXIgYyA9IGRhcmtuZXNzID4gMCA/IDAgOiAyNTU7XG5cbiAgICBpZiAoZGFya25lc3MgIT09IDApIHtcbiAgICAgIHIuY29sb3JGaWxsU3R5bGUoY29udGV4dCwgYywgYywgYywgb3BhY2l0eSk7XG5cbiAgICAgIGlmICh1c2VQYXRocykge1xuICAgICAgICBjb250ZXh0LmZpbGwocGF0aCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBjb250ZXh0LmZpbGwoKTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbiAgdmFyIGRyYXdCb3JkZXIgPSBmdW5jdGlvbiBkcmF3Qm9yZGVyKCkge1xuICAgIGlmIChib3JkZXJXaWR0aCA+IDApIHtcbiAgICAgIGNvbnRleHQubGluZVdpZHRoID0gYm9yZGVyV2lkdGg7XG4gICAgICBjb250ZXh0LmxpbmVDYXAgPSAnYnV0dCc7XG5cbiAgICAgIGlmIChjb250ZXh0LnNldExpbmVEYXNoKSB7XG4gICAgICAgIC8vIGZvciB2ZXJ5IG91dG9mZGF0ZSBicm93c2Vyc1xuICAgICAgICBzd2l0Y2ggKGJvcmRlclN0eWxlKSB7XG4gICAgICAgICAgY2FzZSAnZG90dGVkJzpcbiAgICAgICAgICAgIGNvbnRleHQuc2V0TGluZURhc2goWzEsIDFdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAnZGFzaGVkJzpcbiAgICAgICAgICAgIGNvbnRleHQuc2V0TGluZURhc2goWzQsIDJdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAnc29saWQnOlxuICAgICAgICAgIGNhc2UgJ2RvdWJsZSc6XG4gICAgICAgICAgICBjb250ZXh0LnNldExpbmVEYXNoKFtdKTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmICh1c2VQYXRocykge1xuICAgICAgICBjb250ZXh0LnN0cm9rZShwYXRoKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbnRleHQuc3Ryb2tlKCk7XG4gICAgICB9XG5cbiAgICAgIGlmIChib3JkZXJTdHlsZSA9PT0gJ2RvdWJsZScpIHtcbiAgICAgICAgY29udGV4dC5saW5lV2lkdGggPSBib3JkZXJXaWR0aCAvIDM7XG4gICAgICAgIHZhciBnY28gPSBjb250ZXh0Lmdsb2JhbENvbXBvc2l0ZU9wZXJhdGlvbjtcbiAgICAgICAgY29udGV4dC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSAnZGVzdGluYXRpb24tb3V0JztcblxuICAgICAgICBpZiAodXNlUGF0aHMpIHtcbiAgICAgICAgICBjb250ZXh0LnN0cm9rZShwYXRoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjb250ZXh0LnN0cm9rZSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgY29udGV4dC5nbG9iYWxDb21wb3NpdGVPcGVyYXRpb24gPSBnY287XG4gICAgICB9IC8vIHJlc2V0IGluIGNhc2Ugd2UgY2hhbmdlZCB0aGUgYm9yZGVyIHN0eWxlXG5cblxuICAgICAgaWYgKGNvbnRleHQuc2V0TGluZURhc2gpIHtcbiAgICAgICAgLy8gZm9yIHZlcnkgb3V0b2ZkYXRlIGJyb3dzZXJzXG4gICAgICAgIGNvbnRleHQuc2V0TGluZURhc2goW10pO1xuICAgICAgfVxuICAgIH1cbiAgfTtcblxuICB2YXIgZHJhd092ZXJsYXkgPSBmdW5jdGlvbiBkcmF3T3ZlcmxheSgpIHtcbiAgICBpZiAoc2hvdWxkRHJhd092ZXJsYXkpIHtcbiAgICAgIHIuZH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Wxsb3cgZm9yIHJlZ2lzdHJhdGlvbiBvZiBleHRlbnNpb25zXG4gIGVsc2UgaWYgKHN0cmluZyhvcHRpb25zKSkge1xuICAgICAgcmV0dXJuIGV4dGVuc2lvbi5hcHBseShleHRlbnNpb24sIGFyZ3VtZW50cyk7XG4gICAgfVxufTsgLy8gZS5nLiBjeXRvc2NhcGUudXNlKCByZXF1aXJlKCdjeXRvc2NhcGUtZm9vJyksIGJhciApXG5cblxuY3l0b3NjYXBlLnVzZSA9IGZ1bmN0aW9uIChleHQpIHtcbiAgdmFyIGFyZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbChhcmd1bWVudHMsIDEpOyAvLyBhcmdzIHRvIHBhc3MgdG8gZXh0XG5cbiAgYXJncy51bnNoaWZ0KGN5dG9zY2FwZSk7IC8vIGN5dG9zY2FwZSBpcyBmaXJzdCBhcmcgdG8gZXh0XG5cbiAgZXh0LmFwcGx5KG51bGwsIGFyZ3MpO1xuICByZXR1cm4gdGhpcztcbn07XG5cbmN5dG9zY2FwZS53YXJuaW5ncyA9IGZ1bmN0aW9uIChib29sKSB7XG4gIHJldHVybiB3YXJuaW5ncyhib29sKTtcbn07IC8vIHJlcGxhY2VkIGJ5IGJ1aWxkIHN5c3RlbVxuXG5cbmN5dG9zY2FwZS52ZXJzaW9uID0gdmVyc2lvbjsgLy8gZXhwb3NlIHB1YmxpYyBhcGlzIChtb3N0bHkgZm9yIGV4dGVuc2lvbnMpXG5cbmN5dG9zY2FwZS5zdHlsZXNoZWV0ID0gY3l0b3NjYXBlLlN0eWxlc2hlZXQgPSBTdHlsZXNoZWV0O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGN5dG9zY2FwZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/cytoscape/dist/cytoscape.cjs.js\n"); /***/ }), /***/ "./node_modules/dagre/index.js": /*!*************************************!*\ !*** ./node_modules/dagre/index.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/*\nCopyright (c) 2012-2014 Chris Pettitt\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\n\nmodule.exports = {\n graphlib: __webpack_require__(/*! ./lib/graphlib */ \"./node_modules/dagre/lib/graphlib.js\"),\n\n layout: __webpack_require__(/*! ./lib/layout */ \"./node_modules/dagre/lib/layout.js\"),\n debug: __webpack_require__(/*! ./lib/debug */ \"./node_modules/dagre/lib/debug.js\"),\n util: {\n time: __webpack_require__(/*! ./lib/util */ \"./node_modules/dagre/lib/util.js\").time,\n notime: __webpack_require__(/*! ./lib/util */ \"./node_modules/dagre/lib/util.js\").notime\n },\n version: __webpack_require__(/*! ./lib/version */ \"./node_modules/dagre/lib/version.js\")\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9pbmRleC5qc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XG4gIGRlYnVnOiByZXF1aXJlKFwiLi9saWIvZGVidWdcIiksXG4gIHV0aWw6IHtcbiAgICB0aW1lOiByZXF1aXJlKFwiLi9saWIvdXRpbFwiKS50aW1lLFxuICAgIG5vdGltZTogcmVxdWlyZShcIi4vbGliL3V0aWxcIikubm90aW1lXG4gIH0sXG4gIHZlcnNpb246IHJlcXVpcmUoXCIuL2xpYi92ZXJzaW9uXCIpXG59O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/dagre/index.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/acyclic.js": /*!*******************************************!*\ !*** ./node_modules/dagre/lib/acyclic.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar greedyFAS = __webpack_require__(/*! ./greedy-fas */ \"./node_modules/dagre/lib/greedy-fas.js\");\n\nmodule.exports = {\n run: run,\n undo: undo\n};\n\nfunction run(g) {\n var fas = (g.graph().acyclicer === \"greedy\"\n ? greedyFAS(g, weightFn(g))\n : dfsFAS(g));\n _.forEach(fas, function(e) {\n var label = g.edge(e);\n g.removeEdge(e);\n label.forwardName = e.name;\n label.reversed = true;\n g.setEdge(e.w, e.v, label, _.uniqueId(\"rev\"));\n });\n\n function weightFn(g) {\n return function(e) {\n return g.edge(e).weight;\n };\n }\n}\n\nfunction dfsFAS(g) {\n var fas = [];\n var stack = {};\n var visited = {};\n\n function dfs(v) {\n if (_.has(visited, v)) {\n return;\n }\n visited[v] = true;\n stack[v] = true;\n _.forEach(g.outEdges(v), function(e) {\n if (_.has(stack, e.w)) {\n fas.push(e);\n } else {\n dfs(e.w);\n }\n });\n delete stack[v];\n }\n\n _.forEach(g.nodes(), dfs);\n return fas;\n}\n\nfunction undo(g) {\n _.forEach(g.edges(), function(e) {\n var label = g.edge(e);\n if (label.reversed) {\n g.removeEdge(e);\n\n var forwardName = label.forwardName;\n delete label.reversed;\n delete label.forwardName;\n g.setEdge(e.w, e.v, label, forwardName);\n }\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvYWN5Y2xpYy5qcz9hNmQxIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhOztBQUViLFFBQVEsbUJBQU8sQ0FBQyxvREFBVTtBQUMxQixnQkFBZ0IsbUJBQU8sQ0FBQyw0REFBYzs7QUFFdEM7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxHQUFHOztBQUVIO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxPQUFPO0FBQ1A7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxHQUFHO0FBQ0giLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZGFncmUvbGliL2FjeWNsaWMuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxudmFyIF8gPSByZXF1aXJlKFwiLi9sb2Rhc2hcIik7XG52YXIgZ3JlZWR5RkFTID0gcmVxdWlyZShcIi4vZ3JlZWR5LWZhc1wiKTtcblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gIHJ1bjogcnVuLFxuICB1bmRvOi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cblxuICBfLmZvckVhY2goZy5ub2RlcygpLCBkZnMpO1xuICByZXR1cm4gZmFzO1xufVxuXG5mdW5jdGlvbiB1bmRvKGcpIHtcbiAgXy5mb3JFYWNoKGcuZWRnZXMoKSwgZnVuY3Rpb24oZSkge1xuICAgIHZhciBsYWJlbCA9IGcuZWRnZShlKTtcbiAgICBpZiAobGFiZWwucmV2ZXJzZWQpIHtcbiAgICAgIGcucmVtb3ZlRWRnZShlKTtcblxuICAgICAgdmFyIGZvcndhcmROYW1lID0gbGFiZWwuZm9yd2FyZE5hbWU7XG4gICAgICBkZWxldGUgbGFiZWwucmV2ZXJzZWQ7XG4gICAgICBkZWxldGUgbGFiZWwuZm9yd2FyZE5hbWU7XG4gICAgICBnLnNldEVkZ2UoZS53LCBlLnYsIGxhYmVsLCBmb3J3YXJkTmFtZSk7XG4gICAgfVxuICB9KTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/acyclic.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/add-border-segments.js": /*!*******************************************************!*\ !*** ./node_modules/dagre/lib/add-border-segments.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/util.js\");\n\nmodule.exports = addBorderSegments;\n\nfunction addBorderSegments(g) {\n function dfs(v) {\n var children = g.children(v);\n var node = g.node(v);\n if (children.length) {\n _.forEach(children, dfs);\n }\n\n if (_.has(node, \"minRank\")) {\n node.borderLeft = [];\n node.borderRight = [];\n for (var rank = node.minRank, maxRank = node.maxRank + 1;\n rank < maxRank;\n ++rank) {\n addBorderNode(g, \"borderLeft\", \"_bl\", v, node, rank);\n addBorderNode(g, \"borderRight\", \"_br\", v, node, rank);\n }\n }\n }\n\n _.forEach(g.children(), dfs);\n}\n\nfunction addBorderNode(g, prop, prefix, sg, sgNode, rank) {\n var label = { width: 0, height: 0, rank: rank, borderType: prop };\n var prev = sgNode[prop][rank - 1];\n var curr = util.addDummyNode(g, \"border\", label, prefix);\n sgNode[prop][rank] = curr;\n g.setParent(curr, sg);\n if (prev) {\n g.setEdge(prev, curr, { weight: 1 });\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvYWRkLWJvcmRlci1zZWdtZW50cy5qcz8yMjBlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQVEsbUJBQU8sQ0FBQyxvREFBVTtBQUMxQixXQUFXLG1CQUFPLENBQUMsZ0RBQVE7O0FBRTNCOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBLGVBQWU7QUFDZjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsMkJBQTJCLFlBQVk7QUFDdkM7QUFDQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvYWRkLWJvcmRlci1zZWdtZW50cy5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBfID0gcmVxdWlyZShcIi4vbG9kYXNoXCIpO1xudmFyIHV0aWwgPSByZXF1aXJlKFwiLi91dGlsXCIpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGFkZEJvcmRlclNlZ21lbnRzO1xuXG5mdW5jdGlvbiBhZGRCb3JkZXJTZWdtZW50cyhnKSB7XG4gIGZ1bmN0aW9uIGRmcyh2KSB7XG4gICAgdmFyIGNoaWxkcmVuID0gZy5jaGls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iwgY3VyciwgeyB3ZWlnaHQ6IDEgfSk7XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/add-border-segments.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/coordinate-system.js": /*!*****************************************************!*\ !*** ./node_modules/dagre/lib/coordinate-system.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\n\nmodule.exports = {\n adjust: adjust,\n undo: undo\n};\n\nfunction adjust(g) {\n var rankDir = g.graph().rankdir.toLowerCase();\n if (rankDir === \"lr\" || rankDir === \"rl\") {\n swapWidthHeight(g);\n }\n}\n\nfunction undo(g) {\n var rankDir = g.graph().rankdir.toLowerCase();\n if (rankDir === \"bt\" || rankDir === \"rl\") {\n reverseY(g);\n }\n\n if (rankDir === \"lr\" || rankDir === \"rl\") {\n swapXY(g);\n swapWidthHeight(g);\n }\n}\n\nfunction swapWidthHeight(g) {\n _.forEach(g.nodes(), function(v) { swapWidthHeightOne(g.node(v)); });\n _.forEach(g.edges(), function(e) { swapWidthHeightOne(g.edge(e)); });\n}\n\nfunction swapWidthHeightOne(attrs) {\n var w = attrs.width;\n attrs.width = attrs.height;\n attrs.height = w;\n}\n\nfunction reverseY(g) {\n _.forEach(g.nodes(), function(v) { reverseYOne(g.node(v)); });\n\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n _.forEach(edge.points, reverseYOne);\n if (_.has(edge, \"y\")) {\n reverseYOne(edge);\n }\n });\n}\n\nfunction reverseYOne(attrs) {\n attrs.y = -attrs.y;\n}\n\nfunction swapXY(g) {\n _.forEach(g.nodes(), function(v) { swapXYOne(g.node(v)); });\n\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n _.forEach(edge.points, swapXYOne);\n if (_.has(edge, \"x\")) {\n swapXYOne(edge);\n }\n });\n}\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geyByZXZlcnNlWU9uZShnLm5vZGUodikpOyB9KTtcblxuICBfLmZvckVhY2goZy5lZGdlcygpLCBmdW5jdGlvbihlKSB7XG4gICAgdmFyIGVkZ2UgPSBnLmVkZ2UoZSk7XG4gICAgXy5mb3JFYWNoKGVkZ2UucG9pbnRzLCByZXZlcnNlWU9uZSk7XG4gICAgaWYgKF8uaGFzKGVkZ2UsIFwieVwiKSkge1xuICAgICAgcmV2ZXJzZVlPbmUoZWRnZSk7XG4gICAgfVxuICB9KTtcbn1cblxuZnVuY3Rpb24gcmV2ZXJzZVlPbmUoYXR0cnMpIHtcbiAgYXR0cnMueSA9IC1hdHRycy55O1xufVxuXG5mdW5jdGlvbiBzd2FwWFkoZykge1xuICBfLmZvckVhY2goZy5ub2RlcygpLCBmdW5jdGlvbih2KSB7IHN3YXBYWU9uZShnLm5vZGUodikpOyB9KTtcblxuICBfLmZvckVhY2goZy5lZGdlcygpLCBmdW5jdGlvbihlKSB7XG4gICAgdmFyIGVkZ2UgPSBnLmVkZ2UoZSk7XG4gICAgXy5mb3JFYWNoKGVkZ2UucG9pbnRzLCBzd2FwWFlPbmUpO1xuICAgIGlmIChfLmhhcyhlZGdlLCBcInhcIikpIHtcbiAgICAgIHN3YXBYWU9uZShlZGdlKTtcbiAgICB9XG4gIH0pO1xufVxuXG5mdW5jdGlvbiBzd2FwWFlPbmUoYXR0cnMpIHtcbiAgdmFyIHggPSBhdHRycy54O1xuICBhdHRycy54ID0gYXR0cnMueTtcbiAgYXR0cnMueSA9IHg7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/coordinate-system.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/data/list.js": /*!*********************************************!*\ !*** ./node_modules/dagre/lib/data/list.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/*\n * Simple doubly linked list implementation derived from Cormen, et al.,\n * \"Introduction to Algorithms\".\n */\n\nmodule.exports = List;\n\nfunction List() {\n var sentinel = {};\n sentinel._next = sentinel._prev = sentinel;\n this._sentinel = sentinel;\n}\n\nList.prototype.dequeue = function() {\n var sentinel = this._sentinel;\n var entry = sentinel._prev;\n if (entry !== sentinel) {\n unlink(entry);\n return entry;\n }\n};\n\nList.prototype.enqueue = function(entry) {\n var sentinel = this._sentinel;\n if (entry._prev && entry._next) {\n unlink(entry);\n }\n entry._next = sentinel._next;\n sentinel._next._prev = entry;\n sentinel._next = entry;\n entry._prev = sentinel;\n};\n\nList.prototype.toString = function() {\n var strs = [];\n var sentinel = this._sentinel;\n var curr = sentinel._prev;\n while (curr !== sentinel) {\n strs.push(JSON.stringify(curr, filterOutLinks));\n curr = curr._prev;\n }\n return \"[\" + strs.join(\", \") + \"]\";\n};\n\nfunction unlink(entry) {\n entry._prev._next = entry._next;\n entry._next._prev = entry._prev;\n delete entry._next;\n delete entry._prev;\n}\n\nfunction filterOutLinks(k, v) {\n if (k !== \"_next\" && k !== \"_prev\") {\n return v;\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvZGF0YS9saXN0LmpzPzQ1ODkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs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ucHJvdG90eXBlLnRvU3RyaW5nID0gZnVuY3Rpb24oKSB7XG4gIHZhciBzdHJzID0gW107XG4gIHZhciBzZW50aW5lbCA9IHRoaXMuX3NlbnRpbmVsO1xuICB2YXIgY3VyciA9IHNlbnRpbmVsLl9wcmV2O1xuICB3aGlsZSAoY3VyciAhPT0gc2VudGluZWwpIHtcbiAgICBzdHJzLnB1c2goSlNPTi5zdHJpbmdpZnkoY3VyciwgZmlsdGVyT3V0TGlua3MpKTtcbiAgICBjdXJyID0gY3Vyci5fcHJldjtcbiAgfVxuICByZXR1cm4gXCJbXCIgKyBzdHJzLmpvaW4oXCIsIFwiKSArIFwiXVwiO1xufTtcblxuZnVuY3Rpb24gdW5saW5rKGVudHJ5KSB7XG4gIGVudHJ5Ll9wcmV2Ll9uZXh0ID0gZW50cnkuX25leHQ7XG4gIGVudHJ5Ll9uZXh0Ll9wcmV2ID0gZW50cnkuX3ByZXY7XG4gIGRlbGV0ZSBlbnRyeS5fbmV4dDtcbiAgZGVsZXRlIGVudHJ5Ll9wcmV2O1xufVxuXG5mdW5jdGlvbiBmaWx0ZXJPdXRMaW5rcyhrLCB2KSB7XG4gIGlmIChrICE9PSBcIl9uZXh0XCIgJiYgayAhPT0gXCJfcHJldlwiKSB7XG4gICAgcmV0dXJuIHY7XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/data/list.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/debug.js": /*!*****************************************!*\ !*** ./node_modules/dagre/lib/debug.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/util.js\");\nvar Graph = __webpack_require__(/*! ./graphlib */ \"./node_modules/dagre/lib/graphlib.js\").Graph;\n\nmodule.exports = {\n debugOrdering: debugOrdering\n};\n\n/* istanbul ignore next */\nfunction debugOrdering(g) {\n var layerMatrix = util.buildLayerMatrix(g);\n\n var h = new Graph({ compound: true, multigraph: true }).setGraph({});\n\n _.forEach(g.nodes(), function(v) {\n h.setNode(v, { label: v });\n h.setParent(v, \"layer\" + g.node(v).rank);\n });\n\n _.forEach(g.edges(), function(e) {\n h.setEdge(e.v, e.w, {}, e.name);\n });\n\n _.forEach(layerMatrix, function(layer, i) {\n var layerV = \"layer\" + i;\n h.setNode(layerV, { rank: \"same\" });\n _.reduce(layer, function(u, v) {\n h.setEdge(u, v, { style: \"invis\" });\n return v;\n });\n });\n\n return h;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvZGVidWcuanM/ZTA5MCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxRQUFRLG1CQUFPLENBQUMsb0RBQVU7QUFDMUIsV0FBVyxtQkFBTyxDQUFDLGdEQUFRO0FBQzNCLFlBQVksbUJBQU8sQ0FBQyx3REFBWTs7QUFFaEM7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQSxxQkFBcUIsbUNBQW1DLGFBQWE7O0FBRXJFO0FBQ0Esa0JBQWtCLFdBQVc7QUFDN0I7QUFDQSxHQUFHOztBQUVIO0FBQ0EsMEJBQTBCO0FBQzFCLEdBQUc7O0FBRUg7QUFDQTtBQUNBLHVCQUF1QixlQUFlO0FBQ3RDO0FBQ0EsdUJBQXVCLGlCQUFpQjtBQUN4QztBQUNBLEtBQUs7QUFDTCxHQUFHOztBQUVIO0FBQ0EiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZGFncmUvbGliL2RlYnVnLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIF8gPSByZXF1aXJlKFwiLi9sb2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n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/debug.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/graphlib.js": /*!********************************************!*\ !*** ./node_modules/dagre/lib/graphlib.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* global window */\n\nvar graphlib;\n\nif (true) {\n try {\n graphlib = __webpack_require__(/*! graphlib */ \"./node_modules/graphlib/index.js\");\n } catch (e) {\n // continue regardless of error\n }\n}\n\nif (!graphlib) {\n graphlib = window.graphlib;\n}\n\nmodule.exports = graphlib;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvZ3JhcGhsaWIuanM/MTdkNSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7QUFFQTs7QUFFQSxJQUFJLElBQTZCO0FBQ2pDO0FBQ0EsZUFBZSxtQkFBTyxDQUFDLGtEQUFVO0FBQ2pDLEdBQUc7QUFDSDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2RhZ3JlL2xpYi9ncmFwaGxpYi5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGdsb2JhbCB3aW5kb3cgKi9cblxudmFyIGdyYXBobGliO1xuXG5pZiAodHlwZW9mIHJlcXVpcmUgPT09IFwiZnVuY3Rpb25cIikge1xuICB0cnkge1xuICAgIGdyYXBobGliID0gcmVxdWlyZShcImdyYXBobGliXCIpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgLy8gY29udGludWUgcmVnYXJkbGVzcyBvZiBlcnJvclxuICB9XG59XG5cbmlmICghZ3JhcGhsaWIpIHtcbiAgZ3JhcGhsaWIgPSB3aW5kb3cuZ3JhcGhsaWI7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gZ3JhcGhsaWI7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/graphlib.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/greedy-fas.js": /*!**********************************************!*\ !*** ./node_modules/dagre/lib/greedy-fas.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar Graph = __webpack_require__(/*! ./graphlib */ \"./node_modules/dagre/lib/graphlib.js\").Graph;\nvar List = __webpack_require__(/*! ./data/list */ \"./node_modules/dagre/lib/data/list.js\");\n\n/*\n * A greedy heuristic for finding a feedback arc set for a graph. A feedback\n * arc set is a set of edges that can be removed to make a graph acyclic.\n * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, \"A fast and\n * effective heuristic for the feedback arc set problem.\" This implementation\n * adjusts that from the paper to allow for weighted edges.\n */\nmodule.exports = greedyFAS;\n\nvar DEFAULT_WEIGHT_FN = _.constant(1);\n\nfunction greedyFAS(g, weightFn) {\n if (g.nodeCount() <= 1) {\n return [];\n }\n var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN);\n var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx);\n\n // Expand multi-edges\n return _.flatten(_.map(results, function(e) {\n return g.outEdges(e.v, e.w);\n }), true);\n}\n\nfunction doGreedyFAS(g, buckets, zeroIdx) {\n var results = [];\n var sources = buckets[buckets.length - 1];\n var sinks = buckets[0];\n\n var entry;\n while (g.nodeCount()) {\n while ((entry = sinks.dequeue())) { removeNode(g, buckets, zeroIdx, entry); }\n while ((entry = sources.dequeue())) { removeNode(g, buckets, zeroIdx, entry); }\n if (g.nodeCount()) {\n for (var i = buckets.length - 2; i > 0; --i) {\n entry = buckets[i].dequeue();\n if (entry) {\n results = results.concat(removeNode(g, buckets, zeroIdx, entry, true));\n break;\n }\n }\n }\n }\n\n return results;\n}\n\nfunction removeNode(g, buckets, zeroIdx, entry, collectPredecessors) {\n var results = collectPredecessors ? [] : undefined;\n\n _.forEach(g.inEdges(entry.v), function(edge) {\n var weight = g.edge(edge);\n var uEntry = g.node(edge.v);\n\n if (collectPredecessors) {\n results.push({ v: edge.v, w: edge.w });\n }\n\n uEntry.out -= weight;\n assignBucket(buckets, zeroIdx, uEntry);\n });\n\n _.forEach(g.outEdges(entry.v), function(edge) {\n var weight = g.edge(edge);\n var w = edge.w;\n var wEntry = g.node(w);\n wEntry[\"in\"] -= weight;\n assignBucket(buckets, zeroIdx, wEntry);\n });\n\n g.removeNode(entry.v);\n\n return results;\n}\n\nfunction buildState(g, weightFn) {\n var fasGraph = new Graph();\n var maxIn = 0;\n var maxOut = 0;\n\n _.forEach(g.nodes(), function(v) {\n fasGraph.setNode(v, { v: v, \"in\": 0, out: 0 });\n });\n\n // Aggregate weights on nodes, but also sum the weights across multi-edges\n // into a single edge for the fasGraph.\n _.forEach(g.edges(), function(e) {\n var prevWeight = fasGraph.edge(e.v, e.w) || 0;\n var weight = weightFn(e);\n var edgeWeight = prevWeight + weight;\n fasGraph.setEdge(e.v, e.w, edgeWeight);\n maxOut = Math.max(maxOut, fasGraph.node(e.v).out += weight);\n maxIn = Math.max(maxIn, fasGraph.node(e.w)[\"in\"] += weight);\n });\n\n var buckets = _.range(maxOut + maxIn + 3).map(function() { return new List(); });\n var zeroIdx = maxIn + 1;\n\n _.forEach(fasGraph.nodes(), function(v) {\n assignBucket(buckets, zeroIdx, fasGraph.node(v));\n });\n\n return { graph: fasGraph, buckets: buckets, zeroIdx: zeroIdx };\n}\n\nfunction assignBucket(buckets, zeroIdx, entry) {\n if (!entry.out) {\n buckets[0].enqueue(entry);\n } else if (!entry[\"in\"]) {\n buckets[buckets.length - 1].enqueue(entry);\n } else {\n buckets[entry.out - entry[\"in\"] + zeroIdx].enqueue(entry);\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,e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biAgICBhc3NpZ25CdWNrZXQoYnVja2V0cywgemVyb0lkeCwgZmFzR3JhcGgubm9kZSh2KSk7XG4gIH0pO1xuXG4gIHJldHVybiB7IGdyYXBoOiBmYXNHcmFwaCwgYnVja2V0czogYnVja2V0cywgemVyb0lkeDogemVyb0lkeCB9O1xufVxuXG5mdW5jdGlvbiBhc3NpZ25CdWNrZXQoYnVja2V0cywgemVyb0lkeCwgZW50cnkpIHtcbiAgaWYgKCFlbnRyeS5vdXQpIHtcbiAgICBidWNrZXRzWzBdLmVucXVldWUoZW50cnkpO1xuICB9IGVsc2UgaWYgKCFlbnRyeVtcImluXCJdKSB7XG4gICAgYnVja2V0c1tidWNrZXRzLmxlbmd0aCAtIDFdLmVucXVldWUoZW50cnkpO1xuICB9IGVsc2Uge1xuICAgIGJ1Y2tldHNbZW50cnkub3V0IC0gZW50cnlbXCJpblwiXSArIHplcm9JZHhdLmVucXVldWUoZW50cnkpO1xuICB9XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/greedy-fas.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/layout.js": /*!******************************************!*\ !*** ./node_modules/dagre/lib/layout.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar acyclic = __webpack_require__(/*! ./acyclic */ \"./node_modules/dagre/lib/acyclic.js\");\nvar normalize = __webpack_require__(/*! ./normalize */ \"./node_modules/dagre/lib/normalize.js\");\nvar rank = __webpack_require__(/*! ./rank */ \"./node_modules/dagre/lib/rank/index.js\");\nvar normalizeRanks = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/util.js\").normalizeRanks;\nvar parentDummyChains = __webpack_require__(/*! ./parent-dummy-chains */ \"./node_modules/dagre/lib/parent-dummy-chains.js\");\nvar removeEmptyRanks = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/util.js\").removeEmptyRanks;\nvar nestingGraph = __webpack_require__(/*! ./nesting-graph */ \"./node_modules/dagre/lib/nesting-graph.js\");\nvar addBorderSegments = __webpack_require__(/*! ./add-border-segments */ \"./node_modules/dagre/lib/add-border-segments.js\");\nvar coordinateSystem = __webpack_require__(/*! ./coordinate-system */ \"./node_modules/dagre/lib/coordinate-system.js\");\nvar order = __webpack_require__(/*! ./order */ \"./node_modules/dagre/lib/order/index.js\");\nvar position = __webpack_require__(/*! ./position */ \"./node_modules/dagre/lib/position/index.js\");\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/util.js\");\nvar Graph = __webpack_require__(/*! ./graphlib */ \"./node_modules/dagre/lib/graphlib.js\").Graph;\n\nmodule.exports = layout;\n\nfunction layout(g, opts) {\n var time = opts && opts.debugTiming ? util.time : util.notime;\n time(\"layout\", function() {\n var layoutGraph = \n time(\" buildLayoutGraph\", function() { return buildLayoutGraph(g); });\n time(\" runLayout\", function() { runLayout(layoutGraph, time); });\n time(\" updateInputGraph\", function() { updateInputGraph(g, layoutGraph); });\n });\n}\n\nfunction runLayout(g, time) {\n time(\" makeSpaceForEdgeLabels\", function() { makeSpaceForEdgeLabels(g); });\n time(\" removeSelfEdges\", function() { removeSelfEdges(g); });\n time(\" acyclic\", function() { acyclic.run(g); });\n time(\" nestingGraph.run\", function() { nestingGraph.run(g); });\n time(\" rank\", function() { rank(util.asNonCompoundGraph(g)); });\n time(\" injectEdgeLabelProxies\", function() { injectEdgeLabelProxies(g); });\n time(\" removeEmptyRanks\", function() { removeEmptyRanks(g); });\n time(\" nestingGraph.cleanup\", function() { nestingGraph.cleanup(g); });\n time(\" normalizeRanks\", function() { normalizeRanks(g); });\n time(\" assignRankMinMax\", function() { assignRankMinMax(g); });\n time(\" removeEdgeLabelProxies\", function() { removeEdgeLabelProxies(g); });\n time(\" normalize.run\", function() { normalize.run(g); });\n time(\" parentDummyChains\", function() { parentDummyChains(g); });\n time(\" addBorderSegments\", function() { addBorderSegments(g); });\n time(\" order\", function() { order(g); });\n time(\" insertSelfEdges\", function() { insertSelfEdges(g); });\n time(\" adjustCoordinateSystem\", function() { coordinateSystem.adjust(g); });\n time(\" position\", function() { position(g); });\n time(\" positionSelfEdges\", function() { positionSelfEdges(g); });\n time(\" removeBorderNodes\", function() { removeBorderNodes(g); });\n time(\" normalize.undo\", function() { normalize.undo(g); });\n time(\" fixupEdgeLabelCoords\", function() { fixupEdgeLabelCoords(g); });\n time(\" undoCoordinateSystem\", function() { coordinateSystem.undo(g); });\n time(\" translateGraph\", function() { translateGraph(g); });\n time(\" assignNodeIntersects\", function() { assignNodeIntersects(g); });\n time(\" reversePoints\", function() { reversePointsForReversedEdges(g); });\n time(\" acyclic.undo\", function() { acyclic.undo(g); });\n}\n\n/*\n * Copies final layout information from the layout graph back to the input\n * graph. This process only copies whitelisted attributes from the layout graph\n * to the input graph, so it serves as a good place to determine what\n * attributes can influence layout.\n */\nfunction updateInputGraph(inputGraph, layoutGraph) {\n _.forEach(inputGraph.nodes(), function(v) {\n var inputLabel = inputGraph.node(v);\n var layoutLabel = layoutGraph.node(v);\n\n if (inputLabel) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n\n if (layoutGraph.children(v).length) {\n inputLabel.width = layoutLabel.width;\n inputLabel.height = layoutLabel.height;\n }\n }\n });\n\n _.forEach(inputGraph.edges(), function(e) {\n var inputLabel = inputGraph.edge(e);\n var layoutLabel = layoutGraph.edge(e);\n\n inputLabel.points = layoutLabel.points;\n if (_.has(layoutLabel, \"x\")) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n }\n });\n\n inputGraph.graph().width = layoutGraph.graph().width;\n inputGraph.graph().height = layoutGraph.graph().height;\n}\n\nvar graphNumAttrs = [\"nodesep\", \"edgesep\", \"ranksep\", \"marginx\", \"marginy\"];\nvar graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: \"tb\" };\nvar graphAttrs = [\"acyclicer\", \"ranker\", \"rankdir\", \"align\"];\nvar nodeNumAttrs = [\"width\", \"height\"];\nvar nodeDefaults = { width: 0, height: 0 };\nvar edgeNumAttrs = [\"minlen\", \"weight\", \"width\", \"height\", \"labeloffset\"];\nvar edgeDefaults = {\n minlen: 1, weight: 1, width: 0, height: 0,\n labeloffset: 10, labelpos: \"r\"\n};\nvar edgeAttrs = [\"labelpos\"];\n\n/*\n * Constructs a new graph from the input graph, which can be used for layout.\n * This process copies only whitelisted attributes from the input graph to the\n * layout graph. Thus this function serves as a good place to determine what\n * attributes can influence layout.\n */\nfunction buildLayoutGraph(inputGraph) {\n var g = new Graph({ multigraph: true, compound: true });\n var graph = canonicalize(inputGraph.graph());\n\n g.setGraph(_.merge({},\n graphDefaults,\n selectNumberAttrs(graph, graphNumAttrs),\n _.pick(graph, graphAttrs)));\n\n _.forEach(inputGraph.nodes(), function(v) {\n var node = canonicalize(inputGraph.node(v));\n g.setNode(v, _.defaults(selectNumberAttrs(node, nodeNumAttrs), nodeDefaults));\n g.setParent(v, inputGraph.parent(v));\n });\n\n _.forEach(inputGraph.edges(), function(e) {\n var edge = canonicalize(inputGraph.edge(e));\n g.setEdge(e, _.merge({},\n edgeDefaults,\n selectNumberAttrs(edge, edgeNumAttrs),\n _.pick(edge, edgeAttrs)));\n });\n\n return g;\n}\n\n/*\n * This idea comes from the Gansner paper: to account for edge labels in our\n * layout we split each rank in half by doubling minlen and halving ranksep.\n * Then we can place labels at these mid-points between nodes.\n *\n * We also add some minimal padding to the width to push the label for the edge\n * away from the edge itself a bit.\n */\nfunction makeSpaceForEdgeLabels(g) {\n var graph = g.graph();\n graph.ranksep /= 2;\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n edge.minlen *= 2;\n if (edge.labelpos.toLowerCase() !== \"c\") {\n if (graph.rankdir === \"TB\" || graph.rankdir === \"BT\") {\n edge.width += edge.labeloffset;\n } else {\n edge.height += edge.labeloffset;\n }\n }\n });\n}\n\n/*\n * Creates temporary dummy nodes that capture the rank in which each edge's\n * label is going to, if it has one of non-zero width and height. We do this\n * so that we can safely remove empty ranks while preserving balance for the\n * label's position.\n */\nfunction injectEdgeLabelProxies(g) {\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n if (edge.width && edge.height) {\n var v = g.node(e.v);\n var w = g.node(e.w);\n var label = { rank: (w.rank - v.rank) / 2 + v.rank, e: e };\n util.addDummyNode(g, \"edge-proxy\", label, \"_ep\");\n }\n });\n}\n\nfunction assignRankMinMax(g) {\n var maxRank = 0;\n _.forEach(g.nodes(), function(v) {\n var node = g.node(v);\n if (node.borderTop) {\n node.minRank = g.node(node.borderTop).rank;\n node.maxRank = g.node(node.borderBottom).rank;\n maxRank = _.max(maxRank, node.maxRank);\n }\n });\n g.graph().maxRank = maxRank;\n}\n\nfunction removeEdgeLabelProxies(g) {\n _.forEach(g.nodes(), function(v) {\n var node = g.node(v);\n if (node.dummy === \"edge-proxy\") {\n g.edge(node.e).labelRank = node.rank;\n g.removeNode(v);\n }\n });\n}\n\nfunction translateGraph(g) {\n var minX = Number.POSITIVE_INFINITY;\n var maxX = 0;\n var minY = Number.POSITIVE_INFINITY;\n var maxY = 0;\n var graphLabel = g.graph();\n var marginX = graphLabel.marginx || 0;\n var marginY = graphLabel.marginy || 0;\n\n function getExtremes(attrs) {\n var x = attrs.x;\n var y = attrs.y;\n var w = attrs.width;\n var h = attrs.height;\n minX = Math.min(minX, x - w / 2);\n maxX = Math.max(maxX, x + w / 2);\n minY = Math.min(minY, y - h / 2);\n maxY = Math.max(maxY, y + h / 2);\n }\n\n _.forEach(g.nodes(), function(v) { getExtremes(g.node(v)); });\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n if (_.has(edge, \"x\")) {\n getExtremes(edge);\n }\n });\n\n minX -= marginX;\n minY -= marginY;\n\n _.forEach(g.nodes(), function(v) {\n var node = g.node(v);\n node.x -= minX;\n node.y -= minY;\n });\n\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n _.forEach(edge.points, function(p) {\n p.x -= minX;\n p.y -= minY;\n });\n if (_.has(edge, \"x\")) { edge.x -= minX; }\n if (_.has(edge, \"y\")) { edge.y -= minY; }\n });\n\n graphLabel.width = maxX - minX + marginX;\n graphLabel.height = maxY - minY + marginY;\n}\n\nfunction assignNodeIntersects(g) {\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n var nodeV = g.node(e.v);\n var nodeW = g.node(e.w);\n var p1, p2;\n if (!edge.points) {\n edge.points = [];\n p1 = nodeW;\n p2 = nodeV;\n } else {\n p1 = edge.points[0];\n p2 = edge.points[edge.points.length - 1];\n }\n edge.points.unshift(util.intersectRect(nodeV, p1));\n edge.points.push(util.intersectRect(nodeW, p2));\n });\n}\n\nfunction fixupEdgeLabelCoords(g) {\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n if (_.has(edge, \"x\")) {\n if (edge.labelpos === \"l\" || edge.labelpos === \"r\") {\n edge.width -= edge.labeloffset;\n }\n switch (edge.labelpos) {\n case \"l\": edge.x -= edge.width / 2 + edge.labeloffset; break;\n case \"r\": edge.x += edge.width / 2 + edge.labeloffset; break;\n }\n }\n });\n}\n\nfunction reversePointsForReversedEdges(g) {\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n if (edge.reversed) {\n edge.points.reverse();\n }\n });\n}\n\nfunction removeBorderNodes(g) {\n _.forEach(g.nodes(), function(v) {\n if (g.children(v).length) {\n var node = g.node(v);\n var t = g.node(node.borderTop);\n var b = g.node(node.borderBottom);\n var l = g.node(_.last(node.borderLeft));\n var r = g.node(_.last(node.borderRight));\n\n node.width = Math.abs(r.x - l.x);\n node.height = Math.abs(b.y - t.y);\n node.x = l.x + node.width / 2;\n node.y = t.y + node.height / 2;\n }\n });\n\n _.forEach(g.nodes(), function(v) {\n if (g.node(v).dummy === \"border\") {\n g.removeNode(v);\n }\n });\n}\n\nfunction removeSelfEdges(g) {\n _.forEach(g.edges(), function(e) {\n if (e.v === e.w) {\n var node = g.node(e.v);\n if (!node.selfEdges) {\n node.selfEdges = [];\n }\n node.selfEdges.push({ e: e, label: g.edge(e) });\n g.removeEdge(e);\n }\n });\n}\n\nfunction insertSelfEdges(g) {\n var layers = util.buildLayerMatrix(g);\n _.forEach(layers, function(layer) {\n var orderShift = 0;\n _.forEach(layer, function(v, i) {\n var node = g.node(v);\n node.order = i + orderShift;\n _.forEach(node.selfEdges, function(selfEdge) {\n util.addDummyNode(g, \"selfedge\", {\n width: selfEdge.label.width,\n height: selfEdge.label.height,\n rank: node.rank,\n order: i + (++orderShift),\n e: selfEdge.e,\n label: selfEdge.label\n }, \"_se\");\n });\n delete node.selfEdges;\n });\n });\n}\n\nfunction positionSelfEdges(g) {\n _.forEach(g.nodes(), function(v) {\n var node = g.node(v);\n if (node.dummy === \"selfedge\") {\n var selfNode = g.node(node.e.v);\n var x = selfNode.x + selfNode.width / 2;\n var y = selfNode.y;\n var dx = node.x - x;\n var dy = selfNode.height / 2;\n g.setEdge(node.e, node.label);\n g.removeNode(v);\n node.label.points = [\n { x: x + 2 * dx / 3, y: y - dy },\n { x: x + 5 * dx / 6, y: y - dy },\n { x: x + dx , y: y },\n { x: x + 5 * dx / 6, y: y + dy },\n { x: x + 2 * dx / 3, y: y + dy }\n ];\n node.label.x = node.x;\n node.label.y = node.y;\n }\n });\n}\n\nfunction selectNumberAttrs(obj, attrs) {\n return _.mapValues(_.pick(obj, attrs), Number);\n}\n\nfunction canonicalize(attrs) {\n var newAttrs = {};\n _.forEach(attrs, function(v, k) {\n newAttrs[k.toLowerCase()] = v;\n });\n return newAttrs;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvbGF5b3V0LmpzPzdhOWMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWE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7XG4gICAgICB2YXIgeSA9IHNlbGZOb2RlLnk7XG4gICAgICB2YXIgZHggPSBub2RlLnggLSB4O1xuICAgICAgdmFyIGR5ID0gc2VsZk5vZGUuaGVpZ2h0IC8gMjtcbiAgICAgIGcuc2V0RWRnZShub2RlLmUsIG5vZGUubGFiZWwpO1xuICAgICAgZy5yZW1vdmVOb2RlKHYpO1xuICAgICAgbm9kZS5sYWJlbC5wb2ludHMgPSBbXG4gICAgICAgIHsgeDogeCArIDIgKiBkeCAvIDMsIHk6IHkgLSBkeSB9LFxuICAgICAgICB7IHg6IHggKyA1ICogZHggLyA2LCB5OiB5IC0gZHkgfSxcbiAgICAgICAgeyB4OiB4ICsgICAgIGR4ICAgICwgeTogeSB9LFxuICAgICAgICB7IHg6IHggKyA1ICogZHggLyA2LCB5OiB5ICsgZHkgfSxcbiAgICAgICAgeyB4OiB4ICsgMiAqIGR4IC8gMywgeTogeSArIGR5IH1cbiAgICAgIF07XG4gICAgICBub2RlLmxhYmVsLnggPSBub2RlLng7XG4gICAgICBub2RlLmxhYmVsLnkgPSBub2RlLnk7XG4gICAgfVxuICB9KTtcbn1cblxuZnVuY3Rpb24gc2VsZWN0TnVtYmVyQXR0cnMob2JqLCBhdHRycykge1xuICByZXR1cm4gXy5tYXBWYWx1ZXMoXy5waWNrKG9iaiwgYXR0cnMpLCBOdW1iZXIpO1xufVxuXG5mdW5jdGlvbiBjYW5vbmljYWxpemUoYXR0cnMpIHtcbiAgdmFyIG5ld0F0dHJzID0ge307XG4gIF8uZm9yRWFjaChhdHRycywgZnVuY3Rpb24odiwgaykge1xuICAgIG5ld0F0dHJzW2sudG9Mb3dlckNhc2UoKV0gPSB2O1xuICB9KTtcbiAgcmV0dXJuIG5ld0F0dHJzO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/layout.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/lodash.js": /*!******************************************!*\ !*** ./node_modules/dagre/lib/lodash.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* global window */\n\nvar lodash;\n\nif (true) {\n try {\n lodash = {\n cloneDeep: __webpack_require__(/*! lodash/cloneDeep */ \"./node_modules/lodash/cloneDeep.js\"),\n constant: __webpack_require__(/*! lodash/constant */ \"./node_modules/lodash/constant.js\"),\n defaults: __webpack_require__(/*! lodash/defaults */ \"./node_modules/lodash/defaults.js\"),\n each: __webpack_require__(/*! lodash/each */ \"./node_modules/lodash/each.js\"),\n filter: __webpack_require__(/*! lodash/filter */ \"./node_modules/lodash/filter.js\"),\n find: __webpack_require__(/*! lodash/find */ \"./node_modules/lodash/find.js\"),\n flatten: __webpack_require__(/*! lodash/flatten */ \"./node_modules/lodash/flatten.js\"),\n forEach: __webpack_require__(/*! lodash/forEach */ \"./node_modules/lodash/forEach.js\"),\n forIn: __webpack_require__(/*! lodash/forIn */ \"./node_modules/lodash/forIn.js\"),\n has: __webpack_require__(/*! lodash/has */ \"./node_modules/lodash/has.js\"),\n isUndefined: __webpack_require__(/*! lodash/isUndefined */ \"./node_modules/lodash/isUndefined.js\"),\n last: __webpack_require__(/*! lodash/last */ \"./node_modules/lodash/last.js\"),\n map: __webpack_require__(/*! lodash/map */ \"./node_modules/lodash/map.js\"),\n mapValues: __webpack_require__(/*! lodash/mapValues */ \"./node_modules/lodash/mapValues.js\"),\n max: __webpack_require__(/*! lodash/max */ \"./node_modules/lodash/max.js\"),\n merge: __webpack_require__(/*! lodash/merge */ \"./node_modules/lodash/merge.js\"),\n min: __webpack_require__(/*! lodash/min */ \"./node_modules/lodash/min.js\"),\n minBy: __webpack_require__(/*! lodash/minBy */ \"./node_modules/lodash/minBy.js\"),\n now: __webpack_require__(/*! lodash/now */ \"./node_modules/lodash/now.js\"),\n pick: __webpack_require__(/*! lodash/pick */ \"./node_modules/lodash/pick.js\"),\n range: __webpack_require__(/*! lodash/range */ \"./node_modules/lodash/range.js\"),\n reduce: __webpack_require__(/*! lodash/reduce */ \"./node_modules/lodash/reduce.js\"),\n sortBy: __webpack_require__(/*! lodash/sortBy */ \"./node_modules/lodash/sortBy.js\"),\n uniqueId: __webpack_require__(/*! lodash/uniqueId */ \"./node_modules/lodash/uniqueId.js\"),\n values: __webpack_require__(/*! lodash/values */ \"./node_modules/lodash/values.js\"),\n zipObject: __webpack_require__(/*! lodash/zipObject */ \"./node_modules/lodash/zipObject.js\"),\n };\n } catch (e) {\n // continue regardless of error\n }\n}\n\nif (!lodash) {\n lodash = window._;\n}\n\nmodule.exports = lodash;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvbG9kYXNoLmpzPzZmOWMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUE7O0FBRUEsSUFBSSxJQUE2QjtBQUNqQztBQUNBO0FBQ0EsaUJBQWlCLG1CQUFPLENBQUMsNERBQWtCO0FBQzNDLGdCQUFnQixtQkFBTyxDQUFDLDBEQUFpQjtBQUN6QyxnQkFBZ0IsbUJBQU8sQ0FBQywwREFBaUI7QUFDekMsWUFBWSxtQkFBTyxDQUFDLGtEQUFhO0FBQ2pDLGNBQWMsbUJBQU8sQ0FBQyxzREFBZTtBQUNyQyxZQUFZLG1CQUFPLENBQUMsa0RBQWE7QUFDakMsZUFBZSxtQkFBTyxDQUFDLHdEQUFnQjtBQUN2QyxlQUFlLG1CQUFPLENBQUMsd0RBQWdCO0FBQ3ZDLGFBQWEsbUJBQU8sQ0FBQyxvREFBYztBQUNuQyxZQUFZLG1CQUFPLENBQUMsZ0RBQVk7QUFDaEMsbUJBQW1CLG1CQUFPLENBQUMsZ0VBQW9CO0FBQy9DLFlBQVksbUJBQU8sQ0FBQyxrREFBYTtBQUNqQyxXQUFXLG1CQUFPLENBQUMsZ0RBQ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Wx1ZXM6IHJlcXVpcmUoXCJsb2Rhc2gvdmFsdWVzXCIpLFxuICAgICAgemlwT2JqZWN0OiByZXF1aXJlKFwibG9kYXNoL3ppcE9iamVjdFwiKSxcbiAgICB9O1xuICB9IGNhdGNoIChlKSB7XG4gICAgLy8gY29udGludWUgcmVnYXJkbGVzcyBvZiBlcnJvclxuICB9XG59XG5cbmlmICghbG9kYXNoKSB7XG4gIGxvZGFzaCA9IHdpbmRvdy5fO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGxvZGFzaDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/lodash.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/nesting-graph.js": /*!*************************************************!*\ !*** ./node_modules/dagre/lib/nesting-graph.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/util.js\");\n\nmodule.exports = {\n run: run,\n cleanup: cleanup\n};\n\n/*\n * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs,\n * adds appropriate edges to ensure that all cluster nodes are placed between\n * these boundries, and ensures that the graph is connected.\n *\n * In addition we ensure, through the use of the minlen property, that nodes\n * and subgraph border nodes to not end up on the same rank.\n *\n * Preconditions:\n *\n * 1. Input graph is a DAG\n * 2. Nodes in the input graph has a minlen attribute\n *\n * Postconditions:\n *\n * 1. Input graph is connected.\n * 2. Dummy nodes are added for the tops and bottoms of subgraphs.\n * 3. The minlen attribute for nodes is adjusted to ensure nodes do not\n * get placed on the same rank as subgraph border nodes.\n *\n * The nesting graph idea comes from Sander, \"Layout of Compound Directed\n * Graphs.\"\n */\nfunction run(g) {\n var root = util.addDummyNode(g, \"root\", {}, \"_root\");\n var depths = treeDepths(g);\n var height = _.max(_.values(depths)) - 1; // Note: depths is an Object not an array\n var nodeSep = 2 * height + 1;\n\n g.graph().nestingRoot = root;\n\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n _.forEach(g.edges(), function(e) { g.edge(e).minlen *= nodeSep; });\n\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n\n // Create border nodes and link them up\n _.forEach(g.children(), function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n}\n\nfunction dfs(g, root, nodeSep, weight, height, depths, v) {\n var children = g.children(v);\n if (!children.length) {\n if (v !== root) {\n g.setEdge(root, v, { weight: 0, minlen: nodeSep });\n }\n return;\n }\n\n var top = util.addBorderNode(g, \"_bt\");\n var bottom = util.addBorderNode(g, \"_bb\");\n var label = g.node(v);\n\n g.setParent(top, v);\n label.borderTop = top;\n g.setParent(bottom, v);\n label.borderBottom = bottom;\n\n _.forEach(children, function(child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n\n var childNode = g.node(child);\n var childTop = childNode.borderTop ? childNode.borderTop : child;\n var childBottom = childNode.borderBottom ? childNode.borderBottom : child;\n var thisWeight = childNode.borderTop ? weight : 2 * weight;\n var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1;\n\n g.setEdge(top, childTop, {\n weight: thisWeight,\n minlen: minlen,\n nestingEdge: true\n });\n\n g.setEdge(childBottom, bottom, {\n weight: thisWeight,\n minlen: minlen,\n nestingEdge: true\n });\n });\n\n if (!g.parent(v)) {\n g.setEdge(root, top, { weight: 0, minlen: height + depths[v] });\n }\n}\n\nfunction treeDepths(g) {\n var depths = {};\n function dfs(v, depth) {\n var children = g.children(v);\n if (children && children.length) {\n _.forEach(children, function(child) {\n dfs(child, depth + 1);\n });\n }\n depths[v] = depth;\n }\n _.forEach(g.children(), function(v) { dfs(v, 1); });\n return depths;\n}\n\nfunction sumWeights(g) {\n return _.reduce(g.edges(), function(acc, e) {\n return acc + g.edge(e).weight;\n }, 0);\n}\n\nfunction cleanup(g) {\n var graphLabel = g.graph();\n g.removeNode(graphLabel.nestingRoot);\n delete graphLabel.nestingRoot;\n _.forEach(g.edges(), function(e) {\n var edge = g.edge(e);\n if (edge.nestingEdge) {\n g.removeEdge(e);\n }\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvbmVzdGluZy1ncmFwaC5qcz8yNTFhIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQVEsbUJBQU8sQ0FBQyxvREFBVTtBQUMxQixXQUFXLG1CQUFPLENBQUMsZ0RBQVE7O0FBRTNCO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDRDQUE0QztBQUM1QztBQUNBLDJDQUEyQztBQUMzQzs7QUFFQTs7QUFFQTtBQUNBLG9DQUFvQyw2QkFBNkIsRUFBRTs7QUFFbkU7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxHQUFHOztBQUVIO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsMEJBQTBCLDZCQUE2QjtBQUN2RDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7O0FBRUw7QUFDQTt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mN0aW9uKGUpIHtcbiAgICB2YXIgZWRnZSA9IGcuZWRnZShlKTtcbiAgICBpZiAoZWRnZS5uZXN0aW5nRWRnZSkge1xuICAgICAgZy5yZW1vdmVFZGdlKGUpO1xuICAgIH1cbiAgfSk7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/nesting-graph.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/normalize.js": /*!*********************************************!*\ !*** ./node_modules/dagre/lib/normalize.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar util = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/util.js\");\n\nmodule.exports = {\n run: run,\n undo: undo\n};\n\n/*\n * Breaks any long edges in the graph into short segments that span 1 layer\n * each. This operation is undoable with the denormalize function.\n *\n * Pre-conditions:\n *\n * 1. The input graph is a DAG.\n * 2. Each node in the graph has a \"rank\" property.\n *\n * Post-condition:\n *\n * 1. All edges in the graph have a length of 1.\n * 2. Dummy nodes are added where edges have been split into segments.\n * 3. The graph is augmented with a \"dummyChains\" attribute which contains\n * the first dummy in each chain of dummy nodes produced.\n */\nfunction run(g) {\n g.graph().dummyChains = [];\n _.forEach(g.edges(), function(edge) { normalizeEdge(g, edge); });\n}\n\nfunction normalizeEdge(g, e) {\n var v = e.v;\n var vRank = g.node(v).rank;\n var w = e.w;\n var wRank = g.node(w).rank;\n var name = e.name;\n var edgeLabel = g.edge(e);\n var labelRank = edgeLabel.labelRank;\n\n if (wRank === vRank + 1) return;\n\n g.removeEdge(e);\n\n var dummy, attrs, i;\n for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) {\n edgeLabel.points = [];\n attrs = {\n width: 0, height: 0,\n edgeLabel: edgeLabel, edgeObj: e,\n rank: vRank\n };\n dummy = util.addDummyNode(g, \"edge\", attrs, \"_d\");\n if (vRank === labelRank) {\n attrs.width = edgeLabel.width;\n attrs.height = edgeLabel.height;\n attrs.dummy = \"edge-label\";\n attrs.labelpos = edgeLabel.labelpos;\n }\n g.setEdge(v, dummy, { weight: edgeLabel.weight }, name);\n if (i === 0) {\n g.graph().dummyChains.push(dummy);\n }\n v = dummy;\n }\n\n g.setEdge(v, w, { weight: edgeLabel.weight }, name);\n}\n\nfunction undo(g) {\n _.forEach(g.graph().dummyChains, function(v) {\n var node = g.node(v);\n var origLabel = node.edgeLabel;\n var w;\n g.setEdge(node.edgeObj, origLabel);\n while (node.dummy) {\n w = g.successors(v)[0];\n g.removeNode(v);\n origLabel.points.push({ x: node.x, y: node.y });\n if (node.dummy === \"edge-label\") {\n origLabel.x = node.x;\n origLabel.y = node.y;\n origLabel.width = node.width;\n origLabel.height = node.height;\n }\n v = w;\n node = g.node(v);\n }\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvbm9ybWFsaXplLmpzPzQ1ZWUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWE7O0FBRWIsUUFBUSxtQkFBTyxDQUFDLG9EQUFVO0FBQzFCLFdBQVcsbUJBQU8sQ0FBQyxnREFBUTs7QUFFM0I7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsdUNBQXVDLHdCQUF3QixFQUFFO0FBQ2pFOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQSxzQkFBc0Is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ICAgICAgb3JpZ0xhYmVsLnBvaW50cy5wdXNoKHsgeDogbm9kZS54LCB5OiBub2RlLnkgfSk7XG4gICAgICBpZiAobm9kZS5kdW1teSA9PT0gXCJlZGdlLWxhYmVsXCIpIHtcbiAgICAgICAgb3JpZ0xhYmVsLnggPSBub2RlLng7XG4gICAgICAgIG9yaWdMYWJlbC55ID0gbm9kZS55O1xuICAgICAgICBvcmlnTGFiZWwud2lkdGggPSBub2RlLndpZHRoO1xuICAgICAgICBvcmlnTGFiZWwuaGVpZ2h0ID0gbm9kZS5oZWlnaHQ7XG4gICAgICB9XG4gICAgICB2ID0gdztcbiAgICAgIG5vZGUgPSBnLm5vZGUodik7XG4gICAgfVxuICB9KTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/normalize.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/add-subgraph-constraints.js": /*!******************************************************************!*\ !*** ./node_modules/dagre/lib/order/add-subgraph-constraints.js ***! \******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\n\nmodule.exports = addSubgraphConstraints;\n\nfunction addSubgraphConstraints(g, cg, vs) {\n var prev = {},\n rootPrev;\n\n _.forEach(vs, function(v) {\n var child = g.parent(v),\n parent,\n prevChild;\n while (child) {\n parent = g.parent(child);\n if (parent) {\n prevChild = prev[parent];\n prev[parent] = child;\n } else {\n prevChild = rootPrev;\n rootPrev = child;\n }\n if (prevChild && prevChild !== child) {\n cg.setEdge(prevChild, child);\n return;\n }\n child = parent;\n }\n });\n\n /*\n function dfs(v) {\n var children = v ? g.children(v) : g.children();\n if (children.length) {\n var min = Number.POSITIVE_INFINITY,\n subgraphs = [];\n _.each(children, function(child) {\n var childMin = dfs(child);\n if (g.children(child).length) {\n subgraphs.push({ v: child, order: childMin });\n }\n min = Math.min(min, childMin);\n });\n _.reduce(_.sortBy(subgraphs, \"order\"), function(prev, curr) {\n cg.setEdge(prev.v, curr.v);\n return curr;\n });\n return min;\n }\n return g.node(v).order;\n }\n dfs(undefined);\n */\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvYWRkLXN1YmdyYXBoLWNvbnN0cmFpbnRzLmpzP2Q0ZjMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsUUFBUSxtQkFBTyxDQUFDLHFEQUFXOztBQUUzQjs7QUFFQTtBQUNBLGVBQWU7QUFDZjs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxPQUFPO0FBQ1A7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsR0FBRzs7QUFFSDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSwwQkFBMEIsNEJBQTRCO0FBQ3REO0FBQ0E7QUFDQSxPQUFPO0FBQ1A7QUFDQTtBQUNBO0FBQ0EsT0FBTztBQUNQO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2RhZ3JlL2xpYi9vcmRlci9hZGQtc3ViZ3JhcGgtY29uc3RyYWludHMuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgXyA9IHJlcXVpcmUoXCIuLi9sb2Rhc2hcIik7XG5cbm1vZHVsZS5leHBvcnRzID0gYWRkU3ViZ3JhcGhDb25zdHJhaW50cztcblxuZnVuY3Rpb24gYWRkU3ViZ3JhcGhDb25zdHJhaW50cyhnLCBjZywgdnMpIHtcb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lsZCwgb3JkZXI6IGNoaWxkTWluIH0pO1xuICAgICAgICB9XG4gICAgICAgIG1pbiA9IE1hdGgubWluKG1pbiwgY2hpbGRNaW4pO1xuICAgICAgfSk7XG4gICAgICBfLnJlZHVjZShfLnNvcnRCeShzdWJncmFwaHMsIFwib3JkZXJcIiksIGZ1bmN0aW9uKHByZXYsIGN1cnIpIHtcbiAgICAgICAgY2cuc2V0RWRnZShwcmV2LnYsIGN1cnIudik7XG4gICAgICAgIHJldHVybiBjdXJyO1xuICAgICAgfSk7XG4gICAgICByZXR1cm4gbWluO1xuICAgIH1cbiAgICByZXR1cm4gZy5ub2RlKHYpLm9yZGVyO1xuICB9XG4gIGRmcyh1bmRlZmluZWQpO1xuICAqL1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/add-subgraph-constraints.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/barycenter.js": /*!****************************************************!*\ !*** ./node_modules/dagre/lib/order/barycenter.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\n\nmodule.exports = barycenter;\n\nfunction barycenter(g, movable) {\n return _.map(movable, function(v) {\n var inV = g.inEdges(v);\n if (!inV.length) {\n return { v: v };\n } else {\n var result = _.reduce(inV, function(acc, e) {\n var edge = g.edge(e),\n nodeU = g.node(e.v);\n return {\n sum: acc.sum + (edge.weight * nodeU.order),\n weight: acc.weight + edge.weight\n };\n }, { sum: 0, weight: 0 });\n\n return {\n v: v,\n barycenter: result.sum / result.weight,\n weight: result.weight\n };\n }\n });\n}\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvY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mV0dXJuIHtcbiAgICAgICAgdjogdixcbiAgICAgICAgYmFyeWNlbnRlcjogcmVzdWx0LnN1bSAvIHJlc3VsdC53ZWlnaHQsXG4gICAgICAgIHdlaWdodDogcmVzdWx0LndlaWdodFxuICAgICAgfTtcbiAgICB9XG4gIH0pO1xufVxuXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/barycenter.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/build-layer-graph.js": /*!***********************************************************!*\ !*** ./node_modules/dagre/lib/order/build-layer-graph.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar Graph = __webpack_require__(/*! ../graphlib */ \"./node_modules/dagre/lib/graphlib.js\").Graph;\n\nmodule.exports = buildLayerGraph;\n\n/*\n * Constructs a graph that can be used to sort a layer of nodes. The graph will\n * contain all base and subgraph nodes from the request layer in their original\n * hierarchy and any edges that are incident on these nodes and are of the type\n * requested by the \"relationship\" parameter.\n *\n * Nodes from the requested rank that do not have parents are assigned a root\n * node in the output graph, which is set in the root graph attribute. This\n * makes it easy to walk the hierarchy of movable nodes during ordering.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG\n * 2. Base nodes in the input graph have a rank attribute\n * 3. Subgraph nodes in the input graph has minRank and maxRank attributes\n * 4. Edges have an assigned weight\n *\n * Post-conditions:\n *\n * 1. Output graph has all nodes in the movable rank with preserved\n * hierarchy.\n * 2. Root nodes in the movable layer are made children of the node\n * indicated by the root attribute of the graph.\n * 3. Non-movable nodes incident on movable nodes, selected by the\n * relationship parameter, are included in the graph (without hierarchy).\n * 4. Edges incident on movable nodes, selected by the relationship\n * parameter, are added to the output graph.\n * 5. The weights for copied edges are aggregated as need, since the output\n * graph is not a multi-graph.\n */\nfunction buildLayerGraph(g, rank, relationship) {\n var root = createRootNode(g),\n result = new Graph({ compound: true }).setGraph({ root: root })\n .setDefaultNodeLabel(function(v) { return g.node(v); });\n\n _.forEach(g.nodes(), function(v) {\n var node = g.node(v),\n parent = g.parent(v);\n\n if (node.rank === rank || node.minRank <= rank && rank <= node.maxRank) {\n result.setNode(v);\n result.setParent(v, parent || root);\n\n // This assumes we have only short edges!\n _.forEach(g[relationship](v), function(e) {\n var u = e.v === v ? e.w : e.v,\n edge = result.edge(u, v),\n weight = !_.isUndefined(edge) ? edge.weight : 0;\n result.setEdge(u, v, { weight: g.edge(e).weight + weight });\n });\n\n if (_.has(node, \"minRank\")) {\n result.setNode(v, {\n borderLeft: node.borderLeft[rank],\n borderRight: node.borderRight[rank]\n });\n }\n }\n });\n\n return result;\n}\n\nfunction createRootNode(g) {\n var v;\n while (g.hasNode((v = _.uniqueId(\"_root\"))));\n return v;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvYnVpbGQtbGF5ZXItZ3JhcGguanM/ODgxNyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxRQUFRLG1CQUFPLENBQUMscURBQVc7QUFDM0IsWUFBWSxtQkFBTyxDQUFDLHlEQUFhOztBQUVqQzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esd0JBQXdCLGlCQUFpQixZQUFZLGFBQWE7QUFDbEUsd0NBQXdDLGtCQUFrQixFQUFFOztBQUU1R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VzdWx0LmVkZ2UodSwgdiksXG4gICAgICAgICAgd2VpZ2h0ID0gIV8uaXNVbmRlZmluZWQoZWRnZSkgPyBlZGdlLndlaWdodCA6IDA7XG4gICAgICAgIHJlc3VsdC5zZXRFZGdlKHUsIHYsIHsgd2VpZ2h0OiBnLmVkZ2UoZSkud2VpZ2h0ICsgd2VpZ2h0IH0pO1xuICAgICAgfSk7XG5cbiAgICAgIGlmIChfLmhhcyhub2RlLCBcIm1pblJhbmtcIikpIHtcbiAgICAgICAgcmVzdWx0LnNldE5vZGUodiwge1xuICAgICAgICAgIGJvcmRlckxlZnQ6IG5vZGUuYm9yZGVyTGVmdFtyYW5rXSxcbiAgICAgICAgICBib3JkZXJSaWdodDogbm9kZS5ib3JkZXJSaWdodFtyYW5rXVxuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuXG4gIHJldHVybiByZXN1bHQ7XG59XG5cbmZ1bmN0aW9uIGNyZWF0ZVJvb3ROb2RlKGcpIHtcbiAgdmFyIHY7XG4gIHdoaWxlIChnLmhhc05vZGUoKHYgPSBfLnVuaXF1ZUlkKFwiX3Jvb3RcIikpKSk7XG4gIHJldHVybiB2O1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/build-layer-graph.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/cross-count.js": /*!*****************************************************!*\ !*** ./node_modules/dagre/lib/order/cross-count.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\n\nmodule.exports = crossCount;\n\n/*\n * A function that takes a layering (an array of layers, each with an array of\n * ordererd nodes) and a graph and returns a weighted crossing count.\n *\n * Pre-conditions:\n *\n * 1. Input graph must be simple (not a multigraph), directed, and include\n * only simple edges.\n * 2. Edges in the input graph must have assigned weights.\n *\n * Post-conditions:\n *\n * 1. The graph and layering matrix are left unchanged.\n *\n * This algorithm is derived from Barth, et al., \"Bilayer Cross Counting.\"\n */\nfunction crossCount(g, layering) {\n var cc = 0;\n for (var i = 1; i < layering.length; ++i) {\n cc += twoLayerCrossCount(g, layering[i-1], layering[i]);\n }\n return cc;\n}\n\nfunction twoLayerCrossCount(g, northLayer, southLayer) {\n // Sort all of the edges between the north and south layers by their position\n // in the north layer and then the south. Map these edges to the position of\n // their head in the south layer.\n var southPos = _.zipObject(southLayer,\n _.map(southLayer, function (v, i) { return i; }));\n var southEntries = _.flatten(_.map(northLayer, function(v) {\n return _.sortBy(_.map(g.outEdges(v), function(e) {\n return { pos: southPos[e.w], weight: g.edge(e).weight };\n }), \"pos\");\n }), true);\n\n // Build the accumulator tree\n var firstIndex = 1;\n while (firstIndex < southLayer.length) firstIndex <<= 1;\n var treeSize = 2 * firstIndex - 1;\n firstIndex -= 1;\n var tree = _.map(new Array(treeSize), function() { return 0; });\n\n // Calculate the weighted crossings\n var cc = 0;\n _.forEach(southEntries.forEach(function(entry) {\n var index = entry.pos + firstIndex;\n tree[index] += entry.weight;\n var weightSum = 0;\n while (index > 0) {\n if (index % 2) {\n weightSum += tree[index + 1];\n }\n index = (index - 1) >> 1;\n tree[index] += entry.weight;\n }\n cc += entry.weight * weightSum;\n }));\n\n return cc;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvY3Jvc3MtY291bnQuanM/ZDc4MCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTs7QUFFYixRQUFRLG1CQUFPLENBQUMscURBQVc7O0FBRTNCOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFD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d2VpZ2h0U3VtO1xuICB9KSk7XG5cbiAgcmV0dXJuIGNjO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/cross-count.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/index.js": /*!***********************************************!*\ !*** ./node_modules/dagre/lib/order/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar initOrder = __webpack_require__(/*! ./init-order */ \"./node_modules/dagre/lib/order/init-order.js\");\nvar crossCount = __webpack_require__(/*! ./cross-count */ \"./node_modules/dagre/lib/order/cross-count.js\");\nvar sortSubgraph = __webpack_require__(/*! ./sort-subgraph */ \"./node_modules/dagre/lib/order/sort-subgraph.js\");\nvar buildLayerGraph = __webpack_require__(/*! ./build-layer-graph */ \"./node_modules/dagre/lib/order/build-layer-graph.js\");\nvar addSubgraphConstraints = __webpack_require__(/*! ./add-subgraph-constraints */ \"./node_modules/dagre/lib/order/add-subgraph-constraints.js\");\nvar Graph = __webpack_require__(/*! ../graphlib */ \"./node_modules/dagre/lib/graphlib.js\").Graph;\nvar util = __webpack_require__(/*! ../util */ \"./node_modules/dagre/lib/util.js\");\n\nmodule.exports = order;\n\n/*\n * Applies heuristics to minimize edge crossings in the graph and sets the best\n * order solution as an order attribute on each node.\n *\n * Pre-conditions:\n *\n * 1. Graph must be DAG\n * 2. Graph nodes must be objects with a \"rank\" attribute\n * 3. Graph edges must have the \"weight\" attribute\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have an \"order\" attribute based on the results of the\n * algorithm.\n */\nfunction order(g) {\n var maxRank = util.maxRank(g),\n downLayerGraphs = buildLayerGraphs(g, _.range(1, maxRank + 1), \"inEdges\"),\n upLayerGraphs = buildLayerGraphs(g, _.range(maxRank - 1, -1, -1), \"outEdges\");\n\n var layering = initOrder(g);\n assignOrder(g, layering);\n\n var bestCC = Number.POSITIVE_INFINITY,\n best;\n\n for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {\n sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2);\n\n layering = util.buildLayerMatrix(g);\n var cc = crossCount(g, layering);\n if (cc < bestCC) {\n lastBest = 0;\n best = _.cloneDeep(layering);\n bestCC = cc;\n }\n }\n\n assignOrder(g, best);\n}\n\nfunction buildLayerGraphs(g, ranks, relationship) {\n return _.map(ranks, function(rank) {\n return buildLayerGraph(g, rank, relationship);\n });\n}\n\nfunction sweepLayerGraphs(layerGraphs, biasRight) {\n var cg = new Graph();\n _.forEach(layerGraphs, function(lg) {\n var root = lg.graph().root;\n var sorted = sortSubgraph(lg, root, cg, biasRight);\n _.forEach(sorted.vs, function(v, i) {\n lg.node(v).order = i;\n });\n addSubgraphConstraints(lg, cg, sorted.vs);\n });\n}\n\nfunction assignOrder(g, layering) {\n _.forEach(layering, function(layer) {\n _.forEach(layer, function(v, i) {\n g.node(v).order = i;\n });\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvaW5kZXguanM/MmE5ZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTs7QUFFYixRQUFRLG1CQUFPLENBQUMscURBQVc7QUFDM0IsZ0JBQWdCLG1CQUFPLENBQUMsa0VBQWM7QUFDdEMsaUJBQWlCLG1CQUFPLENBQUMsb0VBQWU7QUFDeEMsbUJBQW1CLG1CQUFPLENBQUMsd0VBQWlCO0FBQzVDLHNCQUFzQixtQkFBTyxDQUFDLGdGQUFxQjtBQUNuRCw2QkFBNkIsbUJBQU8sQ0FBQyw4RkFBNEI7QUFDakUsWUFBWSxtQkFBTyxDQUFDL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odCk7XG4gICAgXy5mb3JFYWNoKHNvcnRlZC52cywgZnVuY3Rpb24odiwgaSkge1xuICAgICAgbGcubm9kZSh2KS5vcmRlciA9IGk7XG4gICAgfSk7XG4gICAgYWRkU3ViZ3JhcGhDb25zdHJhaW50cyhsZywgY2csIHNvcnRlZC52cyk7XG4gIH0pO1xufVxuXG5mdW5jdGlvbiBhc3NpZ25PcmRlcihnLCBsYXllcmluZykge1xuICBfLmZvckVhY2gobGF5ZXJpbmcsIGZ1bmN0aW9uKGxheWVyKSB7XG4gICAgXy5mb3JFYWNoKGxheWVyLCBmdW5jdGlvbih2LCBpKSB7XG4gICAgICBnLm5vZGUodikub3JkZXIgPSBpO1xuICAgIH0pO1xuICB9KTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/index.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/init-order.js": /*!****************************************************!*\ !*** ./node_modules/dagre/lib/order/init-order.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\n\nmodule.exports = initOrder;\n\n/*\n * Assigns an initial order value for each node by performing a DFS search\n * starting from nodes in the first rank. Nodes are assigned an order in their\n * rank as they are first visited.\n *\n * This approach comes from Gansner, et al., \"A Technique for Drawing Directed\n * Graphs.\"\n *\n * Returns a layering matrix with an array per layer and each layer sorted by\n * the order of its nodes.\n */\nfunction initOrder(g) {\n var visited = {};\n var simpleNodes = _.filter(g.nodes(), function(v) {\n return !g.children(v).length;\n });\n var maxRank = _.max(_.map(simpleNodes, function(v) { return g.node(v).rank; }));\n var layers = _.map(_.range(maxRank + 1), function() { return []; });\n\n function dfs(v) {\n if (_.has(visited, v)) return;\n visited[v] = true;\n var node = g.node(v);\n layers[node.rank].push(v);\n _.forEach(g.successors(v), dfs);\n }\n\n var orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v).rank; });\n _.forEach(orderedVs, dfs);\n\n return layers;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvaW5pdC1vcmRlci5qcz9lNjMyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFhOztBQUViLFFBQVEsbUJBQU8sQ0FBQyxxREFBVzs7QUFFM0I7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsR0FBRztBQUNILHNEQUFzRCx1QkFBdUIsRUFBRTtBQUMvRSx1REFBdUQsV0FBVyxFQUFFOztBQUVwRTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxxREFBcUQsdUJBQXVCLEVBQUU7QUFDOUU7O0FBRUE7QUFDQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvaW5pdC1vcmRlci5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG52YXIgXyA9IHJlcXVpcmUoXCIuLi9sb2Rhc2hcIik7XG5cbm1vZHVsZS5leHBvcnRzID0gaW5pdE9yZGVyO1xuXG4vKlxuICogQXNzaWducyBhbiBpbml0aWFsIG9yZGVyIHZhbHVlIGZvciBlYWNoIG5vZGUgYnkgcGVyZm9ybWluZyBhIERGUyBzZWFyY2hcbiAqIHN0YXJ0aW5nIGZyb20gbm9kZXMgaW4gdGhlIGZpcnN0IHJhbmsuIE5vZGVzIGFyZSBhc3NpZ25lZCBhbiBvcmRlciBpbiB0aGVpclxuICogcmFuayBhcyB0aGV5IGFyZSBmaX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LCBkZnMpO1xuXG4gIHJldHVybiBsYXllcnM7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/init-order.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/resolve-conflicts.js": /*!***********************************************************!*\ !*** ./node_modules/dagre/lib/order/resolve-conflicts.js ***! \***********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\n\nmodule.exports = resolveConflicts;\n\n/*\n * Given a list of entries of the form {v, barycenter, weight} and a\n * constraint graph this function will resolve any conflicts between the\n * constraint graph and the barycenters for the entries. If the barycenters for\n * an entry would violate a constraint in the constraint graph then we coalesce\n * the nodes in the conflict into a new node that respects the contraint and\n * aggregates barycenter and weight information.\n *\n * This implementation is based on the description in Forster, \"A Fast and\n * Simple Hueristic for Constrained Two-Level Crossing Reduction,\" thought it\n * differs in some specific details.\n *\n * Pre-conditions:\n *\n * 1. Each entry has the form {v, barycenter, weight}, or if the node has\n * no barycenter, then {v}.\n *\n * Returns:\n *\n * A new list of entries of the form {vs, i, barycenter, weight}. The list\n * `vs` may either be a singleton or it may be an aggregation of nodes\n * ordered such that they do not violate constraints from the constraint\n * graph. The property `i` is the lowest original index of any of the\n * elements in `vs`.\n */\nfunction resolveConflicts(entries, cg) {\n var mappedEntries = {};\n _.forEach(entries, function(entry, i) {\n var tmp = mappedEntries[entry.v] = {\n indegree: 0,\n \"in\": [],\n out: [],\n vs: [entry.v],\n i: i\n };\n if (!_.isUndefined(entry.barycenter)) {\n tmp.barycenter = entry.barycenter;\n tmp.weight = entry.weight;\n }\n });\n\n _.forEach(cg.edges(), function(e) {\n var entryV = mappedEntries[e.v];\n var entryW = mappedEntries[e.w];\n if (!_.isUndefined(entryV) && !_.isUndefined(entryW)) {\n entryW.indegree++;\n entryV.out.push(mappedEntries[e.w]);\n }\n });\n\n var sourceSet = _.filter(mappedEntries, function(entry) {\n return !entry.indegree;\n });\n\n return doResolveConflicts(sourceSet);\n}\n\nfunction doResolveConflicts(sourceSet) {\n var entries = [];\n\n function handleIn(vEntry) {\n return function(uEntry) {\n if (uEntry.merged) {\n return;\n }\n if (_.isUndefined(uEntry.barycenter) ||\n _.isUndefined(vEntry.barycenter) ||\n uEntry.barycenter >= vEntry.barycenter) {\n mergeEntries(vEntry, uEntry);\n }\n };\n }\n\n function handleOut(vEntry) {\n return function(wEntry) {\n wEntry[\"in\"].push(vEntry);\n if (--wEntry.indegree === 0) {\n sourceSet.push(wEntry);\n }\n };\n }\n\n while (sourceSet.length) {\n var entry = sourceSet.pop();\n entries.push(entry);\n _.forEach(entry[\"in\"].reverse(), handleIn(entry));\n _.forEach(entry.out, handleOut(entry));\n }\n\n return _.map(_.filter(entries, function(entry) { return !entry.merged; }),\n function(entry) {\n return _.pick(entry, [\"vs\", \"i\", \"barycenter\", \"weight\"]);\n });\n\n}\n\nfunction mergeEntries(target, source) {\n var sum = 0;\n var weight = 0;\n\n if (target.weight) {\n sum += target.barycenter * target.weight;\n weight += target.weight;\n }\n\n if (source.weight) {\n sum += source.barycenter * source.weight;\n weight += source.weight;\n }\n\n target.vs = source.vs.concat(target.vs);\n target.barycenter = sum / weight;\n target.weight = weight;\n target.i = Math.min(source.i, target.i);\n source.merged = true;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvcmVzb2x2ZS1jb25mbGljdHMuanM/ZDlmMyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTs7QUFFYixRQUFRLG1CQUFPLENBQUMscURBQVc7O0FBRTNCOztBQUVBO0FBQ0Esd0NBQXdDLHNCQUFzQjtBQUM5RDtBQUNBO0FBQ0E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lbnRlciA9IHN1bSAvIHdlaWdodDtcbiAgdGFyZ2V0LndlaWdodCA9IHdlaWdodDtcbiAgdGFyZ2V0LmkgPSBNYXRoLm1pbihzb3VyY2UuaSwgdGFyZ2V0LmkpO1xuICBzb3VyY2UubWVyZ2VkID0gdHJ1ZTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/resolve-conflicts.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/sort-subgraph.js": /*!*******************************************************!*\ !*** ./node_modules/dagre/lib/order/sort-subgraph.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar barycenter = __webpack_require__(/*! ./barycenter */ \"./node_modules/dagre/lib/order/barycenter.js\");\nvar resolveConflicts = __webpack_require__(/*! ./resolve-conflicts */ \"./node_modules/dagre/lib/order/resolve-conflicts.js\");\nvar sort = __webpack_require__(/*! ./sort */ \"./node_modules/dagre/lib/order/sort.js\");\n\nmodule.exports = sortSubgraph;\n\nfunction sortSubgraph(g, v, cg, biasRight) {\n var movable = g.children(v);\n var node = g.node(v);\n var bl = node ? node.borderLeft : undefined;\n var br = node ? node.borderRight: undefined;\n var subgraphs = {};\n\n if (bl) {\n movable = _.filter(movable, function(w) {\n return w !== bl && w !== br;\n });\n }\n\n var barycenters = barycenter(g, movable);\n _.forEach(barycenters, function(entry) {\n if (g.children(entry.v).length) {\n var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight);\n subgraphs[entry.v] = subgraphResult;\n if (_.has(subgraphResult, \"barycenter\")) {\n mergeBarycenters(entry, subgraphResult);\n }\n }\n });\n\n var entries = resolveConflicts(barycenters, cg);\n expandSubgraphs(entries, subgraphs);\n\n var result = sort(entries, biasRight);\n\n if (bl) {\n result.vs = _.flatten([bl, result.vs, br], true);\n if (g.predecessors(bl).length) {\n var blPred = g.node(g.predecessors(bl)[0]),\n brPred = g.node(g.predecessors(br)[0]);\n if (!_.has(result, \"barycenter\")) {\n result.barycenter = 0;\n result.weight = 0;\n }\n result.barycenter = (result.barycenter * result.weight +\n blPred.order + brPred.order) / (result.weight + 2);\n result.weight += 2;\n }\n }\n\n return result;\n}\n\nfunction expandSubgraphs(entries, subgraphs) {\n _.forEach(entries, function(entry) {\n entry.vs = _.flatten(entry.vs.map(function(v) {\n if (subgraphs[v]) {\n return subgraphs[v].vs;\n }\n return v;\n }), true);\n });\n}\n\nfunction mergeBarycenters(target, other) {\n if (!_.isUndefined(target.barycenter)) {\n target.barycenter = (target.barycenter * target.weight +\n other.barycenter * other.weight) /\n (target.weight + other.weight);\n target.weight += other.weight;\n } else {\n target.barycenter = other.barycenter;\n target.weight = other.weight;\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvb3JkZXIvc29ydC1zdWJncmFwaC5qcz8zOGUyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQVEsbUJBQU8sQ0FBQyxxREFBVztBQUMzQixpQkFBaUIsbUJBQU8sQ0FBQyxrRUFBYztBQUN2Qyx1QkFBdUIsbUJBQU8sQ0FBQyxnRkFBcUI7QUFDcEQsV0FBVyxtQkFBTyxDQUFDLHNEQUFROztBQUUzQjs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEdBQUc7O0FBRUg7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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53ZWlnaHQ7XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/sort-subgraph.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/order/sort.js": /*!**********************************************!*\ !*** ./node_modules/dagre/lib/order/sort.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar util = __webpack_require__(/*! ../util */ \"./node_modules/dagre/lib/util.js\");\n\nmodule.exports = sort;\n\nfunction sort(entries, biasRight) {\n var parts = util.partition(entries, function(entry) {\n return _.has(entry, \"barycenter\");\n });\n var sortable = parts.lhs,\n unsortable = _.sortBy(parts.rhs, function(entry) { return -entry.i; }),\n vs = [],\n sum = 0,\n weight = 0,\n vsIndex = 0;\n\n sortable.sort(compareWithBias(!!biasRight));\n\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n\n _.forEach(sortable, function (entry) {\n vsIndex += entry.vs.length;\n vs.push(entry.vs);\n sum += entry.barycenter * entry.weight;\n weight += entry.weight;\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n });\n\n var result = { vs: _.flatten(vs, true) };\n if (weight) {\n result.barycenter = sum / weight;\n result.weight = weight;\n }\n return result;\n}\n\nfunction consumeUnsortable(vs, unsortable, index) {\n var last;\n while (unsortable.length && (last = _.last(unsortable)).i <= index) {\n unsortable.pop();\n vs.push(last.vs);\n index++;\n }\n return index;\n}\n\nfunction compareWithBias(bias) {\n return function(entryV, entryW) {\n if (entryV.barycenter < entryW.barycenter) {\n return -1;\n } else if (entryV.barycenter > entryW.barycenter) {\n return 1;\n }\n\n return !bias ? entryV.i - entryW.i : entryW.i - entryV.i;\n };\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5d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ybiBpbmRleDtcbn1cblxuZnVuY3Rpb24gY29tcGFyZVdpdGhCaWFzKGJpYXMpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uKGVudHJ5ViwgZW50cnlXKSB7XG4gICAgaWYgKGVudHJ5Vi5iYXJ5Y2VudGVyIDwgZW50cnlXLmJhcnljZW50ZXIpIHtcbiAgICAgIHJldHVybiAtMTtcbiAgICB9IGVsc2UgaWYgKGVudHJ5Vi5iYXJ5Y2VudGVyID4gZW50cnlXLmJhcnljZW50ZXIpIHtcbiAgICAgIHJldHVybiAxO1xuICAgIH1cblxuICAgIHJldHVybiAhYmlhcyA/IGVudHJ5Vi5pIC0gZW50cnlXLmkgOiBlbnRyeVcuaSAtIGVudHJ5Vi5pO1xuICB9O1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/order/sort.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/parent-dummy-chains.js": /*!*******************************************************!*\ !*** ./node_modules/dagre/lib/parent-dummy-chains.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\n\nmodule.exports = parentDummyChains;\n\nfunction parentDummyChains(g) {\n var postorderNums = postorder(g);\n\n _.forEach(g.graph().dummyChains, function(v) {\n var node = g.node(v);\n var edgeObj = node.edgeObj;\n var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w);\n var path = pathData.path;\n var lca = pathData.lca;\n var pathIdx = 0;\n var pathV = path[pathIdx];\n var ascending = true;\n\n while (v !== edgeObj.w) {\n node = g.node(v);\n\n if (ascending) {\n while ((pathV = path[pathIdx]) !== lca &&\n g.node(pathV).maxRank < node.rank) {\n pathIdx++;\n }\n\n if (pathV === lca) {\n ascending = false;\n }\n }\n\n if (!ascending) {\n while (pathIdx < path.length - 1 &&\n g.node(pathV = path[pathIdx + 1]).minRank <= node.rank) {\n pathIdx++;\n }\n pathV = path[pathIdx];\n }\n\n g.setParent(v, pathV);\n v = g.successors(v)[0];\n }\n });\n}\n\n// Find a path from v to w through the lowest common ancestor (LCA). Return the\n// full path and the LCA.\nfunction findPath(g, postorderNums, v, w) {\n var vPath = [];\n var wPath = [];\n var low = Math.min(postorderNums[v].low, postorderNums[w].low);\n var lim = Math.max(postorderNums[v].lim, postorderNums[w].lim);\n var parent;\n var lca;\n\n // Traverse up from v to find the LCA\n parent = v;\n do {\n parent = g.parent(parent);\n vPath.push(parent);\n } while (parent &&\n (postorderNums[parent].low > low || lim > postorderNums[parent].lim));\n lca = parent;\n\n // Traverse from w to LCA\n parent = w;\n while ((parent = g.parent(parent)) !== lca) {\n wPath.push(parent);\n }\n\n return { path: vPath.concat(wPath.reverse()), lca: lca };\n}\n\nfunction postorder(g) {\n var result = {};\n var lim = 0;\n\n function dfs(v) {\n var low = lim;\n _.forEach(g.children(v), dfs);\n result[v] = { low: low, lim: lim++ };\n }\n _.forEach(g.children(), dfs);\n\n return result;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvcGFyZW50LWR1bW15LWNoYWlucy5qcz9mMWNkIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQVEsbUJBQU8sQ0FBQyxvREFBVTs7QUFFMUI7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLEdBQUc7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zdG9yZGVyTnVtc1t2XS5saW0sIHBvc3RvcmRlck51bXNbd10ubGltKTtcbiAgdmFyIHBhcmVudDtcbiAgdmFyIGxjYTtcblxuICAvLyBUcmF2ZXJzZSB1cCBmcm9tIHYgdG8gZmluZCB0aGUgTENBXG4gIHBhcmVudCA9IHY7XG4gIGRvIHtcbiAgICBwYXJlbnQgPSBnLnBhcmVudChwYXJlbnQpO1xuICAgIHZQYXRoLnB1c2gocGFyZW50KTtcbiAgfSB3aGlsZSAocGFyZW50ICYmXG4gICAgICAgICAgIChwb3N0b3JkZXJOdW1zW3BhcmVudF0ubG93ID4gbG93IHx8IGxpbSA+IHBvc3RvcmRlck51bXNbcGFyZW50XS5saW0pKTtcbiAgbGNhID0gcGFyZW50O1xuXG4gIC8vIFRyYXZlcnNlIGZyb20gdyB0byBMQ0FcbiAgcGFyZW50ID0gdztcbiAgd2hpbGUgKChwYXJlbnQgPSBnLnBhcmVudChwYXJlbnQpKSAhPT0gbGNhKSB7XG4gICAgd1BhdGgucHVzaChwYXJlbnQpO1xuICB9XG5cbiAgcmV0dXJuIHsgcGF0aDogdlBhdGguY29uY2F0KHdQYXRoLnJldmVyc2UoKSksIGxjYTogbGNhIH07XG59XG5cbmZ1bmN0aW9uIHBvc3RvcmRlcihnKSB7XG4gIHZhciByZXN1bHQgPSB7fTtcbiAgdmFyIGxpbSA9IDA7XG5cbiAgZnVuY3Rpb24gZGZzKHYpIHtcbiAgICB2YXIgbG93ID0gbGltO1xuICAgIF8uZm9yRWFjaChnLmNoaWxkcmVuKHYpLCBkZnMpO1xuICAgIHJlc3VsdFt2XSA9IHsgbG93OiBsb3csIGxpbTogbGltKysgfTtcbiAgfVxuICBfLmZvckVhY2goZy5jaGlsZHJlbigpLCBkZnMpO1xuXG4gIHJldHVybiByZXN1bHQ7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/parent-dummy-chains.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/position/bk.js": /*!***********************************************!*\ !*** ./node_modules/dagre/lib/position/bk.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar Graph = __webpack_require__(/*! ../graphlib */ \"./node_modules/dagre/lib/graphlib.js\").Graph;\nvar util = __webpack_require__(/*! ../util */ \"./node_modules/dagre/lib/util.js\");\n\n/*\n * This module provides coordinate assignment based on Brandes and Köpf, \"Fast\n * and Simple Horizontal Coordinate Assignment.\"\n */\n\nmodule.exports = {\n positionX: positionX,\n findType1Conflicts: findType1Conflicts,\n findType2Conflicts: findType2Conflicts,\n addConflict: addConflict,\n hasConflict: hasConflict,\n verticalAlignment: verticalAlignment,\n horizontalCompaction: horizontalCompaction,\n alignCoordinates: alignCoordinates,\n findSmallestWidthAlignment: findSmallestWidthAlignment,\n balance: balance\n};\n\n/*\n * Marks all edges in the graph with a type-1 conflict with the \"type1Conflict\"\n * property. A type-1 conflict is one where a non-inner segment crosses an\n * inner segment. An inner segment is an edge with both incident nodes marked\n * with the \"dummy\" property.\n *\n * This algorithm scans layer by layer, starting with the second, for type-1\n * conflicts between the current layer and the previous layer. For each layer\n * it scans the nodes from left to right until it reaches one that is incident\n * on an inner segment. It then scans predecessors to determine if they have\n * edges that cross that inner segment. At the end a final scan is done for all\n * nodes on the current rank to see if they cross the last visited inner\n * segment.\n *\n * This algorithm (safely) assumes that a dummy node will only be incident on a\n * single node in the layers being scanned.\n */\nfunction findType1Conflicts(g, layering) {\n var conflicts = {};\n\n function visitLayer(prevLayer, layer) {\n var\n // last visited node in the previous layer that is incident on an inner\n // segment.\n k0 = 0,\n // Tracks the last node in this layer scanned for crossings with a type-1\n // segment.\n scanPos = 0,\n prevLayerLength = prevLayer.length,\n lastNode = _.last(layer);\n\n _.forEach(layer, function(v, i) {\n var w = findOtherInnerSegmentNode(g, v),\n k1 = w ? g.node(w).order : prevLayerLength;\n\n if (w || v === lastNode) {\n _.forEach(layer.slice(scanPos, i +1), function(scanNode) {\n _.forEach(g.predecessors(scanNode), function(u) {\n var uLabel = g.node(u),\n uPos = uLabel.order;\n if ((uPos < k0 || k1 < uPos) &&\n !(uLabel.dummy && g.node(scanNode).dummy)) {\n addConflict(conflicts, u, scanNode);\n }\n });\n });\n scanPos = i + 1;\n k0 = k1;\n }\n });\n\n return layer;\n }\n\n _.reduce(layering, visitLayer);\n return conflicts;\n}\n\nfunction findType2Conflicts(g, layering) {\n var conflicts = {};\n\n function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {\n var v;\n _.forEach(_.range(southPos, southEnd), function(i) {\n v = south[i];\n if (g.node(v).dummy) {\n _.forEach(g.predecessors(v), function(u) {\n var uNode = g.node(u);\n if (uNode.dummy &&\n (uNode.order < prevNorthBorder || uNode.order > nextNorthBorder)) {\n addConflict(conflicts, u, v);\n }\n });\n }\n });\n }\n\n\n function visitLayer(north, south) {\n var prevNorthPos = -1,\n nextNorthPos,\n southPos = 0;\n\n _.forEach(south, function(v, southLookahead) {\n if (g.node(v).dummy === \"border\") {\n var predecessors = g.predecessors(v);\n if (predecessors.length) {\n nextNorthPos = g.node(predecessors[0]).order;\n scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);\n southPos = southLookahead;\n prevNorthPos = nextNorthPos;\n }\n }\n scan(south, southPos, south.length, nextNorthPos, north.length);\n });\n\n return south;\n }\n\n _.reduce(layering, visitLayer);\n return conflicts;\n}\n\nfunction findOtherInnerSegmentNode(g, v) {\n if (g.node(v).dummy) {\n return _.find(g.predecessors(v), function(u) {\n return g.node(u).dummy;\n });\n }\n}\n\nfunction addConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n\n var conflictsV = conflicts[v];\n if (!conflictsV) {\n conflicts[v] = conflictsV = {};\n }\n conflictsV[w] = true;\n}\n\nfunction hasConflict(conflicts, v, w) {\n if (v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n return _.has(conflicts[v], w);\n}\n\n/*\n * Try to align nodes into vertical \"blocks\" where possible. This algorithm\n * attempts to align a node with one of its median neighbors. If the edge\n * connecting a neighbor is a type-1 conflict then we ignore that possibility.\n * If a previous node has already formed a block with a node after the node\n * we're trying to form a block with, we also ignore that possibility - our\n * blocks would be split in that scenario.\n */\nfunction verticalAlignment(g, layering, conflicts, neighborFn) {\n var root = {},\n align = {},\n pos = {};\n\n // We cache the position here based on the layering because the graph and\n // layering may be out of sync. The layering matrix is manipulated to\n // generate different extreme alignments.\n _.forEach(layering, function(layer) {\n _.forEach(layer, function(v, order) {\n root[v] = v;\n align[v] = v;\n pos[v] = order;\n });\n });\n\n _.forEach(layering, function(layer) {\n var prevIdx = -1;\n _.forEach(layer, function(v) {\n var ws = neighborFn(v);\n if (ws.length) {\n ws = _.sortBy(ws, function(w) { return pos[w]; });\n var mp = (ws.length - 1) / 2;\n for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {\n var w = ws[i];\n if (align[v] === v &&\n prevIdx < pos[w] &&\n !hasConflict(conflicts, v, w)) {\n align[w] = v;\n align[v] = root[v] = root[w];\n prevIdx = pos[w];\n }\n }\n }\n });\n });\n\n return { root: root, align: align };\n}\n\nfunction horizontalCompaction(g, layering, root, align, reverseSep) {\n // This portion of the algorithm differs from BK due to a number of problems.\n // Instead of their algorithm we construct a new block graph and do two\n // sweeps. The first sweep places blocks with the smallest possible\n // coordinates. The second sweep removes unused space by moving blocks to the\n // greatest coordinates without violating separation.\n var xs = {},\n blockG = buildBlockGraph(g, layering, root, reverseSep),\n borderType = reverseSep ? \"borderLeft\" : \"borderRight\";\n\n function iterate(setXsFunc, nextNodesFunc) {\n var stack = blockG.nodes();\n var elem = stack.pop();\n var visited = {};\n while (elem) {\n if (visited[elem]) {\n setXsFunc(elem);\n } else {\n visited[elem] = true;\n stack.push(elem);\n stack = stack.concat(nextNodesFunc(elem));\n }\n\n elem = stack.pop();\n }\n }\n\n // First pass, assign smallest coordinates\n function pass1(elem) {\n xs[elem] = blockG.inEdges(elem).reduce(function(acc, e) {\n return Math.max(acc, xs[e.v] + blockG.edge(e));\n }, 0);\n }\n\n // Second pass, assign greatest coordinates\n function pass2(elem) {\n var min = blockG.outEdges(elem).reduce(function(acc, e) {\n return Math.min(acc, xs[e.w] - blockG.edge(e));\n }, Number.POSITIVE_INFINITY);\n\n var node = g.node(elem);\n if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {\n xs[elem] = Math.max(xs[elem], min);\n }\n }\n\n iterate(pass1, blockG.predecessors.bind(blockG));\n iterate(pass2, blockG.successors.bind(blockG));\n\n // Assign x coordinates to all nodes\n _.forEach(align, function(v) {\n xs[v] = xs[root[v]];\n });\n\n return xs;\n}\n\n\nfunction buildBlockGraph(g, layering, root, reverseSep) {\n var blockGraph = new Graph(),\n graphLabel = g.graph(),\n sepFn = sep(graphLabel.nodesep, graphLabel.edgesep, reverseSep);\n\n _.forEach(layering, function(layer) {\n var u;\n _.forEach(layer, function(v) {\n var vRoot = root[v];\n blockGraph.setNode(vRoot);\n if (u) {\n var uRoot = root[u],\n prevMax = blockGraph.edge(uRoot, vRoot);\n blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));\n }\n u = v;\n });\n });\n\n return blockGraph;\n}\n\n/*\n * Returns the alignment that has the smallest width of the given alignments.\n */\nfunction findSmallestWidthAlignment(g, xss) {\n return _.minBy(_.values(xss), function (xs) {\n var max = Number.NEGATIVE_INFINITY;\n var min = Number.POSITIVE_INFINITY;\n\n _.forIn(xs, function (x, v) {\n var halfWidth = width(g, v) / 2;\n\n max = Math.max(x + halfWidth, max);\n min = Math.min(x - halfWidth, min);\n });\n\n return max - min;\n });\n}\n\n/*\n * Align the coordinates of each of the layout alignments such that\n * left-biased alignments have their minimum coordinate at the same point as\n * the minimum coordinate of the smallest width alignment and right-biased\n * alignments have their maximum coordinate at the same point as the maximum\n * coordinate of the smallest width alignment.\n */\nfunction alignCoordinates(xss, alignTo) {\n var alignToVals = _.values(alignTo),\n alignToMin = _.min(alignToVals),\n alignToMax = _.max(alignToVals);\n\n _.forEach([\"u\", \"d\"], function(vert) {\n _.forEach([\"l\", \"r\"], function(horiz) {\n var alignment = vert + horiz,\n xs = xss[alignment],\n delta;\n if (xs === alignTo) return;\n\n var xsVals = _.values(xs);\n delta = horiz === \"l\" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);\n\n if (delta) {\n xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });\n }\n });\n });\n}\n\nfunction balance(xss, align) {\n return _.mapValues(xss.ul, function(ignore, v) {\n if (align) {\n return xss[align.toLowerCase()][v];\n } else {\n var xs = _.sortBy(_.map(xss, v));\n return (xs[1] + xs[2]) / 2;\n }\n });\n}\n\nfunction positionX(g) {\n var layering = util.buildLayerMatrix(g);\n var conflicts = _.merge(\n findType1Conflicts(g, layering),\n findType2Conflicts(g, layering));\n\n var xss = {};\n var adjustedLayering;\n _.forEach([\"u\", \"d\"], function(vert) {\n adjustedLayering = vert === \"u\" ? layering : _.values(layering).reverse();\n _.forEach([\"l\", \"r\"], function(horiz) {\n if (horiz === \"r\") {\n adjustedLayering = _.map(adjustedLayering, function(inner) {\n return _.values(inner).reverse();\n });\n }\n\n var neighborFn = (vert === \"u\" ? g.predecessors : g.successors).bind(g);\n var align = verticalAlignment(g, adjustedLayering, conflicts, neighborFn);\n var xs = horizontalCompaction(g, adjustedLayering,\n align.root, align.align, horiz === \"r\");\n if (horiz === \"r\") {\n xs = _.mapValues(xs, function(x) { return -x; });\n }\n xss[vert + horiz] = xs;\n });\n });\n\n var smallestWidth = findSmallestWidthAlignment(g, xss);\n alignCoordinates(xss, smallestWidth);\n return balance(xss, g.graph().align);\n}\n\nfunction sep(nodeSep, edgeSep, reverseSep) {\n return function(g, v, w) {\n var vLabel = g.node(v);\n var wLabel = g.node(w);\n var sum = 0;\n var delta;\n\n sum += vLabel.width / 2;\n if (_.has(vLabel, \"labelpos\")) {\n switch (vLabel.labelpos.toLowerCase()) {\n case \"l\": delta = -vLabel.width / 2; break;\n case \"r\": delta = vLabel.width / 2; break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n\n sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;\n\n sum += wLabel.width / 2;\n if (_.has(wLabel, \"labelpos\")) {\n switch (wLabel.labelpos.toLowerCase()) {\n case \"l\": delta = wLabel.width / 2; break;\n case \"r\": delta = -wLabel.width / 2; break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n\n return sum;\n };\n}\n\nfunction width(g, v) {\n return g.node(v).width;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvcG9zaXRpb24vYmsuanM/OGM1NSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTs7QUFFYixRQUFRLG1CQUFPLENBQUMscURBQVc7QUFDM0IsWUFBWSxtQkFBTyxDQUFDLHlEQUFhO0FBQ2pDLFdBQVcsbUJBQU8sQ0FBQyxpREFBUzs7QUFFNUI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO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aWYgKGRlbHRhKSB7XG4gICAgICBzdW0gKz0gcmV2ZXJzZVNlcCA/IGRlbHRhIDogLWRlbHRhO1xuICAgIH1cbiAgICBkZWx0YSA9IDA7XG5cbiAgICBzdW0gKz0gKHZMYWJlbC5kdW1teSA/IGVkZ2VTZXAgOiBub2RlU2VwKSAvIDI7XG4gICAgc3VtICs9ICh3TGFiZWwuZHVtbXkgPyBlZGdlU2VwIDogbm9kZVNlcCkgLyAyO1xuXG4gICAgc3VtICs9IHdMYWJlbC53aWR0aCAvIDI7XG4gICAgaWYgKF8uaGFzKHdMYWJlbCwgXCJsYWJlbHBvc1wiKSkge1xuICAgICAgc3dpdGNoICh3TGFiZWwubGFiZWxwb3MudG9Mb3dlckNhc2UoKSkge1xuICAgICAgY2FzZSBcImxcIjogZGVsdGEgPSB3TGFiZWwud2lkdGggLyAyOyBicmVhaztcbiAgICAgIGNhc2UgXCJyXCI6IGRlbHRhID0gLXdMYWJlbC53aWR0aCAvIDI7IGJyZWFrO1xuICAgICAgfVxuICAgIH1cbiAgICBpZiAoZGVsdGEpIHtcbiAgICAgIHN1bSArPSByZXZlcnNlU2VwID8gZGVsdGEgOiAtZGVsdGE7XG4gICAgfVxuICAgIGRlbHRhID0gMDtcblxuICAgIHJldHVybiBzdW07XG4gIH07XG59XG5cbmZ1bmN0aW9uIHdpZHRoKGcsIHYpIHtcbiAgcmV0dXJuIGcubm9kZSh2KS53aWR0aDtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/position/bk.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/position/index.js": /*!**************************************************!*\ !*** ./node_modules/dagre/lib/position/index.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar util = __webpack_require__(/*! ../util */ \"./node_modules/dagre/lib/util.js\");\nvar positionX = __webpack_require__(/*! ./bk */ \"./node_modules/dagre/lib/position/bk.js\").positionX;\n\nmodule.exports = position;\n\nfunction position(g) {\n g = util.asNonCompoundGraph(g);\n\n positionY(g);\n _.forEach(positionX(g), function(x, v) {\n g.node(v).x = x;\n });\n}\n\nfunction positionY(g) {\n var layering = util.buildLayerMatrix(g);\n var rankSep = g.graph().ranksep;\n var prevY = 0;\n _.forEach(layering, function(layer) {\n var maxHeight = _.max(_.map(layer, function(v) { return g.node(v).height; }));\n _.forEach(layer, function(v) {\n g.node(v).y = prevY + maxHeight / 2;\n });\n prevY += maxHeight + rankSep;\n });\n}\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvcG9zaXRpb24vaW5kZXguanM/MjMyNSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTs7QUFFYixRQUFRLG1CQUFPLENBQUMscURBQVc7QUFDM0IsV0FBVyxtQkFBTyxDQUFDLGlEQUFTO0FBQzVCLGdCQUFnQixtQkFBTyxDQUFDLHFEQUFNOztBQUU5Qjs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLEdBQUc7QUFDSDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esb0RBQW9ELHlCQUF5QixFQUFFO0FBQy9FO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQSxHQUFHO0FBQ0giLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZGFncmUvbGliL3Bvc2l0aW9uL2luZGV4LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbnZhciBfID0gcmVxdWlyZShcIi4uL2xvZGFzaFwiKTtcbnZhciB1dGlsID0gcmVxdWlyZShcIi4uL3V0aWxcIik7XG52YXIgcG9zaXRpb25YID0gcmVxdWlyZShcIi4vYmtcIikucG9zaXRpb25YO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHBvc2l0aW9uO1xuXG5mdW5jdGlvbiBwb3NpdGlvbihnKSB7XG4gIGcgPSB1dGlsLmFzTm9uQ29tcG91bmRHcmFwaChnKTtcblxuICBwb3NpdGlvblkoZyk7XG4gIF8uZm9yRWFjaChwb3NpdGlvblgoZyksIGZ1bmN0aW9uKHgsIHYpIHtcbiAgICBnLm5vZGUodikueCA9IHg7XG4gIH0pO1xufVxuXG5mdW5jdGlvbiBwb3NpdGlvblkoZykge1xuICB2YXIgbGF5ZXJpbmcgPSB1dGlsLmJ1aWxkTGF5ZXJNYXRyaXgoZyk7XG4gIHZhciByYW5rU2VwID0gZy5ncmFwaCgpLnJhbmtzZXA7XG4gIHZhciBwcmV2WSA9IDA7XG4gIF8uZm9yRWFjaChsYXllcmluZywgZnVuY3Rpb24obGF5ZXIpIHtcbiAgICB2YXIgbWF4SGVpZ2h0ID0gXy5tYXgoXy5tYXAobGF5ZXIsIGZ1bmN0aW9uKHYpIHsgcmV0dXJuIGcubm9kZSh2KS5oZWlnaHQ7IH0pKTtcbiAgICBfLmZvckVhY2gobGF5ZXIsIGZ1bmN0aW9uKHYpIHtcbiAgICAgIGcubm9kZSh2KS55ID0gcHJldlkgKyBtYXhIZWlnaHQgLyAyO1xuICAgIH0pO1xuICAgIHByZXZZICs9IG1heEhlaWdodCArIHJhbmtTZXA7XG4gIH0pO1xufVxuXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/position/index.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/rank/feasible-tree.js": /*!******************************************************!*\ !*** ./node_modules/dagre/lib/rank/feasible-tree.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar Graph = __webpack_require__(/*! ../graphlib */ \"./node_modules/dagre/lib/graphlib.js\").Graph;\nvar slack = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/rank/util.js\").slack;\n\nmodule.exports = feasibleTree;\n\n/*\n * Constructs a spanning tree with tight edges and adjusted the input node's\n * ranks to achieve this. A tight edge is one that is has a length that matches\n * its \"minlen\" attribute.\n *\n * The basic structure for this function is derived from Gansner, et al., \"A\n * Technique for Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a DAG.\n * 2. Graph must be connected.\n * 3. Graph must have at least one node.\n * 5. Graph nodes must have been previously assigned a \"rank\" property that\n * respects the \"minlen\" property of incident edges.\n * 6. Graph edges must have a \"minlen\" property.\n *\n * Post-conditions:\n *\n * - Graph nodes will have their rank adjusted to ensure that all edges are\n * tight.\n *\n * Returns a tree (undirected graph) that is constructed using only \"tight\"\n * edges.\n */\nfunction feasibleTree(g) {\n var t = new Graph({ directed: false });\n\n // Choose arbitrary node from which to start our tree\n var start = g.nodes()[0];\n var size = g.nodeCount();\n t.setNode(start, {});\n\n var edge, delta;\n while (tightTree(t, g) < size) {\n edge = findMinSlackEdge(t, g);\n delta = t.hasNode(edge.v) ? slack(g, edge) : -slack(g, edge);\n shiftRanks(t, g, delta);\n }\n\n return t;\n}\n\n/*\n * Finds a maximal tree of tight edges and returns the number of nodes in the\n * tree.\n */\nfunction tightTree(t, g) {\n function dfs(v) {\n _.forEach(g.nodeEdges(v), function(e) {\n var edgeV = e.v,\n w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !slack(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n }\n\n _.forEach(t.nodes(), dfs);\n return t.nodeCount();\n}\n\n/*\n * Finds the edge with the smallest slack that is incident on tree and returns\n * it.\n */\nfunction findMinSlackEdge(t, g) {\n return _.minBy(g.edges(), function(e) {\n if (t.hasNode(e.v) !== t.hasNode(e.w)) {\n return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# sourceURL=webpack-internal:///./node_modules/dagre/lib/rank/feasible-tree.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/rank/index.js": /*!**********************************************!*\ !*** ./node_modules/dagre/lib/rank/index.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar rankUtil = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/rank/util.js\");\nvar longestPath = rankUtil.longestPath;\nvar feasibleTree = __webpack_require__(/*! ./feasible-tree */ \"./node_modules/dagre/lib/rank/feasible-tree.js\");\nvar networkSimplex = __webpack_require__(/*! ./network-simplex */ \"./node_modules/dagre/lib/rank/network-simplex.js\");\n\nmodule.exports = rank;\n\n/*\n * Assigns a rank to each node in the input graph that respects the \"minlen\"\n * constraint specified on edges between nodes.\n *\n * This basic structure is derived from Gansner, et al., \"A Technique for\n * Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a connected DAG\n * 2. Graph nodes must be objects\n * 3. Graph edges must have \"weight\" and \"minlen\" attributes\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have a \"rank\" attribute based on the results of the\n * algorithm. Ranks can start at any index (including negative), we'll\n * fix them up later.\n */\nfunction rank(g) {\n switch(g.graph().ranker) {\n case \"network-simplex\": networkSimplexRanker(g); break;\n case \"tight-tree\": tightTreeRanker(g); break;\n case \"longest-path\": longestPathRanker(g); break;\n default: networkSimplexRanker(g);\n }\n}\n\n// A fast and simple ranker, but results are far from optimal.\nvar longestPathRanker = longestPath;\n\nfunction tightTreeRanker(g) {\n longestPath(g);\n feasibleTree(g);\n}\n\nfunction networkSimplexRanker(g) {\n networkSimplex(g);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvcmFuay9pbmRleC5qcz8wY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wuXG52YXIgbG9uZ2VzdFBhdGhSYW5rZXIgPSBsb25nZXN0UGF0aDtcblxuZnVuY3Rpb24gdGlnaHRUcmVlUmFua2VyKGcpIHtcbiAgbG9uZ2VzdFBhdGgoZyk7XG4gIGZlYXNpYmxlVHJlZShnKTtcbn1cblxuZnVuY3Rpb24gbmV0d29ya1NpbXBsZXhSYW5rZXIoZykge1xuICBuZXR3b3JrU2ltcGxleChnKTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/rank/index.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/rank/network-simplex.js": /*!********************************************************!*\ !*** ./node_modules/dagre/lib/rank/network-simplex.js ***! \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar feasibleTree = __webpack_require__(/*! ./feasible-tree */ \"./node_modules/dagre/lib/rank/feasible-tree.js\");\nvar slack = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/rank/util.js\").slack;\nvar initRank = __webpack_require__(/*! ./util */ \"./node_modules/dagre/lib/rank/util.js\").longestPath;\nvar preorder = __webpack_require__(/*! ../graphlib */ \"./node_modules/dagre/lib/graphlib.js\").alg.preorder;\nvar postorder = __webpack_require__(/*! ../graphlib */ \"./node_modules/dagre/lib/graphlib.js\").alg.postorder;\nvar simplify = __webpack_require__(/*! ../util */ \"./node_modules/dagre/lib/util.js\").simplify;\n\nmodule.exports = networkSimplex;\n\n// Expose some internals for testing purposes\nnetworkSimplex.initLowLimValues = initLowLimValues;\nnetworkSimplex.initCutValues = initCutValues;\nnetworkSimplex.calcCutValue = calcCutValue;\nnetworkSimplex.leaveEdge = leaveEdge;\nnetworkSimplex.enterEdge = enterEdge;\nnetworkSimplex.exchangeEdges = exchangeEdges;\n\n/*\n * The network simplex algorithm assigns ranks to each node in the input graph\n * and iteratively improves the ranking to reduce the length of edges.\n *\n * Preconditions:\n *\n * 1. The input graph must be a DAG.\n * 2. All nodes in the graph must have an object value.\n * 3. All edges in the graph must have \"minlen\" and \"weight\" attributes.\n *\n * Postconditions:\n *\n * 1. All nodes in the graph will have an assigned \"rank\" attribute that has\n * been optimized by the network simplex algorithm. Ranks start at 0.\n *\n *\n * A rough sketch of the algorithm is as follows:\n *\n * 1. Assign initial ranks to each node. We use the longest path algorithm,\n * which assigns ranks to the lowest position possible. In general this\n * leads to very wide bottom ranks and unnecessarily long edges.\n * 2. Construct a feasible tight tree. A tight tree is one such that all\n * edges in the tree have no slack (difference between length of edge\n * and minlen for the edge). This by itself greatly improves the assigned\n * rankings by shorting edges.\n * 3. Iteratively find edges that have negative cut values. Generally a\n * negative cut value indicates that the edge could be removed and a new\n * tree edge could be added to produce a more compact graph.\n *\n * Much of the algorithms here are derived from Gansner, et al., \"A Technique\n * for Drawing Directed Graphs.\" The structure of the file roughly follows the\n * structure of the overall algorithm.\n */\nfunction networkSimplex(g) {\n g = simplify(g);\n initRank(g);\n var t = feasibleTree(g);\n initLowLimValues(t);\n initCutValues(t, g);\n\n var e, f;\n while ((e = leaveEdge(t))) {\n f = enterEdge(t, g, e);\n exchangeEdges(t, g, e, f);\n }\n}\n\n/*\n * Initializes cut values for all edges in the tree.\n */\nfunction initCutValues(t, g) {\n var vs = postorder(t, t.nodes());\n vs = vs.slice(0, vs.length - 1);\n _.forEach(vs, function(v) {\n assignCutValue(t, g, v);\n });\n}\n\nfunction assignCutValue(t, g, child) {\n var childLab = t.node(child);\n var parent = childLab.parent;\n t.edge(child, parent).cutvalue = calcCutValue(t, g, child);\n}\n\n/*\n * Given the tight tree, its graph, and a child in the graph calculate and\n * return the cut value for the edge between the child and its parent.\n */\nfunction calcCutValue(t, g, child) {\n var childLab = t.node(child);\n var parent = childLab.parent;\n // True if the child is on the tail end of the edge in the directed graph\n var childIsTail = true;\n // The graph's view of the tree edge we're inspecting\n var graphEdge = g.edge(child, parent);\n // The accumulated cut value for the edge between this node and its parent\n var cutValue = 0;\n\n if (!graphEdge) {\n childIsTail = false;\n graphEdge = g.edge(parent, child);\n }\n\n cutValue = graphEdge.weight;\n\n _.forEach(g.nodeEdges(child), function(e) {\n var isOutEdge = e.v === child,\n other = isOutEdge ? e.w : e.v;\n\n if (other !== parent) {\n var pointsToHead = isOutEdge === childIsTail,\n otherWeight = g.edge(e).weight;\n\n cutValue += pointsToHead ? otherWeight : -otherWeight;\n if (isTreeEdge(t, child, other)) {\n var otherCutValue = t.edge(child, other).cutvalue;\n cutValue += pointsToHead ? -otherCutValue : otherCutValue;\n }\n }\n });\n\n return cutValue;\n}\n\nfunction initLowLimValues(tree, root) {\n if (arguments.length < 2) {\n root = tree.nodes()[0];\n }\n dfsAssignLowLim(tree, {}, 1, root);\n}\n\nfunction dfsAssignLowLim(tree, visited, nextLim, v, parent) {\n var low = nextLim;\n var label = tree.node(v);\n\n visited[v] = true;\n _.forEach(tree.neighbors(v), function(w) {\n if (!_.has(visited, w)) {\n nextLim = dfsAssignLowLim(tree, visited, nextLim, w, v);\n }\n });\n\n label.low = low;\n label.lim = nextLim++;\n if (parent) {\n label.parent = parent;\n } else {\n // TODO should be able to remove this when we incrementally update low lim\n delete label.parent;\n }\n\n return nextLim;\n}\n\nfunction leaveEdge(tree) {\n return _.find(tree.edges(), function(e) {\n return tree.edge(e).cutvalue < 0;\n });\n}\n\nfunction enterEdge(t, g, edge) {\n var v = edge.v;\n var w = edge.w;\n\n // For the rest of this function we assume that v is the tail and w is the\n // head, so if we don't have this edge in the graph we should flip it to\n // match the correct orientation.\n if (!g.hasEdge(v, w)) {\n v = edge.w;\n w = edge.v;\n }\n\n var vLabel = t.node(v);\n var wLabel = t.node(w);\n var tailLabel = vLabel;\n var flip = false;\n\n // If the root is in the tail of the edge then we need to flip the logic that\n // checks for the head and tail nodes in the candidates function below.\n if (vLabel.lim > wLabel.lim) {\n tailLabel = wLabel;\n flip = true;\n }\n\n var candidates = _.filter(g.edges(), function(edge) {\n return flip === isDescendant(t, t.node(edge.v), tailLabel) &&\n flip !== isDescendant(t, t.node(edge.w), tailLabel);\n });\n\n return _.minBy(candidates, function(edge) { return slack(g, edge); });\n}\n\nfunction exchangeEdges(t, g, e, f) {\n var v = e.v;\n var w = e.w;\n t.removeEdge(v, w);\n t.setEdge(f.v, f.w, {});\n initLowLimValues(t);\n initCutValues(t, g);\n updateRanks(t, g);\n}\n\nfunction updateRanks(t, g) {\n var root = _.find(t.nodes(), function(v) { return !g.node(v).parent; });\n var vs = preorder(t, root);\n vs = vs.slice(1);\n _.forEach(vs, function(v) {\n var parent = t.node(v).parent,\n edge = g.edge(v, parent),\n flipped = false;\n\n if (!edge) {\n edge = g.edge(parent, v);\n flipped = true;\n }\n\n g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen);\n });\n}\n\n/*\n * Returns true if the edge is in the tree.\n */\nfunction isTreeEdge(tree, u, v) {\n return tree.hasEdge(u, v);\n}\n\n/*\n * Returns true if the specified node is descendant of the root node per the\n * assigned low and lim attributes in the tree.\n */\nfunction isDescendant(tree, vLabel, rootLabel) {\n return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvcmFuay9uZXR3b3JrLXNpbXBsZXguanM/NzRlOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBYTs7QUFFYixRQUFRLG1CQUFPLENBQUMscURBQVc7QUFDM0IsbUJBQW1CLG1CQUFPLENBQUMsdUVBQWlCO0FBQzVDLFlBQVksbUJBQU8sQ0FBQyxxREFBUTtBQUM1QixlQUFlLG1CQUFPLENBQUMscURBQVE7QUFDL0IsZUFBZSxtQkFBTyxDQUFDLHlEQUFhO0FBQ3BDL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CB2KTtcbn1cblxuLypcbiAqIFJldHVybnMgdHJ1ZSBpZiB0aGUgc3BlY2lmaWVkIG5vZGUgaXMgZGVzY2VuZGFudCBvZiB0aGUgcm9vdCBub2RlIHBlciB0aGVcbiAqIGFzc2lnbmVkIGxvdyBhbmQgbGltIGF0dHJpYnV0ZXMgaW4gdGhlIHRyZWUuXG4gKi9cbmZ1bmN0aW9uIGlzRGVzY2VuZGFudCh0cmVlLCB2TGFiZWwsIHJvb3RMYWJlbCkge1xuICByZXR1cm4gcm9vdExhYmVsLmxvdyA8PSB2TGFiZWwubGltICYmIHZMYWJlbC5saW0gPD0gcm9vdExhYmVsLmxpbTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/rank/network-simplex.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/rank/util.js": /*!*********************************************!*\ !*** ./node_modules/dagre/lib/rank/util.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/dagre/lib/lodash.js\");\n\nmodule.exports = {\n longestPath: longestPath,\n slack: slack\n};\n\n/*\n * Initializes ranks for the input graph using the longest path algorithm. This\n * algorithm scales well and is fast in practice, it yields rather poor\n * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom\n * ranks wide and leaving edges longer than necessary. However, due to its\n * speed, this algorithm is good for getting an initial ranking that can be fed\n * into other algorithms.\n *\n * This algorithm does not normalize layers because it will be used by other\n * algorithms in most cases. If using this algorithm directly, be sure to\n * run normalize at the end.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG.\n * 2. Input graph node labels can be assigned properties.\n *\n * Post-conditions:\n *\n * 1. Each node will be assign an (unnormalized) \"rank\" property.\n */\nfunction longestPath(g) {\n var visited = {};\n\n function dfs(v) {\n var label = g.node(v);\n if (_.has(visited, v)) {\n return label.rank;\n }\n visited[v] = true;\n\n var rank = _.min(_.map(g.outEdges(v), function(e) {\n return dfs(e.w) - g.edge(e).minlen;\n }));\n\n if (rank === Number.POSITIVE_INFINITY || // return value of _.map([]) for Lodash 3\n rank === undefined || // return value of _.map([]) for Lodash 4\n rank === null) { // return value of _.map([null])\n rank = 0;\n }\n\n return (label.rank = rank);\n }\n\n _.forEach(g.sources(), dfs);\n}\n\n/*\n * Returns the amount of slack for the given edge. The slack is defined as the\n * difference between the length of the edge and its minimum length.\n */\nfunction slack(g, e) {\n return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvcmFuay91dGlsLmpzP2U4NDkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQWE7O0FBRWIsUUFBUSxtQkFBTyxDQUFDLHFEQUFXOztBQUUzQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsS0FBSzs7QUFFTDtBQUNBO0FBQ0Esd0JBQXdCO0FBQ3hCO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2RhZ3JlL2xpYi9yYW5rL3V0aWwuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3Rc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Ugc2xhY2sgaXMgZGVmaW5lZCBhcyB0aGVcbiAqIGRpZmZlcmVuY2UgYmV0d2VlbiB0aGUgbGVuZ3RoIG9mIHRoZSBlZGdlIGFuZCBpdHMgbWluaW11bSBsZW5ndGguXG4gKi9cbmZ1bmN0aW9uIHNsYWNrKGcsIGUpIHtcbiAgcmV0dXJuIGcubm9kZShlLncpLnJhbmsgLSBnLm5vZGUoZS52KS5yYW5rIC0gZy5lZGdlKGUpLm1pbmxlbjtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/rank/util.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/util.js": /*!****************************************!*\ !*** ./node_modules/dagre/lib/util.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("/* eslint \"no-console\": off */\n\n\n\nvar _ = __webpack_require__(/*! ./lodash */ \"./node_modules/dagre/lib/lodash.js\");\nvar Graph = __webpack_require__(/*! ./graphlib */ \"./node_modules/dagre/lib/graphlib.js\").Graph;\n\nmodule.exports = {\n addDummyNode: addDummyNode,\n simplify: simplify,\n asNonCompoundGraph: asNonCompoundGraph,\n successorWeights: successorWeights,\n predecessorWeights: predecessorWeights,\n intersectRect: intersectRect,\n buildLayerMatrix: buildLayerMatrix,\n normalizeRanks: normalizeRanks,\n removeEmptyRanks: removeEmptyRanks,\n addBorderNode: addBorderNode,\n maxRank: maxRank,\n partition: partition,\n time: time,\n notime: notime\n};\n\n/*\n * Adds a dummy node to the graph and return v.\n */\nfunction addDummyNode(g, type, attrs, name) {\n var v;\n do {\n v = _.uniqueId(name);\n } while (g.hasNode(v));\n\n attrs.dummy = type;\n g.setNode(v, attrs);\n return v;\n}\n\n/*\n * Returns a new graph with only simple edges. Handles aggregation of data\n * associated with multi-edges.\n */\nfunction simplify(g) {\n var simplified = new Graph().setGraph(g.graph());\n _.forEach(g.nodes(), function(v) { simplified.setNode(v, g.node(v)); });\n _.forEach(g.edges(), function(e) {\n var simpleLabel = simplified.edge(e.v, e.w) || { weight: 0, minlen: 1 };\n var label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n}\n\nfunction asNonCompoundGraph(g) {\n var simplified = new Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph());\n _.forEach(g.nodes(), function(v) {\n if (!g.children(v).length) {\n simplified.setNode(v, g.node(v));\n }\n });\n _.forEach(g.edges(), function(e) {\n simplified.setEdge(e, g.edge(e));\n });\n return simplified;\n}\n\nfunction successorWeights(g) {\n var weightMap = _.map(g.nodes(), function(v) {\n var sucs = {};\n _.forEach(g.outEdges(v), function(e) {\n sucs[e.w] = (sucs[e.w] || 0) + g.edge(e).weight;\n });\n return sucs;\n });\n return _.zipObject(g.nodes(), weightMap);\n}\n\nfunction predecessorWeights(g) {\n var weightMap = _.map(g.nodes(), function(v) {\n var preds = {};\n _.forEach(g.inEdges(v), function(e) {\n preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight;\n });\n return preds;\n });\n return _.zipObject(g.nodes(), weightMap);\n}\n\n/*\n * Finds where a line starting at point ({x, y}) would intersect a rectangle\n * ({x, y, width, height}) if it were pointing at the rectangle's center.\n */\nfunction intersectRect(rect, point) {\n var x = rect.x;\n var y = rect.y;\n\n // Rectangle intersection algorithm from:\n // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes\n var dx = point.x - x;\n var dy = point.y - y;\n var w = rect.width / 2;\n var h = rect.height / 2;\n\n if (!dx && !dy) {\n throw new Error(\"Not possible to find intersection inside of the rectangle\");\n }\n\n var sx, sy;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = h * dx / dy;\n sy = h;\n } else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = w * dy / dx;\n }\n\n return { x: x + sx, y: y + sy };\n}\n\n/*\n * Given a DAG with each node assigned \"rank\" and \"order\" properties, this\n * function will produce a matrix with the ids of each node.\n */\nfunction buildLayerMatrix(g) {\n var layering = _.map(_.range(maxRank(g) + 1), function() { return []; });\n _.forEach(g.nodes(), function(v) {\n var node = g.node(v);\n var rank = node.rank;\n if (!_.isUndefined(rank)) {\n layering[rank][node.order] = v;\n }\n });\n return layering;\n}\n\n/*\n * Adjusts the ranks for all nodes in the graph such that all nodes v have\n * rank(v) >= 0 and at least one node w has rank(w) = 0.\n */\nfunction normalizeRanks(g) {\n var min = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\n _.forEach(g.nodes(), function(v) {\n var node = g.node(v);\n if (_.has(node, \"rank\")) {\n node.rank -= min;\n }\n });\n}\n\nfunction removeEmptyRanks(g) {\n // Ranks may not start at 0, so we need to offset them\n var offset = _.min(_.map(g.nodes(), function(v) { return g.node(v).rank; }));\n\n var layers = [];\n _.forEach(g.nodes(), function(v) {\n var rank = g.node(v).rank - offset;\n if (!layers[rank]) {\n layers[rank] = [];\n }\n layers[rank].push(v);\n });\n\n var delta = 0;\n var nodeRankFactor = g.graph().nodeRankFactor;\n _.forEach(layers, function(vs, i) {\n if (_.isUndefined(vs) && i % nodeRankFactor !== 0) {\n --delta;\n } else if (delta) {\n _.forEach(vs, function(v) { g.node(v).rank += delta; });\n }\n });\n}\n\nfunction addBorderNode(g, prefix, rank, order) {\n var node = {\n width: 0,\n height: 0\n };\n if (arguments.length >= 4) {\n node.rank = rank;\n node.order = order;\n }\n return addDummyNode(g, \"border\", node, prefix);\n}\n\nfunction maxRank(g) {\n return _.max(_.map(g.nodes(), function(v) {\n var rank = g.node(v).rank;\n if (!_.isUndefined(rank)) {\n return rank;\n }\n }));\n}\n\n/*\n * Partition a collection into two groups: `lhs` and `rhs`. If the supplied\n * function returns true for an entry it goes into `lhs`. Otherwise it goes\n * into `rhs.\n */\nfunction partition(collection, fn) {\n var result = { lhs: [], rhs: [] };\n _.forEach(collection, function(value) {\n if (fn(value)) {\n result.lhs.push(value);\n } else {\n result.rhs.push(value);\n }\n });\n return result;\n}\n\n/*\n * Returns a new function that wraps `fn` with a timer. The wrapper logs the\n * time it takes to execute the function.\n */\nfunction time(name, fn) {\n var start = _.now();\n try {\n return fn();\n } finally {\n console.log(name + \" time: \" + (_.now() - start) + \"ms\");\n }\n}\n\nfunction notime(name, fn) {\n return fn();\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvdXRpbC5qcz9iNTBlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztBQUVhOztBQUViLFFBQVEsbUJBQU8sQ0FBQyxvREFBVTtBQUMxQixZQUFZLG1CQUFPLENBQUMsd0RBQVk7O0FBRWhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsR0FBRzs7QUFFSDtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxvQ0FBb0Msa0NBQWtDLEVBQUU7QUFDeEU7QUFDQSxvREFBb0Q7QUFDcEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0wsR0FBRztBQUNIO0FBQ0E7O0FBRUE7QUFDQSw4QkFBOEIsK0JBQStCO0FBQzdEO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsR0FBRztBQUNIO0FBQ0E7QUFDQSxHQUFHO0FBQ0g7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQU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cmhzLlxuICovXG5mdW5jdGlvbiBwYXJ0aXRpb24oY29sbGVjdGlvbiwgZm4pIHtcbiAgdmFyIHJlc3VsdCA9IHsgbGhzOiBbXSwgcmhzOiBbXSB9O1xuICBfLmZvckVhY2goY29sbGVjdGlvbiwgZnVuY3Rpb24odmFsdWUpIHtcbiAgICBpZiAoZm4odmFsdWUpKSB7XG4gICAgICByZXN1bHQubGhzLnB1c2godmFsdWUpO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXN1bHQucmhzLnB1c2godmFsdWUpO1xuICAgIH1cbiAgfSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbi8qXG4gKiBSZXR1cm5zIGEgbmV3IGZ1bmN0aW9uIHRoYXQgd3JhcHMgYGZuYCB3aXRoIGEgdGltZXIuIFRoZSB3cmFwcGVyIGxvZ3MgdGhlXG4gKiB0aW1lIGl0IHRha2VzIHRvIGV4ZWN1dGUgdGhlIGZ1bmN0aW9uLlxuICovXG5mdW5jdGlvbiB0aW1lKG5hbWUsIGZuKSB7XG4gIHZhciBzdGFydCA9IF8ubm93KCk7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGZuKCk7XG4gIH0gZmluYWxseSB7XG4gICAgY29uc29sZS5sb2cobmFtZSArIFwiIHRpbWU6IFwiICsgKF8ubm93KCkgLSBzdGFydCkgKyBcIm1zXCIpO1xuICB9XG59XG5cbmZ1bmN0aW9uIG5vdGltZShuYW1lLCBmbikge1xuICByZXR1cm4gZm4oKTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/util.js\n"); /***/ }), /***/ "./node_modules/dagre/lib/version.js": /*!*******************************************!*\ !*** ./node_modules/dagre/lib/version.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = \"0.8.5\";\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9kYWdyZS9saWIvdmVyc2lvbi5qcz85MjE0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2RhZ3JlL2xpYi92ZXJzaW9uLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBcIjAuOC41XCI7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/dagre/lib/version.js\n"); /***/ }), /***/ "./node_modules/graphlib/index.js": /*!****************************************!*\ !*** ./node_modules/graphlib/index.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/**\n * Copyright (c) 2014, Chris Pettitt\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar lib = __webpack_require__(/*! ./lib */ \"./node_modules/graphlib/lib/index.js\");\n\nmodule.exports = {\n Graph: lib.Graph,\n json: __webpack_require__(/*! ./lib/json */ \"./node_modules/graphlib/lib/json.js\"),\n alg: __webpack_require__(/*! ./lib/alg */ \"./node_modules/graphlib/lib/alg/index.js\"),\n version: lib.version\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9pbmRleC5qcz9lMDA4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFlBQVksK0JBQStCO0FBQzNDO0FBQ0E7QUFDQTtBQUNBOztBQUVBLFVBQVUsbUJBQU8sQ0FBQyxtREFBTzs7QUFFekI7QUFDQTtBQUNBLFFBQVEsbUJBQU8sQ0FBQyx1REFBWTtBQUM1QixPQUFPLG1CQUFPLENBQUMsMkRBQVc7QUFDMUI7QUFDQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9pbmRleC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h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9IHJlcXVpcmUoXCIuL2xpYlwiKTtcblxubW9kdWxlLmV4cG9ydHMgPSB7XG4gIEdyYXBoOiBsaWIuR3JhcGgsXG4gIGpzb246IHJlcXVpcmUoXCIuL2xpYi9qc29uXCIpLFxuICBhbGc6IHJlcXVpcmUoXCIuL2xpYi9hbGdcIiksXG4gIHZlcnNpb246IGxpYi52ZXJzaW9uXG59O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/index.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/components.js": /*!*****************************************************!*\ !*** ./node_modules/graphlib/lib/alg/components.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\n\nmodule.exports = components;\n\nfunction components(g) {\n var visited = {};\n var cmpts = [];\n var cmpt;\n\n function dfs(v) {\n if (_.has(visited, v)) return;\n visited[v] = true;\n cmpt.push(v);\n _.each(g.successors(v), dfs);\n _.each(g.predecessors(v), dfs);\n }\n\n _.each(g.nodes(), function(v) {\n cmpt = [];\n dfs(v);\n if (cmpt.length) {\n cmpts.push(cmpt);\n }\n });\n\n return cmpts;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL2NvbXBvbmVudHMuanM/ZTQ0YSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxRQUFRLG1CQUFPLENBQUMsd0RBQVc7O0FBRTNCOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEdBQUc7O0FBRUg7QUFDQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL2NvbXBvbmVudHMuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgXyA9IHJlcXVpcmUoXCIuLi9sb2Rhc2hcIik7XG5cbm1vZHVsZS5leHBvcnRzID0gY29tcG9uZW50cztcblxuZnVuY3Rpb24gY29tcG9uZW50cyhnKSB7XG4gIHZhciB2aXNpdGVkID0ge307XG4gIHZhciBjbXB0cyA9IFtdO1xuICB2YXIgY21wdDtcblxuICBmdW5jdGlvbiBkZnModikge1xuICAgIGlmIChfLmhhcyh2aXNpdGVkLCB2KSkgcmV0dXJuO1xuICAgIHZpc2l0ZWRbdl0gPSB0cnVlO1xuICAgIGNtcHQucHVzaCh2KTtcbiAgICBfLmVhY2goZy5zdWNjZXNzb3JzKHYpLCBkZnMpO1xuICAgIF8uZWFjaChnLnByZWRlY2Vzc29ycyh2KSwgZGZzKTtcbiAgfVxuXG4gIF8uZWFjaChnLm5vZGVzKCksIGZ1bmN0aW9uKHYpIHtcbiAgICBjbXB0ID0gW107XG4gICAgZGZzKHYpO1xuICAgIGlmIChjbXB0Lmxlbmd0aCkge1xuICAgICAgY21wdHMucHVzaChjbXB0KTtcbiAgICB9XG4gIH0pO1xuXG4gIHJldHVybiBjbXB0cztcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/components.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/dfs.js": /*!**********************************************!*\ !*** ./node_modules/graphlib/lib/alg/dfs.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\n\nmodule.exports = dfs;\n\n/*\n * A helper that preforms a pre- or post-order traversal on the input graph\n * and returns the nodes in the order they were visited. If the graph is\n * undirected then this algorithm will navigate using neighbors. If the graph\n * is directed then this algorithm will navigate using successors.\n *\n * Order must be one of \"pre\" or \"post\".\n */\nfunction dfs(g, vs, order) {\n if (!_.isArray(vs)) {\n vs = [vs];\n }\n\n var navigation = (g.isDirected() ? g.successors : g.neighbors).bind(g);\n\n var acc = [];\n var visited = {};\n _.each(vs, function(v) {\n if (!g.hasNode(v)) {\n throw new Error(\"Graph does not have node: \" + v);\n }\n\n doDfs(g, v, order === \"post\", visited, navigation, acc);\n });\n return acc;\n}\n\nfunction doDfs(g, v, postorder, visited, navigation, acc) {\n if (!_.has(visited, v)) {\n visited[v] = true;\n\n if (!postorder) { acc.push(v); }\n _.each(navigation(v), function(w) {\n doDfs(g, w, postorder, visited, navigation, acc);\n });\n if (postorder) { acc.push(v); }\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL2Rmcy5qcz9kZjJlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQVEsbUJBQU8sQ0FBQyx3REFBVzs7QUFFM0I7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLEdBQUc7QUFDSDtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQSxxQkFBcUIsYUFBYTtBQUNsQztBQUNBO0FBQ0EsS0FBSztBQUNMLG9CQUFvQixhQUFhO0FBQ2pDO0FBQ0EiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZ3JhcGhsaWIvbGliL2FsZy9kZnMuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgXyA9I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JldHVybiBhY2M7XG59XG5cbmZ1bmN0aW9uIGRvRGZzKGcsIHYsIHBvc3RvcmRlciwgdmlzaXRlZCwgbmF2aWdhdGlvbiwgYWNjKSB7XG4gIGlmICghXy5oYXModmlzaXRlZCwgdikpIHtcbiAgICB2aXNpdGVkW3ZdID0gdHJ1ZTtcblxuICAgIGlmICghcG9zdG9yZGVyKSB7IGFjYy5wdXNoKHYpOyB9XG4gICAgXy5lYWNoKG5hdmlnYXRpb24odiksIGZ1bmN0aW9uKHcpIHtcbiAgICAgIGRvRGZzKGcsIHcsIHBvc3RvcmRlciwgdmlzaXRlZCwgbmF2aWdhdGlvbiwgYWNjKTtcbiAgICB9KTtcbiAgICBpZiAocG9zdG9yZGVyKSB7IGFjYy5wdXNoKHYpOyB9XG4gIH1cbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/dfs.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/dijkstra-all.js": /*!*******************************************************!*\ !*** ./node_modules/graphlib/lib/alg/dijkstra-all.js ***! \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var dijkstra = __webpack_require__(/*! ./dijkstra */ \"./node_modules/graphlib/lib/alg/dijkstra.js\");\nvar _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\n\nmodule.exports = dijkstraAll;\n\nfunction dijkstraAll(g, weightFunc, edgeFunc) {\n return _.transform(g.nodes(), function(acc, v) {\n acc[v] = dijkstra(g, v, weightFunc, edgeFunc);\n }, {});\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL2RpamtzdHJhLWFsbC5qcz9kMzEyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWUsbUJBQU8sQ0FBQywrREFBWTtBQUNuQyxRQUFRLG1CQUFPLENBQUMsd0RBQVc7O0FBRTNCOztBQUVBO0FBQ0E7QUFDQTtBQUNBLEdBQUcsSUFBSTtBQUNQIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2dyYXBobGliL2xpYi9hbGcvZGlqa3N0cmEtYWxsLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGRpamtzdHJhID0gcmVxdWlyZShcIi4vZGlqa3N0cmFcIik7XG52YXIgXyA9IHJlcXVpcmUoXCIuLi9sb2Rhc2hcIik7XG5cbm1vZHVsZS5leHBvcnRzID0gZGlqa3N0cmFBbGw7XG5cbmZ1bmN0aW9uIGRpamtzdHJhQWxsKGcsIHdlaWdodEZ1bmMsIGVkZ2VGdW5jKSB7XG4gIHJldHVybiBfLnRyYW5zZm9ybShnLm5vZGVzKCksIGZ1bmN0aW9uKGFjYywgdikge1xuICAgIGFjY1t2XSA9IGRpamtzdHJhKGcsIHYsIHdlaWdodEZ1bmMsIGVkZ2VGdW5jKTtcbiAgfSwge30pO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/dijkstra-all.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/dijkstra.js": /*!***************************************************!*\ !*** ./node_modules/graphlib/lib/alg/dijkstra.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\nvar PriorityQueue = __webpack_require__(/*! ../data/priority-queue */ \"./node_modules/graphlib/lib/data/priority-queue.js\");\n\nmodule.exports = dijkstra;\n\nvar DEFAULT_WEIGHT_FUNC = _.constant(1);\n\nfunction dijkstra(g, source, weightFn, edgeFn) {\n return runDijkstra(g, String(source),\n weightFn || DEFAULT_WEIGHT_FUNC,\n edgeFn || function(v) { return g.outEdges(v); });\n}\n\nfunction runDijkstra(g, source, weightFn, edgeFn) {\n var results = {};\n var pq = new PriorityQueue();\n var v, vEntry;\n\n var updateNeighbors = function(edge) {\n var w = edge.v !== v ? edge.v : edge.w;\n var wEntry = results[w];\n var weight = weightFn(edge);\n var distance = vEntry.distance + weight;\n\n if (weight < 0) {\n throw new Error(\"dijkstra does not allow negative edge weights. \" +\n \"Bad edge: \" + edge + \" Weight: \" + weight);\n }\n\n if (distance < wEntry.distance) {\n wEntry.distance = distance;\n wEntry.predecessor = v;\n pq.decrease(w, distance);\n }\n };\n\n g.nodes().forEach(function(v) {\n var distance = v === source ? 0 : Number.POSITIVE_INFINITY;\n results[v] = { distance: distance };\n pq.add(v, distance);\n });\n\n while (pq.size() > 0) {\n v = pq.removeMin();\n vEntry = results[v];\n if (vEntry.distance === Number.POSITIVE_INFINITY) {\n break;\n }\n\n edgeFn(v).forEach(updateNeighbors);\n }\n\n return results;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL2RpamtzdHJhLmpzP2E0NzMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsUUFBUSxtQkFBTyxDQUFDLHdEQUFXO0FBQzNCLG9CQUFvQixtQkFBTyxDQUFDLGtGQUF3Qjs7QUFFcEQ7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsMkJBQTJCLHNCQUFzQixFQUFFO0FBQ25EOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxrQkFBa0I7QUF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Rpc3RhbmNlICsgd2VpZ2h0O1xuXG4gICAgaWYgKHdlaWdodCA8IDApIHtcbiAgICAgIHRocm93IG5ldyBFcnJvcihcImRpamtzdHJhIGRvZXMgbm90IGFsbG93IG5lZ2F0aXZlIGVkZ2Ugd2VpZ2h0cy4gXCIgK1xuICAgICAgICAgICAgICAgICAgICAgIFwiQmFkIGVkZ2U6IFwiICsgZWRnZSArIFwiIFdlaWdodDogXCIgKyB3ZWlnaHQpO1xuICAgIH1cblxuICAgIGlmIChkaXN0YW5jZSA8IHdFbnRyeS5kaXN0YW5jZSkge1xuICAgICAgd0VudHJ5LmRpc3RhbmNlID0gZGlzdGFuY2U7XG4gICAgICB3RW50cnkucHJlZGVjZXNzb3IgPSB2O1xuICAgICAgcHEuZGVjcmVhc2UodywgZGlzdGFuY2UpO1xuICAgIH1cbiAgfTtcblxuICBnLm5vZGVzKCkuZm9yRWFjaChmdW5jdGlvbih2KSB7XG4gICAgdmFyIGRpc3RhbmNlID0gdiA9PT0gc291cmNlID8gMCA6IE51bWJlci5QT1NJVElWRV9JTkZJTklUWTtcbiAgICByZXN1bHRzW3ZdID0geyBkaXN0YW5jZTogZGlzdGFuY2UgfTtcbiAgICBwcS5hZGQodiwgZGlzdGFuY2UpO1xuICB9KTtcblxuICB3aGlsZSAocHEuc2l6ZSgpID4gMCkge1xuICAgIHYgPSBwcS5yZW1vdmVNaW4oKTtcbiAgICB2RW50cnkgPSByZXN1bHRzW3ZdO1xuICAgIGlmICh2RW50cnkuZGlzdGFuY2UgPT09IE51bWJlci5QT1NJVElWRV9JTkZJTklUWSkge1xuICAgICAgYnJlYWs7XG4gICAgfVxuXG4gICAgZWRnZUZuKHYpLmZvckVhY2godXBkYXRlTmVpZ2hib3JzKTtcbiAgfVxuXG4gIHJldHVybiByZXN1bHRzO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/dijkstra.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/find-cycles.js": /*!******************************************************!*\ !*** ./node_modules/graphlib/lib/alg/find-cycles.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\nvar tarjan = __webpack_require__(/*! ./tarjan */ \"./node_modules/graphlib/lib/alg/tarjan.js\");\n\nmodule.exports = findCycles;\n\nfunction findCycles(g) {\n return _.filter(tarjan(g), function(cmpt) {\n return cmpt.length > 1 || (cmpt.length === 1 && g.hasEdge(cmpt[0], cmpt[0]));\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL2ZpbmQtY3ljbGVzLmpzP2RkYWMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsUUFBUSxtQkFBTyxDQUFDLHdEQUFXO0FBQzNCLGFBQWEsbUJBQU8sQ0FBQywyREFBVTs7QUFFL0I7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsR0FBRztBQUNIIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2dyYXBobGliL2xpYi9hbGcvZmluZC1jeWNsZXMuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgXyA9IHJlcXVpcmUoXCIuLi9sb2Rhc2hcIik7XG52YXIgdGFyamFuID0gcmVxdWlyZShcIi4vdGFyamFuXCIpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZpbmRDeWNsZXM7XG5cbmZ1bmN0aW9uIGZpbmRDeWNsZXMoZykge1xuICByZXR1cm4gXy5maWx0ZXIodGFyamFuKGcpLCBmdW5jdGlvbihjbXB0KSB7XG4gICAgcmV0dXJuIGNtcHQubGVuZ3RoID4gMSB8fCAoY21wdC5sZW5ndGggPT09IDEgJiYgZy5oYXNFZGdlKGNtcHRbMF0sIGNtcHRbMF0pKTtcbiAgfSk7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/find-cycles.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/floyd-warshall.js": /*!*********************************************************!*\ !*** ./node_modules/graphlib/lib/alg/floyd-warshall.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\n\nmodule.exports = floydWarshall;\n\nvar DEFAULT_WEIGHT_FUNC = _.constant(1);\n\nfunction floydWarshall(g, weightFn, edgeFn) {\n return runFloydWarshall(g,\n weightFn || DEFAULT_WEIGHT_FUNC,\n edgeFn || function(v) { return g.outEdges(v); });\n}\n\nfunction runFloydWarshall(g, weightFn, edgeFn) {\n var results = {};\n var nodes = g.nodes();\n\n nodes.forEach(function(v) {\n results[v] = {};\n results[v][v] = { distance: 0 };\n nodes.forEach(function(w) {\n if (v !== w) {\n results[v][w] = { distance: Number.POSITIVE_INFINITY };\n }\n });\n edgeFn(v).forEach(function(edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var d = weightFn(edge);\n results[v][w] = { distance: d, predecessor: v };\n });\n });\n\n nodes.forEach(function(k) {\n var rowK = results[k];\n nodes.forEach(function(i) {\n var rowI = results[i];\n nodes.forEach(function(j) {\n var ik = rowI[k];\n var kj = rowK[j];\n var ij = rowI[j];\n var altDistance = ik.distance + kj.distance;\n if (altDistance < ij.distance) {\n ij.distance = altDistance;\n ij.predecessor = kj.predecessor;\n }\n });\n });\n });\n\n return results;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9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Rpc3RhbmNlID0gYWx0RGlzdGFuY2U7XG4gICAgICAgICAgaWoucHJlZGVjZXNzb3IgPSBrai5wcmVkZWNlc3NvcjtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgfSk7XG4gIH0pO1xuXG4gIHJldHVybiByZXN1bHRzO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/floyd-warshall.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/index.js": /*!************************************************!*\ !*** ./node_modules/graphlib/lib/alg/index.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = {\n components: __webpack_require__(/*! ./components */ \"./node_modules/graphlib/lib/alg/components.js\"),\n dijkstra: __webpack_require__(/*! ./dijkstra */ \"./node_modules/graphlib/lib/alg/dijkstra.js\"),\n dijkstraAll: __webpack_require__(/*! ./dijkstra-all */ \"./node_modules/graphlib/lib/alg/dijkstra-all.js\"),\n findCycles: __webpack_require__(/*! ./find-cycles */ \"./node_modules/graphlib/lib/alg/find-cycles.js\"),\n floydWarshall: __webpack_require__(/*! ./floyd-warshall */ \"./node_modules/graphlib/lib/alg/floyd-warshall.js\"),\n isAcyclic: __webpack_require__(/*! ./is-acyclic */ \"./node_modules/graphlib/lib/alg/is-acyclic.js\"),\n postorder: __webpack_require__(/*! ./postorder */ \"./node_modules/graphlib/lib/alg/postorder.js\"),\n preorder: __webpack_require__(/*! ./preorder */ \"./node_modules/graphlib/lib/alg/preorder.js\"),\n prim: __webpack_require__(/*! ./prim */ \"./node_modules/graphlib/lib/alg/prim.js\"),\n tarjan: __webpack_require__(/*! ./tarjan */ \"./node_modules/graphlib/lib/alg/tarjan.js\"),\n topsort: __webpack_require__(/*! ./topsort */ \"./node_modules/graphlib/lib/alg/topsort.js\")\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIj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lyZShcIi4vcG9zdG9yZGVyXCIpLFxuICBwcmVvcmRlcjogcmVxdWlyZShcIi4vcHJlb3JkZXJcIiksXG4gIHByaW06IHJlcXVpcmUoXCIuL3ByaW1cIiksXG4gIHRhcmphbjogcmVxdWlyZShcIi4vdGFyamFuXCIpLFxuICB0b3Bzb3J0OiByZXF1aXJlKFwiLi90b3Bzb3J0XCIpXG59O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/index.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/is-acyclic.js": /*!*****************************************************!*\ !*** ./node_modules/graphlib/lib/alg/is-acyclic.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var topsort = __webpack_require__(/*! ./topsort */ \"./node_modules/graphlib/lib/alg/topsort.js\");\n\nmodule.exports = isAcyclic;\n\nfunction isAcyclic(g) {\n try {\n topsort(g);\n } catch (e) {\n if (e instanceof topsort.CycleException) {\n return false;\n }\n throw e;\n }\n return true;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL2lzLWFjeWNsaWMuanM/NDNlOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFPLENBQUMsNkRBQVc7O0FBRWpDOztBQUVBO0FBQ0E7QUFDQTtBQUNBLEdBQUc7QUFDSDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL2lzLWFjeWNsaWMuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgdG9wc29ydCA9IHJlcXVpcmUoXCIuL3RvcHNvcnRcIik7XG5cbm1vZHVsZS5leHBvcnRzID0gaXNBY3ljbGljO1xuXG5mdW5jdGlvbiBpc0FjeWNsaWMoZykge1xuICB0cnkge1xuICAgIHRvcHNvcnQoZyk7XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICBpZiAoZSBpbnN0YW5jZW9mIHRvcHNvcnQuQ3ljbGVFeGNlcHRpb24pIHtcbiAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG4gICAgdGhyb3cgZTtcbiAgfVxuICByZXR1cm4gdHJ1ZTtcbn1cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/is-acyclic.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/postorder.js": /*!****************************************************!*\ !*** ./node_modules/graphlib/lib/alg/postorder.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var dfs = __webpack_require__(/*! ./dfs */ \"./node_modules/graphlib/lib/alg/dfs.js\");\n\nmodule.exports = postorder;\n\nfunction postorder(g, vs) {\n return dfs(g, vs, \"post\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL3Bvc3RvcmRlci5qcz80ZjE3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFVBQVUsbUJBQU8sQ0FBQyxxREFBTzs7QUFFekI7O0FBRUE7QUFDQTtBQUNBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2dyYXBobGliL2xpYi9hbGcvcG9zdG9yZGVyLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGRmcyA9IHJlcXVpcmUoXCIuL2Rmc1wiKTtcblxubW9kdWxlLmV4cG9ydHMgPSBwb3N0b3JkZXI7XG5cbmZ1bmN0aW9uIHBvc3RvcmRlcihnLCB2cykge1xuICByZXR1cm4gZGZzKGcsIHZzLCBcInBvc3RcIik7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/postorder.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/preorder.js": /*!***************************************************!*\ !*** ./node_modules/graphlib/lib/alg/preorder.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var dfs = __webpack_require__(/*! ./dfs */ \"./node_modules/graphlib/lib/alg/dfs.js\");\n\nmodule.exports = preorder;\n\nfunction preorder(g, vs) {\n return dfs(g, vs, \"pre\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL3ByZW9yZGVyLmpzP2FhZjkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsVUFBVSxtQkFBTyxDQUFDLHFEQUFPOztBQUV6Qjs7QUFFQTtBQUNBO0FBQ0EiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZ3JhcGhsaWIvbGliL2FsZy9wcmVvcmRlci5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBkZnMgPSByZXF1aXJlKFwiLi9kZnNcIik7XG5cbm1vZHVsZS5leHBvcnRzID0gcHJlb3JkZXI7XG5cbmZ1bmN0aW9uIHByZW9yZGVyKGcsIHZzKSB7XG4gIHJldHVybiBkZnMoZywgdnMsIFwicHJlXCIpO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/preorder.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/prim.js": /*!***********************************************!*\ !*** ./node_modules/graphlib/lib/alg/prim.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\nvar Graph = __webpack_require__(/*! ../graph */ \"./node_modules/graphlib/lib/graph.js\");\nvar PriorityQueue = __webpack_require__(/*! ../data/priority-queue */ \"./node_modules/graphlib/lib/data/priority-queue.js\");\n\nmodule.exports = prim;\n\nfunction prim(g, weightFunc) {\n var result = new Graph();\n var parents = {};\n var pq = new PriorityQueue();\n var v;\n\n function updateNeighbors(edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var pri = pq.priority(w);\n if (pri !== undefined) {\n var edgeWeight = weightFunc(edge);\n if (edgeWeight < pri) {\n parents[w] = v;\n pq.decrease(w, edgeWeight);\n }\n }\n }\n\n if (g.nodeCount() === 0) {\n return result;\n }\n\n _.each(g.nodes(), function(v) {\n pq.add(v, Number.POSITIVE_INFINITY);\n result.setNode(v);\n });\n\n // Start from an arbitrary node\n pq.decrease(g.nodes()[0], 0);\n\n var init = false;\n while (pq.size() > 0) {\n v = pq.removeMin();\n if (_.has(parents, v)) {\n result.setEdge(v, parents[v]);\n } else if (init) {\n throw new Error(\"Input graph is not connected: \" + g);\n } else {\n init = true;\n }\n\n g.nodeEdges(v).forEach(updateNeighbors);\n }\n\n return result;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL3ByaW0uanM/NjFlOSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxRQUFRLG1CQUFPLENBQUMsd0RBQVc7QUFDM0IsWUFBWSxtQkFBTyxDQUFDLHNEQUFVO0FBQzlCLG9CQUFvQixtQkFBTyxDQUFDLGtGQUF3Qjs7QUFFcEQ7O0FBRUE7QUFD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cGFyZW50c1t3XSA9IHY7XG4gICAgICAgIHBxLmRlY3JlYXNlKHcsIGVkZ2VXZWlnaHQpO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIGlmIChnLm5vZGVDb3VudCgpID09PSAwKSB7XG4gICAgcmV0dXJuIHJlc3VsdDtcbiAgfVxuXG4gIF8uZWFjaChnLm5vZGVzKCksIGZ1bmN0aW9uKHYpIHtcbiAgICBwcS5hZGQodiwgTnVtYmVyLlBPU0lUSVZFX0lORklOSVRZKTtcbiAgICByZXN1bHQuc2V0Tm9kZSh2KTtcbiAgfSk7XG5cbiAgLy8gU3RhcnQgZnJvbSBhbiBhcmJpdHJhcnkgbm9kZVxuICBwcS5kZWNyZWFzZShnLm5vZGVzKClbMF0sIDApO1xuXG4gIHZhciBpbml0ID0gZmFsc2U7XG4gIHdoaWxlIChwcS5zaXplKCkgPiAwKSB7XG4gICAgdiA9IHBxLnJlbW92ZU1pbigpO1xuICAgIGlmIChfLmhhcyhwYXJlbnRzLCB2KSkge1xuICAgICAgcmVzdWx0LnNldEVkZ2UodiwgcGFyZW50c1t2XSk7XG4gICAgfSBlbHNlIGlmIChpbml0KSB7XG4gICAgICB0aHJvdyBuZXcgRXJyb3IoXCJJbnB1dCBncmFwaCBpcyBub3QgY29ubmVjdGVkOiBcIiArIGcpO1xuICAgIH0gZWxzZSB7XG4gICAgICBpbml0ID0gdHJ1ZTtcbiAgICB9XG5cbiAgICBnLm5vZGVFZGdlcyh2KS5mb3JFYWNoKHVwZGF0ZU5laWdoYm9ycyk7XG4gIH1cblxuICByZXR1cm4gcmVzdWx0O1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/prim.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/tarjan.js": /*!*************************************************!*\ !*** ./node_modules/graphlib/lib/alg/tarjan.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\n\nmodule.exports = tarjan;\n\nfunction tarjan(g) {\n var index = 0;\n var stack = [];\n var visited = {}; // node id -> { onStack, lowlink, index }\n var results = [];\n\n function dfs(v) {\n var entry = visited[v] = {\n onStack: true,\n lowlink: index,\n index: index++\n };\n stack.push(v);\n\n g.successors(v).forEach(function(w) {\n if (!_.has(visited, w)) {\n dfs(w);\n entry.lowlink = Math.min(entry.lowlink, visited[w].lowlink);\n } else if (visited[w].onStack) {\n entry.lowlink = Math.min(entry.lowlink, visited[w].index);\n }\n });\n\n if (entry.lowlink === entry.index) {\n var cmpt = [];\n var w;\n do {\n w = stack.pop();\n visited[w].onStack = false;\n cmpt.push(w);\n } while (v !== w);\n results.push(cmpt);\n }\n }\n\n g.nodes().forEach(function(v) {\n if (!_.has(visited, v)) {\n dfs(v);\n }\n });\n\n return results;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL3Rhcmphbi5qcz9jZmE3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQVEsbUJBQU8sQ0FBQyx3REFBVzs7QUFFM0I7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsbUJBQW1CLGdCQUFnQjtBQUNuQzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE9BQU87QUFDUDtBQUNBO0FBQ0EsS0FBSzs7QUFFTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE9BQU87QUFDUDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxHQUFHOztBQUVIO0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0gc3RhY2sucG9wKCk7XG4gICAgICAgIHZpc2l0ZWRbd10ub25TdGFjayA9IGZhbHNlO1xuICAgICAgICBjbXB0LnB1c2godyk7XG4gICAgICB9IHdoaWxlICh2ICE9PSB3KTtcbiAgICAgIHJlc3VsdHMucHVzaChjbXB0KTtcbiAgICB9XG4gIH1cblxuICBnLm5vZGVzKCkuZm9yRWFjaChmdW5jdGlvbih2KSB7XG4gICAgaWYgKCFfLmhhcyh2aXNpdGVkLCB2KSkge1xuICAgICAgZGZzKHYpO1xuICAgIH1cbiAgfSk7XG5cbiAgcmV0dXJuIHJlc3VsdHM7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/tarjan.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/alg/topsort.js": /*!**************************************************!*\ !*** ./node_modules/graphlib/lib/alg/topsort.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\n\nmodule.exports = topsort;\ntopsort.CycleException = CycleException;\n\nfunction topsort(g) {\n var visited = {};\n var stack = {};\n var results = [];\n\n function visit(node) {\n if (_.has(stack, node)) {\n throw new CycleException();\n }\n\n if (!_.has(visited, node)) {\n stack[node] = true;\n visited[node] = true;\n _.each(g.predecessors(node), visit);\n delete stack[node];\n results.push(node);\n }\n }\n\n _.each(g.sinks(), visit);\n\n if (_.size(visited) !== g.nodeCount()) {\n throw new CycleException();\n }\n\n return results;\n}\n\nfunction CycleException() {}\nCycleException.prototype = new Error(); // must be an instance of Error to pass testing//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvYWxnL3RvcHNvcnQuanM/ODE4NSJdLCJu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BpZiAoXy5zaXplKHZpc2l0ZWQpICE9PSBnLm5vZGVDb3VudCgpKSB7XG4gICAgdGhyb3cgbmV3IEN5Y2xlRXhjZXB0aW9uKCk7XG4gIH1cblxuICByZXR1cm4gcmVzdWx0cztcbn1cblxuZnVuY3Rpb24gQ3ljbGVFeGNlcHRpb24oKSB7fVxuQ3ljbGVFeGNlcHRpb24ucHJvdG90eXBlID0gbmV3IEVycm9yKCk7IC8vIG11c3QgYmUgYW4gaW5zdGFuY2Ugb2YgRXJyb3IgdG8gcGFzcyB0ZXN0aW5nIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/alg/topsort.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/data/priority-queue.js": /*!**********************************************************!*\ !*** ./node_modules/graphlib/lib/data/priority-queue.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ../lodash */ \"./node_modules/graphlib/lib/lodash.js\");\n\nmodule.exports = PriorityQueue;\n\n/**\n * A min-priority queue data structure. This algorithm is derived from Cormen,\n * et al., \"Introduction to Algorithms\". The basic idea of a min-priority\n * queue is that you can efficiently (in O(1) time) get the smallest key in\n * the queue. Adding and removing elements takes O(log n) time. A key can\n * have its priority decreased in O(log n) time.\n */\nfunction PriorityQueue() {\n this._arr = [];\n this._keyIndices = {};\n}\n\n/**\n * Returns the number of elements in the queue. Takes `O(1)` time.\n */\nPriorityQueue.prototype.size = function() {\n return this._arr.length;\n};\n\n/**\n * Returns the keys that are in the queue. Takes `O(n)` time.\n */\nPriorityQueue.prototype.keys = function() {\n return this._arr.map(function(x) { return x.key; });\n};\n\n/**\n * Returns `true` if **key** is in the queue and `false` if not.\n */\nPriorityQueue.prototype.has = function(key) {\n return _.has(this._keyIndices, key);\n};\n\n/**\n * Returns the priority for **key**. If **key** is not present in the queue\n * then this function returns `undefined`. Takes `O(1)` time.\n *\n * @param {Object} key\n */\nPriorityQueue.prototype.priority = function(key) {\n var index = this._keyIndices[key];\n if (index !== undefined) {\n return this._arr[index].priority;\n }\n};\n\n/**\n * Returns the key for the minimum element in this queue. If the queue is\n * empty this function throws an Error. Takes `O(1)` time.\n */\nPriorityQueue.prototype.min = function() {\n if (this.size() === 0) {\n throw new Error(\"Queue underflow\");\n }\n return this._arr[0].key;\n};\n\n/**\n * Inserts a new key into the priority queue. If the key already exists in\n * the queue this function returns `false`; otherwise it will return `true`.\n * Takes `O(n)` time.\n *\n * @param {Object} key the key to add\n * @param {Number} priority the initial priority for the key\n */\nPriorityQueue.prototype.add = function(key, priority) {\n var keyIndices = this._keyIndices;\n key = String(key);\n if (!_.has(keyIndices, key)) {\n var arr = this._arr;\n var index = arr.length;\n keyIndices[key] = index;\n arr.push({key: key, priority: priority});\n this._decrease(index);\n return true;\n }\n return false;\n};\n\n/**\n * Removes and returns the smallest key in the queue. Takes `O(log n)` time.\n */\nPriorityQueue.prototype.removeMin = function() {\n this._swap(0, this._arr.length - 1);\n var min = this._arr.pop();\n delete this._keyIndices[min.key];\n this._heapify(0);\n return min.key;\n};\n\n/**\n * Decreases the priority for **key** to **priority**. If the new priority is\n * greater than the previous priority, this function will throw an Error.\n *\n * @param {Object} key the key for which to raise priority\n * @param {Number} priority the new priority for the key\n */\nPriorityQueue.prototype.decrease = function(key, priority) {\n var index = this._keyIndices[key];\n if (priority > this._arr[index].priority) {\n throw new Error(\"New priority is greater than current priority. \" +\n \"Key: \" + key + \" Old: \" + this._arr[index].priority + \" New: \" + priority);\n }\n this._arr[index].priority = priority;\n this._decrease(index);\n};\n\nPriorityQueue.prototype._heapify = function(i) {\n var arr = this._arr;\n var l = 2 * i;\n var r = l + 1;\n var largest = i;\n if (l < arr.length) {\n largest = arr[l].priority < arr[largest].priority ? l : largest;\n if (r < arr.length) {\n largest = arr[r].priority < arr[largest].priority ? r : largest;\n }\n if (largest !== i) {\n this._swap(i, largest);\n this._heapify(largest);\n }\n }\n};\n\nPriorityQueue.prototype._decrease = function(index) {\n var arr = this._arr;\n var priority = arr[index].priority;\n var parent;\n while (index !== 0) {\n parent = index >> 1;\n if (arr[parent].priority < priority) {\n break;\n }\n this._swap(index, parent);\n index = parent;\n }\n};\n\nPriorityQueue.prototype._swap = function(i, j) {\n var arr = this._arr;\n var keyIndices = this._keyIndices;\n var origArrI = arr[i];\n var origArrJ = arr[j];\n arr[i] = origArrJ;\n arr[j] = origArrI;\n keyIndices[origArrJ.key] = i;\n keyIndices[origArrI.key] = j;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvZGF0YS9wcmlvcml0eS1xdWV1ZS5qcz8wMWViIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQVEsbUJBQU8sQ0FBQyx3REFBVzs7QUFFM0I7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxvQ0FBb0MsY0FBYyxFQUFFO0FBQ3BEOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsMkNBQTJDO0FBQzNDO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCO0FBQ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Jvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/data/priority-queue.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/graph.js": /*!********************************************!*\ !*** ./node_modules/graphlib/lib/graph.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; eval("\n\nvar _ = __webpack_require__(/*! ./lodash */ \"./node_modules/graphlib/lib/lodash.js\");\n\nmodule.exports = Graph;\n\nvar DEFAULT_EDGE_NAME = \"\\x00\";\nvar GRAPH_NODE = \"\\x00\";\nvar EDGE_KEY_DELIM = \"\\x01\";\n\n// Implementation notes:\n//\n// * Node id query functions should return string ids for the nodes\n// * Edge id query functions should return an \"edgeObj\", edge object, that is\n// composed of enough information to uniquely identify an edge: {v, w, name}.\n// * Internally we use an \"edgeId\", a stringified form of the edgeObj, to\n// reference edges. This is because we need a performant way to look these\n// edges up and, object properties, which have string keys, are the closest\n// we're going to get to a performant hashtable in JavaScript.\n\nfunction Graph(opts) {\n this._isDirected = _.has(opts, \"directed\") ? opts.directed : true;\n this._isMultigraph = _.has(opts, \"multigraph\") ? opts.multigraph : false;\n this._isCompound = _.has(opts, \"compound\") ? opts.compound : false;\n\n // Label for the graph itself\n this._label = undefined;\n\n // Defaults to be set when creating a new node\n this._defaultNodeLabelFn = _.constant(undefined);\n\n // Defaults to be set when creating a new edge\n this._defaultEdgeLabelFn = _.constant(undefined);\n\n // v -> label\n this._nodes = {};\n\n if (this._isCompound) {\n // v -> parent\n this._parent = {};\n\n // v -> children\n this._children = {};\n this._children[GRAPH_NODE] = {};\n }\n\n // v -> edgeObj\n this._in = {};\n\n // u -> v -> Number\n this._preds = {};\n\n // v -> edgeObj\n this._out = {};\n\n // v -> w -> Number\n this._sucs = {};\n\n // e -> edgeObj\n this._edgeObjs = {};\n\n // e -> label\n this._edgeLabels = {};\n}\n\n/* Number of nodes in the graph. Should only be changed by the implementation. */\nGraph.prototype._nodeCount = 0;\n\n/* Number of edges in the graph. Should only be changed by the implementation. */\nGraph.prototype._edgeCount = 0;\n\n\n/* === Graph functions ========= */\n\nGraph.prototype.isDirected = function() {\n return this._isDirected;\n};\n\nGraph.prototype.isMultigraph = function() {\n return this._isMultigraph;\n};\n\nGraph.prototype.isCompound = function() {\n return this._isCompound;\n};\n\nGraph.prototype.setGraph = function(label) {\n this._label = label;\n return this;\n};\n\nGraph.prototype.graph = function() {\n return this._label;\n};\n\n\n/* === Node functions ========== */\n\nGraph.prototype.setDefaultNodeLabel = function(newDefault) {\n if (!_.isFunction(newDefault)) {\n newDefault = _.constant(newDefault);\n }\n this._defaultNodeLabelFn = newDefault;\n return this;\n};\n\nGraph.prototype.nodeCount = function() {\n return this._nodeCount;\n};\n\nGraph.prototype.nodes = function() {\n return _.keys(this._nodes);\n};\n\nGraph.prototype.sources = function() {\n var self = this;\n return _.filter(this.nodes(), function(v) {\n return _.isEmpty(self._in[v]);\n });\n};\n\nGraph.prototype.sinks = function() {\n var self = this;\n return _.filter(this.nodes(), function(v) {\n return _.isEmpty(self._out[v]);\n });\n};\n\nGraph.prototype.setNodes = function(vs, value) {\n var args = arguments;\n var self = this;\n _.each(vs, function(v) {\n if (args.length > 1) {\n self.setNode(v, value);\n } else {\n self.setNode(v);\n }\n });\n return this;\n};\n\nGraph.prototype.setNode = function(v, value) {\n if (_.has(this._nodes, v)) {\n if (arguments.length > 1) {\n this._nodes[v] = value;\n }\n return this;\n }\n\n this._nodes[v] = arguments.length > 1 ? value : this._defaultNodeLabelFn(v);\n if (this._isCompound) {\n this._parent[v] = GRAPH_NODE;\n this._children[v] = {};\n this._children[GRAPH_NODE][v] = true;\n }\n this._in[v] = {};\n this._preds[v] = {};\n this._out[v] = {};\n this._sucs[v] = {};\n ++this._nodeCount;\n return this;\n};\n\nGraph.prototype.node = function(v) {\n return this._nodes[v];\n};\n\nGraph.prototype.hasNode = function(v) {\n return _.has(this._nodes, v);\n};\n\nGraph.prototype.removeNode = function(v) {\n var self = this;\n if (_.has(this._nodes, v)) {\n var removeEdge = function(e) { self.removeEdge(self._edgeObjs[e]); };\n delete this._nodes[v];\n if (this._isCompound) {\n this._removeFromParentsChildList(v);\n delete this._parent[v];\n _.each(this.children(v), function(child) {\n self.setParent(child);\n });\n delete this._children[v];\n }\n _.each(_.keys(this._in[v]), removeEdge);\n delete this._in[v];\n delete this._preds[v];\n _.each(_.keys(this._out[v]), removeEdge);\n delete this._out[v];\n delete this._sucs[v];\n --this._nodeCount;\n }\n return this;\n};\n\nGraph.prototype.setParent = function(v, parent) {\n if (!this._isCompound) {\n throw new Error(\"Cannot set parent in a non-compound graph\");\n }\n\n if (_.isUndefined(parent)) {\n parent = GRAPH_NODE;\n } else {\n // Coerce parent to string\n parent += \"\";\n for (var ancestor = parent;\n !_.isUndefined(ancestor);\n ancestor = this.parent(ancestor)) {\n if (ancestor === v) {\n throw new Error(\"Setting \" + parent+ \" as parent of \" + v +\n \" would create a cycle\");\n }\n }\n\n this.setNode(parent);\n }\n\n this.setNode(v);\n this._removeFromParentsChildList(v);\n this._parent[v] = parent;\n this._children[parent][v] = true;\n return this;\n};\n\nGraph.prototype._removeFromParentsChildList = function(v) {\n delete this._children[this._parent[v]][v];\n};\n\nGraph.prototype.parent = function(v) {\n if (this._isCompound) {\n var parent = this._parent[v];\n if (parent !== GRAPH_NODE) {\n return parent;\n }\n }\n};\n\nGraph.prototype.children = function(v) {\n if (_.isUndefined(v)) {\n v = GRAPH_NODE;\n }\n\n if (this._isCompound) {\n var children = this._children[v];\n if (children) {\n return _.keys(children);\n }\n } else if (v === GRAPH_NODE) {\n return this.nodes();\n } else if (this.hasNode(v)) {\n return [];\n }\n};\n\nGraph.prototype.predecessors = function(v) {\n var predsV = this._preds[v];\n if (predsV) {\n return _.keys(predsV);\n }\n};\n\nGraph.prototype.successors = function(v) {\n var sucsV = this._sucs[v];\n if (sucsV) {\n return _.keys(sucsV);\n }\n};\n\nGraph.prototype.neighbors = function(v) {\n var preds = this.predecessors(v);\n if (preds) {\n return _.union(preds, this.successors(v));\n }\n};\n\nGraph.prototype.isLeaf = function (v) {\n var neighbors;\n if (this.isDirected()) {\n neighbors = this.successors(v);\n } else {\n neighbors = this.neighbors(v);\n }\n return neighbors.length === 0;\n};\n\nGraph.prototype.filterNodes = function(filter) {\n var copy = new this.constructor({\n directed: this._isDirected,\n multigraph: this._isMultigraph,\n compound: this._isCompound\n });\n\n copy.setGraph(this.graph());\n\n var self = this;\n _.each(this._nodes, function(value, v) {\n if (filter(v)) {\n copy.setNode(v, value);\n }\n });\n\n _.each(this._edgeObjs, function(e) {\n if (copy.hasNode(e.v) && copy.hasNode(e.w)) {\n copy.setEdge(e, self.edge(e));\n }\n });\n\n var parents = {};\n function findParent(v) {\n var parent = self.parent(v);\n if (parent === undefined || copy.hasNode(parent)) {\n parents[v] = parent;\n return parent;\n } else if (parent in parents) {\n return parents[parent];\n } else {\n return findParent(parent);\n }\n }\n\n if (this._isCompound) {\n _.each(copy.nodes(), function(v) {\n copy.setParent(v, findParent(v));\n });\n }\n\n return copy;\n};\n\n/* === Edge functions ========== */\n\nGraph.prototype.setDefaultEdgeLabel = function(newDefault) {\n if (!_.isFunction(newDefault)) {\n newDefault = _.constant(newDefault);\n }\n this._defaultEdgeLabelFn = newDefault;\n return this;\n};\n\nGraph.prototype.edgeCount = function() {\n return this._edgeCount;\n};\n\nGraph.prototype.edges = function() {\n return _.values(this._edgeObjs);\n};\n\nGraph.prototype.setPath = function(vs, value) {\n var self = this;\n var args = arguments;\n _.reduce(vs, function(v, w) {\n if (args.length > 1) {\n self.setEdge(v, w, value);\n } else {\n self.setEdge(v, w);\n }\n return w;\n });\n return this;\n};\n\n/*\n * setEdge(v, w, [value, [name]])\n * setEdge({ v, w, [name] }, [value])\n */\nGraph.prototype.setEdge = function() {\n var v, w, name, value;\n var valueSpecified = false;\n var arg0 = arguments[0];\n\n if (typeof arg0 === \"object\" && arg0 !== null && \"v\" in arg0) {\n v = arg0.v;\n w = arg0.w;\n name = arg0.name;\n if (arguments.length === 2) {\n value = arguments[1];\n valueSpecified = true;\n }\n } else {\n v = arg0;\n w = arguments[1];\n name = arguments[3];\n if (arguments.length > 2) {\n value = arguments[2];\n valueSpecified = true;\n }\n }\n\n v = \"\" + v;\n w = \"\" + w;\n if (!_.isUndefined(name)) {\n name = \"\" + name;\n }\n\n var e = edgeArgsToId(this._isDirected, v, w, name);\n if (_.has(this._edgeLabels, e)) {\n if (valueSpecified) {\n this._edgeLabels[e] = value;\n }\n return this;\n }\n\n if (!_.isUndefined(name) && !this._isMultigraph) {\n throw new Error(\"Cannot set a named edge when isMultigraph = false\");\n }\n\n // It didn't exist, so we need to create it.\n // First ensure the nodes exist.\n this.setNode(v);\n this.setNode(w);\n\n this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);\n\n var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);\n // Ensure we add undirected edges in a consistent way.\n v = edgeObj.v;\n w = edgeObj.w;\n\n Object.freeze(edgeObj);\n this._edgeObjs[e] = edgeObj;\n incrementOrInitEntry(this._preds[w], v);\n incrementOrInitEntry(this._sucs[v], w);\n this._in[w][e] = edgeObj;\n this._out[v][e] = edgeObj;\n this._edgeCount++;\n return this;\n};\n\nGraph.prototype.edge = function(v, w, name) {\n var e = (arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name));\n return this._edgeLabels[e];\n};\n\nGraph.prototype.hasEdge = function(v, w, name) {\n var e = (arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name));\n return _.has(this._edgeLabels, e);\n};\n\nGraph.prototype.removeEdge = function(v, w, name) {\n var e = (arguments.length === 1\n ? edgeObjToId(this._isDirected, arguments[0])\n : edgeArgsToId(this._isDirected, v, w, name));\n var edge = this._edgeObjs[e];\n if (edge) {\n v = edge.v;\n w = edge.w;\n delete this._edgeLabels[e];\n delete this._edgeObjs[e];\n decrementOrRemoveEntry(this._preds[w], v);\n decrementOrRemoveEntry(this._sucs[v], w);\n delete this._in[w][e];\n delete this._out[v][e];\n this._edgeCount--;\n }\n return this;\n};\n\nGraph.prototype.inEdges = function(v, u) {\n var inV = this._in[v];\n if (inV) {\n var edges = _.values(inV);\n if (!u) {\n return edges;\n }\n return _.filter(edges, function(edge) { return edge.v === u; });\n }\n};\n\nGraph.prototype.outEdges = function(v, w) {\n var outV = this._out[v];\n if (outV) {\n var edges = _.values(outV);\n if (!w) {\n return edges;\n }\n return _.filter(edges, function(edge) { return edge.w === w; });\n }\n};\n\nGraph.prototype.nodeEdges = function(v, w) {\n var inEdges = this.inEdges(v, w);\n if (inEdges) {\n return inEdges.concat(this.outEdges(v, w));\n }\n};\n\nfunction incrementOrInitEntry(map, k) {\n if (map[k]) {\n map[k]++;\n } else {\n map[k] = 1;\n }\n}\n\nfunction decrementOrRemoveEntry(map, k) {\n if (!--map[k]) { delete map[k]; }\n}\n\nfunction edgeArgsToId(isDirected, v_, w_, name) {\n var v = \"\" + v_;\n var w = \"\" + w_;\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM +\n (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name);\n}\n\nfunction edgeArgsToObj(isDirected, v_, w_, name) {\n var v = \"\" + v_;\n var w = \"\" + w_;\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n var edgeObj = { v: v, w: w };\n if (name) {\n edgeObj.name = name;\n }\n return edgeObj;\n}\n\nfunction edgeObjToId(isDirected, edgeObj) {\n return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvZ3JhcGguanM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ZWQsIGVkZ2VPYmoudiwgZWRnZU9iai53LCBlZGdlT2JqLm5hbWUpO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/graph.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/index.js": /*!********************************************!*\ !*** ./node_modules/graphlib/lib/index.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("// Includes only the \"core\" of graphlib\nmodule.exports = {\n Graph: __webpack_require__(/*! ./graph */ \"./node_modules/graphlib/lib/graph.js\"),\n version: __webpack_require__(/*! ./version */ \"./node_modules/graphlib/lib/version.js\")\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvaW5kZXguanM/MDFjZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0EsU0FBUyxtQkFBTyxDQUFDLHFEQUFTO0FBQzFCLFdBQVcsbUJBQU8sQ0FBQyx5REFBVztBQUM5QiIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvaW5kZXguanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJbmNsdWRlcyBvbmx5IHRoZSBcImNvcmVcIiBvZiBncmFwaGxpYlxubW9kdWxlLmV4cG9ydHMgPSB7XG4gIEdyYXBoOiByZXF1aXJlKFwiLi9ncmFwaFwiKSxcbiAgdmVyc2lvbjogcmVxdWlyZShcIi4vdmVyc2lvblwiKVxufTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/index.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/json.js": /*!*******************************************!*\ !*** ./node_modules/graphlib/lib/json.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var _ = __webpack_require__(/*! ./lodash */ \"./node_modules/graphlib/lib/lodash.js\");\nvar Graph = __webpack_require__(/*! ./graph */ \"./node_modules/graphlib/lib/graph.js\");\n\nmodule.exports = {\n write: write,\n read: read\n};\n\nfunction write(g) {\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound()\n },\n nodes: writeNodes(g),\n edges: writeEdges(g)\n };\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n return json;\n}\n\nfunction writeNodes(g) {\n return _.map(g.nodes(), function(v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n var node = { v: v };\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n return node;\n });\n}\n\nfunction writeEdges(g) {\n return _.map(g.edges(), function(e) {\n var edgeValue = g.edge(e);\n var edge = { v: e.v, w: e.w };\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n return edge;\n });\n}\n\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n _.each(json.nodes, function(entry) {\n g.setNode(entry.v, entry.value);\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n _.each(json.edges, function(entry) {\n g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n });\n return g;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvanNvbi5qcz8xOWIyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFFBQVEsbUJBQU8sQ0FBQyx1REFBVTtBQUMxQixZQUFZLG1CQUFPL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Xy5lYWNoKGpzb24ubm9kZXMsIGZ1bmN0aW9uKGVudHJ5KSB7XG4gICAgZy5zZXROb2RlKGVudHJ5LnYsIGVudHJ5LnZhbHVlKTtcbiAgICBpZiAoZW50cnkucGFyZW50KSB7XG4gICAgICBnLnNldFBhcmVudChlbnRyeS52LCBlbnRyeS5wYXJlbnQpO1xuICAgIH1cbiAgfSk7XG4gIF8uZWFjaChqc29uLmVkZ2VzLCBmdW5jdGlvbihlbnRyeSkge1xuICAgIGcuc2V0RWRnZSh7IHY6IGVudHJ5LnYsIHc6IGVudHJ5LncsIG5hbWU6IGVudHJ5Lm5hbWUgfSwgZW50cnkudmFsdWUpO1xuICB9KTtcbiAgcmV0dXJuIGc7XG59XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/json.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/lodash.js": /*!*********************************************!*\ !*** ./node_modules/graphlib/lib/lodash.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* global window */\n\nvar lodash;\n\nif (true) {\n try {\n lodash = {\n clone: __webpack_require__(/*! lodash/clone */ \"./node_modules/lodash/clone.js\"),\n constant: __webpack_require__(/*! lodash/constant */ \"./node_modules/lodash/constant.js\"),\n each: __webpack_require__(/*! lodash/each */ \"./node_modules/lodash/each.js\"),\n filter: __webpack_require__(/*! lodash/filter */ \"./node_modules/lodash/filter.js\"),\n has: __webpack_require__(/*! lodash/has */ \"./node_modules/lodash/has.js\"),\n isArray: __webpack_require__(/*! lodash/isArray */ \"./node_modules/lodash/isArray.js\"),\n isEmpty: __webpack_require__(/*! lodash/isEmpty */ \"./node_modules/lodash/isEmpty.js\"),\n isFunction: __webpack_require__(/*! lodash/isFunction */ \"./node_modules/lodash/isFunction.js\"),\n isUndefined: __webpack_require__(/*! lodash/isUndefined */ \"./node_modules/lodash/isUndefined.js\"),\n keys: __webpack_require__(/*! lodash/keys */ \"./node_modules/lodash/keys.js\"),\n map: __webpack_require__(/*! lodash/map */ \"./node_modules/lodash/map.js\"),\n reduce: __webpack_require__(/*! lodash/reduce */ \"./node_modules/lodash/reduce.js\"),\n size: __webpack_require__(/*! lodash/size */ \"./node_modules/lodash/size.js\"),\n transform: __webpack_require__(/*! lodash/transform */ \"./node_modules/lodash/transform.js\"),\n union: __webpack_require__(/*! lodash/union */ \"./node_modules/lodash/union.js\"),\n values: __webpack_require__(/*! lodash/values */ \"./node_modules/lodash/values.js\")\n };\n } catch (e) {\n // continue regardless of error\n }\n}\n\nif (!lodash) {\n lodash = window._;\n}\n\nmodule.exports = lodash;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvbG9kYXNoLmpzPzMzZGUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0FBRUE7O0FBRUEsSUFBSSxJQUE2QjtBQUNqQztBQUNBO0FBQ0EsYUFBYSxtQkFBTyxDQUFDLG9EQUFjO0FBQ25DLGdCQUFnQixtQkFBTyxDQUFDLDBEQUFpQjtBQUN6QyxZQUFZLG1CQUFPLENBQUMsa0RBQWE7QUFDakMsY0FBYyxtQkFBTyxDQUFDLHNEQUFlO0FBQ3JDLFlBQVksbUJBQU8sQ0FBQyxnREFBWTtBQUNoQyxlQUFlLG1CQUFPLENBQUMsd0RBQWdCO0FBQ3ZDLGVBQWUsbUJBQU8sQ0FBQyx3REFBZ0I7QUFDdkMsa0JBQWtCLG1CQUFPLENBQUMsOERBQW1CO0FBQzdDLG1CQUFtQixtQkFBTyxDQUFDLGdFQUFvQjtBQUMvQyxZQUFZLG1CQUFPLENBQUMsa0RBQWE7QUFDakMsV0FBVyxtQkFBTyxDQUFDLGdEQUFZO0FBQy9CLGNBQWMsbUJBQU8sQ0FBQyxzRE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XBcIiksXG4gICAgICByZWR1Y2U6IHJlcXVpcmUoXCJsb2Rhc2gvcmVkdWNlXCIpLFxuICAgICAgc2l6ZTogcmVxdWlyZShcImxvZGFzaC9zaXplXCIpLFxuICAgICAgdHJhbnNmb3JtOiByZXF1aXJlKFwibG9kYXNoL3RyYW5zZm9ybVwiKSxcbiAgICAgIHVuaW9uOiByZXF1aXJlKFwibG9kYXNoL3VuaW9uXCIpLFxuICAgICAgdmFsdWVzOiByZXF1aXJlKFwibG9kYXNoL3ZhbHVlc1wiKVxuICAgIH07XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICAvLyBjb250aW51ZSByZWdhcmRsZXNzIG9mIGVycm9yXG4gIH1cbn1cblxuaWYgKCFsb2Rhc2gpIHtcbiAgbG9kYXNoID0gd2luZG93Ll87XG59XG5cbm1vZHVsZS5leHBvcnRzID0gbG9kYXNoO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/lodash.js\n"); /***/ }), /***/ "./node_modules/graphlib/lib/version.js": /*!**********************************************!*\ !*** ./node_modules/graphlib/lib/version.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("module.exports = '2.1.8';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9ncmFwaGxpYi9saWIvdmVyc2lvbi5qcz9jM2NkIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2dyYXBobGliL2xpYi92ZXJzaW9uLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAnMi4xLjgnO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/graphlib/lib/version.js\n"); /***/ }), /***/ "./node_modules/heap/index.js": /*!************************************!*\ !*** ./node_modules/heap/index.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = __webpack_require__(/*! ./lib/heap */ \"./node_modules/heap/lib/heap.js\");\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9oZWFwL2luZGV4LmpzPzE3NWEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsbURBQVkiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvaGVhcC9pbmRleC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9saWIvaGVhcCcpO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/heap/index.js\n"); /***/ }), /***/ "./node_modules/heap/lib/heap.js": /*!***************************************!*\ !*** ./node_modules/heap/lib/heap.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Generated by CoffeeScript 1.8.0\n(function() {\n var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup;\n\n floor = Math.floor, min = Math.min;\n\n\n /*\n Default comparison function to be used\n */\n\n defaultCmp = function(x, y) {\n if (x < y) {\n return -1;\n }\n if (x > y) {\n return 1;\n }\n return 0;\n };\n\n\n /*\n Insert item x in list a, and keep it sorted assuming a is sorted.\n \n If x is already in a, insert it to the right of the rightmost x.\n \n Optional args lo (default 0) and hi (default a.length) bound the slice\n of a to be searched.\n */\n\n insort = function(a, x, lo, hi, cmp) {\n var mid;\n if (lo == null) {\n lo = 0;\n }\n if (cmp == null) {\n cmp = defaultCmp;\n }\n if (lo < 0) {\n throw new Error('lo must be non-negative');\n }\n if (hi == null) {\n hi = a.length;\n }\n while (lo < hi) {\n mid = floor((lo + hi) / 2);\n if (cmp(x, a[mid]) < 0) {\n hi = mid;\n } else {\n lo = mid + 1;\n }\n }\n return ([].splice.apply(a, [lo, lo - lo].concat(x)), x);\n };\n\n\n /*\n Push item onto heap, maintaining the heap invariant.\n */\n\n heappush = function(array, item, cmp) {\n if (cmp == null) {\n cmp = defaultCmp;\n }\n array.push(item);\n return _siftdown(array, 0, array.length - 1, cmp);\n };\n\n\n /*\n Pop the smallest item off the heap, maintaining the heap invariant.\n */\n\n heappop = function(array, cmp) {\n var lastelt, returnitem;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n lastelt = array.pop();\n if (array.length) {\n returnitem = array[0];\n array[0] = lastelt;\n _siftup(array, 0, cmp);\n } else {\n returnitem = lastelt;\n }\n return returnitem;\n };\n\n\n /*\n Pop and return the current smallest value, and add the new item.\n \n This is more efficient than heappop() followed by heappush(), and can be\n more appropriate when using a fixed size heap. Note that the value\n returned may be larger than item! That constrains reasonable use of\n this routine unless written as part of a conditional replacement:\n if item > array[0]\n item = heapreplace(array, item)\n */\n\n heapreplace = function(array, item, cmp) {\n var returnitem;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n returnitem = array[0];\n array[0] = item;\n _siftup(array, 0, cmp);\n return returnitem;\n };\n\n\n /*\n Fast version of a heappush followed by a heappop.\n */\n\n heappushpop = function(array, item, cmp) {\n var _ref;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n if (array.length && cmp(array[0], item) < 0) {\n _ref = [array[0], item], item = _ref[0], array[0] = _ref[1];\n _siftup(array, 0, cmp);\n }\n return item;\n };\n\n\n /*\n Transform list into a heap, in-place, in O(array.length) time.\n */\n\n heapify = function(array, cmp) {\n var i, _i, _j, _len, _ref, _ref1, _results, _results1;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n _ref1 = (function() {\n _results1 = [];\n for (var _j = 0, _ref = floor(array.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--){ _results1.push(_j); }\n return _results1;\n }).apply(this).reverse();\n _results = [];\n for (_i = 0, _len = _ref1.length; _i < _len; _i++) {\n i = _ref1[_i];\n _results.push(_siftup(array, i, cmp));\n }\n return _results;\n };\n\n\n /*\n Update the position of the given item in the heap.\n This function should be called every time the item is being modified.\n */\n\n updateItem = function(array, item, cmp) {\n var pos;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n pos = array.indexOf(item);\n if (pos === -1) {\n return;\n }\n _siftdown(array, 0, pos, cmp);\n return _siftup(array, pos, cmp);\n };\n\n\n /*\n Find the n largest elements in a dataset.\n */\n\n nlargest = function(array, n, cmp) {\n var elem, result, _i, _len, _ref;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n result = array.slice(0, n);\n if (!result.length) {\n return result;\n }\n heapify(result, cmp);\n _ref = array.slice(n);\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n elem = _ref[_i];\n heappushpop(result, elem, cmp);\n }\n return result.sort(cmp).reverse();\n };\n\n\n /*\n Find the n smallest elements in a dataset.\n */\n\n nsmallest = function(array, n, cmp) {\n var elem, i, los, result, _i, _j, _len, _ref, _ref1, _results;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n if (n * 10 <= array.length) {\n result = array.slice(0, n).sort(cmp);\n if (!result.length) {\n return result;\n }\n los = result[result.length - 1];\n _ref = array.slice(n);\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n elem = _ref[_i];\n if (cmp(elem, los) < 0) {\n insort(result, elem, 0, null, cmp);\n result.pop();\n los = result[result.length - 1];\n }\n }\n return result;\n }\n heapify(array, cmp);\n _results = [];\n for (i = _j = 0, _ref1 = min(n, array.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) {\n _results.push(heappop(array, cmp));\n }\n return _results;\n };\n\n _siftdown = function(array, startpos, pos, cmp) {\n var newitem, parent, parentpos;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n newitem = array[pos];\n while (pos > startpos) {\n parentpos = (pos - 1) >> 1;\n parent = array[parentpos];\n if (cmp(newitem, parent) < 0) {\n array[pos] = parent;\n pos = parentpos;\n continue;\n }\n break;\n }\n return array[pos] = newitem;\n };\n\n _siftup = function(array, pos, cmp) {\n var childpos, endpos, newitem, rightpos, startpos;\n if (cmp == null) {\n cmp = defaultCmp;\n }\n endpos = array.length;\n startpos = pos;\n newitem = array[pos];\n childpos = 2 * pos + 1;\n while (childpos < endpos) {\n rightpos = childpos + 1;\n if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) {\n childpos = rightpos;\n }\n array[pos] = array[childpos];\n pos = childpos;\n childpos = 2 * pos + 1;\n }\n array[pos] = newitem;\n return _siftdown(array, startpos, pos, cmp);\n };\n\n Heap = (function() {\n Heap.push = heappush;\n\n Heap.pop = heappop;\n\n Heap.replace = heapreplace;\n\n Heap.pushpop = heappushpop;\n\n Heap.heapify = heapify;\n\n Heap.updateItem = updateItem;\n\n Heap.nlargest = nlargest;\n\n Heap.nsmallest = nsmallest;\n\n function Heap(cmp) {\n this.cmp = cmp != null ? cmp : defaultCmp;\n this.nodes = [];\n }\n\n Heap.prototype.push = function(x) {\n return heappush(this.nodes, x, this.cmp);\n };\n\n Heap.prototype.pop = function() {\n return heappop(this.nodes, this.cmp);\n };\n\n Heap.prototype.peek = function() {\n return this.nodes[0];\n };\n\n Heap.prototype.contains = function(x) {\n return this.nodes.indexOf(x) !== -1;\n };\n\n Heap.prototype.replace = function(x) {\n return heapreplace(this.nodes, x, this.cmp);\n };\n\n Heap.prototype.pushpop = function(x) {\n return heappushpop(this.nodes, x, this.cmp);\n };\n\n Heap.prototype.heapify = function() {\n return heapify(this.nodes, this.cmp);\n };\n\n Heap.prototype.updateItem = function(x) {\n return updateItem(this.nodes, x, this.cmp);\n };\n\n Heap.prototype.clear = function() {\n return this.nodes = [];\n };\n\n Heap.prototype.empty = function() {\n return this.nodes.length === 0;\n };\n\n Heap.prototype.size = function() {\n return this.nodes.length;\n };\n\n Heap.prototype.clone = function() {\n var heap;\n heap = new Heap();\n heap.nodes = this.nodes.slice(0);\n return heap;\n };\n\n Heap.prototype.toArray = function() {\n return this.nodes.slice(0);\n };\n\n Heap.prototype.insert = Heap.prototype.push;\n\n Heap.prototype.top = Heap.prototype.peek;\n\n Heap.prototype.front = Heap.prototype.peek;\n\n Heap.prototype.has = Heap.prototype.contains;\n\n Heap.prototype.copy = Heap.prototype.clone;\n\n return Heap;\n\n })();\n\n (function(root, factory) {\n if (true) {\n return !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n })(this, function() {\n return Heap;\n });\n\n}).call(this);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9oZWFwL2xpYi9oZWFwLmpzPzEyNDgiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOztBQUVBOzs7QUFHQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E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ZWN0Jykge1xuICAgICAgcmV0dXJuIG1vZHVsZS5leHBvcnRzID0gZmFjdG9yeSgpO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gcm9vdC5IZWFwID0gZmFjdG9yeSgpO1xuICAgIH1cbiAgfSkodGhpcywgZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIEhlYXA7XG4gIH0pO1xuXG59KS5jYWxsKHRoaXMpO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/heap/lib/heap.js\n"); /***/ }), /***/ "./node_modules/klayjs/klay.js": /*!*************************************!*\ !*** ./node_modules/klayjs/klay.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** klay.js version 0.4.1 build 201604131004 */\nvar klayregister;\nvar klaycallback;\n(function(){\nvar $wnd, $doc;if(typeof(window) !== 'undefined'){ $wnd = window; $doc = $wnd.document; }\nelse { $wnd = { Array: function(){} }; }\nfunction kI(){}\nfunction iI(){}\nfunction pb(){}\nfunction Ab(){}\nfunction Tt(){}\nfunction Jt(){}\nfunction Jq(){}\nfunction Vq(){}\nfunction Vs(){}\nfunction yl(){}\nfunction Yl(){}\nfunction gm(){}\nfunction Cu(){}\nfunction tJ(){}\nfunction NJ(){}\nfunction PJ(){}\nfunction PS(){}\nfunction sS(){}\nfunction yS(){}\nfunction AS(){}\nfunction MS(){}\nfunction RS(){}\nfunction TS(){}\nfunction lR(){}\nfunction HR(){}\nfunction IR(){}\nfunction KR(){}\nfunction WR(){}\nfunction AT(){}\nfunction FT(){}\nfunction HT(){}\nfunction JT(){}\nfunction LT(){}\nfunction NT(){}\nfunction sU(){}\nfunction uV(){}\nfunction xV(){}\nfunction EV(){}\nfunction HW(){}\nfunction UX(){}\nfunction XX(){}\nfunction ZX(){}\nfunction _X(){}\nfunction bY(){}\nfunction dY(){}\nfunction wY(){}\nfunction zY(){}\nfunction SY(){}\nfunction VY(){}\nfunction qZ(){}\nfunction tZ(){}\nfunction wZ(){}\nfunction AZ(){}\nfunction d$(){}\nfunction g$(){}\nfunction j$(){}\nfunction w$(){}\nfunction z$(){}\nfunction C$(){}\nfunction F$(){}\nfunction I$(){}\nfunction L$(){}\nfunction N$(){}\nfunction R$(){}\nfunction X$(){}\nfunction _$(){}\nfunction k0(){}\nfunction m0(){}\nfunction s0(){}\nfunction w0(){}\nfunction A0(){}\nfunction C0(){}\nfunction E0(){}\nfunction G0(){}\nfunction V0(){}\nfunction Z0(){}\nfunction _0(){}\nfunction _1(){}\nfunction b1(){}\nfunction e1(){}\nfunction k1(){}\nfunction q1(){}\nfunction u1(){}\nfunction R1(){}\nfunction X1(){}\nfunction Z1(){}\nfunction c2(){}\nfunction f2(){}\nfunction h2(){}\nfunction k2(){}\nfunction n2(){}\nfunction q2(){}\nfunction x2(){}\nfunction A2(){}\nfunction H2(){}\nfunction H4(){}\nfunction z4(){}\nfunction B4(){}\nfunction D4(){}\nfunction U4(){}\nfunction i3(){}\nfunction l3(){}\nfunction u3(){}\nfunction C3(){}\nfunction I3(){}\nfunction $5(){}\nfunction d7(){}\nfunction V7(){}\nfunction q8(){}\nfunction smb(){}\nfunction Wbb(){}\nfunction rcb(){}\nfunction Mcb(){}\nfunction Vdb(){}\nfunction hkb(){}\nfunction Kpb(){}\nfunction Spb(){}\nfunction aqb(){}\nfunction iqb(){}\nfunction pqb(){}\nfunction isb(){}\nfunction mvb(){}\nfunction zwb(){}\nfunction yfb(a){}\nfunction sP(a){}\nfunction XW(a){}\nfunction _t(){Wt()}\nfunction lI(){GP()}\nfunction J8(){G8()}\nfunction m8(){k8()}\nfunction CQ(){zQ()}\nfunction CV(){AV()}\nfunction q0(){p0()}\nfunction S0(){J0()}\nfunction y9(){w9()}\nfunction Bab(){zab()}\nfunction Qab(){Hab()}\nfunction cbb(){abb()}\nfunction sbb(){rbb()}\nfunction Ycb(){Xcb()}\nfunction Wfb(){Mfb()}\nfunction ft(){_s(this)}\nfunction uP(){sP(this)}\nfunction GU(){tU(this)}\nfunction ZW(){XW(this)}\nfunction ic(a){this.a=a}\nfunction sc(a){this.a=a}\nfunction $c(a){this.a=a}\nfunction sf(a){this.a=a}\nfunction Qg(a){this.a=a}\nfunction qh(a){this.a=a}\nfunction Vj(a){this.a=a}\nfunction Nk(a){this.a=a}\nfunction km(a){this.a=a}\nfunction dm(a){this.b=a}\nfunction En(a){this.a=a}\nfunction Hn(a){this.a=a}\nfunction Yp(a){this.a=a}\nfunction bq(a){this.a=a}\nfunction eq(a){this.a=a}\nfunction tq(a){this.a=a}\nfunction wq(a){this.a=a}\nfunction ku(a){this.a=a}\nfunction uu(a){this.a=a}\nfunction Gu(a){this.a=a}\nfunction Uu(a){this.a=a}\nfunction WJ(a){this.a=a}\nfunction rP(a){this.a=a}\nfunction $V(a){this.a=a}\nfunction tW(a){this.a=a}\nfunction yW(a){this.e=a}\nfunction fY(a){this.a=a}\nfunction hY(a){this.a=a}\nfunction lY(a){this.a=a}\nfunction nY(a){this.a=a}\nfunction CY(a){this.a=a}\nfunction JY(a){this.a=a}\nfunction SZ(a){this.a=a}\nfunction Z$(a){this.a=a}\nfunction b_(a){this.a=a}\nfunction d_(a){this.a=a}\nfunction f_(a){this.a=a}\nfunction w1(a){this.a=a}\nfunction y1(a){this.a=a}\nfunction E3(a){this.a=a}\nfunction q4(a){this.a=a}\nfunction x4(a){this.a=a}\nfunction F4(a){this.a=a}\nfunction $8(a){this.a=a}\nfunction a9(a){this.a=a}\nfunction l9(a){this.a=a}\nfunction C9(a){this.a=a}\nfunction k9(a){this.c=a}\nfunction wlb(a){this.a=a}\nfunction nxb(a){this.a=a}\nfunction wcb(a){this.a=a}\nfunction tdb(a){this.a=a}\nfunction ydb(a){this.a=a}\nfunction Ddb(a){this.a=a}\nfunction lkb(a){this.a=a}\nfunction klb(a){this.a=a}\nfunction llb(a){this.a=a}\nfunction inb(a){this.a=a}\nfunction wnb(a){this.d=a}\nfunction Snb(a){this.a=a}\nfunction Ynb(a){this.a=a}\nfunction aob(a){this.a=a}\nfunction fob(a){this.a=a}\nfunction Bob(a){this.b=a}\nfunction Gob(a){this.a=a}\nfunction Mob(a){this.a=a}\nfunction Tob(a){this.c=a}\nfunction opb(a){this.a=a}\nfunction Ipb(a){this.a=a}\nfunction rqb(a){this.a=a}\nfunction zqb(a){this.b=a}\nfunction Nqb(a){this.b=a}\nfunction mrb(a){this.c=a}\nfunction Trb(a){this.a=a}\nfunction Xrb(a){this.a=a}\nfunction Fsb(a){this.a=a}\nfunction ju(){this.a=[]}\nfunction ytb(a){this.a=a}\nfunction Lub(a){this.a=a}\nfunction u5(a){a.b=a.a}\nfunction vg(a){a.c=a.d.d}\nfunction sX(a,b){a.g=b}\nfunction bfb(a,b){a.k=b}\nfunction qfb(a,b){a.a=b}\nfunction rfb(a,b){a.b=b}\nfunction qW(a,b){a.e.k=b}\nfunction qu(a){return a.a}\nfunction yu(a){return a.a}\nfunction Mu(a){return a.a}\nfunction $u(a){return a.a}\nfunction rv(a){return a.a}\nfunction jv(){return null}\nfunction Fu(){return null}\nfunction Rh(){this.c=this}\nfunction tkb(){_s(this)}\nfunction ntb(){Ymb(this)}\nfunction b5(a){a5(this,a)}\nfunction GO(a){IO();$O(a)}\nfunction mI(a){a.a=new aJ}\nfunction IZ(a,b){a.a=b-a.a}\nfunction KZ(a,b){a.b=b-a.b}\nfunction Dq(){Dq=iI;new Jq}\nfunction nW(){nW=iI;new HW}\nfunction ni(){throw new Hmb}\nfunction ii(){throw new Hmb}\nfunction ji(){throw new Hmb}\nfunction li(){throw new Hmb}\nfunction mi(){throw new Hmb}\nfunction dd(){throw new Hmb}\nfunction pj(){throw new Hmb}\nfunction Wn(){throw new Hmb}\nfunction $n(){throw new Hmb}\nfunction qT(){this.a=new GU}\nfunction fU(){this.a=new GU}\nfunction cV(){this.a=new GU}\nfunction pV(){this.a=new GU}\nfunction l7(){this.a=new GU}\nfunction k7(){this.a=new d7}\nfunction A7(){this.a=new n7}\nfunction t8(){this.b=new GU}\nfunction jJ(){aJ.call(this)}\nfunction ZN(){UN.call(this)}\nfunction AP(){uP.call(this)}\nfunction DP(){uP.call(this)}\nfunction q7(){GU.call(this)}\nfunction alb(){ft.call(this)}\nfunction rlb(){ft.call(this)}\nfunction nkb(){ft.call(this)}\nfunction qkb(){ft.call(this)}\nfunction tlb(){ft.call(this)}\nfunction Vlb(){ft.call(this)}\nfunction Hmb(){ft.call(this)}\nfunction Wab(){this.f=new GU}\nfunction Ybb(){this.d=new GU}\nfunction jV(){this.a=new vtb}\nfunction vqb(){throw new Hmb}\nfunction wqb(){throw new Hmb}\nfunction xqb(){throw new Hmb}\nfunction yqb(){throw new Hmb}\nfunction Mqb(){throw new Hmb}\nfunction Uvb(){this.a=new GU}\nfunction it(){it=iI;ht=new pb}\nfunction bmb(){bmb=iI;new smb}\nfunction zb(){zb=iI;yb=new Ab}\nfunction Tq(){Tq=iI;Sq=new Vq}\nfunction dr(){dr=iI;cr=new er}\nfunction Gt(){Gt=iI;Ft=new Jt}\nfunction Bu(){Bu=iI;Au=new Cu}\nfunction fR(){fR=iI;eR=new lR}\nfunction VR(){VR=iI;UR=new WR}\nfunction jS(a){dS(a);return a}\nfunction jl(a){Gi();this.a=a}\nfunction vi(a){hi();this.a=a}\nfunction Uk(a){hi();this.a=a}\nfunction Zk(a){hi();this.a=a}\nfunction ds(a,b){a.i=b;b.f=a}\nfunction ycb(a,b){stb(a.b,b)}\nfunction nsb(){ft.call(this)}\nfunction osb(){ft.call(this)}\nfunction nvb(){ft.call(this)}\nfunction Ccb(){Bcb.call(this)}\nfunction Jcb(){Bcb.call(this)}\nfunction pkb(){nkb.call(this)}\nfunction Xlb(){rlb.call(this)}\nfunction gt(a){et.call(this,a)}\nfunction Vd(a){Md.call(this,a)}\nfunction uh(a){Md.call(this,a)}\nfunction Bk(a){Hj.call(this,a)}\nfunction Jk(a){dk.call(this,a)}\nfunction Lm(a){Em.call(this,a)}\nfunction nq(a){vm.call(this,a)}\nfunction ap(a){Ro.call(this,a)}\nfunction ir(a){Hj.call(this,a)}\nfunction Op(a,b){a.a.W().nb(b)}\nfunction emb(a,b){return a===b}\nfunction Zr(a){return !a?0:a.a}\nfunction Rs(a){return !a?0:a.d}\nfunction Ts(a){return !a?0:a.j}\nfunction zu(a){gt.call(this,a)}\nfunction $J(a){gt.call(this,a)}\nfunction _J(a){gt.call(this,a)}\nfunction EQ(a){_J.call(this,a)}\nfunction Tu(){Uu.call(this,{})}\nfunction y5(a){b5.call(this,a)}\nfunction H5(a){b5.call(this,a)}\nfunction WP(a,b,c){XP(a,b.b,c)}\nfunction a7(a,b,c){f6(a.c,b,c)}\nfunction qV(a,b,c){a.b.Fc(b,c)}\nfunction M9(a){$8.call(this,a)}\nfunction P9(a){$8.call(this,a)}\nfunction YY(){this.a=(sK(),qK)}\nfunction cZ(){this.a=(sK(),qK)}\nfunction vtb(){this.a=new ntb}\nfunction Vwb(){this.a=new iwb}\nfunction vT(){vT=iI;uT=new AT}\nfunction AV(){AV=iI;zV=new EV}\nfunction p0(){p0=iI;o0=new s0}\nfunction Ckb(a){xkb();return a}\nfunction Ixb(a){Dxb(a);return a}\nfunction ikb(a){et.call(this,a)}\nfunction okb(a){gt.call(this,a)}\nfunction slb(a){gt.call(this,a)}\nfunction Kb(a){this.c=$v(_b(a))}\nfunction FI(){this.a=0;this.b=0}\nfunction aJ(){OI(this);_I(this)}\nfunction cI(){aI==null&&(aI=[])}\nfunction Vvb(a){a.b=null;a.c=0}\nfunction mS(a,b){a.b=b;return a}\nfunction nS(a,b){a.c=b;return a}\nfunction oS(a,b){a.f=b;return a}\nfunction pS(a,b){a.g=b;return a}\nfunction S7(a,b){a.a=b;return a}\nfunction T7(a,b){a.f=b;return a}\nfunction U7(a,b){a.k=b;return a}\nfunction xc(a,b){return a.e-b.e}\nfunction H3(a,b){return a.d-b.d}\nfunction Klb(a){return a<0?-a:a}\nfunction hlb(a){return isNaN(a)}\nfunction gv(a){return new Gu(a)}\nfunction iv(a){return new lv(a)}\nfunction rkb(a){gt.call(this,a)}\nfunction ulb(a){gt.call(this,a)}\nfunction Ulb(a){gt.call(this,a)}\nfunction Wlb(a){gt.call(this,a)}\nfunction Imb(a){gt.call(this,a)}\nfunction et(a){this.f=a;_s(this)}\nfunction _2(){this.b=0;this.a=0}\nfunction Ws(){Ws=iI;Math.log(2)}\nfunction Ytb(){Ytb=iI;Xtb=$tb()}\nfunction Vtb(c,a,b){c.set(a,b)}\nfunction Wtb(c,a,b){c.set(a,b)}\nfunction Ot(a,b){Nt();Mt.dc(a,b)}\nfunction tv(a,b){return Skb(a,b)}\nfunction zm(a,b){return a.a.B(b)}\nfunction aP(a,b){return a.g[b.e]}\nfunction bP(a,b){return a.i[b.e]}\nfunction cP(a,b){return a.j[b.e]}\nfunction dP(a,b){return a.n[b.e]}\nfunction eP(a,b){return a.o[b.e]}\nfunction Ou(b,a){return a in b.a}\nfunction Tab(a,b){return a.b-b.b}\nfunction ndb(a,b){return a.d-b.d}\nfunction jgb(a,b){return a.i-b.i}\nfunction Nlb(a,b){return a>b?a:b}\nfunction Olb(a,b){return a>b?a:b}\nfunction Plb(a,b){return a>b?a:b}\nfunction Qlb(a,b){return ab?1:0}\nfunction xlb(a,b){return ab?1:0}\nfunction pvb(a){return a!=null?vb(a):0}\nfunction Ntb(a){this.a=aub();this.b=a}\nfunction fub(a){this.a=aub();this.b=a}\nfunction Cg(a){this.a=a;xg.call(this,a)}\nfunction o4(){n4();this.b=new q4(this)}\nfunction Oh(){Oh=iI;Nh=Jb(new Kb(', '))}\nfunction Gh(){Gh=iI;Fh=new Jh;Eh=new Kh}\nfunction Il(){Il=iI;Gl=new Yl;Hl=new gm}\nfunction xp(){xp=iI;vp=new Ap;wp=new Cp}\nfunction qs(){qs=iI;ps=new ts;os=new ws}\nfunction wJ(){wJ=iI;uJ=new NJ;vJ=new PJ}\nfunction Teb(a){a.g=new GU;a.b=new GU}\nfunction OI(a){a.a=new mvb;a.c=new mvb}\nfunction n4(){n4=iI;m4=new U4;l4=new u4}\nfunction Uc(){Mc.call(this,'IS_NULL',2)}\nfunction Kwb(){Gwb.call(this,'Head',1)}\nfunction Pwb(){Gwb.call(this,'Tail',3)}\nfunction pR(a,b){qR.call(this,a,b,null)}\nfunction lpb(a,b){ipb(a,0,a.length,b)}\nfunction x7(a,b){vU(b.a,a.a);return a.a}\nfunction CI(a,b){a.a*=b;a.b*=b;return a}\nfunction gl(a,b){Gi();this.a=a;this.b=b}\nfunction i9(a,b){return a.a[b.d.k][b.k]}\nfunction W9(a,b){return a.a[b.d.k][b.k]}\nfunction xJ(a,b){return kmb(a.b,b.mc())}\nfunction Swb(a,b){return qe(Xvb(a.a,b))}\nfunction Twb(a,b){return qe(Yvb(a.a,b))}\nfunction $T(a,b){return Wv(Dd(a.a,b),20)}\nfunction aw(a,b){return a!=null&&Vv(a,b)}\nfunction Qob(a){return a.a=b){throw new pkb}}\nfunction pl(a,b){_b(a);_b(b);return new Bl(a,b)}\nfunction ul(a,b){_b(a);_b(b);return new El(a,b)}\nfunction nmb(a,b){bmb();return a.lastIndexOf(b)}\nfunction rgb(a,b,c){return a0);return a.a.sb(a.c=--a.b)}\nfunction $f(a){a.b?$f(a.b):a.d.V()&&Wmb(a.f.b,a.e)}\nfunction wg(a){Yf(a.d);if(a.d.d!=a.c){throw new nsb}}\nfunction ksb(a,b){if(b[WAb]!=a[WAb]){throw new nsb}}\nfunction Pl(a,b){Il();_b(a);_b(b);return new tm(a,b)}\nfunction Zq(a,b){Gi();Yq.call(this,a,Yi(new opb(b)))}\nfunction mg(a,b,c,d){this.a=a;_f.call(this,a,b,c,d)}\nfunction GI(a){this.a=Math.cos(a);this.b=Math.sin(a)}\nfunction GQ(a,b,c){_J.call(this,a);this.b=b;this.a=c}\nfunction NR(a){this.b=new GU;this.a=new GU;this.c=a}\nfunction sY(a){this.c=new FI;this.a=new GU;this.b=a}\nfunction tu(){tu=iI;ru=new uu(false);su=new uu(true)}\nfunction o7(a,b){++a.d;return a.c[a.c.length]=b,true}\nfunction $ub(a,b){TI(a.d,b,a.b.b,a.b);++a.a;a.c=null}\nfunction stb(a,b){var c;c=a.a.db(b,a);return c==null}\nfunction cxb(a,b){var c;c=a.slice(0,b);return Cv(c,a)}\nfunction exb(a,b){var c;c=new Array(b);return Cv(c,a)}\nfunction usb(a,b,c){var d;d=a.b[b];a.b[b]=c;return d}\nfunction apb(a,b){var c;for(c=0;c0?new tI(a-1,b):new tI(a,b)}\nfunction Ib(a){_b(a);return aw(a,345)?Wv(a,345):xb(a)}\nfunction Rwb(a,b){return bwb(a.a,b,(xkb(),vkb))==null}\nfunction Po(a,b){var c;c=a.a.Y();$b(b,c);return c-1-b}\nfunction hu(a,b,c){var d;d=gu(a,b);iu(a,b,c);return d}\nfunction Nkb(a,b,c){var d;d=Mkb(a,b);$kb(c,d);return d}\nfunction Mkb(a,b){var c;c=new Kkb;c.i=a;c.d=b;return c}\nfunction Mk(a,b,c){this.a=a;bc(c,b);this.c=b;this.b=c}\nfunction Av(a,b,c){zxb(c==null||sv(a,c));return a[b]=c}\nfunction Pm(a){a.a=null;a.e=null;Ymb(a.b);a.d=0;++a.c}\nfunction Pmb(a){slb.call(this,(bmb(),a==null?Wxb:a))}\nfunction Omb(a){slb.call(this,(bmb(),a==null?Wxb:a))}\nfunction Om(a){var b;return b=a.f,!b?(a.f=new Pp(a)):b}\nfunction Jd(a){var b;return b=a.k,!b?(a.k=new Qg(a)):b}\nfunction Be(a){var b;b=a.e;return !b?(a.e=new Fp(a)):b}\nfunction Vg(a){var b;b=a.e;!b&&(a.e=b=a.gb());return b}\nfunction d6(a){var b,c;b=a.c.f.d;c=a.d.f.d;return b==c}\nfunction Gfb(a,b){var c;c=new Dfb(a);Afb(c,b);return c}\nfunction umb(a,b){a.a+=String.fromCharCode(b);return a}\nfunction hX(a){if(!a.a&&!!a.d){return a.d.b}return a.a}\nfunction _H(a){if(UH(a)){return a|0}return a.l|a.m<<22}\nfunction xo(a){Mh(a,Uyb);return $s(PH(PH(5,a),a/10|0))}\nfunction Smb(a,b){return ew(b)?Tmb(a,b):re(Ktb(a.d,b))}\nfunction tl(a){return aw(a,19)?Wv(a,19).Y():Ul(a.mb())}\nfunction pr(a){return a?new xtb((Oh(),a)):qr(null.mb())}\nfunction Tb(a,b){return gw(a)===gw(b)||a!=null&&rb(a,b)}\nfunction zT(a,b){return vT(),glb(Ixb(Yv(a)),Ixb(Yv(b)))}\nfunction Ep(a){return mp(),Wl(a.a.bb().mb(),(xp(),wp))}\nfunction Gi(){Gi=iI;hi();Fi=new gr((ypb(),ypb(),vpb))}\nfunction kr(){kr=iI;hi();jr=new lr((ypb(),ypb(),xpb))}\nfunction Exb(a,b){if(a==null){throw new Wlb((bmb(),b))}}\nfunction Zfb(a,b){Mfb();return (a-b<=0?0-(a-b):a-b)<0.2}\nfunction U0(a,b){return a.i.b0){return 1}return 0}\nfunction mP(){kP();return Bv(tv(Rz,1),uyb,171,0,[jP,gP,hP])}\nfunction gL(){eL();return Bv(tv(Fz,1),uyb,166,0,[cL,bL,dL])}\nfunction WM(){UM();return Bv(tv(Jz,1),uyb,149,0,[TM,SM,RM])}\nfunction FO(){DO();return Bv(tv(Pz,1),uyb,225,0,[BO,AO,CO])}\nfunction ZZ(){XZ();return Bv(tv(VB,1),uyb,221,0,[VZ,WZ,UZ])}\nfunction A8(){x8();return Bv(tv(_D,1),uyb,173,0,[w8,v8,u8])}\nfunction QH(a,b){return SH(Hv(UH(a)?YH(a):a,UH(b)?YH(b):b))}\nfunction XI(a){return a.b==0?null:(Bxb(a.b!=0),$I(a,a.a.a))}\nfunction zfb(a){a.d=a.d-15;a.b=a.b-15;a.c=a.c+15;a.a=a.a+15}\nfunction Rn(a){this.b=a;this.c=a;a.e=null;a.c=null;this.a=1}\nfunction nZ(a,b,c){this.d=a;this.b=new GU;this.c=b;this.a=c}\nfunction sfb(a,b){qfb(this,new HI(a.a,a.b));rfb(this,Eo(b))}\nfunction Xf(a,b){if(b===a){return true}Yf(a);return a.d.t(b)}\nfunction Oeb(a){if(a==neb||a==keb){return true}return false}\nfunction VO(a){if(!Qob(new Tob(zW(a.e)))){return}OO(a);QO(a)}\nfunction Y2(a,b){var c;c=Wv(vub(a.e,b),116);!!c&&(a.d=true)}\nfunction Lrb(a,b){var c;c=a.b.pb(b);Mrb(c,a.b.Y());return c}\nfunction a6(a){var b;b=e6(a,(sN(),rN));b+=e6(a,ZM);return b}\nfunction f6(a,b,c){j6(a,b,c,(sN(),ZM),a.f);j6(a,b,c,rN,a.n)}\nfunction PX(a,b){!!a.f&&BU(a.f.f,a);a.f=b;!!a.f&&vU(a.f.f,a)}\nfunction rX(a,b){!!a.d&&BU(a.d.a,a);a.d=b;!!a.d&&vU(a.d.a,a)}\nfunction eW(a,b){!!a.d&&BU(a.d.b,a);a.d=b;!!a.d&&vU(a.d.b,a)}\nfunction dW(a,b){!!a.c&&BU(a.c.e,a);a.c=b;!!a.c&&vU(a.c.e,a)}\nfunction Zdb(a){var b;b=Eo(a.b);Ue(b,a.c);Ue(b,a.i);return b}\nfunction Qxb(){if(Lxb==256){Kxb=Mxb;Mxb={};Lxb=0}++Lxb}\nfunction Gbb(){Gbb=iI;Fbb=new Hbb(pzb,0);Ebb=new Hbb(ozb,1)}\nfunction fgb(){fgb=iI;dgb=new ggb(ozb,0);egb=new ggb(pzb,1)}\nfunction hgb(){fgb();return Bv(tv(fF,1),uyb,223,0,[dgb,egb])}\nfunction xab(){vab();return Bv(tv(rE,1),uyb,242,0,[uab,tab])}\nfunction Ibb(){Gbb();return Bv(tv(BE,1),uyb,248,0,[Fbb,Ebb])}\nfunction Nbb(){Lbb();return Bv(tv(CE,1),uyb,247,0,[Jbb,Kbb])}\nfunction ncb(){lcb();return Bv(tv(JE,1),uyb,194,0,[jcb,kcb])}\nfunction Ohb(){Mhb();return Bv(tv(pF,1),uyb,174,0,[Khb,Lhb])}\nfunction Hpb(a){ypb();return aw(a,63)?new csb(a):new Rqb(a)}\nfunction Rm(a){var b;return b=a.g,Wv(!b?(a.g=new En(a)):b,20)}\nfunction Ktb(a,b){return Itb(a,b,Jtb(a,b==null?0:a.b.Vc(b)))}\nfunction tX(a){var b;return b=lX(a),'n_'+(b==null?Dlb(a.k):b)}\nfunction ob(a){return Ikb(tb(a))+'@'+(vb(a)>>>0).toString(16)}\nfunction ykb(a,b){return zkb(Ckb((Dxb(a),a)),Ckb((Dxb(b),b)))}\nfunction Tmb(a,b){return b==null?re(Ktb(a.d,null)):cub(a.e,b)}\nfunction Rr(a,b,c){return new Ur(a.c,pk(a.b,wk(a.d,b,c)),a.a)}\nfunction hw(a){return Math.max(Math.min(a,$xb),-2147483648)|0}\nfunction Ptb(a){this.e=a;this.b=this.e.a.entries();this.a=[]}\nfunction xf(a){this.c=a;this.b=new rnb((new inb(this.c.a)).a)}\nfunction Em(a){this.b=(Il(),Il(),Il(),Gl);this.a=Wv(_b(a),35)}\nfunction EJ(a,b,c){wJ();DJ.call(this,a,b);c!=null&&(this.c=c)}\nfunction cc(a,b,c){if(a<0||bc){throw new okb(Wb(a,b,c))}}\nfunction $b(a,b){if(a<0||a>=b){throw new okb(Ub(a,b))}return a}\nfunction ac(a,b){if(a==null){throw new Wlb((bmb(),b))}return a}\nfunction Dm(a){if(!Cm(a)){throw new nvb}a.c=a.b;return a.b.H()}\nfunction jI(a){function b(){}\n;b.prototype=a||{};return new b}\nfunction rr(a){var b;b=new wtb(op(a.length));zpb(b,a);return b}\nfunction Gub(a){var b;b=a.c.b.b;a.b=b;a.a=a.c.b;b.a=a.c.b.b=a}\nfunction jwb(a){this.b=null;!a&&(a=(hsb(),hsb(),gsb));this.a=a}\nfunction W6(a){this.b=a;this.a=new Fnb(this.b,this.b.c.length)}\nfunction Li(a){Gi();_b(a);return a?Ki(a):Ki(Bo(new Tob(null)))}\nfunction rt(a,b){var c=qt[a.charCodeAt(0)];return c==null?a:c}\nfunction Skb(a,b){var c=a.a=a.a||[];return c[b]||(c[b]=a.Oc(b))}\nfunction CU(a,b,c){var d;Gxb(b,c,a.c.length);d=c-b;hxb(a.c,b,d)}\nfunction Ur(a,b,c){Ch.call(this,b.a);this.c=a;this.b=b;this.a=c}\nfunction ko(a){Vm(a.c);a.e=a.a=a.c;a.c=a.c.c;++a.d;return a.a.f}\nfunction lo(a){Vm(a.e);a.c=a.a=a.e;a.e=a.e.e;--a.d;return a.a.f}\nfunction MX(a){return MI(Bv(tv(qz,1),Fzb,10,0,[a.f.i,a.i,a.a]))}\nfunction GK(){EK();return Bv(tv(Cz,1),uyb,107,0,[DK,AK,BK,CK])}\nfunction PK(){NK();return Bv(tv(Dz,1),uyb,122,0,[MK,KK,JK,LK])}\nfunction ON(){MN();return Bv(tv(Mz,1),uyb,139,0,[KN,LN,JN,IN])}\nfunction FN(){DN();return Bv(tv(Lz,1),uyb,150,0,[BN,CN,AN,zN])}\nfunction Nc(){Lc();return Bv(tv(Bw,1),uyb,136,0,[Ic,Hc,Jc,Kc])}\nfunction iT(){cT();return Bv(tv(yA,1),uyb,201,0,[$S,bT,_S,aT])}\nfunction wN(){sN();return Bv(tv(Kz,1),uyb,32,0,[qN,$M,ZM,pN,rN])}\nfunction xK(){sK();return Bv(tv(Bz,1),uyb,59,0,[qK,pK,oK,nK,rK])}\nfunction c8(){c8=iI;b8=Cc((Z7(),Bv(tv(WD,1),uyb,193,0,[X7,Y7])))}\nfunction _3(){_3=iI;$3=Cc((X3(),Bv(tv(iD,1),uyb,175,0,[V3,W3])))}\nfunction u9(){u9=iI;t9=Cc((p9(),Bv(tv(hE,1),uyb,192,0,[o9,n9])))}\nfunction Jhb(){Hhb();return Bv(tv(oF,1),uyb,140,0,[Fhb,Ghb,Ehb])}\nfunction Jgb(){Hgb();return Bv(tv(jF,1),uyb,218,0,[Fgb,Egb,Ggb])}\nfunction fjb(){djb();return Bv(tv(rF,1),uyb,219,0,[cjb,ajb,bjb])}\nfunction Sjb(){Qjb();return Bv(tv(sF,1),uyb,153,0,[Njb,Pjb,Ojb])}\nfunction ekb(){ckb();return Bv(tv(uF,1),uyb,172,0,[_jb,akb,bkb])}\nfunction Vmb(a,b,c){return b==null?Ltb(a.d,null,c):dub(a.e,b,c)}\nfunction wk(a,b,c){return new sk(a,false,null,(Gh(),Fh),true,b,c)}\nfunction tsb(a,b){return $sb(a.a,b)?usb(a,Wv(b,17).e,null):null}\nfunction ql(a){_b(a);return Ql((Il(),new Im(Dl(ul(a.a,new yl)))))}\nfunction Epb(a){ypb();if(!a){return nqb(),mqb}return new Ipb(a)}\nfunction Oo(a,b){var c,d;d=Qo(a,b);c=a.a.ub(d);return new bp(a,c)}\nfunction Cpb(a,b){var c,d;d=a.Y();for(c=0;cb){throw new okb(Vb(a,b,'index'))}return a}\nfunction Zf(a,b){var c;Yf(a);c=a.d.nb(b);if(c){--a.f.c;$f(a)}return c}\nfunction RT(a,b,c){var d;d=(_b(a),new IU((Oh(),a)));PT(new QT(d,b,c))}\nfunction cmb(a,b){return kmb((bmb(),a.toLowerCase()),b.toLowerCase())}\nfunction rmb(a,b){return kmb((bmb(),a.toLowerCase()),b.toLowerCase())}\nfunction Jwb(){Fwb();return Bv(tv(DH,1),uyb,138,0,[Bwb,Cwb,Dwb,Ewb])}\nfunction bxb(a,b,c,d){Array.prototype.splice.apply(a,[b,c].concat(d))}\nfunction TI(a,b,c,d){var e;e=new mvb;e.c=b;e.b=c;e.a=d;d.b=c.a=e;++a.b}\nfunction Sm(a,b){var c;c=Hpb(Bo(new mo(a,b)));Ml(new mo(a,b));return c}\nfunction Su(d,a,b){if(b){var c=b.gc();d.a[a]=c(b)}else{delete d.a[a]}}\nfunction iu(d,a,b){if(b){var c=b.gc();b=c(b)}else{b=undefined}d.a[a]=b}\nfunction Dfb(a){yfb(this);this.d=a.d;this.c=a.c;this.a=a.a;this.b=a.b}\nfunction n7(){this.g=new q7;this.c=new q7;this.a=new GU;this.k=new GU}\nfunction dR(){this.d=new OQ;this.a=new tV;this.c=new SV;this.b=new CV}\nfunction oR(){this.i=new GU;this.g=new FI;this.n=new xS;this.q=new xS}\nfunction _Y(a,b,c,d){this.e=a;this.b=new GU;this.d=b;this.a=c;this.c=d}\nfunction oT(){oT=iI;lT=new FT;mT=new HT;jT=new JT;kT=new LT;nT=new NT}\nfunction DO(){DO=iI;BO=new EO(ozb,0);AO=new EO(qzb,1);CO=new EO(pzb,2)}\nfunction IK(){IK=iI;HK=Cc((EK(),Bv(tv(Cz,1),uyb,107,0,[DK,AK,BK,CK])))}\nfunction RK(){RK=iI;QK=Cc((NK(),Bv(tv(Dz,1),uyb,122,0,[MK,KK,JK,LK])))}\nfunction QN(){QN=iI;PN=Cc((MN(),Bv(tv(Mz,1),uyb,139,0,[KN,LN,JN,IN])))}\nfunction HN(){HN=iI;GN=Cc((DN(),Bv(tv(Lz,1),uyb,150,0,[BN,CN,AN,zN])))}\nfunction pcb(){pcb=iI;ocb=Cc((lcb(),Bv(tv(JE,1),uyb,194,0,[jcb,kcb])))}\nfunction Qhb(){Qhb=iI;Phb=Cc((Mhb(),Bv(tv(pF,1),uyb,174,0,[Khb,Lhb])))}\nfunction Ao(a){_b(a);return aw(a,19)?new IU((Oh(),Wv(a,19))):Bo(a.mb())}\nfunction yY(a){return Ckb(Ixb(Xv(rJ(a,(Rib(),Vhb)))))&&rJ(a,uib)!=null}\nfunction UY(a){return Ckb(Ixb(Xv(rJ(a,(Rib(),Vhb)))))&&rJ(a,uib)!=null}\nfunction jkb(a,b,c,d){b==null&&(b=Wxb);a.a+=''+(bmb(),b.substr(c,d-c))}\nfunction Mrb(a,b){var c;for(c=0;c>22&azb;d=a<0?bzb:0;return Ev(b,c,d)}\nfunction nbb(){kbb();return Bv(tv(zE,1),uyb,141,0,[jbb,gbb,hbb,fbb,ibb])}\nfunction Sgb(){Pgb();return Bv(tv(kF,1),uyb,115,0,[Lgb,Kgb,Ngb,Mgb,Ogb])}\nfunction Zib(){Xib();return Bv(tv(qF,1),uyb,85,0,[Wib,Sib,Tib,Uib,Vib])}\nfunction zK(){zK=iI;yK=Cc((sK(),Bv(tv(Bz,1),uyb,59,0,[qK,pK,oK,nK,rK])))}\nfunction yN(){yN=iI;xN=Cc((sN(),Bv(tv(Kz,1),uyb,32,0,[qN,$M,ZM,pN,rN])))}\nfunction DM(){DM=iI;CM=Cc((zM(),Bv(tv(Hz,1),uyb,100,0,[yM,xM,uM,vM,wM])))}\nfunction F9(){F9=iI;E9=PQ(UQ(UQ(UQ(TQ(new WQ,(d0(),N_)),U_),r_),B_),M_)}\nfunction TT(a,b){var c,d;for(d=b.mb();d.G();){c=Wv(d.H(),55);ST(a,c,0,0)}}\nfunction VT(a,b,c){var d,e;for(e=a.mb();e.G();){d=Wv(e.H(),55);UT(d,b,c)}}\nfunction X8(a,b,c){var d,e;d=0;for(e=0;eb){throw new okb('Index: '+a+', Size: '+b)}}\nfunction Cxb(a,b){if(a<0||a>=b){throw new okb('Index: '+a+', Size: '+b)}}\nfunction uob(a,b){var c,d;c=b.yb();d=Wvb(a,c);return !!d&&ovb(d.e,b.zb())}\nfunction zbb(a,b){var c;c=a.d;if(b>0){return Wv(yU(c.a,b-1),9)}return null}\nfunction xv(a,b,c,d,e,f){var g;g=yv(e,d);e!=9&&Bv(tv(a,f),b,c,e,g);return g}\nfunction pd(a){var b;if(!od(a)){throw new nvb}a.d=1;b=a.c;a.c=null;return b}\nfunction _f(a,b,c,d){this.f=a;this.e=b;this.d=c;this.b=d;this.c=!d?null:d.d}\nfunction MH(b,c){if(b&&typeof b==Sxb){try{b.__gwt$exception=c}catch(a){}}}\nfunction wT(a,b){if(a.a.$b(b.d,a.b)>0){vU(a.c,new WS(b.c,b.d,a.d));a.b=b.d}}\nfunction W4(a,b){var c;c=glb(a.j,b.j);if(c==0){return glb(a.k,b.k)}return c}\nfunction C6(a){var b,c;c=Wv(yU(a.f,0),7);b=Wv(rJ(c,(Rib(),uib)),7);return b}\nfunction M6(a){var b,c;c=Wv(yU(a.f,0),7);b=Wv(rJ(c,(Rib(),uib)),7);return b}\nfunction B$(a,b){return glb(Ixb(Yv(rJ(a,(Rib(),Cib)))),Ixb(Yv(rJ(b,Cib))))}\nfunction Ujb(){Ujb=iI;Tjb=Cc((Qjb(),Bv(tv(sF,1),uyb,153,0,[Njb,Pjb,Ojb])))}\nfunction gkb(){gkb=iI;fkb=Cc((ckb(),Bv(tv(uF,1),uyb,172,0,[_jb,akb,bkb])))}\nfunction mK(){mK=iI;lK=Cc((iK(),Bv(tv(Az,1),uyb,103,0,[cK,fK,gK,hK,dK,eK])))}\nfunction aL(){aL=iI;_K=Cc((YK(),Bv(tv(Ez,1),uyb,133,0,[WK,UK,XK,SK,VK,TK])))}\nfunction QM(){QM=iI;PM=Cc((KM(),Bv(tv(Iz,1),uyb,28,0,[JM,IM,HM,EM,GM,FM])))}\nfunction k4(){k4=iI;j4=Cc((g4(),Bv(tv(jD,1),uyb,125,0,[e4,b4,f4,d4,c4,a4])))}\nfunction K1(){I1();return Bv(tv(GC,1),uyb,109,0,[G1,B1,E1,C1,D1,A1,F1,H1])}\nfunction qM(){oM();return Bv(tv(Gz,1),uyb,41,0,[gM,fM,iM,nM,mM,lM,jM,kM,hM])}\nfunction Bgb(){zgb();return Bv(tv(iF,1),uyb,123,0,[ygb,xgb,wgb,ugb,tgb,vgb])}\nfunction bhb(){_gb();return Bv(tv(lF,1),uyb,124,0,[Ygb,Xgb,$gb,Wgb,Zgb,Vgb])}\nfunction bK(){bK=iI;aK=new DJ('de.cau.cs.kieler.labels.labelManager',null)}\nfunction ixb(){if(Date.now){return Date.now()}return (new Date).getTime()}\nfunction Xsb(a){var b;b=Wv(cxb(a.b,a.b.length),11);return new atb(a.a,b,a.c)}\nfunction dmb(a,b){var c;c=(bmb(),b.length);return emb(imb(a,a.length-c,c),b)}\nfunction dwb(a,b){var c;c=new zwb;c.c=true;c.d=b.zb();return ewb(a,b.yb(),c)}\nfunction He(a,b){var c;c=b.yb();return mp(),new Fk(c,Kd(a.b,c,Wv(b.zb(),19)))}\nfunction BU(a,b){var c;c=zU(a,b,0);if(c==-1){return false}a.vb(c);return true}\nfunction Cv(a,b){uv(b)!=9&&Bv(tb(b),b._c,b.__elementTypeId$,uv(b),a);return a}\nfunction Rub(a){ksb(a.c.a.c,a);Bxb(a.b!=a.c.a.b);a.a=a.b;a.b=a.b.a;return a.a}\nfunction qnb(a){uxb(!!a.c);ksb(a.e,a);a.c.I();a.c=null;a.b=onb(a);lsb(a.e,a)}\nfunction Acb(a,b,c){a.a=b;a.c=c;a.b.a.Q();_I(a.d);a.e.a.c=xv(UF,syb,1,0,4,1)}\nfunction Ar(a,b,c){Bk.call(this,Fpb(_b(a),_b(b)));this.b=a;this.c=b;this.a=c}\nfunction j9(a,b,c,d){this.b=new l9(this);this.a=a;this.c=b;this.e=c;this.d=d}\nfunction xub(a){$mb.call(this,a,0);pub(this);this.b.b=this.b;this.b.a=this.b}\nfunction ywb(a,b){qob.call(this,a,b);this.a=xv(yH,syb,183,2,0,1);this.b=true}\nfunction Qmb(a,b){return ew(b)?b==null?!!Ktb(a.d,null):bub(a.e,b):!!Ktb(a.d,b)}\nfunction RR(a,b){return Ws(),(a-b>0?a-b:-(a-b))<=$yb||a==b||isNaN(a)&&isNaN(b)}\nfunction Xs(a,b){Ws();return (a-b>0?a-b:-(a-b))<=$yb||a==b||isNaN(a)&&isNaN(b)}\nfunction Z5(a){var b,c;b=true;do{b?(c=W5(a)):(c=U5(a));b=!b}while(c);S5(a,a.d)}\nfunction Ru(a,b,c){var d;if(b==null){throw new Vlb}d=Pu(a,b);Su(a,b,c);return d}\nfunction sJ(a,b,c){!a.n&&(a.n=new ntb);c==null?Wmb(a.n,b):Umb(a.n,b,c);return a}\nfunction zU(a,b,c){for(;c=a.a.c.length){vU(a.a,new aJ)}return Wv(yU(a.a,b),20)}\nfunction Fe(a,b){var c;c=Wv(rp(a.a,b),19);if(!c){return null}return Kd(a.b,b,c)}\nfunction XP(a,b,c){var d;d=Pu(a,Gzb);if(!d){d=new Tu;Ru(a,Gzb,d)}Ru(d.kc(),b,c)}\nfunction Okb(a,b,c,d,e){var f;f=Mkb(a,b);$kb(c,f);f.g=e?8:0;f.f=d;f.e=e;return f}\nfunction mo(a,b){var c;this.f=a;this.b=b;c=Wv(Smb(a.b,b),126);this.c=!c?null:c.b}\nfunction fJ(a,b){var c,d,e;for(d=0,e=b.length;d0&&(d+=dab(b));a.b[c]&&(d+=eab(b));return d}\nfunction vub(a,b){var c;c=Wv(Wmb(a.c,b),176);if(c){Hub(c);return c.e}return null}\nfunction $s(a){if(RH(a,$xb)>0){return $xb}if(RH(a,eyb)<0){return eyb}return _H(a)}\nfunction Ph(a){Oh();Mh(a,'size');return _H(VH(WH(a,8),Nyb)?WH(a,8):Nyb),new Amb}\nfunction ukb(a){skb.call(this,(bmb(),a==null?Wxb:xb(a)),aw(a,46)?Wv(a,46):null)}\nfunction HU(a){tU(this);wxb(a>=0,'Initial capacity must not be negative')}\nfunction JQ(){JQ=iI;HQ=VQ(UQ(UQ(new WQ,(d0(),O_)),C_),J_);IQ=TQ(new WQ,G_)}\nfunction LX(){LX=iI;IX=new UX;GX=new XX;HX=new ZX;FX=new _X;JX=new bY;KX=new dY}\nfunction Fwb(){Fwb=iI;Bwb=new Gwb('All',0);Cwb=new Kwb;Dwb=new Mwb;Ewb=new Pwb}\nfunction x8(){x8=iI;w8=new y8(DAb,0);v8=new y8('LONGEST_PATH',1);u8=new y8(zAb,2)}\nfunction Rv(){Rv=iI;Ov=Ev(azb,azb,524287);Pv=Ev(0,0,524288);Dv(1);Dv(2);Qv=Dv(0)}\nfunction M1(){M1=iI;L1=Cc((I1(),Bv(tv(GC,1),uyb,109,0,[G1,B1,E1,C1,D1,A1,F1,H1])))}\nfunction pbb(){pbb=iI;obb=Cc((kbb(),Bv(tv(zE,1),uyb,141,0,[jbb,gbb,hbb,fbb,ibb])))}\nfunction Ugb(){Ugb=iI;Tgb=Cc((Pgb(),Bv(tv(kF,1),uyb,115,0,[Lgb,Kgb,Ngb,Mgb,Ogb])))}\nfunction _ib(){_ib=iI;$ib=Cc((Xib(),Bv(tv(qF,1),uyb,85,0,[Wib,Sib,Tib,Uib,Vib])))}\nfunction zvb(a){tvb();xvb(this,_H(QH(SH(Lv(UH(a)?YH(a):a,24)),bBb)),_H(QH(a,bBb)))}\nfunction tb(a){return ew(a)?$F:cw(a)?HF:bw(a)?EF:_v(a)?a.$c:zv(a)?a.$c:a.$c||$y}\nfunction uv(a){return a.__elementTypeCategory$==null?9:a.__elementTypeCategory$}\nfunction Ht(a){var b,c;if(a.a){c=null;do{b=a.a;a.a=null;c=Lt(b,c)}while(a.a);a.a=c}}\nfunction It(a){var b,c;if(a.b){c=null;do{b=a.b;a.b=null;c=Lt(b,c)}while(a.b);a.b=c}}\nfunction oJ(a){nJ();var b,c;c=jzb;for(b=0;bc&&(c=a[b])}return c}\nfunction KQ(a,b){var c;c=Wv(Smb(a.b,b),106);if(!c){c=b.rc();Umb(a.b,b,c)}return c}\nfunction rub(a,b){var c;c=Wv(Smb(a.c,b),176);if(c){uub(a,c);return c.e}return null}\nfunction R2(a,b,c,d){var e;e=Wv(rub(a.e,b),116);e.b+=c;e.a+=d;tub(a.e,b,e);a.d=true}\nfunction gtb(a){var b;++a.a;for(b=a.c.a.length;a.a'+a.d.f+'('+a.d+')':'e_'+txb(a)}\nfunction gT(a,b){cT();return a==$S&&b==bT||a==bT&&b==$S||a==aT&&b==_S||a==_S&&b==aT}\nfunction hT(a,b){cT();return a==$S&&b==_S||a==$S&&b==aT||a==bT&&b==aT||a==bT&&b==_S}\nfunction Bhb(){zhb();return Bv(tv(nF,1),uyb,110,0,[shb,whb,thb,xhb,uhb,yhb,vhb,rhb])}\nfunction sM(){sM=iI;rM=Cc((oM(),Bv(tv(Gz,1),uyb,41,0,[gM,fM,iM,nM,mM,lM,jM,kM,hM])))}\nfunction UM(){UM=iI;TM=new VM('OUTSIDE',0);SM=new VM('INSIDE',1);RM=new VM('FIXED',2)}\nfunction Hhb(){Hhb=iI;Fhb=new Ihb(tzb,0);Ghb=new Ihb('TOP',1);Ehb=new Ihb('BOTTOM',2)}\nfunction mxb(){mxb=iI;lxb=new qxb;kxb=new oxb('ISO-LATIN-1');jxb=new oxb('ISO-8859-1')}\nfunction lcb(){lcb=iI;jcb=new mcb('CLASSIC',0);kcb=new mcb('IMPROVE_STRAIGHTNESS',1)}\nfunction kW(){this.e=new FI;this.a=new $W;this.d=new FI;this.b=new GU;this.c=new GU}\nfunction kdb(a,b,c){this.b=b;this.a=a;this.c=c;vU(this.a.e,this);vU(this.b.b,this)}\nfunction Afb(a,b){a.d=Qlb(a.d,b.d);a.c=Nlb(a.c,b.c);a.a=Nlb(a.a,b.a);a.b=Qlb(a.b,b.b)}\nfunction $I(a,b){var c;c=b.c;b.a.b=b.b;b.b.a=b.a;b.a=b.b=null;b.c=null;--a.b;return c}\nfunction Jl(a,b){Il();var c;_b(a);_b(b);c=false;while(b.G()){c=c|a.ib(b.H())}return c}\nfunction pnb(a){var b;ksb(a.e,a);Bxb(a.b);a.c=a.a;b=Wv(a.a.H(),21);a.b=onb(a);return b}\nfunction sm(a){var b;while(a.b.G()){b=a.b.H();if(a.a.D(b)){return b}}return a.d=2,null}\nfunction _sb(a,b){if(!!b&&a.b[b.e]==b){Av(a.b,b.e,null);--a.c;return true}return false}\nfunction TH(a){if(ezb0&&a.c0&&a.e!=0&&qI(a.g,b/a.j*a.g.d)}}\nfunction WV(a){if(a.b.d.f.g==(CX(),xX)){return Wv(rJ(a.b.d.f,(Rib(),uib)),7)}return a.b.d}\nfunction VV(a){if(a.b.c.f.g==(CX(),xX)){return Wv(rJ(a.b.c.f,(Rib(),uib)),7)}return a.b.c}\nfunction od(a){dc(a.d!=3);switch(a.d){case 2:return false;case 0:return true;}return qd(a)}\nfunction CZ(a){switch(a.e){case 2:return sN(),rN;case 4:return sN(),ZM;default:return a;}}\nfunction DZ(a){switch(a.e){case 1:return sN(),pN;case 3:return sN(),$M;default:return a;}}\nfunction Km(a){var b;if(aw(a,90)){b=Wv(a,90);return new Lm(b.a)}else{return Il(),new dm(a)}}\nfunction Fpb(a,b){ypb();var c;c=new otb(1);ew(a)?Vmb(c,a,b):Ltb(c.d,a,b);return new mrb(c)}\nfunction Is(a,b){if(!a.g){return a.e}else{a.g=Is(a.g,b);--a.a;a.j=XH(a.j,b.c);return Gs(a)}}\nfunction Js(a,b){if(!a.e){return a.g}else{a.e=Js(a.e,b);--a.a;a.j=XH(a.j,b.c);return Gs(a)}}\nfunction Ue(a,b){var c,d,e;Dxb(b);c=false;for(e=b.mb();e.G();){d=e.H();c=c|a.ib(d)}return c}\nfunction nr(a){var b,c,d;b=0;for(d=a.mb();d.G();){c=d.H();b+=c!=null?vb(c):0;b=~~b}return b}\nfunction BY(a){var b,c,d,e;for(c=a.a,d=0,e=c.length;d0?1:d<0?-1:0)}\nfunction r5(a,b,c){this.g=a;this.d=b;this.e=c;this.a=new GU;p5(this);ypb();Gpb(this.a,null)}\nfunction Os(a,b){Xb(b>0);this.b=a;this.c=b;this.j=b;this.a=1;this.d=1;this.e=null;this.g=null}\nfunction qcb(a){a.a=null;a.e=null;a.b.c=xv(UF,syb,1,0,4,1);a.f.c=xv(UF,syb,1,0,4,1);a.c=null}\nfunction qhb(){ohb();return Bv(tv(mF,1),uyb,113,0,[fhb,hhb,ihb,jhb,khb,lhb,nhb,ehb,ghb,mhb])}\nfunction uvb(a){return wvb(a,26)*1.4901161193847656E-8+wvb(a,27)*1.1102230246251565E-16}\nfunction Fo(a){return aw(a,87)?Ii(Wv(a,87)):aw(a,88)?Wv(a,88).a:aw(a,63)?new ap(a):new Ro(a)}\nfunction Udb(a){var b;b=Wv(rJ(a,(Rib(),hib)),32);return a.g==(CX(),xX)&&(b==(sN(),rN)||b==ZM)}\nfunction YT(a,b){if(ZT(a,b)){Fd(a.a,Wv(rJ(b,(Rib(),fib)),18),b);return true}else{return false}}\nfunction QQ(a,b){var c;if(b){for(c=0;c<6;c++){Wv(yU(a.a,c),18).jb(Wv(yU(b.a,c),19))}}return a}\nfunction rI(a,b){var c;if(a.b){return null}else{c=oI(a.e,a.f);QI(a.a,c);c.g=a;a.d=b;return c}}\nfunction hJ(a,b){var c,d;for(d=WI(a,0);d.b!=d.d.c;){c=Wv(_ub(d),10);c.a+=b.a;c.b+=b.b}return a}\nfunction J9(a,b){var c,d;for(c=0;c0?!a.g?0:Es(a.g,b,c):a.c}\nfunction rk(a,b){var c,d;if(!a.b){return false}d=a.e;c=a.a.$b(b,d);return c<0|c==0&a.d==(Gh(),Fh)}\nfunction qk(a,b){var c,d;if(!a.c){return false}d=a.g;c=a.a.$b(b,d);return c>0|c==0&a.f==(Gh(),Fh)}\nfunction SH(a){var b;b=a.h;if(b==0){return a.l+a.m*czb}if(b==bzb){return a.l+a.m*czb-dzb}return a}\nfunction MI(a){var b,c,d,e;b=new FI;for(d=0,e=a.length;d=e;f--){a[f+1]=a[f]}a[e]=d}\nfunction kab(a,b,c,d){var e,f;e=jab(a,b,c,d);e<0&&(e=-e-1);for(f=c-1;f>=e;f--){a[f+1]=a[f]}a[e]=d}\nfunction Xe(a,b){var c,d;Dxb(b);for(d=b.mb();d.G();){c=d.H();if(!a.kb(c)){return false}}return true}\nfunction Ll(a,b){Il();var c;_b(b);while(a.G()){c=a.H();if(!Udb(Wv(c,9))){return false}}return true}\nfunction wV(a,b){var c,d,e;c=b.k-a.k;if(c==0){d=a.e.a*a.e.b;e=b.e.a*b.e.b;return glb(d,e)}return c}\nfunction YH(a){var b,c,d,e;e=a;d=0;if(e<0){e+=dzb;d=bzb}c=hw(e/czb);b=hw(e-c*czb);return Ev(b,c,d)}\nfunction n6(a,b){a.c.c=xv(UF,syb,1,0,4,1);o6(a,a.e,b);o6(a,a.a,b);ypb();Gpb(a.c,null);return p6(a)}\nfunction c5(a,b,c){a.g=i5(a,b,(sN(),ZM),a.b);a.d=i5(a,c,ZM,a.b);if(a.g.c==0||a.d.c==0){return}f5(a)}\nfunction d5(a,b,c){a.g=i5(a,b,(sN(),rN),a.j);a.d=i5(a,c,rN,a.j);if(a.g.c==0||a.d.c==0){return}f5(a)}\nfunction pU(a,b,c){return new VN(Qlb(a.a,b.a)-c/2,Qlb(a.b,b.b)-c/2,Jlb(a.a-b.a)+c,Jlb(a.b-b.b)+c)}\nfunction onb(a){if(a.a.G()){return true}if(a.a!=a.d){return false}a.a=new Ptb(a.e.d);return a.a.G()}\nfunction xU(a,b){var c,d;c=b.ob();d=c.length;if(d==0){return false}gxb(a.c,a.c.length,c);return true}\nfunction S5(a,b){var c,d;for(c=0;c0;e--){f=e-1;c=c|Y5(a,b,f,e)}return c}\nfunction V5(a,b){var c,d,e,f;c=false;d=a.d[b].length;for(f=0;f>22);e=a.h+b.h+(d>>22);return Ev(c&azb,d&azb,e&bzb)}\nfunction Mv(a,b){var c,d,e;c=a.l-b.l;d=a.m-b.m+(c>>22);e=a.h-b.h+(d>>22);return Ev(c&azb,d&azb,e&bzb)}\nfunction LI(a,b){var c;for(c=0;c<(bmb(),b.length);c++){if(a==b.charCodeAt(c)){return true}}return false}\nfunction yP(a,b){var c;for(c=0;c<(bmb(),b.length);c++){if(a==b.charCodeAt(c)){return true}}return false}\nfunction rJ(a,b){var c,d;if(a.n){d=Smb(a.n,b);if(d!=null){return d}}c=zJ(b);aw(c,5)&&sJ(a,b,c);return c}\nfunction lJ(a){var b,c,d;b=new jJ;for(d=WI(a,0);d.b!=d.d.c;){c=Wv(_ub(d),10);rn(b,0,new II(c))}return b}\nfunction Q6(a,b,c){var d,e,f,g;g=new U6(b,c);f=0;for(e=T6(g);e.G();){d=Wv(e.H(),7);Umb(a.c,d,Elb(f++))}}\nfunction Fb(a,b,c){_b(b);if(c.G()){vmb(b,a.C(c.H()));while(c.G()){vmb(b,a.c);vmb(b,a.C(c.H()))}}return b}\nfunction g9(a,b,c,d,e){if(d){h9(a,b)}else{d9(a,b,e);e9(a,b,c)}if(b.c.length>1){Gpb(b,a.b);V9(a.c,b)}}\nfunction Bv(a,b,c,d,e){e.$c=a;e._c=b;e.ad=kI;e.__elementTypeId$=c;e.__elementTypeCategory$=d;return e}\nfunction vS(a,b,c){switch(c.e){case 2:a.b=b;break;case 1:a.c=b;break;case 4:a.d=b;break;case 3:a.a=b;}}\nfunction B6(a,b,c){var d,e;e=C6(c).g;d=w6(a,b,e).a;return d-Klb(Wv(Smb(a.c,b),24).a-Wv(Smb(a.c,c),24).a)}\nfunction glb(a,b){if(ab){return 1}if(a==b){return 0}return isNaN(a)?isNaN(b)?0:1:-1}\nfunction Yi(a){switch(a.Y()){case 0:return Fi;case 1:return new Er(a.mb().H());default:return new gr(a);}}\nfunction Nt(){Nt=iI;var a,b;b=!(!!Error.stackTraceLimit||'stack' in new Error);a=new _t;Mt=b?new Tt:a}\nfunction RP(){RP=iI;OP=new DJ('intCoordinates',(xkb(),xkb(),vkb));PP=new CJ('jsonObject');QP=new HI(0,0)}\nfunction XZ(){XZ=iI;VZ=new YZ('MIRROR_X',0);WZ=new YZ('TRANSPOSE',1);UZ=new YZ('MIRROR_AND_TRANSPOSE',2)}\nfunction Hgb(){Hgb=iI;Fgb=new Igb(tzb,0);Egb=new Igb('INCOMING_ONLY',1);Ggb=new Igb('OUTGOING_ONLY',2)}\nfunction Seb(){Ieb();return Bv(tv(_E,1),uyb,60,0,[meb,jeb,ieb,peb,oeb,Heb,Geb,neb,keb,leb,qeb,Eeb,Feb])}\nfunction b3(){b3=iI;var a,b,c,d;a3=new vsb(_E);for(b=Seb(),c=0,d=b.length;c0){return Dvb(b-1,a.a.c.length),AU(a.a,b-1)}else{throw new osb}}\nfunction p2(a){if(a.b.c.length-a.e.c.length<0){QX(a,(sN(),ZM));a.a.a=a.j.a}else{QX(a,(sN(),rN));a.a.a=0}}\nfunction $mb(a,b){wxb(a>=0,'Negative initial capacity');wxb(b>=0,'Non-positive load factor');Ymb(this)}\nfunction rnb(a){var b;this.e=a;this.d=new hub(this.e.e);this.a=this.d;this.b=onb(this);b=a[WAb];this[WAb]=b}\nfunction Kkb(){++Fkb;this.n=null;this.j=null;this.i=null;this.d=null;this.b=null;this.k=null;this.a=null}\nfunction fpb(a){var b,c,d,e;e=1;for(c=0,d=a.length;c=0){e=e.a[1]}else{d=e;e=e.a[0]}}return d}\nfunction Yvb(a,b){var c,d,e;d=null;e=a.b;while(e){c=a.a.$b(b,e.d);if(c<=0){e=e.a[0]}else{d=e;e=e.a[1]}}return d}\nfunction u0(a,b,c,d){var e,f;for(f=a.mb();f.G();){e=Wv(f.H(),33);e.i.a=b.a+(d.a-e.j.a)/2;e.i.b=b.b;b.b+=e.j.b+c}}\nfunction o$(a,b){var c;if(a.c.length==0){return}c=Wv(FU(a,xv(qB,Nzb,9,a.c.length,0,1)),51);lpb(c,new z$);l$(c,b)}\nfunction t$(a,b){var c;if(a.c.length==0){return}c=Wv(FU(a,xv(qB,Nzb,9,a.c.length,0,1)),51);lpb(c,new C$);l$(c,b)}\nfunction _Z(a){var b,c;b=a.g;if(b==(CX(),xX)){c=Wv(rJ(a,(Rib(),hib)),32);return c==(sN(),$M)||c==pN}return false}\nfunction Gc(a,b){var c;Dxb(b);c=a[':'+b];xxb(!!c,'Enum constant undefined: %s',Bv(tv(UF,1),syb,1,4,[b]));return c}\nfunction Zb(a,b,c){if(!a){throw new slb(fc('lowerEndpoint (%s) > upperEndpoint (%s)',Bv(tv(UF,1),syb,1,4,[b,c])))}}\nfunction kv(a){ev();throw new zu(\"Unexpected typeof result '\"+a+\"'; please report this bug to the GWT team\")}\nfunction tN(a){switch(a.e){case 1:return pN;case 2:return rN;case 3:return $M;case 4:return ZM;default:return qN;}}\nfunction vK(a){switch(a.e){case 2:return pK;case 1:return oK;case 4:return nK;case 3:return rK;default:return qK;}}\nfunction Dkb(a){if(a>=48&&a<58){return a-48}if(a>=97&&a<97){return a-97+10}if(a>=65&&a<65){return a-65+10}return -1}\nfunction td(a,b){var c,d;for(d=Ep(Be(a.P()));d.b.G();){c=Wv(zm(d,d.b.H()),19);if(c.kb(b)){return true}}return false}\nfunction js(a){var b;if(!is(a)){throw new nvb}b=new fs(a.c,a.a);a.b=b;a.a.i==a.c.a?(a.a=null):(a.a=a.a.i);return b}\nfunction pp(a,b){mp();var c;if(a===b){return true}else if(aw(b,57)){c=Wv(b,57);return mr(nj(a),c.bb())}return false}\nfunction Gq(a,b,c,d){Dq();Mh(c,'oldCount');Mh(d,'newCount');if(a.Cb(b)==c){a.Gb(b,d);return true}else{return false}}\nfunction Bh(a,b,c,d,e){_b(c);_b(e);return Rr(new Ur(a.c,pk(a.b,new sk(a.d,true,b,c,false,null,(Gh(),Fh))),a.a),d,e)}\nfunction ck(a){hi();switch(a.Y()){case 0:return kr(),jr;case 1:return new Gr(a.mb().H());default:return new lr(a);}}\nfunction PH(a,b){var c;if(UH(a)&&UH(b)){c=a+b;if(ezb=d||bc){break}else e>=b&&++d}return d}\nfunction sn(a,b,c){var d,e,f,g;Dxb(c);g=false;f=WI(a,b);for(e=WI(c,0);e.b!=e.d.c;){d=_ub(e);$ub(f,d);g=true}return g}\nfunction Uf(a,b){var c,d,e;if(b.V()){return false}e=a.Y();c=a.d.jb(b);if(c){d=a.d.Y();a.f.c+=d-e;e==0&&Vf(a)}return c}\nfunction qJ(a,b){var c;if(!b){return a}c=!b.n?(ypb(),ypb(),wpb):b.n;c.V()||(!a.n?(a.n=new ptb(c)):he(a.n,c));return a}\nfunction Gb(b,c,d){var e;try{Fb(b,c,d)}catch(a){a=OH(a);if(aw(a,181)){e=a;throw new ukb(e)}else throw NH(a)}return c}\nfunction Qb(b,c,d){var e;try{Pb(b,c,d)}catch(a){a=OH(a);if(aw(a,181)){e=a;throw new ukb(e)}else throw NH(a)}return c}\nfunction NH(a){var b;if(aw(a,164)){b=Wv(a,164);if(gw(b.b)!==gw((it(),ht))){return gw(b.b)===gw(ht)?null:b.b}}return a}\nfunction SW(a,b){var c;c=Wv(rJ(hX(a),(Rib(),zib)),9);while(c){if(c==b){return true}c=Wv(rJ(hX(c),zib),9)}return false}\nfunction EZ(a){switch(Wv(rJ(a,(Rib(),mib)),140).e){case 1:sJ(a,mib,(Hhb(),Ehb));break;case 2:sJ(a,mib,(Hhb(),Ghb));}}\nfunction Kk(a){hi();switch(a.c){case 0:return kr(),jr;case 1:return new Gr(Sl(new jtb(a)));default:return new Jk(a);}}\nfunction Ti(a){Gi();var b,c;for(b=0,c=a.length;b-129&&a<128){b=a+128;c=(Glb(),Flb)[b];!c&&(c=Flb[b]=new wlb(a));return c}return new wlb(a)}\nfunction R5(a){var b,c;b=Z4(a.b,a.d);c=$xb;while(c>b){S5(a,a.d);if(b==0){c=0;break}W5(a);U5(a);c=b;b=Z4(a.b,a.d)}a.c=c}\nfunction yvb(){tvb();var a,b,c;c=svb+++ixb();a=hw(Math.floor(c*FAb))&bBb;b=hw(c-a*aBb);this.a=a^1502;this.b=b^_Ab}\nfunction vb(a){return ew(a)?Pxb(a):cw(a)?hw((Dxb(a),a)):bw(a)?Ckb((Dxb(a),a))?1231:1237:_v(a)?a.v():zv(a)?txb(a):txb(a)}\nfunction AQ(a,b,c){var d,e,f;e=new jQ;e.d=c;d=UP(e,b);f=new dR;Ckb(Ixb(Xv(rJ(d,yQ))))?YQ(f,d,new sI):BQ(a,f,d);ZP(e,d)}\nfunction E6(a,b,c,d){var e,f,g,h;h=new U6(b,d);g=0;for(f=T6(h);f.G();){e=Wv(f.H(),7);Umb(a.i,e,Elb(g++))}Umb(c,b,Elb(g))}\nfunction c6(a,b){var c,d,e,f,g;c=0;g=0;for(e=0,f=b.length;e=1?pK:nK}return c}\nfunction Cm(a){_b(a.b);if(a.b.G()){return true}while(a.a.G()){_b(a.b=a.Wb(a.a.H()));if(a.b.G()){return true}}return false}\nfunction m7(a){if(a.d!=a.c.d||a.i!=a.g.d){a.a.c=xv(UF,syb,1,0,4,1);xU(a.a,a.c);xU(a.a,a.g);a.d=a.c.d;a.i=a.g.d}return a.a}\nfunction Yf(a){var b;if(a.b){Yf(a.b);if(a.b.d!=a.c){throw new nsb}}else if(a.d.V()){b=Wv(Smb(a.f.b,a.e),19);!!b&&(a.d=b)}}\nfunction H9(a,b,c,d,e){var f,g,h,i;i=Co(a);g9(b,i,d,e,c);f=0;for(h=new Tob(i);h.ab){avb(c);break}}$ub(c,b)}\nfunction dub(a,b,c){var d;d=Utb(a.a,b);Wtb(a.a,b,c===undefined?null:c);if(d===undefined){++a.c;msb(a.b)}else{++a.d}return d}\nfunction qgb(a,b,c){if((b-a<=0?0-(b-a):b-a)uAb?a-c>uAb:c-a>uAb}\nfunction Qgb(a){switch(a.e){case 0:return Kgb;case 1:return Lgb;case 2:return Mgb;case 3:return Ngb;default:return Ogb;}}\nfunction uS(a,b){switch(b.e){case 2:return a.b;case 1:return a.c;case 4:return a.d;case 3:return a.a;default:return false;}}\nfunction vN(a){sN();switch(a.e){case 4:return $M;case 1:return ZM;case 3:return pN;case 2:return rN;default:return qN;}}\nfunction c7(a,b){if(b==a.c){return a.d}else if(b==a.d){return a.c}else{throw new slb('Node '+b+' not part of edge '+a)}}\nfunction zO(a,b){var c;if(Zsb(a.a,b)){return Wv(Zsb(a.a,b)?a.b[b.e]:null,62)}else{c=new ZN;Wsb(a.a,b);usb(a,b.e,c);return c}}\nfunction Zeb(a,b){var c,d,e,f;f=a.g.tb();c=0;while(f.G()){d=Ixb(Yv(f.H()));e=d-b;if(e>RAb){return c}else e>SAb&&++c}return c}\nfunction Usb(a){var b,c,d,e;c=(b=Wv(Hkb((d=a.$c,e=d.f,e==IF?d:e)),11),new atb(b,Wv(exb(b,b.length),11),0));Wsb(c,a);return c}\nfunction yR(a,b){var c,d;for(d=new Tob(b);d.ab&&d.$b(a[f-1],a[f])>0;--f){g=a[f];Av(a,f,a[f-1]);Av(a,f-1,g)}}}\nfunction k3(a){var b,c;if(!MM(Wv(rJ(a,(eM(),TL)),28))){for(c=new Tob(a.f);c.a %s',Bv(tv(UF,1),syb,1,4,[Elb(b),Elb(c)]));d=a.length;c=c=0;c--){a.j=(b=new N5(a.e,a.d,c,1),new b7(c,a.d,b));d=d|O5(a,c)}return d}\nfunction k6(a){this.f=(mp(),new ntb);this.n=new ntb;this.k=new ntb;this.g=new vtb;this.i=new Vr((Tq(),Sq));this.j=a;c6(this,a)}\nfunction vsb(a){var b;this.a=(b=Wv(a.e&&a.e(),11),new atb(b,Wv(exb(b,b.length),11),0));this.b=xv(UF,syb,1,this.a.a.length,4,1)}\nfunction jf(a,b){var c;if(b===a){return true}if(!aw(b,18)){return false}c=Wv(b,18);if(c.Y()!=a.Y()){return false}return a.lb(c)}\nfunction Reb(a){Ieb();switch(a.e){case 1:return meb;case 2:return ieb;case 3:return oeb;case 4:return Geb;default:return Feb;}}\nfunction pgb(a,b){switch(b.e){case 1:return a.e.d;case 2:return a.e.c;case 3:return a.e.a;case 4:return a.e.b;default:return 0;}}\nfunction xO(){uO();return Bv(tv(Oz,1),uyb,67,0,[rO,qO,sO,iO,hO,jO,mO,lO,kO,pO,oO,nO,fO,eO,gO,cO,bO,dO,_N,$N,aO,tO])}\nfunction zM(){zM=iI;yM=new AM(szb,0);xM=new AM('JUSTIFIED',1);uM=new AM('BEGIN',2);vM=new AM(qzb,3);wM=new AM('END',4)}\nfunction DN(){DN=iI;BN=new EN('PORTS',0);CN=new EN('PORT_LABELS',1);AN=new EN('NODE_LABELS',2);zN=new EN('MINIMUM_SIZE',3)}\nfunction kP(){kP=iI;jP=new lP('UNKNOWN',0);gP=new lP('ABOVE',1);hP=new lP('BELOW',2);iP=new DJ('de.cau.cs.kieler.labelSide',jP)}\nfunction Qjb(){Qjb=iI;Njb=new Rjb('EQUALLY_DISTRIBUTED',0);Pjb=new Rjb('NORTH_STACKED',1);Ojb=new Rjb('NORTH_SEQUENCE',2)}\nfunction gI(){fI={};!Array.isArray&&(Array.isArray=function(a){return Object.prototype.toString.call(a)==='[object Array]'})}\nfunction SR(a,b){return Ws(),Ws(),((a-b>0?a-b:-(a-b))<=$yb||a==b||isNaN(a)&&isNaN(b)?0:ab?1:Ys(isNaN(a),isNaN(b)))>0}\nfunction TR(a,b){return Ws(),Ws(),((a-b>0?a-b:-(a-b))<=$yb||a==b||isNaN(a)&&isNaN(b)?0:ab?1:Ys(isNaN(a),isNaN(b)))<0}\nfunction Veb(a){var b,c;a.d||cfb(a);c=new jJ;b=a.b.mb();b.H();while(b.G()){QI(c,Wv(b.H(),92).a)}Bxb(c.b!=0);$I(c,c.c.b);return c}\nfunction $db(a){var b,c,d,e;e=new Wub;b=new IU(a.c);Dpb(b);for(d=new Tob(b);d.ab.f){return 1}else if(a.gb.g){return 1}return a.b-b.b}\nfunction S8(a,b){if(b.c==a){return b.d}else if(b.d==a){return b.c}throw new slb('Input edge is not connected to the input port.')}\nfunction q5(a){var b;if(a.c==0){return}b=Wv(yU(a.a,a.b),128);b.b==1?(++a.b,a.b0.5&&f<50){e=ofb(d);c=$eb(d,e,true);b=Jlb(c.b);++f}return $eb(a,e,false)}\nfunction jfb(a){var b,c,d,e,f;d=gfb(a);b=rAb;f=0;e=0;while(b>0.5&&f<50){e=nfb(d);c=$eb(d,e,true);b=Jlb(c.a);++f}return $eb(a,e,false)}\nfunction QR(a){var b,c,d;this.a=new Wub;this.e=new vtb;this.f=0;for(c=0,d=a.length;c2000){vt=a;wt=$wnd.setTimeout(Et,10)}}if(ut++==0){Ht((Gt(),Ft));return true}return false}\nfunction kS(a){var b,c;for(c=new Tob(a.a.b);c.a0),b.a.sb(b.c=--b.b))}\nfunction a$(a){var b;if(!LM(Wv(rJ(a,(eM(),TL)),28))){return}b=a.c;b$((Cxb(0,b.c.length),Wv(b.c[0],16)));b$(Wv(yU(b,b.c.length-1),16))}\nfunction NV(a,b,c){nI(c,'Compound graph preprocessor',1);a.a=new xk;RV(a,b,null);MV(a,b);sJ(b,(Rib(),bib),a.a);a.a=null;Ymb(a.b);pI(c)}\nfunction P0(a){var b,c;b=Wv(Dm(Uh(iX(a))),12);c=Wv(Dm(Uh(mX(a))),12);return !Ckb(Ixb(Xv(rJ(b,(Rib(),Iib)))))||!Ckb(Ixb(Xv(rJ(c,Iib))))}\nfunction O6(a,b,c){if(b.g==(CX(),AX)&&c.g==zX){a.d=L6(b,(sN(),pN));a.b=L6(b,$M)}if(c.g==AX&&b.g==zX){a.d=L6(c,(sN(),$M));a.b=L6(c,pN)}}\nfunction _8(a,b,c){var d,e,f,g;f=b.g;g=c.g;if(f!=g){return f.e-g.e}else{d=a.a[b.k];e=a.a[c.k];return !d&&!e?0:!d?-1:!e?1:glb(d.a,e.a)}}\nfunction jab(a,b,c,d){var e,f,g,h;f=b;e=c-1;while(f<=e){g=f+e>>>1;h=a[g];if(hd){e=g-1}else{return g}}return -(f+1)}\nfunction Id(a){return aw(a,137)?(ypb(),new dsb(Wv(a,137))):aw(a,18)?(ypb(),new Frb(Wv(a,18))):aw(a,20)?Hpb(Wv(a,20)):(ypb(),new zqb(a))}\nfunction Kd(a,b,c){return aw(c,137)?new Lg(a,b,Wv(c,137)):aw(c,18)?new Kg(a,b,Wv(c,18)):aw(c,20)?Ld(a,b,Wv(c,20),null):new _f(a,b,c,null)}\nfunction tn(b,c){var d;d=b.ub(c);try{return d.H()}catch(a){a=OH(a);if(aw(a,74)){throw new okb(\"Can't get element \"+c)}else throw NH(a)}}\nfunction rp(b,c){mp();_b(b);try{return b.cb(c)}catch(a){a=OH(a);if(aw(a,119)){return null}else if(aw(a,76)){return null}else throw NH(a)}}\nfunction Qu(f,a){var b=f.a;var c;a=String(a);b.hasOwnProperty(a)&&(c=b[a]);var d=(ev(),dv)[typeof c];var e=d?d(c):kv(typeof c);return e}\nfunction kgb(a,b,c,d){if(bb.e){return 1}else if(a.fb.f){return 1}return txb(a)-txb(b)}\nfunction QZ(a){switch(a.e){case 1:return sN(),rN;case 4:return sN(),$M;case 3:return sN(),ZM;case 2:return sN(),pN;default:return sN(),qN;}}\nfunction Ki(a){var b,c;b=cxb(a.c,a.c.length);switch(b.length){case 0:return Fi;case 1:c=new Er(b[0]);return c;default:return new gr(Ti(b));}}\nfunction EY(a){var b,c,d,e;d=xv(ow,syb,64,a.c.length,0,1);e=0;for(c=new Tob(a);c.a=a.b>>1){d=a.c;for(c=a.b;c>b;--c){d=d.b}}else{d=a.a.a;for(c=0;c0&&(e.b+=b);return e}\nfunction eU(a,b){var c,d,e;e=new FI;for(d=a.mb();d.G();){c=Wv(d.H(),55);UT(c,0,e.b);e.b+=c.e.b+b;e.a=Nlb(e.a,c.e.a)}e.a>0&&(e.a+=b);return e}\nfunction tub(a,b,c){var d,e,f;e=Wv(Smb(a.c,b),176);if(!e){d=new Jub(a,b,c);Umb(a.c,b,d);Gub(d);return null}else{f=job(e,c);uub(a,e);return f}}\nfunction y3(a,b){if(!Keb(a.b).kb(b.c)){return false}return Oeb(a.b)?!(rgb(b.d,a.c,a.a)&&rgb(b.a,a.c,a.a)):rgb(b.d,a.c,a.a)&&rgb(b.a,a.c,a.a)}\nfunction s6(a,b){return a.ch6(a.d,q6(b.a,b.b))?-1:a.c==b.c&&q6(a.a,a.b)==q6(a.a,a.b)?0:1}\nfunction L5(a,b,c){if(a.e){switch(a.b){case 1:g5(a.c,b,c);break;case 0:h5(a.c,b,c);}}else{e5(a.c,b,c)}a.a[b.k][c.k]=a.c.i;a.a[c.k][b.k]=a.c.e}\nfunction LW(a,b,c){switch(c.e){case 1:a.a=b.a/2;a.b=0;break;case 2:a.a=b.a;a.b=b.b/2;break;case 3:a.a=b.a/2;a.b=b.b;break;case 4:a.a=0;a.b=b.b/2;}}\nfunction Jeb(a){switch(a.e){case 8:return sN(),$M;case 9:return sN(),pN;case 10:return sN(),ZM;case 11:return sN(),rN;default:return sN(),qN;}}\nfunction Qt(a){var b,c,d;b='Ot';d=Slb(a.length,5);for(c=0;c=c+1&&(a.splice(0,c+1),undefined);break}}return a}\nfunction Vv(a,b){if(ew(a)){return !!Uv[b]}else if(a._c){return !!a._c[b]}else if(cw(a)){return !!Tv[b]}else if(bw(a)){return !!Sv[b]}return false}\nfunction jQ(){RP();this.i=(mp(),new ntb);this.a=new ntb;this.k=new ntb;this.j=new ntb;this.b=new ntb;this.n=new ntb;this.f=new ntb;this.e=new ntb}\nfunction r$(a,b){var c,d;if(b.a.R(a)){return}else{d=Wv(rJ(a,(Rib(),hib)),32);c=Wv(yU(a.f,0),7);d==(sN(),$M)?QX(c,pN):d==pN&&QX(c,$M);b.a.db(a,b)}}\nfunction bbb(a){var b,c;c=Plb(1,Wv(rJ(a,(Rib(),Eib)),24).a);a.c.f.g==(CX(),AX)&&a.d.f.g==AX?(b=1):a.c.f.g==AX||a.d.f.g==AX?(b=2):(b=8);return c*b}\nfunction P1(a){var b,c,d,e,f;f=Wv(rJ(a,(Rib(),uib)),7);b=Wv(FU(a.b,xv(dB,gAb,12,a.b.c.length,0,1)),47);for(d=0,e=b.length;de&&Av(b,e,null);return b}\nfunction npb(a,b){var c,d,e;e=a.a.length;b.lengthe&&Av(b,e,null);return b}\nfunction xb(a){return ew(a)?a:cw(a)?ilb((Dxb(a),a)):bw(a)?Bkb(Ckb((Dxb(a),a))):_v(a)?a.w():zv(a)?ob(a):a.toString?a.toString():'[JavaScriptObject]'}\nfunction A6(a){var b,c,d,e,f;f=0;for(c=a.b,d=0,e=c.length;d0);if((b&-b)==b){return hw(b*wvb(a,31)*4.6566128730773926E-10)}do{c=wvb(a,31);d=c%b}while(c-d+(b-1)<0);return hw(d)}\nfunction zcb(a,b){if(a.c.f==b){return a.d.f}else if(a.d.f==b){return a.c.f}else{throw new slb('Node '+b+' is neither source nor target of edge '+a)}}\nfunction Ekb(a,b,c){vxb(a>=0&&a<=1114111);if(a>=ayb){b[c++]=55296+(a-ayb>>10&1023)&byb;b[c]=56320+(a-ayb&1023)&byb;return 2}else{b[c]=a&byb;return 1}}\nfunction Ol(a,b){Il();var c,d;while(a.G()){if(!b.G()){return false}c=a.H();d=b.H();if(!(gw(c)===gw(d)||c!=null&&rb(c,d))){return false}}return !b.G()}\nfunction JS(a){var b,c,d;Vvb(a.b.a);a.a=xv(kA,syb,25,a.c.b.a.b.c.length,0,1);b=0;for(d=new Tob(a.c.b.a.b);d.af&&Av(b,f,null);return b}\nfunction qX(a,b,c){if(!!c&&(b<0||b>c.a.c.length)){throw new slb('index must be >= 0 and <= layer node count')}!!a.d&&BU(a.d.a,a);a.d=c;!!c&&uU(c.a,b,a)}\nfunction Zvb(a,b,c,d,e,f,g,h){var i,j;if(!d){return}i=d.a[0];!!i&&Zvb(a,b,c,i,e,f,g,h);$vb(a,c,d.d,e,f,g,h)&&b.ib(d);j=d.a[1];!!j&&Zvb(a,b,c,j,e,f,g,h)}\nfunction Gxb(a,b,c){if(a<0){throw new okb(jyb+a+' < 0')}if(b>c){throw new okb('toIndex: '+b+' > size '+c)}if(a>b){throw new slb(jyb+a+' > toIndex: '+b)}}\nfunction ee(a,b){var c,d,e;c=b.yb();e=b.zb();d=a.cb(c);if(!(gw(e)===gw(d)||e!=null&&rb(e,d))){return false}if(d==null&&!a.R(c)){return false}return true}\nfunction h1(a,b,c){var d;d=b.c.f;if(d.g==(CX(),zX)){sJ(a,(Rib(),qib),Wv(rJ(d,qib),7));sJ(a,rib,Wv(rJ(d,rib),7))}else{sJ(a,(Rib(),qib),b.c);sJ(a,rib,c.d)}}\nfunction w2(a,b,c){var d;d=b.c.f;if(d.g==(CX(),zX)){sJ(a,(Rib(),qib),Wv(rJ(d,qib),7));sJ(a,rib,Wv(rJ(d,rib),7))}else{sJ(a,(Rib(),qib),b.c);sJ(a,rib,c.d)}}\nfunction at(a,b,c){var d,e,f,g,h;bt(a);for(e=(a.i==null&&(a.i=xv(_F,Txb,46,0,0,1)),a.i),f=0,g=e.length;f>>28]|b[a>>24&15]<<4|b[a>>20&15]<<8|b[a>>16&15]<<12|b[a>>12&15]<<16|b[a>>8&15]<<20|b[a>>4&15]<<24|b[a&15]<<28}\nfunction ZV(a,b,c){var d,e;if(b.c==(djb(),bjb)&&c.c==ajb){return -1}else if(b.c==ajb&&c.c==bjb){return 1}d=aW(b.a,a.a);e=aW(c.a,a.a);return b.c==bjb?e-d:d-e}\nfunction L7(a){var b,c,d,e,f;e=$xb;f=null;for(d=new Tob(a.d);d.a0||!g&&h==0)){return false}return true}\nfunction Yj(a){hi();var b,c;if(!a.G()){return kr(),jr}c=a.H();if(!a.G()){return new Gr(c)}b=new Wub;stb(b,_b(c));do{stb(b,_b(a.H()))}while(a.G());return ck(b)}\nfunction m6(a,b,c){a.e=b;a.a=c;a.d=n6(a,(sN(),ZM));a.d+=n6(a,rN);j6(a,b,c,ZM,a.f);j6(a,b,c,rN,a.n);a.b=n6(a,ZM);a.b+=n6(a,rN);j6(a,c,b,ZM,a.f);j6(a,c,b,rN,a.n)}\nfunction hmb(a){var b,c,d;c=(bmb(),a.length);d=0;while(dd&&a.charCodeAt(b-1)<=32){--b}return d>0||b>19;j=b.h>>19;if(i!=j){return j-i}e=a.h;h=b.h;if(e!=h){return e-h}d=a.m;g=b.m;if(d!=g){return d-g}c=a.l;f=b.l;return c-f}\nfunction K7(a){var b,c,d,e;for(c=(e=(new Snb(a.p.a)).a.bb().mb(),new Ynb(e));c.a.G();){b=(d=Wv(c.a.H(),21),Wv(d.yb(),89));if(b.e&&a.b[b.b]<0){return b}}return null}\nfunction TN(a,b){var c,d,e,f,g;d=Qlb(a.d,b.d);f=Qlb(a.e,b.e);e=Nlb(a.d+a.c,b.d+b.c);g=Nlb(a.e+a.b,b.e+b.b);if(e=b.length){throw new okb('Greedy SwitchDecider: Free layer layer not in graph.')}this.b=b[a];this.c=new r6(this.b);this.d=new R6(this.b)}\nfunction _n(a,b){var c;this.f=a;this.b=this.f.c;c=a.d;bc(b,c);if(b>=(c/2|0)){this.e=a.e;this.d=c;while(b++0){Yn(this)}}this.a=null}\nfunction qS(a){var b,c,d;for(c=new Tob(a.a.b);c.a0&&(a.g=Ls(a.g));return Ks(a);case 2:Cs(a.e)<0&&(a.e=Ks(a.e));return Ls(a);default:a.d=1+Plb(Rs(a.e),Rs(a.g));return a;}}\nfunction k5(a,b){this.f=(mp(),new ntb);this.b=new ntb;this.j=new ntb;this.a=a;this.c=b;this.c>0&&j5(this,this.c-1,(sN(),ZM));this.c0&&Lr(a,b,c);return 0}e=xv(mw,Yyb,26,1,12,1);d=Ns(f,a.d,b,c,e);Us(a.c,f,d);return e[0]}\nfunction l$(a,b){var c,d,e,f,g;e=Wv(rJ(b,(Rib(),Jib)),15).a*Wv(rJ(b,(Mjb(),qjb)),15).a;g=a[0].i.a+a[0].j.a;for(f=1;f=0;b--){rvb[b]=d;d*=0.5}c=1;for(a=24;a>=0;a--){qvb[a]=c;c*=0.5}}\nfunction f5(a){while(a.g.c!=0&&a.d.c!=0){if(o5(a.g).c>o5(a.d).c){a.i+=a.g.c;q5(a.d)}else if(o5(a.d).c>o5(a.g).c){a.e+=a.d.c;q5(a.g)}else{a.i+=n5(a.g);a.e+=n5(a.d);q5(a.g);q5(a.d)}}}\nfunction TP(a){if(!a){throw new EQ('An element is null. The origin of an edge could not be determined, this might be due to an inconsistency within the internal element mappings.')}}\nfunction UP(a,b){var c,d;Ymb(a.i);Ymb(a.a);Ymb(a.k);Ymb(a.j);Ymb(a.b);Ymb(a.n);Ymb(a.f);Ymb(a.e);if(a.d){d=Pu(a.d,OP.b);!!d&&!!d.ic()&&(a.c=d.ic().a)}c=fQ(a,b,null);bQ(a,b);return c}\nfunction kfb(a){var b,c,d,e,f,g;d=hfb(gfb(a));b=rAb;f=0;e=0;while(b>0.5&&f<50){e=ofb(d);c=$eb(d,e,true);b=Jlb(c.b);++f}g=Yv(tn(Eo(a.g),Eo(a.g).b-1));return $eb(a,(Dxb(g),g)-e,false)}\nfunction lfb(a){var b,c,d,e,f,g;d=hfb(gfb(a));b=rAb;f=0;e=0;while(b>0.5&&f<50){e=nfb(d);c=$eb(d,e,true);b=Jlb(c.a);++f}g=Yv(tn(Eo(a.g),Eo(a.g).b-1));return $eb(a,(Dxb(g),g)-e,false)}\nfunction Ze(a){var b,c,d,e;e=new Bmb('[');b=false;for(d=a.mb();d.G();){c=d.H();b?(e.a+=', ',e):(b=true);ymb(e,c===a?'(this Collection)':(bmb(),c==null?Wxb:xb(c)))}e.a+=']';return e.a}\nfunction ie(a){var b,c,d,e;e=new Bmb('{');b=false;for(d=a.bb().mb();d.G();){c=Wv(d.H(),21);b?(e.a+=', ',e):(b=true);ymb(e,je(a,c.yb()));e.a+='=';ymb(e,je(a,c.zb()))}e.a+='}';return e.a}\nfunction Ks(a){var b;dc(!!a.g);b=a.g;a.g=b.e;b.e=a;b.j=a.j;b.a=a.a;a.a=1+Zr(a.e)+Zr(a.g);a.j=PH(PH(a.c,Ts(a.e)),Ts(a.g));a.d=1+Plb(Rs(a.e),Rs(a.g));b.d=1+Plb(Rs(b.e),Rs(b.g));return b}\nfunction Ls(a){var b;dc(!!a.e);b=a.e;a.e=b.g;b.g=a;b.j=a.j;b.a=a.a;a.a=1+Zr(a.e)+Zr(a.g);a.j=PH(PH(a.c,Ts(a.e)),Ts(a.g));a.d=1+Plb(Rs(a.e),Rs(a.g));b.d=1+Plb(Rs(b.e),Rs(b.g));return b}\nfunction ZO(a){var b;if(!Qob(new Tob(AW(a.e)))){return}b=Wv(oW(a.e,(eM(),TL)),28);b==(KM(),FM)?SO(a.e):b==GM?TO(a.e):Ckb(Ixb(Xv(oW(a.e,AL))))||a.e.e.j.a==0&&a.e.e.j.b==0?UO(a.e):WO(a)}\nfunction s3(a,b,c){var d,e,f;e=new Tob(a);if(e.ah?e:h}}return e}\nfunction sT(a,b){oT();var c;if(a.c==b.c){if(a.b==b.b||gT(a.b,b.b)){c=dT(a.b)?1:-1;if(a.a&&!b.a){return c}else if(!a.a&&b.a){return -c}}return xlb(a.b.e,b.b.e)}else{return glb(a.c,b.c)}}\nfunction nU(a){var b,c;c=xI(MI(Bv(tv(qz,1),Fzb,10,0,[a.f.i,a.i,a.a])));b=a.f.e;switch(a.g.e){case 1:c.b-=b.d;break;case 2:c.a+=b.c;break;case 3:c.b+=b.a;break;case 4:c.a-=b.b;}return c}\nfunction z6(a,b){var c;c=0;if(b.g==(CX(),BX)){if(C6(b).f!=a.a){D6(a,C6(b).f);a.e=true}a.e?++a.g:(c+=a.f)}else if(b.g==zX){a.e?(c+=a.g):++a.f}else if(b.g==AX){D6(a,b);a.e=false}return c}\nfunction HV(a,b,c,d,e){var f,g,h,i;i=null;for(h=new Tob(d);h.a0){f%2>0&&(d+=h[f+1]);f=(f-1)/2|0;++h[f]}}return d}\nfunction aeb(a,b,c){var d,e,f,g;a.e=b;if(c){for(e=(g=(new Snb(a.a.a)).a.bb().mb(),new Ynb(g));e.a.G();){d=(f=Wv(e.a.H(),21),Wv(f.yb(),12));sJ(d,(Rib(),Mib),a.e);QX(d.c,b.a);QX(d.d,b.b)}}}\nfunction g4(){g4=iI;e4=new h4(tzb,0);b4=new h4(ozb,1);f4=new h4(pzb,2);d4=new h4('LEFT_RIGHT_CONSTRAINT_LOCKING',3);c4=new h4('LEFT_RIGHT_CONNECTION_LOCKING',4);a4=new h4('EDGE_LENGTH',5)}\nfunction N5(a,b,c,d){var e;this.b=d;this.e=a.a;e=b[c];this.d=vv(KH,[Txb,xAb],[227,26],13,[e.length,e.length],2);this.a=vv(mw,[Txb,Yyb],[52,26],12,[e.length,e.length],2);this.c=new k5(b,c)}\nfunction fwb(a,b,c,d){var e,f;f=b;e=f.d==null||a.a.$b(c.d,f.d)>0?1:0;while(f.a[e]!=c){f=f.a[e];e=a.a.$b(c.d,f.d)>0?1:0}f.a[e]=d;d.b=c.b;d.a[0]=c.a[0];d.a[1]=c.a[1];c.a[0]=null;c.a[1]=null}\nfunction ZQ(a,b,c){var d,e,f,g;nI(c,Tzb,1);NQ(a.d,b);g=sV(a.a,b);if(g.Y()==1){_Q(Wv(g.sb(0),55),c)}else{f=1/g.Y();for(e=g.mb();e.G();){d=Wv(e.H(),55);_Q(d,rI(c,f))}}qV(a.a,g,b);bR(b);pI(c)}\nfunction o6(a,b,c){var d,e,f,g,h;h=new U6(b,c);for(g=T6(h);g.G();){f=Wv(g.H(),7);for(e=Uh(Sh((Gi(),new gr(Ti(Bv(tv(UF,1),syb,1,4,[f.b,f.e]))))));Cm(e);){d=Wv(Dm(e),12);bW(d)||l6(a,b,f,d)}}}\nfunction _6(a,b){var c,d,e;e=nX(a,b);for(d=e.mb();d.G();){c=Wv(d.H(),7);if(rJ(c,(Rib(),Bib))!=null||Cm(Uh(Sh((Gi(),new gr(Ti(Bv(tv(UF,1),syb,1,4,[c.b,c.e])))))))){return true}}return false}\nfunction Efb(a){var b,c;if(sl(a)){throw new slb(TAb)}for(c=WI(a,0);c.b!=c.d.c;){b=Wv(_ub(c),10);this.d=Qlb(this.d,b.b);this.c=Nlb(this.c,b.a);this.a=Nlb(this.a,b.b);this.b=Qlb(this.b,b.a)}}\nfunction wI(a,b,c){if(b<0||c<0){throw new slb('The highx must be bigger then lowx and the highy must be bigger then lowy')}a.a<0?(a.a=0):a.a>b&&(a.a=b);a.b<0?(a.b=0):a.b>c&&(a.b=c);return a}\nfunction nX(a,b){switch(b.e){case 1:return pl(a.f,(LX(),HX));case 2:return pl(a.f,(LX(),FX));case 3:return pl(a.f,(LX(),JX));case 4:return pl(a.f,(LX(),KX));default:return ypb(),ypb(),vpb;}}\nfunction K0(a){var b,c,d,e;for(e=(Il(),new Im(Dl(ul(a.a,new yl))));Cm(e);){d=Wv(Dm(e),9);d.g==(CX(),yX)&&sJ(d,(Rib(),pib),(kP(),hP));for(c=Uh(mX(d));Cm(c);){b=Wv(Dm(c),12);M0(b,(kP(),hP))}}}\nfunction L0(a){var b,c,d,e;for(e=(Il(),new Im(Dl(ul(a.a,new yl))));Cm(e);){d=Wv(Dm(e),9);d.g==(CX(),yX)&&sJ(d,(Rib(),pib),(kP(),gP));for(c=Uh(mX(d));Cm(c);){b=Wv(Dm(c),12);M0(b,(kP(),gP))}}}\nfunction cdb(a,b){this.b=new vtb;switch(a){case 0:this.d=new Ddb(this);break;case 1:this.d=new tdb(this);break;case 2:this.d=new ydb(this);break;default:throw new rlb;}this.c=b;this.a=0.2*b}\nfunction uW(a){var b,c,d,e;if(!a.b){a.b=new GU;for(c=new Tob(a.a.c);c.a=ayb){b=55296+(a-ayb>>10&1023)&byb;c=56320+(a-ayb&1023)&byb;return String.fromCharCode(b)+(''+String.fromCharCode(c))}else{return String.fromCharCode(a&byb)}}\nfunction KV(a,b,c,d){var e,f,g;e=hX(c);f=PW(e);g=new RX;PX(g,c);switch(d.e){case 1:QX(g,tN(vN(f)));break;case 2:QX(g,vN(f));}sJ(g,(Rib(),tib),Wv(rJ(b,tib),15));sJ(b,uib,g);Umb(a.b,g,b);return g}\nfunction l6(a,b,c,d){var e;vU(a.c,new t6(a,c,d,Wv(Smb(a.k,c),24).a));if(d6(d)&&(b==a.e?d.d.f!=a.a&&d.c.f!=a.a:d.d.f!=a.e&&d.c.f!=a.e)){e=c==d.c?d.d:d.c;vU(a.c,new t6(a,e,d,Wv(Smb(a.k,e),24).a))}}\nfunction fe(a,b){var c,d,e;if(b===a){return true}if(!aw(b,57)){return false}e=Wv(b,57);if(a.Y()!=e.Y()){return false}for(d=e.bb().mb();d.G();){c=Wv(d.H(),21);if(!a._(c)){return false}}return true}\nfunction $Z(a,b){var c,d,e;d=new uX(a);qJ(d,b);sJ(d,(Rib(),gib),b);sJ(d,(eM(),TL),(KM(),FM));sJ(d,lL,(iK(),eK));sX(d,(CX(),xX));c=new RX;PX(c,d);QX(c,(sN(),rN));e=new RX;PX(e,d);QX(e,ZM);return d}\nfunction O7(a,b){var c,d,e;e=$xb;for(d=new Tob(m7(b));d.ae?f:e}return f}\nfunction M7(a){var b,c,d,e,f;f=$xb;e=$xb;for(d=new Tob(m7(a));d.a0&&l8(a,f,c))}}b.k=0}\nfunction Bfb(a,b){yfb(this);if(0>b){throw new slb('Top must be smaller or equal to bottom.')}else if(0>a){throw new slb('Left must be smaller or equal to right.')}this.d=0;this.c=a;this.a=b;this.b=0}\nfunction Ffb(a){var b,c,d;yfb(this);if(a.length==0){throw new slb(TAb)}for(c=0,d=a.length;cc){return Vb(a,c,'start index')}if(b<0||b>c){return Vb(b,c,'end index')}return fc('end index (%s) must not be less than start index (%s)',Bv(tv(UF,1),syb,1,4,[Elb(b),Elb(a)]))}\nfunction SP(a){if(!('id' in a.a)){throw new FQ(\"Every graph element must specify an 'id' property.\",a)}if(!Pu(a,'id').lc()){throw new FQ(\"Invalid format for 'id'. Must be a string, was \"+Pu(a,'id').$c,a)}}\nfunction f3(a,b){var c,d,e,f,g,h,i;i=a.b;for(d=Wv(qsb(a3,a),20).mb();d.G();){c=Wv(d.H(),75);for(h=(f=(new Snb(c.c.a)).a.bb().mb(),new Ynb(f));h.a.G();){g=(e=Wv(h.a.H(),21),Wv(e.yb(),7));Anb(b,g);J2(g,i)}}}\nfunction _db(a,b){var c,d,e;for(e=new Tob(b.e);e.a1){throw new slb('In straight hyperEdges there may be only one edge.')}QI((e=(new Snb(c.a)).a.bb().mb(),d=Wv((new Ynb(e)).a.H(),21),Wv(d.yb(),12)).a,new HI(b,a.b))}\nfunction no(a,b,c){var d,e;this.f=a;d=Wv(Smb(a.b,b),126);e=!d?0:d.a;bc(c,e);if(c>=(e/2|0)){this.e=!d?null:d.c;this.d=e;while(c++0){ko(this)}}this.b=b;this.a=null}\nfunction HP(a,b){if(typeof klaycallback===Zxb){klaycallback(b)}else{typeof document!==Czb?Rxb(a(b)):typeof module===Sxb&&module.exports&&Rxb(a(b));typeof document===Czb&&typeof self!==Czb&&self.postMessage(b)}}\nfunction _P(a,b){var c,d,e,f;if('x' in a.a){e=Wv(Pu(a,'x'),104);b.i.a=e.a}if('y' in a.a){f=Wv(Pu(a,'y'),104);b.i.b=f.a}if(Jzb in a.a){d=Wv(Pu(a,Jzb),104);b.j.a=d.a}if(Kzb in a.a){c=Wv(Pu(a,Kzb),104);b.j.b=c.a}}\nfunction lgb(a,b,c){var d,e;igb(this);b==(fgb(),dgb)?stb(this.g,a.c):stb(this.o,a.c);c==dgb?stb(this.g,a.d):stb(this.o,a.d);stb(this.c,a);d=MX(a.c).b;e=MX(a.d).b;kgb(this,d,e,e);this.f=Zfb(MX(a.c).b,MX(a.d).b)}\nfunction p5(a){var b,c,d,e,f,g;g=new U6(a.d,a.e);for(f=T6(g);f.G();){e=Wv(f.H(),7);d=a.e==(sN(),rN)?e.b:e.e;for(c=new Tob(d);c.a>1);jpb(b,a,i,j,-e,f);jpb(b,a,j,h,-e,f);if(f.$b(a[j-1],a[j])<=0){while(ch?d:h}}return d-e}\nfunction DQ(a){var b;b=new Tu;Ru(b,'type',new lv((Gkb($z),$z.n)));Ru(b,Dzb,new lv(a.f));!!a.b&&Ru(b,'value',a.b);!!a.a&&Ru(b,'context',a.a);Ru(b,Ezb,new lv(Hb(new Kb('\\n'),new wnb(new opb((a.g==null&&(a.g=Pt(a)),a.g))))));return b}\nfunction D5(a,b){if(a.cb.c){return 1}else if(a.bb.b){return 1}else if(a.a!=b.a){return a.a.b-b.a.b}else if(a.d==0&&b.d==1){return -1}else if(a.d==1&&b.d==0){return 1}return 0}\nfunction cn(a,b){var c,d,e,f,g;if(b===a){return true}if(!aw(b,20)){return false}g=Wv(b,20);if(a.Y()!=g.Y()){return false}f=g.mb();for(d=a.mb();d.G();){c=d.H();e=f.H();if(!(gw(c)===gw(e)||c!=null&&rb(c,e))){return false}}return true}\nfunction st(b){var c=(!qt&&(qt=tt()),qt);var d=b.replace(/[\\x00-\\x1f\\xad\\u0600-\\u0603\\u06dd\\u070f\\u17b4\\u17b5\\u200b-\\u200f\\u2028-\\u202e\\u2060-\\u2064\\u206a-\\u206f\\ufeff\\ufff9-\\ufffb\"\\\\]/g,function(a){return rt(a,c)});return '\"'+d+'\"'}\nfunction ER(a,b){var c,d,e,f,g,h,i;e=b==1?wR:vR;for(d=(g=(new Snb(e.a)).a.bb().mb(),new Ynb(g));d.a.G();){c=(f=Wv(d.a.H(),21),Wv(f.yb(),59));for(i=Wv(Dd(a.f.c,c),18).mb();i.G();){h=Wv(i.H(),27);BU(a.b.b,h.b);BU(a.b.a,Wv(h.b,25).f)}}}\nfunction aR(a,b,c){var d,e,f,g;nI(c,'Recursive layout',2);if(b.b.c.length!=0){g=1/b.b.c.length;for(f=new Tob(b.b);f.a=2147483648&&(d-=4294967296);return d}}\nfunction MW(a,b,c){var d,e,f;if(b==c){return}d=b;do{vI(a,d.d);f=Wv(rJ(d,(Rib(),zib)),9);if(f){e=d.a;uI(a,e.b,e.d);vI(a,f.i);d=hX(f)}}while(f);d=c;do{EI(a,d.d);f=Wv(rJ(d,(Rib(),zib)),9);if(f){e=d.a;DI(a,e.b,e.d);EI(a,f.i);d=hX(f)}}while(f)}\nfunction n3(a,b){var c,d,e,f,g,h;c=new GU;h=new Um;for(e=(g=(new Snb(a.a)).a.bb().mb(),new Ynb(g));e.a.G();){d=(f=Wv(e.a.H(),21),Wv(f.yb(),12));Nm(h,d.c,d,null);Nm(h,d.d,d,null)}while(h.a){vU(c,m3(h,b,LM(Wv(rJ(b,(eM(),TL)),28))))}return c}\nfunction B7(a,b){var c,d,e,f,g;for(f=new Tob(a.e.a);f.a0&&e0}else if(e<0&&-e0}return false}\nfunction Odb(a,b,c,d,e){var f,g;if(!yI(MI(Bv(tv(qz,1),Fzb,10,0,[e.f.i,e.i,e.a])),c)){b.c==e?rn(b.a,0,new II(c)):QI(b.a,new II(c));if(d&&!ttb(a.a,c)){g=Wv(rJ(b,(eM(),CL)),44);if(!g){g=new jJ;sJ(b,CL,g)}f=new II(c);TI(g,f,g.c.b,g.c);stb(a.a,f)}}}\nfunction Pdb(a){var b,c,d,e,f,g,h;b=0;for(d=new Tob(a.a);d.a(h-g<=0?0-(h-g):h-g)?b:h-g<=0?0-(h-g):h-g}}}return b}\nfunction yo(a,b){var c,d,e;if(gw(b)===gw(_b(a))){return true}if(!aw(b,20)){return false}d=Wv(b,20);e=a.Y();if(e!=d.Y()){return false}if(aw(d,63)){for(c=0;c=0){return e}else{f=1;for(h=new Tob(b.f);h.ai+1?f:i+1}}}H8(a,b,f);return f}}\nfunction edb(a,b,c){var d,e,f,g,h,i;d=0;if(a.b!=0&&b.b!=0){f=WI(a,0);g=WI(b,0);h=Ixb(Yv(_ub(f)));i=Ixb(Yv(_ub(g)));e=true;do{h>i-c&&h>b;f=a.m>>b|c<<22-b;e=a.l>>b|a.m<<22-b}else if(b<44){g=d?bzb:0;f=c>>b-22;e=a.m>>b-22|c<<44-b}else{g=d?bzb:0;f=d?azb:0;e=c>>b-44}return Ev(e&azb,f&azb,g&bzb)}\nfunction O9(a,b){switch(a.e){case 1:switch(b.e){case 1:return 1;case 4:return 2;case 3:return 3;case 2:return 4;}break;case 2:switch(b.e){case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;}break;default:throw new slb(GAb);}return 0}\nfunction hZ(a,b,c){var d,e,f,g,h,i;d=new GU;d.c[d.c.length]=b;i=b;h=0;do{i=mZ(a,i);!!i&&(d.c[d.c.length]=i,true);++h}while(i);g=(c-(d.c.length-1)*a.d.d)/d.c.length;for(f=new Tob(d);f.a=a.g.d){b=a.f;b.e=Is(a.e,b);b.g=a.g;b.a=a.a-1;b.j=XH(a.j,c);return Gs(b)}else{b=a.i;b.g=Js(a.g,b);b.e=a.e;b.a=a.a-1;b.j=XH(a.j,c);return Gs(b)}}\nfunction e2(a){var b,c,d,e,f,g;for(e=new Tob(a.a);e.af.k?QX(g,pN):g.g==pN&&f.k>d.k&&QX(g,$M)}}}\nfunction q3(a,b,c){var d,e,f,g,h,i,j;j=a.b;g=0;for(f=new Tob(a.a.b);f.a0?e+a.i[1]*b+a.n[1]:0,a.o[3]>0?e+a.i[3]*b+a.n[3]:0);f=Nlb(a.o[4]>0?c+a.i[4]*b+a.n[4]:0,a.o[2]>0?c+a.i[2]*b+a.n[2]:0);return new HI(g,f)}\nfunction b$(a){var b,c,d,e,f,g;g=Wv(FU(a.a,xv(qB,Nzb,9,a.a.c.length,0,1)),51);lpb(g,new g$);c=null;for(e=0,f=g.length;e0){return Mr(a,b,c.g)}else if(d==0){switch(a.b.f.e){case 0:return PH(b._b(c),b.ac(c.g));case 1:return b.ac(c.g);default:throw new tkb;}}else{return PH(PH(b.ac(c.g),b._b(c)),Mr(a,b,c.e))}}\nfunction Nr(a,b,c){var d;if(!c){return 0}d=a.d.$b(a.b.e,c.b);if(d<0){return Nr(a,b,c.e)}else if(d==0){switch(a.b.d.e){case 0:return PH(b._b(c),b.ac(c.e));case 1:return b.ac(c.e);default:throw new tkb;}}else{return PH(PH(b.ac(c.e),b._b(c)),Nr(a,b,c.g))}}\nfunction z2(a,b,c,d){var e,f,g,h;g=new uX(a);sX(g,(CX(),zX));sJ(g,(Rib(),uib),b);sJ(g,(eM(),TL),(KM(),FM));sJ(g,qib,c);sJ(g,rib,d);f=new RX;QX(f,(sN(),rN));PX(f,g);h=new RX;QX(h,ZM);PX(h,g);eW(b,f);e=new hW;qJ(e,b);sJ(e,CL,null);dW(e,h);eW(e,d);return g}\nfunction e6(a,b){var c,d,e,f,g,h,i,j,k,l;c=0;for(g=a.j,h=0,i=g.length;hb.c){return 1}else if(a.bb.b){return 1}else if(a.a!=b.a){return txb(a.a)-txb(b.a)}else if(a.d==(vab(),uab)&&b.d==tab){return -1}else if(a.d==tab&&b.d==uab){return 1}return 0}\nfunction R4(a){var b,c,d,e,f,g;e=new aJ;for(d=new Tob(a.d.a);d.a1){b=x7(y7(new A7,a.b++),a.d);for(g=WI(e,0);g.b!=g.d.c;){f=Wv(_ub(g),61);f7(i7(h7(j7(g7(new k7,1),0),b),f))}}}\nfunction p3(a,b,c,d){var e,f,g,h,i,j;j=0;for(g=new Tob(a.a.b);g.ac.a&&(f=Plb(f,g.a-c.a-1))}return f}\nfunction RZ(a){var b,c;b=Wv(rJ(a,(eM(),HL)),15).a;c=Wv(rJ(a,IL),15).a;sJ(a,IL,new llb(b));sJ(a,HL,new llb(c));switch(Wv(rJ(a,lL),103).e){case 1:sJ(a,lL,(iK(),hK));break;case 2:sJ(a,lL,(iK(),dK));break;case 3:sJ(a,lL,(iK(),fK));break;case 4:sJ(a,lL,(iK(),gK));}}\nfunction N0(a){var b,c,d,e,f;for(e=(Il(),new Im(Dl(ul(a.a,new yl))));Cm(e);){d=Wv(Dm(e),9);if(d.g==(CX(),yX)){f=P0(d)?(kP(),hP):(kP(),gP);sJ(d,(Rib(),pib),f)}for(c=Uh(mX(d));Cm(c);){b=Wv(Dm(c),12);f=Ckb(Ixb(Xv(rJ(b,(Rib(),Iib)))))?(kP(),gP):(kP(),hP);M0(b,f)}}}\nfunction O0(a){var b,c,d,e,f;for(e=(Il(),new Im(Dl(ul(a.a,new yl))));Cm(e);){d=Wv(Dm(e),9);if(d.g==(CX(),yX)){f=P0(d)?(kP(),gP):(kP(),hP);sJ(d,(Rib(),pib),f)}for(c=Uh(mX(d));Cm(c);){b=Wv(Dm(c),12);f=Ckb(Ixb(Xv(rJ(b,(Rib(),Iib)))))?(kP(),hP):(kP(),gP);M0(b,f)}}}\nfunction jdb(a,b,c){var d,e,f;for(f=new Tob(a.e);f.a0){d.b.c-=d.c;d.b.c<=0&&d.b.f>0&&QI(b,d.b)}}for(e=new Tob(a.b);e.a0){d.a.f-=d.c;d.a.f<=0&&d.a.c>0&&QI(c,d.a)}}}\nfunction agb(a,b,c){var d,e,f;for(f=new Tob(a.j);f.a0){d.b.e-=d.c;d.b.e<=0&&d.b.k>0&&QI(b,d.b)}}for(e=new Tob(a.d);e.a0){d.a.k-=d.c;d.a.k<=0&&d.a.e>0&&QI(c,d.a)}}}\nfunction tj(a){var b,c,d,e,f;f=a.d.c+a.e.c;switch(f){case 0:return dr(),cr;case 1:d=Wv(Sl(new rnb((new inb(a)).a)),21);return Bj(d.yb(),d.zb());default:e=(mp(),new wub);for(c=new rnb((new inb(a)).a);c.b;){b=pnb(c);tub(e,_b(b.yb()),_b(b.zb()))}return new ir(e);}}\nfunction DS(a,b,c){var d,e,f;for(e=new Tob(a.b.a.b);e.a0){!(tK(a.b.d)&&d.q.d)&&!(uK(a.b.d)&&d.q.b)&&(d.j.e+=0>f/2-0.5?0:f/2-0.5);!(tK(a.b.d)&&d.q.a)&&!(uK(a.b.d)&&d.q.c)&&(d.j.b-=f-1)}}}\nfunction R9(a,b){switch(a.e){case 1:switch(b.e){case 1:return HAb;case 4:return 0.5;case 3:return IAb;case 2:return JAb;}break;case 2:switch(b.e){case 1:return HAb;case 2:return 0.5;case 3:return IAb;case 4:return JAb;}break;default:throw new slb(GAb);}return 0}\nfunction rT(a,b){var c,d,e,f;f=new Fnb(a,0);c=(Bxb(f.b0);f.a.sb(f.c=--f.b);Anb(f,e);Bxb(f.b1){++f;++g}}if(!LM(Wv(rJ(c,(eM(),TL)),28))&&h){++f;++g}Umb(e,c,Elb(f));return g}\nfunction nfb(a){var b,c,d,e,f,g,h,i,j,k,l,m;g=a.b.mb();h=Wv(g.H(),92);k=h.a.a;j=k>RAb;i=kRAb;i=kRAb;i=kRAb;i=k0;Sr(a.i,Elb(h6(a,b.d)),1)>0;utb(a.g,b);d+=g6(a,b,a.i)}else{stb(a.g,b);Lr(a.i,Elb(h6(a,b.c)),1);Lr(a.i,Elb(h6(a,b.d)),1)}}else{e=Pr(a.i,Elb(Wv(Smb(a.k,c),24).a));d+=a.g.a.Y()-e}return d}\nfunction Keb(a){switch(a.e){case 0:return veb;case 1:return seb;case 2:return reb;case 3:return yeb;case 4:return xeb;case 5:return Deb;case 6:return Ceb;case 7:return web;case 8:return teb;case 9:return ueb;case 11:return Aeb;case 10:return zeb;default:return Beb;}}\nfunction Leb(a){switch(a.e){case 0:return neb;case 1:return meb;case 2:return jeb;case 3:return ieb;case 4:return peb;case 5:return oeb;case 6:return Heb;case 7:return Geb;case 8:return leb;case 9:return keb;case 10:return Eeb;case 11:return qeb;default:return Feb;}}\nfunction Meb(a){switch(a.e){case 0:return oeb;case 1:return Heb;case 2:return Geb;case 3:return neb;case 4:return meb;case 5:return jeb;case 6:return ieb;case 7:return peb;case 8:return leb;case 9:return keb;case 10:return Eeb;case 11:return qeb;default:return Feb;}}\nfunction Neb(a){switch(a.e){case 0:return jeb;case 1:return ieb;case 2:return peb;case 3:return oeb;case 4:return Heb;case 5:return Geb;case 6:return neb;case 7:return meb;case 8:return leb;case 9:return keb;case 10:return Eeb;case 11:return qeb;default:return Feb;}}\nfunction fcb(a){var b,c,d,e,f,g,h,i;c=(mp(),new wub);h=new Yub((Oh(),new opb(a.f)));for(g=(e=(new Snb(h.a)).a.bb().mb(),new Ynb(e));g.a.G();){f=(d=Wv(g.a.H(),21),Wv(d.yb(),9));if(!f){Fmb();break}i=a.i[f.k];b=Wv(rub(c,i),20);if(!b){b=new GU;tub(c,i,b)}b.ib(f)}return c}\nfunction CS(a,b,c){var d,e,f;for(e=new Tob(a.b.a.b);e.a0){!(tK(a.b.d)&&d.q.d)&&!(uK(a.b.d)&&d.q.b)&&(d.j.e-=0>f/2-0.5?0:f/2-0.5);!(tK(a.b.d)&&d.q.a)&&!(uK(a.b.d)&&d.q.c)&&(d.j.b+=0>f-1?0:f-1)}}}\nfunction T6(a){var b,c,d;d=a.a.f;switch(a.b){case 0:return new Tob(a.a.f);case 1:return Pl((c=new W6(d),c),S6(a));case 2:switch(a.c.e){case 2:case 1:return Pl(new Tob(d),S6(a));case 3:case 4:return Pl((b=new W6(d),b),S6(a));}}throw new Imb('PortOrder not implemented.')}\nfunction CT(a,b){var c;if(!!a.d&&(b.c!=a.e.c||hT(a.e.b,b.b))){vU(a.f,a.d);a.a=a.d.d+a.d.c;a.d=null;a.e=null}eT(b.b)?(a.c=b):(a.b=b);if(b.b==(cT(),$S)&&!b.a||b.b==_S&&b.a||b.b==aT&&b.a||b.b==bT&&!b.a){if(!!a.c&&!!a.b){c=new VN(a.a,a.c.d,b.c-a.a,a.b.d-a.c.d);a.d=c;a.e=b}}}\nfunction Cbb(a,b,c,d){this.e=a;this.j=Wv(rJ(a,(Rib(),Kib)),134);this.f=xv(qB,Nzb,9,b,0,1);this.b=xv(HF,Txb,184,b,6,1);this.a=xv(qB,Nzb,9,b,0,1);this.d=xv(HF,Txb,184,b,6,1);this.i=xv(qB,Nzb,9,b,0,1);this.g=xv(HF,Txb,184,b,6,1);this.n=xv(HF,Txb,184,b,6,1);this.k=c;this.c=d}\nfunction P6(a,b,c){var d,e;if(b.g==(CX(),BX)&&c.g==BX){if(!LM(Wv(rJ(Wv(rJ(b,(Rib(),uib)),9),(eM(),TL)),28))||Wv(rJ(b,uib),9)!=Wv(rJ(c,uib),9)){return}if(I6(b)||I6(c)){a.d=1;a.b=1;return}e=Wv(yU(b.f,0),7).g;d=Wv(yU(c.f,0),7).g;M6(b).g==(sN(),$M)?H6(a,b,c,e,d):H6(a,c,b,d,e)}}\nfunction f7(a){if(!a.a.c||!a.a.d){throw new ulb((Gkb(QD),QD.j+' must have a source and target '+(Gkb(UD),UD.j)+' specified.'))}if(a.a.c==a.a.d){throw new ulb('Network simplex does not support self-loops: '+a.a+' '+a.a.c+' '+a.a.d)}o7(a.a.c.g,a.a);o7(a.a.d.c,a.a);return a.a}\nfunction H6(a,b,c,d,e){if(d==(sN(),ZM)&&e==ZM){N6(a,b)>N6(a,c)?(a.d=K6(a,c)):(a.b=K6(a,b))}else if(d==rN&&e==rN){N6(a,b)N6(a,c)){a.d=K6(a,c);a.b=K6(a,b)}}else{if(N6(a,b)0&&f>0?(g.k=b++):d>0?(g.k=c++):f>0?(g.k=e++):(g.k=c++);}}Gpb(a.f,new Z1)}\nfunction i0(a,b,c,d){var e,f,g,h,i;if(c.d.f==b.f){return}e=new uX(a);sX(e,(CX(),zX));sJ(e,(Rib(),uib),c);sJ(e,(eM(),TL),(KM(),FM));d.c[d.c.length]=e;g=new RX;PX(g,e);QX(g,(sN(),rN));h=new RX;PX(h,e);QX(h,ZM);i=c.d;eW(c,g);f=new hW;qJ(f,c);sJ(f,CL,null);dW(f,h);eW(f,i);j0(e,g,h)}\nfunction W2(a){var b,c,d,e,f,g,h,i,j;g=rAb;i=rAb;h=null;for(c=new Sub(new Lub(a.e));c.b!=c.c.a.b;){b=Rub(c);if(Wv(b.d,60).c==1){d=Wv(b.e,116).a;j=Wv(b.e,116).b;e=g-d>uAb;f=d-guAb;if(e||f){i=Wv(b.e,116).b;g=Wv(b.e,116).a;h=Wv(b.d,60);if(i==0&&g==0){return h}}}}return h}\nfunction i1(a,b){var c,d,e,f,g,h;f=a.d;h=Wv(rJ(a,(eM(),dM)),15).a;if(h<0){h=0;sJ(a,dM,new llb(h))}b.j.b=h;g=Math.floor(h/2);d=new RX;QX(d,(sN(),rN));PX(d,b);d.i.b=g;e=new RX;QX(e,ZM);PX(e,b);e.i.b=g;eW(a,d);c=new hW;qJ(c,a);sJ(c,CL,null);dW(c,e);eW(c,f);h1(b,a,c);f1(a,c);return c}\nfunction OZ(a){var b,c;c=Wv(rJ(a,(Mjb(),vjb)),85);b=Wv(rJ(a,(Rib(),mib)),140);if(c==(Xib(),Tib)){sJ(a,vjb,Wib);sJ(a,mib,(Hhb(),Ghb))}else if(c==Vib){sJ(a,vjb,Wib);sJ(a,mib,(Hhb(),Ehb))}else if(b==(Hhb(),Ghb)){sJ(a,vjb,Tib);sJ(a,mib,Fhb)}else if(b==Ehb){sJ(a,vjb,Vib);sJ(a,mib,Fhb)}}\nfunction QO(a){var b,c,d,e,f;for(d=new Tob(zW(a.e));d.aRAb){this.b.ib(c);h=false}this.b.ib(i)}h&&this.b.ib(c)}\nfunction G7(a){var b,c,d,e;J7(a,a.n);if(a.d.c.length>0){dpb(a.c);while(R7(a,Wv(Rob(new Tob(a.e.a)),61))0?c:0;d.i.b=c+Wjb(a.a,f,h)}else{d.i.b=(Dxb(g),g)}}i=Wjb(a.a,f,h);d.i.b0&&(a.charCodeAt(0)==45||a.charCodeAt(0)==43)?1:0;for(b=e;b$xb){throw new Ylb(dyb+a+'\"')}return f}\nfunction H$(a,b,c,d){var e,f,g,h;e=Wv(nX(b,(sN(),rN)).mb().H(),7);f=Wv(nX(b,ZM).mb().H(),7);for(h=new Tob(a.f);h.ag?0:g)g?0:g:i,(0>(jg?0:g)g?0:g:i)));g=j;j+=h;d=Wv(yU(a.c,f),9);c=new dX(k);c.j.b=b.j.b;Fd(a.b,b,c);vU(d.c,c)}BU(a.g.c,b);vU(a.i,(e=new PY(a,b),e))}\nfunction p8(a,b,c){var d,e,f,g,h,i,j,k,l;b.k=1;f=b.d;for(l=oX(b,(djb(),bjb)).mb();l.G();){k=Wv(l.H(),7);for(e=new Tob(k.e);e.am+i&&d.I()}for(g=new Tob(n);g.auAb;f=d-guAb;if(e||f){i=Wv(b.e,116).b;g=Wv(b.e,116).a;h=Wv(b.d,60);if(i==0&&g==0){return h}}}}return h}\nfunction P4(a,b){var c,d,e,f,g;a.d=b;Ymb(a.b);a.c=false;h:for(d=new Tob(a.d.c);d.ai){new kdb(b,a,h-i)}else if(h>0&&i>0){new kdb(a,b,0);new kdb(b,a,0)}}\nfunction c3(a,b){var c,d,e,f,g,h,i,j,k;j=new GU;k=null;for(d=Wv(qsb(a3,a),20).mb();d.G();){c=Wv(d.H(),75);for(i=(f=(new Snb(c.c.a)).a.bb().mb(),new Ynb(f));i.a.G();){g=(e=Wv(i.a.H(),21),Wv(e.yb(),7));Anb(b,g);J2(g,a.b)}xU(j,c.b);k=a.a}Dpb(j);K2(j,k);for(h=new Tob(j);h.ac.k&&h1){c?(g=rY(b.d)+1):(g=rY(j.d)-1);h=Wv(yU(a.a.c,g),16);rX(j,h)}vY(a,j,c)}}return b}\nfunction Hcb(a,b){var c,d,e,f;b.d?(e=a.a.c==(Gbb(),Fbb)?iX(b.b):mX(b.b)):(e=a.a.c==(Gbb(),Ebb)?iX(b.b):mX(b.b));f=false;for(d=(Il(),new Im(Dl(ul(e.a,new yl))));Cm(d);){c=Wv(Dm(d),12);if(a.c.a[c.c.f.d.k]===a.c.a[c.d.f.d.k]){continue}f=true;if(ttb(a.b,a.a.f[zcb(c,b.b).k])){b.c=true;b.a=c;return b}}b.c=f;b.a=null;return b}\nfunction K4(a,b,c){var d,e,f,g;d=Wv(rJ(a.d,(eM(),pL)),15).a;for(f=new Tob(a.a.b);f.aRAb){f=b;g=0;while((b-f<=0?0-(b-f):b-f)0&&vS(this.n,true,(sK(),pK));a.g==(CX(),xX)&&wS(this.n,false,false,false,false)}\nfunction UT(a,b,c){var d,e,f,g,h,i,j,k,l,m;f=new HI(b,c);for(k=new Tob(a.b);k.ad?l:d;if(h>a.j.a){j=(h-a.j.a)/2;g.b=Nlb(g.b,j);g.c=Nlb(g.c,j)}}\nfunction ST(a,b,c,d){var e,f,g,h,i,j,k,l,m,n;g=uI(b.d,c,d);for(l=new Tob(b.b);l.a=40;g&&Q7(a);H7(a);G7(a);c=K7(a);d=0;while(!!c&&dj){m=0;n+=i+b;i=0}UT(g,m,n);c=Nlb(c,m+k.a);i=Nlb(i,k.b);m+=k.a+b}return new HI(c+b,n+i+b)}\nfunction Nm(a,b,c,d){var e,f,g;g=new Sn(b,c);if(!a.a){a.a=a.e=g;Umb(a.b,b,new Rn(g));++a.c}else if(!d){a.e.b=g;g.d=a.e;a.e=g;e=Wv(Smb(a.b,b),126);if(!e){Umb(a.b,b,new Rn(g));++a.c}else{++e.a;f=e.c;f.c=g;g.e=f;e.c=g}}else{e=Wv(Smb(a.b,b),126);++e.a;g.d=d.d;g.e=d.e;g.b=d;g.c=d;!d.e?(Wv(Smb(a.b,b),126).b=g):(d.e.c=g);!d.d?(a.a=g):(d.d.b=g);d.d=g;d.e=g}++a.d;return g}\nfunction hS(a){var b,c,d,e,f,g,h,i;if(a.e){throw new ulb((Gkb(nA),'The '+nA.j+Yzb))}a.d==(sK(),qK)&&gS(a,oK);for(c=new Tob(a.a.a);c.a0){i=a.g;if(!i){e[0]=0;return Bs(a,c,d)}g=i.d;a.g=zs(i,b,c,d,e);e[0]==0&&++a.a;a.j=PH(a.j,d);return a.g.d==g?a:Gs(a)}e[0]=a.c;j=PH(a.c,d);Xb(RH(j,$xb)<=0);a.c+=d;a.j=PH(a.j,d);return a}\nfunction iJ(b,c){var d,e,f,g,h,i;f=fmb(c,',|;|\\\\(|\\\\)|\\\\[|\\\\]|\\\\{|\\\\}| |\\t|\\n');_I(b);try{e=0;h=0;g=0;i=0;while(e0){h%2==0?(g=clb(f[e])):(i=clb(f[e]));h>0&&h%2!=0&&QI(b,new HI(g,i));++h}++e}}catch(a){a=OH(a);if(aw(a,130)){d=a;throw new slb('The given string does not match the expected format for vectors.'+d)}else throw NH(a)}}\nfunction _bb(a,b,c){var d,e,f,g,h,i,j,k;e=true;for(g=new Tob(b.c);g.aj&&d>j){j=Ixb(c.n[h.k])+Ixb(c.d[h.k])+h.j.b+h.e.a}else{e=false;a.a&&(Fmb(),Emb);break}}if(!e){break}}a.a&&(Fmb(),Emb);return e}\nfunction Jv(a){var b,c,d,e,f,g,h,i;if(isNaN(a)){return Rv(),Qv}if(a<-9223372036854775808){return Rv(),Pv}if(a>=9223372036854775807){return Rv(),Ov}e=false;if(a<0){e=true;a=-a}d=0;if(a>=dzb){d=hw(a/dzb);a-=d*dzb}c=0;if(a>=czb){c=hw(a/czb);a-=c*czb}b=hw(a);f=Ev(b,c,d);e&&(g=~f.l+1&azb,h=~f.m+(g==0?1:0)&azb,i=~f.h+(g==0&&h==0?1:0)&bzb,f.l=g,f.m=h,f.h=i,undefined);return f}\nfunction JO(a){var b,c,d,e,f,g,h;e=DW(a);if(Qob(new Tob(e))){h=new VN(0,0,a.e.j.a,a.e.j.b);for(c=new Tob(e);c.ai+n){o=k.i+l.i;l.a=(l.i*l.a+k.i*k.a)/o;l.i=o;k.g=l;c=true}}f=h;k=l}}return c}\nfunction XY(a){var b,c,d,e,f,g;if(gw(rJ(a,(eM(),TL)))===gw((KM(),GM))||gw(rJ(a,TL))===gw(FM)){for(g=new Tob(a.f);g.ag){return sN(),ZM}break;case 4:case 3:if(k<0){return sN(),$M}else if(k+c>f){return sN(),pN}}i=(j+h/2)/g;d=(k+c/2)/f;return i+d<=1&&i-d<=0?(sN(),rN):i+d>=1&&i-d>=0?(sN(),ZM):d<0.5?(sN(),$M):(sN(),pN)}\nfunction pP(a,b,c,d,e,f,g){var h,i,j,k,l,m;m=new UN;for(j=b.mb();j.G();){h=Wv(j.H(),627);for(l=new Tob(sW(h));l.a0&&QI(a.e,f)}else{a.c[g]-=j+1;a.c[g]<=0&&a.a[g]>0&&QI(a.d,f)}}}}}\nfunction tcb(a,b){var c,d,e,f,g,h,i,j,k;for(g=new Tob(b.c);g.ah&&(h=Wv(rJ(c,Eib),24).a)}for(d=Uh(iX(i));Cm(d);){c=Wv(Dm(d),12);i.d!=c.c.f.d&&Wv(rJ(c,(Rib(),Eib)),24).a==h&&vU(k,new RJ(c.c.f,c))}Gpb(k,a.c);uU(a.b,i.k,k)}}}\nfunction ucb(a,b){var c,d,e,f,g,h,i,j,k;for(g=new Tob(b.c);g.ah&&(h=Wv(rJ(c,Eib),24).a)}for(d=Uh(mX(i));Cm(d);){c=Wv(Dm(d),12);i.d!=c.d.f.d&&Wv(rJ(c,(Rib(),Eib)),24).a==h&&vU(k,new RJ(c.d.f,c))}Gpb(k,a.c);uU(a.f,i.k,k)}}}\nfunction g3(a){b3();var b,c,d,e,f,g,h,i,j,k;this.b=new i3;this.c=new GU;this.a=new GU;for(i=Seb(),j=0,k=i.length;j0){e=h.length;while(e>0&&h[e-1]==''){--e}e0?As(a,c,d):a}a.e=Ns(g,b,c,d,e);d==0&&e[0]!=0?--a.a:d>0&&e[0]==0&&++a.a;a.j=PH(a.j,d-e[0]);return Gs(a)}else if(f>0){h=a.g;if(!h){e[0]=0;return d>0?Bs(a,c,d):a}a.g=Ns(h,b,c,d,e);d==0&&e[0]!=0?--a.a:d>0&&e[0]==0&&++a.a;a.j=PH(a.j,d-e[0]);return Gs(a)}e[0]=a.c;if(d==0){return Fs(a)}a.j=PH(a.j,d-a.c);a.c=d;return a}\nfunction Q7(a){var b,c,d,e,f,g,h;a.o=new Uvb;d=new aJ;for(g=new Tob(a.e.a);g.a0;h=c7(b,f);c?p7(h.c,b):p7(h.g,b);m7(h).c.length==1&&(TI(d,h,d.c.b,d.c),true);e=new RJ(f,b);Tvb(a.o,e);BU(a.e.a,f)}}\nfunction Hs(a,b,c,d,e){var f,g,h;f=b.$b(c,a.b);if(f<0){g=a.e;if(!g){e[0]=0;return a}a.e=Hs(g,b,c,d,e);if(e[0]>0){if(d>=e[0]){--a.a;a.j=XH(a.j,e[0])}else{a.j=XH(a.j,d)}}return e[0]==0?a:Gs(a)}else if(f>0){h=a.g;if(!h){e[0]=0;return a}a.g=Hs(h,b,c,d,e);if(e[0]>0){if(d>=e[0]){--a.a;a.j=XH(a.j,e[0])}else{a.j=XH(a.j,d)}}return Gs(a)}e[0]=a.c;if(d>=a.c){return Fs(a)}else{a.c-=d;a.j=XH(a.j,d);return a}}\nfunction BQ(a,b,c){var d,e,f,g,h,i,j,k;for(i=new Tob(c.b);i.a0||c==0&&b.f==(Gh(),Fh)){h=b.g;i=b.f}}}else{e=b.c;h=b.g;i=b.f}if(d&&e){c=a.a.$b(f,h);if(c>0||c==0&&g==(Gh(),Fh)&&i==(Gh(),Fh)){f=h;g=(Gh(),Fh);i=Eh}}return new sk(a.a,d,f,g,e,h,i)}\nfunction h0(a,b,c,d){var e,f,g,h,i,j,k;if(c.c.f==b.f){return}e=new uX(a);sX(e,(CX(),zX));sJ(e,(Rib(),uib),c);sJ(e,(eM(),TL),(KM(),FM));d.c[d.c.length]=e;g=new RX;PX(g,e);QX(g,(sN(),rN));h=new RX;PX(h,e);QX(h,ZM);eW(c,g);f=new hW;qJ(f,c);sJ(f,CL,null);dW(f,h);eW(f,b);j0(e,g,h);j=new Fnb(c.b,0);while(j.b=d&&l.a>=d&&(m.a=d);o.a<=c&&l.a<=c&&(p.a=c-10);b.c.a.Y()==1?fJ(h.a,Bv(tv(qz,1),Fzb,10,0,[m,n,q,p])):fJ(h.a,Bv(tv(qz,1),Fzb,10,0,[m,n,e,q,p]))}}\nfunction cW(a,b){var c,d,e,f,g,h;f=a.c;g=a.d;dW(a,null);eW(a,null);b&&Ckb(Ixb(Xv(rJ(g,(Rib(),kib)))))?dW(a,VW(g.f,(djb(),bjb),(sN(),ZM))):dW(a,g);b&&Ckb(Ixb(Xv(rJ(f,(Rib(),yib)))))?eW(a,VW(f.f,(djb(),ajb),(sN(),rN))):eW(a,f);for(d=new Tob(a.b);d.a0&&!!j[d]&&(o=Wjb(a.b,j[d],i));p=Nlb(p,e.d.c.b+o)}for(f=new Tob(k.f);f.aIxb(W9(g.g,g.d[0]).a)){Bxb(i.b>0);i.a.sb(i.c=--i.b);Anb(i,g);e=true}else if(!!h.e&&h.e.Y()>0){f=(!h.e&&(h.e=new GU),h.e).nb(b);j=(!h.e&&(h.e=new GU),h.e).nb(c);if(f||j){(!h.e&&(h.e=new GU),h.e).ib(g);++g.c}}}e||(d.c[d.c.length]=g,true)}\nfunction s2(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o;if(c.d.f==b.f){return}e=new uX(a);sX(e,(CX(),zX));sJ(e,(Rib(),uib),c);sJ(e,(eM(),TL),(KM(),FM));d.c[d.c.length]=e;g=new RX;PX(g,e);QX(g,(sN(),rN));h=new RX;PX(h,e);QX(h,ZM);i=c.d;eW(c,g);f=new hW;qJ(f,c);sJ(f,CL,null);dW(f,h);eW(f,i);j=Wv(yU(g.b,0),12).c;k=j.f;l=k.g;m=Wv(yU(h.e,0),12).d;n=m.f;o=n.g;l==zX?sJ(e,qib,Wv(rJ(k,qib),7)):sJ(e,qib,j);o==zX?sJ(e,rib,Wv(rJ(n,rib),7)):sJ(e,rib,m)}\nfunction $6(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;if(h=a.b[b],i=a.b[c],(j=Wv(rJ(h,(Rib(),oib)),20),!!j&&j.Y()!=0&&j.kb(i))||(k=h.g!=(CX(),zX)&&i.g!=zX,l=Wv(rJ(h,nib),9),m=Wv(rJ(i,nib),9),n=!!l&&l!=h||!!m&&m!=i,o=l!=m,p=_6(h,(sN(),$M)),q=_6(i,pN),r=n&&o||p||q,k&&r)||h.g==(CX(),BX)&&i.g==AX||i.g==(CX(),BX)&&h.g==AX){return false}g=a.b[b];d=a.b[c];m6(a.c,g,d);G6(a.d,g,d);f=M5(a.a,g,d)+a.c.d+a.d.d;e=M5(a.a,d,g)+a.c.b+a.d.b;return f>e}\nfunction v2(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p;g=b;m=b.d;k=b.c.f;n=b.d.f;l=rY(k.d);o=rY(n.d);for(h=l;h0&&LI(c.charCodeAt(d-1),gzb)){--d}if(f>=d){throw new slb('The given string does not contain any numbers.')}g=fmb(c.substr(f,d-f),',|;|\\r|\\n');if(g.length!=2){throw new slb('Exactly two numbers are expected, '+g.length+' were found.')}try{b.a=clb(hmb(g[0]));b.b=clb(hmb(g[1]))}catch(a){a=OH(a);if(aw(a,130)){e=a;throw new slb(hzb+e)}else throw NH(a)}}\nfunction Qdb(a,b,c){var d,e,f,g,h,i,j,k,l;i=c+b.d.c.a;for(l=new Tob(b.f);l.a1;for(h=Uh(Sh((Gi(),new gr(Ti(Bv(tv(UF,1),syb,1,4,[k.b,k.e]))))));Cm(h);){g=Wv(Dm(h),12);j=g.c==k?g.d:g.c;Jlb(MI(Bv(tv(qz,1),Fzb,10,0,[j.f.i,j.i,j.a])).b-f.b)>1&&Odb(a,g,f,e,k)}}}\nfunction FR(a,b){var c,d,e,f,g,h;for(g=new rnb((new inb(a.f.b)).a);g.b;){f=pnb(g);e=Wv(f.yb(),251);if(b==1){if(e.yc()!=(sK(),rK)&&e.yc()!=nK){continue}}else{if(e.yc()!=(sK(),oK)&&e.yc()!=pK){continue}}d=Wv(Wv(f.zb(),27).b,25);h=Wv(Wv(f.zb(),27).a,78);c=h.c;switch(e.yc().e){case 2:d.j.d=a.e.a;d.j.c=Nlb(1,d.j.c+c);break;case 1:d.j.d=d.j.d+c;d.j.c=Nlb(1,d.j.c-c);break;case 4:d.j.e=a.e.b;d.j.b=Nlb(1,d.j.b+c);break;case 3:d.j.e=d.j.e+c;d.j.b=Nlb(1,d.j.b-c);}}}\nfunction bdb(a,b,c,d,e){var f,g,h,i,j,k,l,m,n;m=(mp(),new ntb);h=new GU;adb(a,c,a.d.Mc(),h,m);adb(a,d,a.d.Nc(),h,m);i=new Fnb(h,0);while(i.bl||d+e>i){throw new nkb}if(((j.g&1)==0||(j.g&4)!=0)&&k!=h){if(a===c&&bd;){c[g]=a[--b]}}else{for(g=d+e;d0&&dxb(a,b,c,d,e,true)}\nfunction cR(a,b,c){var d,e,f,g,h;d=Wv(rJ(a,(Mjb(),jjb)),18);c.a>b.a&&(d.kb((zgb(),tgb))?(a.d.a+=(c.a-b.a)/2):d.kb(vgb)&&(a.d.a+=c.a-b.a));c.b>b.b&&(d.kb((zgb(),xgb))?(a.d.b+=(c.b-b.b)/2):d.kb(wgb)&&(a.d.b+=c.b-b.b));if(Wv(rJ(a,(Rib(),jib)),18).kb((ohb(),hhb))&&(c.a>b.a||c.b>b.b)){for(h=new Tob(a.b);h.a0){return As(a,c,e)}return a}a.e=Ms(h,b,c,d,e,f);if(f[0]==d){e==0&&f[0]!=0?--a.a:e>0&&f[0]==0&&++a.a;a.j=PH(a.j,e-f[0])}return Gs(a)}else if(g>0){i=a.g;if(!i){f[0]=0;if(d==0&&e>0){return Bs(a,c,e)}return a}a.g=Ms(i,b,c,d,e,f);if(f[0]==d){e==0&&f[0]!=0?--a.a:e>0&&f[0]==0&&++a.a;a.j=PH(a.j,e-f[0])}return Gs(a)}f[0]=a.c;if(d==a.c){if(e==0){return Fs(a)}a.j=PH(a.j,e-a.c);a.c=e}return a}\nfunction gfb(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;i=a.e;n=a.f;g=a.d;o=a.c;k=o-1;p=a.g;l=Eo(a.g.xb(1,a.g.Y()-1));j=new GU;for(c=0;c=0){return false}else if(!!c.e&&e==(CX(),wX)&&e!=c.e){return false}else{b.k=c.b;vU(c.f,b)}c.e=e;if(e==(CX(),zX)||e==BX||e==wX){for(g=new Tob(b.f);g.a0){vS(a.n,false,(sK(),oK));vS(a.n,true,pK)}}\nfunction tP(b,c){var d,e,f,g,h,i,j,k,l,m;h=0;while(h<(bmb(),c.length)&&yP(c.charCodeAt(h),fzb)){++h}d=c.length;while(d>0&&yP(c.charCodeAt(d-1),gzb)){--d}if(h0){d=new IU(Wv(Dd(a.a,f),18));Gpb(d,new $V(b));e=new Fnb(f.b,0);while(e.bv)){i=2;g=$xb}else if(i==0){i=1;g=A}else{i=0;g=A}}else{n=A>=g||g-A0&&(i=a.i.a/f);break;case 2:case 4:e=a.f.j.b;e>0&&(i=a.i.b/e);}sJ(a,(Rib(),Cib),i)}h=a.j;if(d){a.a.a=d.a;a.a.b=d.b}else if(b!=IM&&b!=JM&&g!=qN){switch(g.e){case 1:a.a.a=h.a/2;break;case 2:a.a.a=h.a;a.a.b=h.b/2;break;case 3:a.a.a=h.a/2;a.a.b=h.b;break;case 4:a.a.b=h.b/2;}}else{a.a.a=h.a/2;a.a.b=h.b/2}}\nfunction zJ(a){var b,c,d,e;if(aw(a.a,10)){return xI(Wv(a.a,10))}else if(aw(a.a,66)){return Xsb(Wv(a.a,86))}else if(aw(a.a,50)){return Wv(a.a,50).Wc()}else if(aw(a.a,191)){b=new Vwb;e=(d=new rwb((new wwb((new Gob(Wv(a.a,191).a)).a)).b),new Mob(d));while(Bnb(e.a.a)){Rwb(b,(c=pwb(e.a),c.yb()))}return b}else if(aw(a.a,13)){return new IU(Wv(a.a,13))}else if(aw(a.a,44)){b=new jJ;e=WI(Wv(a.a,44),0);while(e.b!=e.d.c){QI(b,Wv(_ub(e),10))}return b}else if(aw(a.a,58)){b=new aJ;e=WI(Wv(a.a,58),0);while(e.b!=e.d.c){QI(b,_ub(e))}return b}else{return a.a}}\nfunction o1(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;h=0;o=0;i=Xob(a.f,a.f.length);f=a.d;g=a.i;d=a.a;e=a.b;do{n=0;for(k=new Tob(a.p);k.ap?m:p}o=MI(Bv(tv(qz,1),Fzb,10,0,[a.f.i,a.i,a.a])).b;kgb(this,o,n,m);for(i=(f=(new Snb(b.a)).a.bb().mb(),new Ynb(f));i.a.G();){h=(e=Wv(i.a.H(),21),Wv(e.yb(),27));stb(this.c,Wv(h.b,12))}this.f=false}\nfunction cQ(a,b,c,d){var e,f,g,h,i,j;h=(eM(),KL).b;if(h in b.a&&Pu(b,h).ic().a){return}j=Pu(b,Dzb);if(!j){throw new GQ(\"Labels must have a property 'text'.\",null,b)}else if(!j.lc()){throw new GQ(\"A label's 'text' property must be a string.\",j,b)}i=j.lc().a;f=new dX(i);sJ(f,(Rib(),uib),b);Umb(a.f,f,b);_P(b,f);hQ(b,f);aw(c,9)?vU(Wv(c,9).c,f):aw(c,12)?vU(Wv(c,12).b,f):aw(c,7)&&vU(Wv(c,7).c,f);if(aw(c,12)){g=Wv(rJ(f,tL),107);_P(b,f);sJ(f,tL,g);e=Wv(rJ(d,jib),18);switch(g.e){case 2:case 3:e.ib((ohb(),ghb));case 1:case 0:e.ib((ohb(),ehb));sJ(f,tL,(EK(),AK));}}}\nfunction UW(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;f=0;g=0;for(j=new Tob(a.a);j.a0.5?(r-=g*2*(o-0.5)):o<0.5&&(r+=f*2*(0.5-o));e=h.e.b;rq.a-p-k&&(r=q.a-p-k);h.i.a=b+r}}\nfunction Kv(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,A,B,C,D,F,G;c=a.l&8191;d=a.l>>13|(a.m&15)<<9;e=a.m>>4&8191;f=a.m>>17|(a.h&255)<<5;g=(a.h&1048320)>>8;h=b.l&8191;i=b.l>>13|(b.m&15)<<9;j=b.m>>4&8191;k=b.m>>17|(b.h&255)<<5;l=(b.h&1048320)>>8;B=c*h;C=d*h;D=e*h;F=f*h;G=g*h;if(i!=0){C+=c*i;D+=d*i;F+=e*i;G+=f*i}if(j!=0){D+=c*j;F+=d*j;G+=e*j}if(k!=0){F+=c*k;G+=d*k}l!=0&&(G+=c*l);n=B&azb;o=(C&511)<<13;m=n+o;q=B>>22;r=C>>9;s=(D&262143)<<4;t=(F&31)<<17;p=q+r+s+t;v=D>>18;w=F>>5;A=(G&4095)<<8;u=v+w+A;p+=m>>22;m&=azb;u+=p>>22;p&=azb;u&=bzb;return Ev(m,p,u)}\nfunction jZ(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w;q=a.d.c.c.c.length;if(c>=q-1){return null}e=new GU;e.c[e.c.length]=b;u=b;g=c;o=-1;h=Wv(yU(a.d.c.c,c),16);for(n=0;n1&&g1&&g>1){k=fZ(a,u);h=Wv(yU(a.d.c.c,g),16);l=Wv(yU(a.d.c.c,g-1),16);w=Wv(p.sb(m++),24).a;r=Slb(w,l.a.c.length);qX(u,r,l);qX(k,t,h);t=r;!!u&&(e.c[e.c.length]=u,true);u=k;--v;++f;--g}s=(d-(e.c.length-1)*a.d.d)/e.c.length;for(j=new Tob(e);j.ad?0:d;if(!!b.o&&!!f.o&&aw(b,82)&&aw(f,82)&&!sr(or(Wv(b,82).d,Wv(f,82).d))){e=x7(new A7,a.d);h=hw(Llb(f.g.a-b.g.a));f7(i7(h7(j7(g7(new k7,0>h?0:h),1),e),a.c[b.f.d]));f7(i7(h7(j7(g7(new k7,0>-h?0:-h),1),e),a.c[f.f.d]))}else{j=1;(aw(b,82)&&aw(f,93)||aw(f,82)&&aw(b,93))&&(j=2);f7(i7(h7(j7(g7(new k7,hw(d)),j),a.c[b.f.d]),a.c[f.f.d]))}}}}\nfunction tQ(){tQ=iI;sQ=new vtb;rQ=uQ(Bv(tv(rz,1),syb,79,0,[(eM(),kL),xL]));oQ=uQ(Bv(tv(rz,1),syb,79,0,[ML,UL,(Mjb(),Hjb),yL,(Rib(),Eib),Kjb,Cjb]));kQ=uQ(Bv(tv(rz,1),syb,79,0,[mL,qL,KL,wL,BL,EL,FL,$L,_L,AL,gjb,mjb,njb,xjb,rjb,yjb,Ijb,Djb,ijb]));nQ=uQ(Bv(tv(rz,1),syb,79,0,[IL,HL,DL,dM,LL,Dib,Xhb,Rhb,Jib,Ejb,qjb,wjb]));mQ=uQ(Bv(tv(rz,1),syb,79,0,[WL,lL,sL,uL,tL,vL,zL,NL,OL,PL,QL,RL,TL,VL,hjb,ljb,zjb,ojb,kjb,Ajb,Bjb,sjb,tjb,vjb,Fjb,Gjb,Jjb,Ljb,ujb]));lQ=uQ(Bv(tv(rz,1),syb,79,0,[JL,aM,bM,jjb]));qQ=uQ(Bv(tv(rz,1),syb,79,0,[jL,oL,CL,GL,SL,YL]));pQ=uQ(Bv(tv(rz,1),syb,79,0,[(RP(),OP)]))}\nfunction AR(a){var b,c,d,e,f,g,h;b=0;for(f=new Tob(a.b.a);f.a$yb)&&h<10);oS(a.c,new KR);AR(a);iS(a.c);gR(a.f)}\nfunction tT(a){oT();var b,c,d,e,f,g,h;h=new qT;for(c=new Tob(a);c.a=h.b.c)&&(h.b=b);if(!h.c||b.c<=h.c.c){h.d=h.c;h.c=b}(!h.e||b.d>=h.e.d)&&(h.e=b);(!h.f||b.d<=h.f.d)&&(h.f=b)}d=new xT((cT(),$S));RT(a,mT,new opb(Bv(tv(JA,1),syb,160,0,[d])));g=new xT(bT);RT(a,lT,new opb(Bv(tv(JA,1),syb,160,0,[g])));e=new xT(_S);RT(a,kT,new opb(Bv(tv(JA,1),syb,160,0,[e])));f=new xT(aT);RT(a,jT,new opb(Bv(tv(JA,1),syb,160,0,[f])));rT(d.c,$S);rT(e.c,_S);rT(f.c,aT);rT(g.c,bT);h.a.c=xv(UF,syb,1,0,4,1);xU(h.a,d.c);xU(h.a,Fo(e.c));xU(h.a,f.c);xU(h.a,Fo(g.c));return h}\nfunction $O(a){var b,c,d,e,f,g,h,i,j,k;e=Wv(vW(a,(eM(),DL)),15).a;for(h=new Tob(uW(a));h.a0){p=(Cxb(0,i.c.length),Wv(i.c[0],12));e=(Cxb(0,n.c.length),Wv(n.c[0],12));s=e.d.b;f=zU(s,e,0);fW(p,e.d,f);dW(e,null);eW(e,null);o=p.a;b&&QI(o,new II(t));for(d=WI(e.a,0);d.b!=d.d.c;){c=Wv(_ub(d),10);QI(o,new II(c))}r=p.b;for(m=new Tob(e.b);m.ag)&&stb(a.c,Wv(q.b,12))}}++h}f=g}}}}\nfunction _9(a,b,c){var d,e,f,g,h,i;this.g=a;h=b.d.length;i=c.d.length;this.d=xv(qB,Nzb,9,h+i,0,1);for(g=0;g0?Z9(this,this.f/this.a):W9(b.g,b.d[0]).a!=null&&W9(c.g,c.d[0]).a!=null?Z9(this,(Ixb(W9(b.g,b.d[0]).a)+Ixb(W9(c.g,c.d[0]).a))/2):W9(b.g,b.d[0]).a!=null?Z9(this,W9(b.g,b.d[0]).a):W9(c.g,c.d[0]).a!=null&&Z9(this,W9(c.g,c.d[0]).a)}\nfunction x9(a,b){var c,d,e,f,g,h,i,j,k,l,m;switch(a.g.e){case 1:d=Wv(rJ(a,(Rib(),uib)),12);c=Wv(rJ(d,vib),44);!c?(c=new jJ):Ckb(Ixb(Xv(rJ(d,Iib))))&&(c=lJ(c));j=Wv(rJ(a,qib),7);k=MI(Bv(tv(qz,1),Fzb,10,0,[j.f.i,j.i,j.a]));if(b<=k.a){return k.b}TI(c,k,c.a,c.a.a);l=Wv(rJ(a,rib),7);m=MI(Bv(tv(qz,1),Fzb,10,0,[l.f.i,l.i,l.a]));if(m.a<=b){return m.b}TI(c,m,c.c.b,c.c);i=WI(c,0);g=Wv(_ub(i),10);h=Wv(_ub(i),10);while(h.a=2){_I(a.a);d=0;for(m=WI(c,0);m.b!=m.d.c;){l=Wv(_ub(m),10);if(d==0){b=EI(EI(new HI(l.a,l.b),a.c.i),a.c.f.i);a.c.a.a=b.a;a.c.a.b=b.b}else if(d==c.b-1){b=EI(EI(new HI(l.a,l.b),a.d.i),a.d.f.i);a.d.a.a=b.a;a.d.a.b=b.b}else{QI(a.a,l)}++d}}if(k){for(i=WI(a.a,0);i.b!=i.d.c;){h=Wv(_ub(i),10);g.a=Nlb(g.a,h.a);g.b=Nlb(g.b,h.b)}}for(f=new Tob(a.b);f.a0&&sJ(g,$hb,(xkb(),xkb(),wkb));h=Wv(rJ(g,(eM(),TL)),28);h==(KM(),JM)?IM:h!=IM&&d.ib((ohb(),khb));Ckb(Ixb(Xv(rJ(g,qL))))&&d.ib((ohb(),fhb));if(Ckb(Ixb(Xv(rJ(g,AL))))){d.ib((ohb(),jhb));d.ib(ihb);sJ(g,TL,IM)}return g}\nfunction iR(a,b){b.V()&&wS(a.n,true,true,true,true);b.t((sN(),eN))&&wS(a.n,true,true,true,false);b.t(_M)&&wS(a.n,false,true,true,true);b.t(mN)&&wS(a.n,true,true,false,true);b.t(oN)&&wS(a.n,true,false,true,true);b.t(fN)&&wS(a.n,false,true,true,false);b.t(aN)&&wS(a.n,false,true,false,true);b.t(nN)&&wS(a.n,true,false,false,true);b.t(lN)&&wS(a.n,true,false,true,false);b.t(jN)&&wS(a.n,true,true,true,true);b.t(cN)&&wS(a.n,true,true,true,true);b.t(jN)&&wS(a.n,true,true,true,true);b.t(bN)&&wS(a.n,true,true,true,true);b.t(kN)&&wS(a.n,true,true,true,true);b.t(iN)&&wS(a.n,true,true,true,true);b.t(hN)&&wS(a.n,true,true,true,true)}\nfunction n1(a,b){var c,d,e,f,g,h,i,j,k,l;i=true;e=0;j=a.f[b.k];k=b.j.b+a.n;c=a.c[b.k][2];DU(a.a,j,Elb(Wv(yU(a.a,j),24).a-1+c));DU(a.b,j,Ixb(Yv(yU(a.b,j)))-k+c*a.e);++j;if(j>=a.i){++a.i;vU(a.a,Elb(1));vU(a.b,k)}else{d=a.c[b.k][1];DU(a.a,j,Elb(Wv(yU(a.a,j),24).a+1-d));DU(a.b,j,Ixb(Yv(yU(a.b,j)))+k-d*a.e)}(a.q==(I1(),B1)&&(Wv(yU(a.a,j),24).a>a.j||Wv(yU(a.a,j-1),24).a>a.j)||a.q==E1&&(Ixb(Yv(yU(a.b,j)))>a.k||Ixb(Yv(yU(a.b,j-1)))>a.k))&&(i=false);for(g=Uh(iX(b));Cm(g);){f=Wv(Dm(g),12);h=f.c.f;if(a.f[h.k]==j){l=n1(a,h);e=e+Wv(l.a,24).a;i=i&&Ckb(Ixb(Xv(l.b)))}}a.f[b.k]=j;e=e+a.c[b.k][0];return new RJ(Elb(e),(xkb(),i?wkb:vkb))}\nfunction WW(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;m=new II(a.j);r=b.a/m.a;h=b.b/m.b;p=b.a-m.a;f=b.b-m.b;if(c){e=gw(rJ(a,(eM(),TL)))===gw((KM(),FM));for(o=new Tob(a.f);o.a=1){if(q-g>0&&l>=0){i.i.a+=p;i.i.b+=f*g}else if(q-g<0&&k>=0){i.i.a+=p*q;i.i.b+=f}}}a.j.a=b.a;a.j.b=b.b;sJ(a,(eM(),aM),(DN(),d=Wv(Hkb(Lz),11),new atb(d,Wv(exb(d,d.length),11),0)))}\nfunction C7(a){var b,c,d,e,f,g,h,i,j,k;d=new GU;for(g=new Tob(a.e.a);g.a-1){for(e=WI(h,0);e.b!=e.d.c;){d=Wv(_ub(e),77);d.n=g}while(h.b!=0){d=Wv(un(h,0),77);for(c=new Tob(d.d);c.a0){a.a=j+(p-1)*f;b.d.b+=a.a;b.e.b+=a.a}}if(q.a.Y()!=0){o=new cdb(1,f);p=bdb(o,b,q,r,b.e.b+j-b.d.b);p>0&&(b.e.b+=j+(p-1)*f)}}\nfunction Xt(a,b){var c,d,e,f,g,h,i,j,k;if((bmb(),b.length)==0){return a.fc(Yxb,Xxb,-1,-1)}k=hmb(b);emb(k.substr(0,3),'at ')&&(k=imb(k,3,k.length-3));k=k.replace(/\\[.*?\\]/g,'');g=k.indexOf('(');if(g==-1){g=k.indexOf('@');if(g==-1){j=k;k=''}else{j=hmb(imb(k,g+1,k.length-(g+1)));k=hmb(k.substr(0,g))}}else{c=k.indexOf(')',g);j=k.substr(g+1,c-(g+1));k=hmb(k.substr(0,g))}g=mmb(k,lmb(46));g!=-1&&(k=imb(k,g+1,k.length-(g+1)));(k.length==0||emb(k,'Anonymous function'))&&(k=Xxb);h=nmb(j,lmb(58));e=omb(j,lmb(58),h-1);i=-1;d=-1;f=Yxb;if(h!=-1&&e!=-1){f=j.substr(0,e);i=St(j.substr(e+1,h-(e+1)));d=St(imb(j,h+1,j.length-(h+1)))}return a.fc(f,k,i,d)}\nfunction idb(a){var b,c,d,e,f,g,h,i,j,k;j=new GU;h=new GU;for(g=new Tob(a);g.a-1){for(f=new Tob(h);f.a0){continue}i.i=Slb(i.i,e.i-1);--i.f;i.f==0&&(h.c[h.c.length]=i,true)}}}}\nfunction PV(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p;if(!Ckb(Ixb(Xv(rJ(c,(eM(),$L)))))){return}for(h=new Tob(c.f);h.a0);g.a.sb(g.c=--g.b);Anb(g,d);$ub(j,d);J2(d,i.g);avb(j);avb(j);e.a.eb(d)!=null}}}}}\nfunction IP(b){var c,d,e,f,g,h,i,j,k;g=new Uu(b);f=Pu(g,'graph');j=Pu(g,'success');e=Pu(g,'error');h=Pu(g,'options');try{if(!f||!f.kc()){throw new $J(\"Mandatory parameter missing, 'graph' must be specified\")}AQ(new CQ,f.kc(),h?h.kc():null);i=f.kc().a;!!j&&!!j.kc()?HP(j.kc().a,i):HP(null,i)}catch(a){a=OH(a);if(aw(a,73)){k=a;!!e&&!!e.kc()?HP(e.kc().a,DQ(k).a):HP(null,DQ(k).a)}else if(aw(a,54)){c=a;d=new Tu;Ru(d,'type',new lv(Ikb(c.$c)));c.bc()!=null?Ru(d,Dzb,new lv(c.bc())):Ru(d,Dzb,new lv('null (sic)'));Ru(d,Ezb,new lv(Hb(new Kb('\\n'),new wnb(new opb((c.g==null&&(c.g=Pt(c)),c.g))))));!!e&&!!e.kc()?HP(e.kc().a,d.a):HP(null,d.a);at(c,(Fmb(),Dmb),'')}else throw NH(a)}}\nfunction e9(a,b,c){var d,e,f,g,h,i,j,k,l,m;if(c){d=-1;k=new Fnb(b,0);while(k.b0&&c.c==0){!b&&(b=new GU);b.c[b.c.length]=c}}if(b){while(b.c.length!=0){c=Wv(AU(b,0),102);if(!!c.b&&c.b.c.length>0){for(f=(!c.b&&(c.b=new GU),new Tob(c.b));f.azU(a,c,0)){return new RJ(e,c)}}else if(Ixb(W9(e.g,e.d[0]).a)>Ixb(W9(c.g,c.d[0]).a)){return new RJ(e,c)}}}for(h=(!c.e&&(c.e=new GU),c.e).mb();h.G();){g=Wv(h.H(),102);i=(!g.b&&(g.b=new GU),g.b);Fxb(0,i.c.length);fxb(i.c,0,c);g.c==i.c.length&&(b.c[b.c.length]=g,true)}}}return null}\nfunction R0(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;l=(mp(),new ntb);for(k=(Il(),new Im(Dl(ul(a.a,new yl))));Cm(k);){j=Wv(Dm(k),9);e=Q0(j,(sN(),ZM));for(d=new Tob(e);d.a0&&(f.a=Nlb(f.a,e+a.q.b+a.q.c));c>0&&(f.b=Nlb(f.b,c+a.q.d+a.q.a))}else{e>0&&(f.a=Nlb(f.a,e));c>0&&(f.b=Nlb(f.b,c))}}pW(a.e,f)}\nfunction ewb(a,b,c){var d,e,f,g,h,i,j,k,l,m,n;if(!a.b){return false}g=null;m=null;i=new ywb(null,null);e=1;i.a[1]=a.b;l=i;while(l.a[e]){j=e;h=m;m=l;l=l.a[e];d=a.a.$b(b,l.d);e=d<0?0:1;d==0&&(!c.c||ovb(l.e,c.d))&&(g=l);if(!(!!l&&l.b)&&!awb(l.a[e])){if(awb(l.a[1-e])){m=m.a[j]=hwb(l,e)}else if(!awb(l.a[1-e])){n=m.a[1-j];if(n){if(!awb(n.a[1-j])&&!awb(n.a[j])){m.b=false;n.b=true;l.b=true}else{f=h.a[1]==m?1:0;awb(n.a[j])?(h.a[f]=gwb(m,j)):awb(n.a[1-j])&&(h.a[f]=hwb(m,j));l.b=h.a[f].b=true;h.a[f].a[0].b=false;h.a[f].a[1].b=false}}}}}if(g){c.b=true;c.d=g.e;if(l!=g){k=new ywb(l.d,l.e);fwb(a,i,g,k);m==g&&(m=k)}m.a[m.a[1]==l?1:0]=l.a[!l.a[0]?1:0];--a.c}a.b=i.a[1];!!a.b&&(a.b.b=false);return c.b}\nfunction v$(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;d=Wv(rJ(a,(eM(),TL)),28);i=a.e;h=a.a;c=Wv(rJ(a,(Rib(),Xhb)),15).a;j=i.a+h.b+h.c+2*c;k=0-h.d-c-a.d.b;n=i.b+h.d+h.a+2*c-a.d.b;l=new GU;o=new GU;for(f=(m=(new Snb(b.a)).a.bb().mb(),new Ynb(m));f.a.G();){e=(g=Wv(f.a.H(),21),Wv(g.yb(),9));switch(d.e){case 1:case 2:case 3:m$(e);break;case 4:p=Wv(rJ(e,SL),10);q=!p?0:p.a;e.i.a=j*Ixb(Yv(rJ(e,Cib)))-q;fX(e,true,false);break;case 5:r=Wv(rJ(e,SL),10);s=!r?0:r.a;e.i.a=Ixb(Yv(rJ(e,Cib)))-s;fX(e,true,false);i.a=Nlb(i.a,e.i.a+e.j.a/2);}switch(Wv(rJ(e,hib),32).e){case 1:e.i.b=k;l.c[l.c.length]=e;break;case 3:e.i.b=n;o.c[o.c.length]=e;}}switch(d.e){case 1:case 2:o$(l,a);o$(o,a);break;case 3:t$(l,a);t$(o,a);}}\nfunction OY(a){var b,c,d,e,f,g;d=Wv(rJ(a.a.g,(eM(),JL)),86);if(jf(d,(oM(),b=Wv(Hkb(Gz),11),new atb(b,Wv(exb(b,b.length),11),0))));else if(Xe(d,Usb(gM))){c=Wv(Wv(Dd(a.a.b,a.b),20).sb(0),33);a.b.i.a=c.i.a;a.b.i.b=c.i.b}else if(Xe(d,Usb(iM))){e=Wv(yU(a.a.c,a.a.c.c.length-1),9);f=Wv(Wv(Dd(a.a.b,a.b),20).sb(Wv(Dd(a.a.b,a.b),20).Y()-1),33);g=e.j.a-(f.i.a+f.j.a);a.b.i.a=a.a.g.j.a-g-a.b.j.a;a.b.i.b=f.i.b}else if(Xe(d,Vsb(mM,Bv(tv(Gz,1),uyb,41,0,[fM])))){c=Wv(Wv(Dd(a.a.b,a.b),20).sb(0),33);a.b.i.a=(a.a.g.j.a-a.b.j.a)/2;a.b.i.b=c.i.b}else if(Xe(d,Usb(mM))){c=Wv(Wv(Dd(a.a.b,a.b),20).sb(0),33);a.b.i.b=c.i.b}else if(Xe(d,Usb(fM))){c=Wv(Wv(Dd(a.a.b,a.b),20).sb(0),33);a.b.i.a=(a.a.g.j.a-a.b.j.a)/2;a.b.i.b=c.i.b}return null}\nfunction NZ(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;for(o=new Tob(a);o.ar?i:r;for(t=new Tob(k.f);t.a=j&&v>=q){m+=o.i.b+p.i.b+p.a.b-u;++h}}}}if(c){for(g=new Tob(s.b);g.a=j&&v>=q){m+=o.i.b+p.i.b+p.a.b-u;++h}}}}}if(h>0){w+=m/h;++n}}if(n>0){b.a=e*w/n;b.i=n}else{b.a=0;b.i=0}}\nfunction Kab(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;n=b.c.length;m=0;for(l=new Tob(a.c);l.a=0){i=null;h=new Fnb(k.a,j+1);while(h.b0){a.a[b.d.k][b.k].d+=wvb(a.e,24)*FAb*0.07000000029802322-0.03500000014901161;a.a[b.d.k][b.k].a=a.a[b.d.k][b.k].d/a.a[b.d.k][b.k].b}}\nfunction Sbb(a,b){var c,d,e,f,g,h,i,j,k,l,m;for(e=new Tob(a.a.c);e.aVzb||b.k==Jbb&&k0){d+=f.b.c.length+f.e.c.length;Umb(b,f,Elb(d))}}}else{for(h=nX(i,(sN(),ZM)).mb();h.G();){f=Wv(h.H(),7);d+=f.b.c.length+f.e.c.length}for(g=nX(i,ZM).mb();g.G();){f=Wv(g.H(),7);f.b.c.length+f.e.c.length>0&&Umb(b,f,Elb(d))}}}for(j=a.length-1;j>=0;j--){i=a[j];if(LM(Wv(rJ(i,(eM(),TL)),28))){for(m=nX(i,(sN(),rN)).mb();m.G();){l=Wv(m.H(),7);if(l.b.c.length+l.e.c.length>0){e+=l.b.c.length+l.e.c.length;Umb(c,l,Elb(e))}}}else{for(n=nX(i,(sN(),rN)).mb();n.G();){l=Wv(n.H(),7);e+=l.b.c.length+l.e.c.length}for(m=nX(i,rN).mb();m.G();){l=Wv(m.H(),7);l.b.c.length+l.e.c.length>0&&Umb(c,l,Elb(e))}}}}\nfunction wfb(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r;m=sgb(a.g);o=sgb(b.g);n=vI(xI(a.i),a.a);p=vI(xI(b.i),b.a);i=vI(new HI(n.a,n.b),CI(new GI(m),1.3*c));q=vI(new HI(p.a,p.b),CI(new GI(o),1.3*d));h=Jlb(i.a-q.a);hq?j:q}c.e.b+=j-h.b;for(l=new Tob(a.a);l.a1){b=Qlb(f,a.c);j=(l=new uX(a.e.c),sX(l,(CX(),wX)),sJ(l,(eM(),TL),Wv(rJ(j,TL),28)),sJ(l,JL,Wv(rJ(j,JL),86)),l.k=a.e.b++,vU(a.b,l),l.j.b=j.j.b,l.j.a=b,m=new RX,QX(m,(sN(),ZM)),PX(m,j),m.i.a=l.j.a,m.i.b=l.j.b/2,n=new RX,QX(n,rN),PX(n,l),n.i.b=l.j.b/2,n.i.a=-n.j.a,o=new hW,dW(o,m),eW(o,n),l);vU(a.e.c.b,j);--k;f-=a.c+a.e.d}new HY(a.d,a.b,a.c);for(h=new Tob(e);h.ab.a||b.p>a.a){return}c=0;d=0;for(l=(g=(new Snb(a.o.a)).a.bb().mb(),new Ynb(g));l.a.G();){j=(e=Wv(l.a.H(),21),Wv(e.yb(),7));qgb(MI(Bv(tv(qz,1),Fzb,10,0,[j.f.i,j.i,j.a])).b,b.p,b.a)&&++c}for(m=(h=(new Snb(a.g.a)).a.bb().mb(),new Ynb(h));m.a.G();){j=(e=Wv(m.a.H(),21),Wv(e.yb(),7));qgb(MI(Bv(tv(qz,1),Fzb,10,0,[j.f.i,j.i,j.a])).b,b.p,b.a)&&--c}for(n=(i=(new Snb(b.o.a)).a.bb().mb(),new Ynb(i));n.a.G();){j=(e=Wv(n.a.H(),21),Wv(e.yb(),7));qgb(MI(Bv(tv(qz,1),Fzb,10,0,[j.f.i,j.i,j.a])).b,a.p,a.a)&&++d}for(k=(f=(new Snb(b.g.a)).a.bb().mb(),new Ynb(f));k.a.G();){j=(e=Wv(k.a.H(),21),Wv(e.yb(),7));qgb(MI(Bv(tv(qz,1),Fzb,10,0,[j.f.i,j.i,j.a])).b,a.p,a.a)&&--d}if(c1){for(i=WI(Eo(nX(b,rN)),0);i.b!=i.d.c;){h=Wv(_ub(i),7);if(h.b.c.length==0){e=new RX;QX(e,rN);e.j.a=h.j.a;e.j.b=h.j.b;PX(e,d);sJ(e,uib,rJ(h,uib));PX(h,null)}else{PX(g,d)}}}sJ(b,uib,null);sJ(b,Vhb,(null,vkb));sX(b,wX);sJ(d,(eM(),TL),Wv(rJ(b,TL),28));sJ(d,JL,Wv(rJ(b,JL),86));uU(a.b,0,d);return d}\nfunction NW(a,b,c,d,e,f,g){var h,i,j,k,l,m;l=c;j=new uX(g);sX(j,(CX(),xX));sJ(j,(Rib(),iib),e);sJ(j,(eM(),TL),(KM(),FM));sJ(j,tib,Wv(rJ(a,LL),15));i=Wv(rJ(a,SL),10);!i&&(i=new HI(e.a/2,e.b/2));sJ(j,SL,i);k=new RX;PX(k,j);if(!(b!=IM&&b!=JM)){h=f!=(sK(),qK)?f:pK;d>0?(l=vN(h)):(l=tN(vN(h)));sJ(a,WL,l)}switch(l.e){case 4:sJ(j,(Mjb(),vjb),(Xib(),Tib));sJ(j,dib,(Hgb(),Ggb));j.j.b=e.b;QX(k,(sN(),ZM));k.i.b=i.b;break;case 2:sJ(j,(Mjb(),vjb),(Xib(),Vib));sJ(j,dib,(Hgb(),Egb));j.j.b=e.b;QX(k,(sN(),rN));k.i.b=i.b;break;case 1:sJ(j,mib,(Hhb(),Ghb));j.j.a=e.a;QX(k,(sN(),pN));k.i.a=i.a;break;case 3:sJ(j,mib,(Hhb(),Ehb));j.j.a=e.a;QX(k,(sN(),$M));k.i.a=i.a;}if(b==EM||b==GM||b==FM){m=0;switch(l.e){case 4:case 2:m=null.cd;b==GM&&(m/=null.cd);break;case 1:case 3:m=null.cd;b==GM&&(m/=null.cd);}sJ(j,Cib,m)}sJ(j,hib,l);return j}\nfunction LP(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;j=new jJ;r=(mp(),new ntb);Umb(r,a,MP(a));d=(Mh(2,Vyb),new HU(2));!!a.c&&vU(d,a.c);!!a.d&&vU(d,a.d);for(n=new Tob(d);n.a1&&(TI(j,o,j.c.b,j.c),true);bvb(c)}}}o=p}}}return j}\nfunction m1(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p;a.n=Wv(rJ(a.g,(Rib(),Jib)),15).a*Wv(rJ(a.g,(Mjb(),Ejb)),15).a;a.e=a.n*Wv(rJ(a.g,qjb),15).a;a.i=a.g.c.c.length;h=a.i-1;m=0;a.j=0;a.k=0;a.a=Co(xv(PF,Txb,24,a.i,0,1));a.b=Co(xv(HF,Txb,184,a.i,6,1));for(g=new Tob(a.g.c);g.a0&&vU(a.p,k);vU(a.o,k)}b-=d;n=i+b;j+=b*a.e;DU(a.a,h,Elb(n));DU(a.b,h,j);a.j=Plb(a.j,n);a.k=Nlb(a.k,j);a.d+=b;b+=p}}\nfunction sN(){sN=iI;var a;qN=new uN(szb,0);$M=new uN('NORTH',1);ZM=new uN('EAST',2);pN=new uN('SOUTH',3);rN=new uN('WEST',4);dN=(ypb(),new Frb((a=Wv(Hkb(Kz),11),new atb(a,Wv(exb(a,a.length),11),0))));eN=Kk(Vsb($M,Bv(tv(Kz,1),uyb,32,0,[])));_M=Kk(Vsb(ZM,Bv(tv(Kz,1),uyb,32,0,[])));mN=Kk(Vsb(pN,Bv(tv(Kz,1),uyb,32,0,[])));oN=Kk(Vsb(rN,Bv(tv(Kz,1),uyb,32,0,[])));jN=Kk(Vsb($M,Bv(tv(Kz,1),uyb,32,0,[pN])));cN=Kk(Vsb(ZM,Bv(tv(Kz,1),uyb,32,0,[rN])));lN=Kk(Vsb($M,Bv(tv(Kz,1),uyb,32,0,[rN])));fN=Kk(Vsb($M,Bv(tv(Kz,1),uyb,32,0,[ZM])));nN=Kk(Vsb(pN,Bv(tv(Kz,1),uyb,32,0,[rN])));aN=Kk(Vsb(ZM,Bv(tv(Kz,1),uyb,32,0,[pN])));iN=Kk(Vsb($M,Bv(tv(Kz,1),uyb,32,0,[ZM,rN])));bN=Kk(Vsb(ZM,Bv(tv(Kz,1),uyb,32,0,[pN,rN])));kN=Kk(Vsb($M,Bv(tv(Kz,1),uyb,32,0,[pN,rN])));gN=Kk(Vsb($M,Bv(tv(Kz,1),uyb,32,0,[ZM,pN])));hN=Kk(Vsb($M,Bv(tv(Kz,1),uyb,32,0,[ZM,pN,rN])))}\nfunction q$(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,A,B,C;u=new GU;for(m=new Tob(a.c);m.a=b.length)return {'done':true};var a=b[d++];return {'value':[a,c.get(a)],'done':false}}}};if(!Ztb()){e.prototype.createObject=function(){return {}};e.prototype.get=function(a){return this.obj[':'+a]};e.prototype.set=function(a,b){this.obj[':'+a]=b};e.prototype[$Ab]=function(a){delete this.obj[':'+a]};e.prototype.keys=function(){var a=[];for(var b in this.obj){b.charCodeAt(0)==58&&a.push(b.substring(1))}return a}}return e}\nfunction fQ(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;k=new kW;sJ(k,PP,b);Umb(a.e,b,k);sJ(k,(Rib(),zib),c);!!a.d&&iQ(a.d,k,false);hQ(b,k);if(Lzb in b.a){q=k.a;r=Wv(Pu(b,Lzb),69);p=Wv(Pu(r,'left'),104);!!p&&(q.b=p.a);t=Wv(Pu(r,'top'),104);!!t&&(q.d=t.a);s=Wv(Pu(r,'right'),104);!!s&&(q.c=s.a);e=Wv(Pu(r,Azb),104);!!e&&(q.a=e.a)}l=(d=Wv(Hkb(mF),11),new atb(d,Wv(exb(d,d.length),11),0));sJ(k,jib,l);a.g==null&&(a.g=Xv(rJ(k,(zQ(),yQ))));if(Mzb in b.a){u=Pu(b,Mzb);if(!u.hc()){throw new GQ(\"The 'children' property of nodes must be an array.\",u,b)}j=u.hc();if(j.a.length>0){!!c&&sJ(c,sib,k);h=xv(qB,Nzb,9,j.a.length,0,1);for(n=0;nB[i]&&(q=i);for(l=new Tob(a.b.c);l.a1){vU(f,new mgb(q,v,c));for(o=(l=(new Snb(v.a)).a.bb().mb(),new Ynb(l));o.a.G();){n=(j=Wv(o.a.H(),21),Wv(j.yb(),27));BU(e,n.b)}}if(g.a.Y()>1){vU(f,new mgb(q,g,c));for(o=(l=(new Snb(g.a)).a.bb().mb(),new Ynb(l));o.a.G();){n=(j=Wv(o.a.H(),21),Wv(j.yb(),27));BU(e,n.b)}}}}\nfunction dab(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,A;e=0;s=0;r=(mp(),new ntb);d=new ntb;f=new ntb;A=new ntb;fab(a,f,A);b=null;q=0;w=0;t=true;i=true;for(m=0,o=a.length;mb.j.d){p=a.c[b.f.d];s=a.c[m.f.d];if(p==s){continue}f7(i7(h7(j7(g7(new k7,1),100),p),s))}}}}}}}\nfunction t3(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;g=new z3(a);h=Ao(pl(b,g));Gpb(h,new C3);e=a.b;switch(e.c){case 2:i=new E3(e.a);c=Al(pl(h,i));od(c)?(j=Wv(pd(c),91).b):(j=15);i=new E3(Jeb(e));c=Al(pl(h,i));od(c)?(f=Wv(pd(c),91).b):(f=15);i=new E3(e.b);c=Al(pl(h,i));od(c)?(k=Wv(pd(c),91).b):(k=15);d=p3(a,j,f,k);stb(b,new w3(d,a.c,a.e,a.a.c.f,e.a));stb(b,new w3(d,a.c,a.e,a.a.c.f,Jeb(e)));stb(b,new w3(d,a.c,a.e,a.a.c.f,e.b));break;case 1:i=new E3(e.a);c=Al(pl(h,i));od(c)?(j=Wv(pd(c),91).b):(j=15);i=new E3(e.b);c=Al(pl(h,i));od(c)?(k=Wv(pd(c),91).b):(k=15);d=q3(a,j,k);stb(b,new w3(d,a.c,a.e,a.a.c.f,e.a));stb(b,new w3(d,a.c,a.e,a.a.c.f,e.b));break;case 0:i=new E3(e.a);c=Al(pl(h,i));od(c)?(j=Wv(pd(c),91).b):(j=15);d=(l=a.b,m=xfb(a.a.c,a.a.d,j),Ue(a.a.a,Veb(m)),n=s3(a.a.b,m.a,l),o=new Dfb((!m.k&&(m.k=new Efb(Xeb(m))),m.k)),zfb(o),!n?o:Gfb(o,n));stb(b,new w3(d,a.c,a.e,a.a.c.f,e.a));break;default:throw new slb('The loopside must be defined.');}return d}\nfunction Pbb(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;for(h=new Tob(a.a.c);h.a0){d=l.Y();j=hw(Math.floor((d+1)/2))-1;e=hw(Math.ceil((d+1)/2))-1;if(b.k==Kbb){for(k=e;k>=j;k--){if(b.a[u.k]==u){p=Wv(l.sb(k),27);o=Wv(p.a,9);if(!ttb(c,p.b)&&n>a.b.e[o.k]){b.a[o.k]=u;b.f[u.k]=b.f[o.k];b.a[u.k]=b.f[u.k];n=a.b.e[o.k]}}}}else{for(k=j;k<=e;k++){if(b.a[u.k]==u){r=Wv(l.sb(k),27);q=Wv(r.a,9);if(!ttb(c,r.b)&&n0||c.k==Kbb&&er?n:r}else{c.n[b.k]=d>(n>r?n:r)?d:n>r?n:r}}}else{q=a.d.f;p=Rbb(a,c.i[b.k]);m=Rbb(a,c.i[l.k]);if(c.k==Kbb){o=Ixb(c.n[b.k])+Ixb(c.d[g.k])+g.j.b+g.e.a+q-(Ixb(c.n[l.k])+Ixb(c.d[j.k])-j.e.d);Xbb(p,m,o)}else{o=Ixb(c.n[b.k])+Ixb(c.d[g.k])-g.e.d-Ixb(c.n[l.k])-Ixb(c.d[j.k])-j.j.b-j.e.a-q;Xbb(p,m,o)}}}else{r=a.e.Ic(r,b,g)}g=c.a[g.k]}while(g!=b);ycb(a.e,b)}\nfunction sZ(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;m=false;l=false;if(MM(Wv(rJ(d,(eM(),TL)),28))){g=false;h=false;t:for(o=new Tob(d.f);o.a=d.j.b/2}else{s=!l}if(s){r=Wv(rJ(d,(Rib(),Qib)),20);if(!r){f=new GU;sJ(d,Qib,f)}else if(m){f=r}else{e=Wv(rJ(d,Yhb),20);if(!e){f=new GU;sJ(d,Yhb,f)}else{r.Y()<=e.Y()?(f=r):(f=e)}}}else{e=Wv(rJ(d,(Rib(),Yhb)),20);if(!e){f=new GU;sJ(d,Yhb,f)}else if(l){f=e}else{r=Wv(rJ(d,Qib),20);if(!r){f=new GU;sJ(d,Qib,f)}else{e.Y()<=r.Y()?(f=e):(f=r)}}}f.ib(a);sJ(a,(Rib(),Zhb),c);if(b.d==c){eW(b,null);c.b.c.length+c.e.c.length==0&&PX(c,null)}else{dW(b,null);c.b.c.length+c.e.c.length==0&&PX(c,null)}_I(b.a)}\nfunction rU(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;c=new bV(b);c.a||kU(b);j=jU(b);i=new xk;q=new oV;for(p=new Tob(b.b);p.aj.k){++b;n=true}if(!!o&&!!j&&o.k>j.k){++b;p=true}if(!!m&&!!h&&m.kh.k){++b;i=true}if(!!m&&!!h&&m.kj.k){++b;k=true}i&&k&&h==j&&--b}}}}}return b}\nfunction Oab(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,A,B,C,D;for(t=a.a,u=0,v=t.length;u0){l=Wv(yU(m.d.a,g-1),9);B=Xjb(a.b,m,l);q=m.i.b-m.e.d-(l.i.b+l.j.b+l.e.a+B)}else{q=m.i.b-m.e.d}j=q1&&(g=Qlb(g,Jlb(Wv(tn(h.a,1),10).b-k.b)))}}}}}else{for(p=new Tob(b.f);p.ae){f=m.a-e;g=$xb;d.c=xv(UF,syb,1,0,4,1);e=m.a}if(m.a>=e){d.c[d.c.length]=h;h.a.b>1&&(g=Qlb(g,Jlb(Wv(tn(h.a,h.a.b-2),10).b-m.b)))}}}}}if(d.c.length!=0&&f>b.j.a/2&&g>b.j.b/2){n=new RX;PX(n,b);QX(n,(sN(),$M));n.i.a=b.j.a/2;r=new RX;PX(r,b);QX(r,pN);r.i.a=b.j.a/2;r.i.b=b.j.b;for(i=new Tob(d);i.a=j.b?dW(h,r):dW(h,n)}else{j=Wv(ZI(h.a),10);q=h.a.b==0?MX(h.c):Wv(VI(h.a),10);q.b>=j.b?eW(h,r):eW(h,n)}l=Wv(rJ(h,(eM(),CL)),44);!!l&&Ve(l,j,true)}b.i.a=e-b.j.a/2}}\nfunction N2(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;r=new GU;s=new GU;t=new GU;for(f=new Tob(b);f.a50?(r.c[r.c.length]=e,true):e.k>0?(s.c[s.c.length]=e,true):(t.c[t.c.length]=e,true)}if(s.c.length==1&&r.c.length==0){xU(r,s);s.c=xv(UF,syb,1,0,4,1)}r.c.length!=0&&Zsb(U2(a.a),(Ieb(),meb))&&Zsb(U2(a.a),(Ieb(),oeb))?L2(a,r):xU(s,r);s.c.length==0||M2(a,s);if(t.c.length!=0){c=V2(a.a);if(c.c!=0){k=new Tob(t);i=(_b(c),Nl((new vl(c)).a));while(k.a1){p=Wv(nm(i),60);aeb(e,p,true);Sob(k);Y2(a.a,p)}}}m=t.c.length;d=O2(a);n=new GU;g=m/T2(a.a).c|0;for(h=0;h3){xU(n,(Ieb(),Ieb(),geb));o-=4}switch(o){case 3:vU(n,Meb(d));case 2:q=Leb(Meb(d));do{q=Leb(q)}while(!Zsb(U2(a.a),q));n.c[n.c.length]=q;q=Neb(Meb(d));do{q=Neb(q)}while(!Zsb(U2(a.a),q));n.c[n.c.length]=q;break;case 1:vU(n,Meb(d));}l=new Tob(n);j=new Tob(t);while(l.a1&&(a.c[l]=true):t.g==rN&&t.e.c.length+t.b.c.length>1&&(a.d[l]=true)}if(q.g==(CX(),BX)){++i[l];g[l]=true}}}c=true;p=true;for(h=0;h0;r=v.e.c.length>0;j&&r?(m.c[m.c.length]=v,true):j?(p.c[p.c.length]=v,true):r&&(u.c[u.c.length]=v,true)}for(o=new Tob(p);o.a=p){if(u>p){o.c=xv(UF,syb,1,0,4,1);p=u}o.c[o.c.length]=g}}if(o.c.length!=0){n=Wv(yU(o,vvb(b,o.c.length)),77);H.a.eb(n)!=null;n.i=q++;agb(n,F,B);o.c=xv(UF,syb,1,0,4,1)}}w=a.c.length+1;for(h=new Tob(a);h.aG.i){vnb(c);BU(G.d,d);if(d.c>0){d.a=G;vU(G.j,d);d.b=C;vU(C.d,d)}}}}}\nfunction OO(a){var b,c,d;for(d=new Lsb((new Fsb(a.c)).a);htb(d.a);){c=(d.b=itb(d.a),new Psb(d.c,d.b));b=Wv(c.b.b[c.a.e],62);switch(Wv(c.a,67).e){case 0:b.d=0;b.e=-(b.b+a.d);break;case 1:b.d=(a.e.e.j.a-b.c)/2;b.e=-(b.b+a.d);break;case 2:b.d=a.e.e.j.a-b.c;b.e=-(b.b+a.d);break;case 3:b.d=0;b.e=a.e.e.j.b+a.d;break;case 4:b.d=(a.e.e.j.a-b.c)/2;b.e=a.e.e.j.b+a.d;break;case 5:b.d=a.e.e.j.a-b.c;b.e=a.e.e.j.b+a.d;break;case 6:b.d=-(b.c+a.d);b.e=0;break;case 7:b.d=-(b.c+a.d);b.e=(a.e.e.j.b-b.b)/2;break;case 8:b.d=-(b.c+a.d);b.e=a.e.e.j.b-b.b;break;case 9:b.d=a.e.e.j.a+a.d;b.e=0;break;case 10:b.d=a.e.e.j.a+a.d;b.e=(a.e.e.j.b-b.b)/2;break;case 11:b.d=a.e.e.j.a+a.d;b.e=a.e.e.j.b-b.b;break;case 12:b.d=a.q.b+a.d;b.e=a.q.d+a.d;break;case 13:b.d=(a.e.e.j.a-b.c)/2;b.e=a.q.d+a.d;break;case 14:b.d=a.e.e.j.a-a.q.c-b.c-a.d;b.e=a.q.d+a.d;break;case 15:b.d=a.q.b+a.d;b.e=(a.e.e.j.b-b.b)/2;break;case 16:b.d=(a.e.e.j.a-b.c)/2;b.e=(a.e.e.j.b-b.b)/2;break;case 17:b.d=a.e.e.j.a-a.q.c-b.c-a.d;b.e=(a.e.e.j.b-b.b)/2;break;case 18:b.d=a.q.b+a.d;b.e=a.e.e.j.b-a.q.a-b.b-a.d;break;case 19:b.d=(a.e.e.j.a-b.c)/2;b.e=a.e.e.j.b-a.q.a-b.b-a.d;break;case 20:b.d=a.e.e.j.a-a.q.c-b.c-a.d;b.e=a.e.e.j.b-a.q.a-b.b-a.d;}}}\nfunction ddb(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,A,B,C,D,F,G,H,I;F=new aJ;B=new aJ;o=-1;for(s=new Tob(a);s.a=m){if(u>m){l.c=xv(UF,syb,1,0,4,1);m=u}l.c[l.c.length]=q}}if(l.c.length!=0){k=Wv(yU(l,vvb(b,l.c.length)),80);cwb(H.a,k)!=null;k.d=n++;jdb(k,F,B);l.c=xv(UF,syb,1,0,4,1)}}w=a.c.length+1;for(r=new Tob(a);r.aG.d){vnb(c);BU(G.b,d);if(d.c>0){d.a=G;vU(G.e,d);d.b=C;vU(C.b,d)}}}}}\nfunction e0(a){switch(a.e){case 14:return new wY;case 37:return new SY;case 8:return new YY;case 30:return new cZ;case 38:return new qZ;case 3:return new tZ;case 47:case 1:return new SZ((XZ(),WZ));case 4:return new wZ;case 49:return new AZ;case 23:return new $5;case 13:return new d$;case 34:return new j$;case 40:return new w$;case 35:return new F$;case 44:return new o4;case 28:return new I$;case 39:return new L$;case 27:return new N$;case 6:return new R$;case 31:return new m0;case 9:return new q0;case 43:return new w0;case 17:return new A0;case 18:return new G0;case 29:return new S0;case 11:return new q1;case 12:return new Z0;case 36:return new _0;case 46:case 0:return new SZ((XZ(),VZ));case 41:return new b1;case 15:return new e1;case 33:return new k1;case 42:return new R1;case 22:return new X1;case 19:return new k0;case 10:return new _1;case 7:return new c2;case 24:return new f2;case 21:return new h2;case 16:return new n2;case 45:return new q2;case 26:return new x2;case 20:return new A2;case 25:return new H2;case 5:return new l3;case 32:return new u3;case 48:case 2:return new SZ((XZ(),UZ));default:throw new slb('No implementation is available for the layout processor '+(a.d!=null?a.d:''+a.e));}}\nfunction PO(a){var b,c,d,e,f,g,h;c=a.e.e.j;a.b?(b=Wv(oW(a.e,(eM(),jL)),65)):(b=new EP(a.k,a.k,a.k,a.k));e=c.a;(a.b||a.g[1]!=(zM(),xM))&&(e-=b.b+b.c);f=c.a;(a.b||a.g[3]!=(zM(),xM))&&(f-=b.b+b.c);g=c.b;(a.b||a.g[4]!=(zM(),xM))&&(g-=b.d+b.a);d=c.b;(a.b||a.g[2]!=(zM(),xM))&&(d-=b.d+b.a);if(aP(a,(sN(),$M))==(zM(),xM)){a.j[1]=(e-dP(a,$M))/bP(a,$M);a.f=a.b?b.b+(eP(a,$M)==1?a.j[1]:0):a.j[1]}else{a.j[1]=a.k;h=dP(a,$M)+a.j[1]*(eP(a,$M)-1);switch(aP(a,$M).e){case 2:a.f=b.b;break;case 3:a.f=b.b+(e-h)/2;break;case 4:a.f=c.a-h-b.c;}}if(aP(a,pN)==xM){a.j[3]=(f-dP(a,pN))/bP(a,pN);a.r=c.a-(a.b?b.c+(eP(a,pN)==1?a.j[3]:0):a.j[3])}else{a.j[3]=a.k;h=dP(a,pN)+a.j[3]*(eP(a,pN)-1);switch(aP(a,pN).e){case 2:a.r=h+b.b;break;case 3:a.r=c.a-(f-h)/2-b.c;break;case 4:a.r=c.a-b.c;}}if(aP(a,rN)==xM){a.j[4]=(g-dP(a,rN))/bP(a,rN);a.s=c.b-(a.b?b.a+(eP(a,rN)==1?a.j[4]:0):a.j[4])}else{a.j[4]=a.k;h=dP(a,rN)+a.j[4]*(eP(a,rN)-1);switch(aP(a,rN).e){case 2:a.s=h+b.d;break;case 3:a.s=c.b-(g-h)/2-b.a;break;case 4:a.s=c.b-b.a;}}if(aP(a,ZM)==xM){a.j[2]=(d-dP(a,ZM))/bP(a,ZM);a.a=a.b?b.d+(eP(a,ZM)==1?a.j[2]:0):a.j[2]}else{a.j[2]=a.k;h=dP(a,ZM)+a.j[2]*(eP(a,ZM)-1);switch(aP(a,ZM).e){case 2:a.a=b.d;break;case 3:a.a=b.d+(d-h)/2;break;case 4:a.a=c.b-h-b.a;}}}\nfunction hab(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,A,B,C,D,F,G,H,I;G=0;g=0;l=b[0].d;B=c[0].d;for(o=0,q=c.length;o0){u=(Bxb(A.b>0),Wv(A.a.sb(A.c=--A.b),7));w=0;for(f=new Tob(u.b);f.a0){if(u.g==(sN(),$M)){a.a[u.k]=G;++G}else{a.a[u.k]=G+s+t;++t}g+=w}}G+=t}else{r=0;for(v=new Tob(m.f);v.a0){++G;g+=r}}}C=xv(mw,Yyb,26,g,12,1);i=0;for(n=0,p=b.length;n0){j%2>0&&(d+=H[j+1]);j=(j-1)/2|0;++H[j]}}return d}\nfunction BV(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,A,B,C,D,F,G,H,I,J;nI(b,'Compound graph postprocessor',1);c=Ckb(Ixb(Xv(rJ(a,(Mjb(),gjb)))));h=Wv(rJ(a,(Rib(),bib)),144);l=new vtb;for(w=h.W().mb();w.G();){v=Wv(w.H(),12);g=new IU(h.U(v));Gpb(g,new $V(a));F=VV((Cxb(0,g.c.length),Wv(g.c[0],114)));H=WV(Wv(yU(g,g.c.length-1),114));_I(v.a);C=F.f;SW(H.f,C)?(B=Wv(rJ(C,sib),55)):(B=hX(C));o=Wv(rJ(v,(eM(),CL)),44);if(ol(g,zV)){if(!o){o=new jJ;sJ(v,CL,o)}else{_I(o)}}else !!o&&sJ(v,CL,null);q=null;for(f=new Tob(g);f.adAb;J=Jlb(q.b-t.b)>dAb;(!c&&I&&J||c&&(I||J))&&QI(v.a,D)}Ue(v.a,d);d.b==0?(q=D):(q=(Bxb(d.b!=0),Wv(d.c.b.c,10)));s=Wv(rJ(r,CL),44);if(s){n=new jJ;gJ(n,0,s);hJ(n,u);Ue(o,n)}if(WV(e)==H){if(hX(H.f)!=e.a){u=new FI;MW(u,hX(H.f),B)}sJ(v,Pib,u)}p=new Fnb(r.b,0);while(p.bF?l:F}for(d=new Tob(C.e);d.aF?B:F}}sJ(u,Fab,Elb(l));sJ(u,Gab,Elb(B))}}r=0;for(n=new Tob(b.c);n.a0&&j>0&&WW(r,new HI(C,j),true)}}p=Nlb(p,r.i.a+r.j.a);q=Nlb(q,r.i.b+r.j.b);for(n=new Tob(r.c);n.a1){A=xv(LF,Txb,15,a.a.length,0,1);j=Do(a.a.length);p=0;o=0;c=2*b.d.a.c.length+1;H:for(w=new Tob(b.f);w.a0){A[v.k]=new llb(G/(v.b.c.length+v.e.c.length));p=Rlb(p,A[v.k].a);o=Olb(o,A[v.k].a)}else r&&(A[v.k]=new llb(G))}q=(!b.d?-1:zU(b.d.a,b,0))+1;n=b.d.a.c.length+1;for(i=new Tob(j);i.af.j.e+f.j.b){o.d=true}else{o.d=true;o.c=true}}}d.b!=d.d.c&&(b=c)}if(o){g=Wv(Smb(u,i.d.f),25);if(b.bg.j.e+g.j.b){o.d=true}else{o.d=true;o.c=true}}}}for(j=Uh(iX(s));Cm(j);){i=Wv(Dm(j),12);if(i.a.b!=0){b=Wv(VI(i.a),10);if(i.d.g==(sN(),$M)){C=new X4(b,new HI(b.a,f.j.e),f,i);C.c=true;B.c[B.c.length]=C}if(i.d.g==pN){C=new X4(b,new HI(b.a,f.j.e+f.j.b),f,i);C.d=true;B.c[B.c.length]=C}}}}}if(B.c.length!=0){ypb();Gpb(B,null);n=(Cxb(0,B.c.length),Wv(B.c[0],142));e=new L3(n,a.d);for(m=1;mc&&(C=o.a.db(s,o),C==null)}L=new vtb;p=new vtb;for(u=(G=(new Snb(K.a)).a.bb().mb(),new Ynb(G));u.a.G();){s=(l=Wv(u.a.H(),21),Wv(l.yb(),9));g=b==1?mX(s):iX(s);for(j=(Il(),new Im(Dl(ul(g.a,new yl))));Cm(j);){i=Wv(Dm(j),12);rY(s.d)!=rY(i.d.f.d)&&stb(L,i.d.f)}}for(v=(H=(new Snb(o.a)).a.bb().mb(),new Ynb(H));v.a.G();){s=(l=Wv(v.a.H(),21),Wv(l.yb(),9));g=b==1?mX(s):iX(s);for(j=(Il(),new Im(Dl(ul(g.a,new yl))));Cm(j);){i=Wv(Dm(j),12);rY(s.d)!=rY(i.d.f.d)&&stb(p,i.d.f)}}if(aZ){Fmb()}B=Wv(yU(a.d.c.c,d+(b==1?1:-1)),16);q=eyb;r=$xb;for(m=0;mm?q:m):p.a.R(s)&&(r=r1||tl(Sh(new gr(Ti(Bv(tv(UF,1),syb,1,4,[t.b,t.e])))))>1)&&f.ib((ohb(),ihb));if(gw(rJ(p,(Mjb(),kjb)))===gw((p9(),n9))&&!(Hzb in c.a)){d=new jJ;try{i=Pu(c,Hzb).hc();for(g=0;g0&&(a.a[R.k]=$++)}}else{L=0;for(S=new Tob(D.f);S.a0&&++$}}eb=0;for(H=0,K=c.length;H0){R=(Bxb(V.b>0),Wv(V.a.sb(V.c=--V.b),7));U=0;for(h=new Tob(R.b);h.a0){if(R.g==(sN(),$M)){a.a[R.k]=eb;++eb}else{a.a[R.k]=eb+M+O;++O}}}eb+=O}else{L=0;for(S=new Tob(D.f);S.a0&&++eb}}T=(mp(),new ntb);n=new Wub;for(F=0,I=b.length;Fj.b&&(j.b=W)}else if(R.f.d==Z){Wj.c&&(j.c=W)}}}ipb(o,0,o.length,(hsb(),hsb(),gsb));db=xv(mw,Yyb,26,o.length,12,1);d=xv(mw,Yyb,26,eb+1,12,1);for(q=0;q0){w%2>0&&(e+=hb[w+1]);w=(w-1)/2|0;++hb[w]}}B=xv(sE,syb,156,o.length*2,0,1);for(t=0;t1?(b.c=Skb(this,a-1)):(b.c=this);return b};_.Pc=function Rkb(){Gkb(this);return this.b};_.Qc=function Tkb(){return Ikb(this)};_.Rc=function Vkb(){return Jkb(this)};_.Sc=function Xkb(){return (this.g&4)!=0};_.Tc=function Ykb(){return (this.g&1)!=0};_.w=function _kb(){return ((this.g&2)!=0?'interface ':(this.g&1)!=0?'':'class ')+(Gkb(this),this.n)};_.g=0;var Fkb=1;hI(119,72,{3:1,119:1,54:1,46:1},alb);hI(29,72,cyb,rlb,slb);hI(95,72,Vxb,nkb,okb);hI(231,1,{3:1,231:1});var blb;hI(24,231,{3:1,23:1,24:1,231:1},wlb);_.F=function ylb(a){return vlb(this,Wv(a,24))};_.t=function zlb(a){return aw(a,24)&&Wv(a,24).a==this.a};_.v=function Alb(){return this.a};_.w=function Clb(){return Dlb(this.a)};_.a=0;Uv={3:1,345:1,23:1,2:1};hI(350,1,fyb,smb);_.$b=function tmb(a,b){return rmb($v(a),$v(b))};hI(257,95,Vxb,Cmb);hI(145,1,{23:1,145:1});_.F=function Kmb(a){return Jmb(this,Wv(a,145))};_.t=function Lmb(a){var b;if(a===this){return true}if(!aw(a,145)){return false}b=Wv(a,145);return emb(this.a,b.a)};_.v=function Mmb(){return Pxb(this.a)};_.w=function Nmb(){return this.a};hI(358,29,cyb,Omb);hI(256,29,{3:1,54:1,29:1,46:1,256:1},Pmb);hI(185,145,gyb);var jxb,kxb,lxb;hI(289,185,gyb,oxb);_.Zc=function pxb(a,b,c){var d,e;d=xv(jw,hyb,26,c,12,1);for(e=0;ec){throw new okb(iyb)}}g=xv(jw,hyb,26,f,12,1);k=0;h=0;for(i=0;i0){d=a[b+i++];if((d&192)!=128){throw new slb('Invalid UTF8 sequence at '+(b+i-1)+', byte='+(d>>>0).toString(16))}e=e<<6|d&63}k+=Ekb(e,g,k)}return g};var UF=Nkb(kyb,'Object',1);var _F=Nkb(kyb,'Throwable',46);var KF=Nkb(kyb,'Exception',54);var VF=Nkb(kyb,'RuntimeException',72);var Zy=Nkb(lyb,'JavaScriptException',164);var ez=Nkb(myb,'StackTraceCreator/Collector',642);var bz=Nkb(myb,'StackTraceCreator/CollectorLegacy',356);var dz=Nkb(myb,'StackTraceCreator/CollectorModern',643);var cz=Nkb(myb,'StackTraceCreator/CollectorModernNoSourceMap',357);var wF=Nkb(nyb,'IOException',181);var zF=Nkb(nyb,'UnsupportedEncodingException',351);var GF=Nkb(kyb,'Class',288);var FF=Nkb(kyb,'ClassCastException',119);var MF=Nkb(kyb,'IllegalArgumentException',29);var OF=Nkb(kyb,'IndexOutOfBoundsException',95);var TF=Nkb(kyb,'Number',231);var PF=Nkb(kyb,'Integer',24);var $F=Nkb(kyb,'String',2);var XF=Nkb(kyb,'String/1',350);var ZF=Nkb(kyb,'StringIndexOutOfBoundsException',257);var bG=Nkb(oyb,'Charset',145);var cG=Nkb(oyb,'IllegalCharsetNameException',358);var dG=Nkb(oyb,'UnsupportedCharsetException',256);var JH=Nkb(pyb,'EmulatedCharset',185);var HH=Nkb(pyb,'EmulatedCharset/LatinCharset',289);var IH=Nkb(pyb,'EmulatedCharset/UtfCharset',355);hI(669,1,{3:1});var sw=Nkb(qyb,'Optional',669);hI(601,669,{3:1},Ab);_.t=function Bb(a){return a===this};_.v=function Cb(){return 2040732332};_.w=function Db(){return 'Optional.absent()'};_.A=function Eb(a){_b(a);return zb(),yb};var yb;var nw=Nkb(qyb,'Absent',601);var ow=Pkb(qyb,'Function');hI(208,1,{},Kb);_.C=function Lb(a){return Ib(a)};var rw=Nkb(qyb,'Joiner',208);hI(363,208,{},Nb);_.C=function Ob(a){return Mb(this,a)};var pw=Nkb(qyb,'Joiner/1',363);hI(362,1,{},Rb);var qw=Nkb(qyb,'Joiner/MapJoiner',362);var tw=Pkb(qyb,'Predicate');var gc;hI(244,1,{68:1,244:1,3:1},ic);_.D=function jc(a){var b;for(b=0;b0};_.H=function kd(){if(this.b>=this.c){throw new nvb}return Lk(this,this.b++)};_.L=function ld(){return this.b};_.M=function md(){if(this.b<=0){throw new nvb}return Lk(this,--this.b)};_.N=function nd(){return this.b-1};_.b=0;_.c=0;var Dw=Nkb(xyb,'AbstractIndexedListIterator',378);hI(428,108,wyb);_.G=function rd(){return od(this)};_.H=function sd(){return pd(this)};_.d=1;var Ew=Nkb(xyb,'AbstractIterator',428);hI(653,1,{144:1});_.P=function vd(){var a;return a=this.f,!a?(this.f=this.S()):a};_.T=function wd(){return new Bf(this.P())};_.t=function xd(a){return Mp(this,a)};_.v=function yd(){return this.P().v()};_.V=function zd(){return this.Y()==0};_.W=function Ad(){return ud(this)};_.w=function Bd(){return this.P().w()};var Xw=Nkb(xyb,'AbstractMultimap',653);hI(294,653,zyb);_.Q=function Nd(){Cd(this)};_.R=function Od(a){return Qmb(this.b,a)};_.S=function Pd(){return new Ie(this,this.b)};_.T=function Qd(){return new If(this,this.b)};_.$=function Rd(){return Id(this.Z())};_.U=function Sd(a){return Dd(this,a)};_.X=function Td(a){return Gd(this,a)};_.Y=function Ud(){return this.c};_.c=0;var Uw=Nkb(xyb,'AbstractMapBasedMultimap',294);hI(600,294,zyb);_.Z=function Xd(){return new HU(this.a)};_.$=function Yd(){return Gi(),Gi(),Fi};_.U=function $d(a){return Wv(Dd(this,a),20)};_.X=function _d(a){return Wv(Gd(this,a),20)};_.P=function Wd(){var a;return a=this.f,!a?(this.f=new Ie(this,this.b)):a};_.t=function Zd(a){return Mp(this,a)};var Fw=Nkb(xyb,'AbstractListMultimap',600);hI(388,1,Ayb);_.G=function ae(){return this.b.b||this.d.G()};_.H=function be(){var a;if(!this.d.G()){a=pnb(this.b);a.yb();this.a=Wv(a.zb(),19);this.d=this.a.mb()}return this.d.H()};_.I=function ce(){this.d.I();this.a.V()&&qnb(this.b);--this.c.c};var Kw=Nkb(xyb,'AbstractMapBasedMultimap/Itr',388);hI(389,388,Ayb,de);var Gw=Nkb(xyb,'AbstractMapBasedMultimap/1',389);hI(638,1,Byb);_.Q=function ke(){this.bb().Q()};_._=function le(a){return ee(this,a)};_.R=function me(a){return !!ge(this,a,false)};_.ab=function ne(a){var b,c,d;for(c=this.bb().mb();c.G();){b=Wv(c.H(),21);d=b.zb();if(gw(a)===gw(d)||a!=null&&rb(a,d)){return true}}return false};_.t=function oe(a){return fe(this,a)};_.cb=function pe(a){return re(ge(this,a,false))};_.v=function se(){return Apb(this.bb())};_.V=function te(){return this.Y()==0};_.W=function ue(){return new Snb(this)};_.db=function ve(a,b){throw new Imb('Put not supported on this map')};_.eb=function we(a){return re(ge(this,a,true))};_.Y=function xe(){return this.bb().Y()};_.w=function ye(){return ie(this)};_.fb=function ze(){return new aob(this)};var tG=Nkb(Cyb,'AbstractMap',638);hI(654,638,Byb);_.bb=function Ce(){return Ae(this)};_.W=function De(){var a;a=this.d;return !a?(this.d=new Bf(this)):a};_.fb=function Ee(){return Be(this)};var ny=Nkb(xyb,'Maps/ViewCachingAbstractMap',654);hI(262,654,Byb,Ie);_.cb=function Ne(a){return Fe(this,a)};_.eb=function Qe(a){return Ge(this,a)};_.Q=function Je(){this.a==this.b.b?Cd(this.b):Ml(new xf(this))};_.R=function Ke(a){return qp(this.a,a)};_.hb=function Le(){return new sf(this)};_.gb=function(){return this.hb()};_.t=function Me(a){return this===a||fe(this.a,a)};_.v=function Oe(){return Apb(new inb(this.a))};_.W=function Pe(){return ud(this.b)};_.Y=function Re(){return Zmb(this.a)};_.w=function Se(){return ie(this.a)};var Jw=Nkb(xyb,'AbstractMapBasedMultimap/AsMap',262);hI(640,1,Dyb);_.ib=function $e(a){return Te()};_.jb=function _e(a){return Ue(this,a)};_.Q=function af(){We(this)};_.kb=function bf(a){return Ve(this,a,false)};_.lb=function cf(a){return Xe(this,a)};_.V=function df(){return this.Y()==0};_.nb=function ef(a){return Ve(this,a,true)};_.ob=function ff(){return this.pb(xv(UF,syb,1,this.Y(),4,1))};_.pb=function gf(a){return Ye(this,a)};_.w=function hf(){return Ze(this)};var eG=Nkb(Cyb,'AbstractCollection',640);hI(641,640,Eyb);_.t=function kf(a){return jf(this,a)};_.v=function lf(){return Apb(this)};var zG=Nkb(Cyb,'AbstractSet',641);hI(649,641,Eyb);var Jy=Nkb(xyb,'Sets/ImprovedAbstractSet',649);hI(655,649,Eyb);_.Q=function nf(){this.qb().Q()};_.kb=function of(a){return mf(this,a)};_.V=function pf(){return this.qb().V()};_.nb=function qf(a){var b;if(this.kb(a)){b=Wv(a,21);return this.qb().W().nb(b.yb())}return false};_.Y=function rf(){return this.qb().Y()};var ky=Nkb(xyb,'Maps/EntrySet',655);hI(387,655,Eyb,sf);_.kb=function tf(a){return Qh(new inb(this.a.a),a)};_.mb=function uf(){return new xf(this.a)};_.qb=function vf(){return this.a};_.nb=function wf(a){var b;if(!Qh(new inb(this.a.a),a)){return false}b=Wv(a,21);Hd(this.a.b,b.yb());return true};var Hw=Nkb(xyb,'AbstractMapBasedMultimap/AsMap/AsMapEntries',387);hI(299,1,Ayb,xf);_.H=function zf(){var a;return a=pnb(this.b),this.a=Wv(a.zb(),19),He(this.c,a)};_.G=function yf(){return this.b.b};_.I=function Af(){qnb(this.b);this.c.b.c-=this.a.Y();this.a.Q()};var Iw=Nkb(xyb,'AbstractMapBasedMultimap/AsMap/AsMapIterator',299);hI(260,649,Eyb,Bf);_.Q=function Cf(){this.b.Q()};_.kb=function Df(a){return this.b.R(a)};_.V=function Ef(){return this.b.V()};_.mb=function Ff(){return mp(),Wl(this.b.bb().mb(),(xp(),vp))};_.nb=function Gf(a){if(this.b.R(a)){this.b.eb(a);return true}return false};_.Y=function Hf(){return this.b.Y()};var ly=Nkb(xyb,'Maps/KeySet',260);hI(386,260,Eyb,If);_.Q=function Jf(){var a;Ml((a=this.b.bb().mb(),new Pf(this,a)))};_.lb=function Kf(a){return this.b.W().lb(a)};_.t=function Lf(a){return this===a||this.b.W().t(a)};_.v=function Mf(){return this.b.W().v()};_.mb=function Nf(){var a;return a=this.b.bb().mb(),new Pf(this,a)};_.nb=function Of(a){var b,c;c=0;b=Wv(this.b.eb(a),19);if(b){c=b.Y();b.Q();this.a.c-=c}return c>0};var Mw=Nkb(xyb,'AbstractMapBasedMultimap/KeySet',386);hI(300,1,Ayb,Pf);_.G=function Qf(){return this.c.G()};_.H=function Rf(){this.a=Wv(this.c.H(),21);return this.a.yb()};_.I=function Sf(){var a;ec(!!this.a);a=Wv(this.a.zb(),19);this.c.I();this.b.a.c-=a.Y();a.Q()};var Lw=Nkb(xyb,'AbstractMapBasedMultimap/KeySet/1',300);hI(216,640,Dyb,_f);_.ib=function ag(a){return Tf(this,a)};_.jb=function bg(a){return Uf(this,a)};_.Q=function cg(){Wf(this)};_.kb=function dg(a){return Yf(this),this.d.kb(a)};_.lb=function eg(a){return Yf(this),this.d.lb(a)};_.t=function fg(a){return Xf(this,a)};_.v=function gg(){return Yf(this),this.d.v()};_.mb=function hg(){return Yf(this),new xg(this)};_.nb=function ig(a){return Zf(this,a)};_.Y=function jg(){return Yf(this),this.d.Y()};_.w=function kg(){Yf(this);return xb(this.d)};var Pw=Nkb(xyb,'AbstractMapBasedMultimap/WrappedCollection',216);var sH=Pkb(Cyb,'List');hI(297,216,Fyb,mg);_.rb=function ng(a,b){var c;Yf(this);c=this.d.V();Wv(this.d,20).rb(a,b);++this.a.c;c&&Vf(this)};_.sb=function og(a){Yf(this);return Wv(this.d,20).sb(a)};_.tb=function pg(){Yf(this);return new Cg(this)};_.ub=function qg(a){Yf(this);return new Dg(this,a)};_.vb=function rg(a){var b;Yf(this);b=Wv(this.d,20).vb(a);--this.a.c;$f(this);return b};_.wb=function sg(a,b){Yf(this);return Wv(this.d,20).wb(a,b)};_.xb=function tg(a,b){Yf(this);return Ld(this.a,this.e,Wv(this.d,20).xb(a,b),!this.b?this:this.b)};var Rw=Nkb(xyb,'AbstractMapBasedMultimap/WrappedList',297);hI(385,297,Gyb,ug);var Nw=Nkb(xyb,'AbstractMapBasedMultimap/RandomAccessWrappedList',385);hI(189,1,Ayb,xg);_.G=function zg(){return wg(this),this.b.G()};_.H=function Ag(){return wg(this),this.b.H()};_.I=function Bg(){this.b.I();--this.d.f.c;$f(this.d)};var Ow=Nkb(xyb,'AbstractMapBasedMultimap/WrappedCollection/WrappedIterator',189);hI(298,189,Hyb,Cg,Dg);_.J=function Eg(a){var b;b=lg(this.a)==0;(wg(this),Wv(this.b,96)).J(a);++this.a.a.c;b&&Vf(this.a)};_.K=function Fg(){return (wg(this),Wv(this.b,96)).K()};_.L=function Gg(){return (wg(this),Wv(this.b,96)).L()};_.M=function Hg(){return (wg(this),Wv(this.b,96)).M()};_.N=function Ig(){return (wg(this),Wv(this.b,96)).N()};_.O=function Jg(a){(wg(this),Wv(this.b,96)).O(a)};var Qw=Nkb(xyb,'AbstractMapBasedMultimap/WrappedList/WrappedListIterator',298);hI(295,216,Eyb,Kg);var Sw=Nkb(xyb,'AbstractMapBasedMultimap/WrappedSet',295);hI(296,216,Iyb,Lg);var Tw=Nkb(xyb,'AbstractMapBasedMultimap/WrappedSortedSet',296);hI(668,1,Jyb);_.t=function Mg(a){var b;if(aw(a,21)){b=Wv(a,21);return Tb(this.yb(),b.yb())&&Tb(this.zb(),b.zb())}return false};_.v=function Ng(){var a,b;a=this.yb();b=this.zb();return (a==null?0:vb(a))^(b==null?0:vb(b))};_.Ab=function Og(a){throw new Hmb};_.w=function Pg(){return this.yb()+'='+this.zb()};var Vw=Nkb(xyb,Kyb,668);hI(390,640,Dyb,Qg);_.Q=function Rg(){Cd(this.a)};_.kb=function Sg(a){return td(this.a,a)};_.mb=function Tg(){return new de(this.a)};_.Y=function Ug(){return this.a.c};var Ww=Nkb(xyb,'AbstractMultimap/Values',390);hI(656,640,Lyb);_.ib=function Wg(a){return this.Bb(a,1),true};_.Bb=function Xg(a,b){throw new Hmb};_.jb=function Yg(a){return Eq(this,a)};_.Q=function Zg(){Ml(this.Eb())};_.kb=function $g(a){return this.Cb(a)>0};_.Cb=function _g(a){var b,c;for(c=Vg(this).mb();c.G();){b=Wv(c.H(),83);if(Tb(b.Zb(),a)){return b.Yb()}}return 0};_.gb=function ah(){return new qh(this)};_.bb=function bh(){return Vg(this)};_.t=function dh(a){return Fq(this,a)};_.v=function eh(){return Vg(this).v()};_.V=function fh(){return Vg(this).V()};_.mb=function gh(){return Dq(),new Oq(this,Vg(this).mb())};_.nb=function hh(a){return this.Fb(a,1)>0};_.Fb=function ih(a,b){throw new Hmb};_.Gb=function jh(a,b){var c,d;return Dq(),Mh(b,'count'),c=this.Cb(a),d=b-c,d>0?this.Bb(a,d):d<0&&this.Fb(a,-d),c};_.Hb=function kh(a,b,c){return Gq(this,a,b,c)};_.Y=function lh(){return Hq(this)};_.w=function mh(){return xb(Vg(this))};var Zw=Nkb(xyb,'AbstractMultiset',656);hI(657,649,Eyb);_.Q=function nh(){this.Ib().Q()};_.kb=function oh(a){var b,c;if(aw(a,83)){c=Wv(a,83);if(c.Yb()<=0){return false}b=this.Ib().Cb(c.Zb());return b==c.Yb()}return false};_.nb=function ph(a){var b,c,d,e;if(aw(a,83)){c=Wv(a,83);b=c.Zb();d=c.Yb();if(d!=0){e=this.Ib();return e.Hb(b,d,0)}}return false};var xy=Nkb(xyb,'Multisets/EntrySet',657);hI(396,657,Eyb,qh);_.mb=function rh(){return this.a.Eb()};_.Ib=function sh(){return this.a};_.Y=function th(){return this.a.Db()};var Yw=Nkb(xyb,'AbstractMultiset/EntrySet',396);hI(384,294,zyb);_.Z=function wh(){return new wtb(op(this.a))};_.$=function xh(){return hi(),kr(),jr};_.U=function zh(a){return Wv(Dd(this,a),18)};_.X=function Ah(a){return Wv(Gd(this,a),18)};_.P=function vh(){var a;return a=this.f,!a?(this.f=new Ie(this,this.b)):a};_.t=function yh(a){return Mp(this,a)};var $w=Nkb(xyb,'AbstractSetMultimap',384);hI(342,656,Lyb);var _w=Nkb(xyb,'AbstractSortedMultiset',342);hI(280,600,zyb,Dh);_.a=0;var ax=Nkb(xyb,'ArrayListMultimap',280);hI(159,17,Myb);var Eh,Fh;var dx=Okb(xyb,'BoundType',159,IF,Ih);hI(623,159,Myb,Jh);var bx=Okb(xyb,'BoundType/1',623,dx,null);hI(624,159,Myb,Kh);var cx=Okb(xyb,'BoundType/2',624,dx,null);var Nh;hI(234,1,Oyb);_.w=function Th(){return Vl(this.c.mb())};var fx=Nkb(xyb,'FluentIterable',234);hI(170,234,Oyb,Vh);_.mb=function Wh(){return Uh(this)};var ex=Nkb(xyb,'FluentIterable/2',170);hI(664,1,{});_.w=function Xh(){return xb(irb(this.a.d).b)};var mx=Nkb(xyb,'ForwardingObject',664);hI(665,664,Dyb);_.ib=function Yh(a){return irb(this.a.d),vqb()};_.jb=function Zh(a){return irb(this.a.d),wqb()};_.Q=function $h(){irb(this.a.d);xqb()};_.kb=function _h(a){return Irb(irb(this.a.d),a)};_.lb=function ai(a){return Jrb(irb(this.a.d),a)};_.V=function bi(){return irb(this.a.d).b.V()};_.mb=function ci(){var a;return a=irb(this.a.d).b.mb(),new Trb(a)};_.nb=function di(a){return irb(this.a.d),yqb()};_.Y=function ei(){return irb(this.a.d).b.Y()};_.ob=function fi(){return Krb(irb(this.a.d))};_.pb=function gi(a){return Lrb(irb(this.a.d),a)};var gx=Nkb(xyb,'ForwardingCollection',665);hI(660,640,Pyb);_.mb=function ti(){return this.Kb()};_.ib=function oi(a){return ii()};_.jb=function pi(a){return ji()};_.Q=function qi(){li()};_.kb=function ri(a){return a!=null&&Ve(this,a,false)};_.Jb=function si(){switch(this.Y()){case 0:return Gi(),Gi(),Fi;case 1:return Gi(),new Er(this.Kb().H());default:return new Zq(this,this.ob());}};_.nb=function ui(a){return mi()};var sx=Nkb(xyb,'ImmutableCollection',660);hI(316,660,Pyb,vi);_.mb=function Ai(){return Xl(this.a.mb())};_.kb=function wi(a){return a!=null&&this.a.kb(a)};_.lb=function xi(a){return this.a.lb(a)};_.V=function yi(){return this.a.V()};_.Kb=function zi(){return Xl(this.a.mb())};_.Y=function Bi(){return this.a.Y()};_.ob=function Ci(){return this.a.ob()};_.pb=function Di(a){return this.a.pb(a)};_.w=function Ei(){return xb(this.a)};var hx=Nkb(xyb,'ForwardingImmutableCollection',316);hI(87,660,Qyb);_.mb=function Pi(){return this.Kb()};_.tb=function Qi(){return this.Lb(0)};_.ub=function Si(a){return this.Lb(a)};_.xb=function Xi(a,b){return this.Mb(a,b)};_.rb=function Ji(a,b){throw new Hmb};_.t=function Mi(a){return yo(this,a)};_.v=function Ni(){return zo(this)};_.Kb=function Oi(){return this.Lb(0)};_.Lb=function Ri(a){return Hi(this,a)};_.vb=function Ui(a){throw new Hmb};_.wb=function Vi(a,b){throw new Hmb};_.Mb=function Wi(a,b){var c;return Yi((c=new Mo(this),new Mnb(c,a,b)))};var Fi;var wx=Nkb(xyb,'ImmutableList',87);hI(667,87,Qyb);_.mb=function gj(){return Xl(this.Nb().mb())};_.xb=function jj(a,b){return Yi(this.Nb().xb(a,b))};_.kb=function _i(a){return Zi(this,a)};_.lb=function aj(a){return this.Nb().lb(a)};_.t=function bj(a){return this.Nb().t(a)};_.sb=function cj(a){return $i(this,a)};_.v=function dj(){return this.Nb().v()};_.V=function ej(){return this.Nb().V()};_.Kb=function fj(){return Xl(this.Nb().mb())};_.Y=function hj(){return this.Nb().Y()};_.Mb=function ij(a,b){return Yi(this.Nb().xb(a,b))};_.ob=function kj(){return this.Nb().pb(xv(UF,syb,1,this.Nb().Y(),4,1))};_.pb=function lj(a){return this.Nb().pb(a)};_.w=function mj(){return xb(this.Nb())};var ix=Nkb(xyb,'ForwardingImmutableList',667);hI(524,1,Ryb);_.bb=function wj(){return nj(this)};_.W=function Aj(){return oj(this)};_.fb=function Gj(){return this.Rb()};_.Q=function qj(){throw new Hmb};_.R=function rj(a){return this.cb(a)!=null};_.ab=function sj(a){return this.Rb().kb(a)};_.Pb=function uj(){return new Uk(this)};_.Qb=function vj(){return new Zk(this)};_.t=function xj(a){return pp(this,a)};_.v=function yj(){return nj(this).v()};_.V=function zj(){return this.Y()==0};_.db=function Cj(a,b){return pj()};_.eb=function Dj(a){throw new Hmb};_.w=function Ej(){var a;return mp(),a=umb(Ph(this.Y()),123),Qb(lp,a,nj(this).mb()),a.a+='}',a.a};_.Rb=function Fj(){if(this.g){return this.g}return this.g=this.Qb()};_.e=null;_.f=null;_.g=null;var Cx=Nkb(xyb,'ImmutableMap',524);hI(320,524,Ryb);_.R=function Ij(a){return qp(this.d,a)};_.ab=function Jj(a){return hrb(this.d,a)};_.Ob=function Kj(){return ck(new Vj(this))};_.Pb=function Lj(){return ck(krb(this.d))};_.Qb=function Mj(){return hi(),new vi(lrb(this.d))};_.t=function Nj(a){return jrb(this.d,a)};_.cb=function Oj(a){return a==null?null:rp(this.d,a)};_.v=function Pj(){return this.d.c.v()};_.V=function Qj(){return this.d.c.V()};_.Y=function Rj(){return this.d.c.Y()};_.w=function Sj(){return xb(this.d.c)};var kx=Nkb(xyb,'ForwardingImmutableMap',320);hI(666,665,Eyb);_.t=function Tj(a){return a===this||Drb(irb(this.a.d),a)};_.v=function Uj(){return irb(this.a.d).b.v()};var nx=Nkb(xyb,'ForwardingSet',666);hI(523,666,Eyb,Vj);_.kb=function Wj(b){if(aw(b,21)&&Wv(b,21).yb()==null){return false}try{return Irb(irb(this.a.d),b)}catch(a){a=OH(a);if(aw(a,119)){return false}else throw NH(a)}};_.pb=function Xj(a){var b;b=Lrb(irb(this.a.d),a);irb(this.a.d).b.Y()=e){f.Q()}else{d=f.mb();for(c=0;c0||this.c.G()};_.H=function Qq(){if(!(this.d>0||this.c.G())){throw new nvb}if(this.d==0){this.b=Wv(this.c.H(),83);this.f=this.d=this.b.Yb()}--this.d;this.a=true;return this.b.Zb()};_.I=function Rq(){ec(this.a);this.f==1?this.c.I():this.e.Fb(this.b.Zb(),1)>0;--this.f;this.a=false};_.a=false;_.d=0;_.f=0;var zy=Nkb(xyb,'Multisets/MultisetIteratorImpl',303);hI(622,659,{3:1,56:1},Vq);_.$b=function Wq(a,b){return Uq(Wv(a,23),Wv(b,23))};_.w=function Xq(){return 'Ordering.natural()'};var Sq;var By=Nkb(xyb,'NaturalOrdering',622);hI(343,661,Qyb,Zq);_.ub=function br(a){return Hi(this.b,a)};_.Sb=function $q(){return this.a};_.sb=function _q(a){return $i(this.b,a)};_.Lb=function ar(a){return Hi(this.b,a)};var Dy=Nkb(xyb,'RegularImmutableAsList',343);hI(559,275,Ryb,er);_.Tb=function fr(){return this.a};var cr;var Ey=Nkb(xyb,'RegularImmutableBiMap',559);hI(53,667,Qyb,gr);_.Nb=function hr(){return this.a};var Fy=Nkb(xyb,'RegularImmutableList',53);hI(321,320,Ryb,ir);var Gy=Nkb(xyb,'RegularImmutableMap',321);hI(265,315,Syb,lr);var jr;var Hy=Nkb(xyb,'RegularImmutableSet',265);hI(650,641,Eyb);var Ky=Nkb(xyb,'Sets/SetView',650);hI(377,650,Eyb,tr);_.kb=function ur(a){return ttb(this.b,a)&&ttb(this.c,a)};_.lb=function vr(a){return Xe(this.b,a)&&Xe(this.c,a)};_.V=function wr(){return sr(this)};_.mb=function xr(){var a;return Pl((a=(new Snb(this.b.a)).a.bb().mb(),new Ynb(a)),this.a)};_.Y=function yr(){var a;return Ul(Pl((a=(new Snb(this.b.a)).a.bb().mb(),new Ynb(a)),this.a))};var Iy=Nkb(xyb,'Sets/2',377);hI(328,275,Ryb,zr,Ar);_.fb=function Dr(){return hi(),new Gr(this.c)};_.Tb=function Br(){var a;a=this.a;return !a?(this.a=new Ar(this.c,this.b,this)):a};_.Ub=function Cr(){return hi(),new Gr(this.c)};var Ly=Nkb(xyb,'SingletonImmutableBiMap',328);hI(127,667,Qyb,Er);_.Nb=function Fr(){return this.a};var My=Nkb(xyb,'SingletonImmutableList',127);hI(135,663,Syb,Gr);_.mb=function Jr(){return Il(),new dm(this.a)};_.kb=function Hr(a){return rb(this.a,a)};_.Kb=function Ir(){return Il(),new dm(this.a)};_.Y=function Kr(){return 1};var Ny=Nkb(xyb,'SingletonImmutableSet',135);hI(285,342,{207:1,3:1,22:1,19:1},Ur,Vr);_.Bb=function Wr(a,b){return Lr(this,a,b)};_.Cb=function Xr(a){return Pr(this,a)};_.Db=function Yr(){return $s(Or(this,(qs(),os)))};_.Eb=function $r(){return new ks(this)};_.Fb=function _r(a,b){return Sr(this,a,b)};_.Gb=function as(a,b){return Tr(this,a,b)};_.Hb=function bs(a,b,c){var d,e,f;Mh(c,'newCount');Mh(b,'oldCount');Xb(ok(this.b,a));f=this.c.a;if(!f){if(b==0){c>0&&Lr(this,a,c);return true}else{return false}}e=xv(mw,Yyb,26,1,12,1);d=Ms(f,this.d,a,b,c,e);Us(this.c,f,d);return e[0]==b};_.Y=function cs(){return $s(Or(this,(qs(),ps)))};var Wy=Nkb(xyb,'TreeMultiset',285);hI(619,658,{83:1},fs);_.Yb=function gs(){var a;a=this.b.c;return a==0?Pr(this.a,this.b.b):a};_.Zb=function hs(){return this.b.b};var Py=Nkb(xyb,'TreeMultiset/1',619);hI(620,1,Ayb,ks);_.H=function ms(){return js(this)};_.G=function ls(){return is(this)};_.I=function ns(){ec(!!this.b);Tr(this.c,this.b.b.b,0);this.b=null};var Qy=Nkb(xyb,'TreeMultiset/2',620);hI(205,17,Zyb);var os,ps;var Ty=Okb(xyb,'TreeMultiset/Aggregate',205,IF,ss);hI(617,205,Zyb,ts);_._b=function us(a){return a.c};_.ac=function vs(a){return !a?0:a.j};var Ry=Okb(xyb,'TreeMultiset/Aggregate/1',617,Ty,null);hI(618,205,Zyb,ws);_._b=function xs(a){return 1};_.ac=function ys(a){return !a?0:a.a};var Sy=Okb(xyb,'TreeMultiset/Aggregate/2',618,Ty,null);hI(206,658,{83:1,206:1},Os);_.Yb=function Ps(){return this.c};_.Zb=function Qs(){return this.b};_.w=function Ss(){return Dq(),pq(new Lq(this.b,this.c))};_.a=0;_.c=0;_.d=0;_.j=0;var Uy=Nkb(xyb,'TreeMultiset/AvlNode',206);hI(616,1,{},Vs);var Vy=Nkb(xyb,'TreeMultiset/Reference',616);var $y=Nkb(lyb,'JavaScriptObject$',0);var qt;hI(628,1,{});var _y=Nkb(lyb,'Scheduler',628);var ut=0,vt=0,wt=-1;hI(360,628,{},Jt);var Ft;var az=Nkb(myb,'SchedulerImpl',360);hI(646,1,{});_.hc=function bu(){return null};_.ic=function cu(){return null};_.jc=function du(){return null};_.kc=function eu(){return null};_.lc=function fu(){return null};var nz=Nkb(_yb,'JSONValue',646);hI(214,646,{214:1},ju,ku);_.t=function lu(a){if(!aw(a,214)){return false}return this.a==Wv(a,214).a};_.gc=function mu(){return qu};_.v=function nu(){return txb(this.a)};_.hc=function ou(){return this};_.w=function pu(){var a,b,c;c=new Bmb('[');for(b=0,a=this.a.length;b0&&(c.a+=',',c);xmb(c,gu(this,b))}c.a+=']';return c.a};var fz=Nkb(_yb,'JSONArray',214);hI(292,646,{},uu);_.gc=function vu(){return yu};_.ic=function wu(){return this};_.w=function xu(){return Bkb(this.a)};_.a=false;var ru,su;var gz=Nkb(_yb,'JSONBoolean',292);hI(371,72,Vxb,zu);var hz=Nkb(_yb,'JSONException',371);hI(435,646,{},Cu);_.gc=function Du(){return Fu};_.w=function Eu(){return Wxb};var Au;var iz=Nkb(_yb,'JSONNull',435);hI(104,646,{104:1},Gu);_.t=function Hu(a){if(!aw(a,104)){return false}return this.a==Wv(a,104).a};_.gc=function Iu(){return Mu};_.v=function Ju(){return hw(Ixb(this.a))};_.jc=function Ku(){return this};_.w=function Lu(){return this.a+''};_.a=0;var jz=Nkb(_yb,'JSONNumber',104);hI(69,646,{69:1},Tu,Uu);_.t=function Vu(a){if(!aw(a,69)){return false}return this.a==Wv(a,69).a};_.gc=function Wu(){return $u};_.v=function Xu(){return txb(this.a)};_.kc=function Yu(){return this};_.w=function Zu(){var a,b,c,d,e,f;f=new Bmb('{');a=true;e=Nu(this,xv($F,Txb,2,0,5,1));for(c=0,d=e.length;c>16&byb|b^d<<16};_.mb=function UJ(){return new WJ(this)};_.w=function VJ(){return this.a==null&&this.b==null?'pair(null,null)':this.a==null?'pair(null,'+xb(this.b)+')':this.b==null?'pair('+xb(this.a)+',null)':'pair('+xb(this.a)+','+xb(this.b)+')'};var xz=Nkb(mzb,'Pair',27);hI(431,1,Ayb,WJ);_.G=function XJ(){return !this.c&&(!this.b&&this.a.a!=null||this.a.b!=null)};_.H=function YJ(){if(!this.c&&!this.b&&this.a.a!=null){this.b=true;return this.a.a}else if(!this.c&&this.a.b!=null){this.c=true;return this.a.b}throw new nvb};_.I=function ZJ(){this.c&&this.a.b!=null?(this.a.b=null):this.b&&this.a.a!=null&&(this.a.a=null);throw new tlb};_.b=false;_.c=false;var wz=Nkb(mzb,'Pair/1',431);hI(228,72,Vxb,$J);var yz=Nkb(nzb,'UnsupportedConfigurationException',228);hI(99,72,Vxb,_J);var zz=Nkb(nzb,'UnsupportedGraphException',99);var aK;hI(103,17,{103:1,3:1,23:1,17:1},jK);var cK,dK,eK,fK,gK,hK;var Az=Okb(rzb,'Alignment',103,IF,kK);var lK;hI(59,17,{59:1,3:1,23:1,17:1},wK);var nK,oK,pK,qK,rK;var Bz=Okb(rzb,'Direction',59,IF,xK);var yK;hI(107,17,{107:1,3:1,23:1,17:1},FK);var AK,BK,CK,DK;var Cz=Okb(rzb,'EdgeLabelPlacement',107,IF,GK);var HK;hI(122,17,{122:1,3:1,23:1,17:1},OK);var JK,KK,LK,MK;var Dz=Okb(rzb,'EdgeRouting',122,IF,PK);var QK;hI(133,17,{133:1,3:1,23:1,17:1},ZK);var SK,TK,UK,VK,WK,XK;var Ez=Okb(rzb,'EdgeType',133,IF,$K);var _K;hI(166,17,{166:1,3:1,23:1,17:1},fL);var bL,cL,dL;var Fz=Okb(rzb,'HierarchyHandling',166,IF,gL);var hL;var jL,kL,lL,mL,nL,oL,pL,qL,rL,sL,tL,uL,vL,wL,xL,yL,zL,AL,BL,CL,DL,EL,FL,GL,HL,IL,JL,KL,LL,ML,NL,OL,PL,QL,RL,SL,TL,UL,VL,WL,XL,YL,ZL,$L,_L,aM,bM,cM,dM;hI(41,17,{41:1,3:1,23:1,17:1},pM);var fM,gM,hM,iM,jM,kM,lM,mM,nM;var Gz=Okb(rzb,'NodeLabelPlacement',41,IF,qM);var rM;hI(100,17,{100:1,3:1,23:1,17:1},AM);var uM,vM,wM,xM,yM;var Hz=Okb(rzb,'PortAlignment',100,IF,BM);var CM;hI(28,17,{28:1,3:1,23:1,17:1},NM);var EM,FM,GM,HM,IM,JM;var Iz=Okb(rzb,'PortConstraints',28,IF,OM);var PM;hI(149,17,{149:1,3:1,23:1,17:1},VM);var RM,SM,TM;var Jz=Okb(rzb,'PortLabelPlacement',149,IF,WM);var XM;hI(32,17,{32:1,3:1,23:1,17:1},uN);var ZM,$M,_M,aN,bN,cN,dN,eN,fN,gN,hN,iN,jN,kN,lN,mN,nN,oN,pN,qN,rN;var Kz=Okb(rzb,'PortSide',32,IF,wN);var xN;hI(150,17,{150:1,3:1,23:1,17:1},EN);var zN,AN,BN,CN;var Lz=Okb(rzb,'SizeConstraint',150,IF,FN);var GN;hI(139,17,{139:1,3:1,23:1,17:1},NN);var IN,JN,KN,LN;var Mz=Okb(rzb,'SizeOptions',139,IF,ON);var PN;hI(62,1,{62:1},UN,VN);_.t=function WN(a){var b;if(a==null||!aw(a,62)){return false}b=Wv(a,62);return ovb(this.d,b.d)&&ovb(this.e,b.e)&&ovb(this.c,b.c)&&ovb(this.b,b.b)};_.v=function XN(){return fpb(Bv(tv(UF,1),syb,1,4,[this.d,this.e,this.c,this.b]))};_.w=function YN(){return 'Rect[x='+this.d+',y='+this.e+',w='+this.c+',h='+this.b+']'};_.b=0;_.c=0;_.d=0;_.e=0;var Tz=Nkb(wzb,'Rectangle',62);hI(283,62,{283:1,62:1},ZN);_.a=0;var Nz=Nkb(xzb,'LabelGroup',283);hI(67,17,{67:1,3:1,23:1,17:1},vO);var $N,_N,aO,bO,cO,dO,eO,fO,gO,hO,iO,jO,kO,lO,mO,nO,oO,pO,qO,rO,sO,tO;var Oz=Okb(xzb,'LabelLocation',67,IF,xO);hI(225,17,{225:1,3:1,23:1,17:1},EO);var AO,BO,CO;var Pz=Okb(xzb,'TextAlignment',225,IF,FO);var HO;hI(589,1,{},fP);_.a=0;_.b=false;_.d=0;_.f=0;_.k=0;_.r=0;_.s=0;var Qz=Nkb(wzb,'LabelAndNodeSizeProcessor/NodeData',589);hI(171,17,{171:1,3:1,23:1,17:1},lP);var gP,hP,iP,jP;var Rz=Okb(wzb,'LabelSide',171,IF,mP);hI(590,1,{},rP);_.b=true;_.c=true;_.d=true;_.e=true;var Sz=Nkb(wzb,zzb,590);hI(121,1,Bzb);_.t=function wP(a){var b;if(aw(a,121)){b=Wv(a,121);return this.d==b.d&&this.a==b.a&&this.b==b.b&&this.c==b.c}else{return false}};_.v=function xP(){var a,b;a=hw(Ixb(this.b))<<16;a|=hw(Ixb(this.a))&byb;b=hw(Ixb(this.c))<<16;b|=hw(Ixb(this.d))&byb;return a^b};_.w=function zP(){return '[top='+this.d+',left='+this.b+',bottom='+this.a+',right='+this.c+']'};_.a=0;_.b=0;_.c=0;_.d=0;var Wz=Nkb(wzb,'Spacing',121);hI(232,121,Bzb,AP,BP,CP);var Uz=Nkb(wzb,'Spacing/Insets',232);hI(65,121,{286:1,121:1,65:1,3:1,5:1},DP,EP,FP);var Vz=Nkb(wzb,'Spacing/Margins',65);hI(364,1,{},jQ);_.c=false;_.d=null;_.g=null;var OP,PP,QP;var Xz=Nkb(Ozb,'JsonGraphImporter',364);var kQ,lQ,mQ,nQ,oQ,pQ,qQ,rQ,sQ;hI(417,14,lzb,xQ);var Yz=Nkb(Ozb,'LayoutOptionResolver/DummyProperty',417);hI(348,1,{},CQ);var yQ;var Zz=Nkb(Ozb,'RecursiveLGraphLayout',348);hI(73,99,{73:1,3:1,54:1,46:1},EQ,FQ,GQ);var $z=Nkb(Ozb,'UnsupportedJsonGraphException',73);hI(380,1,{},OQ);var HQ,IQ;var _z=Nkb(Szb,'GraphConfigurator',380);hI(49,1,{},WQ);var aA=Nkb(Szb,'IntermediateProcessingConfiguration',49);hI(365,1,{},dR);var bA=Nkb(Szb,'KlayLayered',365);hI(577,1,{},kR);_.i=0;var eR;var eA=Nkb(Wzb,'ComponentsToCGraphTransformer',577);var UR;hI(578,1,{},lR);_.tc=function mR(a,b){return Qlb(a.wc(),b.wc())};_.uc=function nR(a,b){return Qlb(a.xc(),b.xc())};var cA=Nkb(Wzb,'ComponentsToCGraphTransformer/1',578);hI(25,1,{25:1});_.k=0;_.o=null;_.p=true;_.r=Vzb;var kA=Nkb(Xzb,'CNode',25);hI(198,25,{198:1,25:1},pR,qR);_.vc=function rR(){this.b.d=this.j.d;this.b.e=this.j.e};_.wc=function sR(){return this.a!=null?Ixb(this.a):this.c.i};_.xc=function tR(){return this.a!=null?Ixb(this.a):this.c.i};_.w=function uR(){return ''};var dA=Nkb(Wzb,'ComponentsToCGraphTransformer/CRectNode',198);hI(549,1,{},HR);var vR,wR;var hA=Nkb(Wzb,'OneDimensionalComponentsCompaction',549);hI(550,1,Tyb,IR);_.B=function JR(a){return xR(),xkb(),Wv(Wv(a,27).a,25).f.f!=0?wkb:vkb};var fA=Nkb(Wzb,'OneDimensionalComponentsCompaction/lambda$0$Type',550);hI(551,1,Tyb,KR);_.B=function LR(a){return xR(),xkb(),uS(Wv(Wv(a,27).a,25).n,Wv(Wv(a,27).b,59))||Wv(Wv(a,27).a,25).f.f!=0&&uS(Wv(Wv(a,27).a,25).n,Wv(Wv(a,27).b,59))?wkb:vkb};var gA=Nkb(Wzb,'OneDimensionalComponentsCompaction/lambda$1$Type',551);hI(324,1,{},NR);var iA=Nkb(Xzb,'CGraph',324);hI(78,1,{78:1},QR);_.b=0;_.c=0;_.d=0;_.f=0;_.i=true;_.j=Vzb;var jA=Nkb(Xzb,'CGroup',78);hI(470,1,{},WR);_.tc=function XR(a,b){return Nlb(a.wc(),b.wc())};_.uc=function YR(a,b){return Nlb(a.xc(),b.xc())};var lA=Nkb(Xzb,'ISpacingsHandler/1',470);hI(323,1,{},rS);_.e=false;var ZR,$R,_R;var nA=Nkb(Xzb,'OneDimensionalCompactor',323);hI(554,1,Tyb,sS);_.B=function tS(a){return aS(),xkb(),Wv(Wv(a,27).a,25).f.f!=0?wkb:vkb};var mA=Nkb(Xzb,'OneDimensionalCompactor/lambda$0$Type',554);hI(335,1,{},xS);_.a=false;_.b=false;_.c=false;_.d=false;var oA=Nkb(Xzb,'Quadruplet',335);hI(587,1,{},yS);_.Cc=function zS(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;k=Uzb;for(d=new Tob(a.a.b);d.ad.j.d||d.j.d==f.j.d&&d.j.cm){w=0;A+=l+u;l=0}p=f.d;UT(f,w+p.a,A+p.b);p.a=0;p.b=0;c=Nlb(c,w+s.a);l=Nlb(l,s.b);w+=s.a+u}b.e.a=c;b.e.b=A+l;r=Wv(rJ(b,Jib),15).a;if(Ckb(Ixb(Xv(rJ(e,(Mjb(),ijb)))))){d=new sU;iU(d,a,r);for(k=a.mb();k.G();){j=Wv(k.H(),55);vI(BI(j.d),d.e)}vI(BI(b.e),d.a)}TT(b,a)};var YA=Nkb(aAb,'SimpleRowGraphPlacer',432);hI(433,1,fyb,xV);_.$b=function yV(a,b){return wV(Wv(a,55),Wv(b,55))};var XA=Nkb(aAb,'SimpleRowGraphPlacer/1',433);hI(369,1,eAb,CV);_.sc=function DV(a,b){BV(a,b)};var zV;var $A=Nkb(fAb,'CompoundGraphPostprocessor',369);hI(370,1,_zb,EV);_.D=function FV(a){var b;return b=Wv(rJ(Wv(a,114).b,(eM(),CL)),44),!!b&&b.b!=0};var ZA=Nkb(fAb,'CompoundGraphPostprocessor/1',370);hI(368,1,eAb,SV);_.sc=function TV(a,b){NV(this,a,b)};var aB=Nkb(fAb,'CompoundGraphPreprocessor',368);hI(187,1,{187:1},UV);_.c=false;var _A=Nkb(fAb,'CompoundGraphPreprocessor/ExternalPort',187);hI(114,1,{114:1},XV);_.w=function YV(){return zc(this.c)+':'+gW(this.b)};var cB=Nkb(fAb,'CrossHierarchyEdge',114);hI(310,1,fyb,$V);_.$b=function _V(a,b){return ZV(this,Wv(a,114),Wv(b,114))};var bB=Nkb(fAb,'CrossHierarchyEdgeComparator',310);hI(147,131,{179:1,131:1,147:1,3:1});_.k=0;var lB=Nkb(hAb,'LGraphElement',147);hI(12,147,{179:1,131:1,12:1,147:1,3:1},hW);_.w=function iW(){return gW(this)};var dB=Nkb(hAb,'LEdge',12);hI(55,147,{179:1,131:1,55:1,147:1,3:1,22:1},kW);_.mb=function lW(){return new Tob(this.c)};_.w=function mW(){if(this.c.c.length==0){return 'G-unlayered'+Ze(this.b)}else if(this.b.c.length==0){return 'G-layered'+Ze(this.c)}return 'G[layerless'+Ze(this.b)+', layers'+Ze(this.c)+']'};var mB=Nkb(hAb,'LGraph',55);hI(273,1,{});_.pc=function rW(){return this.e.j};var eB=Nkb(hAb,'LGraphAdapters/AbstractLShapeAdapter',273);hI(240,1,{627:1},tW);_.b=null;var fB=Nkb(hAb,'LGraphAdapters/LEdgeAdapter',240);hI(325,1,{},wW);_.pc=function xW(){return this.a.e};_.b=null;_.c=false;var gB=Nkb(hAb,'LGraphAdapters/LGraphAdapter',325);hI(224,273,{129:1,224:1},yW);var hB=Nkb(hAb,'LGraphAdapters/LLabelAdapter',224);hI(555,273,{626:1},BW);_.a=null;_.b=null;_.c=false;var iB=Nkb(hAb,'LGraphAdapters/LNodeAdapter',555);hI(556,273,{161:1},FW);_.a=null;_.b=null;_.c=null;_.d=false;var jB=Nkb(hAb,'LGraphAdapters/LPortAdapter',556);hI(557,1,fyb,HW);_.$b=function IW(a,b){return GW(Wv(a,7),Wv(b,7))};var kB=Nkb(hAb,'LGraphAdapters/PortComparator',557);hI(168,1,{168:1},ZW,$W);_.t=function _W(a){var b;if(aw(a,168)){b=Wv(a,168);return this.d==b.d&&this.a==b.a&&this.b==b.b&&this.c==b.c}else{return false}};_.v=function aX(){var a,b;a=hw(Ixb(this.b))<<16;a|=hw(Ixb(this.a))&byb;b=hw(Ixb(this.c))<<16;b|=hw(Ixb(this.d))&byb;return a^b};_.w=function bX(){return 'Insets[top='+this.d+',left='+this.b+',bottom='+this.a+',right='+this.c+']'};_.a=0;_.b=0;_.c=0;_.d=0;var nB=Nkb(hAb,'LInsets',168);hI(165,147,{179:1,131:1,147:1,165:1,3:1});var CB=Nkb(hAb,'LShape',165);hI(33,165,{179:1,131:1,147:1,33:1,165:1,3:1},dX);_.w=function eX(){return this.a==null?'l_'+this.k:'l_'+this.a};var oB=Nkb(hAb,'LLabel',33);hI(9,165,{179:1,131:1,147:1,9:1,165:1,3:1},uX);_.w=function vX(){return tX(this)};var qB=Nkb(hAb,'LNode',9);hI(132,17,{132:1,3:1,23:1,17:1},DX);var wX,xX,yX,zX,AX,BX;var pB=Okb(hAb,'LNode/NodeType',132,IF,EX);hI(7,165,{179:1,131:1,147:1,7:1,165:1,3:1},RX);_.w=function SX(){var a;return a=OX(this),a==null?'p_'+this.k:'p_'+a};var FX,GX,HX,IX,JX,KX;var BB=Nkb(hAb,'LPort',7);hI(399,1,_zb,UX);_.D=function VX(a){return TX(a)};var rB=Nkb(hAb,'LPort/1',399);hI(400,1,_zb,XX);_.D=function YX(a){return WX(a)};var sB=Nkb(hAb,'LPort/2',400);hI(401,1,_zb,ZX);_.D=function $X(a){return Wv(a,7).g==(sN(),$M)};var tB=Nkb(hAb,'LPort/3',401);hI(402,1,_zb,_X);_.D=function aY(a){return Wv(a,7).g==(sN(),ZM)};var uB=Nkb(hAb,'LPort/4',402);hI(403,1,_zb,bY);_.D=function cY(a){return Wv(a,7).g==(sN(),pN)};var vB=Nkb(hAb,'LPort/5',403);hI(404,1,_zb,dY);_.D=function eY(a){return Wv(a,7).g==(sN(),rN)};var wB=Nkb(hAb,'LPort/6',404);hI(190,1,Oyb,fY);_.mb=function gY(){var a;a=new Tob(this.a.b);return new hY(a)};var yB=Nkb(hAb,'LPort/7',190);hI(405,1,Ayb,hY);_.H=function jY(){return Wv(Rob(this.a),12).c};_.G=function iY(){return Qob(this.a)};_.I=function kY(){Sob(this.a)};var xB=Nkb(hAb,'LPort/7/1',405);hI(169,1,Oyb,lY);_.mb=function mY(){var a;return a=new Tob(this.a.e),new nY(a)};var AB=Nkb(hAb,'LPort/8',169);hI(304,1,Ayb,nY);_.H=function pY(){return Wv(Rob(this.a),12).d};_.G=function oY(){return Qob(this.a)};_.I=function qY(){Sob(this.a)};var zB=Nkb(hAb,'LPort/8/1',304);hI(16,147,{179:1,131:1,147:1,16:1,3:1,22:1},sY);_.mb=function tY(){return new Tob(this.a)};_.w=function uY(){return 'L_'+zU(this.b.c,this,0)+Ze(this.a)};var DB=Nkb(hAb,'Layer',16);hI(437,1,eAb,wY);_.sc=function xY(a,b){var c,d,e,f,g,h,i;nI(b,'Big nodes intermediate-processing',1);this.a=a;for(f=new Tob(this.a.c);f.af?50:f;c=new GU;n=f+this.d;for(k=new Tob(l);k.an){m=1;d=g.j.a;while(d>f){++m;d=(g.j.a-(m-1)*this.d)/m}vU(c,new _Y(this,g,m,d))}}for(h=new Tob(c);h.ah?50:h;c=new GU;p=h+this.d;for(m=new Tob(n);m.ap){o=1;d=i.j.a;while(d>h){++o;d=(i.j.a-(o-1)*this.d)/o}vU(c,new nZ(this,i,o))}}for(j=new Tob(c);j.a0||k.g==rN&&k.b.c.length-k.e.c.length<0)){c=false;break}if(k.g==rN){for(e=new Tob(k.e);e.a0&&E$((Cxb(0,c.c.length),Wv(c.c[0],16)),a);c.c.length>1&&E$(Wv(yU(c,c.c.length-1),16),a);pI(b)};var bC=Nkb(jAb,'HierarchicalPortPositionProcessor',454);hI(471,1,eAb,I$);_.sc=function J$(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p;nI(b,'Hyperedge merging',1);n=new Fnb(a.c,0);while(n.bo+1){m=(i+o)/2|0;vU(l,new RJ(j,(Cxb(m,h.c.length),Wv(h.c[m],9))))}else if(o>i+1){m=((o-i)/2|0)-1;vU(l,new RJ(j,(Cxb(m,n.c.length),Wv(n.c[m],9))))}}}}for(r=new Tob(l);r.a=2){k=true;q=(Cxb(1,j.c.length),Wv(j.c[1],16));for(n=new Tob(f.a);n.a=2){k=true;r=Wv(yU(j,j.c.length-2),16);for(n=new Tob(g.a);n.ac?i:c}a.e.b=i-j;a.d.b-=j;pI(b)};var zC=Nkb(jAb,'LayerSizeAndGraphHeightCalculator',496);hI(497,1,eAb,b1);_.sc=function d1(a,b){var c,d,e,f,g;nI(b,'Edge joining',1);c=Ckb(Ixb(Xv(rJ(a,(Mjb(),gjb)))));for(e=new Tob(a.c);e.athis.j){this.q=B1;o1(this,e)}break;case 4:this.q=(I1(),H1);o1(this,e);i=0;for(d=new Tob(this.b);d.athis.k){this.q=E1;o1(this,e)}break;case 6:l=hw(Llb(this.f.length*j/100));o1(this,new w1(l));break;case 5:k=hw(Llb(this.d*j/100));o1(this,new y1(k));break;default:o1(this,e);}p1(this,a);pI(b)};_.d=0;_.e=0;_.i=0;_.j=0;_.k=0;_.n=0;var HC=Nkb(jAb,'NodePromotion',491);hI(492,1,Tyb,u1);_.B=function v1(a){return xkb(),xkb(),wkb};var DC=Nkb(jAb,'NodePromotion/lambda$0$Type',492);hI(493,1,Tyb,w1);_.B=function x1(a){return r1(this.a,a)};_.a=0;var EC=Nkb(jAb,'NodePromotion/lambda$1$Type',493);hI(494,1,Tyb,y1);_.B=function z1(a){return s1(this.a,a)};_.a=0;var FC=Nkb(jAb,'NodePromotion/lambda$2$Type',494);hI(109,17,{109:1,3:1,23:1,17:1},J1);var A1,B1,C1,D1,E1,F1,G1,H1;var GC=Okb(jAb,'NodePromotionStrategy',109,IF,K1);var L1;hI(500,1,eAb,R1);_.sc=function S1(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;nI(b,sAb,1);n=Wv(rJ(a,(eM(),uL)),122);for(e=new Tob(a.c);e.a=2){o=true;l=new Tob(f.f);c=Wv(Rob(l),7);while(l.ac){pI(b);return}D=0;f=rAb;do{++D;c=G/D/(o*D);m=f;f=c-d<=0?0-(c-d):c-d}while(c>d);mD?1:D)|0;j=B;u=B;J=true;while(j=B&&(J=true);++u;++j}k=new Fnb(a.c,0);while(k.b '+this.a+' '+zc(this.c)};_.a=0;_.b=0;_.d=0;var cD=Nkb(jAb,'SplineSelfLoopRouter/LoopPadding',91);hI(521,1,_zb,z3);_.D=function A3(a){return y3(this,Wv(a,91))};_.a=0;_.c=0;var _C=Nkb(jAb,'SplineSelfLoopRouter/LoopPadding/EnclosingPredicate',521);hI(520,1,fyb,C3);_.$b=function D3(a,b){return B3(Wv(a,91),Wv(b,91))};var aD=Nkb(jAb,'SplineSelfLoopRouter/LoopPadding/MarginComparator',520);hI(196,1,_zb,E3);_.D=function F3(a){return Wv(a,91).c==this.a};var bD=Nkb(jAb,'SplineSelfLoopRouter/LoopPadding/PortSidePredicate',196);hI(195,1,{195:1},G3);_.c=0;_.d=0;_.e=0;var eD=Nkb(jAb,'SplineSelfLoopRouter/SelfLoopEdge',195);hI(519,1,fyb,I3);_.$b=function J3(a,b){return H3(Wv(a,195),Wv(b,195))};var dD=Nkb(jAb,'SplineSelfLoopRouter/SelfLoopEdge/StepSizeComparator',519);hI(82,25,{25:1,82:1},L3);_.vc=function M3(){var a,b,c,d;for(b=WI(this.a,0);b.b!=b.d.c;){a=Wv(_ub(b),10);a.a=this.j.d}for(d=WI(this.c,0);d.b!=d.d.c;){c=Wv(_ub(d),10);c.a=this.j.d}};_.wc=function N3(){return this.b};_.xc=function O3(){return this.e};_.w=function P3(){return Ze(new Snb(this.d.a))};_.b=0;_.e=0;var gD=Nkb(vAb,'CLEdge',82);hI(93,25,{25:1,93:1},Q3);_.vc=function R3(){this.b.i.a=this.j.d+this.b.e.b};_.wc=function S3(){if(this.b.g==(CX(),xX)){return 0}return this.a};_.xc=function T3(){if(this.b.g==(CX(),xX)){return 0}return this.c};_.w=function U3(){return xb(rJ(this.b,(Rib(),uib)))};_.a=0;_.c=0;var hD=Nkb(vAb,'CLNode',93);hI(175,17,{175:1,3:1,23:1,17:1},Y3);var V3,W3;var iD=Okb(vAb,'ConstraintCalculationStrategy',175,IF,Z3);var $3;hI(125,17,{125:1,3:1,23:1,17:1},h4);var a4,b4,c4,d4,e4,f4;var jD=Okb(vAb,'GraphCompactionStrategy',125,IF,i4);var j4;hI(455,1,eAb,o4);_.sc=function p4(a,b){var c,d,e;d=Wv(rJ(a,(Mjb(),Fjb)),125);if(d==(g4(),e4)){return}nI(b,'Horizontal Compaction',1);this.a=a;e=new Q4;c=new rS(P4(e,a));pS(c,this.b);switch(Wv(rJ(a,Gjb),175).e){case 1:nS(c,l4);break;default:nS(c,(aS(),$R));}switch(d.e){case 1:hS(c);break;case 2:hS(gS(c,(sK(),pK)));break;case 3:hS(bS(gS(hS(c),(sK(),pK))));break;case 4:hS(bS(oS(gS(hS(c),(sK(),pK)),new H4)));break;case 5:hS(mS(c,m4));}gS(c,(sK(),oK));c.e=true;L4(e);pI(b)};var l4,m4;var sD=Nkb(vAb,'HorizontalGraphCompactor',455);hI(462,1,{},q4);_.tc=function r4(a,b){var c,d,e;if(aw(a,82)&&aw(b,82)&&!sr(or(Wv(a,82).d,Wv(b,82).d))){return 0}c=null;aw(a,93)&&(c=Wv(a,93).b);d=null;aw(b,93)&&(d=Wv(b,93).b);if(!!c&&c.g==(CX(),xX)||!!d&&d.g==(CX(),xX)){return 0}e=Wv(rJ(this.a.a,(Rib(),Kib)),134);return Vjb(e,c?c.g:(CX(),zX),d?d.g:(CX(),zX))};_.uc=function s4(a,b){if(aw(a,82)&&aw(b,82)&&!sr(or(Wv(a,82).d,Wv(b,82).d))){return 1}return Qlb(a.xc(),b.xc())};var kD=Nkb(vAb,'HorizontalGraphCompactor/1',462);hI(456,317,{},u4);_.Dc=function v4(a){var b,c,d;this.b=a;ES(this,new z4,this.a);ES(this,new B4,this.a);b=Uzb;for(d=new Tob(this.b.a.b);d.a0&&(this.a[T.k]=eb++)}}else{N=0;for(U=new Tob(G.f);U.a0&&++eb}}jb=0;for(J=0,M=b.length;J0){T=(Bxb(X.b>0),Wv(X.a.sb(X.c=--X.b),7));W=0;for(g=new Tob(T.b);g.a0){if(T.g==(sN(),$M)){this.a[T.k]=jb;++jb}else{this.a[T.k]=jb+O+Q;++Q}}}jb+=Q}else{N=0;for(U=new Tob(G.f);U.a0&&++jb}}V=new ntb;p=new vtb;for(H=0,K=a.length;Hl.c&&(l.c=Y)}else if(T.f.d==db){Yl.d&&(l.d=Y)}}}ipb(q,0,q.length,(hsb(),hsb(),gsb));ib=xv(mw,Yyb,26,q.length,12,1);c=xv(mw,Yyb,26,jb+1,12,1);for(s=0;s0){w%2>0&&(d+=mb[w+1]);w=(w-1)/2|0;++mb[w]}}D=xv(BD,syb,158,q.length*2,0,1);for(v=0;v0){q=(Bxb(t.b>0),Wv(t.a.sb(t.c=--t.b),7));s=0;for(e=new Tob(q.b);e.a0){if(q.g==(sN(),$M)){this.a[q.k]=B;++B}else{this.a[q.k]=B+o+p;++p}f+=s}}B+=p}else{n=0;for(r=new Tob(i.f);r.a0){++B;f+=n}}}v=xv(mw,Yyb,26,f,12,1);g=0;for(j=0,l=a.length;j0};_.I=function Z6(){throw new Hmb};var MD=Nkb(wAb,'PortIterable/1',344);hI(336,1,{},b7);var OD=Nkb(wAb,'SwitchDecider',336);hI(89,1,{89:1},d7);_.w=function e7(){return 'NEdge[id='+this.b+' w='+this.f+' d='+this.a+']'};_.a=1;_.b=0;_.e=false;_.f=0;var QD=Nkb(yAb,'NEdge',89);hI(157,1,{},k7);var PD=Nkb(yAb,'NEdge/NEdgeBuilder',157);hI(278,1,{},l7);var RD=Nkb(yAb,'NGraph',278);hI(61,1,{61:1},n7);_.b=0;_.d=-1;_.e=0;_.i=-1;_.j=false;var UD=Nkb(yAb,'NNode',61);hI(333,13,bAb,q7);_.rb=function r7(a,b){++this.d;Fxb(a,this.c.length);fxb(this.c,a,b)};_.ib=function s7(a){return o7(this,a)};_.jb=function t7(a){++this.d;return xU(this,a)};_.Q=function u7(){++this.d;this.c=xv(UF,syb,1,0,4,1)};_.vb=function v7(a){++this.d;return AU(this,a)};_.nb=function w7(a){return p7(this,a)};var SD=Nkb(yAb,'NNode/ChangeAwareArrayList',333);hI(199,1,{},A7);var TD=Nkb(yAb,'NNode/NNodeBuilder',199);hI(595,1,{},V7);_.a=false;_.f=$xb;_.j=0;var VD=Nkb(yAb,'NetworkSimplex',595);hI(193,17,{180:1,193:1,3:1,23:1,17:1},$7);_.rc=function _7(){switch(this.e){case 0:return new g8;case 1:return new m8;default:throw new slb('No implementation is available for the cycle breaker '+(this.d!=null?this.d:''+this.e));}};var X7,Y7;var WD=Okb(AAb,'CycleBreakingStrategy',193,IF,a8);var b8;hI(539,1,BAb,g8);_.qc=function h8(a){return d8};_.sc=function i8(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,A,B,C,D,F,G,H,I,J;nI(b,'Greedy cycle removal',1);r=a.b;J=r.c.length;this.a=xv(mw,Yyb,26,J,12,1);this.c=xv(mw,Yyb,26,J,12,1);this.b=xv(mw,Yyb,26,J,12,1);h=0;for(p=new Tob(r);p.a0?C+1:1}for(e=new Tob(u.e);e.a0?C+1:1}}this.c[h]==0?QI(this.d,n):this.a[h]==0&&QI(this.e,n);++h}m=-1;l=1;j=new GU;D=Wv(rJ(a,(Rib(),Gib)),154);while(J>0){while(this.d.b!=0){G=Wv(YI(this.d),9);this.b[G.k]=m--;f8(this,G);--J}while(this.e.b!=0){H=Wv(YI(this.e),9);this.b[H.k]=l++;f8(this,H);--J}if(J>0){k=eyb;for(q=new Tob(r);q.a=k){if(s>k){j.c=xv(UF,syb,1,0,4,1);k=s}j.c[j.c.length]=n}}}i=Wv(yU(j,vvb(D,j.c.length)),9);this.b[i.k]=l++;f8(this,i);--J}}F=r.c.length+1;for(h=0;hthis.b[I]){cW(c,true);sJ(a,cib,(xkb(),xkb(),wkb))}}}}this.a=null;this.c=null;this.b=null;_I(this.e);_I(this.d);pI(b)};var d8;var XD=Nkb(AAb,'GreedyCycleBreaker',539);hI(540,1,BAb,m8);_.qc=function n8(a){return j8};_.sc=function o8(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p;nI(b,'Interactive cycle breaking',1);k=new GU;for(m=new Tob(a.b);m.a0&&l8(this,g,k)}for(d=new Tob(k);d.ag?h+1:g;p=new Fnb(c,0);d=null;while(p.b=g){Bxb(p.b>0);p.a.sb(p.c=--p.b);break}else if(n.a>h){if(!d){vU(n.b,j);n.c=Qlb(n.c,h);n.a=Nlb(n.a,g);d=n}else{xU(d.b,n.b);d.a=Nlb(d.a,n.a);vnb(p)}}}if(!d){d=new t8;d.c=h;d.a=g;Anb(p,d);vU(d.b,j)}}f=a.c;i=0;for(o=new Tob(c);o.a0){c+=g.i.a+g.j.a/2;++j}for(l=new Tob(g.f);l.a0;G++){k=wvb(F,1)!=0;j=k?0:q-1;i=this.b[j];C=wvb(F,1)!=0?A:t;H9(i,f,k,false,true);g=$xb;h=true;do{J9(this.b,this.k);D=g;g=0;g+=bab(this.f,i,j);if(k){for(r=1;r=0;r--){l=this.b[r];X8(C,i,(djb(),ajb));H9(l,f,false,!h,false);g+=bab(this.f,l,r);this.c[r]||this.d[r+1]?(g+=lab(this.e,l,i)):(g+=hab(this.i,l,i));i=l}j=0}h=false;k=!k}while(g0);if(gd?f:d}if(f>g){for(k=oX(a,c).mb();k.G();){j=Wv(k.H(),7);m[j.k]=b+O9(c,j.g)-g}return f-g}return 0}};var lE=Nkb(EAb,'LayerTotalPortDistributor',327);hI(274,326,{},P9);_.Hc=function Q9(a,b,c){var d,e,f,g,h,i,j,k,l,m,n;l=this.a;if(LM(Wv(rJ(a,(eM(),TL)),28))){switch(c.e){case 1:{e=0;f=0;for(k=new Tob(a.f);k.a');a0?B:0;o.c=d;o.d=Wv(Smb(u,k.c.f),61);o7(o.c.g,o);o7(o.d.c,o);F=new d7;F.f=bbb(k);F.a=B<0?-B:0;F.c=d;F.d=Wv(Smb(u,k.d.f),61);o7(F.c.g,F);o7(F.d.c,F)}}}f=Wv(rJ(a,(Mjb(),Kjb)),24).a*hw(Math.sqrt(t));F7(S7(T7(W7(e),f),false),rI(b,1));for(q=new Tob(e.a);q.aAbb(d))&&(j=d)}}!j&&(j=(Cxb(0,n.c.length),Wv(n.c[0],81)));for(m=new Tob(a.c);m.a0){c=m.b+(l-1)*m.a;!!i&&(c+=m.b);c'+this.b};_.c=0;var SE=Nkb(PAb,'OrthogonalRoutingGenerator/Dependency',118);hI(80,1,{80:1,23:1},odb);_.F=function pdb(a){return ndb(this,Wv(a,80))};_.t=function qdb(a){var b;if(aw(a,80)){b=Wv(a,80);return this.d==b.d}return false};_.v=function rdb(){return this.d};_.w=function sdb(){var a,b,c,d;a=new Bmb('{');d=new Tob(this.g);while(d.adAb){e=new HI(i,l);QI(c.a,e);_cb(this.a,c,a,e,false);f=new HI(k,l);QI(c.a,f);_cb(this.a,c,a,f,false)}}}};_.Lc=function vdb(a){return a.f.i.a+a.i.a+a.a.a};_.Mc=function wdb(){return sN(),pN};_.Nc=function xdb(){return sN(),$M};var UE=Nkb(PAb,'OrthogonalRoutingGenerator/NorthToSouthRoutingStrategy',580);hI(581,1,{},ydb);_.Kc=function zdb(a,b){var c,d,e,f,g,h,i,j,k,l;l=b-a.i*this.a.c;for(h=new Tob(a.g);h.adAb){e=new HI(i,l);QI(c.a,e);_cb(this.a,c,a,e,false);f=new HI(k,l);QI(c.a,f);_cb(this.a,c,a,f,false)}}}};_.Lc=function Adb(a){return a.f.i.a+a.i.a+a.a.a};_.Mc=function Bdb(){return sN(),$M};_.Nc=function Cdb(){return sN(),pN};var VE=Nkb(PAb,'OrthogonalRoutingGenerator/SouthToNorthRoutingStrategy',581);hI(579,1,{},Ddb);_.Kc=function Edb(a,b){var c,d,e,f,g,h,i,j,k,l;l=b+a.i*this.a.c;for(h=new Tob(a.g);h.adAb){e=new HI(l,i);QI(c.a,e);_cb(this.a,c,a,e,true);f=new HI(l,k);QI(c.a,f);_cb(this.a,c,a,f,true)}}}};_.Lc=function Fdb(a){return a.f.i.b+a.i.b+a.a.b};_.Mc=function Gdb(){return sN(),ZM};_.Nc=function Hdb(){return sN(),rN};var WE=Nkb(PAb,'OrthogonalRoutingGenerator/WestToEastRoutingStrategy',579);hI(535,1,BAb,Rdb);_.qc=function Sdb(a){var b,c;c=Wv(rJ(a,(Rib(),jib)),18);b=new WQ;if(c.kb((ohb(),khb))||Ckb(Ixb(Xv(rJ(a,(Mjb(),rjb)))))){QQ(b,Kdb);c.kb(lhb)&&QQ(b,Ldb)}c.kb(ehb)&&QQ(b,Idb);c.kb(ghb)&&QQ(b,Jdb);return b};_.sc=function Tdb(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v;nI(b,'Polyline edge routing',1);l=Wv(rJ(a,(Rib(),Jib)),15).a;c=Wv(rJ(a,(Mjb(),qjb)),15).a;q=0;if(a.c.c.length!=0){r=Pdb(Wv(yU(a.c,0),16));q=0.4*c*r}f=new Fnb(a.c,0);while(f.b0&&(q-=l);UW(e,q);i=0;for(k=new Tob(e.a);k.a(p-o<=0?0-(p-o):p-o)?h:p-o<=0?0-(p-o):p-o}switch(j.g.e){case 0:case 4:case 1:case 3:Qdb(this,j,q);}i=i>h?i:h}if(f.br?i:r;Bxb(f.b>0);f.a.sb(f.c=--f.b)}g=0.4*c*i;!d&&f.b0){n=(t+1)*this.a;n=0&&(L+=(t+2)*this.a)}r=A;i=j}while(A);for(d=new Tob(I);d.a('+this.c+') '+this.b};_.c=0;var eF=Nkb(QAb,'SplineEdgeRouter/Dependency',117);hI(223,17,{223:1,3:1,23:1,17:1},ggb);var dgb,egb;var fF=Okb(QAb,'SplineEdgeRouter/SideToProcess',223,IF,hgb);hI(77,1,{77:1,23:1},lgb,mgb);_.F=function ngb(a){return jgb(this,Wv(a,77))};_.a=0;_.b=0;_.e=0;_.f=false;_.i=0;_.k=0;_.n=0;_.p=0;var gF=Nkb(QAb,'SplineEdgeRouter/SplineHyperEdge',77);hI(123,17,{123:1,3:1,23:1,17:1},Agb);var tgb,ugb,vgb,wgb,xgb,ygb;var iF=Okb(VAb,'ContentAlignment',123,IF,Bgb);var Cgb;hI(218,17,{218:1,3:1,23:1,17:1},Igb);var Egb,Fgb,Ggb;var jF=Okb(VAb,'EdgeConstraint',218,IF,Jgb);hI(115,17,{115:1,3:1,23:1,17:1},Rgb);var Kgb,Lgb,Mgb,Ngb,Ogb;var kF=Okb(VAb,'EdgeLabelSideSelection',115,IF,Sgb);var Tgb;hI(124,17,{124:1,3:1,23:1,17:1},ahb);var Vgb,Wgb,Xgb,Ygb,Zgb,$gb;var lF=Okb(VAb,'FixedAlignment',124,IF,bhb);var chb;hI(113,17,{113:1,3:1,23:1,17:1},phb);var ehb,fhb,ghb,hhb,ihb,jhb,khb,lhb,mhb,nhb;var mF=Okb(VAb,'GraphProperties',113,IF,qhb);hI(110,17,{110:1,3:1,23:1,17:1},Ahb);_.a=false;_.b=false;_.c=false;var rhb,shb,thb,uhb,vhb,whb,xhb,yhb;var nF=Okb(VAb,'GreedySwitchType',110,IF,Bhb);var Chb;hI(140,17,{140:1,3:1,23:1,17:1},Ihb);var Ehb,Fhb,Ghb;var oF=Okb(VAb,'InLayerConstraint',140,IF,Jhb);hI(174,17,{174:1,3:1,23:1,17:1},Nhb);var Khb,Lhb;var pF=Okb(VAb,'InteractiveReferencePoint',174,IF,Ohb);var Phb;var Rhb,Shb,Thb,Uhb,Vhb,Whb,Xhb,Yhb,Zhb,$hb,_hb,aib,bib,cib,dib,eib,fib,gib,hib,iib,jib,kib,lib,mib,nib,oib,pib,qib,rib,sib,tib,uib,vib,wib,xib,yib,zib,Aib,Bib,Cib,Dib,Eib,Fib,Gib,Hib,Iib,Jib,Kib,Lib,Mib,Nib,Oib,Pib,Qib;hI(85,17,{85:1,3:1,23:1,17:1},Yib);var Sib,Tib,Uib,Vib,Wib;var qF=Okb(VAb,'LayerConstraint',85,IF,Zib);var $ib;hI(219,17,{219:1,3:1,23:1,17:1},ejb);var ajb,bjb,cjb;var rF=Okb(VAb,'PortType',219,IF,fjb);var gjb,hjb,ijb,jjb,kjb,ljb,mjb,njb,ojb,pjb,qjb,rjb,sjb,tjb,ujb,vjb,wjb,xjb,yjb,zjb,Ajb,Bjb,Cjb,Djb,Ejb,Fjb,Gjb,Hjb,Ijb,Jjb,Kjb,Ljb;hI(153,17,{153:1,3:1,23:1,17:1},Rjb);var Njb,Ojb,Pjb;var sF=Okb(VAb,'SelfLoopPlacement',153,IF,Sjb);var Tjb;hI(134,1,{134:1},$jb);_.a=0;_.b=0;_.c=0;_.d=0;_.e=0;_.f=0;var tF=Nkb(VAb,'Spacings',134);hI(172,17,{172:1,3:1,23:1,17:1},dkb);var _jb,akb,bkb;var uF=Okb(VAb,'WideNodesStrategy',172,IF,ekb);var fkb;hI(644,1,{});var xF=Nkb(nyb,'OutputStream',644);hI(645,644,{});var vF=Nkb(nyb,'FilterOutputStream',645);hI(291,645,{},hkb);var yF=Nkb(nyb,'PrintStream',291);hI(255,1,{});_.w=function mkb(){return this.a};var AF=Nkb(kyb,'AbstractStringBuilder',255);hI(621,95,Vxb,pkb);var BF=Nkb(kyb,'ArrayIndexOutOfBoundsException',621);hI(290,72,Vxb,qkb,rkb);var CF=Nkb(kyb,'ArrayStoreException',290);hI(252,46,Uxb);var JF=Nkb(kyb,'Error',252);hI(84,252,Uxb,tkb,ukb);var DF=Nkb(kyb,'AssertionError',84);Sv={3:1,349:1,23:1};var vkb,wkb;var EF=Nkb(kyb,'Boolean',349);Tv={3:1,23:1,184:1,231:1};var HF=Nkb(kyb,'Double',184);hI(15,231,{3:1,23:1,15:1,231:1},klb,llb);_.F=function mlb(a){return jlb(this,Wv(a,15))};_.t=function nlb(a){return aw(a,15)&&Wv(a,15).a==this.a};_.v=function olb(){return hw(this.a)};_.w=function plb(){return qlb(this.a)};_.a=0;var LF=Nkb(kyb,'Float',15);hI(101,72,Vxb,tlb,ulb);var NF=Nkb(kyb,'IllegalStateException',101);var Flb;var Hlb;hI(608,72,Vxb,Ulb);var QF=Nkb(kyb,'NegativeArraySizeException',608);hI(76,72,{3:1,54:1,76:1,46:1},Vlb,Wlb);var RF=Nkb(kyb,'NullPointerException',76);hI(130,29,{3:1,54:1,29:1,130:1,46:1},Xlb,Ylb);var SF=Nkb(kyb,'NumberFormatException',130);hI(146,1,{3:1,146:1},Zlb);_.t=function $lb(a){var b;if(aw(a,146)){b=Wv(a,146);return this.c==b.c&&ovb(this.d,b.d)&&ovb(this.a,b.a)&&ovb(this.b,b.b)}return false};_.v=function _lb(){return fpb(Bv(tv(UF,1),syb,1,4,[Elb(this.c),this.a,this.d,this.b]))};_.w=function amb(){return this.a+'.'+this.d+'('+(this.b!=null?this.b:'Unknown Source')+(this.c>=0?':'+this.c:'')+')'};_.c=0;var WF=Nkb(kyb,'StackTraceElement',146);hI(98,255,{345:1},zmb,Amb,Bmb);var YF=Nkb(kyb,'StringBuilder',98);var Dmb,Emb;hI(45,72,{3:1,54:1,46:1,45:1},Hmb,Imb);var aG=Nkb(kyb,'UnsupportedOperationException',45);hI(213,638,Byb);_.Q=function _mb(){Ymb(this)};_.R=function anb(a){return Qmb(this,a)};_.ab=function bnb(a){return Rmb(this,a,this.e)||Rmb(this,a,this.d)};_.bb=function cnb(){return new inb(this)};_.cb=function dnb(a){return Smb(this,a)};_.db=function enb(a,b){return Umb(this,a,b)};_.eb=function fnb(a){return Wmb(this,a)};_.Y=function gnb(){return Zmb(this)};var hG=Nkb(Cyb,'AbstractHashMap',213);hI(120,641,Eyb,inb);_.Q=function jnb(){this.a.Q()};_.kb=function knb(a){return hnb(this,a)};_.mb=function lnb(){return new rnb(this.a)};_.nb=function mnb(a){var b;if(hnb(this,a)){b=Wv(a,21).yb();this.a.eb(b);return true}return false};_.Y=function nnb(){return this.a.Y()};var gG=Nkb(Cyb,'AbstractHashMap/EntrySet',120);hI(148,1,Ayb,rnb);_.H=function tnb(){return pnb(this)};_.G=function snb(){return this.b};_.I=function unb(){qnb(this)};_.b=false;var fG=Nkb(Cyb,'AbstractHashMap/EntrySetIterator',148);hI(162,1,Ayb,wnb);_.G=function xnb(){return this.b0};_.L=function Inb(){return this.b};_.M=function Jnb(){return Dnb(this)};_.N=function Knb(){return this.b-1};_.O=function Lnb(a){Enb(this,a)};var jG=Nkb(Cyb,'AbstractList/ListIteratorImpl',43);hI(258,647,Fyb,Mnb);_.rb=function Nnb(a,b){Fxb(a,this.b);this.c.rb(this.a+a,b);++this.b};_.sb=function Onb(a){Cxb(a,this.b);return this.c.sb(this.a+a)};_.vb=function Pnb(a){var b;Cxb(a,this.b);b=this.c.vb(this.a+a);--this.b;return b};_.wb=function Qnb(a,b){Cxb(a,this.b);return this.c.wb(this.a+a,b)};_.Y=function Rnb(){return this.b};_.a=0;_.b=0;var kG=Nkb(Cyb,'AbstractList/SubList',258);hI(36,641,Eyb,Snb);_.Q=function Tnb(){this.a.Q()};_.kb=function Unb(a){return this.a.R(a)};_.mb=function Vnb(){var a;return a=this.a.bb().mb(),new Ynb(a)};_.nb=function Wnb(a){if(this.a.R(a)){this.a.eb(a);return true}return false};_.Y=function Xnb(){return this.a.Y()};var nG=Nkb(Cyb,'AbstractMap/1',36);hI(40,1,Ayb,Ynb);_.G=function Znb(){return this.a.G()};_.H=function $nb(){var a;return a=Wv(this.a.H(),21),a.yb()};_.I=function _nb(){this.a.I()};var mG=Nkb(Cyb,'AbstractMap/1/1',40);hI(211,640,Dyb,aob);_.Q=function bob(){this.a.Q()};_.kb=function cob(a){return this.a.ab(a)};_.mb=function dob(){var a;return a=this.a.bb().mb(),new fob(a)};_.Y=function eob(){return this.a.Y()};var pG=Nkb(Cyb,'AbstractMap/2',211);hI(212,1,Ayb,fob);_.G=function gob(){return this.a.G()};_.H=function hob(){var a;return a=Wv(this.a.H(),21),a.zb()};_.I=function iob(){this.a.I()};var oG=Nkb(Cyb,'AbstractMap/2/1',212);hI(210,1,{210:1,21:1});_.t=function kob(a){var b;if(!aw(a,21)){return false}b=Wv(a,21);return ovb(this.d,b.yb())&&ovb(this.e,b.zb())};_.yb=function lob(){return this.d};_.zb=function mob(){return this.e};_.v=function nob(){return pvb(this.d)^pvb(this.e)};_.Ab=function oob(a){return job(this,a)};_.w=function pob(){return this.d+'='+this.e};var qG=Nkb(Cyb,'AbstractMap/AbstractEntry',210);hI(163,210,{210:1,163:1,21:1},qob);var rG=Nkb(Cyb,'AbstractMap/SimpleEntry',163);hI(652,1,Jyb);_.t=function rob(a){var b;if(!aw(a,21)){return false}b=Wv(a,21);return ovb(this.yb(),b.yb())&&ovb(this.zb(),b.zb())};_.v=function sob(){return pvb(this.yb())^pvb(this.zb())};_.w=function tob(){return this.yb()+'='+this.zb()};var sG=Nkb(Cyb,Kyb,652);hI(639,638,Byb);_._=function wob(a){return uob(this,a)};_.R=function xob(a){return vob(this,a)};_.bb=function yob(){return new Bob(this)};_.cb=function zob(a){return re(Wvb(this,a))};_.W=function Aob(){return new Gob(this)};var xG=Nkb(Cyb,'AbstractNavigableMap',639);hI(287,641,Eyb,Bob);_.kb=function Cob(a){return aw(a,21)&&uob(this.b,Wv(a,21))};_.mb=function Dob(){return new rwb(this.b)};_.nb=function Eob(a){var b;if(aw(a,21)){b=Wv(a,21);return dwb(this.b,b)}return false};_.Y=function Fob(){return this.b.c};var uG=Nkb(Cyb,'AbstractNavigableMap/EntrySet',287);hI(229,641,Iyb,Gob);_.Q=function Hob(){Vvb(this.a)};_.kb=function Iob(a){return vob(this.a,a)};_.mb=function Job(){var a;return a=new rwb((new wwb(this.a)).b),new Mob(a)};_.nb=function Kob(a){if(vob(this.a,a)){cwb(this.a,a);return true}return false};_.Y=function Lob(){return this.a.c};var wG=Nkb(Cyb,'AbstractNavigableMap/NavigableKeySet',229);hI(230,1,Ayb,Mob);_.G=function Nob(){return Bnb(this.a.a)};_.H=function Oob(){var a;return a=pwb(this.a),a.yb()};_.I=function Pob(){qwb(this.a)};var vG=Nkb(Cyb,'AbstractNavigableMap/NavigableKeySet/1',230);hI(4,1,Ayb,Tob);_.G=function Uob(){return Qob(this)};_.H=function Vob(){return Rob(this)};_.I=function Wob(){Sob(this)};_.a=0;_.b=-1;var AG=Nkb(Cyb,'ArrayList/1',4);hI(94,647,XAb,opb);_.kb=function ppb(a){return dn(this,a)!=-1};_.sb=function qpb(a){return mpb(this,a)};_.wb=function rpb(a,b){var c;c=(Cxb(a,this.a.length),this.a[a]);Av(this.a,a,b);return c};_.Y=function spb(){return this.a.length};_.ob=function tpb(){return npb(this,xv(UF,syb,1,this.a.length,4,1))};_.pb=function upb(a){return npb(this,a)};var CG=Nkb(Cyb,'Arrays/ArrayList',94);var vpb,wpb,xpb;hI(413,1,fyb,Ipb);_.$b=function Jpb(a,b){return zT(b,a)};var DG=Nkb(Cyb,'Collections/2',413);hI(406,647,XAb,Kpb);_.kb=function Lpb(a){return false};_.sb=function Mpb(a){Cxb(a,0);return null};_.mb=function Npb(){return ypb(),Rpb(),Qpb};_.tb=function Opb(){return ypb(),Rpb(),Qpb};_.Y=function Ppb(){return 0};var FG=Nkb(Cyb,'Collections/EmptyList',406);hI(407,1,Hyb,Spb);_.J=function Tpb(a){throw new Hmb};_.G=function Upb(){return false};_.K=function Vpb(){return false};_.H=function Wpb(){throw new nvb};_.L=function Xpb(){return 0};_.M=function Ypb(){throw new nvb};_.N=function Zpb(){return -1};_.I=function $pb(){throw new tlb};_.O=function _pb(a){throw new tlb};var Qpb;var EG=Nkb(Cyb,'Collections/EmptyListIterator',407);hI(409,638,Ryb,aqb);_.R=function bqb(a){return false};_.ab=function cqb(a){return false};_.bb=function dqb(){return ypb(),xpb};_.cb=function eqb(a){return null};_.W=function fqb(){return ypb(),xpb};_.Y=function gqb(){return 0};_.fb=function hqb(){return ypb(),vpb};var GG=Nkb(Cyb,'Collections/EmptyMap',409);hI(408,641,Syb,iqb);_.kb=function jqb(a){return false};_.mb=function kqb(){return ypb(),Rpb(),Qpb};_.Y=function lqb(){return 0};var HG=Nkb(Cyb,'Collections/EmptySet',408);hI(410,1,fyb,pqb);_.$b=function qqb(a,b){return oqb(Wv(a,23),Wv(b,23))};var mqb;var IG=Nkb(Cyb,'Collections/ReverseComparator',410);hI(411,647,{3:1,22:1,19:1,20:1},rqb);_.kb=function sqb(a){return ovb(this.a,a)};_.sb=function tqb(a){Cxb(a,1);return this.a};_.Y=function uqb(){return 1};var JG=Nkb(Cyb,'Collections/SingletonList',411);hI(217,1,Dyb,zqb);_.ib=function Aqb(a){return vqb()};_.jb=function Bqb(a){return wqb()};_.Q=function Cqb(){xqb()};_.kb=function Dqb(a){return this.b.kb(a)};_.lb=function Eqb(a){return this.b.lb(a)};_.V=function Fqb(){return this.b.V()};_.mb=function Gqb(){return new Nqb(this.b.mb())};_.nb=function Hqb(a){return yqb()};_.Y=function Iqb(){return this.b.Y()};_.ob=function Jqb(){return this.b.ob()};_.pb=function Kqb(a){return this.b.pb(a)};_.w=function Lqb(){return xb(this.b)};var LG=Nkb(Cyb,'Collections/UnmodifiableCollection',217);hI(152,1,Ayb,Nqb);_.G=function Oqb(){return this.b.G()};_.H=function Pqb(){return this.b.H()};_.I=function Qqb(){Mqb()};var KG=Nkb(Cyb,'Collections/UnmodifiableCollectionIterator',152);hI(233,217,Fyb,Rqb);_.rb=function Sqb(a,b){throw new Hmb};_.t=function Tqb(a){return this.a.t(a)};_.sb=function Uqb(a){return this.a.sb(a)};_.v=function Vqb(){return this.a.v()};_.V=function Wqb(){return this.a.V()};_.tb=function Xqb(){return new arb(this.a.ub(0))};_.ub=function Yqb(a){return new arb(this.a.ub(a))};_.vb=function Zqb(a){throw new Hmb};_.wb=function $qb(a,b){throw new Hmb};_.xb=function _qb(a,b){return new Rqb(this.a.xb(a,b))};var NG=Nkb(Cyb,'Collections/UnmodifiableList',233);hI(309,152,Hyb,arb);_.J=function brb(a){throw new Hmb};_.K=function crb(){return this.a.K()};_.L=function drb(){return this.a.L()};_.M=function erb(){return this.a.M()};_.N=function frb(){return this.a.N()};_.O=function grb(a){throw new Hmb};var MG=Nkb(Cyb,'Collections/UnmodifiableListIterator',309);hI(305,1,Byb,mrb);_.Q=function nrb(){throw new Hmb};_.R=function orb(a){return this.c.R(a)};_.ab=function prb(a){return hrb(this,a)};_.bb=function qrb(){return irb(this)};_.t=function rrb(a){return jrb(this,a)};_.cb=function srb(a){return this.c.cb(a)};_.v=function trb(){return this.c.v()};_.V=function urb(){return this.c.V()};_.W=function vrb(){return krb(this)};_.db=function wrb(a,b){throw new Hmb};_.eb=function xrb(a){throw new Hmb};_.Y=function yrb(){return this.c.Y()};_.w=function zrb(){return xb(this.c)};_.fb=function Arb(){return lrb(this)};var RG=Nkb(Cyb,'Collections/UnmodifiableMap',305);hI(151,217,Eyb,Frb);_.t=function Grb(a){return Drb(this,a)};_.v=function Hrb(){return this.b.v()};var TG=Nkb(Cyb,'Collections/UnmodifiableSet',151);hI(412,151,Eyb,Nrb);_.kb=function Orb(a){return Irb(this,a)};_.lb=function Prb(a){return Jrb(this,a)};_.mb=function Qrb(){var a;return a=this.b.mb(),new Trb(a)};_.ob=function Rrb(){return Krb(this)};_.pb=function Srb(a){return Lrb(this,a)};var QG=Nkb(Cyb,'Collections/UnmodifiableMap/UnmodifiableEntrySet',412);hI(263,1,Ayb,Trb);_.H=function Vrb(){return new Xrb(Wv(this.a.H(),21))};_.G=function Urb(){return this.a.G()};_.I=function Wrb(){throw new Hmb};var OG=Nkb(Cyb,'Collections/UnmodifiableMap/UnmodifiableEntrySet/1',263);hI(306,1,Jyb,Xrb);_.t=function Yrb(a){return this.a.t(a)};_.yb=function Zrb(){return this.a.yb()};_.zb=function $rb(){return this.a.zb()};_.v=function _rb(){return this.a.v()};_.Ab=function asb(a){throw new Hmb};_.w=function bsb(){return xb(this.a)};var PG=Nkb(Cyb,'Collections/UnmodifiableMap/UnmodifiableEntrySet/UnmodifiableEntry',306);hI(307,233,Gyb,csb);var SG=Nkb(Cyb,'Collections/UnmodifiableRandomAccessList',307);hI(308,151,Iyb,dsb);_.t=function esb(a){return this.a.t(a)};_.v=function fsb(){return this.a.v()};var UG=Nkb(Cyb,'Collections/UnmodifiableSortedSet',308);var gsb;hI(522,1,fyb,isb);_.$b=function jsb(a,b){Dxb(a);Dxb(b);return Akb(Wv(a,23),b)};var VG=Nkb(Cyb,'Comparators/1',522);hI(202,72,Vxb,nsb);var WG=Nkb(Cyb,'ConcurrentModificationException',202);hI(609,72,Vxb,osb);var XG=Nkb(Cyb,'EmptyStackException',609);hI(319,638,Byb,vsb);_.db=function Bsb(a,b){return ssb(this,a,b)};_.Q=function wsb(){psb(this)};_.R=function xsb(a){return Ysb(this.a,a)};_.ab=function ysb(a){var b,c;for(c=new jtb(this.a);c.a -1)) {\n // throw \"assert failed\";\n // }\n // }\n\n return this.owner;\n};\n\nLNode.prototype.getWidth = function () {\n return this.rect.width;\n};\n\nLNode.prototype.setWidth = function (width) {\n this.rect.width = width;\n};\n\nLNode.prototype.getHeight = function () {\n return this.rect.height;\n};\n\nLNode.prototype.setHeight = function (height) {\n this.rect.height = height;\n};\n\nLNode.prototype.getCenterX = function () {\n return this.rect.x + this.rect.width / 2;\n};\n\nLNode.prototype.getCenterY = function () {\n return this.rect.y + this.rect.height / 2;\n};\n\nLNode.prototype.getCenter = function () {\n return new PointD(this.rect.x + this.rect.width / 2, this.rect.y + this.rect.height / 2);\n};\n\nLNode.prototype.getLocation = function () {\n return new PointD(this.rect.x, this.rect.y);\n};\n\nLNode.prototype.getRect = function () {\n return this.rect;\n};\n\nLNode.prototype.getDiagonal = function () {\n return Math.sqrt(this.rect.width * this.rect.width + this.rect.height * this.rect.height);\n};\n\n/**\n * This method returns half the diagonal length of this node.\n */\nLNode.prototype.getHalfTheDiagonal = function () {\n return Math.sqrt(this.rect.height * this.rect.height + this.rect.width * this.rect.width) / 2;\n};\n\nLNode.prototype.setRect = function (upperLeft, dimension) {\n this.rect.x = upperLeft.x;\n this.rect.y = upperLeft.y;\n this.rect.width = dimension.width;\n this.rect.height = dimension.height;\n};\n\nLNode.prototype.setCenter = function (cx, cy) {\n this.rect.x = cx - this.rect.width / 2;\n this.rect.y = cy - this.rect.height / 2;\n};\n\nLNode.prototype.setLocation = function (x, y) {\n this.rect.x = x;\n this.rect.y = y;\n};\n\nLNode.prototype.moveBy = function (dx, dy) {\n this.rect.x += dx;\n this.rect.y += dy;\n};\n\nLNode.prototype.getEdgeListToNode = function (to) {\n var edgeList = [];\n var edge;\n var self = this;\n\n self.edges.forEach(function (edge) {\n\n if (edge.target == to) {\n if (edge.source != self) throw \"Incorrect edge source!\";\n\n edgeList.push(edge);\n }\n });\n\n return edgeList;\n};\n\nLNode.prototype.getEdgesBetween = function (other) {\n var edgeList = [];\n var edge;\n\n var self = this;\n self.edges.forEach(function (edge) {\n\n if (!(edge.source == self || edge.target == self)) throw \"Incorrect edge source and/or target\";\n\n if (edge.target == other || edge.source == other) {\n edgeList.push(edge);\n }\n });\n\n return edgeList;\n};\n\nLNode.prototype.getNeighborsList = function () {\n var neighbors = new Set();\n\n var self = this;\n self.edges.forEach(function (edge) {\n\n if (edge.source == self) {\n neighbors.add(edge.target);\n } else {\n if (edge.target != self) {\n throw \"Incorrect incidency!\";\n }\n\n neighbors.add(edge.source);\n }\n });\n\n return neighbors;\n};\n\nLNode.prototype.withChildren = function () {\n var withNeighborsList = new Set();\n var childNode;\n var children;\n\n withNeighborsList.add(this);\n\n if (this.child != null) {\n var nodes = this.child.getNodes();\n for (var i = 0; i < nodes.length; i++) {\n childNode = nodes[i];\n children = childNode.withChildren();\n children.forEach(function (node) {\n withNeighborsList.add(node);\n });\n }\n }\n\n return withNeighborsList;\n};\n\nLNode.prototype.getNoOfChildren = function () {\n var noOfChildren = 0;\n var childNode;\n\n if (this.child == null) {\n noOfChildren = 1;\n } else {\n var nodes = this.child.getNodes();\n for (var i = 0; i < nodes.length; i++) {\n childNode = nodes[i];\n\n noOfChildren += childNode.getNoOfChildren();\n }\n }\n\n if (noOfChildren == 0) {\n noOfChildren = 1;\n }\n return noOfChildren;\n};\n\nLNode.prototype.getEstimatedSize = function () {\n if (this.estimatedSize == Integer.MIN_VALUE) {\n throw \"assert failed\";\n }\n return this.estimatedSize;\n};\n\nLNode.prototype.calcEstimatedSize = function () {\n if (this.child == null) {\n return this.estimatedSize = (this.rect.width + this.rect.height) / 2;\n } else {\n this.estimatedSize = this.child.calcEstimatedSize();\n this.rect.width = this.estimatedSize;\n this.rect.height = this.estimatedSize;\n\n return this.estimatedSize;\n }\n};\n\nLNode.prototype.scatter = function () {\n var randomCenterX;\n var randomCenterY;\n\n var minX = -LayoutConstants.INITIAL_WORLD_BOUNDARY;\n var maxX = LayoutConstants.INITIAL_WORLD_BOUNDARY;\n randomCenterX = LayoutConstants.WORLD_CENTER_X + RandomSeed.nextDouble() * (maxX - minX) + minX;\n\n var minY = -LayoutConstants.INITIAL_WORLD_BOUNDARY;\n var maxY = LayoutConstants.INITIAL_WORLD_BOUNDARY;\n randomCenterY = LayoutConstants.WORLD_CENTER_Y + RandomSeed.nextDouble() * (maxY - minY) + minY;\n\n this.rect.x = randomCenterX;\n this.rect.y = randomCenterY;\n};\n\nLNode.prototype.updateBounds = function () {\n if (this.getChild() == null) {\n throw \"assert failed\";\n }\n if (this.getChild().getNodes().length != 0) {\n // wrap the children nodes by re-arranging the boundaries\n var childGraph = this.getChild();\n childGraph.updateBounds(true);\n\n this.rect.x = childGraph.getLeft();\n this.rect.y = childGraph.getTop();\n\n this.setWidth(childGraph.getRight() - childGraph.getLeft());\n this.setHeight(childGraph.getBottom() - childGraph.getTop());\n\n // Update compound bounds considering its label properties \n if (LayoutConstants.NODE_DIMENSIONS_INCLUDE_LABELS) {\n\n var width = childGraph.getRight() - childGraph.getLeft();\n var height = childGraph.getBottom() - childGraph.getTop();\n\n if (this.labelWidth > width) {\n this.rect.x -= (this.labelWidth - width) / 2;\n this.setWidth(this.labelWidth);\n }\n\n if (this.labelHeight > height) {\n if (this.labelPos == \"center\") {\n this.rect.y -= (this.labelHeight - height) / 2;\n } else if (this.labelPos == \"top\") {\n this.rect.y -= this.labelHeight - height;\n }\n this.setHeight(this.labelHeight);\n }\n }\n }\n};\n\nLNode.prototype.getInclusionTreeDepth = function () {\n if (this.inclusionTreeDepth == Integer.MAX_VALUE) {\n throw \"assert failed\";\n }\n return this.inclusionTreeDepth;\n};\n\nLNode.prototype.transform = function (trans) {\n var left = this.rect.x;\n\n if (left > LayoutConstants.WORLD_BOUNDARY) {\n left = LayoutConstants.WORLD_BOUNDARY;\n } else if (left < -LayoutConstants.WORLD_BOUNDARY) {\n left = -LayoutConstants.WORLD_BOUNDARY;\n }\n\n var top = this.rect.y;\n\n if (top > LayoutConstants.WORLD_BOUNDARY) {\n top = LayoutConstants.WORLD_BOUNDARY;\n } else if (top < -LayoutConstants.WORLD_BOUNDARY) {\n top = -LayoutConstants.WORLD_BOUNDARY;\n }\n\n var leftTop = new PointD(left, top);\n var vLeftTop = trans.inverseTransformPoint(leftTop);\n\n this.setLocation(vLeftTop.x, vLeftTop.y);\n};\n\nLNode.prototype.getLeft = function () {\n return this.rect.x;\n};\n\nLNode.prototype.getRight = function () {\n return this.rect.x + this.rect.width;\n};\n\nLNode.prototype.getTop = function () {\n return this.rect.y;\n};\n\nLNode.prototype.getBottom = function () {\n return this.rect.y + this.rect.height;\n};\n\nLNode.prototype.getParent = function () {\n if (this.owner == null) {\n return null;\n }\n\n return this.owner.getParent();\n};\n\nmodule.exports = LNode;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction PointD(x, y) {\n if (x == null && y == null) {\n this.x = 0;\n this.y = 0;\n } else {\n this.x = x;\n this.y = y;\n }\n}\n\nPointD.prototype.getX = function () {\n return this.x;\n};\n\nPointD.prototype.getY = function () {\n return this.y;\n};\n\nPointD.prototype.setX = function (x) {\n this.x = x;\n};\n\nPointD.prototype.setY = function (y) {\n this.y = y;\n};\n\nPointD.prototype.getDifference = function (pt) {\n return new DimensionD(this.x - pt.x, this.y - pt.y);\n};\n\nPointD.prototype.getCopy = function () {\n return new PointD(this.x, this.y);\n};\n\nPointD.prototype.translate = function (dim) {\n this.x += dim.width;\n this.y += dim.height;\n return this;\n};\n\nmodule.exports = PointD;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraphObject = __webpack_require__(2);\nvar Integer = __webpack_require__(10);\nvar LayoutConstants = __webpack_require__(0);\nvar LGraphManager = __webpack_require__(6);\nvar LNode = __webpack_require__(3);\nvar LEdge = __webpack_require__(1);\nvar RectangleD = __webpack_require__(13);\nvar Point = __webpack_require__(12);\nvar LinkedList = __webpack_require__(11);\n\nfunction LGraph(parent, obj2, vGraph) {\n LGraphObject.call(this, vGraph);\n this.estimatedSize = Integer.MIN_VALUE;\n this.margin = LayoutConstants.DEFAULT_GRAPH_MARGIN;\n this.edges = [];\n this.nodes = [];\n this.isConnected = false;\n this.parent = parent;\n\n if (obj2 != null && obj2 instanceof LGraphManager) {\n this.graphManager = obj2;\n } else if (obj2 != null && obj2 instanceof Layout) {\n this.graphManager = obj2.graphManager;\n }\n}\n\nLGraph.prototype = Object.create(LGraphObject.prototype);\nfor (var prop in LGraphObject) {\n LGraph[prop] = LGraphObject[prop];\n}\n\nLGraph.prototype.getNodes = function () {\n return this.nodes;\n};\n\nLGraph.prototype.getEdges = function () {\n return this.edges;\n};\n\nLGraph.prototype.getGraphManager = function () {\n return this.graphManager;\n};\n\nLGraph.prototype.getParent = function () {\n return this.parent;\n};\n\nLGraph.prototype.getLeft = function () {\n return this.left;\n};\n\nLGraph.prototype.getRight = function () {\n return this.right;\n};\n\nLGraph.prototype.getTop = function () {\n return this.top;\n};\n\nLGraph.prototype.getBottom = function () {\n return this.bottom;\n};\n\nLGraph.prototype.isConnected = function () {\n return this.isConnected;\n};\n\nLGraph.prototype.add = function (obj1, sourceNode, targetNode) {\n if (sourceNode == null && targetNode == null) {\n var newNode = obj1;\n if (this.graphManager == null) {\n throw \"Graph has no graph mgr!\";\n }\n if (this.getNodes().indexOf(newNode) > -1) {\n throw \"Node already in graph!\";\n }\n newNode.owner = this;\n this.getNodes().push(newNode);\n\n return newNode;\n } else {\n var newEdge = obj1;\n if (!(this.getNodes().indexOf(sourceNode) > -1 && this.getNodes().indexOf(targetNode) > -1)) {\n throw \"Source or target not in graph!\";\n }\n\n if (!(sourceNode.owner == targetNode.owner && sourceNode.owner == this)) {\n throw \"Both owners must be this graph!\";\n }\n\n if (sourceNode.owner != targetNode.owner) {\n return null;\n }\n\n // set source and target\n newEdge.source = sourceNode;\n newEdge.target = targetNode;\n\n // set as intra-graph edge\n newEdge.isInterGraph = false;\n\n // add to graph edge list\n this.getEdges().push(newEdge);\n\n // add to incidency lists\n sourceNode.edges.push(newEdge);\n\n if (targetNode != sourceNode) {\n targetNode.edges.push(newEdge);\n }\n\n return newEdge;\n }\n};\n\nLGraph.prototype.remove = function (obj) {\n var node = obj;\n if (obj instanceof LNode) {\n if (node == null) {\n throw \"Node is null!\";\n }\n if (!(node.owner != null && node.owner == this)) {\n throw \"Owner graph is invalid!\";\n }\n if (this.graphManager == null) {\n throw \"Owner graph manager is invalid!\";\n }\n // remove incident edges first (make a copy to do it safely)\n var edgesToBeRemoved = node.edges.slice();\n var edge;\n var s = edgesToBeRemoved.length;\n for (var i = 0; i < s; i++) {\n edge = edgesToBeRemoved[i];\n\n if (edge.isInterGraph) {\n this.graphManager.remove(edge);\n } else {\n edge.source.owner.remove(edge);\n }\n }\n\n // now the node itself\n var index = this.nodes.indexOf(node);\n if (index == -1) {\n throw \"Node not in owner node list!\";\n }\n\n this.nodes.splice(index, 1);\n } else if (obj instanceof LEdge) {\n var edge = obj;\n if (edge == null) {\n throw \"Edge is null!\";\n }\n if (!(edge.source != null && edge.target != null)) {\n throw \"Source and/or target is null!\";\n }\n if (!(edge.source.owner != null && edge.target.owner != null && edge.source.owner == this && edge.target.owner == this)) {\n throw \"Source and/or target owner is invalid!\";\n }\n\n var sourceIndex = edge.source.edges.indexOf(edge);\n var targetIndex = edge.target.edges.indexOf(edge);\n if (!(sourceIndex > -1 && targetIndex > -1)) {\n throw \"Source and/or target doesn't know this edge!\";\n }\n\n edge.source.edges.splice(sourceIndex, 1);\n\n if (edge.target != edge.source) {\n edge.target.edges.splice(targetIndex, 1);\n }\n\n var index = edge.source.owner.getEdges().indexOf(edge);\n if (index == -1) {\n throw \"Not in owner's edge list!\";\n }\n\n edge.source.owner.getEdges().splice(index, 1);\n }\n};\n\nLGraph.prototype.updateLeftTop = function () {\n var top = Integer.MAX_VALUE;\n var left = Integer.MAX_VALUE;\n var nodeTop;\n var nodeLeft;\n var margin;\n\n var nodes = this.getNodes();\n var s = nodes.length;\n\n for (var i = 0; i < s; i++) {\n var lNode = nodes[i];\n nodeTop = lNode.getTop();\n nodeLeft = lNode.getLeft();\n\n if (top > nodeTop) {\n top = nodeTop;\n }\n\n if (left > nodeLeft) {\n left = nodeLeft;\n }\n }\n\n // Do we have any nodes in this graph?\n if (top == Integer.MAX_VALUE) {\n return null;\n }\n\n if (nodes[0].getParent().paddingLeft != undefined) {\n margin = nodes[0].getParent().paddingLeft;\n } else {\n margin = this.margin;\n }\n\n this.left = left - margin;\n this.top = top - margin;\n\n // Apply the margins and return the result\n return new Point(this.left, this.top);\n};\n\nLGraph.prototype.updateBounds = function (recursive) {\n // calculate bounds\n var left = Integer.MAX_VALUE;\n var right = -Integer.MAX_VALUE;\n var top = Integer.MAX_VALUE;\n var bottom = -Integer.MAX_VALUE;\n var nodeLeft;\n var nodeRight;\n var nodeTop;\n var nodeBottom;\n var margin;\n\n var nodes = this.nodes;\n var s = nodes.length;\n for (var i = 0; i < s; i++) {\n var lNode = nodes[i];\n\n if (recursive && lNode.child != null) {\n lNode.updateBounds();\n }\n nodeLeft = lNode.getLeft();\n nodeRight = lNode.getRight();\n nodeTop = lNode.getTop();\n nodeBottom = lNode.getBottom();\n\n if (left > nodeLeft) {\n left = nodeLeft;\n }\n\n if (right < nodeRight) {\n right = nodeRight;\n }\n\n if (top > nodeTop) {\n top = nodeTop;\n }\n\n if (bottom < nodeBottom) {\n bottom = nodeBottom;\n }\n }\n\n var boundingRect = new RectangleD(left, top, right - left, bottom - top);\n if (left == Integer.MAX_VALUE) {\n this.left = this.parent.getLeft();\n this.right = this.parent.getRight();\n this.top = this.parent.getTop();\n this.bottom = this.parent.getBottom();\n }\n\n if (nodes[0].getParent().paddingLeft != undefined) {\n margin = nodes[0].getParent().paddingLeft;\n } else {\n margin = this.margin;\n }\n\n this.left = boundingRect.x - margin;\n this.right = boundingRect.x + boundingRect.width + margin;\n this.top = boundingRect.y - margin;\n this.bottom = boundingRect.y + boundingRect.height + margin;\n};\n\nLGraph.calculateBounds = function (nodes) {\n var left = Integer.MAX_VALUE;\n var right = -Integer.MAX_VALUE;\n var top = Integer.MAX_VALUE;\n var bottom = -Integer.MAX_VALUE;\n var nodeLeft;\n var nodeRight;\n var nodeTop;\n var nodeBottom;\n\n var s = nodes.length;\n\n for (var i = 0; i < s; i++) {\n var lNode = nodes[i];\n nodeLeft = lNode.getLeft();\n nodeRight = lNode.getRight();\n nodeTop = lNode.getTop();\n nodeBottom = lNode.getBottom();\n\n if (left > nodeLeft) {\n left = nodeLeft;\n }\n\n if (right < nodeRight) {\n right = nodeRight;\n }\n\n if (top > nodeTop) {\n top = nodeTop;\n }\n\n if (bottom < nodeBottom) {\n bottom = nodeBottom;\n }\n }\n\n var boundingRect = new RectangleD(left, top, right - left, bottom - top);\n\n return boundingRect;\n};\n\nLGraph.prototype.getInclusionTreeDepth = function () {\n if (this == this.graphManager.getRoot()) {\n return 1;\n } else {\n return this.parent.getInclusionTreeDepth();\n }\n};\n\nLGraph.prototype.getEstimatedSize = function () {\n if (this.estimatedSize == Integer.MIN_VALUE) {\n throw \"assert failed\";\n }\n return this.estimatedSize;\n};\n\nLGraph.prototype.calcEstimatedSize = function () {\n var size = 0;\n var nodes = this.nodes;\n var s = nodes.length;\n\n for (var i = 0; i < s; i++) {\n var lNode = nodes[i];\n size += lNode.calcEstimatedSize();\n }\n\n if (size == 0) {\n this.estimatedSize = LayoutConstants.EMPTY_COMPOUND_NODE_SIZE;\n } else {\n this.estimatedSize = size / Math.sqrt(this.nodes.length);\n }\n\n return this.estimatedSize;\n};\n\nLGraph.prototype.updateConnected = function () {\n var self = this;\n if (this.nodes.length == 0) {\n this.isConnected = true;\n return;\n }\n\n var queue = new LinkedList();\n var visited = new Set();\n var currentNode = this.nodes[0];\n var neighborEdges;\n var currentNeighbor;\n var childrenOfNode = currentNode.withChildren();\n childrenOfNode.forEach(function (node) {\n queue.push(node);\n visited.add(node);\n });\n\n while (queue.length !== 0) {\n currentNode = queue.shift();\n\n // Traverse all neighbors of this node\n neighborEdges = currentNode.getEdges();\n var size = neighborEdges.length;\n for (var i = 0; i < size; i++) {\n var neighborEdge = neighborEdges[i];\n currentNeighbor = neighborEdge.getOtherEndInGraph(currentNode, this);\n\n // Add unvisited neighbors to the list to visit\n if (currentNeighbor != null && !visited.has(currentNeighbor)) {\n var childrenOfNeighbor = currentNeighbor.withChildren();\n\n childrenOfNeighbor.forEach(function (node) {\n queue.push(node);\n visited.add(node);\n });\n }\n }\n }\n\n this.isConnected = false;\n\n if (visited.size >= this.nodes.length) {\n var noOfVisitedInThisGraph = 0;\n\n visited.forEach(function (visitedNode) {\n if (visitedNode.owner == self) {\n noOfVisitedInThisGraph++;\n }\n });\n\n if (noOfVisitedInThisGraph == this.nodes.length) {\n this.isConnected = true;\n }\n }\n};\n\nmodule.exports = LGraph;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LGraph;\nvar LEdge = __webpack_require__(1);\n\nfunction LGraphManager(layout) {\n LGraph = __webpack_require__(5); // It may be better to initilize this out of this function but it gives an error (Right-hand side of 'instanceof' is not callable) now.\n this.layout = layout;\n\n this.graphs = [];\n this.edges = [];\n}\n\nLGraphManager.prototype.addRoot = function () {\n var ngraph = this.layout.newGraph();\n var nnode = this.layout.newNode(null);\n var root = this.add(ngraph, nnode);\n this.setRootGraph(root);\n return this.rootGraph;\n};\n\nLGraphManager.prototype.add = function (newGraph, parentNode, newEdge, sourceNode, targetNode) {\n //there are just 2 parameters are passed then it adds an LGraph else it adds an LEdge\n if (newEdge == null && sourceNode == null && targetNode == null) {\n if (newGraph == null) {\n throw \"Graph is null!\";\n }\n if (parentNode == null) {\n throw \"Parent node is null!\";\n }\n if (this.graphs.indexOf(newGraph) > -1) {\n throw \"Graph already in this graph mgr!\";\n }\n\n this.graphs.push(newGraph);\n\n if (newGraph.parent != null) {\n throw \"Already has a parent!\";\n }\n if (parentNode.child != null) {\n throw \"Already has a child!\";\n }\n\n newGraph.parent = parentNode;\n parentNode.child = newGraph;\n\n return newGraph;\n } else {\n //change the order of the parameters\n targetNode = newEdge;\n sourceNode = parentNode;\n newEdge = newGraph;\n var sourceGraph = sourceNode.getOwner();\n var targetGraph = targetNode.getOwner();\n\n if (!(sourceGraph != null && sourceGraph.getGraphManager() == this)) {\n throw \"Source not in this graph mgr!\";\n }\n if (!(targetGraph != null && targetGraph.getGraphManager() == this)) {\n throw \"Target not in this graph mgr!\";\n }\n\n if (sourceGraph == targetGraph) {\n newEdge.isInterGraph = false;\n return sourceGraph.add(newEdge, sourceNode, targetNode);\n } else {\n newEdge.isInterGraph = true;\n\n // set source and target\n newEdge.source = sourceNode;\n newEdge.target = targetNode;\n\n // add edge to inter-graph edge list\n if (this.edges.indexOf(newEdge) > -1) {\n throw \"Edge already in inter-graph edge list!\";\n }\n\n this.edges.push(newEdge);\n\n // add edge to source and target incidency lists\n if (!(newEdge.source != null && newEdge.target != null)) {\n throw \"Edge source and/or target is null!\";\n }\n\n if (!(newEdge.source.edges.indexOf(newEdge) == -1 && newEdge.target.edges.indexOf(newEdge) == -1)) {\n throw \"Edge already in source and/or target incidency list!\";\n }\n\n newEdge.source.edges.push(newEdge);\n newEdge.target.edges.push(newEdge);\n\n return newEdge;\n }\n }\n};\n\nLGraphManager.prototype.remove = function (lObj) {\n if (lObj instanceof LGraph) {\n var graph = lObj;\n if (graph.getGraphManager() != this) {\n throw \"Graph not in this graph mgr\";\n }\n if (!(graph == this.rootGraph || graph.parent != null && graph.parent.graphManager == this)) {\n throw \"Invalid parent node!\";\n }\n\n // first the edges (make a copy to do it safely)\n var edgesToBeRemoved = [];\n\n edgesToBeRemoved = edgesToBeRemoved.concat(graph.getEdges());\n\n var edge;\n var s = edgesToBeRemoved.length;\n for (var i = 0; i < s; i++) {\n edge = edgesToBeRemoved[i];\n graph.remove(edge);\n }\n\n // then the nodes (make a copy to do it safely)\n var nodesToBeRemoved = [];\n\n nodesToBeRemoved = nodesToBeRemoved.concat(graph.getNodes());\n\n var node;\n s = nodesToBeRemoved.length;\n for (var i = 0; i < s; i++) {\n node = nodesToBeRemoved[i];\n graph.remove(node);\n }\n\n // check if graph is the root\n if (graph == this.rootGraph) {\n this.setRootGraph(null);\n }\n\n // now remove the graph itself\n var index = this.graphs.indexOf(graph);\n this.graphs.splice(index, 1);\n\n // also reset the parent of the graph\n graph.parent = null;\n } else if (lObj instanceof LEdge) {\n edge = lObj;\n if (edge == null) {\n throw \"Edge is null!\";\n }\n if (!edge.isInterGraph) {\n throw \"Not an inter-graph edge!\";\n }\n if (!(edge.source != null && edge.target != null)) {\n throw \"Source and/or target is null!\";\n }\n\n // remove edge from source and target nodes' incidency lists\n\n if (!(edge.source.edges.indexOf(edge) != -1 && edge.target.edges.indexOf(edge) != -1)) {\n throw \"Source and/or target doesn't know this edge!\";\n }\n\n var index = edge.source.edges.indexOf(edge);\n edge.source.edges.splice(index, 1);\n index = edge.target.edges.indexOf(edge);\n edge.target.edges.splice(index, 1);\n\n // remove edge from owner graph manager's inter-graph edge list\n\n if (!(edge.source.owner != null && edge.source.owner.getGraphManager() != null)) {\n throw \"Edge owner graph or owner graph manager is null!\";\n }\n if (edge.source.owner.getGraphManager().edges.indexOf(edge) == -1) {\n throw \"Not in owner graph manager's edge list!\";\n }\n\n var index = edge.source.owner.getGraphManager().edges.indexOf(edge);\n edge.source.owner.getGraphManager().edges.splice(index, 1);\n }\n};\n\nLGraphManager.prototype.updateBounds = function () {\n this.rootGraph.updateBounds(true);\n};\n\nLGraphManager.prototype.getGraphs = function () {\n return this.graphs;\n};\n\nLGraphManager.prototype.getAllNodes = function () {\n if (this.allNodes == null) {\n var nodeList = [];\n var graphs = this.getGraphs();\n var s = graphs.length;\n for (var i = 0; i < s; i++) {\n nodeList = nodeList.concat(graphs[i].getNodes());\n }\n this.allNodes = nodeList;\n }\n return this.allNodes;\n};\n\nLGraphManager.prototype.resetAllNodes = function () {\n this.allNodes = null;\n};\n\nLGraphManager.prototype.resetAllEdges = function () {\n this.allEdges = null;\n};\n\nLGraphManager.prototype.resetAllNodesToApplyGravitation = function () {\n this.allNodesToApplyGravitation = null;\n};\n\nLGraphManager.prototype.getAllEdges = function () {\n if (this.allEdges == null) {\n var edgeList = [];\n var graphs = this.getGraphs();\n var s = graphs.length;\n for (var i = 0; i < graphs.length; i++) {\n edgeList = edgeList.concat(graphs[i].getEdges());\n }\n\n edgeList = edgeList.concat(this.edges);\n\n this.allEdges = edgeList;\n }\n return this.allEdges;\n};\n\nLGraphManager.prototype.getAllNodesToApplyGravitation = function () {\n return this.allNodesToApplyGravitation;\n};\n\nLGraphManager.prototype.setAllNodesToApplyGravitation = function (nodeList) {\n if (this.allNodesToApplyGravitation != null) {\n throw \"assert failed\";\n }\n\n this.allNodesToApplyGravitation = nodeList;\n};\n\nLGraphManager.prototype.getRoot = function () {\n return this.rootGraph;\n};\n\nLGraphManager.prototype.setRootGraph = function (graph) {\n if (graph.getGraphManager() != this) {\n throw \"Root not in this graph mgr!\";\n }\n\n this.rootGraph = graph;\n // root graph must have a root node associated with it for convenience\n if (graph.parent == null) {\n graph.parent = this.layout.newNode(\"Root node\");\n }\n};\n\nLGraphManager.prototype.getLayout = function () {\n return this.layout;\n};\n\nLGraphManager.prototype.isOneAncestorOfOther = function (firstNode, secondNode) {\n if (!(firstNode != null && secondNode != null)) {\n throw \"assert failed\";\n }\n\n if (firstNode == secondNode) {\n return true;\n }\n // Is second node an ancestor of the first one?\n var ownerGraph = firstNode.getOwner();\n var parentNode;\n\n do {\n parentNode = ownerGraph.getParent();\n\n if (parentNode == null) {\n break;\n }\n\n if (parentNode == secondNode) {\n return true;\n }\n\n ownerGraph = parentNode.getOwner();\n if (ownerGraph == null) {\n break;\n }\n } while (true);\n // Is first node an ancestor of the second one?\n ownerGraph = secondNode.getOwner();\n\n do {\n parentNode = ownerGraph.getParent();\n\n if (parentNode == null) {\n break;\n }\n\n if (parentNode == firstNode) {\n return true;\n }\n\n ownerGraph = parentNode.getOwner();\n if (ownerGraph == null) {\n break;\n }\n } while (true);\n\n return false;\n};\n\nLGraphManager.prototype.calcLowestCommonAncestors = function () {\n var edge;\n var sourceNode;\n var targetNode;\n var sourceAncestorGraph;\n var targetAncestorGraph;\n\n var edges = this.getAllEdges();\n var s = edges.length;\n for (var i = 0; i < s; i++) {\n edge = edges[i];\n\n sourceNode = edge.source;\n targetNode = edge.target;\n edge.lca = null;\n edge.sourceInLca = sourceNode;\n edge.targetInLca = targetNode;\n\n if (sourceNode == targetNode) {\n edge.lca = sourceNode.getOwner();\n continue;\n }\n\n sourceAncestorGraph = sourceNode.getOwner();\n\n while (edge.lca == null) {\n edge.targetInLca = targetNode;\n targetAncestorGraph = targetNode.getOwner();\n\n while (edge.lca == null) {\n if (targetAncestorGraph == sourceAncestorGraph) {\n edge.lca = targetAncestorGraph;\n break;\n }\n\n if (targetAncestorGraph == this.rootGraph) {\n break;\n }\n\n if (edge.lca != null) {\n throw \"assert failed\";\n }\n edge.targetInLca = targetAncestorGraph.getParent();\n targetAncestorGraph = edge.targetInLca.getOwner();\n }\n\n if (sourceAncestorGraph == this.rootGraph) {\n break;\n }\n\n if (edge.lca == null) {\n edge.sourceInLca = sourceAncestorGraph.getParent();\n sourceAncestorGraph = edge.sourceInLca.getOwner();\n }\n }\n\n if (edge.lca == null) {\n throw \"assert failed\";\n }\n }\n};\n\nLGraphManager.prototype.calcLowestCommonAncestor = function (firstNode, secondNode) {\n if (firstNode == secondNode) {\n return firstNode.getOwner();\n }\n var firstOwnerGraph = firstNode.getOwner();\n\n do {\n if (firstOwnerGraph == null) {\n break;\n }\n var secondOwnerGraph = secondNode.getOwner();\n\n do {\n if (secondOwnerGraph == null) {\n break;\n }\n\n if (secondOwnerGraph == firstOwnerGraph) {\n return secondOwnerGraph;\n }\n secondOwnerGraph = secondOwnerGraph.getParent().getOwner();\n } while (true);\n\n firstOwnerGraph = firstOwnerGraph.getParent().getOwner();\n } while (true);\n\n return firstOwnerGraph;\n};\n\nLGraphManager.prototype.calcInclusionTreeDepths = function (graph, depth) {\n if (graph == null && depth == null) {\n graph = this.rootGraph;\n depth = 1;\n }\n var node;\n\n var nodes = graph.getNodes();\n var s = nodes.length;\n for (var i = 0; i < s; i++) {\n node = nodes[i];\n node.inclusionTreeDepth = depth;\n\n if (node.child != null) {\n this.calcInclusionTreeDepths(node.child, depth + 1);\n }\n }\n};\n\nLGraphManager.prototype.includesInvalidEdge = function () {\n var edge;\n\n var s = this.edges.length;\n for (var i = 0; i < s; i++) {\n edge = this.edges[i];\n\n if (this.isOneAncestorOfOther(edge.source, edge.target)) {\n return true;\n }\n }\n return false;\n};\n\nmodule.exports = LGraphManager;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LayoutConstants = __webpack_require__(0);\n\nfunction FDLayoutConstants() {}\n\n//FDLayoutConstants inherits static props in LayoutConstants\nfor (var prop in LayoutConstants) {\n FDLayoutConstants[prop] = LayoutConstants[prop];\n}\n\nFDLayoutConstants.MAX_ITERATIONS = 2500;\n\nFDLayoutConstants.DEFAULT_EDGE_LENGTH = 50;\nFDLayoutConstants.DEFAULT_SPRING_STRENGTH = 0.45;\nFDLayoutConstants.DEFAULT_REPULSION_STRENGTH = 4500.0;\nFDLayoutConstants.DEFAULT_GRAVITY_STRENGTH = 0.4;\nFDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH = 1.0;\nFDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR = 3.8;\nFDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR = 1.5;\nFDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION = true;\nFDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION = true;\nFDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL = 0.3;\nFDLayoutConstants.COOLING_ADAPTATION_FACTOR = 0.33;\nFDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT = 1000;\nFDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT = 5000;\nFDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL = 100.0;\nFDLayoutConstants.MAX_NODE_DISPLACEMENT = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL * 3;\nFDLayoutConstants.MIN_REPULSION_DIST = FDLayoutConstants.DEFAULT_EDGE_LENGTH / 10.0;\nFDLayoutConstants.CONVERGENCE_CHECK_PERIOD = 100;\nFDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR = 0.1;\nFDLayoutConstants.MIN_EDGE_LENGTH = 1;\nFDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD = 10;\n\nmodule.exports = FDLayoutConstants;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/**\n * This class maintains a list of static geometry related utility methods.\n *\n *\n * Copyright: i-Vis Research Group, Bilkent University, 2007 - present\n */\n\nvar Point = __webpack_require__(12);\n\nfunction IGeometry() {}\n\n/**\n * This method calculates *half* the amount in x and y directions of the two\n * input rectangles needed to separate them keeping their respective\n * positioning, and returns the result in the input array. An input\n * separation buffer added to the amount in both directions. We assume that\n * the two rectangles do intersect.\n */\nIGeometry.calcSeparationAmount = function (rectA, rectB, overlapAmount, separationBuffer) {\n if (!rectA.intersects(rectB)) {\n throw \"assert failed\";\n }\n\n var directions = new Array(2);\n\n this.decideDirectionsForOverlappingNodes(rectA, rectB, directions);\n\n overlapAmount[0] = Math.min(rectA.getRight(), rectB.getRight()) - Math.max(rectA.x, rectB.x);\n overlapAmount[1] = Math.min(rectA.getBottom(), rectB.getBottom()) - Math.max(rectA.y, rectB.y);\n\n // update the overlapping amounts for the following cases:\n if (rectA.getX() <= rectB.getX() && rectA.getRight() >= rectB.getRight()) {\n /* Case x.1:\n *\n * rectA\n * \t| |\n * \t| _________ |\n * \t| | | |\n * \t|________|_______|______|\n * \t\t\t | |\n * | |\n * rectB\n */\n overlapAmount[0] += Math.min(rectB.getX() - rectA.getX(), rectA.getRight() - rectB.getRight());\n } else if (rectB.getX() <= rectA.getX() && rectB.getRight() >= rectA.getRight()) {\n /* Case x.2:\n *\n * rectB\n * \t| |\n * \t| _________ |\n * \t| | | |\n * \t|________|_______|______|\n * \t\t\t | |\n * | |\n * rectA\n */\n overlapAmount[0] += Math.min(rectA.getX() - rectB.getX(), rectB.getRight() - rectA.getRight());\n }\n if (rectA.getY() <= rectB.getY() && rectA.getBottom() >= rectB.getBottom()) {\n /* Case y.1:\n * ________ rectA\n * |\n * |\n * ______|____ rectB\n * | |\n * | |\n * ______|____|\n * |\n * |\n * |________\n *\n */\n overlapAmount[1] += Math.min(rectB.getY() - rectA.getY(), rectA.getBottom() - rectB.getBottom());\n } else if (rectB.getY() <= rectA.getY() && rectB.getBottom() >= rectA.getBottom()) {\n /* Case y.2:\n * ________ rectB\n * |\n * |\n * ______|____ rectA\n * | |\n * | |\n * ______|____|\n * |\n * |\n * |________\n *\n */\n overlapAmount[1] += Math.min(rectA.getY() - rectB.getY(), rectB.getBottom() - rectA.getBottom());\n }\n\n // find slope of the line passes two centers\n var slope = Math.abs((rectB.getCenterY() - rectA.getCenterY()) / (rectB.getCenterX() - rectA.getCenterX()));\n // if centers are overlapped\n if (rectB.getCenterY() === rectA.getCenterY() && rectB.getCenterX() === rectA.getCenterX()) {\n // assume the slope is 1 (45 degree)\n slope = 1.0;\n }\n\n var moveByY = slope * overlapAmount[0];\n var moveByX = overlapAmount[1] / slope;\n if (overlapAmount[0] < moveByX) {\n moveByX = overlapAmount[0];\n } else {\n moveByY = overlapAmount[1];\n }\n // return half the amount so that if each rectangle is moved by these\n // amounts in opposite directions, overlap will be resolved\n overlapAmount[0] = -1 * directions[0] * (moveByX / 2 + separationBuffer);\n overlapAmount[1] = -1 * directions[1] * (moveByY / 2 + separationBuffer);\n};\n\n/**\n * This method decides the separation direction of overlapping nodes\n *\n * if directions[0] = -1, then rectA goes left\n * if directions[0] = 1, then rectA goes right\n * if directions[1] = -1, then rectA goes up\n * if directions[1] = 1, then rectA goes down\n */\nIGeometry.decideDirectionsForOverlappingNodes = function (rectA, rectB, directions) {\n if (rectA.getCenterX() < rectB.getCenterX()) {\n directions[0] = -1;\n } else {\n directions[0] = 1;\n }\n\n if (rectA.getCenterY() < rectB.getCenterY()) {\n directions[1] = -1;\n } else {\n directions[1] = 1;\n }\n};\n\n/**\n * This method calculates the intersection (clipping) points of the two\n * input rectangles with line segment defined by the centers of these two\n * rectangles. The clipping points are saved in the input double array and\n * whether or not the two rectangles overlap is returned.\n */\nIGeometry.getIntersection2 = function (rectA, rectB, result) {\n //result[0-1] will contain clipPoint of rectA, result[2-3] will contain clipPoint of rectB\n var p1x = rectA.getCenterX();\n var p1y = rectA.getCenterY();\n var p2x = rectB.getCenterX();\n var p2y = rectB.getCenterY();\n\n //if two rectangles intersect, then clipping points are centers\n if (rectA.intersects(rectB)) {\n result[0] = p1x;\n result[1] = p1y;\n result[2] = p2x;\n result[3] = p2y;\n return true;\n }\n //variables for rectA\n var topLeftAx = rectA.getX();\n var topLeftAy = rectA.getY();\n var topRightAx = rectA.getRight();\n var bottomLeftAx = rectA.getX();\n var bottomLeftAy = rectA.getBottom();\n var bottomRightAx = rectA.getRight();\n var halfWidthA = rectA.getWidthHalf();\n var halfHeightA = rectA.getHeightHalf();\n //variables for rectB\n var topLeftBx = rectB.getX();\n var topLeftBy = rectB.getY();\n var topRightBx = rectB.getRight();\n var bottomLeftBx = rectB.getX();\n var bottomLeftBy = rectB.getBottom();\n var bottomRightBx = rectB.getRight();\n var halfWidthB = rectB.getWidthHalf();\n var halfHeightB = rectB.getHeightHalf();\n\n //flag whether clipping points are found\n var clipPointAFound = false;\n var clipPointBFound = false;\n\n // line is vertical\n if (p1x === p2x) {\n if (p1y > p2y) {\n result[0] = p1x;\n result[1] = topLeftAy;\n result[2] = p2x;\n result[3] = bottomLeftBy;\n return false;\n } else if (p1y < p2y) {\n result[0] = p1x;\n result[1] = bottomLeftAy;\n result[2] = p2x;\n result[3] = topLeftBy;\n return false;\n } else {\n //not line, return null;\n }\n }\n // line is horizontal\n else if (p1y === p2y) {\n if (p1x > p2x) {\n result[0] = topLeftAx;\n result[1] = p1y;\n result[2] = topRightBx;\n result[3] = p2y;\n return false;\n } else if (p1x < p2x) {\n result[0] = topRightAx;\n result[1] = p1y;\n result[2] = topLeftBx;\n result[3] = p2y;\n return false;\n } else {\n //not valid line, return null;\n }\n } else {\n //slopes of rectA's and rectB's diagonals\n var slopeA = rectA.height / rectA.width;\n var slopeB = rectB.height / rectB.width;\n\n //slope of line between center of rectA and center of rectB\n var slopePrime = (p2y - p1y) / (p2x - p1x);\n var cardinalDirectionA = void 0;\n var cardinalDirectionB = void 0;\n var tempPointAx = void 0;\n var tempPointAy = void 0;\n var tempPointBx = void 0;\n var tempPointBy = void 0;\n\n //determine whether clipping point is the corner of nodeA\n if (-slopeA === slopePrime) {\n if (p1x > p2x) {\n result[0] = bottomLeftAx;\n result[1] = bottomLeftAy;\n clipPointAFound = true;\n } else {\n result[0] = topRightAx;\n result[1] = topLeftAy;\n clipPointAFound = true;\n }\n } else if (slopeA === slopePrime) {\n if (p1x > p2x) {\n result[0] = topLeftAx;\n result[1] = topLeftAy;\n clipPointAFound = true;\n } else {\n result[0] = bottomRightAx;\n result[1] = bottomLeftAy;\n clipPointAFound = true;\n }\n }\n\n //determine whether clipping point is the corner of nodeB\n if (-slopeB === slopePrime) {\n if (p2x > p1x) {\n result[2] = bottomLeftBx;\n result[3] = bottomLeftBy;\n clipPointBFound = true;\n } else {\n result[2] = topRightBx;\n result[3] = topLeftBy;\n clipPointBFound = true;\n }\n } else if (slopeB === slopePrime) {\n if (p2x > p1x) {\n result[2] = topLeftBx;\n result[3] = topLeftBy;\n clipPointBFound = true;\n } else {\n result[2] = bottomRightBx;\n result[3] = bottomLeftBy;\n clipPointBFound = true;\n }\n }\n\n //if both clipping points are corners\n if (clipPointAFound && clipPointBFound) {\n return false;\n }\n\n //determine Cardinal Direction of rectangles\n if (p1x > p2x) {\n if (p1y > p2y) {\n cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 4);\n cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 2);\n } else {\n cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 3);\n cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 1);\n }\n } else {\n if (p1y > p2y) {\n cardinalDirectionA = this.getCardinalDirection(-slopeA, slopePrime, 1);\n cardinalDirectionB = this.getCardinalDirection(-slopeB, slopePrime, 3);\n } else {\n cardinalDirectionA = this.getCardinalDirection(slopeA, slopePrime, 2);\n cardinalDirectionB = this.getCardinalDirection(slopeB, slopePrime, 4);\n }\n }\n //calculate clipping Point if it is not found before\n if (!clipPointAFound) {\n switch (cardinalDirectionA) {\n case 1:\n tempPointAy = topLeftAy;\n tempPointAx = p1x + -halfHeightA / slopePrime;\n result[0] = tempPointAx;\n result[1] = tempPointAy;\n break;\n case 2:\n tempPointAx = bottomRightAx;\n tempPointAy = p1y + halfWidthA * slopePrime;\n result[0] = tempPointAx;\n result[1] = tempPointAy;\n break;\n case 3:\n tempPointAy = bottomLeftAy;\n tempPointAx = p1x + halfHeightA / slopePrime;\n result[0] = tempPointAx;\n result[1] = tempPointAy;\n break;\n case 4:\n tempPointAx = bottomLeftAx;\n tempPointAy = p1y + -halfWidthA * slopePrime;\n result[0] = tempPointAx;\n result[1] = tempPointAy;\n break;\n }\n }\n if (!clipPointBFound) {\n switch (cardinalDirectionB) {\n case 1:\n tempPointBy = topLeftBy;\n tempPointBx = p2x + -halfHeightB / slopePrime;\n result[2] = tempPointBx;\n result[3] = tempPointBy;\n break;\n case 2:\n tempPointBx = bottomRightBx;\n tempPointBy = p2y + halfWidthB * slopePrime;\n result[2] = tempPointBx;\n result[3] = tempPointBy;\n break;\n case 3:\n tempPointBy = bottomLeftBy;\n tempPointBx = p2x + halfHeightB / slopePrime;\n result[2] = tempPointBx;\n result[3] = tempPointBy;\n break;\n case 4:\n tempPointBx = bottomLeftBx;\n tempPointBy = p2y + -halfWidthB * slopePrime;\n result[2] = tempPointBx;\n result[3] = tempPointBy;\n break;\n }\n }\n }\n return false;\n};\n\n/**\n * This method returns in which cardinal direction does input point stays\n * 1: North\n * 2: East\n * 3: South\n * 4: West\n */\nIGeometry.getCardinalDirection = function (slope, slopePrime, line) {\n if (slope > slopePrime) {\n return line;\n } else {\n return 1 + line % 4;\n }\n};\n\n/**\n * This method calculates the intersection of the two lines defined by\n * point pairs (s1,s2) and (f1,f2).\n */\nIGeometry.getIntersection = function (s1, s2, f1, f2) {\n if (f2 == null) {\n return this.getIntersection2(s1, s2, f1);\n }\n\n var x1 = s1.x;\n var y1 = s1.y;\n var x2 = s2.x;\n var y2 = s2.y;\n var x3 = f1.x;\n var y3 = f1.y;\n var x4 = f2.x;\n var y4 = f2.y;\n var x = void 0,\n y = void 0; // intersection point\n var a1 = void 0,\n a2 = void 0,\n b1 = void 0,\n b2 = void 0,\n c1 = void 0,\n c2 = void 0; // coefficients of line eqns.\n var denom = void 0;\n\n a1 = y2 - y1;\n b1 = x1 - x2;\n c1 = x2 * y1 - x1 * y2; // { a1*x + b1*y + c1 = 0 is line 1 }\n\n a2 = y4 - y3;\n b2 = x3 - x4;\n c2 = x4 * y3 - x3 * y4; // { a2*x + b2*y + c2 = 0 is line 2 }\n\n denom = a1 * b2 - a2 * b1;\n\n if (denom === 0) {\n return null;\n }\n\n x = (b1 * c2 - b2 * c1) / denom;\n y = (a2 * c1 - a1 * c2) / denom;\n\n return new Point(x, y);\n};\n\n/**\n * This method finds and returns the angle of the vector from the + x-axis\n * in clockwise direction (compatible w/ Java coordinate system!).\n */\nIGeometry.angleOfVector = function (Cx, Cy, Nx, Ny) {\n var C_angle = void 0;\n\n if (Cx !== Nx) {\n C_angle = Math.atan((Ny - Cy) / (Nx - Cx));\n\n if (Nx < Cx) {\n C_angle += Math.PI;\n } else if (Ny < Cy) {\n C_angle += this.TWO_PI;\n }\n } else if (Ny < Cy) {\n C_angle = this.ONE_AND_HALF_PI; // 270 degrees\n } else {\n C_angle = this.HALF_PI; // 90 degrees\n }\n\n return C_angle;\n};\n\n/**\n * This method checks whether the given two line segments (one with point\n * p1 and p2, the other with point p3 and p4) intersect at a point other\n * than these points.\n */\nIGeometry.doIntersect = function (p1, p2, p3, p4) {\n var a = p1.x;\n var b = p1.y;\n var c = p2.x;\n var d = p2.y;\n var p = p3.x;\n var q = p3.y;\n var r = p4.x;\n var s = p4.y;\n var det = (c - a) * (s - q) - (r - p) * (d - b);\n\n if (det === 0) {\n return false;\n } else {\n var lambda = ((s - q) * (r - a) + (p - r) * (s - b)) / det;\n var gamma = ((b - d) * (r - a) + (c - a) * (s - b)) / det;\n return 0 < lambda && lambda < 1 && 0 < gamma && gamma < 1;\n }\n};\n\n// -----------------------------------------------------------------------------\n// Section: Class Constants\n// -----------------------------------------------------------------------------\n/**\n * Some useful pre-calculated constants\n */\nIGeometry.HALF_PI = 0.5 * Math.PI;\nIGeometry.ONE_AND_HALF_PI = 1.5 * Math.PI;\nIGeometry.TWO_PI = 2.0 * Math.PI;\nIGeometry.THREE_PI = 3.0 * Math.PI;\n\nmodule.exports = IGeometry;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction IMath() {}\n\n/**\n * This method returns the sign of the input value.\n */\nIMath.sign = function (value) {\n if (value > 0) {\n return 1;\n } else if (value < 0) {\n return -1;\n } else {\n return 0;\n }\n};\n\nIMath.floor = function (value) {\n return value < 0 ? Math.ceil(value) : Math.floor(value);\n};\n\nIMath.ceil = function (value) {\n return value < 0 ? Math.floor(value) : Math.ceil(value);\n};\n\nmodule.exports = IMath;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction Integer() {}\n\nInteger.MAX_VALUE = 2147483647;\nInteger.MIN_VALUE = -2147483648;\n\nmodule.exports = Integer;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar nodeFrom = function nodeFrom(value) {\n return { value: value, next: null, prev: null };\n};\n\nvar add = function add(prev, node, next, list) {\n if (prev !== null) {\n prev.next = node;\n } else {\n list.head = node;\n }\n\n if (next !== null) {\n next.prev = node;\n } else {\n list.tail = node;\n }\n\n node.prev = prev;\n node.next = next;\n\n list.length++;\n\n return node;\n};\n\nvar _remove = function _remove(node, list) {\n var prev = node.prev,\n next = node.next;\n\n\n if (prev !== null) {\n prev.next = next;\n } else {\n list.head = next;\n }\n\n if (next !== null) {\n next.prev = prev;\n } else {\n list.tail = prev;\n }\n\n node.prev = node.next = null;\n\n list.length--;\n\n return node;\n};\n\nvar LinkedList = function () {\n function LinkedList(vals) {\n var _this = this;\n\n _classCallCheck(this, LinkedList);\n\n this.length = 0;\n this.head = null;\n this.tail = null;\n\n if (vals != null) {\n vals.forEach(function (v) {\n return _this.push(v);\n });\n }\n }\n\n _createClass(LinkedList, [{\n key: \"size\",\n value: function size() {\n return this.length;\n }\n }, {\n key: \"insertBefore\",\n value: function insertBefore(val, otherNode) {\n return add(otherNode.prev, nodeFrom(val), otherNode, this);\n }\n }, {\n key: \"insertAfter\",\n value: function insertAfter(val, otherNode) {\n return add(otherNode, nodeFrom(val), otherNode.next, this);\n }\n }, {\n key: \"insertNodeBefore\",\n value: function insertNodeBefore(newNode, otherNode) {\n return add(otherNode.prev, newNode, otherNode, this);\n }\n }, {\n key: \"insertNodeAfter\",\n value: function insertNodeAfter(newNode, otherNode) {\n return add(otherNode, newNode, otherNode.next, this);\n }\n }, {\n key: \"push\",\n value: function push(val) {\n return add(this.tail, nodeFrom(val), null, this);\n }\n }, {\n key: \"unshift\",\n value: function unshift(val) {\n return add(null, nodeFrom(val), this.head, this);\n }\n }, {\n key: \"remove\",\n value: function remove(node) {\n return _remove(node, this);\n }\n }, {\n key: \"pop\",\n value: function pop() {\n return _remove(this.tail, this).value;\n }\n }, {\n key: \"popNode\",\n value: function popNode() {\n return _remove(this.tail, this);\n }\n }, {\n key: \"shift\",\n value: function shift() {\n return _remove(this.head, this).value;\n }\n }, {\n key: \"shiftNode\",\n value: function shiftNode() {\n return _remove(this.head, this);\n }\n }, {\n key: \"get_object_at\",\n value: function get_object_at(index) {\n if (index <= this.length()) {\n var i = 1;\n var current = this.head;\n while (i < index) {\n current = current.next;\n i++;\n }\n return current.value;\n }\n }\n }, {\n key: \"set_object_at\",\n value: function set_object_at(index, value) {\n if (index <= this.length()) {\n var i = 1;\n var current = this.head;\n while (i < index) {\n current = current.next;\n i++;\n }\n current.value = value;\n }\n }\n }]);\n\n return LinkedList;\n}();\n\nmodule.exports = LinkedList;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\n/*\r\n *This class is the javascript implementation of the Point.java class in jdk\r\n */\nfunction Point(x, y, p) {\n this.x = null;\n this.y = null;\n if (x == null && y == null && p == null) {\n this.x = 0;\n this.y = 0;\n } else if (typeof x == 'number' && typeof y == 'number' && p == null) {\n this.x = x;\n this.y = y;\n } else if (x.constructor.name == 'Point' && y == null && p == null) {\n p = x;\n this.x = p.x;\n this.y = p.y;\n }\n}\n\nPoint.prototype.getX = function () {\n return this.x;\n};\n\nPoint.prototype.getY = function () {\n return this.y;\n};\n\nPoint.prototype.getLocation = function () {\n return new Point(this.x, this.y);\n};\n\nPoint.prototype.setLocation = function (x, y, p) {\n if (x.constructor.name == 'Point' && y == null && p == null) {\n p = x;\n this.setLocation(p.x, p.y);\n } else if (typeof x == 'number' && typeof y == 'number' && p == null) {\n //if both parameters are integer just move (x,y) location\n if (parseInt(x) == x && parseInt(y) == y) {\n this.move(x, y);\n } else {\n this.x = Math.floor(x + 0.5);\n this.y = Math.floor(y + 0.5);\n }\n }\n};\n\nPoint.prototype.move = function (x, y) {\n this.x = x;\n this.y = y;\n};\n\nPoint.prototype.translate = function (dx, dy) {\n this.x += dx;\n this.y += dy;\n};\n\nPoint.prototype.equals = function (obj) {\n if (obj.constructor.name == \"Point\") {\n var pt = obj;\n return this.x == pt.x && this.y == pt.y;\n }\n return this == obj;\n};\n\nPoint.prototype.toString = function () {\n return new Point().constructor.name + \"[x=\" + this.x + \",y=\" + this.y + \"]\";\n};\n\nmodule.exports = Point;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction RectangleD(x, y, width, height) {\n this.x = 0;\n this.y = 0;\n this.width = 0;\n this.height = 0;\n\n if (x != null && y != null && width != null && height != null) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n}\n\nRectangleD.prototype.getX = function () {\n return this.x;\n};\n\nRectangleD.prototype.setX = function (x) {\n this.x = x;\n};\n\nRectangleD.prototype.getY = function () {\n return this.y;\n};\n\nRectangleD.prototype.setY = function (y) {\n this.y = y;\n};\n\nRectangleD.prototype.getWidth = function () {\n return this.width;\n};\n\nRectangleD.prototype.setWidth = function (width) {\n this.width = width;\n};\n\nRectangleD.prototype.getHeight = function () {\n return this.height;\n};\n\nRectangleD.prototype.setHeight = function (height) {\n this.height = height;\n};\n\nRectangleD.prototype.getRight = function () {\n return this.x + this.width;\n};\n\nRectangleD.prototype.getBottom = function () {\n return this.y + this.height;\n};\n\nRectangleD.prototype.intersects = function (a) {\n if (this.getRight() < a.x) {\n return false;\n }\n\n if (this.getBottom() < a.y) {\n return false;\n }\n\n if (a.getRight() < this.x) {\n return false;\n }\n\n if (a.getBottom() < this.y) {\n return false;\n }\n\n return true;\n};\n\nRectangleD.prototype.getCenterX = function () {\n return this.x + this.width / 2;\n};\n\nRectangleD.prototype.getMinX = function () {\n return this.getX();\n};\n\nRectangleD.prototype.getMaxX = function () {\n return this.getX() + this.width;\n};\n\nRectangleD.prototype.getCenterY = function () {\n return this.y + this.height / 2;\n};\n\nRectangleD.prototype.getMinY = function () {\n return this.getY();\n};\n\nRectangleD.prototype.getMaxY = function () {\n return this.getY() + this.height;\n};\n\nRectangleD.prototype.getWidthHalf = function () {\n return this.width / 2;\n};\n\nRectangleD.prototype.getHeightHalf = function () {\n return this.height / 2;\n};\n\nmodule.exports = RectangleD;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction UniqueIDGeneretor() {}\n\nUniqueIDGeneretor.lastID = 0;\n\nUniqueIDGeneretor.createID = function (obj) {\n if (UniqueIDGeneretor.isPrimitive(obj)) {\n return obj;\n }\n if (obj.uniqueID != null) {\n return obj.uniqueID;\n }\n obj.uniqueID = UniqueIDGeneretor.getString();\n UniqueIDGeneretor.lastID++;\n return obj.uniqueID;\n};\n\nUniqueIDGeneretor.getString = function (id) {\n if (id == null) id = UniqueIDGeneretor.lastID;\n return \"Object#\" + id + \"\";\n};\n\nUniqueIDGeneretor.isPrimitive = function (arg) {\n var type = typeof arg === \"undefined\" ? \"undefined\" : _typeof(arg);\n return arg == null || type != \"object\" && type != \"function\";\n};\n\nmodule.exports = UniqueIDGeneretor;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar LayoutConstants = __webpack_require__(0);\nvar LGraphManager = __webpack_require__(6);\nvar LNode = __webpack_require__(3);\nvar LEdge = __webpack_require__(1);\nvar LGraph = __webpack_require__(5);\nvar PointD = __webpack_require__(4);\nvar Transform = __webpack_require__(17);\nvar Emitter = __webpack_require__(27);\n\nfunction Layout(isRemoteUse) {\n Emitter.call(this);\n\n //Layout Quality: 0:draft, 1:default, 2:proof\n this.layoutQuality = LayoutConstants.QUALITY;\n //Whether layout should create bendpoints as needed or not\n this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;\n //Whether layout should be incremental or not\n this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;\n //Whether we animate from before to after layout node positions\n this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;\n //Whether we animate the layout process or not\n this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;\n //Number iterations that should be done between two successive animations\n this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;\n /**\r\n * Whether or not leaf nodes (non-compound nodes) are of uniform sizes. When\r\n * they are, both spring and repulsion forces between two leaf nodes can be\r\n * calculated without the expensive clipping point calculations, resulting\r\n * in major speed-up.\r\n */\n this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;\n /**\r\n * This is used for creation of bendpoints by using dummy nodes and edges.\r\n * Maps an LEdge to its dummy bendpoint path.\r\n */\n this.edgeToDummyNodes = new Map();\n this.graphManager = new LGraphManager(this);\n this.isLayoutFinished = false;\n this.isSubLayout = false;\n this.isRemoteUse = false;\n\n if (isRemoteUse != null) {\n this.isRemoteUse = isRemoteUse;\n }\n}\n\nLayout.RANDOM_SEED = 1;\n\nLayout.prototype = Object.create(Emitter.prototype);\n\nLayout.prototype.getGraphManager = function () {\n return this.graphManager;\n};\n\nLayout.prototype.getAllNodes = function () {\n return this.graphManager.getAllNodes();\n};\n\nLayout.prototype.getAllEdges = function () {\n return this.graphManager.getAllEdges();\n};\n\nLayout.prototype.getAllNodesToApplyGravitation = function () {\n return this.graphManager.getAllNodesToApplyGravitation();\n};\n\nLayout.prototype.newGraphManager = function () {\n var gm = new LGraphManager(this);\n this.graphManager = gm;\n return gm;\n};\n\nLayout.prototype.newGraph = function (vGraph) {\n return new LGraph(null, this.graphManager, vGraph);\n};\n\nLayout.prototype.newNode = function (vNode) {\n return new LNode(this.graphManager, vNode);\n};\n\nLayout.prototype.newEdge = function (vEdge) {\n return new LEdge(null, null, vEdge);\n};\n\nLayout.prototype.checkLayoutSuccess = function () {\n return this.graphManager.getRoot() == null || this.graphManager.getRoot().getNodes().length == 0 || this.graphManager.includesInvalidEdge();\n};\n\nLayout.prototype.runLayout = function () {\n this.isLayoutFinished = false;\n\n if (this.tilingPreLayout) {\n this.tilingPreLayout();\n }\n\n this.initParameters();\n var isLayoutSuccessfull;\n\n if (this.checkLayoutSuccess()) {\n isLayoutSuccessfull = false;\n } else {\n isLayoutSuccessfull = this.layout();\n }\n\n if (LayoutConstants.ANIMATE === 'during') {\n // If this is a 'during' layout animation. Layout is not finished yet. \n // We need to perform these in index.js when layout is really finished.\n return false;\n }\n\n if (isLayoutSuccessfull) {\n if (!this.isSubLayout) {\n this.doPostLayout();\n }\n }\n\n if (this.tilingPostLayout) {\n this.tilingPostLayout();\n }\n\n this.isLayoutFinished = true;\n\n return isLayoutSuccessfull;\n};\n\n/**\r\n * This method performs the operations required after layout.\r\n */\nLayout.prototype.doPostLayout = function () {\n //assert !isSubLayout : \"Should not be called on sub-layout!\";\n // Propagate geometric changes to v-level objects\n if (!this.incremental) {\n this.transform();\n }\n this.update();\n};\n\n/**\r\n * This method updates the geometry of the target graph according to\r\n * calculated layout.\r\n */\nLayout.prototype.update2 = function () {\n // update bend points\n if (this.createBendsAsNeeded) {\n this.createBendpointsFromDummyNodes();\n\n // reset all edges, since the topology has changed\n this.graphManager.resetAllEdges();\n }\n\n // perform edge, node and root updates if layout is not called\n // remotely\n if (!this.isRemoteUse) {\n // update all edges\n var edge;\n var allEdges = this.graphManager.getAllEdges();\n for (var i = 0; i < allEdges.length; i++) {\n edge = allEdges[i];\n // this.update(edge);\n }\n\n // recursively update nodes\n var node;\n var nodes = this.graphManager.getRoot().getNodes();\n for (var i = 0; i < nodes.length; i++) {\n node = nodes[i];\n // this.update(node);\n }\n\n // update root graph\n this.update(this.graphManager.getRoot());\n }\n};\n\nLayout.prototype.update = function (obj) {\n if (obj == null) {\n this.update2();\n } else if (obj instanceof LNode) {\n var node = obj;\n if (node.getChild() != null) {\n // since node is compound, recursively update child nodes\n var nodes = node.getChild().getNodes();\n for (var i = 0; i < nodes.length; i++) {\n update(nodes[i]);\n }\n }\n\n // if the l-level node is associated with a v-level graph object,\n // then it is assumed that the v-level node implements the\n // interface Updatable.\n if (node.vGraphObject != null) {\n // cast to Updatable without any type check\n var vNode = node.vGraphObject;\n\n // call the update method of the interface\n vNode.update(node);\n }\n } else if (obj instanceof LEdge) {\n var edge = obj;\n // if the l-level edge is associated with a v-level graph object,\n // then it is assumed that the v-level edge implements the\n // interface Updatable.\n\n if (edge.vGraphObject != null) {\n // cast to Updatable without any type check\n var vEdge = edge.vGraphObject;\n\n // call the update method of the interface\n vEdge.update(edge);\n }\n } else if (obj instanceof LGraph) {\n var graph = obj;\n // if the l-level graph is associated with a v-level graph object,\n // then it is assumed that the v-level object implements the\n // interface Updatable.\n\n if (graph.vGraphObject != null) {\n // cast to Updatable without any type check\n var vGraph = graph.vGraphObject;\n\n // call the update method of the interface\n vGraph.update(graph);\n }\n }\n};\n\n/**\r\n * This method is used to set all layout parameters to default values\r\n * determined at compile time.\r\n */\nLayout.prototype.initParameters = function () {\n if (!this.isSubLayout) {\n this.layoutQuality = LayoutConstants.QUALITY;\n this.animationDuringLayout = LayoutConstants.DEFAULT_ANIMATION_DURING_LAYOUT;\n this.animationPeriod = LayoutConstants.DEFAULT_ANIMATION_PERIOD;\n this.animationOnLayout = LayoutConstants.DEFAULT_ANIMATION_ON_LAYOUT;\n this.incremental = LayoutConstants.DEFAULT_INCREMENTAL;\n this.createBendsAsNeeded = LayoutConstants.DEFAULT_CREATE_BENDS_AS_NEEDED;\n this.uniformLeafNodeSizes = LayoutConstants.DEFAULT_UNIFORM_LEAF_NODE_SIZES;\n }\n\n if (this.animationDuringLayout) {\n this.animationOnLayout = false;\n }\n};\n\nLayout.prototype.transform = function (newLeftTop) {\n if (newLeftTop == undefined) {\n this.transform(new PointD(0, 0));\n } else {\n // create a transformation object (from Eclipse to layout). When an\n // inverse transform is applied, we get upper-left coordinate of the\n // drawing or the root graph at given input coordinate (some margins\n // already included in calculation of left-top).\n\n var trans = new Transform();\n var leftTop = this.graphManager.getRoot().updateLeftTop();\n\n if (leftTop != null) {\n trans.setWorldOrgX(newLeftTop.x);\n trans.setWorldOrgY(newLeftTop.y);\n\n trans.setDeviceOrgX(leftTop.x);\n trans.setDeviceOrgY(leftTop.y);\n\n var nodes = this.getAllNodes();\n var node;\n\n for (var i = 0; i < nodes.length; i++) {\n node = nodes[i];\n node.transform(trans);\n }\n }\n }\n};\n\nLayout.prototype.positionNodesRandomly = function (graph) {\n\n if (graph == undefined) {\n //assert !this.incremental;\n this.positionNodesRandomly(this.getGraphManager().getRoot());\n this.getGraphManager().getRoot().updateBounds(true);\n } else {\n var lNode;\n var childGraph;\n\n var nodes = graph.getNodes();\n for (var i = 0; i < nodes.length; i++) {\n lNode = nodes[i];\n childGraph = lNode.getChild();\n\n if (childGraph == null) {\n lNode.scatter();\n } else if (childGraph.getNodes().length == 0) {\n lNode.scatter();\n } else {\n this.positionNodesRandomly(childGraph);\n lNode.updateBounds();\n }\n }\n }\n};\n\n/**\r\n * This method returns a list of trees where each tree is represented as a\r\n * list of l-nodes. The method returns a list of size 0 when:\r\n * - The graph is not flat or\r\n * - One of the component(s) of the graph is not a tree.\r\n */\nLayout.prototype.getFlatForest = function () {\n var flatForest = [];\n var isForest = true;\n\n // Quick reference for all nodes in the graph manager associated with\n // this layout. The list should not be changed.\n var allNodes = this.graphManager.getRoot().getNodes();\n\n // First be sure that the graph is flat\n var isFlat = true;\n\n for (var i = 0; i < allNodes.length; i++) {\n if (allNodes[i].getChild() != null) {\n isFlat = false;\n }\n }\n\n // Return empty forest if the graph is not flat.\n if (!isFlat) {\n return flatForest;\n }\n\n // Run BFS for each component of the graph.\n\n var visited = new Set();\n var toBeVisited = [];\n var parents = new Map();\n var unProcessedNodes = [];\n\n unProcessedNodes = unProcessedNodes.concat(allNodes);\n\n // Each iteration of this loop finds a component of the graph and\n // decides whether it is a tree or not. If it is a tree, adds it to the\n // forest and continued with the next component.\n\n while (unProcessedNodes.length > 0 && isForest) {\n toBeVisited.push(unProcessedNodes[0]);\n\n // Start the BFS. Each iteration of this loop visits a node in a\n // BFS manner.\n while (toBeVisited.length > 0 && isForest) {\n //pool operation\n var currentNode = toBeVisited[0];\n toBeVisited.splice(0, 1);\n visited.add(currentNode);\n\n // Traverse all neighbors of this node\n var neighborEdges = currentNode.getEdges();\n\n for (var i = 0; i < neighborEdges.length; i++) {\n var currentNeighbor = neighborEdges[i].getOtherEnd(currentNode);\n\n // If BFS is not growing from this neighbor.\n if (parents.get(currentNode) != currentNeighbor) {\n // We haven't previously visited this neighbor.\n if (!visited.has(currentNeighbor)) {\n toBeVisited.push(currentNeighbor);\n parents.set(currentNeighbor, currentNode);\n }\n // Since we have previously visited this neighbor and\n // this neighbor is not parent of currentNode, given\n // graph contains a component that is not tree, hence\n // it is not a forest.\n else {\n isForest = false;\n break;\n }\n }\n }\n }\n\n // The graph contains a component that is not a tree. Empty\n // previously found trees. The method will end.\n if (!isForest) {\n flatForest = [];\n }\n // Save currently visited nodes as a tree in our forest. Reset\n // visited and parents lists. Continue with the next component of\n // the graph, if any.\n else {\n var temp = [].concat(_toConsumableArray(visited));\n flatForest.push(temp);\n //flatForest = flatForest.concat(temp);\n //unProcessedNodes.removeAll(visited);\n for (var i = 0; i < temp.length; i++) {\n var value = temp[i];\n var index = unProcessedNodes.indexOf(value);\n if (index > -1) {\n unProcessedNodes.splice(index, 1);\n }\n }\n visited = new Set();\n parents = new Map();\n }\n }\n\n return flatForest;\n};\n\n/**\r\n * This method creates dummy nodes (an l-level node with minimal dimensions)\r\n * for the given edge (one per bendpoint). The existing l-level structure\r\n * is updated accordingly.\r\n */\nLayout.prototype.createDummyNodesForBendpoints = function (edge) {\n var dummyNodes = [];\n var prev = edge.source;\n\n var graph = this.graphManager.calcLowestCommonAncestor(edge.source, edge.target);\n\n for (var i = 0; i < edge.bendpoints.length; i++) {\n // create new dummy node\n var dummyNode = this.newNode(null);\n dummyNode.setRect(new Point(0, 0), new Dimension(1, 1));\n\n graph.add(dummyNode);\n\n // create new dummy edge between prev and dummy node\n var dummyEdge = this.newEdge(null);\n this.graphManager.add(dummyEdge, prev, dummyNode);\n\n dummyNodes.add(dummyNode);\n prev = dummyNode;\n }\n\n var dummyEdge = this.newEdge(null);\n this.graphManager.add(dummyEdge, prev, edge.target);\n\n this.edgeToDummyNodes.set(edge, dummyNodes);\n\n // remove real edge from graph manager if it is inter-graph\n if (edge.isInterGraph()) {\n this.graphManager.remove(edge);\n }\n // else, remove the edge from the current graph\n else {\n graph.remove(edge);\n }\n\n return dummyNodes;\n};\n\n/**\r\n * This method creates bendpoints for edges from the dummy nodes\r\n * at l-level.\r\n */\nLayout.prototype.createBendpointsFromDummyNodes = function () {\n var edges = [];\n edges = edges.concat(this.graphManager.getAllEdges());\n edges = [].concat(_toConsumableArray(this.edgeToDummyNodes.keys())).concat(edges);\n\n for (var k = 0; k < edges.length; k++) {\n var lEdge = edges[k];\n\n if (lEdge.bendpoints.length > 0) {\n var path = this.edgeToDummyNodes.get(lEdge);\n\n for (var i = 0; i < path.length; i++) {\n var dummyNode = path[i];\n var p = new PointD(dummyNode.getCenterX(), dummyNode.getCenterY());\n\n // update bendpoint's location according to dummy node\n var ebp = lEdge.bendpoints.get(i);\n ebp.x = p.x;\n ebp.y = p.y;\n\n // remove the dummy node, dummy edges incident with this\n // dummy node is also removed (within the remove method)\n dummyNode.getOwner().remove(dummyNode);\n }\n\n // add the real edge to graph\n this.graphManager.add(lEdge, lEdge.source, lEdge.target);\n }\n }\n};\n\nLayout.transform = function (sliderValue, defaultValue, minDiv, maxMul) {\n if (minDiv != undefined && maxMul != undefined) {\n var value = defaultValue;\n\n if (sliderValue <= 50) {\n var minValue = defaultValue / minDiv;\n value -= (defaultValue - minValue) / 50 * (50 - sliderValue);\n } else {\n var maxValue = defaultValue * maxMul;\n value += (maxValue - defaultValue) / 50 * (sliderValue - 50);\n }\n\n return value;\n } else {\n var a, b;\n\n if (sliderValue <= 50) {\n a = 9.0 * defaultValue / 500.0;\n b = defaultValue / 10.0;\n } else {\n a = 9.0 * defaultValue / 50.0;\n b = -8 * defaultValue;\n }\n\n return a * sliderValue + b;\n }\n};\n\n/**\r\n * This method finds and returns the center of the given nodes, assuming\r\n * that the given nodes form a tree in themselves.\r\n */\nLayout.findCenterOfTree = function (nodes) {\n var list = [];\n list = list.concat(nodes);\n\n var removedNodes = [];\n var remainingDegrees = new Map();\n var foundCenter = false;\n var centerNode = null;\n\n if (list.length == 1 || list.length == 2) {\n foundCenter = true;\n centerNode = list[0];\n }\n\n for (var i = 0; i < list.length; i++) {\n var node = list[i];\n var degree = node.getNeighborsList().size;\n remainingDegrees.set(node, node.getNeighborsList().size);\n\n if (degree == 1) {\n removedNodes.push(node);\n }\n }\n\n var tempList = [];\n tempList = tempList.concat(removedNodes);\n\n while (!foundCenter) {\n var tempList2 = [];\n tempList2 = tempList2.concat(tempList);\n tempList = [];\n\n for (var i = 0; i < list.length; i++) {\n var node = list[i];\n\n var index = list.indexOf(node);\n if (index >= 0) {\n list.splice(index, 1);\n }\n\n var neighbours = node.getNeighborsList();\n\n neighbours.forEach(function (neighbour) {\n if (removedNodes.indexOf(neighbour) < 0) {\n var otherDegree = remainingDegrees.get(neighbour);\n var newDegree = otherDegree - 1;\n\n if (newDegree == 1) {\n tempList.push(neighbour);\n }\n\n remainingDegrees.set(neighbour, newDegree);\n }\n });\n }\n\n removedNodes = removedNodes.concat(tempList);\n\n if (list.length == 1 || list.length == 2) {\n foundCenter = true;\n centerNode = list[0];\n }\n }\n\n return centerNode;\n};\n\n/**\r\n * During the coarsening process, this layout may be referenced by two graph managers\r\n * this setter function grants access to change the currently being used graph manager\r\n */\nLayout.prototype.setGraphManager = function (gm) {\n this.graphManager = gm;\n};\n\nmodule.exports = Layout;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction RandomSeed() {}\n// adapted from: https://stackoverflow.com/a/19303725\nRandomSeed.seed = 1;\nRandomSeed.x = 0;\n\nRandomSeed.nextDouble = function () {\n RandomSeed.x = Math.sin(RandomSeed.seed++) * 10000;\n return RandomSeed.x - Math.floor(RandomSeed.x);\n};\n\nmodule.exports = RandomSeed;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar PointD = __webpack_require__(4);\n\nfunction Transform(x, y) {\n this.lworldOrgX = 0.0;\n this.lworldOrgY = 0.0;\n this.ldeviceOrgX = 0.0;\n this.ldeviceOrgY = 0.0;\n this.lworldExtX = 1.0;\n this.lworldExtY = 1.0;\n this.ldeviceExtX = 1.0;\n this.ldeviceExtY = 1.0;\n}\n\nTransform.prototype.getWorldOrgX = function () {\n return this.lworldOrgX;\n};\n\nTransform.prototype.setWorldOrgX = function (wox) {\n this.lworldOrgX = wox;\n};\n\nTransform.prototype.getWorldOrgY = function () {\n return this.lworldOrgY;\n};\n\nTransform.prototype.setWorldOrgY = function (woy) {\n this.lworldOrgY = woy;\n};\n\nTransform.prototype.getWorldExtX = function () {\n return this.lworldExtX;\n};\n\nTransform.prototype.setWorldExtX = function (wex) {\n this.lworldExtX = wex;\n};\n\nTransform.prototype.getWorldExtY = function () {\n return this.lworldExtY;\n};\n\nTransform.prototype.setWorldExtY = function (wey) {\n this.lworldExtY = wey;\n};\n\n/* Device related */\n\nTransform.prototype.getDeviceOrgX = function () {\n return this.ldeviceOrgX;\n};\n\nTransform.prototype.setDeviceOrgX = function (dox) {\n this.ldeviceOrgX = dox;\n};\n\nTransform.prototype.getDeviceOrgY = function () {\n return this.ldeviceOrgY;\n};\n\nTransform.prototype.setDeviceOrgY = function (doy) {\n this.ldeviceOrgY = doy;\n};\n\nTransform.prototype.getDeviceExtX = function () {\n return this.ldeviceExtX;\n};\n\nTransform.prototype.setDeviceExtX = function (dex) {\n this.ldeviceExtX = dex;\n};\n\nTransform.prototype.getDeviceExtY = function () {\n return this.ldeviceExtY;\n};\n\nTransform.prototype.setDeviceExtY = function (dey) {\n this.ldeviceExtY = dey;\n};\n\nTransform.prototype.transformX = function (x) {\n var xDevice = 0.0;\n var worldExtX = this.lworldExtX;\n if (worldExtX != 0.0) {\n xDevice = this.ldeviceOrgX + (x - this.lworldOrgX) * this.ldeviceExtX / worldExtX;\n }\n\n return xDevice;\n};\n\nTransform.prototype.transformY = function (y) {\n var yDevice = 0.0;\n var worldExtY = this.lworldExtY;\n if (worldExtY != 0.0) {\n yDevice = this.ldeviceOrgY + (y - this.lworldOrgY) * this.ldeviceExtY / worldExtY;\n }\n\n return yDevice;\n};\n\nTransform.prototype.inverseTransformX = function (x) {\n var xWorld = 0.0;\n var deviceExtX = this.ldeviceExtX;\n if (deviceExtX != 0.0) {\n xWorld = this.lworldOrgX + (x - this.ldeviceOrgX) * this.lworldExtX / deviceExtX;\n }\n\n return xWorld;\n};\n\nTransform.prototype.inverseTransformY = function (y) {\n var yWorld = 0.0;\n var deviceExtY = this.ldeviceExtY;\n if (deviceExtY != 0.0) {\n yWorld = this.lworldOrgY + (y - this.ldeviceOrgY) * this.lworldExtY / deviceExtY;\n }\n return yWorld;\n};\n\nTransform.prototype.inverseTransformPoint = function (inPoint) {\n var outPoint = new PointD(this.inverseTransformX(inPoint.x), this.inverseTransformY(inPoint.y));\n return outPoint;\n};\n\nmodule.exports = Transform;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar Layout = __webpack_require__(15);\nvar FDLayoutConstants = __webpack_require__(7);\nvar LayoutConstants = __webpack_require__(0);\nvar IGeometry = __webpack_require__(8);\nvar IMath = __webpack_require__(9);\n\nfunction FDLayout() {\n Layout.call(this);\n\n this.useSmartIdealEdgeLengthCalculation = FDLayoutConstants.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;\n this.idealEdgeLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH;\n this.springConstant = FDLayoutConstants.DEFAULT_SPRING_STRENGTH;\n this.repulsionConstant = FDLayoutConstants.DEFAULT_REPULSION_STRENGTH;\n this.gravityConstant = FDLayoutConstants.DEFAULT_GRAVITY_STRENGTH;\n this.compoundGravityConstant = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_STRENGTH;\n this.gravityRangeFactor = FDLayoutConstants.DEFAULT_GRAVITY_RANGE_FACTOR;\n this.compoundGravityRangeFactor = FDLayoutConstants.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;\n this.displacementThresholdPerNode = 3.0 * FDLayoutConstants.DEFAULT_EDGE_LENGTH / 100;\n this.coolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;\n this.initialCoolingFactor = FDLayoutConstants.DEFAULT_COOLING_FACTOR_INCREMENTAL;\n this.totalDisplacement = 0.0;\n this.oldTotalDisplacement = 0.0;\n this.maxIterations = FDLayoutConstants.MAX_ITERATIONS;\n}\n\nFDLayout.prototype = Object.create(Layout.prototype);\n\nfor (var prop in Layout) {\n FDLayout[prop] = Layout[prop];\n}\n\nFDLayout.prototype.initParameters = function () {\n Layout.prototype.initParameters.call(this, arguments);\n\n this.totalIterations = 0;\n this.notAnimatedIterations = 0;\n\n this.useFRGridVariant = FDLayoutConstants.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION;\n\n this.grid = [];\n};\n\nFDLayout.prototype.calcIdealEdgeLengths = function () {\n var edge;\n var lcaDepth;\n var source;\n var target;\n var sizeOfSourceInLca;\n var sizeOfTargetInLca;\n\n var allEdges = this.getGraphManager().getAllEdges();\n for (var i = 0; i < allEdges.length; i++) {\n edge = allEdges[i];\n\n edge.idealLength = this.idealEdgeLength;\n\n if (edge.isInterGraph) {\n source = edge.getSource();\n target = edge.getTarget();\n\n sizeOfSourceInLca = edge.getSourceInLca().getEstimatedSize();\n sizeOfTargetInLca = edge.getTargetInLca().getEstimatedSize();\n\n if (this.useSmartIdealEdgeLengthCalculation) {\n edge.idealLength += sizeOfSourceInLca + sizeOfTargetInLca - 2 * LayoutConstants.SIMPLE_NODE_SIZE;\n }\n\n lcaDepth = edge.getLca().getInclusionTreeDepth();\n\n edge.idealLength += FDLayoutConstants.DEFAULT_EDGE_LENGTH * FDLayoutConstants.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR * (source.getInclusionTreeDepth() + target.getInclusionTreeDepth() - 2 * lcaDepth);\n }\n }\n};\n\nFDLayout.prototype.initSpringEmbedder = function () {\n\n var s = this.getAllNodes().length;\n if (this.incremental) {\n if (s > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {\n this.coolingFactor = Math.max(this.coolingFactor * FDLayoutConstants.COOLING_ADAPTATION_FACTOR, this.coolingFactor - (s - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * this.coolingFactor * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));\n }\n this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT_INCREMENTAL;\n } else {\n if (s > FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) {\n this.coolingFactor = Math.max(FDLayoutConstants.COOLING_ADAPTATION_FACTOR, 1.0 - (s - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) / (FDLayoutConstants.ADAPTATION_UPPER_NODE_LIMIT - FDLayoutConstants.ADAPTATION_LOWER_NODE_LIMIT) * (1 - FDLayoutConstants.COOLING_ADAPTATION_FACTOR));\n } else {\n this.coolingFactor = 1.0;\n }\n this.initialCoolingFactor = this.coolingFactor;\n this.maxNodeDisplacement = FDLayoutConstants.MAX_NODE_DISPLACEMENT;\n }\n\n this.maxIterations = Math.max(this.getAllNodes().length * 5, this.maxIterations);\n\n this.totalDisplacementThreshold = this.displacementThresholdPerNode * this.getAllNodes().length;\n\n this.repulsionRange = this.calcRepulsionRange();\n};\n\nFDLayout.prototype.calcSpringForces = function () {\n var lEdges = this.getAllEdges();\n var edge;\n\n for (var i = 0; i < lEdges.length; i++) {\n edge = lEdges[i];\n\n this.calcSpringForce(edge, edge.idealLength);\n }\n};\n\nFDLayout.prototype.calcRepulsionForces = function () {\n var gridUpdateAllowed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var forceToNodeSurroundingUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var i, j;\n var nodeA, nodeB;\n var lNodes = this.getAllNodes();\n var processedNodeSet;\n\n if (this.useFRGridVariant) {\n if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed) {\n this.updateGrid();\n }\n\n processedNodeSet = new Set();\n\n // calculate repulsion forces between each nodes and its surrounding\n for (i = 0; i < lNodes.length; i++) {\n nodeA = lNodes[i];\n this.calculateRepulsionForceOfANode(nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate);\n processedNodeSet.add(nodeA);\n }\n } else {\n for (i = 0; i < lNodes.length; i++) {\n nodeA = lNodes[i];\n\n for (j = i + 1; j < lNodes.length; j++) {\n nodeB = lNodes[j];\n\n // If both nodes are not members of the same graph, skip.\n if (nodeA.getOwner() != nodeB.getOwner()) {\n continue;\n }\n\n this.calcRepulsionForce(nodeA, nodeB);\n }\n }\n }\n};\n\nFDLayout.prototype.calcGravitationalForces = function () {\n var node;\n var lNodes = this.getAllNodesToApplyGravitation();\n\n for (var i = 0; i < lNodes.length; i++) {\n node = lNodes[i];\n this.calcGravitationalForce(node);\n }\n};\n\nFDLayout.prototype.moveNodes = function () {\n var lNodes = this.getAllNodes();\n var node;\n\n for (var i = 0; i < lNodes.length; i++) {\n node = lNodes[i];\n node.move();\n }\n};\n\nFDLayout.prototype.calcSpringForce = function (edge, idealLength) {\n var sourceNode = edge.getSource();\n var targetNode = edge.getTarget();\n\n var length;\n var springForce;\n var springForceX;\n var springForceY;\n\n // Update edge length\n if (this.uniformLeafNodeSizes && sourceNode.getChild() == null && targetNode.getChild() == null) {\n edge.updateLengthSimple();\n } else {\n edge.updateLength();\n\n if (edge.isOverlapingSourceAndTarget) {\n return;\n }\n }\n\n length = edge.getLength();\n\n if (length == 0) return;\n\n // Calculate spring forces\n springForce = this.springConstant * (length - idealLength);\n\n // Project force onto x and y axes\n springForceX = springForce * (edge.lengthX / length);\n springForceY = springForce * (edge.lengthY / length);\n\n // Apply forces on the end nodes\n sourceNode.springForceX += springForceX;\n sourceNode.springForceY += springForceY;\n targetNode.springForceX -= springForceX;\n targetNode.springForceY -= springForceY;\n};\n\nFDLayout.prototype.calcRepulsionForce = function (nodeA, nodeB) {\n var rectA = nodeA.getRect();\n var rectB = nodeB.getRect();\n var overlapAmount = new Array(2);\n var clipPoints = new Array(4);\n var distanceX;\n var distanceY;\n var distanceSquared;\n var distance;\n var repulsionForce;\n var repulsionForceX;\n var repulsionForceY;\n\n if (rectA.intersects(rectB)) // two nodes overlap\n {\n // calculate separation amount in x and y directions\n IGeometry.calcSeparationAmount(rectA, rectB, overlapAmount, FDLayoutConstants.DEFAULT_EDGE_LENGTH / 2.0);\n\n repulsionForceX = 2 * overlapAmount[0];\n repulsionForceY = 2 * overlapAmount[1];\n\n var childrenConstant = nodeA.noOfChildren * nodeB.noOfChildren / (nodeA.noOfChildren + nodeB.noOfChildren);\n\n // Apply forces on the two nodes\n nodeA.repulsionForceX -= childrenConstant * repulsionForceX;\n nodeA.repulsionForceY -= childrenConstant * repulsionForceY;\n nodeB.repulsionForceX += childrenConstant * repulsionForceX;\n nodeB.repulsionForceY += childrenConstant * repulsionForceY;\n } else // no overlap\n {\n // calculate distance\n\n if (this.uniformLeafNodeSizes && nodeA.getChild() == null && nodeB.getChild() == null) // simply base repulsion on distance of node centers\n {\n distanceX = rectB.getCenterX() - rectA.getCenterX();\n distanceY = rectB.getCenterY() - rectA.getCenterY();\n } else // use clipping points\n {\n IGeometry.getIntersection(rectA, rectB, clipPoints);\n\n distanceX = clipPoints[2] - clipPoints[0];\n distanceY = clipPoints[3] - clipPoints[1];\n }\n\n // No repulsion range. FR grid variant should take care of this.\n if (Math.abs(distanceX) < FDLayoutConstants.MIN_REPULSION_DIST) {\n distanceX = IMath.sign(distanceX) * FDLayoutConstants.MIN_REPULSION_DIST;\n }\n\n if (Math.abs(distanceY) < FDLayoutConstants.MIN_REPULSION_DIST) {\n distanceY = IMath.sign(distanceY) * FDLayoutConstants.MIN_REPULSION_DIST;\n }\n\n distanceSquared = distanceX * distanceX + distanceY * distanceY;\n distance = Math.sqrt(distanceSquared);\n\n repulsionForce = this.repulsionConstant * nodeA.noOfChildren * nodeB.noOfChildren / distanceSquared;\n\n // Project force onto x and y axes\n repulsionForceX = repulsionForce * distanceX / distance;\n repulsionForceY = repulsionForce * distanceY / distance;\n\n // Apply forces on the two nodes \n nodeA.repulsionForceX -= repulsionForceX;\n nodeA.repulsionForceY -= repulsionForceY;\n nodeB.repulsionForceX += repulsionForceX;\n nodeB.repulsionForceY += repulsionForceY;\n }\n};\n\nFDLayout.prototype.calcGravitationalForce = function (node) {\n var ownerGraph;\n var ownerCenterX;\n var ownerCenterY;\n var distanceX;\n var distanceY;\n var absDistanceX;\n var absDistanceY;\n var estimatedSize;\n ownerGraph = node.getOwner();\n\n ownerCenterX = (ownerGraph.getRight() + ownerGraph.getLeft()) / 2;\n ownerCenterY = (ownerGraph.getTop() + ownerGraph.getBottom()) / 2;\n distanceX = node.getCenterX() - ownerCenterX;\n distanceY = node.getCenterY() - ownerCenterY;\n absDistanceX = Math.abs(distanceX) + node.getWidth() / 2;\n absDistanceY = Math.abs(distanceY) + node.getHeight() / 2;\n\n if (node.getOwner() == this.graphManager.getRoot()) // in the root graph\n {\n estimatedSize = ownerGraph.getEstimatedSize() * this.gravityRangeFactor;\n\n if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {\n node.gravitationForceX = -this.gravityConstant * distanceX;\n node.gravitationForceY = -this.gravityConstant * distanceY;\n }\n } else // inside a compound\n {\n estimatedSize = ownerGraph.getEstimatedSize() * this.compoundGravityRangeFactor;\n\n if (absDistanceX > estimatedSize || absDistanceY > estimatedSize) {\n node.gravitationForceX = -this.gravityConstant * distanceX * this.compoundGravityConstant;\n node.gravitationForceY = -this.gravityConstant * distanceY * this.compoundGravityConstant;\n }\n }\n};\n\nFDLayout.prototype.isConverged = function () {\n var converged;\n var oscilating = false;\n\n if (this.totalIterations > this.maxIterations / 3) {\n oscilating = Math.abs(this.totalDisplacement - this.oldTotalDisplacement) < 2;\n }\n\n converged = this.totalDisplacement < this.totalDisplacementThreshold;\n\n this.oldTotalDisplacement = this.totalDisplacement;\n\n return converged || oscilating;\n};\n\nFDLayout.prototype.animate = function () {\n if (this.animationDuringLayout && !this.isSubLayout) {\n if (this.notAnimatedIterations == this.animationPeriod) {\n this.update();\n this.notAnimatedIterations = 0;\n } else {\n this.notAnimatedIterations++;\n }\n }\n};\n\n//This method calculates the number of children (weight) for all nodes\nFDLayout.prototype.calcNoOfChildrenForAllNodes = function () {\n var node;\n var allNodes = this.graphManager.getAllNodes();\n\n for (var i = 0; i < allNodes.length; i++) {\n node = allNodes[i];\n node.noOfChildren = node.getNoOfChildren();\n }\n};\n\n// -----------------------------------------------------------------------------\n// Section: FR-Grid Variant Repulsion Force Calculation\n// -----------------------------------------------------------------------------\n\nFDLayout.prototype.calcGrid = function (graph) {\n\n var sizeX = 0;\n var sizeY = 0;\n\n sizeX = parseInt(Math.ceil((graph.getRight() - graph.getLeft()) / this.repulsionRange));\n sizeY = parseInt(Math.ceil((graph.getBottom() - graph.getTop()) / this.repulsionRange));\n\n var grid = new Array(sizeX);\n\n for (var i = 0; i < sizeX; i++) {\n grid[i] = new Array(sizeY);\n }\n\n for (var i = 0; i < sizeX; i++) {\n for (var j = 0; j < sizeY; j++) {\n grid[i][j] = new Array();\n }\n }\n\n return grid;\n};\n\nFDLayout.prototype.addNodeToGrid = function (v, left, top) {\n\n var startX = 0;\n var finishX = 0;\n var startY = 0;\n var finishY = 0;\n\n startX = parseInt(Math.floor((v.getRect().x - left) / this.repulsionRange));\n finishX = parseInt(Math.floor((v.getRect().width + v.getRect().x - left) / this.repulsionRange));\n startY = parseInt(Math.floor((v.getRect().y - top) / this.repulsionRange));\n finishY = parseInt(Math.floor((v.getRect().height + v.getRect().y - top) / this.repulsionRange));\n\n for (var i = startX; i <= finishX; i++) {\n for (var j = startY; j <= finishY; j++) {\n this.grid[i][j].push(v);\n v.setGridCoordinates(startX, finishX, startY, finishY);\n }\n }\n};\n\nFDLayout.prototype.updateGrid = function () {\n var i;\n var nodeA;\n var lNodes = this.getAllNodes();\n\n this.grid = this.calcGrid(this.graphManager.getRoot());\n\n // put all nodes to proper grid cells\n for (i = 0; i < lNodes.length; i++) {\n nodeA = lNodes[i];\n this.addNodeToGrid(nodeA, this.graphManager.getRoot().getLeft(), this.graphManager.getRoot().getTop());\n }\n};\n\nFDLayout.prototype.calculateRepulsionForceOfANode = function (nodeA, processedNodeSet, gridUpdateAllowed, forceToNodeSurroundingUpdate) {\n\n if (this.totalIterations % FDLayoutConstants.GRID_CALCULATION_CHECK_PERIOD == 1 && gridUpdateAllowed || forceToNodeSurroundingUpdate) {\n var surrounding = new Set();\n nodeA.surrounding = new Array();\n var nodeB;\n var grid = this.grid;\n\n for (var i = nodeA.startX - 1; i < nodeA.finishX + 2; i++) {\n for (var j = nodeA.startY - 1; j < nodeA.finishY + 2; j++) {\n if (!(i < 0 || j < 0 || i >= grid.length || j >= grid[0].length)) {\n for (var k = 0; k < grid[i][j].length; k++) {\n nodeB = grid[i][j][k];\n\n // If both nodes are not members of the same graph, \n // or both nodes are the same, skip.\n if (nodeA.getOwner() != nodeB.getOwner() || nodeA == nodeB) {\n continue;\n }\n\n // check if the repulsion force between\n // nodeA and nodeB has already been calculated\n if (!processedNodeSet.has(nodeB) && !surrounding.has(nodeB)) {\n var distanceX = Math.abs(nodeA.getCenterX() - nodeB.getCenterX()) - (nodeA.getWidth() / 2 + nodeB.getWidth() / 2);\n var distanceY = Math.abs(nodeA.getCenterY() - nodeB.getCenterY()) - (nodeA.getHeight() / 2 + nodeB.getHeight() / 2);\n\n // if the distance between nodeA and nodeB \n // is less then calculation range\n if (distanceX <= this.repulsionRange && distanceY <= this.repulsionRange) {\n //then add nodeB to surrounding of nodeA\n surrounding.add(nodeB);\n }\n }\n }\n }\n }\n }\n\n nodeA.surrounding = [].concat(_toConsumableArray(surrounding));\n }\n for (i = 0; i < nodeA.surrounding.length; i++) {\n this.calcRepulsionForce(nodeA, nodeA.surrounding[i]);\n }\n};\n\nFDLayout.prototype.calcRepulsionRange = function () {\n return 0.0;\n};\n\nmodule.exports = FDLayout;\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LEdge = __webpack_require__(1);\nvar FDLayoutConstants = __webpack_require__(7);\n\nfunction FDLayoutEdge(source, target, vEdge) {\n LEdge.call(this, source, target, vEdge);\n this.idealLength = FDLayoutConstants.DEFAULT_EDGE_LENGTH;\n}\n\nFDLayoutEdge.prototype = Object.create(LEdge.prototype);\n\nfor (var prop in LEdge) {\n FDLayoutEdge[prop] = LEdge[prop];\n}\n\nmodule.exports = FDLayoutEdge;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar LNode = __webpack_require__(3);\n\nfunction FDLayoutNode(gm, loc, size, vNode) {\n // alternative constructor is handled inside LNode\n LNode.call(this, gm, loc, size, vNode);\n //Spring, repulsion and gravitational forces acting on this node\n this.springForceX = 0;\n this.springForceY = 0;\n this.repulsionForceX = 0;\n this.repulsionForceY = 0;\n this.gravitationForceX = 0;\n this.gravitationForceY = 0;\n //Amount by which this node is to be moved in this iteration\n this.displacementX = 0;\n this.displacementY = 0;\n\n //Start and finish grid coordinates that this node is fallen into\n this.startX = 0;\n this.finishX = 0;\n this.startY = 0;\n this.finishY = 0;\n\n //Geometric neighbors of this node\n this.surrounding = [];\n}\n\nFDLayoutNode.prototype = Object.create(LNode.prototype);\n\nfor (var prop in LNode) {\n FDLayoutNode[prop] = LNode[prop];\n}\n\nFDLayoutNode.prototype.setGridCoordinates = function (_startX, _finishX, _startY, _finishY) {\n this.startX = _startX;\n this.finishX = _finishX;\n this.startY = _startY;\n this.finishY = _finishY;\n};\n\nmodule.exports = FDLayoutNode;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction DimensionD(width, height) {\n this.width = 0;\n this.height = 0;\n if (width !== null && height !== null) {\n this.height = height;\n this.width = width;\n }\n}\n\nDimensionD.prototype.getWidth = function () {\n return this.width;\n};\n\nDimensionD.prototype.setWidth = function (width) {\n this.width = width;\n};\n\nDimensionD.prototype.getHeight = function () {\n return this.height;\n};\n\nDimensionD.prototype.setHeight = function (height) {\n this.height = height;\n};\n\nmodule.exports = DimensionD;\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar UniqueIDGeneretor = __webpack_require__(14);\n\nfunction HashMap() {\n this.map = {};\n this.keys = [];\n}\n\nHashMap.prototype.put = function (key, value) {\n var theId = UniqueIDGeneretor.createID(key);\n if (!this.contains(theId)) {\n this.map[theId] = value;\n this.keys.push(key);\n }\n};\n\nHashMap.prototype.contains = function (key) {\n var theId = UniqueIDGeneretor.createID(key);\n return this.map[key] != null;\n};\n\nHashMap.prototype.get = function (key) {\n var theId = UniqueIDGeneretor.createID(key);\n return this.map[theId];\n};\n\nHashMap.prototype.keySet = function () {\n return this.keys;\n};\n\nmodule.exports = HashMap;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar UniqueIDGeneretor = __webpack_require__(14);\n\nfunction HashSet() {\n this.set = {};\n}\n;\n\nHashSet.prototype.add = function (obj) {\n var theId = UniqueIDGeneretor.createID(obj);\n if (!this.contains(theId)) this.set[theId] = obj;\n};\n\nHashSet.prototype.remove = function (obj) {\n delete this.set[UniqueIDGeneretor.createID(obj)];\n};\n\nHashSet.prototype.clear = function () {\n this.set = {};\n};\n\nHashSet.prototype.contains = function (obj) {\n return this.set[UniqueIDGeneretor.createID(obj)] == obj;\n};\n\nHashSet.prototype.isEmpty = function () {\n return this.size() === 0;\n};\n\nHashSet.prototype.size = function () {\n return Object.keys(this.set).length;\n};\n\n//concats this.set to the given list\nHashSet.prototype.addAllTo = function (list) {\n var keys = Object.keys(this.set);\n var length = keys.length;\n for (var i = 0; i < length; i++) {\n list.push(this.set[keys[i]]);\n }\n};\n\nHashSet.prototype.size = function () {\n return Object.keys(this.set).length;\n};\n\nHashSet.prototype.addAll = function (list) {\n var s = list.length;\n for (var i = 0; i < s; i++) {\n var v = list[i];\n this.add(v);\n }\n};\n\nmodule.exports = HashSet;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * A classic Quicksort algorithm with Hoare's partition\n * - Works also on LinkedList objects\n *\n * Copyright: i-Vis Research Group, Bilkent University, 2007 - present\n */\n\nvar LinkedList = __webpack_require__(11);\n\nvar Quicksort = function () {\n function Quicksort(A, compareFunction) {\n _classCallCheck(this, Quicksort);\n\n if (compareFunction !== null || compareFunction !== undefined) this.compareFunction = this._defaultCompareFunction;\n\n var length = void 0;\n if (A instanceof LinkedList) length = A.size();else length = A.length;\n\n this._quicksort(A, 0, length - 1);\n }\n\n _createClass(Quicksort, [{\n key: '_quicksort',\n value: function _quicksort(A, p, r) {\n if (p < r) {\n var q = this._partition(A, p, r);\n this._quicksort(A, p, q);\n this._quicksort(A, q + 1, r);\n }\n }\n }, {\n key: '_partition',\n value: function _partition(A, p, r) {\n var x = this._get(A, p);\n var i = p;\n var j = r;\n while (true) {\n while (this.compareFunction(x, this._get(A, j))) {\n j--;\n }while (this.compareFunction(this._get(A, i), x)) {\n i++;\n }if (i < j) {\n this._swap(A, i, j);\n i++;\n j--;\n } else return j;\n }\n }\n }, {\n key: '_get',\n value: function _get(object, index) {\n if (object instanceof LinkedList) return object.get_object_at(index);else return object[index];\n }\n }, {\n key: '_set',\n value: function _set(object, index, value) {\n if (object instanceof LinkedList) object.set_object_at(index, value);else object[index] = value;\n }\n }, {\n key: '_swap',\n value: function _swap(A, i, j) {\n var temp = this._get(A, i);\n this._set(A, i, this._get(A, j));\n this._set(A, j, temp);\n }\n }, {\n key: '_defaultCompareFunction',\n value: function _defaultCompareFunction(a, b) {\n return b > a;\n }\n }]);\n\n return Quicksort;\n}();\n\nmodule.exports = Quicksort;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/**\n * Needleman-Wunsch algorithm is an procedure to compute the optimal global alignment of two string\n * sequences by S.B.Needleman and C.D.Wunsch (1970).\n *\n * Aside from the inputs, you can assign the scores for,\n * - Match: The two characters at the current index are same.\n * - Mismatch: The two characters at the current index are different.\n * - Insertion/Deletion(gaps): The best alignment involves one letter aligning to a gap in the other string.\n */\n\nvar NeedlemanWunsch = function () {\n function NeedlemanWunsch(sequence1, sequence2) {\n var match_score = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var mismatch_penalty = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;\n var gap_penalty = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1;\n\n _classCallCheck(this, NeedlemanWunsch);\n\n this.sequence1 = sequence1;\n this.sequence2 = sequence2;\n this.match_score = match_score;\n this.mismatch_penalty = mismatch_penalty;\n this.gap_penalty = gap_penalty;\n\n // Just the remove redundancy\n this.iMax = sequence1.length + 1;\n this.jMax = sequence2.length + 1;\n\n // Grid matrix of scores\n this.grid = new Array(this.iMax);\n for (var i = 0; i < this.iMax; i++) {\n this.grid[i] = new Array(this.jMax);\n\n for (var j = 0; j < this.jMax; j++) {\n this.grid[i][j] = 0;\n }\n }\n\n // Traceback matrix (2D array, each cell is an array of boolean values for [`Diag`, `Up`, `Left`] positions)\n this.tracebackGrid = new Array(this.iMax);\n for (var _i = 0; _i < this.iMax; _i++) {\n this.tracebackGrid[_i] = new Array(this.jMax);\n\n for (var _j = 0; _j < this.jMax; _j++) {\n this.tracebackGrid[_i][_j] = [null, null, null];\n }\n }\n\n // The aligned sequences (return multiple possibilities)\n this.alignments = [];\n\n // Final alignment score\n this.score = -1;\n\n // Calculate scores and tracebacks\n this.computeGrids();\n }\n\n _createClass(NeedlemanWunsch, [{\n key: \"getScore\",\n value: function getScore() {\n return this.score;\n }\n }, {\n key: \"getAlignments\",\n value: function getAlignments() {\n return this.alignments;\n }\n\n // Main dynamic programming procedure\n\n }, {\n key: \"computeGrids\",\n value: function computeGrids() {\n // Fill in the first row\n for (var j = 1; j < this.jMax; j++) {\n this.grid[0][j] = this.grid[0][j - 1] + this.gap_penalty;\n this.tracebackGrid[0][j] = [false, false, true];\n }\n\n // Fill in the first column\n for (var i = 1; i < this.iMax; i++) {\n this.grid[i][0] = this.grid[i - 1][0] + this.gap_penalty;\n this.tracebackGrid[i][0] = [false, true, false];\n }\n\n // Fill the rest of the grid\n for (var _i2 = 1; _i2 < this.iMax; _i2++) {\n for (var _j2 = 1; _j2 < this.jMax; _j2++) {\n // Find the max score(s) among [`Diag`, `Up`, `Left`]\n var diag = void 0;\n if (this.sequence1[_i2 - 1] === this.sequence2[_j2 - 1]) diag = this.grid[_i2 - 1][_j2 - 1] + this.match_score;else diag = this.grid[_i2 - 1][_j2 - 1] + this.mismatch_penalty;\n\n var up = this.grid[_i2 - 1][_j2] + this.gap_penalty;\n var left = this.grid[_i2][_j2 - 1] + this.gap_penalty;\n\n // If there exists multiple max values, capture them for multiple paths\n var maxOf = [diag, up, left];\n var indices = this.arrayAllMaxIndexes(maxOf);\n\n // Update Grids\n this.grid[_i2][_j2] = maxOf[indices[0]];\n this.tracebackGrid[_i2][_j2] = [indices.includes(0), indices.includes(1), indices.includes(2)];\n }\n }\n\n // Update alignment score\n this.score = this.grid[this.iMax - 1][this.jMax - 1];\n }\n\n // Gets all possible valid sequence combinations\n\n }, {\n key: \"alignmentTraceback\",\n value: function alignmentTraceback() {\n var inProcessAlignments = [];\n\n inProcessAlignments.push({ pos: [this.sequence1.length, this.sequence2.length],\n seq1: \"\",\n seq2: \"\"\n });\n\n while (inProcessAlignments[0]) {\n var current = inProcessAlignments[0];\n var directions = this.tracebackGrid[current.pos[0]][current.pos[1]];\n\n if (directions[0]) {\n inProcessAlignments.push({ pos: [current.pos[0] - 1, current.pos[1] - 1],\n seq1: this.sequence1[current.pos[0] - 1] + current.seq1,\n seq2: this.sequence2[current.pos[1] - 1] + current.seq2\n });\n }\n if (directions[1]) {\n inProcessAlignments.push({ pos: [current.pos[0] - 1, current.pos[1]],\n seq1: this.sequence1[current.pos[0] - 1] + current.seq1,\n seq2: '-' + current.seq2\n });\n }\n if (directions[2]) {\n inProcessAlignments.push({ pos: [current.pos[0], current.pos[1] - 1],\n seq1: '-' + current.seq1,\n seq2: this.sequence2[current.pos[1] - 1] + current.seq2\n });\n }\n\n if (current.pos[0] === 0 && current.pos[1] === 0) this.alignments.push({ sequence1: current.seq1,\n sequence2: current.seq2\n });\n\n inProcessAlignments.shift();\n }\n\n return this.alignments;\n }\n\n // Helper Functions\n\n }, {\n key: \"getAllIndexes\",\n value: function getAllIndexes(arr, val) {\n var indexes = [],\n i = -1;\n while ((i = arr.indexOf(val, i + 1)) !== -1) {\n indexes.push(i);\n }\n return indexes;\n }\n }, {\n key: \"arrayAllMaxIndexes\",\n value: function arrayAllMaxIndexes(array) {\n return this.getAllIndexes(array, Math.max.apply(null, array));\n }\n }]);\n\n return NeedlemanWunsch;\n}();\n\nmodule.exports = NeedlemanWunsch;\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar layoutBase = function layoutBase() {\n return;\n};\n\nlayoutBase.FDLayout = __webpack_require__(18);\nlayoutBase.FDLayoutConstants = __webpack_require__(7);\nlayoutBase.FDLayoutEdge = __webpack_require__(19);\nlayoutBase.FDLayoutNode = __webpack_require__(20);\nlayoutBase.DimensionD = __webpack_require__(21);\nlayoutBase.HashMap = __webpack_require__(22);\nlayoutBase.HashSet = __webpack_require__(23);\nlayoutBase.IGeometry = __webpack_require__(8);\nlayoutBase.IMath = __webpack_require__(9);\nlayoutBase.Integer = __webpack_require__(10);\nlayoutBase.Point = __webpack_require__(12);\nlayoutBase.PointD = __webpack_require__(4);\nlayoutBase.RandomSeed = __webpack_require__(16);\nlayoutBase.RectangleD = __webpack_require__(13);\nlayoutBase.Transform = __webpack_require__(17);\nlayoutBase.UniqueIDGeneretor = __webpack_require__(14);\nlayoutBase.Quicksort = __webpack_require__(24);\nlayoutBase.LinkedList = __webpack_require__(11);\nlayoutBase.LGraphObject = __webpack_require__(2);\nlayoutBase.LGraph = __webpack_require__(5);\nlayoutBase.LEdge = __webpack_require__(1);\nlayoutBase.LGraphManager = __webpack_require__(6);\nlayoutBase.LNode = __webpack_require__(3);\nlayoutBase.Layout = __webpack_require__(15);\nlayoutBase.LayoutConstants = __webpack_require__(0);\nlayoutBase.NeedlemanWunsch = __webpack_require__(25);\n\nmodule.exports = layoutBase;\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nfunction Emitter() {\n this.listeners = [];\n}\n\nvar p = Emitter.prototype;\n\np.addListener = function (event, callback) {\n this.listeners.push({\n event: event,\n callback: callback\n });\n};\n\np.removeListener = function (event, callback) {\n for (var i = this.listeners.length; i >= 0; i--) {\n var l = this.listeners[i];\n\n if (l.event === event && l.callback === callback) {\n this.listeners.splice(i, 1);\n }\n }\n};\n\np.emit = function (event, data) {\n for (var i = 0; i < this.listeners.length; i++) {\n var l = this.listeners[i];\n\n if (event === l.event) {\n l.callback(data);\n }\n }\n};\n\nmodule.exports = Emitter;\n\n/***/ })\n/******/ ]);\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJz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GlmIChyZWN0QS5nZXRYKCkgPD0gcmVjdEIuZ2V0WCgpICYmIHJlY3RBLmdldFJpZ2h0KCkgPj0gcmVjdEIuZ2V0UmlnaHQoKSkge1xuICAgIC8qIENhc2UgeC4xOlxuICAgICpcbiAgICAqIHJlY3RBXG4gICAgKiBcdHwgICAgICAgICAgICAgICAgICAgICAgIHxcbiAgICAqIFx0fCAgICAgICAgX19fX19fX19fICAgICAgfFxuICAgICogXHR8ICAgICAgICB8ICAgICAgIHwgICAgICB8XG4gICAgKiBcdHxfX19fX19fX3xfX19fX19ffF9fX19fX3xcbiAgICAqIFx0XHRcdCB8ICAgICAgIHxcbiAgICAqICAgICAgICAgICB8ICAgICAgIHxcbiAgICAqICAgICAgICByZWN0QlxuICAgICovXG4gICAgb3ZlcmxhcEFtb3VudFswXSArPSBNYXRoLm1pbihyZWN0Qi5nZXRYKCkgLSByZWN0QS5nZXRYKCksIHJlY3RBLmdldFJpZ2h0KCkgLSByZWN0Qi5nZXRSaWdodCgpKTtcbiAgfSBlbHNlIGlmIChyZWN0Qi5nZXRYKCkgPD0gcmVjdEEuZ2V0WCgpICYmIHJlY3RCLmdldFJpZ2h0KCkgPj0gcmVjdEEuZ2V0UmlnaHQoKSkge1xuICAgIC8qIENhc2UgeC4yOlxuICAgICpcbiAgICAqIHJlY3RCXG4gICAgKiBcdHwgICAgICAgICAgICAgICAgICAgICAgIHxcbiAgICAqIFx0fCAgICAgICAgX19fX19fX19fICAgICAgfFxuICAgICogXHR8ICAgICAgICB8ICAgICAgIHwgICAgICB8XG4gICAgKiBcdHxfX19fX19fX3xfX19fX19ffF9fX19fX3xcbiAgICAqIFx0XHRcdCB8ICAgICAgIHxcbiAgICAqICAgICAgICAgICB8ICAgICAgIHxcbiAgICAqICAgICAgICByZWN0QVxuICAgICovXG4gICAgb3ZlcmxhcEFtb3VudFswXSArPSBNYXRoLm1pbihyZWN0QS5nZXRYKCkgLSByZWN0Qi5nZXRYKCksIHJlY3RCLmdldFJpZ2h0KCkgLSByZWN0QS5nZXRSaWdodCgpKTtcbiAgfVxuICBpZiAocmVjdEEuZ2V0WSgpIDw9IHJlY3RCLmdldFkoKSAmJiByZWN0QS5nZXRCb3R0b20oKSA+PSByZWN0Qi5nZXRCb3R0b20oKSkge1xuICAgIC8qIENhc2UgeS4xOlxuICAgICAqICAgICAgICAgIF9fX19fX19fIHJlY3RBXG4gICAgICogICAgICAgICB8XG4gICAgICogICAgICAgICB8XG4gICAgICogICBfX19fX198X19fXyAgcmVjdEJcbiAgICAgKiAgICAgICAgIHwgICAgfFxuICAgICAqICAgICAgICAgfCAgICB8XG4gICAgICogICBfX19fX198X19fX3xcbiAgICAgKiAgICAgICAgIHxcbiAgICAgKiAgICAgICAgIHxcbiAgICAgKiAgICAgICAgIHxfX19fX19fX1xuICAgICAqXG4gICAgICovXG4gICAgb3ZlcmxhcEFtb3VudFsxXSArPSBNYXRoLm1pbihyZWN0Qi5nZXRZKCkgLSByZWN0QS5nZXRZKCksIHJlY3RBLmdldEJvdHRvbSgpIC0gcmVjdEIuZ2V0Qm90dG9tKCkpO1xuICB9IGVsc2UgaWYgKHJlY3RCLmdldFkoKSA8PSByZWN0QS5nZXRZKCkgJiYgcmVjdEIuZ2V0Qm90dG9tKCkgPj0gcmVjdEEuZ2V0Qm90dG9tKCkpIHtcbiAgICAvKiBDYXNlIHkuMjpcbiAgICAqICAgICAgICAgIF9fX19fX19fIHJlY3RCXG4gICAgKiAgICAgICAgIHxcbiAgICAqICAgICAgICAgfFxuICAgICogICBfX19fX198X19fXyAgcmVjdEFcbiAgICAqICAgICAgICAgfCAgICB8XG4gICAgKiAgICAgICAgIHwgICAgfFxuICAgICogICBfX19fX198X19fX3xcbiAgICAqICAgICAgICAgfFxuICAgICogICAgICAgICB8XG4gICAgKiAgICAgICAgIHxfX19fX19fX1xuICAgICpcbiAgICAqL1xuICAgIG92ZXJsYXBBbW91bnRbMV0gKz0gTWF0aC5taW4ocmVjdEEuZ2V0WSgpIC0gcmVjdE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QXg7XG4gICAgICAgICAgICByZXN1bHRbMV0gPSB0ZW1wUG9pbnRBeTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgIHRlbXBQb2ludEF5ID0gYm90dG9tTGVmdEF5O1xuICAgICAgICAgICAgdGVtcFBvaW50QXggPSBwMXggKyBoYWxmSGVpZ2h0QSAvIHNsb3BlUHJpbWU7XG4gICAgICAgICAgICByZXN1bHRbMF0gPSB0ZW1wUG9pbnRBeDtcbiAgICAgICAgICAgIHJlc3VsdFsxXSA9IHRlbXBQb2ludEF5O1xuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgdGVtcFBvaW50QXggPSBib3R0b21MZWZ0QXg7XG4gICAgICAgICAgICB0ZW1wUG9pbnRBeSA9IHAxeSArIC1oYWxmV2lkdGhBICogc2xvcGVQcmltZTtcbiAgICAgICAgICAgIHJlc3VsdFswXSA9IHRlbXBQb2ludEF4O1xuICAgICAgICAgICAgcmVzdWx0WzFdID0gdGVtcFBvaW50QXk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKCFjbGlwUG9pbnRCRm91bmQpIHtcbiAgICAgICAgc3dpdGNoIChjYXJkaW5hbERpcmVjdGlvbkIpIHtcbiAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICB0ZW1wUG9pbnRCeSA9IHRvcExlZnRCeTtcbiAgICAgICAgICAgIHRlbXBQb2ludEJ4ID0gcDJ4ICsgLWhhbGZIZWlnaHRCIC8gc2xvcGVQcmltZTtcbiAgICAgICAgICAgIHJlc3VsdFsyXSA9IHRlbXBQb2ludEJ4O1xuICAgICAgICAgICAgcmVzdWx0WzNdID0gdGVtcFBvaW50Qnk7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICB0ZW1wUG9pbnRCeCA9IGJvdHRvbVJp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Q2xhc3MoUXVpY2tzb3J0LCBbe1xuICAgICAgICBrZXk6ICdfcXVpY2tzb3J0JyxcbiAgICAgICAgdmFsdWU6IGZ1bmN0aW9uIF9xdWlja3NvcnQoQSwgcCwgcikge1xuICAgICAgICAgICAgaWYgKHAgPCByKSB7XG4gICAgICAgICAgICAgICAgdmFyIHEgPSB0aGlzLl9wYXJ0aXRpb24oQSwgcCwgcik7XG4gICAgICAgICAgICAgICAgdGhpcy5fcXVpY2tzb3J0KEEsIHAsIHEpO1xuICAgICAgICAgICAgICAgIHRoaXMuX3F1aWNrc29ydChBLCBxICsgMSwgcik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9LCB7XG4gICAgICAgIGtleTogJ19wYXJ0aXRpb24nLFxuICAgICAgICB2YWx1ZTogZnVuY3Rpb24gX3BhcnRpdGlvbihBLCBwLCByKSB7XG4gICAgICAgICAgICB2YXIgeCA9IHRoaXMuX2dldChBLCBwKTtcbiAgICAgICAgICAgIHZhciBpID0gcDtcbiAgICAgICAgICAgIHZhciBqID0gcjtcbiAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHRoaXMuY29tcGFyZUZ1bmN0aW9uKHgsIHRoaXMuX2dldChBLCBqKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgai0tO1xuICAgICAgICAgICAgICAgIH13aGlsZSAodGhpcy5jb21wYXJlRnVuY3Rpb24odGhpcy5fZ2V0KEEsIGkpLCB4KSkge1xuICAgICAgICAgICAgICAgICAgICBpKys7XG4gICAgICAgICAgICAgICAgfWlmIChpIDwgaikge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zd2FwKEEsIGksIGopO1xuICAgICAgICAgICAgICAgICAgICBpKys7XG4gICAgICAgICAgICAgICAgICAgIGotLTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgcmV0dXJuIGo7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9LCB7XG4gICA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FsaWdubWVudHMoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5hbGlnbm1lbnRzO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gTWFpbiBkeW5hbWljIHByb2dyYW1taW5nIHByb2NlZHVyZVxuXG4gICAgfSwge1xuICAgICAgICBrZXk6IFwiY29tcHV0ZUdyaWRzXCIsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBjb21wdXRlR3JpZHMoKSB7XG4gICAgICAgICAgICAvLyBGaWxsIGluIHRoZSBmaXJzdCByb3dcbiAgICAgICAgICAgIGZvciAodmFyIGogPSAxOyBqIDwgdGhpcy5qTWF4OyBqKyspIHtcbiAgICAgICAgICAgICAgICB0aGlzLmdyaWRbMF1bal0gPSB0aGlzLmdyaWRbMF1baiAtIDFdICsgdGhpcy5nYXBfcGVuYWx0eTtcbiAgICAgICAgICAgICAgICB0aGlzLnRyYWNlYmFja0dyaWRbMF1bal0gPSBbZmFsc2UsIGZhbHNlLCB0cnVlXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gRmlsbCBpbiB0aGUgZmlyc3QgY29sdW1uXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IHRoaXMuaU1heDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5ncmlkW2ldWzBdID0gdGhpcy5ncmlkW2kgLSAxXVswXSArIHRoaXMuZ2FwX3BlbmFsdHk7XG4gICAgICAgICAgICAgICAgdGhpcy50cmFjZWJhY2tHcmlkW2ldWzBdID0gW2ZhbHNlLCB0cnVlLCBmYWxzZV07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEZpbGwgdGhlIHJlc3Qgb2YgdGhlIGdyaWRcbiAgICAgICAgICAgIGZvciAodmFyIF9pMiA9IDE7IF9pMiA8IHRoaXMuaU1heDsgX2kyKyspIHtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBfajIgPSAxOyBfajIgPCB0aGlzLmpNYXg7IF9qMisrKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIEZpbmQgdGhlIG1heCBzY29yZShzKSBhbW9uZyBbYERpYWdgLCBgVXBgLCBgTGVmdGBdXG4gICAgICAgICAgICAgICAgICAgIHZhciBkaWFnID0gdm9pZCAwO1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXF1ZW5jZTFbX2kyIC0gMV0gPT09IHRoaXMuc2VxdWVuY2UyW19qMiAtIDFdKSBkaWFnID0gdGhpcy5ncmlkW19pMiAtIDFdW19qMiAtIDFdICsgdGhpcy5tYXRjaF9zY29yZTtlbHNlIGRpYWcgPSB0aGlzLmdyaWRbX2kyIC0gMV1bX2oyIC0gMV0gKyB0aGlzLm1pc21hdGNoX3BlbmFsdHk7XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIHVwID0gdGhpcy5ncmlkW19pMiAtIDFdW19qMl0gKyB0aGlzLmdhcF9wZW5hbHR5O1xuICAgICAgICAgICAgICAgICAgICB2YXIgbGVmdCA9IHRoaXMuZ3JpZFtfaTJdW19qMiAtIDFdICsgdGhpcy5nYXBfcGVuYWx0eTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGVyZSBleGlzdHMgbXVsdGlwbGUgbWF4IHZhbHVlcywgY2FwdHVyZSB0aGVtIGZvciBtdWx0aXBsZSBwYXRoc1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF4T2YgPSBbZGlhZywgdXAsIGxlZnRdO1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW5kaWNlcyA9IHRoaXMuYXJyYXlBbGxNYXhJbmRleGVzKG1heE9mKTtcblxuICAgICAgICAgICAgICAgICAgICAvLyBVcGRhdGUgR3JpZHNcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5ncmlkW19pMl1bX2oyXSA9IG1heE9mW2luZGljZXNbMF1dO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnRyYWNlYmFja0dyaWRbX2kyXVtfajJdID0gW2luZGljZXMuaW5jbHVkZXMoMCksIGluZGljZXMuaW5jbHVkZXMoMSksIGluZGljZXMuaW5jbHVkZXMoMildO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gVXBkYXRlIGFsaWdubWVudCBzY29yZVxuICAgICAgICAgICAgdGhpcy5zY29yZSA9IHRoaXMuZ3JpZFt0aGlzLmlNYXggLSAxXVt0aGlzLmpNYXggLSAxXTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEdldHMgYWxsIHBvc3NpYmxlIHZhbGlkIHNlcXVlbmNlIGNvbWJpbmF0aW9uc1xuXG4gICAgfSwge1xuICAgICAgICBrZXk6IFwiYWxpZ25tZW50VHJhY2ViYWNrXCIsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBhbGlnbm1lbnRUcmFjZWJhY2soKSB7XG4gICAgICAgICAgICB2YXIgaW5Qcm9jZXNzQWxpZ25tZW50cyA9IFtdO1xuXG4gICAgICAgICAgICBpblByb2Nlc3NBbGlnbm1lbnRzLnB1c2goeyBwb3M6IFt0aGlzLnNlcXVlbmNlMS5sZW5ndGgsIHRoaXMuc2VxdWVuY2UyLmxlbmd0aF0sXG4gICAgICAgICAgICAgICAgc2VxMTogXCJcIixcbiAgICAgICAgICAgICAgICBzZXEyOiBcIlwiXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgd2hpbGUgKGluUHJvY2Vzc0FsaWdubWVudHNbMF0pIHtcbiAgICAgICAgICAgICAgICB2YXIgY3VycmVudCA9IGluUHJvY2Vzc0FsaWdubWVudHNbMF07XG4gICAgICAgICAgICAgICAgdmFyIGRpcmVjdGlvbnMgPSB0aGlzLnRyYWNlYmFja0dyaWRbY3VycmVudC5wb3NbMF1dW2N1cnJlbnQucG9zWzFdXTtcblxuICAgICAgICAgICAgICAgIGlmIChkaXJlY3Rpb25zWzBdKSB7XG4gICAgICAgICAgICAgICAgICAgIGluUHJvY2Vzc0FsaWdubWVudHMucHVzaCh7IHBvczogW2N1cnJlbnQucG9zWzBdIC0gMSwgY3VycmVudC5wb3NbMV0gLSAxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlcTE6IHRoaXMuc2VxdWVuY2UxW2N1cnJlbnQucG9zWzBdIC0gMV0gKyBjdXJyZW50LnNlcTEsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXEyOiB0aGlzLnNlcXVlbmNlMltjdXJyZW50LnBvc1sxXSAtIDFdICsgY3VycmVudC5zZXEyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoZGlyZWN0aW9uc1sxXSkge1xuICAgICAgICAgICAgICAgICAgICBpblByb2Nlc3NBbGlnbm1lbnRzLnB1c2goeyBwb3M6IFtjdXJyZW50LnBvc1swXSAtIDEsIGN1cnJlbnQucG9zWzFdXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlcTE6IHRoaXMuc2VxdWVuY2UxW2N1cnJlbnQucG9zWzBdIC0gMV0gKyBjdXJyZW50LnNlcTEsXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXEyOiAnLScgKyBjdXJyZW50LnNlcTJcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChkaXJlY3Rpb25zWzJdKSB7XG4gICAgICAgICAgICAgICAgICAgIGluUHJvY2Vzc0FsaWdubWVudHMucHVzaCh7IHBvczogW2N1cnJlbnQucG9zWzBdLCBjdXJyZW50LnBvc1sxXSAtIDFdLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2VxMTogJy0nICsgY3VycmVudC5zZXExLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2VxMjogdGhpcy5zZXF1ZW5jZTJbY3VycmVudC5wb3NbMV0gLSAxXSArIGN1cnJlbnQuc2VxMlxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoY3VycmVudC5wb3NbMF0gPT09IDAgJiYgY3VycmVudC5wb3NbMV0gPT09IDApIHRoaXMuYWxpZ25tZW50cy5wdXNoKHsgc2VxdWVuY2UxOiBjdXJyZW50LnNlcTEsXG4gICAgICAgICAgICAgICAgICAgIHNlcXVlbmNlMjogY3VycmVudC5zZXEyXG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICBpblByb2Nlc3NBbGlnbm1lbnRzLnNoaWZ0KCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiB0aGlzLmFsaWdubWVudHM7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBIZWxwZXIgRnVuY3Rpb25zXG5cbiAgICB9LCB7XG4gICAgICAgIGtleTogXCJnZXRBbGxJbmRleGVzXCIsXG4gICAgICAgIHZhbHVlOiBmdW5jdGlvbiBnZXRBbGxJbmRleGVzKGFyciwgdmFsKSB7XG4gICAgICAgICAgICB2YXIgaW5kZXhlcyA9IFtdLFxuICAgICAgICAgICAgICAgIGkgPSAtMTtcbiAgICAgICAgICAgIHdoaWxlICgoaSA9IGFyci5pbmRleE9mKHZhbCwgaSArIDEpKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBpbmRleGVzLnB1c2goaSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gaW5kZXhlcztcbiAgICAgICAgfVxuICAgIH0sIHtcbiAgICAgICAga2V5OiBcImFycmF5QWxsTWF4SW5kZXhlc1wiLFxuICAgICAgICB2YWx1ZTogZnVuY3Rpb24gYXJyYXlBbGxNYXhJbmRleGVzKGFycmF5KSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5nZXRBbGxJbmRleGVzKGFycmF5LCBNYXRoLm1heC5hcHBseShudWxsLCBhcnJheSkpO1xuICAgICAgICB9XG4gICAgfV0pO1xuXG4gICAgcmV0dXJuIE5lZWRsZW1hbld1bnNjaDtcbn0oKTtcblxubW9kd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IHRoaXMubGlzdGVuZXJzID0gW107XG59XG5cbnZhciBwID0gRW1pdHRlci5wcm90b3R5cGU7XG5cbnAuYWRkTGlzdGVuZXIgPSBmdW5jdGlvbiAoZXZlbnQsIGNhbGxiYWNrKSB7XG4gIHRoaXMubGlzdGVuZXJzLnB1c2goe1xuICAgIGV2ZW50OiBldmVudCxcbiAgICBjYWxsYmFjazogY2FsbGJhY2tcbiAgfSk7XG59O1xuXG5wLnJlbW92ZUxpc3RlbmVyID0gZnVuY3Rpb24gKGV2ZW50LCBjYWxsYmFjaykge1xuICBmb3IgKHZhciBpID0gdGhpcy5saXN0ZW5lcnMubGVuZ3RoOyBpID49IDA7IGktLSkge1xuICAgIHZhciBsID0gdGhpcy5saXN0ZW5lcnNbaV07XG5cbiAgICBpZiAobC5ldmVudCA9PT0gZXZlbnQgJiYgbC5jYWxsYmFjayA9PT0gY2FsbGJhY2spIHtcbiAgICAgIHRoaXMubGlzdGVuZXJzLnNwbGljZShpLCAxKTtcbiAgICB9XG4gIH1cbn07XG5cbnAuZW1pdCA9IGZ1bmN0aW9uIChldmVudCwgZGF0YSkge1xuICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXMubGlzdGVuZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgdmFyIGwgPSB0aGlzLmxpc3RlbmVyc1tpXTtcblxuICAgIGlmIChldmVudCA9PT0gbC5ldmVudCkge1xuICAgICAgbC5jYWxsYmFjayhkYXRhKTtcbiAgICB9XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gRW1pdHRlcjtcblxuLyoqKi8gfSlcbi8qKioqKiovIF0pO1xufSk7Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/layout-base/layout-base.js\n"); /***/ }), /***/ "./node_modules/lodash.debounce/index.js": /*!***********************************************!*\ !*** ./node_modules/lodash.debounce/index.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2guZGVib3VuY2UvaW5kZXguanM/ZjdmZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVB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Anc3RyaW5nJykge1xuICAgIHJldHVybiB2YWx1ZSA9PT0gMCA/IHZhbHVlIDogK3ZhbHVlO1xuICB9XG4gIHZhbHVlID0gdmFsdWUucmVwbGFjZShyZVRyaW0sICcnKTtcbiAgdmFyIGlzQmluYXJ5ID0gcmVJc0JpbmFyeS50ZXN0KHZhbHVlKTtcbiAgcmV0dXJuIChpc0JpbmFyeSB8fCByZUlzT2N0YWwudGVzdCh2YWx1ZSkpXG4gICAgPyBmcmVlUGFyc2VJbnQodmFsdWUuc2xpY2UoMiksIGlzQmluYXJ5ID8gMiA6IDgpXG4gICAgOiAocmVJc0JhZEhleC50ZXN0KHZhbHVlKSA/IE5BTiA6ICt2YWx1ZSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gZGVib3VuY2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash.debounce/index.js\n"); /***/ }), /***/ "./node_modules/lodash/_DataView.js": /*!******************************************!*\ !*** ./node_modules/lodash/_DataView.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getNative = __webpack_require__(/*! ./_getNative */ \"./node_modules/lodash/_getNative.js\"),\n root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX0RhdGFWaWV3LmpzP2I1YTciXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQWdCLG1CQUFPLENBQUMseURBQWM7QUFDdEMsV0FBVyxtQkFBTyxDQUFDLCtDQUFTOztBQUU1QjtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fRGF0YVZpZXcuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0TmF0aXZlID0gcmVxdWlyZSgnLi9fZ2V0TmF0aXZlJyksXG4gICAgcm9vdCA9IHJlcXVpcmUoJy4vX3Jvb3QnKTtcblxuLyogQnVpbHQtaW4gbWV0aG9kIHJlZmVyZW5jZXMgdGhhdCBhcmUgdmVyaWZpZWQgdG8gYmUgbmF0aXZlLiAqL1xudmFyIERhdGFWaWV3ID0gZ2V0TmF0aXZlKHJvb3QsICdEYXRhVmlldycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IERhdGFWaWV3O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_DataView.js\n"); /***/ }), /***/ "./node_modules/lodash/_Hash.js": /*!**************************************!*\ !*** ./node_modules/lodash/_Hash.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var hashClear = __webpack_require__(/*! ./_hashClear */ \"./node_modules/lodash/_hashClear.js\"),\n hashDelete = __webpack_require__(/*! ./_hashDelete */ \"./node_modules/lodash/_hashDelete.js\"),\n hashGet = __webpack_require__(/*! ./_hashGet */ \"./node_modules/lodash/_hashGet.js\"),\n hashHas = __webpack_require__(/*! ./_hashHas */ \"./node_modules/lodash/_hashHas.js\"),\n hashSet = __webpack_require__(/*! ./_hashSet */ \"./node_modules/lodash/_hashSet.js\");\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.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tleS12YWx1ZSBwYWlycyB0byBjYWNoZS5cbiAqL1xuZnVuY3Rpb24gSGFzaChlbnRyaWVzKSB7XG4gIHZhciBpbmRleCA9IC0xLFxuICAgICAgbGVuZ3RoID0gZW50cmllcyA9PSBudWxsID8gMCA6IGVudHJpZXMubGVuZ3RoO1xuXG4gIHRoaXMuY2xlYXIoKTtcbiAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICB2YXIgZW50cnkgPSBlbnRyaWVzW2luZGV4XTtcbiAgICB0aGlzLnNldChlbnRyeVswXSwgZW50cnlbMV0pO1xuICB9XG59XG5cbi8vIEFkZCBtZXRob2RzIHRvIGBIYXNoYC5cbkhhc2gucHJvdG90eXBlLmNsZWFyID0gaGFzaENsZWFyO1xuSGFzaC5wcm90b3R5cGVbJ2RlbGV0ZSddID0gaGFzaERlbGV0ZTtcbkhhc2gucHJvdG90eXBlLmdldCA9IGhhc2hHZXQ7XG5IYXNoLnByb3RvdHlwZS5oYXMgPSBoYXNoSGFzO1xuSGFzaC5wcm90b3R5cGUuc2V0ID0gaGFzaFNldDtcblxubW9kdWxlLmV4cG9ydHMgPSBIYXNoO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_Hash.js\n"); /***/ }), /***/ "./node_modules/lodash/_ListCache.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_ListCache.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var listCacheClear = __webpack_require__(/*! ./_listCacheClear */ \"./node_modules/lodash/_listCacheClear.js\"),\n listCacheDelete = __webpack_require__(/*! ./_listCacheDelete */ \"./node_modules/lodash/_listCacheDelete.js\"),\n listCacheGet = __webpack_require__(/*! ./_listCacheGet */ \"./node_modules/lodash/_listCacheGet.js\"),\n listCacheHas = __webpack_require__(/*! ./_listCacheHas */ \"./node_modules/lodash/_listCacheHas.js\"),\n listCacheSet = __webpack_require__(/*! ./_listCacheSet */ \"./node_modules/lodash/_listCacheSet.js\");\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX0xpc3RDYWNoZS5qcz81ZTJlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHFCQUFxQixtQkFBTyxDQUFDLG1FQUFtQjtBQUNoRCxzQkFBc0IsbUJBQU8sQ0FBQyxxRUFBb0I7QUFDbEQsbUJBQW1CLG1CQUFPLENBQUMsK0RBQWlCO0FBQzVDLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjtBQUM1QyxtQkFBbUIsbUJBQU8sQ0FBQywrREFBaUI7O0FBRTVDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE1BQU07QUFDakI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX0xpc3RDYWNoZS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBsaXN0Q2FjaGVDbGVhciA9IHJlcXVpcmUoJy4vX2xpc3RDY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ldCA9IGxpc3RDYWNoZVNldDtcblxubW9kdWxlLmV4cG9ydHMgPSBMaXN0Q2FjaGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_ListCache.js\n"); /***/ }), /***/ "./node_modules/lodash/_Map.js": /*!*************************************!*\ !*** ./node_modules/lodash/_Map.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getNative = __webpack_require__(/*! ./_getNative */ \"./node_modules/lodash/_getNative.js\"),\n root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX01hcC5qcz83OWJjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGdCQUFnQixtQkFBTyxDQUFDLHlEQUFjO0FBQ3RDLFdBQVcsbUJBQU8sQ0FBQywrQ0FBUzs7QUFFNUI7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX01hcC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBnZXROYXRpdmUgPSByZXF1aXJlKCcuL19nZXROYXRpdmUnKSxcbiAgICByb290ID0gcmVxdWlyZSgnLi9fcm9vdCcpO1xuXG4vKiBCdWlsdC1pbiBtZXRob2QgcmVmZXJlbmNlcyB0aGF0IGFyZSB2ZXJpZmllZCB0byBiZSBuYXRpdmUuICovXG52YXIgTWFwID0gZ2V0TmF0aXZlKHJvb3QsICdNYXAnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBNYXA7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_Map.js\n"); /***/ }), /***/ "./node_modules/lodash/_MapCache.js": /*!******************************************!*\ !*** ./node_modules/lodash/_MapCache.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var mapCacheClear = __webpack_require__(/*! ./_mapCacheClear */ \"./node_modules/lodash/_mapCacheClear.js\"),\n mapCacheDelete = __webpack_require__(/*! ./_mapCacheDelete */ \"./node_modules/lodash/_mapCacheDelete.js\"),\n mapCacheGet = __webpack_require__(/*! ./_mapCacheGet */ \"./node_modules/lodash/_mapCacheGet.js\"),\n mapCacheHas = __webpack_require__(/*! ./_mapCacheHas */ \"./node_modules/lodash/_mapCacheHas.js\"),\n mapCacheSet = __webpack_require__(/*! ./_mapCacheSet */ \"./node_modules/lodash/_mapCacheSet.js\");\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX01hcENhY2hlLmpzPzdiODMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0JBQW9CLG1CQUFPLENBQUMsaUVBQWtCO0FBQzlDLHFCQUFxQixtQkFBTyxDQUFDLG1FQUFtQjtBQUNoRCxrQkFBa0IsbUJBQU8sQ0FBQy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gd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICB2YXIgZW50cnkgPSBlbnRyaWVzW2luZGV4XTtcbiAgICB0aGlzLnNldChlbnRyeVswXSwgZW50cnlbMV0pO1xuICB9XG59XG5cbi8vIEFkZCBtZXRob2RzIHRvIGBNYXBDYWNoZWAuXG5NYXBDYWNoZS5wcm90b3R5cGUuY2xlYXIgPSBtYXBDYWNoZUNsZWFyO1xuTWFwQ2FjaGUucHJvdG90eXBlWydkZWxldGUnXSA9IG1hcENhY2hlRGVsZXRlO1xuTWFwQ2FjaGUucHJvdG90eXBlLmdldCA9IG1hcENhY2hlR2V0O1xuTWFwQ2FjaGUucHJvdG90eXBlLmhhcyA9IG1hcENhY2hlSGFzO1xuTWFwQ2FjaGUucHJvdG90eXBlLnNldCA9IG1hcENhY2hlU2V0O1xuXG5tb2R1bGUuZXhwb3J0cyA9IE1hcENhY2hlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_MapCache.js\n"); /***/ }), /***/ "./node_modules/lodash/_Promise.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_Promise.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getNative = __webpack_require__(/*! ./_getNative */ \"./node_modules/lodash/_getNative.js\"),\n root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX1Byb21pc2UuanM/MWNlYyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxXQUFXLG1CQUFPLENBQUMsK0NBQVM7O0FBRTVCO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19Qcm9taXNlLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGdldE5hdGl2ZSA9IHJlcXVpcmUoJy4vX2dldE5hdGl2ZScpLFxuICAgIHJvb3QgPSByZXF1aXJlKCcuL19yb290Jyk7XG5cbi8qIEJ1aWx0LWluIG1ldGhvZCByZWZlcmVuY2VzIHRoYXQgYXJlIHZlcmlmaWVkIHRvIGJlIG5hdGl2ZS4gKi9cbnZhciBQcm9taXNlID0gZ2V0TmF0aXZlKHJvb3QsICdQcm9taXNlJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gUHJvbWlzZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_Promise.js\n"); /***/ }), /***/ "./node_modules/lodash/_Set.js": /*!*************************************!*\ !*** ./node_modules/lodash/_Set.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getNative = __webpack_require__(/*! ./_getNative */ \"./node_modules/lodash/_getNative.js\"),\n root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX1NldC5qcz9jODY5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGdCQUFnQixtQkFBTyxDQUFDLHlEQUFjO0FBQ3RDLFdBQVcsbUJBQU8sQ0FBQywrQ0FBUzs7QUFFNUI7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX1NldC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBnZXROYXRpdmUgPSByZXF1aXJlKCcuL19nZXROYXRpdmUnKSxcbiAgICByb290ID0gcmVxdWlyZSgnLi9fcm9vdCcpO1xuXG4vKiBCdWlsdC1pbiBtZXRob2QgcmVmZXJlbmNlcyB0aGF0IGFyZSB2ZXJpZmllZCB0byBiZSBuYXRpdmUuICovXG52YXIgU2V0ID0gZ2V0TmF0aXZlKHJvb3QsICdTZXQnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBTZXQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_Set.js\n"); /***/ }), /***/ "./node_modules/lodash/_SetCache.js": /*!******************************************!*\ !*** ./node_modules/lodash/_SetCache.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var MapCache = __webpack_require__(/*! ./_MapCache */ \"./node_modules/lodash/_MapCache.js\"),\n setCacheAdd = __webpack_require__(/*! ./_setCacheAdd */ \"./node_modules/lodash/_setCacheAdd.js\"),\n setCacheHas = __webpack_require__(/*! ./_setCacheHas */ \"./node_modules/lodash/_setCacheHas.js\");\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX1NldENhY2hlLmpzP2Q2MTIiX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4vLyBBZGQgbWV0aG9kcyB0byBgU2V0Q2FjaGVgLlxuU2V0Q2FjaGUucHJvdG90eXBlLmFkZCA9IFNldENhY2hlLnByb3RvdHlwZS5wdXNoID0gc2V0Q2FjaGVBZGQ7XG5TZXRDYWNoZS5wcm90b3R5cGUuaGFzID0gc2V0Q2FjaGVIYXM7XG5cbm1vZHVsZS5leHBvcnRzID0gU2V0Q2FjaGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_SetCache.js\n"); /***/ }), /***/ "./node_modules/lodash/_Stack.js": /*!***************************************!*\ !*** ./node_modules/lodash/_Stack.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var ListCache = __webpack_require__(/*! ./_ListCache */ \"./node_modules/lodash/_ListCache.js\"),\n stackClear = __webpack_require__(/*! ./_stackClear */ \"./node_modules/lodash/_stackClear.js\"),\n stackDelete = __webpack_require__(/*! ./_stackDelete */ \"./node_modules/lodash/_stackDelete.js\"),\n stackGet = __webpack_require__(/*! ./_stackGet */ \"./node_modules/lodash/_stackGet.js\"),\n stackHas = __webpack_require__(/*! ./_stackHas */ \"./node_modules/lodash/_stackHas.js\"),\n stackSet = __webpack_require__(/*! ./_stackSet */ \"./node_modules/lodash/_stackSet.js\");\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZ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GFpcnMgdG8gY2FjaGUuXG4gKi9cbmZ1bmN0aW9uIFN0YWNrKGVudHJpZXMpIHtcbiAgdmFyIGRhdGEgPSB0aGlzLl9fZGF0YV9fID0gbmV3IExpc3RDYWNoZShlbnRyaWVzKTtcbiAgdGhpcy5zaXplID0gZGF0YS5zaXplO1xufVxuXG4vLyBBZGQgbWV0aG9kcyB0byBgU3RhY2tgLlxuU3RhY2sucHJvdG90eXBlLmNsZWFyID0gc3RhY2tDbGVhcjtcblN0YWNrLnByb3RvdHlwZVsnZGVsZXRlJ10gPSBzdGFja0RlbGV0ZTtcblN0YWNrLnByb3RvdHlwZS5nZXQgPSBzdGFja0dldDtcblN0YWNrLnByb3RvdHlwZS5oYXMgPSBzdGFja0hhcztcblN0YWNrLnByb3RvdHlwZS5zZXQgPSBzdGFja1NldDtcblxubW9kdWxlLmV4cG9ydHMgPSBTdGFjaztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_Stack.js\n"); /***/ }), /***/ "./node_modules/lodash/_Symbol.js": /*!****************************************!*\ !*** ./node_modules/lodash/_Symbol.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX1N5bWJvbC5qcz85ZTY5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFdBQVcsbUJBQU8sQ0FBQywrQ0FBUzs7QUFFNUI7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX1N5bWJvbC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciByb290ID0gcmVxdWlyZSgnLi9fcm9vdCcpO1xuXG4vKiogQnVpbHQtaW4gdmFsdWUgcmVmZXJlbmNlcy4gKi9cbnZhciBTeW1ib2wgPSByb290LlN5bWJvbDtcblxubW9kdWxlLmV4cG9ydHMgPSBTeW1ib2w7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_Symbol.js\n"); /***/ }), /***/ "./node_modules/lodash/_Uint8Array.js": /*!********************************************!*\ !*** ./node_modules/lodash/_Uint8Array.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX1VpbnQ4QXJyYXkuanM/MjQ3NCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXLG1CQUFPLENBQUMsK0NBQVM7O0FBRTVCO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19VaW50OEFycmF5LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIHJvb3QgPSByZXF1aXJlKCcuL19yb290Jyk7XG5cbi8qKiBCdWlsdC1pbiB2YWx1ZSByZWZlcmVuY2VzLiAqL1xudmFyIFVpbnQ4QXJyYXkgPSByb290LlVpbnQ4QXJyYXk7XG5cbm1vZHVsZS5leHBvcnRzID0gVWludDhBcnJheTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_Uint8Array.js\n"); /***/ }), /***/ "./node_modules/lodash/_WeakMap.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_WeakMap.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getNative = __webpack_require__(/*! ./_getNative */ \"./node_modules/lodash/_getNative.js\"),\n root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX1dlYWtNYXAuanM/MzlmZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxXQUFXLG1CQUFPLENBQUMsK0NBQVM7O0FBRTVCO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19XZWFrTWFwLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGdldE5hdGl2ZSA9IHJlcXVpcmUoJy4vX2dldE5hdGl2ZScpLFxuICAgIHJvb3QgPSByZXF1aXJlKCcuL19yb290Jyk7XG5cbi8qIEJ1aWx0LWluIG1ldGhvZCByZWZlcmVuY2VzIHRoYXQgYXJlIHZlcmlmaWVkIHRvIGJlIG5hdGl2ZS4gKi9cbnZhciBXZWFrTWFwID0gZ2V0TmF0aXZlKHJvb3QsICdXZWFrTWFwJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gV2Vha01hcDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_WeakMap.js\n"); /***/ }), /***/ "./node_modules/lodash/_apply.js": /*!***************************************!*\ !*** ./node_modules/lodash/_apply.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FwcGx5LmpzPzg1ZTMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsU0FBUztBQUNwQixXQUFXLEVBQUU7QUFDYixXQUFXLE1BQU07QUFDakIsYUFBYSxFQUFFO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19hcHBseS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQSBmYXN0ZXIgYWx0ZXJuYXRpdmUgdG8gYEZ1bmN0aW9uI2FwcGx5YCwgdGhpcyBmdW5jdGlvbiBpbnZva2VzIGBmdW5jYFxuICogd2l0aCB0aGUgYHRoaXNgIGJpbmRpbmcgb2YgYHRoaXNBcmdgIGFuZCB0aGUgYXJndW1lbnRzIG9mIGBhcmdzYC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtGdW5jdGlvbn0gZnVuYyBUaGUgZnVuY3Rpb24gdG8gaW52b2tlLlxuICogQHBhcmFtIHsqfSB0aGlzQXJnIFRoZSBgdGhpc2AgYmluZGluZyBvZiBgZnVuY2AuXG4gKiBAcGFyYW0ge0FycmF5fSBhcmdzIFRoZSBhcmd1bWVudHMgdG8gaW52b2tlIGBmdW5jYCB3aXRoLlxuICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIHJlc3VsdCBvZiBgZnVuY2AuXG4gKi9cbmZ1bmN0aW9uIGFwcGx5KGZ1bmMsIHRoaXNBcmcsIGFyZ3MpIHtcbiAgc3dpdGNoIChhcmdzLmxlbmd0aCkge1xuICAgIGNhc2UgMDogcmV0dXJuIGZ1bmMuY2FsbCh0aGlzQXJnKTtcbiAgICBjYXNlIDE6IHJldHVybiBmdW5jLmNhbGwodGhpc0FyZywgYXJnc1swXSk7XG4gICAgY2FzZSAyOiByZXR1cm4gZnVuYy5jYWxsKHRoaXNBcmcsIGFyZ3NbMF0sIGFyZ3NbMV0pO1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmMuY2FsbCh0aGlzQXJnLCBhcmdzWzBdLCBhcmdzWzFdLCBhcmdzWzJdKTtcbiAgfVxuICByZXR1cm4gZnVuYy5hcHBseSh0aGlzQXJnLCBhcmdzKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBhcHBseTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_apply.js\n"); /***/ }), /***/ "./node_modules/lodash/_arrayEach.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_arrayEach.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5RWFjaC5qcz84MDU3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE1BQU07QUFDakIsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsTUFBTTtBQUNuQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5RWFjaC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQSBzcGVjaWFsaXplZCB2ZXJzaW9uIG9mIGBfLmZvckVhY2hgIGZvciBhcnJheXMgd2l0aG91dCBzdXBwb3J0IGZvclxuICogaXRlcmF0ZWUgc2hvcnRoYW5kcy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtBcnJheX0gW2FycmF5XSBUaGUgYXJyYXkgdG8gaXRlcmF0ZSBvdmVyLlxuICogQHBhcmFtIHtGdW5jdGlvbn0gaXRlcmF0ZWUgVGhlIGZ1bmN0aW9uIGludm9rZWQgcGVyIGl0ZXJhdGlvbi5cbiAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyBgYXJyYXlgLlxuICovXG5mdW5jdGlvbiBhcnJheUVhY2goYXJyYXksIGl0ZXJhdGVlKSB7XG4gIHZhciBpbmRleCA9IC0xLFxuICAgICAgbGVuZ3RoID0gYXJyYXkgPT0gbnVsbCA/IDAgOiBhcnJheS5sZW5ndGg7XG5cbiAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICBpZiAoaXRlcmF0ZWUoYXJyYXlbaW5kZXhdLCBpbmRleCwgYXJyYXkpID09PSBmYWxzZSkge1xuICAgICAgYnJlYWs7XG4gICAgfVxuICB9XG4gIHJldHVybiBhcnJheTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBhcnJheUVhY2g7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_arrayEach.js\n"); /***/ }), /***/ "./node_modules/lodash/_arrayFilter.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_arrayFilter.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5RmlsdGVyLmpzPzJkN2MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsTUFBTTtBQUNqQixXQUFXLFNBQVM7QUFDcEIsYUFBYSxNQUFNO0FBQ25CO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO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_modules/lodash/_arrayIncludes.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_arrayIncludes.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIndexOf = __webpack_require__(/*! ./_baseIndexOf */ \"./node_modules/lodash/_baseIndexOf.js\");\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5SW5jbHVkZXMuanM/OGRiMyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7O0FBRTFDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE1BQU07QUFDakIsV0FBVyxFQUFFO0FBQ2IsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19hcnJheUluY2x1ZGVzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VJbmRleE9mID0gcmVxdWlyZSgnLi9fYmFzZUluZGV4T2YnKTtcblxuLyoqXG4gKiBBIHNwZWNpYWxpemVkIHZlcnNpb24gb2YgYF8uaW5jbHVkZXNgIGZvciBhcnJheXMgd2l0aG91dCBzdXBwb3J0IGZvclxuICogc3BlY2lmeWluZyBhbiBpbmRleCB0byBzZWFyY2ggZnJvbS5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtBcnJheX0gW2FycmF5XSBUaGUgYXJyYXkgdG8gaW5zcGVjdC5cbiAqIEBwYXJhbSB7Kn0gdGFyZ2V0IFRoZSB2YWx1ZSB0byBzZWFyY2ggZm9yLlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGB0YXJnZXRgIGlzIGZvdW5kLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIGFycmF5SW5jbHVkZXMoYXJyYXksIHZhbHVlKSB7XG4gIHZhciBsZW5ndGggPSBhcnJheSA9PSBudWxsID8gMCA6IGFycmF5Lmxlbmd0aDtcbiAgcmV0dXJuICEhbGVuZ3RoICYmIGJhc2VJbmRleE9mKGFycmF5LCB2YWx1ZSwgMCkgPiAtMTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBhcnJheUluY2x1ZGVzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_arrayIncludes.js\n"); /***/ }), /***/ "./node_modules/lodash/_arrayIncludesWith.js": /*!***************************************************!*\ !*** ./node_modules/lodash/_arrayIncludesWith.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8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ZW5ndGgpIHtcbiAgICBpZiAoY29tcGFyYXRvcih2YWx1ZSwgYXJyYXlbaW5kZXhdKSkge1xuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICB9XG4gIHJldHVybiBmYWxzZTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBhcnJheUluY2x1ZGVzV2l0aDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_arrayIncludesWith.js\n"); /***/ }), /***/ "./node_modules/lodash/_arrayLikeKeys.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_arrayLikeKeys.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseTimes = __webpack_require__(/*! ./_baseTimes */ \"./node_modules/lodash/_baseTimes.js\"),\n isArguments = __webpack_require__(/*! ./isArguments */ \"./node_modules/lodash/isArguments.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isBuffer = __webpack_require__(/*! ./isBuffer */ \"./node_modules/lodash/isBuffer.js\"),\n isIndex = __webpack_require__(/*! ./_isIndex */ \"./node_modules/lodash/_isIndex.js\"),\n isTypedArray = __webpack_require__(/*! ./isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5TGlrZUtleXMuanM/NmZjZCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxrQkFBa0IsbUJBQU8sQ0FBQywyREFBZTtBQUN6QyxjQUFjLG1CQUFPLENBQUMsbURBQVc7QUFDakMsZUFBZSxtQkFBTyxDQUFDLHFEQUFZO0FBQ25DLGNBQWMsbUJBQU8sQ0FBQyxxREFBWTtBQUNsQyxtQkFBbUIsbUJBQU8sQ0FBQyw2REFBZ0I7O0FBRTNDO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLFdBQVcsUUFBUTtBQUNuQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZH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gPT0gJ2J1ZmZlcicgfHwga2V5ID09ICdieXRlTGVuZ3RoJyB8fCBrZXkgPT0gJ2J5dGVPZmZzZXQnKSkgfHxcbiAgICAgICAgICAgLy8gU2tpcCBpbmRleCBwcm9wZXJ0aWVzLlxuICAgICAgICAgICBpc0luZGV4KGtleSwgbGVuZ3RoKVxuICAgICAgICApKSkge1xuICAgICAgcmVzdWx0LnB1c2goa2V5KTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBhcnJheUxpa2VLZXlzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_arrayLikeKeys.js\n"); /***/ }), /***/ "./node_modules/lodash/_arrayMap.js": /*!******************************************!*\ !*** ./node_modules/lodash/_arrayMap.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5TWFwLmpzPzc5NDgiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsTUFBTTtBQUNqQixXQUFXLFNBQVM7QUFDcEIsYUFBYSxNQUFNO0FBQ25CO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5TWFwLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBBIHNwZWNpYWxpemVkIHZlcnNpb24gb2YgYF8ubWFwYCBmb3IgYXJyYXlzIHdpdGhvdXQgc3VwcG9ydCBmb3IgaXRlcmF0ZWVcbiAqIHNob3J0aGFuZHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7QXJyYXl9IFthcnJheV0gVGhlIGFycmF5IHRvIGl0ZXJhdGUgb3Zlci5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGl0ZXJhdGVlIFRoZSBmdW5jdGlvbiBpbnZva2VkIHBlciBpdGVyYXRpb24uXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG5ldyBtYXBwZWQgYXJyYXkuXG4gKi9cbmZ1bmN0aW9uIGFycmF5TWFwKGFycmF5LCBpdGVyYXRlZSkge1xuICB2YXIgaW5kZXggPSAtMSxcbiAgICAgIGxlbmd0aCA9IGFycmF5ID09IG51bGwgPyAwIDogYXJyYXkubGVuZ3RoLFxuICAgICAgcmVzdWx0ID0gQXJyYXkobGVuZ3RoKTtcblxuICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgIHJlc3VsdFtpbmRleF0gPSBpdGVyYXRlZShhcnJheVtpbmRleF0sIGluZGV4LCBhcnJheSk7XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBhcnJheU1hcDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_arrayMap.js\n"); /***/ }), /***/ "./node_modules/lodash/_arrayPush.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_arrayPush.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5UHVzaC5qcz8wODdkIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxNQUFNO0FBQ2pCLFdBQVcsTUFBTTtBQUNqQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fYXJyYXlQdXNoLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBBcHBlbmRzIHRoZSBlbGVtZW50cyBvZiBgdmFsdWVzYCB0byBgYXJyYXlgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5fSBhcnJheSBUaGUgYXJyYXkgdG8gbW9kaWZ5LlxuICogQHBhcmFtIHtBcnJheX0gdmFsdWVzIFRoZSB2YWx1ZXMgdG8gYXBwZW5kLlxuICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gKi9cbmZ1bmN0aW9uIGFycmF5UHVzaChhcnJheSwgdmFsdWVzKSB7XG4gIHZhciBpbmRleCA9IC0xLFxuICAgICAgbGVuZ3RoID0gdmFsdWVzLmxlbmd0aCxcbiAgICAgIG9mZnNldCA9IGFycmF5Lmxlbmd0aDtcblxuICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgIGFycmF5W29mZnNldCArIGluZGV4XSA9IHZhbHVlc1tpbmRleF07XG4gIH1cbiAgcmV0dXJuIGFycmF5O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGFycmF5UHVzaDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_arrayPush.js\n"); /***/ }), /***/ "./node_modules/lodash/_arrayReduce.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_arrayReduce.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5UmVkdWNlLmpzPzZhYzAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsTUFBTTtBQUNqQixXQUFXLFNBQVM7QUFDcEIsV0FBVyxFQUFFO0FBQ2IsV0FBVyxRQUFRO0FBQ25CO0FBQ0EsYUFBYSxFQUFFO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5UmVkdWNlLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBBIHNwZWNpYWxpemVkIHZlcnNpb24gb2YgYF8ucmVkdWNlYCBmb3IgYXJyYXlzIHdpdGhvdXQgc3VwcG9ydCBmb3JcbiAqIGl0ZXJhdGVlIHNob3J0aGFuZHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7QXJyYXl9IFthcnJheV0gVGhlIGFycmF5IHRvIGl0ZXJhdGUgb3Zlci5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGl0ZXJhdGVlIFRoZSBmdW5jdGlvbiBpbnZva2VkIHBlciBpdGVyYXRpb24uXG4gKiBAcGFyYW0geyp9IFthY2N1bXVsYXRvcl0gVGhlIGluaXRpYWwgdmFsdWUuXG4gKiBAcGFyYW0ge2Jvb2xlYW59IFtpbml0QWNjdW1dIFNwZWNpZnkgdXNpbmcgdGhlIGZpcnN0IGVsZW1lbnQgb2YgYGFycmF5YCBhc1xuICogIHRoZSBpbml0aWFsIHZhbHVlLlxuICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIGFjY3VtdWxhdGVkIHZhbHVlLlxuICovXG5mdW5jdGlvbiBhcnJheVJlZHVjZShhcnJheSwgaXRlcmF0ZWUsIGFjY3VtdWxhdG9yLCBpbml0QWNjdW0pIHtcbiAgdmFyIGluZGV4ID0gLTEsXG4gICAgICBsZW5ndGggPSBhcnJheSA9PSBudWxsID8gMCA6IGFycmF5Lmxlbmd0aDtcblxuICBpZiAoaW5pdEFjY3VtICYmIGxlbmd0aCkge1xuICAgIGFjY3VtdWxhdG9yID0gYXJyYXlbKytpbmRleF07XG4gIH1cbiAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICBhY2N1bXVsYXRvciA9IGl0ZXJhdGVlKGFjY3VtdWxhdG9yLCBhcnJheVtpbmRleF0sIGluZGV4LCBhcnJheSk7XG4gIH1cbiAgcmV0dXJuIGFjY3VtdWxhdG9yO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGFycmF5UmVkdWNlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_arrayReduce.js\n"); /***/ }), /***/ "./node_modules/lodash/_arraySome.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_arraySome.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FycmF5U29tZS5qcz80Mjg0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE1BQU07QUFDakIsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fYXJyYXlTb21lLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBBIHNwZWNpYWxpemVkIHZlcnNpb24gb2YgYF8uc29tZWAgZm9yIGFycmF5cyB3aXRob3V0IHN1cHBvcnQgZm9yIGl0ZXJhdGVlXG4gKiBzaG9ydGhhbmRzLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5fSBbYXJyYXldIFRoZSBhcnJheSB0byBpdGVyYXRlIG92ZXIuXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBwcmVkaWNhdGUgVGhlIGZ1bmN0aW9uIGludm9rZWQgcGVyIGl0ZXJhdGlvbi5cbiAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBhbnkgZWxlbWVudCBwYXNzZXMgdGhlIHByZWRpY2F0ZSBjaGVjayxcbiAqICBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIGFycmF5U29tZShhcnJheSwgcHJlZGljYXRlKSB7XG4gIHZhciBpbmRleCA9IC0xLFxuICAgICAgbGVuZ3RoID0gYXJyYXkgPT0gbnVsbCA/IDAgOiBhcnJheS5sZW5ndGg7XG5cbiAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICBpZiAocHJlZGljYXRlKGFycmF5W2luZGV4XSwgaW5kZXgsIGFycmF5KSkge1xuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICB9XG4gIHJldHVybiBmYWxzZTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBhcnJheVNvbWU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_arraySome.js\n"); /***/ }), /***/ "./node_modules/lodash/_asciiSize.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_asciiSize.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseProperty = __webpack_require__(/*! ./_baseProperty */ \"./node_modules/lodash/_baseProperty.js\");\n\n/**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nvar asciiSize = baseProperty('length');\n\nmodule.exports = asciiSize;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2FzY2lpU2l6ZS5qcz9jOWNhIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjs7QUFFNUM7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19hc2NpaVNpemUuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYmFzZVByb3BlcnR5ID0gcmVxdWlyZSgnLi9fYmFzZVByb3BlcnR5Jyk7XG5cbi8qKlxuICogR2V0cyB0aGUgc2l6ZSBvZiBhbiBBU0NJSSBgc3RyaW5nYC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtzdHJpbmd9IHN0cmluZyBUaGUgc3RyaW5nIGluc3BlY3QuXG4gKiBAcmV0dXJucyB7bnVtYmVyfSBSZXR1cm5zIHRoZSBzdHJpbmcgc2l6ZS5cbiAqL1xudmFyIGFzY2lpU2l6ZSA9IGJhc2VQcm9wZXJ0eSgnbGVuZ3RoJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gYXNjaWlTaXplO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_asciiSize.js\n"); /***/ }), /***/ "./node_modules/lodash/_assignMergeValue.js": /*!**************************************************!*\ !*** ./node_modules/lodash/_assignMergeValue.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ \"./node_modules/lodash/_baseAssignValue.js\"),\n eq = __webpack_require__(/*! ./eq */ \"./node_modules/lodash/eq.js\");\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlY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FtrZXldLCB2YWx1ZSkpIHx8XG4gICAgICAodmFsdWUgPT09IHVuZGVmaW5lZCAmJiAhKGtleSBpbiBvYmplY3QpKSkge1xuICAgIGJhc2VBc3NpZ25WYWx1ZShvYmplY3QsIGtleSwgdmFsdWUpO1xuICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYXNzaWduTWVyZ2VWYWx1ZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_assignMergeValue.js\n"); /***/ }), /***/ "./node_modules/lodash/_assignValue.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_assignValue.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ \"./node_modules/lodash/_baseAssignValue.js\"),\n eq = __webpack_require__(/*! ./eq */ \"./node_modules/lodash/eq.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Fzc2lnblZhbHVlLmpzPzMyYjMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsc0J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0byBtb2RpZnkuXG4gKiBAcGFyYW0ge3N0cmluZ30ga2V5IFRoZSBrZXkgb2YgdGhlIHByb3BlcnR5IHRvIGFzc2lnbi5cbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGFzc2lnbi5cbiAqL1xuZnVuY3Rpb24gYXNzaWduVmFsdWUob2JqZWN0LCBrZXksIHZhbHVlKSB7XG4gIHZhciBvYmpWYWx1ZSA9IG9iamVjdFtrZXldO1xuICBpZiAoIShoYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSAmJiBlcShvYmpWYWx1ZSwgdmFsdWUpKSB8fFxuICAgICAgKHZhbHVlID09PSB1bmRlZmluZWQgJiYgIShrZXkgaW4gb2JqZWN0KSkpIHtcbiAgICBiYXNlQXNzaWduVmFsdWUob2JqZWN0LCBrZXksIHZhbHVlKTtcbiAgfVxufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGFzc2lnblZhbHVlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_assignValue.js\n"); /***/ }), /***/ "./node_modules/lodash/_assocIndexOf.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_assocIndexOf.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var eq = __webpack_require__(/*! ./eq */ \"./node_modules/lodash/eq.js\");\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2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c29jSW5kZXhPZjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_assocIndexOf.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseAssign.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseAssign.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var copyObject = __webpack_require__(/*! ./_copyObject */ \"./node_modules/lodash/_copyObject.js\"),\n keys = __webpack_require__(/*! ./keys */ \"./node_modules/lodash/keys.js\");\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VBc3NpZ24uanM/NWIwMSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsbUJBQU8sQ0FBQywyREFBZTtBQUN4QyxXQUFXLG1CQUFPLENBQUMsNkNBQVE7O0FBRTNCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VBc3NpZ24uanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29weU9iamVjdCA9IHJlcXVpcmUoJy4vX2NvcHlPYmplY3QnKSxcbiAgICBrZXlzID0gcmVxdWlyZSgnLi9rZXlzJyk7XG5cbi8qKlxuICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uYXNzaWduYCB3aXRob3V0IHN1cHBvcnQgZm9yIG11bHRpcGxlIHNvdXJjZXNcbiAqIG9yIGBjdXN0b21pemVyYCBmdW5jdGlvbnMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIGRlc3RpbmF0aW9uIG9iamVjdC5cbiAqIEBwYXJhbSB7T2JqZWN0fSBzb3VyY2UgVGhlIHNvdXJjZSBvYmplY3QuXG4gKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIGBvYmplY3RgLlxuICovXG5mdW5jdGlvbiBiYXNlQXNzaWduKG9iamVjdCwgc291cmNlKSB7XG4gIHJldHVybiBvYmplY3QgJiYgY29weU9iamVjdChzb3VyY2UsIGtleXMoc291cmNlKSwgb2JqZWN0KTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlQXNzaWduO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseAssign.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseAssignIn.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_baseAssignIn.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var copyObject = __webpack_require__(/*! ./_copyObject */ \"./node_modules/lodash/_copyObject.js\"),\n keysIn = __webpack_require__(/*! ./keysIn */ \"./node_modules/lodash/keysIn.js\");\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbI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A9IGJhc2VBc3NpZ25JbjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseAssignIn.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseAssignValue.js": /*!*************************************************!*\ !*** ./node_modules/lodash/_baseAssignValue.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var defineProperty = __webpack_require__(/*! ./_defineProperty */ \"./node_modules/lodash/_defineProperty.js\");\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VBc3NpZ25WYWx1ZS5qcz84NzJhIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHFCQUFxQixtQkFBTyxDQUFDLG1FQUFtQjs7QUFFaEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsV0FBVyxFQUFFO0FBQ2I7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTCxHQUFHO0FBQ0g7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fYmFzZUFzc2lnblZhbHVlLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGRlZmluZVByb3BlcnR5ID0gcmVxdWlyZSgnLi9fZGVmaW5lUHJvcGVydHknKTtcblxuLyoqXG4gKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBgYXNzaWduVmFsdWVgIGFuZCBgYXNzaWduTWVyZ2VWYWx1ZWAgd2l0aG91dFxuICogdmFsdWUgY2hlY2tzLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gbW9kaWZ5LlxuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSBwcm9wZXJ0eSB0byBhc3NpZ24uXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBhc3NpZ24uXG4gKi9cbmZ1bmN0aW9uIGJhc2VBc3NpZ25WYWx1ZShvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgaWYgKGtleSA9PSAnX19wcm90b19fJyAmJiBkZWZpbmVQcm9wZXJ0eSkge1xuICAgIGRlZmluZVByb3BlcnR5KG9iamVjdCwga2V5LCB7XG4gICAgICAnY29uZmlndXJhYmxlJzogdHJ1ZSxcbiAgICAgICdlbnVtZXJhYmxlJzogdHJ1ZSxcbiAgICAgICd2YWx1ZSc6IHZhbHVlLFxuICAgICAgJ3dyaXRhYmxlJzogdHJ1ZVxuICAgIH0pO1xuICB9IGVsc2Uge1xuICAgIG9iamVjdFtrZXldID0gdmFsdWU7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlQXNzaWduVmFsdWU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseAssignValue.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseClone.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseClone.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Stack = __webpack_require__(/*! ./_Stack */ \"./node_modules/lodash/_Stack.js\"),\n arrayEach = __webpack_require__(/*! ./_arrayEach */ \"./node_modules/lodash/_arrayEach.js\"),\n assignValue = __webpack_require__(/*! ./_assignValue */ \"./node_modules/lodash/_assignValue.js\"),\n baseAssign = __webpack_require__(/*! ./_baseAssign */ \"./node_modules/lodash/_baseAssign.js\"),\n baseAssignIn = __webpack_require__(/*! ./_baseAssignIn */ \"./node_modules/lodash/_baseAssignIn.js\"),\n cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ \"./node_modules/lodash/_cloneBuffer.js\"),\n copyArray = __webpack_require__(/*! ./_copyArray */ \"./node_modules/lodash/_copyArray.js\"),\n copySymbols = __webpack_require__(/*! ./_copySymbols */ \"./node_modules/lodash/_copySymbols.js\"),\n copySymbolsIn = __webpack_require__(/*! ./_copySymbolsIn */ \"./node_modules/lodash/_copySymbolsIn.js\"),\n getAllKeys = __webpack_require__(/*! ./_getAllKeys */ \"./node_modules/lodash/_getAllKeys.js\"),\n getAllKeysIn = __webpack_require__(/*! ./_getAllKeysIn */ \"./node_modules/lodash/_getAllKeysIn.js\"),\n getTag = __webpack_require__(/*! ./_getTag */ \"./node_modules/lodash/_getTag.js\"),\n initCloneArray = __webpack_require__(/*! ./_initCloneArray */ \"./node_modules/lodash/_initCloneArray.js\"),\n initCloneByTag = __webpack_require__(/*! ./_initCloneByTag */ \"./node_modules/lodash/_initCloneByTag.js\"),\n initCloneObject = __webpack_require__(/*! ./_initCloneObject */ \"./node_modules/lodash/_initCloneObject.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isBuffer = __webpack_require__(/*! ./isBuffer */ \"./node_modules/lodash/isBuffer.js\"),\n isMap = __webpack_require__(/*! ./isMap */ \"./node_modules/lodash/isMap.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\"),\n isSet = __webpack_require__(/*! ./isSet */ \"./node_modules/lodash/isSet.js\"),\n keys = __webpack_require__(/*! ./keys */ \"./node_modules/lodash/keys.js\");\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VDbG9uZS5qcz8zODE4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksbUJBQU8sQ0FBQyxpREFBVTtBQUM5QixnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7QUFDMUMsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7QUFDeEMsbUJBQW1CLG1CQUFPLENBQUMsK0RBQWlCO0FBQzVDLGtCQUFrQixtQkFBTyxDQUFDLDZEQUFnQjtBQUMxQyxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7QUFDMUMsb0JBQW9CLG1CQUFPLENBQUMsaUVBQWtCO0FBQzlDLGlCQUFpQixtQkFBTyxDQUFDLDJEQUFlO0FBQ3hDLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjtBQUM1QyxhQUFhLG1CQUFPLENBQUMsbURBQVc7QUFDaEMscUJBQXFCLG1CQUFPLENBQUMsbUVBQW1CO0FBQ2hELHFCQUFxQixtQkFBTyxDQUFDLG1FQUFtQjtBQUNoRCxzQkFBc0IsbUJBQU8sQ0FBQyxxRUFBb0I7QUFDbEQsY0FBYyxtQkFBTyxDQUFDLG1EQUFXO0FBQ2pDLGVBQWUsbUJBQU8sQ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HJvcHMpIHtcbiAgICAgIGtleSA9IHN1YlZhbHVlO1xuICAgICAgc3ViVmFsdWUgPSB2YWx1ZVtrZXldO1xuICAgIH1cbiAgICAvLyBSZWN1cnNpdmVseSBwb3B1bGF0ZSBjbG9uZSAoc3VzY2VwdGlibGUgdG8gY2FsbCBzdGFjayBsaW1pdHMpLlxuICAgIGFzc2lnblZhbHVlKHJlc3VsdCwga2V5LCBiYXNlQ2xvbmUoc3ViVmFsdWUsIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIGtleSwgdmFsdWUsIHN0YWNrKSk7XG4gIH0pO1xuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VDbG9uZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseClone.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseCreate.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseCreate.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\");\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VDcmVhdGUuanM/NzUzMCJdLCJuYW1lcyI6W10sIm1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q3JlYXRlKHByb3RvKTtcbiAgICB9XG4gICAgb2JqZWN0LnByb3RvdHlwZSA9IHByb3RvO1xuICAgIHZhciByZXN1bHQgPSBuZXcgb2JqZWN0O1xuICAgIG9iamVjdC5wcm90b3R5cGUgPSB1bmRlZmluZWQ7XG4gICAgcmV0dXJuIHJlc3VsdDtcbiAgfTtcbn0oKSk7XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUNyZWF0ZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseCreate.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseEach.js": /*!******************************************!*\ !*** ./node_modules/lodash/_baseEach.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseForOwn = __webpack_require__(/*! ./_baseForOwn */ \"./node_modules/lodash/_baseForOwn.js\"),\n createBaseEach = __webpack_require__(/*! ./_createBaseEach */ \"./node_modules/lodash/_createBaseEach.js\");\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VFYWNoLmpzPzQ4YTAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7QUFDeEMscUJBQXFCLG1CQUFPLENBQUMsbUVBQW1COztBQUVoRDtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsYUFBYTtBQUN4QixXQUFXLFNBQVM7QUFDcEIsYUFBYSxhQUFhO0FBQzFCO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlRWFjaC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlRm9yT3duID0gcmVxdWlyZSgnLi9fYmFzZUZvck93bicpLFxuICAgIGNyZWF0ZUJhc2VFYWNoID0gcmVxdWlyZSgnLi9fY3JlYXRlQmFzZUVhY2gnKTtcblxuLyoqXG4gKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBgXy5mb3JFYWNoYCB3aXRob3V0IHN1cHBvcnQgZm9yIGl0ZXJhdGVlIHNob3J0aGFuZHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7QXJyYXl8T2JqZWN0fSBjb2xsZWN0aW9uIFRoZSBjb2xsZWN0aW9uIHRvIGl0ZXJhdGUgb3Zlci5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGl0ZXJhdGVlIFRoZSBmdW5jdGlvbiBpbnZva2VkIHBlciBpdGVyYXRpb24uXG4gKiBAcmV0dXJucyB7QXJyYXl8T2JqZWN0fSBSZXR1cm5zIGBjb2xsZWN0aW9uYC5cbiAqL1xudmFyIGJhc2VFYWNoID0gY3JlYXRlQmFzZUVhY2goYmFzZUZvck93bik7XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUVhY2g7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseEach.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseExtremum.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_baseExtremum.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSymbol = __webpack_require__(/*! ./isSymbol */ \"./node_modules/lodash/isSymbol.js\");\n\n/**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\nfunction baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseExtremum;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VFeHRyZW11bS5qcz83NmU5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWUsbUJBQU8sQ0FBQyxxREFBWTs7QUFFbkM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsTUFBTTtBQUNqQixXQUFXLFNBQVM7QUFDcEIsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsRUFBRTtBQUNmO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VFeHRyZW11bS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBpc1N5bWJvbCA9IHJlcXVpcmUoJy4vaXNTeW1ib2wnKTtcblxuLyoqXG4gKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBtZXRob2RzIGxpa2UgYF8ubWF4YCBhbmQgYF8ubWluYCB3aGljaCBhY2NlcHRzIGFcbiAqIGBjb21wYXJhdG9yYCB0byBkZXRlcm1pbmUgdGhlIGV4dHJlbXVtIHZhbHVlLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5fSBhcnJheSBUaGUgYXJyYXkgdG8gaXRlcmF0ZSBvdmVyLlxuICogQHBhcmFtIHtGdW5jdGlvbn0gaXRlcmF0ZWUgVGhlIGl0ZXJhdGVlIGludm9rZWQgcGVyIGl0ZXJhdGlvbi5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGNvbXBhcmF0b3IgVGhlIGNvbXBhcmF0b3IgdXNlZCB0byBjb21wYXJlIHZhbHVlcy5cbiAqIEByZXR1cm5zIHsqfSBSZXR1cm5zIHRoZSBleHRyZW11bSB2YWx1ZS5cbiAqL1xuZnVuY3Rpb24gYmFzZUV4dHJlbXVtKGFycmF5LCBpdGVyYXRlZSwgY29tcGFyYXRvcikge1xuICB2YXIgaW5kZXggPSAtMSxcbiAgICAgIGxlbmd0aCA9IGFycmF5Lmxlbmd0aDtcblxuICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgIHZhciB2YWx1ZSA9IGFycmF5W2luZGV4XSxcbiAgICAgICAgY3VycmVudCA9IGl0ZXJhdGVlKHZhbHVlKTtcblxuICAgIGlmIChjdXJyZW50ICE9IG51bGwgJiYgKGNvbXB1dGVkID09PSB1bmRlZmluZWRcbiAgICAgICAgICA/IChjdXJyZW50ID09PSBjdXJyZW50ICYmICFpc1N5bWJvbChjdXJyZW50KSlcbiAgICAgICAgICA6IGNvbXBhcmF0b3IoY3VycmVudCwgY29tcHV0ZWQpXG4gICAgICAgICkpIHtcbiAgICAgIHZhciBjb21wdXRlZCA9IGN1cnJlbnQsXG4gICAgICAgICAgcmVzdWx0ID0gdmFsdWU7XG4gICAgfVxuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUV4dHJlbXVtO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseExtremum.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseFilter.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseFilter.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseEach = __webpack_require__(/*! ./_baseEach */ \"./node_modules/lodash/_baseEach.js\");\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VGaWx0ZXIuanM/OWY3NCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFlLG1CQUFPLENBQUMsdURBQWE7O0FBRXBDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxhQUFhO0FBQ3hCLFdBQVcsU0FBUztBQUNwQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxHQUFHO0FBQ0g7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VGaWx0ZXIuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYmFzZUVhY2ggPSByZXF1aXJlKCcuL19iYXNlRWFjaCcpO1xuXG4vKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmZpbHRlcmAgd2l0aG91dCBzdXBwb3J0IGZvciBpdGVyYXRlZSBzaG9ydGhhbmRzLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5fE9iamVjdH0gY29sbGVjdGlvbiBUaGUgY29sbGVjdGlvbiB0byBpdGVyYXRlIG92ZXIuXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBwcmVkaWNhdGUgVGhlIGZ1bmN0aW9uIGludm9rZWQgcGVyIGl0ZXJhdGlvbi5cbiAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyB0aGUgbmV3IGZpbHRlcmVkIGFycmF5LlxuICovXG5mdW5jdGlvbiBiYXNlRmlsdGVyKGNvbGxlY3Rpb24sIHByZWRpY2F0ZSkge1xuICB2YXIgcmVzdWx0ID0gW107XG4gIGJhc2VFYWNoKGNvbGxlY3Rpb24sIGZ1bmN0aW9uKHZhbHVlLCBpbmRleCwgY29sbGVjdGlvbikge1xuICAgIGlmIChwcmVkaWNhdGUodmFsdWUsIGluZGV4LCBjb2xsZWN0aW9uKSkge1xuICAgICAgcmVzdWx0LnB1c2godmFsdWUpO1xuICAgIH1cbiAgfSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUZpbHRlcjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseFilter.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseFindIndex.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_baseFindIndex.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VGaW5kSW5kZXguanM/MmIwMyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxNQUFNO0FBQ2pCLFdBQVcsU0FBUztBQUNwQixXQUFXLE9BQU87QUFDbEIsV0FBVyxRQUFRO0FBQ25CLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VGaW5kSW5kZXguanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmZpbmRJbmRleGAgYW5kIGBfLmZpbmRMYXN0SW5kZXhgIHdpdGhvdXRcbiAqIHN1cHBvcnQgZm9yIGl0ZXJhdGVlIHNob3J0aGFuZHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBpbnNwZWN0LlxuICogQHBhcmFtIHtGdW5jdGlvbn0gcHJlZGljYXRlIFRoZSBmdW5jdGlvbiBpbnZva2VkIHBlciBpdGVyYXRpb24uXG4gKiBAcGFyYW0ge251bWJlcn0gZnJvbUluZGV4IFRoZSBpbmRleCB0byBzZWFyY2ggZnJvbS5cbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW2Zyb21SaWdodF0gU3BlY2lmeSBpdGVyYXRpbmcgZnJvbSByaWdodCB0byBsZWZ0LlxuICogQHJldHVybnMge251bWJlcn0gUmV0dXJucyB0aGUgaW5kZXggb2YgdGhlIG1hdGNoZWQgdmFsdWUsIGVsc2UgYC0xYC5cbiAqL1xuZnVuY3Rpb24gYmFzZUZpbmRJbmRleChhcnJheSwgcHJlZGljYXRlLCBmcm9tSW5kZXgsIGZyb21SaWdodCkge1xuICB2YXIgbGVuZ3RoID0gYXJyYXkubGVuZ3RoLFxuICAgICAgaW5kZXggPSBmcm9tSW5kZXggKyAoZnJvbVJpZ2h0ID8gMSA6IC0xKTtcblxuICB3aGlsZSAoKGZyb21SaWdodCA/IGluZGV4LS0gOiArK2luZGV4IDwgbGVuZ3RoKSkge1xuICAgIGlmIChwcmVkaWNhdGUoYXJyYXlbaW5kZXhdLCBpbmRleCwgYXJyYXkpKSB7XG4gICAgICByZXR1cm4gaW5kZXg7XG4gICAgfVxuICB9XG4gIHJldHVybiAtMTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlRmluZEluZGV4O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseFindIndex.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseFlatten.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_baseFlatten.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayPush = __webpack_require__(/*! ./_arrayPush */ \"./node_modules/lodash/_arrayPush.js\"),\n isFlattenable = __webpack_require__(/*! ./_isFlattenable */ \"./node_modules/lodash/_isFlattenable.js\");\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VGbGF0dGVuLmpzPzVjNjkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQWdCLG1CQUFPLENBQUMseURBQWM7QUFDdEMsb0JBQW9CLG1CQUFPLENBQUMsaUVBQWtCOztBQUU5QztBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsTUFBTTtBQUNqQixXQUFXLE9BQU87QUFDbEIsV0FBVyxRQUFRO0FBQ25CLFdBQVcsUUFBUTtBQUNuQixXQUFXLE1BQU07QUFDakIsYUFBYSxNQUFNO0FBQ25CO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsT0FBTztBQUNQO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VGbGF0dGVuLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGFycmF5UHVzaCA9IHJlcXVpcmUoJy4vX2FycmF5UHVzaCcpLFxuICAgIGlzRmxhdHRlbmFibGUgPSByZXF1aXJlKCcuL19pc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FsdWUpKSB7XG4gICAgICBpZiAoZGVwdGggPiAxKSB7XG4gICAgICAgIC8vIFJlY3Vyc2l2ZWx5IGZsYXR0ZW4gYXJyYXlzIChzdXNjZXB0aWJsZSB0byBjYWxsIHN0YWNrIGxpbWl0cykuXG4gICAgICAgIGJhc2VGbGF0dGVuKHZhbHVlLCBkZXB0aCAtIDEsIHByZWRpY2F0ZSwgaXNTdHJpY3QsIHJlc3VsdCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBhcnJheVB1c2gocmVzdWx0LCB2YWx1ZSk7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmICghaXNTdHJpY3QpIHtcbiAgICAgIHJlc3VsdFtyZXN1bHQubGVuZ3RoXSA9IHZhbHVlO1xuICAgIH1cbiAgfVxuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VGbGF0dGVuO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseFlatten.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseFor.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_baseFor.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var createBaseFor = __webpack_require__(/*! ./_createBaseFor */ \"./node_modules/lodash/_createBaseFor.js\");\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8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09iamVjdH0gUmV0dXJucyBgb2JqZWN0YC5cbiAqL1xudmFyIGJhc2VGb3IgPSBjcmVhdGVCYXNlRm9yKCk7XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUZvcjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseFor.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseForOwn.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseForOwn.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseFor = __webpack_require__(/*! ./_baseFor */ \"./node_modules/lodash/_baseFor.js\"),\n keys = __webpack_require__(/*! ./keys */ \"./node_modules/lodash/keys.js\");\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VGb3JPd24uanM/MjQyZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFPLENBQUMscURBQVk7QUFDbEMsV0FBVyxtQkFBTyxDQUFDLDZDQUFROztBQUUzQjtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLFNBQVM7QUFDcEIsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fYmFzZUZvck93bi5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlRm9yID0gcmVxdWlyZSgnLi9fYmFzZUZvcicpLFxuICAgIGtleXMgPSByZXF1aXJlKCcuL2tleXMnKTtcblxuLyoqXG4gKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBgXy5mb3JPd25gIHdpdGhvdXQgc3VwcG9ydCBmb3IgaXRlcmF0ZWUgc2hvcnRoYW5kcy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IG9iamVjdCBUaGUgb2JqZWN0IHRvIGl0ZXJhdGUgb3Zlci5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGl0ZXJhdGVlIFRoZSBmdW5jdGlvbiBpbnZva2VkIHBlciBpdGVyYXRpb24uXG4gKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIGBvYmplY3RgLlxuICovXG5mdW5jdGlvbiBiYXNlRm9yT3duKG9iamVjdCwgaXRlcmF0ZWUpIHtcbiAgcmV0dXJuIG9iamVjdCAmJiBiYXNlRm9yKG9iamVjdCwgaXRlcmF0ZWUsIGtleXMpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VGb3JPd247XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseForOwn.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseGet.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_baseGet.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var castPath = __webpack_require__(/*! ./_castPath */ \"./node_modules/lodash/_castPath.js\"),\n toKey = __webpack_require__(/*! ./_toKey */ \"./node_modules/lodash/_toKey.js\");\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VHZXQuanM/NjU2YiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFlLG1CQUFPLENBQUMsdURBQWE7QUFDcEMsWUFBWSxtQkFBTyxDQUFDLGlEQUFVOztBQUU5QjtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLGFBQWE7QUFDeEIsYUFBYSxFQUFFO0FBQ2Y7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VHZXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY2FzdFBhdGggPSByZXF1aXJlKCcuL19jYXN0UGF0aCcpLFxuICAgIHRvS2V5ID0gcmVxdWlyZSgnLi9fdG9LZXknKTtcblxuLyoqXG4gKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBgXy5nZXRgIHdpdGhvdXQgc3VwcG9ydCBmb3IgZGVmYXVsdCB2YWx1ZXMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIG9iamVjdCB0byBxdWVyeS5cbiAqIEBwYXJhbSB7QXJyYXl8c3RyaW5nfSBwYXRoIFRoZSBwYXRoIG9mIHRoZSBwcm9wZXJ0eSB0byBnZXQuXG4gKiBAcmV0dXJucyB7Kn0gUmV0dXJucyB0aGUgcmVzb2x2ZWQgdmFsdWUuXG4gKi9cbmZ1bmN0aW9uIGJhc2VHZXQob2JqZWN0LCBwYXRoKSB7XG4gIHBhdGggPSBjYXN0UGF0aChwYXRoLCBvYmplY3QpO1xuXG4gIHZhciBpbmRleCA9IDAsXG4gICAgICBsZW5ndGggPSBwYXRoLmxlbmd0aDtcblxuICB3aGlsZSAob2JqZWN0ICE9IG51bGwgJiYgaW5kZXggPCBsZW5ndGgpIHtcbiAgICBvYmplY3QgPSBvYmplY3RbdG9LZXkocGF0aFtpbmRleCsrXSldO1xuICB9XG4gIHJldHVybiAoaW5kZXggJiYgaW5kZXggPT0gbGVuZ3RoKSA/IG9iamVjdCA6IHVuZGVmaW5lZDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlR2V0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseGet.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseGetAllKeys.js": /*!************************************************!*\ !*** ./node_modules/lodash/_baseGetAllKeys.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayPush = __webpack_require__(/*! ./_arrayPush */ \"./node_modules/lodash/_arrayPush.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\");\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9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GhlIHN5bWJvbHMgb2YgYG9iamVjdGAuXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIGFycmF5IG9mIHByb3BlcnR5IG5hbWVzIGFuZCBzeW1ib2xzLlxuICovXG5mdW5jdGlvbiBiYXNlR2V0QWxsS2V5cyhvYmplY3QsIGtleXNGdW5jLCBzeW1ib2xzRnVuYykge1xuICB2YXIgcmVzdWx0ID0ga2V5c0Z1bmMob2JqZWN0KTtcbiAgcmV0dXJuIGlzQXJyYXkob2JqZWN0KSA/IHJlc3VsdCA6IGFycmF5UHVzaChyZXN1bHQsIHN5bWJvbHNGdW5jKG9iamVjdCkpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VHZXRBbGxLZXlzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseGetAllKeys.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseGetTag.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseGetTag.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ \"./node_modules/lodash/_getRawTag.js\"),\n objectToString = __webpack_require__(/*! ./_objectToString */ \"./node_modules/lodash/_objectToString.js\");\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n//# sourceURL=[module]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BiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBnZXRUYWdgIHdpdGhvdXQgZmFsbGJhY2tzIGZvciBidWdneSBlbnZpcm9ubWVudHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIHF1ZXJ5LlxuICogQHJldHVybnMge3N0cmluZ30gUmV0dXJucyB0aGUgYHRvU3RyaW5nVGFnYC5cbiAqL1xuZnVuY3Rpb24gYmFzZUdldFRhZyh2YWx1ZSkge1xuICBpZiAodmFsdWUgPT0gbnVsbCkge1xuICAgIHJldHVybiB2YWx1ZSA9PT0gdW5kZWZpbmVkID8gdW5kZWZpbmVkVGFnIDogbnVsbFRhZztcbiAgfVxuICByZXR1cm4gKHN5bVRvU3RyaW5nVGFnICYmIHN5bVRvU3RyaW5nVGFnIGluIE9iamVjdCh2YWx1ZSkpXG4gICAgPyBnZXRSYXdUYWcodmFsdWUpXG4gICAgOiBvYmplY3RUb1N0cmluZyh2YWx1ZSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUdldFRhZztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseGetTag.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseGt.js": /*!****************************************!*\ !*** ./node_modules/lodash/_baseGt.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\nfunction baseGt(value, other) {\n return value > other;\n}\n\nmodule.exports = baseGt;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VHdC5qcz81N2RjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsV0FBVyxFQUFFO0FBQ2IsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlR3QuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmd0YCB3aGljaCBkb2Vzbid0IGNvZXJjZSBhcmd1bWVudHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGNvbXBhcmUuXG4gKiBAcGFyYW0geyp9IG90aGVyIFRoZSBvdGhlciB2YWx1ZSB0byBjb21wYXJlLlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGB2YWx1ZWAgaXMgZ3JlYXRlciB0aGFuIGBvdGhlcmAsXG4gKiAgZWxzZSBgZmFsc2VgLlxuICovXG5mdW5jdGlvbiBiYXNlR3QodmFsdWUsIG90aGVyKSB7XG4gIHJldHVybiB2YWx1ZSA+IG90aGVyO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VHdDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseGt.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseHas.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_baseHas.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VIYXMuanM/OTZmMyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxhQUFhO0FBQ3hCLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VIYXMuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogVXNlZCBmb3IgYnVpbHQtaW4gbWV0aG9kIHJlZmVyZW5jZXMuICovXG52YXIgb2JqZWN0UHJvdG8gPSBPYmplY3QucHJvdG90eXBlO1xuXG4vKiogVXNlZCB0byBjaGVjayBvYmplY3RzIGZvciBvd24gcHJvcGVydGllcy4gKi9cbnZhciBoYXNPd25Qcm9wZXJ0eSA9IG9iamVjdFByb3RvLmhhc093blByb3BlcnR5O1xuXG4vKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmhhc2Agd2l0aG91dCBzdXBwb3J0IGZvciBkZWVwIHBhdGhzLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gW29iamVjdF0gVGhlIG9iamVjdCB0byBxdWVyeS5cbiAqIEBwYXJhbSB7QXJyYXl8c3RyaW5nfSBrZXkgVGhlIGtleSB0byBjaGVjay5cbiAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBga2V5YCBleGlzdHMsIGVsc2UgYGZhbHNlYC5cbiAqL1xuZnVuY3Rpb24gYmFzZUhhcyhvYmplY3QsIGtleSkge1xuICByZXR1cm4gb2JqZWN0ICE9IG51bGwgJiYgaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUhhcztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseHas.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseHasIn.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseHasIn.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VIYXNJbi5qcz8yNmU4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsYUFBYTtBQUN4QixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlSGFzSW4uanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmhhc0luYCB3aXRob3V0IHN1cHBvcnQgZm9yIGRlZXAgcGF0aHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBbb2JqZWN0XSBUaGUgb2JqZWN0IHRvIHF1ZXJ5LlxuICogQHBhcmFtIHtBcnJheXxzdHJpbmd9IGtleSBUaGUga2V5IHRvIGNoZWNrLlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGBrZXlgIGV4aXN0cywgZWxzZSBgZmFsc2VgLlxuICovXG5mdW5jdGlvbiBiYXNlSGFzSW4ob2JqZWN0LCBrZXkpIHtcbiAgcmV0dXJuIG9iamVjdCAhPSBudWxsICYmIGtleSBpbiBPYmplY3Qob2JqZWN0KTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlSGFzSW47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseHasIn.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIndexOf.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_baseIndexOf.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ \"./node_modules/lodash/_baseFindIndex.js\"),\n baseIsNaN = __webpack_require__(/*! ./_baseIsNaN */ \"./node_modules/lodash/_baseIsNaN.js\"),\n strictIndexOf = __webpack_require__(/*! ./_strictIndexOf */ \"./node_modules/lodash/_strictIndexOf.js\");\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n//# sourceURL=[module]\n//# sourceMapp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0byBzZWFyY2ggZnJvbS5cbiAqIEByZXR1cm5zIHtudW1iZXJ9IFJldHVybnMgdGhlIGluZGV4IG9mIHRoZSBtYXRjaGVkIHZhbHVlLCBlbHNlIGAtMWAuXG4gKi9cbmZ1bmN0aW9uIGJhc2VJbmRleE9mKGFycmF5LCB2YWx1ZSwgZnJvbUluZGV4KSB7XG4gIHJldHVybiB2YWx1ZSA9PT0gdmFsdWVcbiAgICA/IHN0cmljdEluZGV4T2YoYXJyYXksIHZhbHVlLCBmcm9tSW5kZXgpXG4gICAgOiBiYXNlRmluZEluZGV4KGFycmF5LCBiYXNlSXNOYU4sIGZyb21JbmRleCk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUluZGV4T2Y7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIndexOf.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsArguments.js": /*!*************************************************!*\ !*** ./node_modules/lodash/_baseIsArguments.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc0FyZ3VtZW50cy5qcz8yNTNjIl0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.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsEqual.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_baseIsEqual.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIsEqualDeep = __webpack_require__(/*! ./_baseIsEqualDeep */ \"./node_modules/lodash/_baseIsEqualDeep.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc0VxdWFsLmpzP2MwNWYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsc0JBQXNCLG1CQUFPLENBQUMscUVBQW9CO0FBQ2xELG1CQUFtQixtQkFBTyxDQUFDLDZEQUFnQjs7QUFFM0M7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLFdBQVcsRUFBRTtBQUNiLFdBQVcsUUFBUTtBQUNuQjtBQUNBO0FBQ0EsV0FBVyxTQ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hbGVudCwgZWxzZSBgZmFsc2VgLlxuICovXG5mdW5jdGlvbiBiYXNlSXNFcXVhbCh2YWx1ZSwgb3RoZXIsIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIHN0YWNrKSB7XG4gIGlmICh2YWx1ZSA9PT0gb3RoZXIpIHtcbiAgICByZXR1cm4gdHJ1ZTtcbiAgfVxuICBpZiAodmFsdWUgPT0gbnVsbCB8fCBvdGhlciA9PSBudWxsIHx8ICghaXNPYmplY3RMaWtlKHZhbHVlKSAmJiAhaXNPYmplY3RMaWtlKG90aGVyKSkpIHtcbiAgICByZXR1cm4gdmFsdWUgIT09IHZhbHVlICYmIG90aGVyICE9PSBvdGhlcjtcbiAgfVxuICByZXR1cm4gYmFzZUlzRXF1YWxEZWVwKHZhbHVlLCBvdGhlciwgYml0bWFzaywgY3VzdG9taXplciwgYmFzZUlzRXF1YWwsIHN0YWNrKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlSXNFcXVhbDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIsEqual.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsEqualDeep.js": /*!*************************************************!*\ !*** ./node_modules/lodash/_baseIsEqualDeep.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Stack = __webpack_require__(/*! ./_Stack */ \"./node_modules/lodash/_Stack.js\"),\n equalArrays = __webpack_require__(/*! ./_equalArrays */ \"./node_modules/lodash/_equalArrays.js\"),\n equalByTag = __webpack_require__(/*! ./_equalByTag */ \"./node_modules/lodash/_equalByTag.js\"),\n equalObjects = __webpack_require__(/*! ./_equalObjects */ \"./node_modules/lodash/_equalObjects.js\"),\n getTag = __webpack_require__(/*! ./_getTag */ \"./node_modules/lodash/_getTag.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isBuffer = __webpack_require__(/*! ./isBuffer */ \"./node_modules/lodash/isBuffer.js\"),\n isTypedArray = __webpack_require__(/*! ./isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc0VxdWFsRGVlcC5qcz83Yjk3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksbUJBQU8sQ0FBQyxpREFBVTtBQUM5QixrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7QUFDMUMsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7QUFDeEMsbUJBQW1CLG1CQUFPLENBQUMsK0RBQWlCO0FBQzVDLGFBQWEsbUJBQU8sQ0FBQyxtREFBVztBQUNoQyxjQUFjLG1CQUFPLENBQUMsbURBQVc7QUFDakMsZUFBZSxtQkFBTyxDQUFDLHFEQUFZO0FBQ25DLG1CQUFtQixtQkFBTyxDQUFDLDZEQUFnQjs7QUFFM0M7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsV0FBVyxTQUFTO0FBQ3BCLFdBQVcsU0FBUztBQUNwQixXQUFXLE9BQU87QUFDbEIsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7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mV0dXJuIGVxdWFsT2JqZWN0cyhvYmplY3QsIG90aGVyLCBiaXRtYXNrLCBjdXN0b21pemVyLCBlcXVhbEZ1bmMsIHN0YWNrKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlSXNFcXVhbERlZXA7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIsEqualDeep.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsMap.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseIsMap.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getTag = __webpack_require__(/*! ./_getTag */ \"./node_modules/lodash/_getTag.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc01hcC5qcz8xYTJkIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGFBQWEsbUJBQU8sQ0FBQyxtREFBVztBQUNoQyxtQkFBbUIsbUJBQU8sQ0FBQyw2REFBZ0I7O0FBRTNDO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlSXNNYXAuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0VGFnID0gcmVxdWlyZSgnLi9fZ2V0VGFnJyksXG4gICAgaXNPYmplY3RMaWtlID0gcmVxdWlyZSgnLi9pc09iamVjdExpa2UnKTtcblxuLyoqIGBPYmplY3QjdG9TdHJpbmdgIHJlc3VsdCByZWZlcmVuY2VzLiAqL1xudmFyIG1hcFRhZyA9ICdbb2JqZWN0IE1hcF0nO1xuXG4vKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmlzTWFwYCB3aXRob3V0IE5vZGUuanMgb3B0aW1pemF0aW9ucy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhIG1hcCwgZWxzZSBgZmFsc2VgLlxuICovXG5mdW5jdGlvbiBiYXNlSXNNYXAodmFsdWUpIHtcbiAgcmV0dXJuIGlzT2JqZWN0TGlrZSh2YWx1ZSkgJiYgZ2V0VGFnKHZhbHVlKSA9PSBtYXBUYWc7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUlzTWFwO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIsMap.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsMatch.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_baseIsMatch.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Stack = __webpack_require__(/*! ./_Stack */ \"./node_modules/lodash/_Stack.js\"),\n baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ \"./node_modules/lodash/_baseIsEqual.js\");\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc01hdGNoLmpzPzk2NmYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxtQkFBTyxDQUFDLGlEQUFVO0FBQzlCLGtCQUFrQixtQkFBTyxDQUFDLDZEQUFnQjs7QUFFMUM7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLE1BQ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gJiYgZGF0YVsyXSkge1xuICAgICAgaWYgKG9ialZhbHVlID09PSB1bmRlZmluZWQgJiYgIShrZXkgaW4gb2JqZWN0KSkge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIHZhciBzdGFjayA9IG5ldyBTdGFjaztcbiAgICAgIGlmIChjdXN0b21pemVyKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBjdXN0b21pemVyKG9ialZhbHVlLCBzcmNWYWx1ZSwga2V5LCBvYmplY3QsIHNvdXJjZSwgc3RhY2spO1xuICAgICAgfVxuICAgICAgaWYgKCEocmVzdWx0ID09PSB1bmRlZmluZWRcbiAgICAgICAgICAgID8gYmFzZUlzRXF1YWwoc3JjVmFsdWUsIG9ialZhbHVlLCBDT01QQVJFX1BBUlRJQUxfRkxBRyB8IENPTVBBUkVfVU5PUkRFUkVEX0ZMQUcsIGN1c3RvbWl6ZXIsIHN0YWNrKVxuICAgICAgICAgICAgOiByZXN1bHRcbiAgICAgICAgICApKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgcmV0dXJuIHRydWU7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUlzTWF0Y2g7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIsMatch.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsNaN.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseIsNaN.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc05hTi5qcz9kOWE4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fYmFzZUlzTmFOLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBUaGUgYmFzZSBpbXBsZW1lbnRhdGlvbiBvZiBgXy5pc05hTmAgd2l0aG91dCBzdXBwb3J0IGZvciBudW1iZXIgb2JqZWN0cy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBgTmFOYCwgZWxzZSBgZmFsc2VgLlxuICovXG5mdW5jdGlvbiBiYXNlSXNOYU4odmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlICE9PSB2YWx1ZTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlSXNOYU47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIsNaN.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsNative.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_baseIsNative.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isFunction = __webpack_require__(/*! ./isFunction */ \"./node_modules/lodash/isFunction.js\"),\n isMasked = __webpack_require__(/*! ./_isMasked */ \"./node_modules/lodash/_isMasked.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\"),\n toSource = __webpack_require__(/*! ./_toSource */ \"./node_modules/lodash/_toSource.js\");\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc05hdGl2ZS5qcz8zNGFjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlCQUFpQixtQkFBTyxDQUFDLHlEQUFjO0FBQ3ZDLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTtBQUNwQyxlQUFlLG1CQUFPLENBQUMscURBQVk7QUFDbkMsZUFBZSxtQkFBTyx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ldHVybiBmYWxzZTtcbiAgfVxuICB2YXIgcGF0dGVybiA9IGlzRnVuY3Rpb24odmFsdWUpID8gcmVJc05hdGl2ZSA6IHJlSXNIb3N0Q3RvcjtcbiAgcmV0dXJuIHBhdHRlcm4udGVzdCh0b1NvdXJjZSh2YWx1ZSkpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VJc05hdGl2ZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIsNative.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsSet.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseIsSet.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getTag = __webpack_require__(/*! ./_getTag */ \"./node_modules/lodash/_getTag.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc1NldC5qcz9jM2ZjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGFBQWEsbUJBQU8sQ0FBQyxtREFBVztBQUNoQyxtQkFBbUIsbUJBQU8sQ0FBQyw2REFBZ0I7O0FBRTNDO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlSXNTZXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0VGFnID0gcmVxdWlyZSgnLi9fZ2V0VGFnJyksXG4gICAgaXNPYmplY3RMaWtlID0gcmVxdWlyZSgnLi9pc09iamVjdExpa2UnKTtcblxuLyoqIGBPYmplY3QjdG9TdHJpbmdgIHJlc3VsdCByZWZlcmVuY2VzLiAqL1xudmFyIHNldFRhZyA9ICdbb2JqZWN0IFNldF0nO1xuXG4vKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmlzU2V0YCB3aXRob3V0IE5vZGUuanMgb3B0aW1pemF0aW9ucy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhIHNldCwgZWxzZSBgZmFsc2VgLlxuICovXG5mdW5jdGlvbiBiYXNlSXNTZXQodmFsdWUpIHtcbiAgcmV0dXJuIGlzT2JqZWN0TGlrZSh2YWx1ZSkgJiYgZ2V0VGFnKHZhbHVlKSA9PSBzZXRUYWc7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZUlzU2V0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIsSet.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIsTypedArray.js": /*!**************************************************!*\ !*** ./node_modules/lodash/_baseIsTypedArray.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isLength = __webpack_require__(/*! ./isLength */ \"./node_modules/lodash/isLength.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJc1R5cGVkQXJyYXkuanM/NzQzZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsbUJBQU8sQ0FBQywyREFBZTtBQUN4QyxlQUFlLG1CQUFPLENBQUMscURBQVk7QUFDbkMsbUJBQW1CLG1CQUFPLENBQUMsNkRBQWdCOztBQUUzQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlSXNUeXBlZEFycmF5LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VHZXRUYWcgPSByZXF1aXJlKCcuL19iYXNlR2V0VGFnJyksXG4gICAgaXNMZW5ndGggPSByZXF1aXJlKCcuL2lzTGVuZ3RoJyksXG4gICAgaXNP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ID1cbnR5cGVkQXJyYXlUYWdzW29iamVjdFRhZ10gPSB0eXBlZEFycmF5VGFnc1tyZWdleHBUYWddID1cbnR5cGVkQXJyYXlUYWdzW3NldFRhZ10gPSB0eXBlZEFycmF5VGFnc1tzdHJpbmdUYWddID1cbnR5cGVkQXJyYXlUYWdzW3dlYWtNYXBUYWddID0gZmFsc2U7XG5cbi8qKlxuICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uaXNUeXBlZEFycmF5YCB3aXRob3V0IE5vZGUuanMgb3B0aW1pemF0aW9ucy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhIHR5cGVkIGFycmF5LCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIGJhc2VJc1R5cGVkQXJyYXkodmFsdWUpIHtcbiAgcmV0dXJuIGlzT2JqZWN0TGlrZSh2YWx1ZSkgJiZcbiAgICBpc0xlbmd0aCh2YWx1ZS5sZW5ndGgpICYmICEhdHlwZWRBcnJheVRhZ3NbYmFzZUdldFRhZyh2YWx1ZSldO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VJc1R5cGVkQXJyYXk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIsTypedArray.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseIteratee.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_baseIteratee.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseMatches = __webpack_require__(/*! ./_baseMatches */ \"./node_modules/lodash/_baseMatches.js\"),\n baseMatchesProperty = __webpack_require__(/*! ./_baseMatchesProperty */ \"./node_modules/lodash/_baseMatchesProperty.js\"),\n identity = __webpack_require__(/*! ./identity */ \"./node_modules/lodash/identity.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n property = __webpack_require__(/*! ./property */ \"./node_modules/lodash/property.js\");\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VJdGVyYXRlZS5qcz9iYWRmIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGtCQUFrQixtQkFBTyxDQUFDLDZEQUFnQjtBQUMxQywwQkFBMEIsbUJBQU8sQ0FBQyw2RUFBd0I7QUFDMUQsZUFBZSxtQkFBTyxDQUFDLHFEQUFZO0FBQ25DLGNBQWMsbUJBQU8sQ0FBQyxtREFBVztBQUNqQyxlQUFlLG1CQUFPLENBQUMscURBQVk7O0FBRW5DO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxTQUFTO0FBQ3RCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZH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iamVjdCcpIHtcbiAgICByZXR1cm4gaXNBcnJheSh2YWx1ZSlcbiAgICAgID8gYmFzZU1hdGNoZXNQcm9wZXJ0eSh2YWx1ZVswXSwgdmFsdWVbMV0pXG4gICAgICA6IGJhc2VNYXRjaGVzKHZhbHVlKTtcbiAgfVxuICByZXR1cm4gcHJvcGVydHkodmFsdWUpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VJdGVyYXRlZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseIteratee.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseKeys.js": /*!******************************************!*\ !*** ./node_modules/lodash/_baseKeys.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isPrototype = __webpack_require__(/*! ./_isPrototype */ \"./node_modules/lodash/_isPrototype.js\"),\n nativeKeys = __webpack_require__(/*! ./_nativeKeys */ \"./node_modules/lodash/_nativeKeys.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VLZXlzLmpzPzAzZGQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsa0JBQWtCLG1CQUF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Y3QpKSB7XG4gICAgcmV0dXJuIG5hdGl2ZUtleXMob2JqZWN0KTtcbiAgfVxuICB2YXIgcmVzdWx0ID0gW107XG4gIGZvciAodmFyIGtleSBpbiBPYmplY3Qob2JqZWN0KSkge1xuICAgIGlmIChoYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSAmJiBrZXkgIT0gJ2NvbnN0cnVjdG9yJykge1xuICAgICAgcmVzdWx0LnB1c2goa2V5KTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlS2V5cztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseKeys.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseKeysIn.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseKeysIn.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\"),\n isPrototype = __webpack_require__(/*! ./_isPrototype */ \"./node_modules/lodash/_isPrototype.js\"),\n nativeKeysIn = __webpack_require__(/*! ./_nativeKeysIn */ \"./node_modules/lodash/_nativeKeysIn.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2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ggZG9lc24ndCB0cmVhdCBzcGFyc2UgYXJyYXlzIGFzIGRlbnNlLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gcXVlcnkuXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIGFycmF5IG9mIHByb3BlcnR5IG5hbWVzLlxuICovXG5mdW5jdGlvbiBiYXNlS2V5c0luKG9iamVjdCkge1xuICBpZiAoIWlzT2JqZWN0KG9iamVjdCkpIHtcbiAgICByZXR1cm4gbmF0aXZlS2V5c0luKG9iamVjdCk7XG4gIH1cbiAgdmFyIGlzUHJvdG8gPSBpc1Byb3RvdHlwZShvYmplY3QpLFxuICAgICAgcmVzdWx0ID0gW107XG5cbiAgZm9yICh2YXIga2V5IGluIG9iamVjdCkge1xuICAgIGlmICghKGtleSA9PSAnY29uc3RydWN0b3InICYmIChpc1Byb3RvIHx8ICFoYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkpKSB7XG4gICAgICByZXN1bHQucHVzaChrZXkpO1xuICAgIH1cbiAgfVxuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VLZXlzSW47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseKeysIn.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseLt.js": /*!****************************************!*\ !*** ./node_modules/lodash/_baseLt.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\nfunction baseLt(value, other) {\n return value < other;\n}\n\nmodule.exports = baseLt;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VMdC5qcz84ZDIwIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsV0FBVyxFQUFFO0FBQ2IsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlTHQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmx0YCB3aGljaCBkb2Vzbid0IGNvZXJjZSBhcmd1bWVudHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGNvbXBhcmUuXG4gKiBAcGFyYW0geyp9IG90aGVyIFRoZSBvdGhlciB2YWx1ZSB0byBjb21wYXJlLlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGB2YWx1ZWAgaXMgbGVzcyB0aGFuIGBvdGhlcmAsXG4gKiAgZWxzZSBgZmFsc2VgLlxuICovXG5mdW5jdGlvbiBiYXNlTHQodmFsdWUsIG90aGVyKSB7XG4gIHJldHVybiB2YWx1ZSA8IG90aGVyO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VMdDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseLt.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseMap.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_baseMap.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseEach = __webpack_require__(/*! ./_baseEach */ \"./node_modules/lodash/_baseEach.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\");\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VNYXAuanM/OTdkMyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFlLG1CQUFPLENBQUMsdURBQWE7QUFDcEMsa0JBQWtCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXpDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxhQUFhO0FBQ3hCLFdBQVcsU0FBUztBQUNwQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLEdBQUc7QUFDSDtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fYmFzZU1hcC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlRWFjaCA9IHJlcXVpcmUoJy4vX2Jhc2VFYWNoJyksXG4gICAgaXNBcnJheUxpa2UgPSByZXF1aXJlKCcuL2lzQXJyYXlMaWtlJyk7XG5cbi8qKlxuICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8ubWFwYCB3aXRob3V0IHN1cHBvcnQgZm9yIGl0ZXJhdGVlIHNob3J0aGFuZHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7QXJyYXl8T2JqZWN0fSBjb2xsZWN0aW9uIFRoZSBjb2xsZWN0aW9uIHRvIGl0ZXJhdGUgb3Zlci5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGl0ZXJhdGVlIFRoZSBmdW5jdGlvbiBpbnZva2VkIHBlciBpdGVyYXRpb24uXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG5ldyBtYXBwZWQgYXJyYXkuXG4gKi9cbmZ1bmN0aW9uIGJhc2VNYXAoY29sbGVjdGlvbiwgaXRlcmF0ZWUpIHtcbiAgdmFyIGluZGV4ID0gLTEsXG4gICAgICByZXN1bHQgPSBpc0FycmF5TGlrZShjb2xsZWN0aW9uKSA/IEFycmF5KGNvbGxlY3Rpb24ubGVuZ3RoKSA6IFtdO1xuXG4gIGJhc2VFYWNoKGNvbGxlY3Rpb24sIGZ1bmN0aW9uKHZhbHVlLCBrZXksIGNvbGxlY3Rpb24pIHtcbiAgICByZXN1bHRbKytpbmRleF0gPSBpdGVyYXRlZSh2YWx1ZSwga2V5LCBjb2xsZWN0aW9uKTtcbiAgfSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZU1hcDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseMap.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseMatches.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_baseMatches.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIsMatch = __webpack_require__(/*! ./_baseIsMatch */ \"./node_modules/lodash/_baseIsMatch.js\"),\n getMatchData = __webpack_require__(/*! ./_getMatchData */ \"./node_modules/lodash/_getMatchData.js\"),\n matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ \"./node_modules/lodash/_matchesStrictComparable.js\");\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VNYXRjaGVzLmpzPzY0MmEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsa0JBQWtCLG1CQUFPLENBQUMsNkRBQWdCO0FBQzFDLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjtBQUM1Qyw4QkFBOEIsbUJBQU8sQ0FBQyxxRkFBNEI7O0FBRWxFO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsU0FBUztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VNYXRjaGVzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VJc01hdGNoID0gcmVxdWlyZSgnLi9fYmFzZUlzTWF0Y2gnKSxcbiAgICBnZXRNYXRjaERhdGEgPSByZXF1aXJlKCcuL19nZXRNYXRjaERhdGEnKSxcbiAgICBtYXRjaGVzU3RyaWN0Q29tcGFyYWJsZSA9IHJlcXVpcmUoJy4vX21hdGNoZXNTdHJpY3RDb21wYXJhYmxlJyk7XG5cbi8qKlxuICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8ubWF0Y2hlc2Agd2hpY2ggZG9lc24ndCBjbG9uZSBgc291cmNlYC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IHNvdXJjZSBUaGUgb2JqZWN0IG9mIHByb3BlcnR5IHZhbHVlcyB0byBtYXRjaC5cbiAqIEByZXR1cm5zIHtGdW5jdGlvbn0gUmV0dXJucyB0aGUgbmV3IHNwZWMgZnVuY3Rpb24uXG4gKi9cbmZ1bmN0aW9uIGJhc2VNYXRjaGVzKHNvdXJjZSkge1xuICB2YXIgbWF0Y2hEYXRhID0gZ2V0TWF0Y2hEYXRhKHNvdXJjZSk7XG4gIGlmIChtYXRjaERhdGEubGVuZ3RoID09IDEgJiYgbWF0Y2hEYXRhWzBdWzJdKSB7XG4gICAgcmV0dXJuIG1hdGNoZXNTdHJpY3RDb21wYXJhYmxlKG1hdGNoRGF0YVswXVswXSwgbWF0Y2hEYXRhWzBdWzFdKTtcbiAgfVxuICByZXR1cm4gZnVuY3Rpb24ob2JqZWN0KSB7XG4gICAgcmV0dXJuIG9iamVjdCA9PT0gc291cmNlIHx8IGJhc2VJc01hdGNoKG9iamVjdCwgc291cmNlLCBtYXRjaERhdGEpO1xuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VNYXRjaGVzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseMatches.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseMatchesProperty.js": /*!*****************************************************!*\ !*** ./node_modules/lodash/_baseMatchesProperty.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIsEqual = __webpack_require__(/*! ./_baseIsEqual */ \"./node_modules/lodash/_baseIsEqual.js\"),\n get = __webpack_require__(/*! ./get */ \"./node_modules/lodash/get.js\"),\n hasIn = __webpack_require__(/*! ./hasIn */ \"./node_modules/lodash/hasIn.js\"),\n isKey = __webpack_require__(/*! ./_isKey */ \"./node_modules/lodash/_isKey.js\"),\n isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ \"./node_modules/lodash/_isStrictComparable.js\"),\n matchesStrictComparable = __webpack_require__(/*! ./_matchesStrictComparable */ \"./node_modules/lodash/_matchesStrictComparable.js\"),\n toKey = __webpack_require__(/*! ./_toKey */ \"./node_modules/lodash/_toKey.js\");\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VNYXRjaGVzUHJvcGVydHkuanM/MTgzOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7QUFDMUMsVUFBVSxtQkFBTyxDQUFDLDJDQUFPO0FBQ3pCLFlBQVksbUJBQU8sQ0FBQywrQ0FBUztBQUM3QixZQUFZLG1CQUFPLENBQUMsaURBQVU7QUFDOUIseUJBQXlCLG1CQUFPLENBQUMsMkVBQXVCO0FBQ3hELDhCQUE4Qixt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uICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge3N0cmluZ30gcGF0aCBUaGUgcGF0aCBvZiB0aGUgcHJvcGVydHkgdG8gZ2V0LlxuICogQHBhcmFtIHsqfSBzcmNWYWx1ZSBUaGUgdmFsdWUgdG8gbWF0Y2guXG4gKiBAcmV0dXJucyB7RnVuY3Rpb259IFJldHVybnMgdGhlIG5ldyBzcGVjIGZ1bmN0aW9uLlxuICovXG5mdW5jdGlvbiBiYXNlTWF0Y2hlc1Byb3BlcnR5KHBhdGgsIHNyY1ZhbHVlKSB7XG4gIGlmIChpc0tleShwYXRoKSAmJiBpc1N0cmljdENvbXBhcmFibGUoc3JjVmFsdWUpKSB7XG4gICAgcmV0dXJuIG1hdGNoZXNTdHJpY3RDb21wYXJhYmxlKHRvS2V5KHBhdGgpLCBzcmNWYWx1ZSk7XG4gIH1cbiAgcmV0dXJuIGZ1bmN0aW9uKG9iamVjdCkge1xuICAgIHZhciBvYmpWYWx1ZSA9IGdldChvYmplY3QsIHBhdGgpO1xuICAgIHJldHVybiAob2JqVmFsdWUgPT09IHVuZGVmaW5lZCAmJiBvYmpWYWx1ZSA9PT0gc3JjVmFsdWUpXG4gICAgICA/IGhhc0luKG9iamVjdCwgcGF0aClcbiAgICAgIDogYmFzZUlzRXF1YWwoc3JjVmFsdWUsIG9ialZhbHVlLCBDT01QQVJFX1BBUlRJQUxfRkxBRyB8IENPTVBBUkVfVU5PUkRFUkVEX0ZMQUcpO1xuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VNYXRjaGVzUHJvcGVydHk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseMatchesProperty.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseMerge.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseMerge.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Stack = __webpack_require__(/*! ./_Stack */ \"./node_modules/lodash/_Stack.js\"),\n assignMergeValue = __webpack_require__(/*! ./_assignMergeValue */ \"./node_modules/lodash/_assignMergeValue.js\"),\n baseFor = __webpack_require__(/*! ./_baseFor */ \"./node_modules/lodash/_baseFor.js\"),\n baseMergeDeep = __webpack_require__(/*! ./_baseMergeDeep */ \"./node_modules/lodash/_baseMergeDeep.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\"),\n keysIn = __webpack_require__(/*! ./keysIn */ \"./node_modules/lodash/keysIn.js\"),\n safeGet = __webpack_require__(/*! ./_safeGet */ \"./node_modules/lodash/_safeGet.js\");\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VNZXJnZS5qcz9mOTA5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFlBQVksbUJBQU8sQ0FBQyxpREFBVTtBQUM5Qix1QkFBdUIsbUJBQU8sQ0FBQyx1RUFBcUI7QUFDc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AgIDogdW5kZWZpbmVkO1xuXG4gICAgICBpZiAobmV3VmFsdWUgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBuZXdWYWx1ZSA9IHNyY1ZhbHVlO1xuICAgICAgfVxuICAgICAgYXNzaWduTWVyZ2VWYWx1ZShvYmplY3QsIGtleSwgbmV3VmFsdWUpO1xuICAgIH1cbiAgfSwga2V5c0luKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlTWVyZ2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseMerge.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseMergeDeep.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_baseMergeDeep.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var assignMergeValue = __webpack_require__(/*! ./_assignMergeValue */ \"./node_modules/lodash/_assignMergeValue.js\"),\n cloneBuffer = __webpack_require__(/*! ./_cloneBuffer */ \"./node_modules/lodash/_cloneBuffer.js\"),\n cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ \"./node_modules/lodash/_cloneTypedArray.js\"),\n copyArray = __webpack_require__(/*! ./_copyArray */ \"./node_modules/lodash/_copyArray.js\"),\n initCloneObject = __webpack_require__(/*! ./_initCloneObject */ \"./node_modules/lodash/_initCloneObject.js\"),\n isArguments = __webpack_require__(/*! ./isArguments */ \"./node_modules/lodash/isArguments.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isArrayLikeObject = __webpack_require__(/*! ./isArrayLikeObject */ \"./node_modules/lodash/isArrayLikeObject.js\"),\n isBuffer = __webpack_require__(/*! ./isBuffer */ \"./node_modules/lodash/isBuffer.js\"),\n isFunction = __webpack_require__(/*! ./isFunction */ \"./node_modules/lodash/isFunction.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\"),\n isPlainObject = __webpack_require__(/*! ./isPlainObject */ \"./node_modules/lodash/isPlainObject.js\"),\n isTypedArray = __webpack_require__(/*! ./isTypedArray */ \"./node_modules/lodash/isTypedArray.js\"),\n safeGet = __webpack_require__(/*! ./_safeGet */ \"./node_modules/lodash/_safeGet.js\"),\n toPlainObject = __webpack_require__(/*! ./toPlainObject */ \"./node_modules/lodash/toPlainObject.js\");\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VNZXJnZURlZXAuanM/NGY1MCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1QkFBdUIsbUJBQU8sQ0FBQyx1RUFBcUI7QUFDcEQsa0JBQWtCLG1CQUFPLENBQUMsNkRBQWdCO0FBQzFDLHNCQUFzQixtQkFBTyxDQUFDLHFFQUFvQjtBQUNsRCxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxzQkFBc0IsbUJBQU8sQ0FBQyxxRUFBb0I7QUFDbEQsa0JBQWtCLG1CQUFPLENBQUMsMkRBQWU7QUFDekMsY0FBYyxtQkFBTyxDQUFDLG1EQUFXO0FBQ2pDLHdCQUF3QixtQkFBTyxDQUFDLHVFQUFxQjtBQUNyRCxlQUFlLG1CQUFPLENBQUMscURBQVk7QUFDbkMsaUJBQWlCLG1CQUFPLENBQUMseURBQWM7QUFDdkMsZUFBZSxtQkFBTyxDQUFDLHFEQUFZO0FBQ25DLG9CQUFvQixtQkFBTyxDQUFDLCtEQUFpQjtBQUM3QyxtQkFBbUIsbUJBQU8sQ0FBQyw2REFBZ0I7QUFDM0MsY0FBYyxtQkFBTyxDQUFDLHFEQUFZO0FBQ2xDLG9CQUFvQixtQkFBTyxDQUFDLCtEQUFpQjs7QUFFN0M7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztB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25lT2JqZWN0KHNyY1ZhbHVlKTtcbiAgICAgIH1cbiAgICB9XG4gICAgZWxzZSB7XG4gICAgICBpc0NvbW1vbiA9IGZhbHNlO1xuICAgIH1cbiAgfVxuICBpZiAoaXNDb21tb24pIHtcbiAgICAvLyBSZWN1cnNpdmVseSBtZXJnZSBvYmplY3RzIGFuZCBhcnJheXMgKHN1c2NlcHRpYmxlIHRvIGNhbGwgc3RhY2sgbGltaXRzKS5cbiAgICBzdGFjay5zZXQoc3JjVmFsdWUsIG5ld1ZhbHVlKTtcbiAgICBtZXJnZUZ1bmMobmV3VmFsdWUsIHNyY1ZhbHVlLCBzcmNJbmRleCwgY3VzdG9taXplciwgc3RhY2spO1xuICAgIHN0YWNrWydkZWxldGUnXShzcmNWYWx1ZSk7XG4gIH1cbiAgYXNzaWduTWVyZ2VWYWx1ZShvYmplY3QsIGtleSwgbmV3VmFsdWUpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VNZXJnZURlZXA7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseMergeDeep.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseOrderBy.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_baseOrderBy.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayMap = __webpack_require__(/*! ./_arrayMap */ \"./node_modules/lodash/_arrayMap.js\"),\n baseIteratee = __webpack_require__(/*! ./_baseIteratee */ \"./node_modules/lodash/_baseIteratee.js\"),\n baseMap = __webpack_require__(/*! ./_baseMap */ \"./node_modules/lodash/_baseMap.js\"),\n baseSortBy = __webpack_require__(/*! ./_baseSortBy */ \"./node_modules/lodash/_baseSortBy.js\"),\n baseUnary = __webpack_require__(/*! ./_baseUnary */ \"./node_modules/lodash/_baseUnary.js\"),\n compareMultiple = __webpack_require__(/*! ./_compareMultiple */ \"./node_modules/lodash/_compareMultiple.js\"),\n identity = __webpack_require__(/*! ./identity */ \"./node_modules/lodash/identity.js\");\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VPcmRlckJ5LmpzPzZhNWMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFBZSxtQkFBTyxDQUFDLHVEQUFhO0FBQ3BDLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjtBQUM1QyxjQUFjLG1CQUFPLENBQUMscURBQVk7QUFDbEMsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7QUFDeEMsZ0JBQWdCLG1CQUFPLENBQUMseURBQWM7QUFDdEMsc0JBQXNCLG1CQUFPLENBQUMscUVBQW9CO0FBQ2xELGVBQWUsbUJBQU8sQ0FBQyxxREFBWTs7QUFFbkM7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLGFBQWE7QUFDeEIsV0FBVyw2QkFBNkI7QUFDeEMsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsTUFBTTtBQUNuQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtB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gKi9cbmZ1bmN0aW9uIGJhc2VPcmRlckJ5KGNvbGxlY3Rpb24sIGl0ZXJhdGVlcywgb3JkZXJzKSB7XG4gIHZhciBpbmRleCA9IC0xO1xuICBpdGVyYXRlZXMgPSBhcnJheU1hcChpdGVyYXRlZXMubGVuZ3RoID8gaXRlcmF0ZWVzIDogW2lkZW50aXR5XSwgYmFzZVVuYXJ5KGJhc2VJdGVyYXRlZSkpO1xuXG4gIHZhciByZXN1bHQgPSBiYXNlTWFwKGNvbGxlY3Rpb24sIGZ1bmN0aW9uKHZhbHVlLCBrZXksIGNvbGxlY3Rpb24pIHtcbiAgICB2YXIgY3JpdGVyaWEgPSBhcnJheU1hcChpdGVyYXRlZXMsIGZ1bmN0aW9uKGl0ZXJhdGVlKSB7XG4gICAgICByZXR1cm4gaXRlcmF0ZWUodmFsdWUpO1xuICAgIH0pO1xuICAgIHJldHVybiB7ICdjcml0ZXJpYSc6IGNyaXRlcmlhLCAnaW5kZXgnOiArK2luZGV4LCAndmFsdWUnOiB2YWx1ZSB9O1xuICB9KTtcblxuICByZXR1cm4gYmFzZVNvcnRCeShyZXN1bHQsIGZ1bmN0aW9uKG9iamVjdCwgb3RoZXIpIHtcbiAgICByZXR1cm4gY29tcGFyZU11bHRpcGxlKG9iamVjdCwgb3RoZXIsIG9yZGVycyk7XG4gIH0pO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VPcmRlckJ5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseOrderBy.js\n"); /***/ }), /***/ "./node_modules/lodash/_basePick.js": /*!******************************************!*\ !*** ./node_modules/lodash/_basePick.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var basePickBy = __webpack_require__(/*! ./_basePickBy */ \"./node_modules/lodash/_basePickBy.js\"),\n hasIn = __webpack_require__(/*! ./hasIn */ \"./node_modules/lodash/hasIn.js\");\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nmodule.exports = basePick;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VQaWNrLmpzPzE1ZjMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7QUFDeEMsWUFBWSxtQkFBTyxDQUFDLCtDQUFTOztBQUU3QjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsU0FBUztBQUNwQixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQSxHQUFHO0FBQ0g7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlUGljay5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlUGlja0J5ID0gcmVxdWlyZSgnLi9fYmFzZVBpY2tCeScpLFxuICAgIGhhc0luID0gcmVxdWlyZSgnLi9oYXNJbicpO1xuXG4vKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLnBpY2tgIHdpdGhvdXQgc3VwcG9ydCBmb3IgaW5kaXZpZHVhbFxuICogcHJvcGVydHkgaWRlbnRpZmllcnMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIHNvdXJjZSBvYmplY3QuXG4gKiBAcGFyYW0ge3N0cmluZ1tdfSBwYXRocyBUaGUgcHJvcGVydHkgcGF0aHMgdG8gcGljay5cbiAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIG5ldyBvYmplY3QuXG4gKi9cbmZ1bmN0aW9uIGJhc2VQaWNrKG9iamVjdCwgcGF0aHMpIHtcbiAgcmV0dXJuIGJhc2VQaWNrQnkob2JqZWN0LCBwYXRocywgZnVuY3Rpb24odmFsdWUsIHBhdGgpIHtcbiAgICByZXR1cm4gaGFzSW4ob2JqZWN0LCBwYXRoKTtcbiAgfSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZVBpY2s7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_basePick.js\n"); /***/ }), /***/ "./node_modules/lodash/_basePickBy.js": /*!********************************************!*\ !*** ./node_modules/lodash/_basePickBy.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGet = __webpack_require__(/*! ./_baseGet */ \"./node_modules/lodash/_baseGet.js\"),\n baseSet = __webpack_require__(/*! ./_baseSet */ \"./node_modules/lodash/_baseSet.js\"),\n castPath = __webpack_require__(/*! ./_castPath */ \"./node_modules/lodash/_castPath.js\");\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nmodule.exports = basePickBy;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VQaWNrQnkuanM/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W9uIGJhc2VQaWNrQnkob2JqZWN0LCBwYXRocywgcHJlZGljYXRlKSB7XG4gIHZhciBpbmRleCA9IC0xLFxuICAgICAgbGVuZ3RoID0gcGF0aHMubGVuZ3RoLFxuICAgICAgcmVzdWx0ID0ge307XG5cbiAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICB2YXIgcGF0aCA9IHBhdGhzW2luZGV4XSxcbiAgICAgICAgdmFsdWUgPSBiYXNlR2V0KG9iamVjdCwgcGF0aCk7XG5cbiAgICBpZiAocHJlZGljYXRlKHZhbHVlLCBwYXRoKSkge1xuICAgICAgYmFzZVNldChyZXN1bHQsIGNhc3RQYXRoKHBhdGgsIG9iamVjdCksIHZhbHVlKTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlUGlja0J5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_basePickBy.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseProperty.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_baseProperty.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VQcm9wZXJ0eS5qcz9lZjVkIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsU0FBUztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlUHJvcGVydHkuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLnByb3BlcnR5YCB3aXRob3V0IHN1cHBvcnQgZm9yIGRlZXAgcGF0aHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgVGhlIGtleSBvZiB0aGUgcHJvcGVydHkgdG8gZ2V0LlxuICogQHJldHVybnMge0Z1bmN0aW9ufSBSZXR1cm5zIHRoZSBuZXcgYWNjZXNzb3IgZnVuY3Rpb24uXG4gKi9cbmZ1bmN0aW9uIGJhc2VQcm9wZXJ0eShrZXkpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uKG9iamVjdCkge1xuICAgIHJldHVybiBvYmplY3QgPT0gbnVsbCA/IHVuZGVmaW5lZCA6IG9iamVjdFtrZXldO1xuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VQcm9wZXJ0eTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseProperty.js\n"); /***/ }), /***/ "./node_modules/lodash/_basePropertyDeep.js": /*!**************************************************!*\ !*** ./node_modules/lodash/_basePropertyDeep.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGet = __webpack_require__(/*! ./_baseGet */ \"./node_modules/lodash/_baseGet.js\");\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n//# sourceURL=[module]\n//# sourceMappingUR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), /***/ "./node_modules/lodash/_baseRange.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseRange.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nmodule.exports = baseRange;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VSYW5nZS5qcz80Nzk2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsV0FBVyxRQUFRO0FBQ25CLGFBQWEsTUFBTTtBQUNuQjtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VSYW5nZS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qIEJ1aWx0LWluIG1ldGhvZCByZWZlcmVuY2VzIGZvciB0aG9zZSB3aX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G59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZVJhbmdlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseRange.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseReduce.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseReduce.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\nfunction baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseReduce;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VSZWR1Y2UuanM/NThmNyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxhQUFhO0FBQ3hCLFdBQVcsU0FBUztBQUNwQixXQUFXLEVBQUU7QUFDYixXQUFXLFFBQVE7QUFDbkI7QUFDQSxXQUFXLFNBQVM7QUFDcEIsYUFBYSxFQUFFO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsR0FBRztBQUNIO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21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sbGVjdGlvbikge1xuICAgIGFjY3VtdWxhdG9yID0gaW5pdEFjY3VtXG4gICAgICA/IChpbml0QWNjdW0gPSBmYWxzZSwgdmFsdWUpXG4gICAgICA6IGl0ZXJhdGVlKGFjY3VtdWxhdG9yLCB2YWx1ZSwgaW5kZXgsIGNvbGxlY3Rpb24pO1xuICB9KTtcbiAgcmV0dXJuIGFjY3VtdWxhdG9yO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VSZWR1Y2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseReduce.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseRest.js": /*!******************************************!*\ !*** ./node_modules/lodash/_baseRest.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var identity = __webpack_require__(/*! ./identity */ \"./node_modules/lodash/identity.js\"),\n overRest = __webpack_require__(/*! ./_overRest */ \"./node_modules/lodash/_overRest.js\"),\n setToString = __webpack_require__(/*! ./_setToString */ \"./node_modules/lodash/_setToString.js\");\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VSZXN0LmpzPzEwMGUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFBZSxtQkFBTyxDQUFDLHFEQUFZO0FBQ25DLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTtBQUNwQyxrQkFBa0IsbUJBQU8s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.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseSet.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_baseSet.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var assignValue = __webpack_require__(/*! ./_assignValue */ \"./node_modules/lodash/_assignValue.js\"),\n castPath = __webpack_require__(/*! ./_castPath */ \"./node_modules/lodash/_castPath.js\"),\n isIndex = __webpack_require__(/*! ./_isIndex */ \"./node_modules/lodash/_isIndex.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\"),\n toKey = __webpack_require__(/*! ./_toKey */ \"./node_modules/lodash/_toKey.js\");\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VTZXQuanM/MTU5YSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7QUFDMUMsZUFBZSxt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fVxuICAgIH1cbiAgICBhc3NpZ25WYWx1ZShuZXN0ZWQsIGtleSwgbmV3VmFsdWUpO1xuICAgIG5lc3RlZCA9IG5lc3RlZFtrZXldO1xuICB9XG4gIHJldHVybiBvYmplY3Q7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZVNldDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseSet.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseSetToString.js": /*!*************************************************!*\ !*** ./node_modules/lodash/_baseSetToString.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var constant = __webpack_require__(/*! ./constant */ \"./node_modules/lodash/constant.js\"),\n defineProperty = __webpack_require__(/*! ./_defineProperty */ \"./node_modules/lodash/_defineProperty.js\"),\n identity = __webpack_require__(/*! ./identity */ \"./node_modules/lodash/identity.js\");\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VTZXRUb1N0cmluZy5qcz9hNDU0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWUsbUJBQU8sQ0FBQyxxREFBWTtBQUNuQyxxQkFBcUIsbUJBQU8sQ0FBQyxtRUFBbUI7QUFDaEQsZUFBZSxtQkFBTyxDQUFDLHFEQUFZOztBQUVuQztBQUNBO0FBQ0E7QUFDQT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XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZVNldFRvU3RyaW5nO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseSetToString.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseSortBy.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseSortBy.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VTb3J0QnkuanM/ZDRiMiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE1BQU07QUFDakIsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsTUFBTTtBQUNuQjtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fYmFzZVNvcnRCeS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uc29ydEJ5YCB3aGljaCB1c2VzIGBjb21wYXJlcmAgdG8gZGVmaW5lIHRoZVxuICogc29ydCBvcmRlciBvZiBgYXJyYXlgIGFuZCByZXBsYWNlcyBjcml0ZXJpYSBvYmplY3RzIHdpdGggdGhlaXIgY29ycmVzcG9uZGluZ1xuICogdmFsdWVzLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5fSBhcnJheSBUaGUgYXJyYXkgdG8gc29ydC5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGNvbXBhcmVyIFRoZSBmdW5jdGlvbiB0byBkZWZpbmUgc29ydCBvcmRlci5cbiAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyBgYXJyYXlgLlxuICovXG5mdW5jdGlvbiBiYXNlU29ydEJ5KGFycmF5LCBjb21wYXJlcikge1xuICB2YXIgbGVuZ3RoID0gYXJyYXkubGVuZ3RoO1xuXG4gIGFycmF5LnNvcnQoY29tcGFyZXIpO1xuICB3aGlsZSAobGVuZ3RoLS0pIHtcbiAgICBhcnJheVtsZW5ndGhdID0gYXJyYXlbbGVuZ3RoXS52YWx1ZTtcbiAgfVxuICByZXR1cm4gYXJyYXk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZVNvcnRCeTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseSortBy.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseTimes.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseTimes.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIj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V4cG9ydHMgPSBiYXNlVGltZXM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseTimes.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseToString.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_baseToString.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\"),\n arrayMap = __webpack_require__(/*! ./_arrayMap */ \"./node_modules/lodash/_arrayMap.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isSymbol = __webpack_require__(/*! ./isSymbol */ \"./node_modules/lodash/isSymbol.js\");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VUb1N0cmluZy5qcz9jZTg2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGFBQWEsbUJ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ash/_baseUnary.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_baseUnary.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VVbmFyeS5qcz9iMDQ3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsU0FBUztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19iYXNlVW5hcnkuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLnVuYXJ5YCB3aXRob3V0IHN1cHBvcnQgZm9yIHN0b3JpbmcgbWV0YWRhdGEuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7RnVuY3Rpb259IGZ1bmMgVGhlIGZ1bmN0aW9uIHRvIGNhcCBhcmd1bWVudHMgZm9yLlxuICogQHJldHVybnMge0Z1bmN0aW9ufSBSZXR1cm5zIHRoZSBuZXcgY2FwcGVkIGZ1bmN0aW9uLlxuICovXG5mdW5jdGlvbiBiYXNlVW5hcnkoZnVuYykge1xuICByZXR1cm4gZnVuY3Rpb24odmFsdWUpIHtcbiAgICByZXR1cm4gZnVuYyh2YWx1ZSk7XG4gIH07XG59XG5cbm1vZHVsZS5leHBvcnRzID0gYmFzZVVuYXJ5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseUnary.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseUniq.js": /*!******************************************!*\ !*** ./node_modules/lodash/_baseUniq.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var SetCache = __webpack_require__(/*! ./_SetCache */ \"./node_modules/lodash/_SetCache.js\"),\n arrayIncludes = __webpack_require__(/*! ./_arrayIncludes */ \"./node_modules/lodash/_arrayIncludes.js\"),\n arrayIncludesWith = __webpack_require__(/*! ./_arrayIncludesWith */ \"./node_modules/lodash/_arrayIncludesWith.js\"),\n cacheHas = __webpack_require__(/*! ./_cacheHas */ \"./node_modules/lodash/_cacheHas.js\"),\n createSet = __webpack_require__(/*! ./_createSet */ \"./node_modules/lodash/_createSet.js\"),\n setToArray = __webpack_require__(/*! ./_setToArray */ \"./node_modules/lodash/_setToArray.js\");\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VVbmlxLmpzPzJjNjYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFBZSxtQkFBTyxDQUFDLHVEQUFhO0FBQ3BDLG9CQUFvQixtQkFBTyxDQUFDLGlFQUFrQjtBQUM5Qyx3QkFBd0IsbUJBQU8sQ0FBQyx5RUFBc0I7QUFDdEQsZUFBZSxtQkFBTyxDQUFDLHVEQUFhO0FBQ3BDLGdCQUFnQixtQkFBTyxDQUFDLHlEQUFjO0FBQ3RDLGlCQUFpQixtQkFBTyxDQUFDLDJEQUFlOztBQUV4QztBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxNQUFNO0FBQ2pCLFdBQVcsU0FBUztBQUNwQixXQUFXLFNBQVM7QUFDcEIsYUFBYSxNQUFNO0FBQ25CO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtB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ZWQgPT09IGNvbXB1dGVkKSB7XG4gICAgICB2YXIgc2VlbkluZGV4ID0gc2Vlbi5sZW5ndGg7XG4gICAgICB3aGlsZSAoc2VlbkluZGV4LS0pIHtcbiAgICAgICAgaWYgKHNlZW5bc2VlbkluZGV4XSA9PT0gY29tcHV0ZWQpIHtcbiAgICAgICAgICBjb250aW51ZSBvdXRlcjtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKGl0ZXJhdGVlKSB7XG4gICAgICAgIHNlZW4ucHVzaChjb21wdXRlZCk7XG4gICAgICB9XG4gICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgfVxuICAgIGVsc2UgaWYgKCFpbmNsdWRlcyhzZWVuLCBjb21wdXRlZCwgY29tcGFyYXRvcikpIHtcbiAgICAgIGlmIChzZWVuICE9PSByZXN1bHQpIHtcbiAgICAgICAgc2Vlbi5wdXNoKGNvbXB1dGVkKTtcbiAgICAgIH1cbiAgICAgIHJlc3VsdC5wdXNoKHZhbHVlKTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlVW5pcTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseUniq.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseValues.js": /*!********************************************!*\ !*** ./node_modules/lodash/_baseValues.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayMap = __webpack_require__(/*! ./_arrayMap */ \"./node_modules/lodash/_arrayMap.js\");\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n//# sourceURL=[module]\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pIHtcbiAgcmV0dXJuIGFycmF5TWFwKHByb3BzLCBmdW5jdGlvbihrZXkpIHtcbiAgICByZXR1cm4gb2JqZWN0W2tleV07XG4gIH0pO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGJhc2VWYWx1ZXM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseValues.js\n"); /***/ }), /***/ "./node_modules/lodash/_baseZipObject.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_baseZipObject.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\nfunction baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n}\n\nmodule.exports = baseZipObject;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Jhc2VaaXBPYmplY3QuanM/ZDcwZCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsTUFBTTtBQUNqQixXQUFXLE1BQU07QUFDakIsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fYmFzZVppcE9iamVjdC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogVGhpcyBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLnppcE9iamVjdGAgd2hpY2ggYXNzaWducyB2YWx1ZXMgdXNpbmcgYGFzc2lnbkZ1bmNgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5fSBwcm9wcyBUaGUgcHJvcGVydHkgaWRlbnRpZmllcnMuXG4gKiBAcGFyYW0ge0FycmF5fSB2YWx1ZXMgVGhlIHByb3BlcnR5IHZhbHVlcy5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IGFzc2lnbkZ1bmMgVGhlIGZ1bmN0aW9uIHRvIGFzc2lnbiB2YWx1ZXMuXG4gKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIHRoZSBuZXcgb2JqZWN0LlxuICovXG5mdW5jdGlvbiBiYXNlWmlwT2JqZWN0KHByb3BzLCB2YWx1ZXMsIGFzc2lnbkZ1bmMpIHtcbiAgdmFyIGluZGV4ID0gLTEsXG4gICAgICBsZW5ndGggPSBwcm9wcy5sZW5ndGgsXG4gICAgICB2YWxzTGVuZ3RoID0gdmFsdWVzLmxlbmd0aCxcbiAgICAgIHJlc3VsdCA9IHt9O1xuXG4gIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgdmFyIHZhbHVlID0gaW5kZXggPCB2YWxzTGVuZ3RoID8gdmFsdWVzW2luZGV4XSA6IHVuZGVmaW5lZDtcbiAgICBhc3NpZ25GdW5jKHJlc3VsdCwgcHJvcHNbaW5kZXhdLCB2YWx1ZSk7XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBiYXNlWmlwT2JqZWN0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_baseZipObject.js\n"); /***/ }), /***/ "./node_modules/lodash/_cacheHas.js": /*!******************************************!*\ !*** ./node_modules/lodash/_cacheHas.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NhY2hlSGFzLmpzP2M1ODQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NhY2hlSGFzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDaGVja3MgaWYgYSBgY2FjaGVgIHZhbHVlIGZvciBga2V5YCBleGlzdHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBjYWNoZSBUaGUgY2FjaGUgdG8gcXVlcnkuXG4gKiBAcGFyYW0ge3N0cmluZ30ga2V5IFRoZSBrZXkgb2YgdGhlIGVudHJ5IHRvIGNoZWNrLlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGFuIGVudHJ5IGZvciBga2V5YCBleGlzdHMsIGVsc2UgYGZhbHNlYC5cbiAqL1xuZnVuY3Rpb24gY2FjaGVIYXMoY2FjaGUsIGtleSkge1xuICByZXR1cm4gY2FjaGUuaGFzKGtleSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY2FjaGVIYXM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_cacheHas.js\n"); /***/ }), /***/ "./node_modules/lodash/_castFunction.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_castFunction.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var identity = __webpack_require__(/*! ./identity */ \"./node_modules/lodash/identity.js\");\n\n/**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\nfunction castFunction(value) {\n return typeof value == 'function' ? value : identity;\n}\n\nmodule.exports = castFunction;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nhc3RGdW5jdGlvbi5qcz8xMzA0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWUsbUJBQU8sQ0FBQyxxREFBWTs7QUFFbkM7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLFNBQVM7QUFDdEI7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19jYXN0RnVuY3Rpb24uanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaWRlbnRpdHkgPSByZXF1aXJlKCcuL2lkZW50aXR5Jyk7XG5cbi8qKlxuICogQ2FzdHMgYHZhbHVlYCB0byBgaWRlbnRpdHlgIGlmIGl0J3Mgbm90IGEgZnVuY3Rpb24uXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGluc3BlY3QuXG4gKiBAcmV0dXJucyB7RnVuY3Rpb259IFJldHVybnMgY2FzdCBmdW5jdGlvbi5cbiAqL1xuZnVuY3Rpb24gY2FzdEZ1bmN0aW9uKHZhbHVlKSB7XG4gIHJldHVybiB0eXBlb2YgdmFsdWUgPT0gJ2Z1bmN0aW9uJyA/IHZhbHVlIDogaWRlbnRpdHk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY2FzdEZ1bmN0aW9uO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_castFunction.js\n"); /***/ }), /***/ "./node_modules/lodash/_castPath.js": /*!******************************************!*\ !*** ./node_modules/lodash/_castPath.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isKey = __webpack_require__(/*! ./_isKey */ \"./node_modules/lodash/_isKey.js\"),\n stringToPath = __webpack_require__(/*! ./_stringToPath */ \"./node_modules/lodash/_stringToPath.js\"),\n toString = __webpack_require__(/*! ./toString */ \"./node_modules/lodash/toString.js\");\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nhc3RQYXRoLmpzP2UyZTQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxtQkFBTyxDQUFDLG1EQUFXO0FBQ2pDLFlBQVksbUJBQU8sQ0FBQyxpREFBVTtBQUM5QixtQkFBbUIsbUJBQ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IGNhc3RQYXRoO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_castPath.js\n"); /***/ }), /***/ "./node_modules/lodash/_cloneArrayBuffer.js": /*!**************************************************!*\ !*** ./node_modules/lodash/_cloneArrayBuffer.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Uint8Array = __webpack_require__(/*! ./_Uint8Array */ \"./node_modules/lodash/_Uint8Array.js\");\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nsb25lQXJyYXlCdWZmZXIuanM/ZjhhZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsbUJBQU8sQ0FBQywyREFBZTs7QUFFeEM7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLFlBQVk7QUFDdkIsYUFBYSxZQUFZO0FBQ3pCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nsb25lQXJyYXlCdWZmZXIuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgVWludDhBcnJheSA9IHJlcXVpcmUoJy4vX1VpbnQ4QXJyYXknKTtcblxuLyoqXG4gKiBDcmVhdGVzIGEgY2xvbmUgb2YgYGFycmF5QnVmZmVyYC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtBcnJheUJ1ZmZlcn0gYXJyYXlCdWZmZXIgVGhlIGFycmF5IGJ1ZmZlciB0byBjbG9uZS5cbiAqIEByZXR1cm5zIHtBcnJheUJ1ZmZlcn0gUmV0dXJucyB0aGUgY2xvbmVkIGFycmF5IGJ1ZmZlci5cbiAqL1xuZnVuY3Rpb24gY2xvbmVBcnJheUJ1ZmZlcihhcnJheUJ1ZmZlcikge1xuICB2YXIgcmVzdWx0ID0gbmV3IGFycmF5QnVmZmVyLmNvbnN0cnVjdG9yKGFycmF5QnVmZmVyLmJ5dGVMZW5ndGgpO1xuICBuZXcgVWludDhBcnJheShyZXN1bHQpLnNldChuZXcgVWludDhBcnJheShhcnJheUJ1ZmZlcikpO1xuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsb25lQXJyYXlCdWZmZXI7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_cloneArrayBuffer.js\n"); /***/ }), /***/ "./node_modules/lodash/_cloneBuffer.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_cloneBuffer.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nsb25lQnVmZmVyLmpzP2U1MzgiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEseURBQVcsbUJBQU8sQ0FBQywrQ0FBUzs7QUFFNUI7QUFDQSxrQkFBa0IsS0FBMEI7O0FBRTVDO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxRQUFRO0FBQ25CLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19jbG9uZUJ1ZmZlci5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciByb290ID0gcmVxdWlyZSgnLi9fcm9vdCcpO1xuXG4vKiogRGV0ZWN0IGZyZWUgdmFyaWFibGUgYGV4cG9ydHNgLiAqL1xudmFyIGZyZWVFeHBvcnRzID0gdHlwZW9mIGV4cG9ydHMgPT0gJ29iamVjdCcgJiYgZXhwb3J0cyAmJiAhZXhwb3J0cy5ub2Rl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3VsdCA9IGFsbG9jVW5zYWZlID8gYWxsb2NVbnNhZmUobGVuZ3RoKSA6IG5ldyBidWZmZXIuY29uc3RydWN0b3IobGVuZ3RoKTtcblxuICBidWZmZXIuY29weShyZXN1bHQpO1xuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsb25lQnVmZmVyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_cloneBuffer.js\n"); /***/ }), /***/ "./node_modules/lodash/_cloneDataView.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_cloneDataView.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ \"./node_modules/lodash/_cloneArrayBuffer.js\");\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nsb25lRGF0YVZpZXcuanM/NWQ4OSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1QkFBdUIsbUJBQU8sQ0FBQyx1RUFBcUI7O0FBRXBEO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsUUFBUTtBQUNuQixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nsb25lRGF0YVZpZXcuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY2xvbmVBcnJheUJ1ZmZlciA9IHJlcXVpcmUoJy4vX2Nsb25lQXJyYXlCdWZmZXInKTtcblxuLyoqXG4gKiBDcmVhdGVzIGEgY2xvbmUgb2YgYGRhdGFWaWV3YC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IGRhdGFWaWV3IFRoZSBkYXRhIHZpZXcgdG8gY2xvbmUuXG4gKiBAcGFyYW0ge2Jvb2xlYW59IFtpc0RlZXBdIFNwZWNpZnkgYSBkZWVwIGNsb25lLlxuICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgY2xvbmVkIGRhdGEgdmlldy5cbiAqL1xuZnVuY3Rpb24gY2xvbmVEYXRhVmlldyhkYXRhVmlldywgaXNEZWVwKSB7XG4gIHZhciBidWZmZXIgPSBpc0RlZXAgPyBjbG9uZUFycmF5QnVmZmVyKGRhdGFWaWV3LmJ1ZmZlcikgOiBkYXRhVmlldy5idWZmZXI7XG4gIHJldHVybiBuZXcgZGF0YVZpZXcuY29uc3RydWN0b3IoYnVmZmVyLCBkYXRhVmlldy5ieXRlT2Zmc2V0LCBkYXRhVmlldy5ieXRlTGVuZ3RoKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjbG9uZURhdGFWaWV3O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_cloneDataView.js\n"); /***/ }), /***/ "./node_modules/lodash/_cloneRegExp.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_cloneRegExp.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nsb25lUmVnRXhwLmpzPzZmNmMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fY2xvbmVSZWdFeHAuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogVXNlZCB0byBtYXRjaCBgUmVnRXhwYCBmbGFncyBmcm9tIHRoZWlyIGNvZXJjZWQgc3RyaW5nIHZhbHVlcy4gKi9cbnZhciByZUZsYWdzID0gL1xcdyokLztcblxuLyoqXG4gKiBDcmVhdGVzIGEgY2xvbmUgb2YgYHJlZ2V4cGAuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSByZWdleHAgVGhlIHJlZ2V4cCB0byBjbG9uZS5cbiAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIGNsb25lZCByZWdleHAuXG4gKi9cbmZ1bmN0aW9uIGNsb25lUmVnRXhwKHJlZ2V4cCkge1xuICB2YXIgcmVzdWx0ID0gbmV3IHJlZ2V4cC5jb25zdHJ1Y3RvcihyZWdleHAuc291cmNlLCByZUZsYWdzLmV4ZWMocmVnZXhwKSk7XG4gIHJlc3VsdC5sYXN0SW5kZXggPSByZWdleHAubGFzdEluZGV4O1xuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsb25lUmVnRXhwO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_cloneRegExp.js\n"); /***/ }), /***/ "./node_modules/lodash/_cloneSymbol.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_cloneSymbol.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\");\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nsb25lU3ltYm9sLmpzP2EyZGIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsYUFBYSxtQkFBTyxDQUFDLG1EQUFXOztBQUVoQztBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fY2xvbmVTeW1ib2wuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgU3ltYm9sID0gcmVxdWlyZSgnLi9fU3ltYm9sJyk7XG5cbi8qKiBVc2VkIHRvIGNvbnZlcnQgc3ltYm9scyB0byBwcmltaXRpdmVzIGFuZCBzdHJpbmdzLiAqL1xudmFyIHN5bWJvbFByb3RvID0gU3ltYm9sID8gU3ltYm9sLnByb3RvdHlwZSA6IHVuZGVmaW5lZCxcbiAgICBzeW1ib2xWYWx1ZU9mID0gc3ltYm9sUHJvdG8gPyBzeW1ib2xQcm90by52YWx1ZU9mIDogdW5kZWZpbmVkO1xuXG4vKipcbiAqIENyZWF0ZXMgYSBjbG9uZSBvZiB0aGUgYHN5bWJvbGAgb2JqZWN0LlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gc3ltYm9sIFRoZSBzeW1ib2wgb2JqZWN0IHRvIGNsb25lLlxuICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgY2xvbmVkIHN5bWJvbCBvYmplY3QuXG4gKi9cbmZ1bmN0aW9uIGNsb25lU3ltYm9sKHN5bWJvbCkge1xuICByZXR1cm4gc3ltYm9sVmFsdWVPZiA/IE9iamVjdChzeW1ib2xWYWx1ZU9mLmNhbGwoc3ltYm9sKSkgOiB7fTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjbG9uZVN5bWJvbDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_cloneSymbol.js\n"); /***/ }), /***/ "./node_modules/lodash/_cloneTypedArray.js": /*!*************************************************!*\ !*** ./node_modules/lodash/_cloneTypedArray.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ \"./node_modules/lodash/_cloneArrayBuffer.js\");\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2Nsb25lVHlwZWRBcnJheS5qcz9jOGZlIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHVCQUF1QixtQkFBTyxDQUFDLHVFQUFxQjs7QUFFcEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxRQUFRO0FBQ25CLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fY2xvbmVUeXBlZEFycmF5LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGNsb25lQXJyYXlCdWZmZXIgPSByZXF1aXJlKCcuL19jbG9uZUFycmF5QnVmZmVyJyk7XG5cbi8qKlxuICogQ3JlYXRlcyBhIGNsb25lIG9mIGB0eXBlZEFycmF5YC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IHR5cGVkQXJyYXkgVGhlIHR5cGVkIGFycmF5IHRvIGNsb25lLlxuICogQHBhcmFtIHtib29sZWFufSBbaXNEZWVwXSBTcGVjaWZ5IGEgZGVlcCBjbG9uZS5cbiAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIGNsb25lZCB0eXBlZCBhcnJheS5cbiAqL1xuZnVuY3Rpb24gY2xvbmVUeXBlZEFycmF5KHR5cGVkQXJyYXksIGlzRGVlcCkge1xuICB2YXIgYnVmZmVyID0gaXNEZWVwID8gY2xvbmVBcnJheUJ1ZmZlcih0eXBlZEFycmF5LmJ1ZmZlcikgOiB0eXBlZEFycmF5LmJ1ZmZlcjtcbiAgcmV0dXJuIG5ldyB0eXBlZEFycmF5LmNvbnN0cnVjdG9yKGJ1ZmZlciwgdHlwZWRBcnJheS5ieXRlT2Zmc2V0LCB0eXBlZEFycmF5Lmxlbmd0aCk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY2xvbmVUeXBlZEFycmF5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_cloneTypedArray.js\n"); /***/ }), /***/ "./node_modules/lodash/_compareAscending.js": /*!**************************************************!*\ !*** ./node_modules/lodash/_compareAscending.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSymbol = __webpack_require__(/*! ./isSymbol */ \"./node_modules/lodash/isSymbol.js\");\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvbXBhcmVBc2NlbmRpbmcuanM/Y2FlNyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFlLG1CQUFPLENBQUMscURBQVk7O0FBRW5DO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsV0FBVyxFQUFFO0FBQ2IsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19jb21wYXJlQXNjZW5kaW5nLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzU3ltYm9sID0gcmVxdWlyZSgnLi9pc1N5bWJvbCcpO1xuXG4vKipcbiAqIENvbXBhcmVzIHZhbHVlcyB0byBzb3J0IHRoZW0gaW4gYXNjZW5kaW5nIG9yZGVyLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBjb21wYXJlLlxuICogQHBhcmFtIHsqfSBvdGhlciBUaGUgb3RoZXIgdmFsdWUgdG8gY29tcGFyZS5cbiAqIEByZXR1cm5zIHtudW1iZXJ9IFJldHVybnMgdGhlIHNvcnQgb3JkZXIgaW5kaWNhdG9yIGZvciBgdmFsdW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bElzRGVmaW5lZCAmJiB2YWxJc1JlZmxleGl2ZSAmJiAhdmFsSXNOdWxsICYmICF2YWxJc1N5bWJvbCkgfHxcbiAgICAgICAgKG90aElzTnVsbCAmJiB2YWxJc0RlZmluZWQgJiYgdmFsSXNSZWZsZXhpdmUpIHx8XG4gICAgICAgICghb3RoSXNEZWZpbmVkICYmIHZhbElzUmVmbGV4aXZlKSB8fFxuICAgICAgICAhb3RoSXNSZWZsZXhpdmUpIHtcbiAgICAgIHJldHVybiAtMTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIDA7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY29tcGFyZUFzY2VuZGluZztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_compareAscending.js\n"); /***/ }), /***/ "./node_modules/lodash/_compareMultiple.js": /*!*************************************************!*\ !*** ./node_modules/lodash/_compareMultiple.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var compareAscending = __webpack_require__(/*! ./_compareAscending */ \"./node_modules/lodash/_compareAscending.js\");\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvbXBhcmVNdWx0aXBsZS5qcz8yMTY0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHVCQUF1QixtQkFBTyxDQUFDLHVFQUFxQjs7QUFFcEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLG1CQUFtQjtBQUM5QixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19jb21wYXJlTXVsdGlwbGUuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29tcGFyZUFzY2VuZGluZyA9IHJlcXVpcmUoJy4vX2NvbXBhcmVBc2NlbmRpbmcnKTtcblxuLyoqXG4gKiBVc2VkIGJ5IGBfLm9yZGVyQnlgIHRvIGNvbXBhcmUgbXVsdGlwbGUgcHJvcGVydGllcyBvZiBhIHZhbHVlIHRvIGFub3RoZXJcbiAqIGFuZCBzdGFibGUgc29ydCB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XG4gICAgaWYgKHJlc3VsdCkge1xuICAgICAgaWYgKGluZGV4ID49IG9yZGVyc0xlbmd0aCkge1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgfVxuICAgICAgdmFyIG9yZGVyID0gb3JkZXJzW2luZGV4XTtcbiAgICAgIHJldHVybiByZXN1bHQgKiAob3JkZXIgPT0gJ2Rlc2MnID8gLTEgOiAxKTtcbiAgICB9XG4gIH1cbiAgLy8gRml4ZXMgYW4gYEFycmF5I3NvcnRgIGJ1ZyBpbiB0aGUgSlMgZW5naW5lIGVtYmVkZGVkIGluIEFkb2JlIGFwcGxpY2F0aW9uc1xuICAvLyB0aGF0IGNhdXNlcyBpdCwgdW5kZXIgY2VydGFpbiBjaXJjdW1zdGFuY2VzLCB0byBwcm92aWRlIHRoZSBzYW1lIHZhbHVlIGZvclxuICAvLyBgb2JqZWN0YCBhbmQgYG90aGVyYC4gU2VlIGh0dHBzOi8vZ2l0aHViLmNvbS9qYXNoa2VuYXMvdW5kZXJzY29yZS9wdWxsLzEyNDdcbiAgLy8gZm9yIG1vcmUgZGV0YWlscy5cbiAgLy9cbiAgLy8gVGhpcyBhbHNvIGVuc3VyZXMgYSBzdGFibGUgc29ydCBpbiBWOCBhbmQgb3RoZXIgZW5naW5lcy5cbiAgLy8gU2VlIGh0dHBzOi8vYnVncy5jaHJvbWl1bS5vcmcvcC92OC9pc3N1ZXMvZGV0YWlsP2lkPTkwIGZvciBtb3JlIGRldGFpbHMuXG4gIHJldHVybiBvYmplY3QuaW5kZXggLSBvdGhlci5pbmRleDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjb21wYXJlTXVsdGlwbGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_compareMultiple.js\n"); /***/ }), /***/ "./node_modules/lodash/_copyArray.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_copyArray.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvcHlBcnJheS5qcz80MzU5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxNQUFNO0FBQ2pCLFdBQVcsTUFBTTtBQUNqQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fY29weUFycmF5LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3BpZXMgdGhlIHZhbHVlcyBvZiBgc291cmNlYCB0byBgYXJyYXlgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5fSBzb3VyY2UgVGhlIGFycmF5IHRvIGNvcHkgdmFsdWVzIGZyb20uXG4gKiBAcGFyYW0ge0FycmF5fSBbYXJyYXk9W11dIFRoZSBhcnJheSB0byBjb3B5IHZhbHVlcyB0by5cbiAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyBgYXJyYXlgLlxuICovXG5mdW5jdGlvbiBjb3B5QXJyYXkoc291cmNlLCBhcnJheSkge1xuICB2YXIgaW5kZXggPSAtMSxcbiAgICAgIGxlbmd0aCA9IHNvdXJjZS5sZW5ndGg7XG5cbiAgYXJyYXkgfHwgKGFycmF5ID0gQXJyYXkobGVuZ3RoKSk7XG4gIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgYXJyYXlbaW5kZXhdID0gc291cmNlW2luZGV4XTtcbiAgfVxuICByZXR1cm4gYXJyYXk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY29weUFycmF5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_copyArray.js\n"); /***/ }), /***/ "./node_modules/lodash/_copyObject.js": /*!********************************************!*\ !*** ./node_modules/lodash/_copyObject.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var assignValue = __webpack_require__(/*! ./_assignValue */ \"./node_modules/lodash/_assignValue.js\"),\n baseAssignValue = __webpack_require__(/*! ./_baseAssignValue */ \"./node_modules/lodash/_baseAssignValue.js\");\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvcHlPYmplY3QuanM/OGVlYiJdLCJuYW1lcyI6W10sIm1hcHBpb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waWVkIHZhbHVlcy5cbiAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgYG9iamVjdGAuXG4gKi9cbmZ1bmN0aW9uIGNvcHlPYmplY3Qoc291cmNlLCBwcm9wcywgb2JqZWN0LCBjdXN0b21pemVyKSB7XG4gIHZhciBpc05ldyA9ICFvYmplY3Q7XG4gIG9iamVjdCB8fCAob2JqZWN0ID0ge30pO1xuXG4gIHZhciBpbmRleCA9IC0xLFxuICAgICAgbGVuZ3RoID0gcHJvcHMubGVuZ3RoO1xuXG4gIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgdmFyIGtleSA9IHByb3BzW2luZGV4XTtcblxuICAgIHZhciBuZXdWYWx1ZSA9IGN1c3RvbWl6ZXJcbiAgICAgID8gY3VzdG9taXplcihvYmplY3Rba2V5XSwgc291cmNlW2tleV0sIGtleSwgb2JqZWN0LCBzb3VyY2UpXG4gICAgICA6IHVuZGVmaW5lZDtcblxuICAgIGlmIChuZXdWYWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICBuZXdWYWx1ZSA9IHNvdXJjZVtrZXldO1xuICAgIH1cbiAgICBpZiAoaXNOZXcpIHtcbiAgICAgIGJhc2VBc3NpZ25WYWx1ZShvYmplY3QsIGtleSwgbmV3VmFsdWUpO1xuICAgIH0gZWxzZSB7XG4gICAgICBhc3NpZ25WYWx1ZShvYmplY3QsIGtleSwgbmV3VmFsdWUpO1xuICAgIH1cbiAgfVxuICByZXR1cm4gb2JqZWN0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNvcHlPYmplY3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_copyObject.js\n"); /***/ }), /***/ "./node_modules/lodash/_copySymbols.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_copySymbols.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var copyObject = __webpack_require__(/*! ./_copyObject */ \"./node_modules/lodash/_copyObject.js\"),\n getSymbols = __webpack_require__(/*! ./_getSymbols */ \"./node_modules/lodash/_getSymbols.js\");\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvcHlTeW1ib2xzLmpzPzU0ZWIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7QUFDeEMsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTyxXQUFXO0FBQzdCLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvcHlTeW1ib2xzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGNvcHlPYmplY3QgPSByZXF1aXJlKCcuL19jb3B5T2JqZWN0JyksXG4gICAgZ2V0U3ltYm9scyA9IHJlcXVpcmUoJy4vX2dldFN5bWJvbHMnKTtcblxuLyoqXG4gKiBDb3BpZXMgb3duIHN5bWJvbHMgb2YgYHNvdXJjZWAgdG8gYG9iamVjdGAuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBzb3VyY2UgVGhlIG9iamVjdCB0byBjb3B5IHN5bWJvbHMgZnJvbS5cbiAqIEBwYXJhbSB7T2JqZWN0fSBbb2JqZWN0PXt9XSBUaGUgb2JqZWN0IHRvIGNvcHkgc3ltYm9scyB0by5cbiAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgYG9iamVjdGAuXG4gKi9cbmZ1bmN0aW9uIGNvcHlTeW1ib2xzKHNvdXJjZSwgb2JqZWN0KSB7XG4gIHJldHVybiBjb3B5T2JqZWN0KHNvdXJjZSwgZ2V0U3ltYm9scyhzb3VyY2UpLCBvYmplY3QpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNvcHlTeW1ib2xzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_copySymbols.js\n"); /***/ }), /***/ "./node_modules/lodash/_copySymbolsIn.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_copySymbolsIn.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var copyObject = __webpack_require__(/*! ./_copyObject */ \"./node_modules/lodash/_copyObject.js\"),\n getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ \"./node_modules/lodash/_getSymbolsIn.js\");\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvcHlTeW1ib2xzSW4uanM/MTA0MSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsbUJBQU8sQ0FBQywyREFBZTtBQUN4QyxtQkFBbUIsbUJBQU8sQ0FBQywrREFBaUI7O0FBRTVDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTyxXQUFXO0FBQzdCLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvcHlTeW1ib2xzSW4uanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29weU9iamVjdCA9IHJlcXVpcmUoJy4vX2NvcHlPYmplY3QnKSxcbiAgICBnZXRTeW1ib2xzSW4gPSByZXF1aXJlKCcuL19nZXRTeW1ib2xzSW4nKTtcblxuLyoqXG4gKiBDb3BpZXMgb3duIGFuZCBpbmhlcml0ZWQgc3ltYm9scyBvZiBgc291cmNlYCB0byBgb2JqZWN0YC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IHNvdXJjZSBUaGUgb2JqZWN0IHRvIGNvcHkgc3ltYm9scyBmcm9tLlxuICogQHBhcmFtIHtPYmplY3R9IFtvYmplY3Q9e31dIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIHRvLlxuICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyBgb2JqZWN0YC5cbiAqL1xuZnVuY3Rpb24gY29weVN5bWJvbHNJbihzb3VyY2UsIG9iamVjdCkge1xuICByZXR1cm4gY29weU9iamVjdChzb3VyY2UsIGdldFN5bWJvbHNJbihzb3VyY2UpLCBvYmplY3QpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNvcHlTeW1ib2xzSW47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_copySymbolsIn.js\n"); /***/ }), /***/ "./node_modules/lodash/_coreJsData.js": /*!********************************************!*\ !*** ./node_modules/lodash/_coreJsData.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NvcmVKc0RhdGEuanM/ZGEwMyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXLG1CQUFPLENBQUMsK0NBQVM7O0FBRTVCO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19jb3JlSnNEYXRhLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIHJvb3QgPSByZXF1aXJlKCcuL19yb290Jyk7XG5cbi8qKiBVc2VkIHRvIGRldGVjdCBvdmVycmVhY2hpbmcgY29yZS1qcyBzaGltcy4gKi9cbnZhciBjb3JlSnNEYXRhID0gcm9vdFsnX19jb3JlLWpzX3NoYXJlZF9fJ107XG5cbm1vZHVsZS5leHBvcnRzID0gY29yZUpzRGF0YTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_coreJsData.js\n"); /***/ }), /***/ "./node_modules/lodash/_createAssigner.js": /*!************************************************!*\ !*** ./node_modules/lodash/_createAssigner.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseRest = __webpack_require__(/*! ./_baseRest */ \"./node_modules/lodash/_baseRest.js\"),\n isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ \"./node_modules/lodash/_isIterateeCall.js\");\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NyZWF0ZUFzc2lnbmVyLmpzPzJlYzEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFBZSxtQkFBTyxDQUFDLHVEQUFhO0FBQ3BDLHFCQUFxQixtQkFBTyxDQUFDLG1FQUFtQjs7QUFFaEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLFNBQVM7QUFDcEIsYUFBYSxTQUFTO0FBQ3RCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxHQUFHO0FBQ0g7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19jcmVhdGVBc3NpZ25lci5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlUmVzdCA9IHJlcXVpcmUoJy4vX2Jhc2VSZXN0JyksXG4gICAgaXNJdGVyYXRlZUNhbGwgPSByZXF1aXJlKCcuL19pc0l0ZXJhdGVlQ2FsbCcpO1xuXG4vKipcbiAqIENyZ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gICAgICBpZiAoc291cmNlKSB7XG4gICAgICAgIGFzc2lnbmVyKG9iamVjdCwgc291cmNlLCBpbmRleCwgY3VzdG9taXplcik7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiBvYmplY3Q7XG4gIH0pO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNyZWF0ZUFzc2lnbmVyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_createAssigner.js\n"); /***/ }), /***/ "./node_modules/lodash/_createBaseEach.js": /*!************************************************!*\ !*** ./node_modules/lodash/_createBaseEach.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\");\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NyZWF0ZUJhc2VFYWNoLmpzPzk1MGEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsa0JBQWtCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXpDO0FBQ0E7QUFDQTtBQUNBO0FBQ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H1cbiAgICB2YXIgbGVuZ3RoID0gY29sbGVjdGlvbi5sZW5ndGgsXG4gICAgICAgIGluZGV4ID0gZnJvbVJpZ2h0ID8gbGVuZ3RoIDogLTEsXG4gICAgICAgIGl0ZXJhYmxlID0gT2JqZWN0KGNvbGxlY3Rpb24pO1xuXG4gICAgd2hpbGUgKChmcm9tUmlnaHQgPyBpbmRleC0tIDogKytpbmRleCA8IGxlbmd0aCkpIHtcbiAgICAgIGlmIChpdGVyYXRlZShpdGVyYWJsZVtpbmRleF0sIGluZGV4LCBpdGVyYWJsZSkgPT09IGZhbHNlKSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gY29sbGVjdGlvbjtcbiAgfTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjcmVhdGVCYXNlRWFjaDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_createBaseEach.js\n"); /***/ }), /***/ "./node_modules/lodash/_createBaseFor.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_createBaseFor.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NyZWF0ZUJhc2VGb3Iuan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pdGVyYWJsZSkgPT09IGZhbHNlKSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gb2JqZWN0O1xuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNyZWF0ZUJhc2VGb3I7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_createBaseFor.js\n"); /***/ }), /***/ "./node_modules/lodash/_createFind.js": /*!********************************************!*\ !*** ./node_modules/lodash/_createFind.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIteratee = __webpack_require__(/*! ./_baseIteratee */ \"./node_modules/lodash/_baseIteratee.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\"),\n keys = __webpack_require__(/*! ./keys */ \"./node_modules/lodash/keys.js\");\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = baseIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n}\n\nmodule.exports = createFind;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NyZWF0ZUZpbmQuanM/NWNhMCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxtQkFBbUIsbUJBQU8sQ0FBQywrREFBaUI7QUFDNUMsa0JBQWtCLG1CQUFPLEN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AzKTtcbiAgICAgIGNvbGxlY3Rpb24gPSBrZXlzKGNvbGxlY3Rpb24pO1xuICAgICAgcHJlZGljYXRlID0gZnVuY3Rpb24oa2V5KSB7IHJldHVybiBpdGVyYXRlZShpdGVyYWJsZVtrZXldLCBrZXksIGl0ZXJhYmxlKTsgfTtcbiAgICB9XG4gICAgdmFyIGluZGV4ID0gZmluZEluZGV4RnVuYyhjb2xsZWN0aW9uLCBwcmVkaWNhdGUsIGZyb21JbmRleCk7XG4gICAgcmV0dXJuIGluZGV4ID4gLTEgPyBpdGVyYWJsZVtpdGVyYXRlZSA/IGNvbGxlY3Rpb25baW5kZXhdIDogaW5kZXhdIDogdW5kZWZpbmVkO1xuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNyZWF0ZUZpbmQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_createFind.js\n"); /***/ }), /***/ "./node_modules/lodash/_createRange.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_createRange.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseRange = __webpack_require__(/*! ./_baseRange */ \"./node_modules/lodash/_baseRange.js\"),\n isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ \"./node_modules/lodash/_isIterateeCall.js\"),\n toFinite = __webpack_require__(/*! ./toFinite */ \"./node_modules/lodash/toFinite.js\");\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\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R1cm5zIHRoZSBuZXcgcmFuZ2UgZnVuY3Rpb24uXG4gKi9cbmZ1bmN0aW9uIGNyZWF0ZVJhbmdlKGZyb21SaWdodCkge1xuICByZXR1cm4gZnVuY3Rpb24oc3RhcnQsIGVuZCwgc3RlcCkge1xuICAgIGlmIChzdGVwICYmIHR5cGVvZiBzdGVwICE9ICdudW1iZXInICYmIGlzSXRlcmF0ZWVDYWxsKHN0YXJ0LCBlbmQsIHN0ZXApKSB7XG4gICAgICBlbmQgPSBzdGVwID0gdW5kZWZpbmVkO1xuICAgIH1cbiAgICAvLyBFbnN1cmUgdGhlIHNpZ24gb2YgYC0wYCBpcyBwcmVzZXJ2ZWQuXG4gICAgc3RhcnQgPSB0b0Zpbml0ZShzdGFydCk7XG4gICAgaWYgKGVuZCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICBlbmQgPSBzdGFydDtcbiAgICAgIHN0YXJ0ID0gMDtcbiAgICB9IGVsc2Uge1xuICAgICAgZW5kID0gdG9GaW5pdGUoZW5kKTtcbiAgICB9XG4gICAgc3RlcCA9IHN0ZXAgPT09IHVuZGVmaW5lZCA/IChzdGFydCA8IGVuZCA/IDEgOiAtMSkgOiB0b0Zpbml0ZShzdGVwKTtcbiAgICByZXR1cm4gYmFzZVJhbmdlKHN0YXJ0LCBlbmQsIHN0ZXAsIGZyb21SaWdodCk7XG4gIH07XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY3JlYXRlUmFuZ2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_createRange.js\n"); /***/ }), /***/ "./node_modules/lodash/_createSet.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_createSet.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Set = __webpack_require__(/*! ./_Set */ \"./node_modules/lodash/_Set.js\"),\n noop = __webpack_require__(/*! ./noop */ \"./node_modules/lodash/noop.js\"),\n setToArray = __webpack_require__(/*! ./_setToArray */ \"./node_modules/lodash/_setToArray.js\");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2NyZWF0ZVNldC5qcz83NTBhIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLFVBQVUsbUJBQU8sQ0FBQyw2Q0FBUTtBQUMxQixXQUFXLG1CQUFPLENBQUMsNkNBQVE7QUFDM0IsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXhDO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE1BQU07QUFDakIsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fY3JlYXRlU2V0LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIFNldCA9IHJlcXVpcmUoJy4vX1NldCcpLFxuICAgIG5vb3AgPSByZXF1aXJlKCcuL25vb3AnKSxcbiAgICBzZXRUb0FycmF5ID0gcmVxdWlyZSgnLi9fc2V0VG9BcnJheScpO1xuXG4vKiogVXNlZCBhcyByZWZlcmVuY2VzIGZvciB2YXJpb3VzIGBOdW1iZXJgIGNvbnN0YW50cy4gKi9cbnZhciBJTkZJTklUWSA9IDEgLyAwO1xuXG4vKipcbiAqIENyZWF0ZXMgYSBzZXQgb2JqZWN0IG9mIGB2YWx1ZXNgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0FycmF5fSB2YWx1ZXMgVGhlIHZhbHVlcyB0byBhZGQgdG8gdGhlIHNldC5cbiAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIG5ldyBzZXQuXG4gKi9cbnZhciBjcmVhdGVTZXQgPSAhKFNldCAmJiAoMSAvIHNldFRvQXJyYXkobmV3IFNldChbLC0wXSkpWzFdKSA9PSBJTkZJTklUWSkgPyBub29wIDogZnVuY3Rpb24odmFsdWVzKSB7XG4gIHJldHVybiBuZXcgU2V0KHZhbHVlcyk7XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGNyZWF0ZVNldDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_createSet.js\n"); /***/ }), /***/ "./node_modules/lodash/_defineProperty.js": /*!************************************************!*\ !*** ./node_modules/lodash/_defineProperty.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getNative = __webpack_require__(/*! ./_getNative */ \"./node_modules/lodash/_getNative.js\");\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2RlZmluZVByb3BlcnR5LmpzPzNiNGEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQWdCLG1CQUFPLENBQUMseURBQWM7O0FBRXRDO0FBQ0E7QUFDQTtBQUNBLFdBQVcsUUFBUTtBQUNuQjtBQUNBLEdBQUc7QUFDSCxDQUFDOztBQUVEIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fZGVmaW5lUHJvcGVydHkuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0TmF0aXZlID0gcmVxdWlyZSgnLi9fZ2V0TmF0aXZlJyk7XG5cbnZhciBkZWZpbmVQcm9wZXJ0eSA9IChmdW5jdGlvbigpIHtcbiAgdHJ5IHtcbiAgICB2YXIgZnVuYyA9IGdldE5hdGl2ZShPYmplY3QsICdkZWZpbmVQcm9wZXJ0eScpO1xuICAgIGZ1bmMoe30sICcnLCB7fSk7XG4gICAgcmV0dXJuIGZ1bmM7XG4gIH0gY2F0Y2ggKGUpIHt9XG59KCkpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGRlZmluZVByb3BlcnR5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_defineProperty.js\n"); /***/ }), /***/ "./node_modules/lodash/_equalArrays.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_equalArrays.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var SetCache = __webpack_require__(/*! ./_SetCache */ \"./node_modules/lodash/_SetCache.js\"),\n arraySome = __webpack_require__(/*! ./_arraySome */ \"./node_modules/lodash/_arraySome.js\"),\n cacheHas = __webpack_require__(/*! ./_cacheHas */ \"./node_modules/lodash/_cacheHas.js\");\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2VxdWFsQXJyYXlzLmpzP2EyYmUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFBZSxtQkFBTyxDQUFDLHVEQUFhO0FBQ3BDLGdCQUFnQixtQkFBTyxDQUFDLHlEQUFjO0FBQ3RDLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTs7QUFFcEM7QUFDQTtBQUNBOztBQUVBO0FBQ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O1xuICAgICAgfVxuICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICBicmVhaztcbiAgICB9XG4gICAgLy8gUmVjdXJzaXZlbHkgY29tcGFyZSBhcnJheXMgKHN1c2NlcHRpYmxlIHRvIGNhbGwgc3RhY2sgbGltaXRzKS5cbiAgICBpZiAoc2Vlbikge1xuICAgICAgaWYgKCFhcnJheVNvbWUob3RoZXIsIGZ1bmN0aW9uKG90aFZhbHVlLCBvdGhJbmRleCkge1xuICAgICAgICAgICAgaWYgKCFjYWNoZUhhcyhzZWVuLCBvdGhJbmRleCkgJiZcbiAgICAgICAgICAgICAgICAoYXJyVmFsdWUgPT09IG90aFZhbHVlIHx8IGVxdWFsRnVuYyhhcnJWYWx1ZSwgb3RoVmFsdWUsIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIHN0YWNrKSkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHNlZW4ucHVzaChvdGhJbmRleCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSkpIHtcbiAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgIH0gZWxzZSBpZiAoIShcbiAgICAgICAgICBhcnJWYWx1ZSA9PT0gb3RoVmFsdWUgfHxcbiAgICAgICAgICAgIGVxdWFsRnVuYyhhcnJWYWx1ZSwgb3RoVmFsdWUsIGJpdG1hc2ssIGN1c3RvbWl6ZXIsIHN0YWNrKVxuICAgICAgICApKSB7XG4gICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgIGJyZWFrO1xuICAgIH1cbiAgfVxuICBzdGFja1snZGVsZXRlJ10oYXJyYXkpO1xuICBzdGFja1snZGVsZXRlJ10ob3RoZXIpO1xuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGVxdWFsQXJyYXlzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_equalArrays.js\n"); /***/ }), /***/ "./node_modules/lodash/_equalByTag.js": /*!********************************************!*\ !*** ./node_modules/lodash/_equalByTag.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\"),\n Uint8Array = __webpack_require__(/*! ./_Uint8Array */ \"./node_modules/lodash/_Uint8Array.js\"),\n eq = __webpack_require__(/*! ./eq */ \"./node_modules/lodash/eq.js\"),\n equalArrays = __webpack_require__(/*! ./_equalArrays */ \"./node_modules/lodash/_equalArrays.js\"),\n mapToArray = __webpack_require__(/*! ./_mapToArray */ \"./node_modules/lodash/_mapToArray.js\"),\n setToArray = __webpack_require__(/*! ./_setToArray */ \"./node_modules/lodash/_setToArray.js\");\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2VxdWFsQnlUYWcuanM/MWMzYyJdLCJuYW1lcyI6W10sIm1h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vIEFzc3VtZSBjeWNsaWMgdmFsdWVzIGFyZSBlcXVhbC5cbiAgICAgIHZhciBzdGFja2VkID0gc3RhY2suZ2V0KG9iamVjdCk7XG4gICAgICBpZiAoc3RhY2tlZCkge1xuICAgICAgICByZXR1cm4gc3RhY2tlZCA9PSBvdGhlcjtcbiAgICAgIH1cbiAgICAgIGJpdG1hc2sgfD0gQ09NUEFSRV9VTk9SREVSRURfRkxBRztcblxuICAgICAgLy8gUmVjdXJzaXZlbHkgY29tcGFyZSBvYmplY3RzIChzdXNjZXB0aWJsZSB0byBjYWxsIHN0YWNrIGxpbWl0cykuXG4gICAgICBzdGFjay5zZXQob2JqZWN0LCBvdGhlcik7XG4gICAgICB2YXIgcmVzdWx0ID0gZXF1YWxBcnJheXMoY29udmVydChvYmplY3QpLCBjb252ZXJ0KG90aGVyKSwgYml0bWFzaywgY3VzdG9taXplciwgZXF1YWxGdW5jLCBzdGFjayk7XG4gICAgICBzdGFja1snZGVsZXRlJ10ob2JqZWN0KTtcbiAgICAgIHJldHVybiByZXN1bHQ7XG5cbiAgICBjYXNlIHN5bWJvbFRhZzpcbiAgICAgIGlmIChzeW1ib2xWYWx1ZU9mKSB7XG4gICAgICAgIHJldHVybiBzeW1ib2xWYWx1ZU9mLmNhbGwob2JqZWN0KSA9PSBzeW1ib2xWYWx1ZU9mLmNhbGwob3RoZXIpO1xuICAgICAgfVxuICB9XG4gIHJldHVybiBmYWxzZTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBlcXVhbEJ5VGFnO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_equalByTag.js\n"); /***/ }), /***/ "./node_modules/lodash/_equalObjects.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_equalObjects.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getAllKeys = __webpack_require__(/*! ./_getAllKeys */ \"./node_modules/lodash/_getAllKeys.js\");\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2VxdWFsT2JqZWN0cy5qcz9iMWU1Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlCQUFpQixtQkFBTyxDQUFDLDJEQUFlOztBQUV4QztBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsV0FBVyxTQUFTO0FBQ3BCLFdBQVcsU0FBUztBQUNwQixXQUFXLE9BQU87QUFDbEIsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2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icpO1xuICB9XG4gIGlmIChyZXN1bHQgJiYgIXNraXBDdG9yKSB7XG4gICAgdmFyIG9iakN0b3IgPSBvYmplY3QuY29uc3RydWN0b3IsXG4gICAgICAgIG90aEN0b3IgPSBvdGhlci5jb25zdHJ1Y3RvcjtcblxuICAgIC8vIE5vbiBgT2JqZWN0YCBvYmplY3QgaW5zdGFuY2VzIHdpdGggZGlmZmVyZW50IGNvbnN0cnVjdG9ycyBhcmUgbm90IGVxdWFsLlxuICAgIGlmIChvYmpDdG9yICE9IG90aEN0b3IgJiZcbiAgICAgICAgKCdjb25zdHJ1Y3RvcicgaW4gb2JqZWN0ICYmICdjb25zdHJ1Y3RvcicgaW4gb3RoZXIpICYmXG4gICAgICAgICEodHlwZW9mIG9iakN0b3IgPT0gJ2Z1bmN0aW9uJyAmJiBvYmpDdG9yIGluc3RhbmNlb2Ygb2JqQ3RvciAmJlxuICAgICAgICAgIHR5cGVvZiBvdGhDdG9yID09ICdmdW5jdGlvbicgJiYgb3RoQ3RvciBpbnN0YW5jZW9mIG90aEN0b3IpKSB7XG4gICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICB9XG4gIH1cbiAgc3RhY2tbJ2RlbGV0ZSddKG9iamVjdCk7XG4gIHN0YWNrWydkZWxldGUnXShvdGhlcik7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gZXF1YWxPYmplY3RzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_equalObjects.js\n"); /***/ }), /***/ "./node_modules/lodash/_flatRest.js": /*!******************************************!*\ !*** ./node_modules/lodash/_flatRest.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var flatten = __webpack_require__(/*! ./flatten */ \"./node_modules/lodash/flatten.js\"),\n overRest = __webpack_require__(/*! ./_overRest */ \"./node_modules/lodash/_overRest.js\"),\n setToString = __webpack_require__(/*! ./_setToString */ \"./node_modules/lodash/_setToString.js\");\n\n/**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\nfunction flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n}\n\nmodule.exports = flatRest;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2ZsYXRSZXN0LmpzP2M2Y2YiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxtQkFBTyxDQUFDLG1EQUFXO0FBQ2pDLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTtBQUNwQyxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7O0FBRTFDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsU0FBUztBQUN0QjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2ZsYXRSZXN0LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGZsYXR0ZW4gPSByZXF1aXJlKCcuL2ZsYXR0ZW4nKSxcbiAgICBvdmVyUmVzdCA9IHJlcXVpcmUoJy4vX292ZXJSZXN0JyksXG4gICAgc2V0VG9TdHJpbmcgPSByZXF1aXJlKCcuL19zZXRUb1N0cmluZycpO1xuXG4vKipcbiAqIEEgc3BlY2lhbGl6ZWQgdmVyc2lvbiBvZiBgYmFzZVJlc3RgIHdoaWNoIGZsYXR0ZW5zIHRoZSByZXN0IGFycmF5LlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBmdW5jIFRoZSBmdW5jdGlvbiB0byBhcHBseSBhIHJlc3QgcGFyYW1ldGVyIHRvLlxuICogQHJldHVybnMge0Z1bmN0aW9ufSBSZXR1cm5zIHRoZSBuZXcgZnVuY3Rpb24uXG4gKi9cbmZ1bmN0aW9uIGZsYXRSZXN0KGZ1bmMpIHtcbiAgcmV0dXJuIHNldFRvU3RyaW5nKG92ZXJSZXN0KGZ1bmMsIHVuZGVmaW5lZCwgZmxhdHRlbiksIGZ1bmMgKyAnJyk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gZmxhdFJlc3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_flatRest.js\n"); /***/ }), /***/ "./node_modules/lodash/_freeGlobal.js": /*!********************************************!*\ !*** ./node_modules/lodash/_freeGlobal.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2ZyZWVHbG9iYWwuanM/NTg1YSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fZnJlZUdsb2JhbC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBEZXRlY3QgZnJlZSB2YXJpYWJsZSBgZ2xvYmFsYCBmcm9tIE5vZGUuanMuICovXG52YXIgZnJlZUdsb2JhbCA9IHR5cGVvZiBnbG9iYWwgPT0gJ29iamVjdCcgJiYgZ2xvYmFsICYmIGdsb2JhbC5PYmplY3QgPT09IE9iamVjdCAmJiBnbG9iYWw7XG5cbm1vZHVsZS5leHBvcnRzID0gZnJlZUdsb2JhbDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_freeGlobal.js\n"); /***/ }), /***/ "./node_modules/lodash/_getAllKeys.js": /*!********************************************!*\ !*** ./node_modules/lodash/_getAllKeys.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ \"./node_modules/lodash/_baseGetAllKeys.js\"),\n getSymbols = __webpack_require__(/*! ./_getSymbols */ \"./node_modules/lodash/_getSymbols.js\"),\n keys = __webpack_require__(/*! ./keys */ \"./node_modules/lodash/keys.js\");\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldEFsbEtleXMuanM/YTk5NCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxxQkFBcUIsbUJBQU8sQ0FBQyxtRUFBbUI7QUFDaEQsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7QUFDeEMsV0FBVyxtQkFBTyxDQUFDLDZDQUFROztBQUUzQjtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19nZXRBbGxLZXlzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VHZXRBbGxLZXlzID0gcmVxdWlyZSgnLi9fYmFzZUdldEFsbEtleXMnKSxcbiAgICBnZXRTeW1ib2xzID0gcmVxdWlyZSgnLi9fZ2V0U3ltYm9scycpLFxuICAgIGtleXMgPSByZXF1aXJlKCcuL2tleXMnKTtcblxuLyoqXG4gKiBDcmVhdGVzIGFuIGFycmF5IG9mIG93biBlbnVtZXJhYmxlIHByb3BlcnR5IG5hbWVzIGFuZCBzeW1ib2xzIG9mIGBvYmplY3RgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gcXVlcnkuXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIGFycmF5IG9mIHByb3BlcnR5IG5hbWVzIGFuZCBzeW1ib2xzLlxuICovXG5mdW5jdGlvbiBnZXRBbGxLZXlzKG9iamVjdCkge1xuICByZXR1cm4gYmFzZUdldEFsbEtleXMob2JqZWN0LCBrZXlzLCBnZXRTeW1ib2xzKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBnZXRBbGxLZXlzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getAllKeys.js\n"); /***/ }), /***/ "./node_modules/lodash/_getAllKeysIn.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_getAllKeysIn.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGetAllKeys = __webpack_require__(/*! ./_baseGetAllKeys */ \"./node_modules/lodash/_baseGetAllKeys.js\"),\n getSymbolsIn = __webpack_require__(/*! ./_getSymbolsIn */ \"./node_modules/lodash/_getSymbolsIn.js\"),\n keysIn = __webpack_require__(/*! ./keysIn */ \"./node_modules/lodash/keysIn.js\");\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldEFsbEtleXNJbi5qcz8xYmFjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHFCQUFxQixtQkFBTyxDQUFDLG1FQUFtQjtBQUNoRCxtQkFBbUIsbUJBQU8sQ0FBQywrREFBaUI7QUFDNUMsYUFBYSxtQkFBTyxDQUFDLGlEQUFVOztBQUUvQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsTUFBTTtBQUNuQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldEFsbEtleXNJbi5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlR2V0QWxsS2V5cyA9IHJlcXVpcmUoJy4vX2Jhc2VHZXRBbGxLZXlzJyksXG4gICAgZ2V0U3ltYm9sc0luID0gcmVxdWlyZSgnLi9fZ2V0U3ltYm9sc0luJyksXG4gICAga2V5c0luID0gcmVxdWlyZSgnLi9rZXlzSW4nKTtcblxuLyoqXG4gKiBDcmVhdGVzIGFuIGFycmF5IG9mIG93biBhbmQgaW5oZXJpdGVkIGVudW1lcmFibGUgcHJvcGVydHkgbmFtZXMgYW5kXG4gKiBzeW1ib2xzIG9mIGBvYmplY3RgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gcXVlcnkuXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIGFycmF5IG9mIHByb3BlcnR5IG5hbWVzIGFuZCBzeW1ib2xzLlxuICovXG5mdW5jdGlvbiBnZXRBbGxLZXlzSW4ob2JqZWN0KSB7XG4gIHJldHVybiBiYXNlR2V0QWxsS2V5cyhvYmplY3QsIGtleXNJbiwgZ2V0U3ltYm9sc0luKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBnZXRBbGxLZXlzSW47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getAllKeysIn.js\n"); /***/ }), /***/ "./node_modules/lodash/_getMapData.js": /*!********************************************!*\ !*** ./node_modules/lodash/_getMapData.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isKeyable = __webpack_require__(/*! ./_isKeyable */ \"./node_modules/lodash/_isKeyable.js\");\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldE1hcERhdGEuanM/NDI0NSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYzs7QUFFdEM7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsRUFBRTtBQUNmO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fZ2V0TWFwRGF0YS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBpc0tleWFibGUgPSByZXF1aXJlKCcuL19pc0tleWFibGUnKTtcblxuLyoqXG4gKiBHZXRzIHRoZSBkYXRhIGZvciBgbWFwYC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IG1hcCBUaGUgbWFwIHRvIHF1ZXJ5LlxuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUgcmVmZXJlbmNlIGtleS5cbiAqIEByZXR1cm5zIHsqfSBSZXR1cm5zIHRoZSBtYXAgZGF0YS5cbiAqL1xuZnVuY3Rpb24gZ2V0TWFwRGF0YShtYXAsIGtleSkge1xuICB2YXIgZGF0YSA9IG1hcC5fX2RhdGFfXztcbiAgcmV0dXJuIGlzS2V5YWJsZShrZXkpXG4gICAgPyBkYXRhW3R5cGVvZiBrZXkgPT0gJ3N0cmluZycgPyAnc3RyaW5nJyA6ICdoYXNoJ11cbiAgICA6IGRhdGEubWFwO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGdldE1hcERhdGE7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getMapData.js\n"); /***/ }), /***/ "./node_modules/lodash/_getMatchData.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_getMatchData.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isStrictComparable = __webpack_require__(/*! ./_isStrictComparable */ \"./node_modules/lodash/_isStrictComparable.js\"),\n keys = __webpack_require__(/*! ./keys */ \"./node_modules/lodash/keys.js\");\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldE1hdGNoRGF0YS5qcz8zYmI0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHlCQUF5QixtQkFBTyxDQUFDLDJFQUF1QjtBQUN4RCxXQUFXLG1CQUFPLENBQUMsNkNBQVE7O0FBRTNCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsTUFBTTtBQUNuQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19nZXRNYXRjaERhdGEuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaXNTdHJpY3RDb21wYXJhYmxlID0gcmVxdWlyZSgnLi9faXNTdHJpY3RDb21wYXJhYmxlJyksXG4gICAga2V5cyA9IHJlcXVpcmUoJy4va2V5cycpO1xuXG4vKipcbiAqIEdldHMgdGhlIHByb3BlcnR5IG5hbWVzLCB2YWx1ZXMsIGFuZCBjb21wYXJlIGZsYWdzIG9mIGBvYmplY3RgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gcXVlcnkuXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG1hdGNoIGRhdGEgb2YgYG9iamVjdGAuXG4gKi9cbmZ1bmN0aW9uIGdldE1hdGNoRGF0YShvYmplY3QpIHtcbiAgdmFyIHJlc3VsdCA9IGtleXMob2JqZWN0KSxcbiAgICAgIGxlbmd0aCA9IHJlc3VsdC5sZW5ndGg7XG5cbiAgd2hpbGUgKGxlbmd0aC0tKSB7XG4gICAgdmFyIGtleSA9IHJlc3VsdFtsZW5ndGhdLFxuICAgICAgICB2YWx1ZSA9IG9iamVjdFtrZXldO1xuXG4gICAgcmVzdWx0W2xlbmd0aF0gPSBba2V5LCB2YWx1ZSwgaXNTdHJpY3RDb21wYXJhYmxlKHZhbHVlKV07XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBnZXRNYXRjaERhdGE7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getMatchData.js\n"); /***/ }), /***/ "./node_modules/lodash/_getNative.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_getNative.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIsNative = __webpack_require__(/*! ./_baseIsNative */ \"./node_modules/lodash/_baseIsNative.js\"),\n getValue = __webpack_require__(/*! ./_getValue */ \"./node_modules/lodash/_getValue.js\");\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldE5hdGl2ZS5qcz8wYjA3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjtBQUM1QyxlQUFlLG1CQUFPLENBQUMsdURBQWE7O0FBRXBDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsT0FBTztBQUNsQixhQUFhLEVBQUU7QUFDZjtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fZ2V0TmF0aXZlLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VJc05hdGl2ZSA9IHJlcXVpcmUoJy4vX2Jhc2VJc05hdGl2ZScpLFxuICAgIGdldFZhbHVlID0gcmVxdWlyZSgnLi9fZ2V0VmFsdWUnKTtcblxuLyoqXG4gKiBHZXRzIHRoZSBuYXRpdmUgZnVuY3Rpb24gYXQgYGtleWAgb2YgYG9iamVjdGAuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIG9iamVjdCB0byBxdWVyeS5cbiAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgVGhlIGtleSBvZiB0aGUgbWV0aG9kIHRvIGdldC5cbiAqIEByZXR1cm5zIHsqfSBSZXR1cm5zIHRoZSBmdW5jdGlvbiBpZiBpdCdzIG5hdGl2ZSwgZWxzZSBgdW5kZWZpbmVkYC5cbiAqL1xuZnVuY3Rpb24gZ2V0TmF0aXZlKG9iamVjdCwga2V5KSB7XG4gIHZhciB2YWx1ZSA9IGdldFZhbHVlKG9iamVjdCwga2V5KTtcbiAgcmV0dXJuIGJhc2VJc05hdGl2ZSh2YWx1ZSkgPyB2YWx1ZSA6IHVuZGVmaW5lZDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBnZXROYXRpdmU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getNative.js\n"); /***/ }), /***/ "./node_modules/lodash/_getPrototype.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_getPrototype.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var overArg = __webpack_require__(/*! ./_overArg */ \"./node_modules/lodash/_overArg.js\");\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldFByb3RvdHlwZS5qcz8yZGNiIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsbUJBQU8sQ0FBQyxxREFBWTs7QUFFbEM7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldFByb3RvdHlwZS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBvdmVyQXJnID0gcmVxdWlyZSgnLi9fb3ZlckFyZycpO1xuXG4vKiogQnVpbHQtaW4gdmFsdWUgcmVmZXJlbmNlcy4gKi9cbnZhciBnZXRQcm90b3R5cGUgPSBvdmVyQXJnKE9iamVjdC5nZXRQcm90b3R5cGVPZiwgT2JqZWN0KTtcblxubW9kdWxlLmV4cG9ydHMgPSBnZXRQcm90b3R5cGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getPrototype.js\n"); /***/ }), /***/ "./node_modules/lodash/_getRawTag.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_getRawTag.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldFJhd1RhZy5qcz8wMGZkIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGFBQWEsbUJBQU8sQ0FBQyxtREFBVzs7QUFFaEM7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLEdBQUc7O0FBRUg7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldFJhd1RhZy5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBTeW1ib2wgPSByZXF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gICAgICB0YWcgPSB2YWx1ZVtzeW1Ub1N0cmluZ1RhZ107XG5cbiAgdHJ5IHtcbiAgICB2YWx1ZVtzeW1Ub1N0cmluZ1RhZ10gPSB1bmRlZmluZWQ7XG4gICAgdmFyIHVubWFza2VkID0gdHJ1ZTtcbiAgfSBjYXRjaCAoZSkge31cblxuICB2YXIgcmVzdWx0ID0gbmF0aXZlT2JqZWN0VG9TdHJpbmcuY2FsbCh2YWx1ZSk7XG4gIGlmICh1bm1hc2tlZCkge1xuICAgIGlmIChpc093bikge1xuICAgICAgdmFsdWVbc3ltVG9TdHJpbmdUYWddID0gdGFnO1xuICAgIH0gZWxzZSB7XG4gICAgICBkZWxldGUgdmFsdWVbc3ltVG9TdHJpbmdUYWddO1xuICAgIH1cbiAgfVxuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGdldFJhd1RhZztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getRawTag.js\n"); /***/ }), /***/ "./node_modules/lodash/_getSymbols.js": /*!********************************************!*\ !*** ./node_modules/lodash/_getSymbols.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ \"./node_modules/lodash/_arrayFilter.js\"),\n stubArray = __webpack_require__(/*! ./stubArray */ \"./node_modules/lodash/stubArray.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldFN5bWJvbHMuanM/MzJmNCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7QUFDMUMsZ0JBQWdCLG1CQUFPLENBQUMsdURBQWE7O0FBRXJDO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsTUFBTTtBQUNuQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsR0FBRztBQUNIOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fZ2V0U3ltYm9scy5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBhcnJheUZpbHRlciA9IHJlcXVpcmUoJy4vX2FycmF5RmlsdGVyJyksXG4gICAgc3R1YkFycmF5ID0gcmVxdWlyZSgnLi9zdHViQXJyYXknKTtcblxuLyoqIFVzZWQgZm9yIGJ1aWx0LWluIG1ldGhvZCByZWZlcmVuY2VzLiAqL1xudmFyIG9iamVjdFByb3RvID0gT2JqZWN0LnByb3RvdHlwZTtcblxuLyoqIEJ1aWx0LWluIHZhbHVlIHJlZmVyZW5jZXMuICovXG52YXIgcHJvcGVydHlJc0VudW1lcmFibGUgPSBvYmplY3RQcm90by5wcm9wZXJ0eUlzRW51bWVyYWJsZTtcblxuLyogQnVpbHQtaW4gbWV0aG9kIHJlZmVyZW5jZXMgZm9yIHRob3NlIHdpdGggdGhlIHNhbWUgbmFtZSBhcyBvdGhlciBgbG9kYXNoYCBtZXRob2RzLiAqL1xudmFyIG5hdGl2ZUdldFN5bWJvbHMgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzO1xuXG4vKipcbiAqIENyZWF0ZXMgYW4gYXJyYXkgb2YgdGhlIG93biBlbnVtZXJhYmxlIHN5bWJvbHMgb2YgYG9iamVjdGAuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIG9iamVjdCB0byBxdWVyeS5cbiAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyB0aGUgYXJyYXkgb2Ygc3ltYm9scy5cbiAqL1xudmFyIGdldFN5bWJvbHMgPSAhbmF0aXZlR2V0U3ltYm9scyA/IHN0dWJBcnJheSA6IGZ1bmN0aW9uKG9iamVjdCkge1xuICBpZiAob2JqZWN0ID09IG51bGwpIHtcbiAgICByZXR1cm4gW107XG4gIH1cbiAgb2JqZWN0ID0gT2JqZWN0KG9iamVjdCk7XG4gIHJldHVybiBhcnJheUZpbHRlcihuYXRpdmVHZXRTeW1ib2xzKG9iamVjdCksIGZ1bmN0aW9uKHN5bWJvbCkge1xuICAgIHJldHVybiBwcm9wZXJ0eUlzRW51bWVyYWJsZS5jYWxsKG9iamVjdCwgc3ltYm9sKTtcbiAgfSk7XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGdldFN5bWJvbHM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getSymbols.js\n"); /***/ }), /***/ "./node_modules/lodash/_getSymbolsIn.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_getSymbolsIn.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayPush = __webpack_require__(/*! ./_arrayPush */ \"./node_modules/lodash/_arrayPush.js\"),\n getPrototype = __webpack_require__(/*! ./_getPrototype */ \"./node_modules/lodash/_getPrototype.js\"),\n getSymbols = __webpack_require__(/*! ./_getSymbols */ \"./node_modules/lodash/_getSymbols.js\"),\n stubArray = __webpack_require__(/*! ./stubArray */ \"./node_modules/lodash/stubArray.js\");\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldFN5bWJvbHNJbi5qcz9hMDI5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGdCQUFnQixtQkFBTyxDQUFDLHlEQUFjO0FBQ3RDLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjtBQUM1QyxpQkFBaUIsbUJBQU8sQ0FBQywyREFBZTtBQUN4QyxnQkFBZ0IsbUJBQU8sQ0FBQyx1REFBYTs7QUFFckM7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fZ2V0U3ltYm9sc0luLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGFycmF5UHVzaCA9IHJlcXVpcmUoJy4vX2FycmF5UHVzaCcpLFxuICAgIGdldFByb3RvdHlwZSA9IHJlcXVpcmUoJy4vX2dldFByb3RvdHlwZScpLFxuICAgIGdldFN5bWJvbHMgPSByZXF1aXJlKCcuL19nZXRTeW1ib2xzJyksXG4gICAgc3R1YkFycmF5ID0gcmVxdWlyZSgnLi9zdHViQXJyYXknKTtcblxuLyogQnVpbHQtaW4gbWV0aG9kIHJlZmVyZW5jZXMgZm9yIHRob3NlIHdpdGggdGhlIHNhbWUgbmFtZSBhcyBvdGhlciBgbG9kYXNoYCBtZXRob2RzLiAqL1xudmFyIG5hdGl2ZUdldFN5bWJvbHMgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzO1xuXG4vKipcbiAqIENyZWF0ZXMgYW4gYXJyYXkgb2YgdGhlIG93biBhbmQgaW5oZXJpdGVkIGVudW1lcmFibGUgc3ltYm9scyBvZiBgb2JqZWN0YC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IG9iamVjdCBUaGUgb2JqZWN0IHRvIHF1ZXJ5LlxuICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBhcnJheSBvZiBzeW1ib2xzLlxuICovXG52YXIgZ2V0U3ltYm9sc0luID0gIW5hdGl2ZUdldFN5bWJvbHMgPyBzdHViQXJyYXkgOiBmdW5jdGlvbihvYmplY3QpIHtcbiAgdmFyIHJlc3VsdCA9IFtdO1xuICB3aGlsZSAob2JqZWN0KSB7XG4gICAgYXJyYXlQdXNoKHJlc3VsdCwgZ2V0U3ltYm9scyhvYmplY3QpKTtcbiAgICBvYmplY3QgPSBnZXRQcm90b3R5cGUob2JqZWN0KTtcbiAgfVxuICByZXR1cm4gcmVzdWx0O1xufTtcblxubW9kdWxlLmV4cG9ydHMgPSBnZXRTeW1ib2xzSW47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getSymbolsIn.js\n"); /***/ }), /***/ "./node_modules/lodash/_getTag.js": /*!****************************************!*\ !*** ./node_modules/lodash/_getTag.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var DataView = __webpack_require__(/*! ./_DataView */ \"./node_modules/lodash/_DataView.js\"),\n Map = __webpack_require__(/*! ./_Map */ \"./node_modules/lodash/_Map.js\"),\n Promise = __webpack_require__(/*! ./_Promise */ \"./node_modules/lodash/_Promise.js\"),\n Set = __webpack_require__(/*! ./_Set */ \"./node_modules/lodash/_Set.js\"),\n WeakMap = __webpack_require__(/*! ./_WeakMap */ \"./node_modules/lodash/_WeakMap.js\"),\n baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n toSource = __webpack_require__(/*! ./_toSource */ \"./node_modules/lodash/_toSource.js\");\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldFRhZy5qcz80MmEyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTtBQUNwQyxVQUFVLG1CQUFPLENBQUMsNkNBQVE7QUFDMUIsY0FBYyxtQkFBTyxDQUFDLHFEQUFZO0FBQ2xDLFVBQVUsbUJBQU8sQ0FBQyw2Q0FBUTtBQUMxQixjQUFjLG1CQUFPLENBQUMscURBQVk7QUFDbEMsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7QUFDeEMsZUFBZSxtQkFBTyxDQUFDLHVEQUFhOztBQUVwQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fZ2V0VGFnLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIERhdGFWaWV3ID0gcmVxdWlyZSgnLi9fRGF0YVZpZXcnKSxcbiAgICBNYXAgPSByZX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2FzZSBwcm9taXNlQ3RvclN0cmluZzogcmV0dXJuIHByb21pc2VUYWc7XG4gICAgICAgIGNhc2Ugc2V0Q3RvclN0cmluZzogcmV0dXJuIHNldFRhZztcbiAgICAgICAgY2FzZSB3ZWFrTWFwQ3RvclN0cmluZzogcmV0dXJuIHdlYWtNYXBUYWc7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXN1bHQ7XG4gIH07XG59XG5cbm1vZHVsZS5leHBvcnRzID0gZ2V0VGFnO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getTag.js\n"); /***/ }), /***/ "./node_modules/lodash/_getValue.js": /*!******************************************!*\ !*** ./node_modules/lodash/_getValue.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2dldFZhbHVlLmpzPzM2OTgiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsRUFBRTtBQUNmO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fZ2V0VmFsdWUuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdldHMgdGhlIHZhbHVlIGF0IGBrZXlgIG9mIGBvYmplY3RgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gW29iamVjdF0gVGhlIG9iamVjdCB0byBxdWVyeS5cbiAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgVGhlIGtleSBvZiB0aGUgcHJvcGVydHkgdG8gZ2V0LlxuICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIHByb3BlcnR5IHZhbHVlLlxuICovXG5mdW5jdGlvbiBnZXRWYWx1ZShvYmplY3QsIGtleSkge1xuICByZXR1cm4gb2JqZWN0ID09IG51bGwgPyB1bmRlZmluZWQgOiBvYmplY3Rba2V5XTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBnZXRWYWx1ZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_getValue.js\n"); /***/ }), /***/ "./node_modules/lodash/_hasPath.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_hasPath.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var castPath = __webpack_require__(/*! ./_castPath */ \"./node_modules/lodash/_castPath.js\"),\n isArguments = __webpack_require__(/*! ./isArguments */ \"./node_modules/lodash/isArguments.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isIndex = __webpack_require__(/*! ./_isIndex */ \"./node_modules/lodash/_isIndex.js\"),\n isLength = __webpack_require__(/*! ./isLength */ \"./node_modules/lodash/isLength.js\"),\n toKey = __webpack_require__(/*! ./_toKey */ \"./node_modules/lodash/_toKey.js\");\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2hhc1BhdGguanM/ZTJjMCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFlLG1CQUFPLENBQUMsdURBQWE7QUFDcEMsa0JBQWtCLG1CQUFPLENBQUMsMkRBQWU7QUFDekMsY0FBYyxtQkFBTyxDQUFDLG1EQUFXO0FBQ2pDLGNBQWMsbUJBQU8sQ0FBQyxxREFBWTtBQUNsQyxlQUFlLG1CQUFPLENBQUMscURBQVk7QUFDbkMsWUFBWSxtQkFBTyxDQUFDLGlEQUFVOztBQUU5QjtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLGFBQWE7QUFDeEIsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19oYXNQYXRoLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGNhc3RQYXRoID0gcmVxdWlyZSgnLi9fY2FzdFBhdGgnKSxcbiAgICBpc0FyZ3VtZW50cyA9IHJlcXVpcmUoJy4vaXNBcmd1bWVudHMnKSxcbiAgICBpc0FycmF5ID0gcmVxdWlyZSgnLi9pc0FycmF5JyksXG4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Z3RoID0gb2JqZWN0ID09IG51bGwgPyAwIDogb2JqZWN0Lmxlbmd0aDtcbiAgcmV0dXJuICEhbGVuZ3RoICYmIGlzTGVuZ3RoKGxlbmd0aCkgJiYgaXNJbmRleChrZXksIGxlbmd0aCkgJiZcbiAgICAoaXNBcnJheShvYmplY3QpIHx8IGlzQXJndW1lbnRzKG9iamVjdCkpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGhhc1BhdGg7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_hasPath.js\n"); /***/ }), /***/ "./node_modules/lodash/_hasUnicode.js": /*!********************************************!*\ !*** ./node_modules/lodash/_hasUnicode.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n return reHasUnicode.test(string);\n}\n\nmodule.exports = hasUnicode;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfb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JvbSB0aGUgYXN0cmFsIHBsYW5lc10oaHR0cDovL2Vldi5lZS9ibG9nLzIwMTUvMDkvMTIvZGFyay1jb3JuZXJzLW9mLXVuaWNvZGUvKS4gKi9cbnZhciByZUhhc1VuaWNvZGUgPSBSZWdFeHAoJ1snICsgcnNaV0ogKyByc0FzdHJhbFJhbmdlICArIHJzQ29tYm9SYW5nZSArIHJzVmFyUmFuZ2UgKyAnXScpO1xuXG4vKipcbiAqIENoZWNrcyBpZiBgc3RyaW5nYCBjb250YWlucyBVbmljb2RlIHN5bWJvbHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7c3RyaW5nfSBzdHJpbmcgVGhlIHN0cmluZyB0byBpbnNwZWN0LlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGEgc3ltYm9sIGlzIGZvdW5kLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIGhhc1VuaWNvZGUoc3RyaW5nKSB7XG4gIHJldHVybiByZUhhc1VuaWNvZGUudGVzdChzdHJpbmcpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGhhc1VuaWNvZGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_hasUnicode.js\n"); /***/ }), /***/ "./node_modules/lodash/_hashClear.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_hashClear.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ \"./node_modules/lodash/_nativeCreate.js\");\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2hhc2hDbGVhci5qcz80OWY0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjs7QUFFNUM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2hhc2hDbGVhci5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBuYXRpdmVDcmVhdGUgPSByZXF1aXJlKCcuL19uYXRpdmVDcmVhdGUnKTtcblxuLyoqXG4gKiBSZW1vdmVzIGFsbCBrZXktdmFsdWUgZW50cmllcyBmcm9tIHRoZSBoYXNoLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBjbGVhclxuICogQG1lbWJlck9mIEhhc2hcbiAqL1xuZnVuY3Rpb24gaGFzaENsZWFyKCkge1xuICB0aGlzLl9fZGF0YV9fID0gbmF0aXZlQ3JlYXRlID8gbmF0aXZlQ3JlYXRlKG51bGwpIDoge307XG4gIHRoaXMuc2l6ZSA9IDA7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaGFzaENsZWFyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_hashClear.js\n"); /***/ }), /***/ "./node_modules/lodash/_hashDelete.js": /*!********************************************!*\ !*** ./node_modules/lodash/_hashDelete.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size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c3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBoYXNoRGVsZXRlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_hashDelete.js\n"); /***/ }), /***/ "./node_modules/lodash/_hashGet.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_hashGet.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ \"./node_modules/lodash/_nativeCreate.js\");\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2hhc2hHZXQuanM/YmJjMCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxtQkFBbUIsbUJBQU8sQ0FBQywrREFBaUI7O0FBRTVDO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLEVBQUU7QUFDZjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTt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hdGEsIGtleSkgPyBkYXRhW2tleV0gOiB1bmRlZmluZWQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaGFzaEdldDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_hashGet.js\n"); /***/ }), /***/ "./node_modules/lodash/_hashHas.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_hashHas.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ \"./node_modules/lodash/_nativeCreate.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2hhc2hIYXMuanM/N2E0OCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxtQkFBbUIsbUJBQU8sQ0FBQywrREFBaUI7O0FBRTVDO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19oYXNoSGFzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIG5hdGl2ZUNyZWF0ZSA9IHJlcXVpcmUoJy4vX25hdGl2ZUNyZWF0ZScpO1xuXG4vKiogVXNlZCBmb3IgYnVpbHQtaW4gbWV0aG9kIHJlZmVyZW5jZXMuICovXG52YXIgb2JqZWN0UHJvdG8gPSBPYmplY3QucHJvdG90eXBlO1xuXG4vKiogVXNlZCB0byBjaGVjayBvYmplY3RzIGZvciBvd24gcHJvcGVydGllcy4gKi9cbnZhciBoYXNPd25Qcm9wZXJ0eSA9IG9iamVjdFByb3RvLmhhc093blByb3BlcnR5O1xuXG4vKipcbiAqIENoZWNrcyBpZiBhIGhhc2ggdmFsdWUgZm9yIGBrZXlgIGV4aXN0cy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQG5hbWUgaGFzXG4gKiBAbWVtYmVyT2YgSGFzaFxuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSBlbnRyeSB0byBjaGVjay5cbiAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBhbiBlbnRyeSBmb3IgYGtleWAgZXhpc3RzLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIGhhc2hIYXMoa2V5KSB7XG4gIHZhciBkYXRhID0gdGhpcy5fX2RhdGFfXztcbiAgcmV0dXJuIG5hdGl2ZUNyZWF0ZSA/IChkYXRhW2tleV0gIT09IHVuZGVmaW5lZCkgOiBoYXNPd25Qcm9wZXJ0eS5jYWxsKGRhdGEsIGtleSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaGFzaEhhcztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_hashHas.js\n"); /***/ }), /***/ "./node_modules/lodash/_hashSet.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_hashSet.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var nativeCreate = __webpack_require__(/*! ./_nativeCreate */ \"./node_modules/lodash/_nativeCreate.js\");\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2hhc2hTZXQuanM/MjUyNCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxtQkFBbUIsbUJBQU8sQ0FBQywrREFBaUI7O0FBRTVDO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsRUFBRTtBQUNiLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2hhc2hTZXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbmF0aXZlQ3JlYXRlID0gcmVxdWlyZSgnLi9fbmF0aXZlQ3JlYXRlJyk7XG5cbi8qKiBVc2VkIHRvIHN0YW5kLWluIGZvciBgdW5kZWZpbmVkYCBoYXNoIHZhbHVlcy4gKi9cbnZhciBIQVNIX1VOREVGSU5FRCA9ICdfX2xvZGFzaF9oYXNoX3VuZGVmaW5lZF9fJztcblxuLyoqXG4gKiBTZXRzIHRoZSBoYXNoIGBrZXlgIHRvIGB2YWx1ZWAuXG4gKlxuICogQHByaXZhdGVcbiAqIEBuYW1lIHNldFxuICogQG1lbWJlck9mIEhhc2hcbiAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgVGhlIGtleSBvZiB0aGUgdmFsdWUgdG8gc2V0LlxuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gc2V0LlxuICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgaGFzaCBpbnN0YW5jZS5cbiAqL1xuZnVuY3Rpb24gaGFzaFNldChrZXksIHZhbHVlKSB7XG4gIHZhciBkYXRhID0gdGhpcy5fX2RhdGFfXztcbiAgdGhpcy5zaXplICs9IHRoaXMuaGFzKGtleSkgPyAwIDogMTtcbiAgZGF0YVtrZXldID0gKG5hdGl2ZUNyZWF0ZSAmJiB2YWx1ZSA9PT0gdW5kZWZpbmVkKSA/IEhBU0hfVU5ERUZJTkVEIDogdmFsdWU7XG4gIHJldHVybiB0aGlzO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGhhc2hTZXQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_hashSet.js\n"); /***/ }), /***/ "./node_modules/lodash/_initCloneArray.js": /*!************************************************!*\ !*** ./node_modules/lodash/_initCloneArray.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray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HJ1Y3RvcihsZW5ndGgpO1xuXG4gIC8vIEFkZCBwcm9wZXJ0aWVzIGFzc2lnbmVkIGJ5IGBSZWdFeHAjZXhlY2AuXG4gIGlmIChsZW5ndGggJiYgdHlwZW9mIGFycmF5WzBdID09ICdzdHJpbmcnICYmIGhhc093blByb3BlcnR5LmNhbGwoYXJyYXksICdpbmRleCcpKSB7XG4gICAgcmVzdWx0LmluZGV4ID0gYXJyYXkuaW5kZXg7XG4gICAgcmVzdWx0LmlucHV0ID0gYXJyYXkuaW5wdXQ7XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBpbml0Q2xvbmVBcnJheTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_initCloneArray.js\n"); /***/ }), /***/ "./node_modules/lodash/_initCloneByTag.js": /*!************************************************!*\ !*** ./node_modules/lodash/_initCloneByTag.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var cloneArrayBuffer = __webpack_require__(/*! ./_cloneArrayBuffer */ \"./node_modules/lodash/_cloneArrayBuffer.js\"),\n cloneDataView = __webpack_require__(/*! ./_cloneDataView */ \"./node_modules/lodash/_cloneDataView.js\"),\n cloneRegExp = __webpack_require__(/*! ./_cloneRegExp */ \"./node_modules/lodash/_cloneRegExp.js\"),\n cloneSymbol = __webpack_require__(/*! ./_cloneSymbol */ \"./node_modules/lodash/_cloneSymbol.js\"),\n cloneTypedArray = __webpack_require__(/*! ./_cloneTypedArray */ \"./node_modules/lodash/_cloneTypedArray.js\");\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2luaXRDbG9uZUJ5VGFnLmpzP2MyYjYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsdUJBQXVCLG1CQUFPLENBQUMsdUVBQXFCO0FBQ3BELG9CQUFvQixtQkFBTyxDQUFDLGlFQUFrQjtBQUM5Q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jYXNlIGludDMyVGFnOlxuICAgIGNhc2UgdWludDhUYWc6IGNhc2UgdWludDhDbGFtcGVkVGFnOiBjYXNlIHVpbnQxNlRhZzogY2FzZSB1aW50MzJUYWc6XG4gICAgICByZXR1cm4gY2xvbmVUeXBlZEFycmF5KG9iamVjdCwgaXNEZWVwKTtcblxuICAgIGNhc2UgbWFwVGFnOlxuICAgICAgcmV0dXJuIG5ldyBDdG9yO1xuXG4gICAgY2FzZSBudW1iZXJUYWc6XG4gICAgY2FzZSBzdHJpbmdUYWc6XG4gICAgICByZXR1cm4gbmV3IEN0b3Iob2JqZWN0KTtcblxuICAgIGNhc2UgcmVnZXhwVGFnOlxuICAgICAgcmV0dXJuIGNsb25lUmVnRXhwKG9iamVjdCk7XG5cbiAgICBjYXNlIHNldFRhZzpcbiAgICAgIHJldHVybiBuZXcgQ3RvcjtcblxuICAgIGNhc2Ugc3ltYm9sVGFnOlxuICAgICAgcmV0dXJuIGNsb25lU3ltYm9sKG9iamVjdCk7XG4gIH1cbn1cblxubW9kdWxlLmV4cG9ydHMgPSBpbml0Q2xvbmVCeVRhZztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_initCloneByTag.js\n"); /***/ }), /***/ "./node_modules/lodash/_initCloneObject.js": /*!*************************************************!*\ !*** ./node_modules/lodash/_initCloneObject.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseCreate = __webpack_require__(/*! ./_baseCreate */ \"./node_modules/lodash/_baseCreate.js\"),\n getPrototype = __webpack_require__(/*! ./_getPrototype */ \"./node_modules/lodash/_getPrototype.js\"),\n isPrototype = __webpack_require__(/*! ./_isPrototype */ \"./node_modules/lodash/_isPrototype.js\");\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2luaXRDbG9uZU9iamVjdC5qcz9mYTIxIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlCQUFpQixtQkFBTyxDQUFDLDJEQUFlO0FBQ3hDLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjtBQUM1QyxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7O0FBRTFDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19pbml0Q2xvbmVPYmplY3QuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYmFzZUNyZWF0ZSA9IHJlcXVpcmUoJy4vX2Jhc2VDcmVhdGUnKSxcbiAgICBnZXRQcm90b3R5cGUgPSByZXF1aXJlKCcuL19nZXRQcm90b3R5cGUnKSxcbiAgICBpc1Byb3RvdHlwZSA9IHJlcXVpcmUoJy4vX2lzUHJvdG90eXBlJyk7XG5cbi8qKlxuICogSW5pdGlhbGl6ZXMgYW4gb2JqZWN0IGNsb25lLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gY2xvbmUuXG4gKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIHRoZSBpbml0aWFsaXplZCBjbG9uZS5cbiAqL1xuZnVuY3Rpb24gaW5pdENsb25lT2JqZWN0KG9iamVjdCkge1xuICByZXR1cm4gKHR5cGVvZiBvYmplY3QuY29uc3RydWN0b3IgPT0gJ2Z1bmN0aW9uJyAmJiAhaXNQcm90b3R5cGUob2JqZWN0KSlcbiAgICA/IGJhc2VDcmVhdGUoZ2V0UHJvdG90eXBlKG9iamVjdCkpXG4gICAgOiB7fTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBpbml0Q2xvbmVPYmplY3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_initCloneObject.js\n"); /***/ }), /***/ "./node_modules/lodash/_isFlattenable.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_isFlattenable.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\"),\n isArguments = __webpack_require__(/*! ./isArguments */ \"./node_modules/lodash/isArguments.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\");\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2lzRmxhdHRlbmFibGUuanM/MDYyMSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxhQUFhLG1CQUFPLENBQUMsbURBQVc7QUFDaEMsa0JBQWtCLG1CQUFPLENBQUMsMkRBQWU7QUFDekMsY0FBYyxtQkFBTyx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GbGF0dGVuYWJsZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_isFlattenable.js\n"); /***/ }), /***/ "./node_modules/lodash/_isIndex.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_isIndex.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2lzSW5kZXguanM/YzA5OCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixXQUFXLE9BQU87QUFDbEIsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19pc0luZGV4LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqIFVzZWQgYXMgcmVmZXJl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odash/_isIndex.js\n"); /***/ }), /***/ "./node_modules/lodash/_isIterateeCall.js": /*!************************************************!*\ !*** ./node_modules/lodash/_isIterateeCall.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var eq = __webpack_require__(/*! ./eq */ \"./node_modules/lodash/eq.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\"),\n isIndex = __webpack_require__(/*! ./_isIndex */ \"./node_modules/lodash/_isIndex.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\");\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2lzSXRlcmF0ZWVDYWxsLmpzPzlhZmYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsU0FBUyxtQkFBTyxDQUFDLHlDQUFNO0FBQ3ZCLGtCQUFrQixtQkFBTyxDQUFDLDJEQUFlO0FBQ3pDLGNBQWMsbUJBQU8sQ0FBQyxxREFBWTtBQUNsQyxlQUFlLG1CQUFPLENBQUMscURBQVk7O0FBRW5DO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsV0FBVyxFQUFFO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xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuICB2YXIgdHlwZSA9IHR5cGVvZiBpbmRleDtcbiAgaWYgKHR5cGUgPT0gJ251bWJlcidcbiAgICAgICAgPyAoaXNBcnJheUxpa2Uob2JqZWN0KSAmJiBpc0luZGV4KGluZGV4LCBvYmplY3QubGVuZ3RoKSlcbiAgICAgICAgOiAodHlwZSA9PSAnc3RyaW5nJyAmJiBpbmRleCBpbiBvYmplY3QpXG4gICAgICApIHtcbiAgICByZXR1cm4gZXEob2JqZWN0W2luZGV4XSwgdmFsdWUpO1xuICB9XG4gIHJldHVybiBmYWxzZTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBpc0l0ZXJhdGVlQ2FsbDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_isIterateeCall.js\n"); /***/ }), /***/ "./node_modules/lodash/_isKey.js": /*!***************************************!*\ !*** ./node_modules/lodash/_isKey.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isSymbol = __webpack_require__(/*! ./isSymbol */ \"./node_modules/lodash/isSymbol.js\");\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n//# sourceURL=[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sdWUgdG8gY2hlY2suXG4gKiBAcGFyYW0ge09iamVjdH0gW29iamVjdF0gVGhlIG9iamVjdCB0byBxdWVyeSBrZXlzIG9uLlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGB2YWx1ZWAgaXMgYSBwcm9wZXJ0eSBuYW1lLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIGlzS2V5KHZhbHVlLCBvYmplY3QpIHtcbiAgaWYgKGlzQXJyYXkodmFsdWUpKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG4gIHZhciB0eXBlID0gdHlwZW9mIHZhbHVlO1xuICBpZiAodHlwZSA9PSAnbnVtYmVyJyB8fCB0eXBlID09ICdzeW1ib2wnIHx8IHR5cGUgPT0gJ2Jvb2xlYW4nIHx8XG4gICAgICB2YWx1ZSA9PSBudWxsIHx8IGlzU3ltYm9sKHZhbHVlKSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG4gIHJldHVybiByZUlzUGxhaW5Qcm9wLnRlc3QodmFsdWUpIHx8ICFyZUlzRGVlcFByb3AudGVzdCh2YWx1ZSkgfHxcbiAgICAob2JqZWN0ICE9IG51bGwgJiYgdmFsdWUgaW4gT2JqZWN0KG9iamVjdCkpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGlzS2V5O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_isKey.js\n"); /***/ }), /***/ "./node_modules/lodash/_isKeyable.js": /*!*******************************************!*\ !*** ./node_modules/lodash/_isKeyable.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value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oiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_isKeyable.js\n"); /***/ }), /***/ "./node_modules/lodash/_isMasked.js": /*!******************************************!*\ !*** ./node_modules/lodash/_isMasked.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var coreJsData = __webpack_require__(/*! ./_coreJsData */ \"./node_modules/lodash/_coreJsData.js\");\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2lzTWFza2VkLmpzPzEzNjgiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQzs7QUFFRDtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsU0FBUztBQUNwQixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19pc01hc2tlZC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlSnNEYXRhID0gcmVxdWlyZSgnLi9fY29yZUpzRGF0YScpO1xuXG4vKiogVXNlZCB0byBkZXRlY3QgbWV0aG9kcyBtYXNxdWVyYWRpbmcgYXMgbmF0aXZlLiAqL1xudmFyIG1hc2tTcmNLZXkgPSAoZnVuY3Rpb24oKSB7XG4gIHZhciB1aWQgPSAvW14uXSskLy5leGVjKGNvcmVKc0RhdGEgJiYgY29yZUpzRGF0YS5rZXlzICYmIGNvcmVKc0RhdGEua2V5cy5JRV9QUk9UTyB8fCAnJyk7XG4gIHJldHVybiB1aWQgPyAoJ1N5bWJvbChzcmMpXzEuJyArIHVpZCkgOiAnJztcbn0oKSk7XG5cbi8qKlxuICogQ2hlY2tzIGlmIGBmdW5jYCBoYXMgaXRzIHNvdXJjZSBtYXNrZWQuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7RnVuY3Rpb259IGZ1bmMgVGhlIGZ1bmN0aW9uIHRvIGNoZWNrLlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGBmdW5jYCBpcyBtYXNrZWQsIGVsc2UgYGZhbHNlYC5cbiAqL1xuZnVuY3Rpb24gaXNNYXNrZWQoZnVuYykge1xuICByZXR1cm4gISFtYXNrU3JjS2V5ICYmIChtYXNrU3JjS2V5IGluIGZ1bmMpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGlzTWFza2VkO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_isMasked.js\n"); /***/ }), /***/ "./node_modules/lodash/_isPrototype.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_isPrototype.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n//# sourceURL=[module]\n//#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cGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_isPrototype.js\n"); /***/ }), /***/ "./node_modules/lodash/_isStrictComparable.js": /*!****************************************************!*\ !*** ./node_modules/lodash/_isStrictComparable.js ***! \****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\");\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2lzU3RyaWN0Q29tcGFyYWJsZS5qcz8wOGNjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWUsbUJBQU8sQ0FBQyxxREFBWTs7QUFFbkM7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2lzU3RyaWN0Q29tcGFyYWJsZS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vaXNPYmplY3QnKTtcblxuLyoqXG4gKiBDaGVja3MgaWYgYHZhbHVlYCBpcyBzdWl0YWJsZSBmb3Igc3RyaWN0IGVxdWFsaXR5IGNvbXBhcmlzb25zLCBpLmUuIGA9PT1gLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBjaGVjay5cbiAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBgdmFsdWVgIGlmIHN1aXRhYmxlIGZvciBzdHJpY3RcbiAqICBlcXVhbGl0eSBjb21wYXJpc29ucywgZWxzZSBgZmFsc2VgLlxuICovXG5mdW5jdGlvbiBpc1N0cmljdENvbXBhcmFibGUodmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlID09PSB2YWx1ZSAmJiAhaXNPYmplY3QodmFsdWUpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGlzU3RyaWN0Q29tcGFyYWJsZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_isStrictComparable.js\n"); /***/ }), /***/ "./node_modules/lodash/_listCacheClear.js": /*!************************************************!*\ !*** ./node_modules/lodash/_listCacheClear.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2xpc3RDYWNoZUNsZWFyLmpzPzI4YzkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2xpc3RDYWNoZUNsZWFyLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBSZW1vdmVzIGFsbCBrZXktdmFsdWUgZW50cmllcyBmcm9tIHRoZSBsaXN0IGNhY2hlLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBjbGVhclxuICogQG1lbWJlck9mIExpc3RDYWNoZVxuICovXG5mdW5jdGlvbiBsaXN0Q2FjaGVDbGVhcigpIHtcbiAgdGhpcy5fX2RhdGFfXyA9IFtdO1xuICB0aGlzLnNpemUgPSAwO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGxpc3RDYWNoZUNsZWFyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_listCacheClear.js\n"); /***/ }), /***/ "./node_modules/lodash/_listCacheDelete.js": /*!*************************************************!*\ !*** ./node_modules/lodash/_listCacheDelete.js ***! \*************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ \"./node_modules/lodash/_assocIndexOf.js\");\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2xpc3RDYWNoZURlbGV0ZS5qcz82OWQ1Il0sIm5hbWVzIjpbXS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A9IHRoaXMuX19kYXRhX18sXG4gICAgICBpbmRleCA9IGFzc29jSW5kZXhPZihkYXRhLCBrZXkpO1xuXG4gIGlmIChpbmRleCA8IDApIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbiAgdmFyIGxhc3RJbmRleCA9IGRhdGEubGVuZ3RoIC0gMTtcbiAgaWYgKGluZGV4ID09IGxhc3RJbmRleCkge1xuICAgIGRhdGEucG9wKCk7XG4gIH0gZWxzZSB7XG4gICAgc3BsaWNlLmNhbGwoZGF0YSwgaW5kZXgsIDEpO1xuICB9XG4gIC0tdGhpcy5zaXplO1xuICByZXR1cm4gdHJ1ZTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBsaXN0Q2FjaGVEZWxldGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_listCacheDelete.js\n"); /***/ }), /***/ "./node_modules/lodash/_listCacheGet.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_listCacheGet.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ \"./node_modules/lodash/_assocIndexOf.js\");\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2xpc3RDYWNoZUdldC5qcz9iNGMwIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjs7QUFFNUM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsRUFBRTtBQUNmO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19saXN0Q2FjaGVHZXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYXNzb2NJbmRleE9mID0gcmVxdWlyZSgnLi9fYXNzb2NJbmRleE9mJyk7XG5cbi8qKlxuICogR2V0cyB0aGUgbGlzdCBjYWNoZSB2YWx1ZSBmb3IgYGtleWAuXG4gKlxuICogQHByaXZhdGVcbiAqIEBuYW1lIGdldFxuICogQG1lbWJlck9mIExpc3RDYWNoZVxuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSB2YWx1ZSB0byBnZXQuXG4gKiBAcmV0dXJucyB7Kn0gUmV0dXJucyB0aGUgZW50cnkgdmFsdWUuXG4gKi9cbmZ1bmN0aW9uIGxpc3RDYWNoZUdldChrZXkpIHtcbiAgdmFyIGRhdGEgPSB0aGlzLl9fZGF0YV9fLFxuICAgICAgaW5kZXggPSBhc3NvY0luZGV4T2YoZGF0YSwga2V5KTtcblxuICByZXR1cm4gaW5kZXggPCAwID8gdW5kZWZpbmVkIDogZGF0YVtpbmRleF1bMV07XG59XG5cbm1vZHVsZS5leHBvcnRzID0gbGlzdENhY2hlR2V0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_listCacheGet.js\n"); /***/ }), /***/ "./node_modules/lodash/_listCacheHas.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_listCacheHas.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ \"./node_modules/lodash/_assocIndexOf.js\");\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2xpc3RDYWNoZUhhcy5qcz9mYmE1Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjs7QUFFNUM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2xpc3RDYWNoZUhhcy5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBhc3NvY0luZGV4T2YgPSByZXF1aXJlKCcuL19hc3NvY0luZGV4T2YnKTtcblxuLyoqXG4gKiBDaGVja3MgaWYgYSBsaXN0IGNhY2hlIHZhbHVlIGZvciBga2V5YCBleGlzdHMuXG4gKlxuICogQHByaXZhdGVcbiAqIEBuYW1lIGhhc1xuICogQG1lbWJlck9mIExpc3RDYWNoZVxuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSBlbnRyeSB0byBjaGVjay5cbiAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBhbiBlbnRyeSBmb3IgYGtleWAgZXhpc3RzLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIGxpc3RDYWNoZUhhcyhrZXkpIHtcbiAgcmV0dXJuIGFzc29jSW5kZXhPZih0aGlzLl9fZGF0YV9fLCBrZXkpID4gLTE7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gbGlzdENhY2hlSGFzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_listCacheHas.js\n"); /***/ }), /***/ "./node_modules/lodash/_listCacheSet.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_listCacheSet.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var assocIndexOf = __webpack_require__(/*! ./_assocIndexOf */ \"./node_modules/lodash/_assocIndexOf.js\");\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX2xpc3RDYWNoZVNldC5qcz82N2NhIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1CQUFtQixtQkFBTyxDQUFDLCtEQUFpQjs7QUFFNUM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsRUFBRTtBQUNiLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxHQUFHO0FBQ0g7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19saXN0Q2FjaGVTZXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYXNzb2NJbmRleE9mID0gcmVxdWlyZSgnLi9fYXNzb2NJbmRleE9mJyk7XG5cbi8qKlxuICogU2V0cyB0aGUgbGlzdCBjYWNoZSBga2V5YCB0byBgdmFsdWVgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBzZXRcbiAqIEBtZW1iZXJPZiBMaXN0Q2FjaGVcbiAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgVGhlIGtleSBvZiB0aGUgdmFsdWUgdG8gc2V0LlxuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gc2V0LlxuICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbGlzdCBjYWNoZSBpbnN0YW5jZS5cbiAqL1xuZnVuY3Rpb24gbGlzdENhY2hlU2V0KGtleSwgdmFsdWUpIHtcbiAgdmFyIGRhdGEgPSB0aGlzLl9fZGF0YV9fLFxuICAgICAgaW5kZXggPSBhc3NvY0luZGV4T2YoZGF0YSwga2V5KTtcblxuICBpZiAoaW5kZXggPCAwKSB7XG4gICAgKyt0aGlzLnNpemU7XG4gICAgZGF0YS5wdXNoKFtrZXksIHZhbHVlXSk7XG4gIH0gZWxzZSB7XG4gICAgZGF0YVtpbmRleF1bMV0gPSB2YWx1ZTtcbiAgfVxuICByZXR1cm4gdGhpcztcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBsaXN0Q2FjaGVTZXQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_listCacheSet.js\n"); /***/ }), /***/ "./node_modules/lodash/_mapCacheClear.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_mapCacheClear.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var Hash = __webpack_require__(/*! ./_Hash */ \"./node_modules/lodash/_Hash.js\"),\n ListCache = __webpack_require__(/*! ./_ListCache */ \"./node_modules/lodash/_ListCache.js\"),\n Map = __webpack_require__(/*! ./_Map */ \"./node_modules/lodash/_Map.js\");\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21hcENhY2hlQ2xlYXIuanM/N2M2NCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxXQUFXLG1CQUFPLENBQUMsK0NBQVM7QUFDNUIsZ0JBQWdCLG1CQUFPLENBQUMseURBQWM7QUFDdEMsVUFBVSxtQkFBTyxDQUFDLDZDQUFROztBQUUxQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19tYXBDYWNoZUNsZWFyLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIEhhc2ggPSByZXF1aXJlKCcuL19IYXNoJyksXG4gICAgTGlzdENhY2hlID0gcmVxdWlyZSgnLi9fTGlzdENhY2hlJyksXG4gICAgTWFwID0gcmVxdWlyZSgnLi9fTWFwJyk7XG5cbi8qKlxuICogUmVtb3ZlcyBhbGwga2V5LXZhbHVlIGVudHJpZXMgZnJvbSB0aGUgbWFwLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBjbGVhclxuICogQG1lbWJlck9mIE1hcENhY2hlXG4gKi9cbmZ1bmN0aW9uIG1hcENhY2hlQ2xlYXIoKSB7XG4gIHRoaXMuc2l6ZSA9IDA7XG4gIHRoaXMuX19kYXRhX18gPSB7XG4gICAgJ2hhc2gnOiBuZXcgSGFzaCxcbiAgICAnbWFwJzogbmV3IChNYXAgfHwgTGlzdENhY2hlKSxcbiAgICAnc3RyaW5nJzogbmV3IEhhc2hcbiAgfTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBtYXBDYWNoZUNsZWFyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_mapCacheClear.js\n"); /***/ }), /***/ "./node_modules/lodash/_mapCacheDelete.js": /*!************************************************!*\ !*** ./node_modules/lodash/_mapCacheDelete.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getMapData = __webpack_require__(/*! ./_getMapData */ \"./node_modules/lodash/_getMapData.js\");\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21hcENhY2hlRGVsZXRlLmpzPzkzZWQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fbWFwQ2FjaGVEZWxldGUuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0TWFwRGF0YSA9IHJlcXVpcmUoJy4vX2dldE1hcERhdGEnKTtcblxuLyoqXG4gKiBSZW1vdmVzIGBrZXlgIGFuZCBpdHMgdmFsdWUgZnJvbSB0aGUgbWFwLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBkZWxldGVcbiAqIEBtZW1iZXJPZiBNYXBDYWNoZVxuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSB2YWx1ZSB0byByZW1vdmUuXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgdGhlIGVudHJ5IHdhcyByZW1vdmVkLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIG1hcENhY2hlRGVsZXRlKGtleSkge1xuICB2YXIgcmVzdWx0ID0gZ2V0TWFwRGF0YSh0aGlzLCBrZXkpWydkZWxldGUnXShrZXkpO1xuICB0aGlzLnNpemUgLT0gcmVzdWx0ID8gMSA6IDA7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gbWFwQ2FjaGVEZWxldGU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_mapCacheDelete.js\n"); /***/ }), /***/ "./node_modules/lodash/_mapCacheGet.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_mapCacheGet.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getMapData = __webpack_require__(/*! ./_getMapData */ \"./node_modules/lodash/_getMapData.js\");\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21hcENhY2hlR2V0LmpzPzI0NzgiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLEVBQUU7QUFDZjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21hcENhY2hlR2V0LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGdldE1hcERhdGEgPSByZXF1aXJlKCcuL19nZXRNYXBEYXRhJyk7XG5cbi8qKlxuICogR2V0cyB0aGUgbWFwIHZhbHVlIGZvciBga2V5YC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQG5hbWUgZ2V0XG4gKiBAbWVtYmVyT2YgTWFwQ2FjaGVcbiAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgVGhlIGtleSBvZiB0aGUgdmFsdWUgdG8gZ2V0LlxuICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIGVudHJ5IHZhbHVlLlxuICovXG5mdW5jdGlvbiBtYXBDYWNoZUdldChrZXkpIHtcbiAgcmV0dXJuIGdldE1hcERhdGEodGhpcywga2V5KS5nZXQoa2V5KTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBtYXBDYWNoZUdldDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_mapCacheGet.js\n"); /***/ }), /***/ "./node_modules/lodash/_mapCacheHas.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_mapCacheHas.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getMapData = __webpack_require__(/*! ./_getMapData */ \"./node_modules/lodash/_getMapData.js\");\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21hcENhY2hlSGFzLmpzP2E1MjQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19tYXBDYWNoZUhhcy5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBnZXRNYXBEYXRhID0gcmVxdWlyZSgnLi9fZ2V0TWFwRGF0YScpO1xuXG4vKipcbiAqIENoZWNrcyBpZiBhIG1hcCB2YWx1ZSBmb3IgYGtleWAgZXhpc3RzLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBoYXNcbiAqIEBtZW1iZXJPZiBNYXBDYWNoZVxuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSBlbnRyeSB0byBjaGVjay5cbiAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBhbiBlbnRyeSBmb3IgYGtleWAgZXhpc3RzLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIG1hcENhY2hlSGFzKGtleSkge1xuICByZXR1cm4gZ2V0TWFwRGF0YSh0aGlzLCBrZXkpLmhhcyhrZXkpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IG1hcENhY2hlSGFzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_mapCacheHas.js\n"); /***/ }), /***/ "./node_modules/lodash/_mapCacheSet.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_mapCacheSet.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getMapData = __webpack_require__(/*! ./_getMapData */ \"./node_modules/lodash/_getMapData.js\");\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21hcENhY2hlU2V0LmpzPzFmYzgiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsaUJBQWlCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLEVBQUU7QUFDYixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19tYXBDYWNoZVNldC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBnZXRNYXBEYXRhID0gcmVxdWlyZSgnLi9fZ2V0TWFwRGF0YScpO1xuXG4vKipcbiAqIFNldHMgdGhlIG1hcCBga2V5YCB0byBgdmFsdWVgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBzZXRcbiAqIEBtZW1iZXJPZiBNYXBDYWNoZVxuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSB2YWx1ZSB0byBzZXQuXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBzZXQuXG4gKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIHRoZSBtYXAgY2FjaGUgaW5zdGFuY2UuXG4gKi9cbmZ1bmN0aW9uIG1hcENhY2hlU2V0KGtleSwgdmFsdWUpIHtcbiAgdmFyIGRhdGEgPSBnZXRNYXBEYXRhKHRoaXMsIGtleSksXG4gICAgICBzaXplID0gZGF0YS5zaXplO1xuXG4gIGRhdGEuc2V0KGtleSwgdmFsdWUpO1xuICB0aGlzLnNpemUgKz0gZGF0YS5zaXplID09IHNpemUgPyAwIDogMTtcbiAgcmV0dXJuIHRoaXM7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gbWFwQ2FjaGVTZXQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_mapCacheSet.js\n"); /***/ }), /***/ "./node_modules/lodash/_mapToArray.js": /*!********************************************!*\ !*** ./node_modules/lodash/_mapToArray.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21hcFRvQXJyYXkuanM/ZWRmYSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLEdBQUc7QUFDSDtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fbWFwVG9BcnJheS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29udmVydHMgYG1hcGAgdG8gaXRzIGtleS12YWx1ZSBwYWlycy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IG1hcCBUaGUgbWFwIHRvIGNvbnZlcnQuXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIGtleS12YWx1ZSBwYWlycy5cbiAqL1xuZnVuY3Rpb24gbWFwVG9BcnJheShtYXApIHtcbiAgdmFyIGluZGV4ID0gLTEsXG4gICAgICByZXN1bHQgPSBBcnJheShtYXAuc2l6ZSk7XG5cbiAgbWFwLmZvckVhY2goZnVuY3Rpb24odmFsdWUsIGtleSkge1xuICAgIHJlc3VsdFsrK2luZGV4XSA9IFtrZXksIHZhbHVlXTtcbiAgfSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gbWFwVG9BcnJheTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_mapToArray.js\n"); /***/ }), /***/ "./node_modules/lodash/_matchesStrictComparable.js": /*!*********************************************************!*\ !*** ./node_modules/lodash/_matchesStrictComparable.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21hdGNoZXNTdHJpY3RDb21wYXJhYmxlLmpzPzIwZWMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLEVBQUU7QUFDYixhQUFhLFNBQVM7QUFDdEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19tYXRjaGVzU3RyaWN0Q29tcGFyYWJsZS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQSBzcGVjaWFsaXplZCB2ZXJzaW9uIG9mIGBtYXRjaGVzUHJvcGVydHlgIGZvciBzb3VyY2UgdmFsdWVzIHN1aXRhYmxlXG4gKiBmb3Igc3RyaWN0IGVxdWFsaXR5IGNvbXBhcmlzb25zLCBpLmUuIGA9PT1gLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge3N0cmluZ30ga2V5IFRoZSBrZXkgb2YgdGhlIHByb3BlcnR5IHRvIGdldC5cbiAqIEBwYXJhbSB7Kn0gc3JjVmFsdWUgVGhlIHZhbHVlIHRvIG1hdGNoLlxuICogQHJldHVybnMge0Z1bmN0aW9ufSBSZXR1cm5zIHRoZSBuZXcgc3BlYyBmdW5jdGlvbi5cbiAqL1xuZnVuY3Rpb24gbWF0Y2hlc1N0cmljdENvbXBhcmFibGUoa2V5LCBzcmNWYWx1ZSkge1xuICByZXR1cm4gZnVuY3Rpb24ob2JqZWN0KSB7XG4gICAgaWYgKG9iamVjdCA9PSBudWxsKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICAgIHJldHVybiBvYmplY3Rba2V5XSA9PT0gc3JjVmFsdWUgJiZcbiAgICAgIChzcmNWYWx1ZSAhPT0gdW5kZWZpbmVkIHx8IChrZXkgaW4gT2JqZWN0KG9iamVjdCkpKTtcbiAgfTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBtYXRjaGVzU3RyaWN0Q29tcGFyYWJsZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_matchesStrictComparable.js\n"); /***/ }), /***/ "./node_modules/lodash/_memoizeCapped.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_memoizeCapped.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var memoize = __webpack_require__(/*! ./memoize */ \"./node_modules/lodash/memoize.js\");\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21lbW9pemVDYXBwZWQuanM/MjM0ZCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFPLENBQUMsbURBQVc7O0FBRWpDO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsU0FBUztBQUNwQixhQUFhLFNBQVM7QUFDdEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxHQUFHOztBQUVIO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX21lbW9pemVDYXBwZWQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWVtb2l6ZSA9IHJlcXVpcmUoJy4vbWVtb2l6ZScpO1xuXG4vKiogVXNlZCBhcyB0aGUgbWF4aW11bSBtZW1vaXplIGNhY2hlIHNpemUuICovXG52YXIgTUFYX01FTU9JWkVfU0laRSA9IDUwMDtcblxuLyoqXG4gKiBBIHNwZWNpYWxpemVkIHZlcnNpb24gb2YgYF8ubWVtb2l6ZWAgd2hpY2ggY2xlYXJzIHRoZSBtZW1vaXplZCBmdW5jdGlvbidzXG4gKiBjYWNoZSB3aGVuIGl0IGV4Y2VlZHMgYE1BWF9NRU1PSVpFX1NJWkVgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBmdW5jIFRoZSBmdW5jdGlvbiB0byBoYXZlIGl0cyBvdXRwdXQgbWVtb2l6ZWQuXG4gKiBAcmV0dXJucyB7RnVuY3Rpb259IFJldHVybnMgdGhlIG5ldyBtZW1vaXplZCBmdW5jdGlvbi5cbiAqL1xuZnVuY3Rpb24gbWVtb2l6ZUNhcHBlZChmdW5jKSB7XG4gIHZhciByZXN1bHQgPSBtZW1vaXplKGZ1bmMsIGZ1bmN0aW9uKGtleSkge1xuICAgIGlmIChjYWNoZS5zaXplID09PSBNQVhfTUVNT0laRV9TSVpFKSB7XG4gICAgICBjYWNoZS5jbGVhcigpO1xuICAgIH1cbiAgICByZXR1cm4ga2V5O1xuICB9KTtcblxuICB2YXIgY2FjaGUgPSByZXN1bHQuY2FjaGU7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gbWVtb2l6ZUNhcHBlZDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_memoizeCapped.js\n"); /***/ }), /***/ "./node_modules/lodash/_nativeCreate.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_nativeCreate.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var getNative = __webpack_require__(/*! ./_getNative */ \"./node_modules/lodash/_getNative.js\");\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX25hdGl2ZUNyZWF0ZS5qcz82MDQ0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGdCQUFnQixtQkFBTyxDQUFDLHlEQUFjOztBQUV0QztBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fbmF0aXZlQ3JlYXRlLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGdldE5hdGl2ZSA9IHJlcXVpcmUoJy4vX2dldE5hdGl2ZScpO1xuXG4vKiBCdWlsdC1pbiBtZXRob2QgcmVmZXJlbmNlcyB0aGF0IGFyZSB2ZXJpZmllZCB0byBiZSBuYXRpdmUuICovXG52YXIgbmF0aXZlQ3JlYXRlID0gZ2V0TmF0aXZlKE9iamVjdCwgJ2NyZWF0ZScpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IG5hdGl2ZUNyZWF0ZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_nativeCreate.js\n"); /***/ }), /***/ "./node_modules/lodash/_nativeKeys.js": /*!********************************************!*\ !*** ./node_modules/lodash/_nativeKeys.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var overArg = __webpack_require__(/*! ./_overArg */ \"./node_modules/lodash/_overArg.js\");\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX25hdGl2ZUtleXMuanM/NTdhNSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFPLENBQUMscURBQVk7O0FBRWxDO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19uYXRpdmVLZXlzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIG92ZXJBcmcgPSByZXF1aXJlKCcuL19vdmVyQXJnJyk7XG5cbi8qIEJ1aWx0LWluIG1ldGhvZCByZWZlcmVuY2VzIGZvciB0aG9zZSB3aXRoIHRoZSBzYW1lIG5hbWUgYXMgb3RoZXIgYGxvZGFzaGAgbWV0aG9kcy4gKi9cbnZhciBuYXRpdmVLZXlzID0gb3ZlckFyZyhPYmplY3Qua2V5cywgT2JqZWN0KTtcblxubW9kdWxlLmV4cG9ydHMgPSBuYXRpdmVLZXlzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_nativeKeys.js\n"); /***/ }), /***/ "./node_modules/lodash/_nativeKeysIn.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_nativeKeysIn.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX25hdGl2ZUtleXNJbi5qcz9lYzhjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19uYXRpdmVLZXlzSW4uanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIFRoaXMgZnVuY3Rpb24gaXMgbGlrZVxuICogW2BPYmplY3Qua2V5c2BdKGh0dHA6Ly9lY21hLWludGVybmF0aW9uYWwub3JnL2VjbWEtMjYyLzcuMC8jc2VjLW9iamVjdC5rZXlzKVxuICogZXhjZXB0IHRoYXQgaXQgaW5jbHVkZXMgaW5oZXJpdGVkIGVudW1lcmFibGUgcHJvcGVydGllcy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IG9iamVjdCBUaGUgb2JqZWN0IHRvIHF1ZXJ5LlxuICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBhcnJheSBvZiBwcm9wZXJ0eSBuYW1lcy5cbiAqL1xuZnVuY3Rpb24gbmF0aXZlS2V5c0luKG9iamVjdCkge1xuICB2YXIgcmVzdWx0ID0gW107XG4gIGlmIChvYmplY3QgIT0gbnVsbCkge1xuICAgIGZvciAodmFyIGtleSBpbiBPYmplY3Qob2JqZWN0KSkge1xuICAgICAgcmVzdWx0LnB1c2goa2V5KTtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBuYXRpdmVLZXlzSW47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_nativeKeysIn.js\n"); /***/ }), /***/ "./node_modules/lodash/_nodeUtil.js": /*!******************************************!*\ !*** ./node_modules/lodash/_nodeUtil.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX25vZGVVdGlsLmpzPzk5ZDMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsK0RBQWlCLG1CQUFPLENBQUMsMkRBQWU7O0FBRXhDO0FBQ0Esa0JBQWtCLEtBQTBCOztBQUU1QztBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsR0FBRztBQUNILENBQUM7O0FBRUQiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19ub2RlVXRpbC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBmcmVlR2xvYmFsID0gcmVxdWlyZSgnLi9fZnJlZUdsb2JhbCcpO1xuXG4vKiogRGV0ZWN0IGZyZWUgdmFyaWFibGUgYGV4cG9ydHNgLiAqL1xudmFyIGZyZWVFeHBvcnRzID0gdHlwZW9mIGV4cG9ydHMgPT0gJ29iamVjdCcgJiYgZXhwb3J0cyAmJiAhZXhwb3J0cy5ub2RlVHlwZSAmJiBleHBvcnRzO1xuXG4vKiogRGV0ZWN0IGZyZWUgdmFyaWFibGUgYG1vZHVsZWAuICovXG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3J0cyA9IG5vZGVVdGlsO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_nodeUtil.js\n"); /***/ }), /***/ "./node_modules/lodash/_objectToString.js": /*!************************************************!*\ !*** ./node_modules/lodash/_objectToString.js ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX29iamVjdFRvU3RyaW5nLmpzPzI5ZjMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19vYmplY3RUb1N0cmluZy5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBVc2VkIGZvciBidWlsdC1pbiBtZXRob2QgcmVmZXJlbmNlcy4gKi9cbnZhciBvYmplY3RQcm90byA9IE9iamVjdC5wcm90b3R5cGU7XG5cbi8qKlxuICogVXNlZCB0byByZXNvbHZlIHRoZVxuICogW2B0b1N0cmluZ1RhZ2BdKGh0dHA6Ly9lY21hLWludGVybmF0aW9uYWwub3JnL2VjbWEtMjYyLzcuMC8jc2VjLW9iamVjdC5wcm90b3R5cGUudG9zdHJpbmcpXG4gKiBvZiB2YWx1ZXMuXG4gKi9cbnZhciBuYXRpdmVPYmplY3RUb1N0cmluZyA9IG9iamVjdFByb3RvLnRvU3RyaW5nO1xuXG4vKipcbiAqIENvbnZlcnRzIGB2YWx1ZWAgdG8gYSBzdHJpbmcgdXNpbmcgYE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmdgLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBjb252ZXJ0LlxuICogQHJldHVybnMge3N0cmluZ30gUmV0dXJucyB0aGUgY29udmVydGVkIHN0cmluZy5cbiAqL1xuZnVuY3Rpb24gb2JqZWN0VG9TdHJpbmcodmFsdWUpIHtcbiAgcmV0dXJuIG5hdGl2ZU9iamVjdFRvU3RyaW5nLmNhbGwodmFsdWUpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IG9iamVjdFRvU3RyaW5nO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_objectToString.js\n"); /***/ }), /***/ "./node_modules/lodash/_overArg.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_overArg.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX292ZXJBcmcuanM/OTFlOSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsU0FBUztBQUNwQixXQUFXLFNBQVM7QUFDcEIsYUFBYSxTQUFTO0FBQ3RCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX292ZXJBcmcuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENyZWF0ZXMgYSB1bmFyeSBmdW5jdGlvbiB0aGF0IGludm9rZXMgYGZ1bmNgIHdpdGggaXRzIGFyZ3VtZW50IHRyYW5zZm9ybWVkLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAcGFyYW0ge0Z1bmN0aW9ufSBmdW5jIFRoZSBmdW5jdGlvbiB0byB3cmFwLlxuICogQHBhcmFtIHtGdW5jdGlvbn0gdHJhbnNmb3JtIFRoZSBhcmd1bWVudCB0cmFuc2Zvcm0uXG4gKiBAcmV0dXJucyB7RnVuY3Rpb259IFJldHVybnMgdGhlIG5ldyBmdW5jdGlvbi5cbiAqL1xuZnVuY3Rpb24gb3ZlckFyZyhmdW5jLCB0cmFuc2Zvcm0pIHtcbiAgcmV0dXJuIGZ1bmN0aW9uKGFyZykge1xuICAgIHJldHVybiBmdW5jKHRyYW5zZm9ybShhcmcpKTtcbiAgfTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBvdmVyQXJnO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_overArg.js\n"); /***/ }), /***/ "./node_modules/lodash/_overRest.js": /*!******************************************!*\ !*** ./node_modules/lodash/_overRest.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var apply = __webpack_require__(/*! ./_apply */ \"./node_modules/lodash/_apply.js\");\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX292ZXJSZXN0LmpzPzIyODYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFBWSxtQkFBTyxDQUFDLGlEQUFVOztBQUU5QjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxTQUFTO0FBQ3BCLFdBQVcsT0FBTztBQUNsQixXQUFXLFNBQVM7QUFDcEIsYUFBYSxTQUFTO0FBQ3RCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fb3ZlclJlc3QuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYXBwbHkgPSByZXF1aXJlKCcuL19hcHBseScpO1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YXJyYXlbaW5kZXhdID0gYXJnc1tzdGFydCArIGluZGV4XTtcbiAgICB9XG4gICAgaW5kZXggPSAtMTtcbiAgICB2YXIgb3RoZXJBcmdzID0gQXJyYXkoc3RhcnQgKyAxKTtcbiAgICB3aGlsZSAoKytpbmRleCA8IHN0YXJ0KSB7XG4gICAgICBvdGhlckFyZ3NbaW5kZXhdID0gYXJnc1tpbmRleF07XG4gICAgfVxuICAgIG90aGVyQXJnc1tzdGFydF0gPSB0cmFuc2Zvcm0oYXJyYXkpO1xuICAgIHJldHVybiBhcHBseShmdW5jLCB0aGlzLCBvdGhlckFyZ3MpO1xuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IG92ZXJSZXN0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_overRest.js\n"); /***/ }), /***/ "./node_modules/lodash/_root.js": /*!**************************************!*\ !*** ./node_modules/lodash/_root.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3Jvb3QuanM/MmIzZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsbUJBQU8sQ0FBQywyREFBZTs7QUFFeEM7QUFDQTs7QUFFQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fcm9vdC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBmcmVlR2xvYmFsID0gcmVxdWlyZSgnLi9fZnJlZUdsb2JhbCcpO1xuXG4vKiogRGV0ZWN0IGZyZWUgdmFyaWFibGUgYHNlbGZgLiAqL1xudmFyIGZyZWVTZWxmID0gdHlwZW9mIHNlbGYgPT0gJ29iamVjdCcgJiYgc2VsZiAmJiBzZWxmLk9iamVjdCA9PT0gT2JqZWN0ICYmIHNlbGY7XG5cbi8qKiBVc2VkIGFzIGEgcmVmZXJlbmNlIHRvIHRoZSBnbG9iYWwgb2JqZWN0LiAqL1xudmFyIHJvb3QgPSBmcmVlR2xvYmFsIHx8IGZyZWVTZWxmIHx8IEZ1bmN0aW9uKCdyZXR1cm4gdGhpcycpKCk7XG5cbm1vZHVsZS5leHBvcnRzID0gcm9vdDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_root.js\n"); /***/ }), /***/ "./node_modules/lodash/_safeGet.js": /*!*****************************************!*\ !*** ./node_modules/lodash/_safeGet.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nmodule.exports = safeGet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3NhZmVHZXQuanM/OGFkYiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixXQUFXLE9BQU87QUFDbEIsYUFBYSxFQUFFO0FBQ2Y7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3NhZmVHZXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdldHMgdGhlIHZhbHVlIGF0IGBrZXlgLCB1bmxlc3MgYGtleWAgaXMgXCJfX3Byb3RvX19cIiBvciBcImNvbnN0cnVjdG9yXCIuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIG9iamVjdCB0byBxdWVyeS5cbiAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgVGhlIGtleSBvZiB0aGUgcHJvcGVydHkgdG8gZ2V0LlxuICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIHByb3BlcnR5IHZhbHVlLlxuICovXG5mdW5jdGlvbiBzYWZlR2V0KG9iamVjdCwga2V5KSB7XG4gIGlmIChrZXkgPT09ICdjb25zdHJ1Y3RvcicgJiYgdHlwZW9mIG9iamVjdFtrZXldID09PSAnZnVuY3Rpb24nKSB7XG4gICAgcmV0dXJuO1xuICB9XG5cbiAgaWYgKGtleSA9PSAnX19wcm90b19fJykge1xuICAgIHJldHVybjtcbiAgfVxuXG4gIHJldHVybiBvYmplY3Rba2V5XTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBzYWZlR2V0O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_safeGet.js\n"); /***/ }), /***/ "./node_modules/lodash/_setCacheAdd.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_setCacheAdd.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3NldENhY2hlQWRkLmpzPzdlZDIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fc2V0Q2FjaGVBZGQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogVXNlZCB0byBzdGFuZC1pbiBmb3IgYHVuZGVmaW5lZGAgaGFzaCB2YWx1ZXMuICovXG52YXIgSEFTSF9VTkRFRklORUQgPSAnX19sb2Rhc2hfaGFzaF91bmRlZmluZWRfXyc7XG5cbi8qKlxuICogQWRkcyBgdmFsdWVgIHRvIHRoZSBhcnJheSBjYWNoZS5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQG5hbWUgYWRkXG4gKiBAbWVtYmVyT2YgU2V0Q2FjaGVcbiAqIEBhbGlhcyBwdXNoXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBjYWNoZS5cbiAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIGNhY2hlIGluc3RhbmNlLlxuICovXG5mdW5jdGlvbiBzZXRDYWNoZUFkZCh2YWx1ZSkge1xuICB0aGlzLl9fZGF0YV9fLnNldCh2YWx1ZSwgSEFTSF9VTkRFRklORUQpO1xuICByZXR1cm4gdGhpcztcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBzZXRDYWNoZUFkZDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_setCacheAdd.js\n"); /***/ }), /***/ "./node_modules/lodash/_setCacheHas.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_setCacheHas.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3NldENhY2hlSGFzLmpzP2RjMGYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fc2V0Q2FjaGVIYXMuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENoZWNrcyBpZiBgdmFsdWVgIGlzIGluIHRoZSBhcnJheSBjYWNoZS5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQG5hbWUgaGFzXG4gKiBAbWVtYmVyT2YgU2V0Q2FjaGVcbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIHNlYXJjaCBmb3IuXG4gKiBAcmV0dXJucyB7bnVtYmVyfSBSZXR1cm5zIGB0cnVlYCBpZiBgdmFsdWVgIGlzIGZvdW5kLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIHNldENhY2hlSGFzKHZhbHVlKSB7XG4gIHJldHVybiB0aGlzLl9fZGF0YV9fLmhhcyh2YWx1ZSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gc2V0Q2FjaGVIYXM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_setCacheHas.js\n"); /***/ }), /***/ "./node_modules/lodash/_setToArray.js": /*!********************************************!*\ !*** ./node_modules/lodash/_setToArray.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3NldFRvQXJyYXkuanM/YWM0MSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLE1BQU07QUFDbkI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLEdBQUc7QUFDSDtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fc2V0VG9BcnJheS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29udmVydHMgYHNldGAgdG8gYW4gYXJyYXkgb2YgaXRzIHZhbHVlcy5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQHBhcmFtIHtPYmplY3R9IHNldCBUaGUgc2V0IHRvIGNvbnZlcnQuXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIHZhbHVlcy5cbiAqL1xuZnVuY3Rpb24gc2V0VG9BcnJheShzZXQpIHtcbiAgdmFyIGluZGV4ID0gLTEsXG4gICAgICByZXN1bHQgPSBBcnJheShzZXQuc2l6ZSk7XG5cbiAgc2V0LmZvckVhY2goZnVuY3Rpb24odmFsdWUpIHtcbiAgICByZXN1bHRbKytpbmRleF0gPSB2YWx1ZTtcbiAgfSk7XG4gIHJldHVybiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gc2V0VG9BcnJheTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_setToArray.js\n"); /***/ }), /***/ "./node_modules/lodash/_setToString.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_setToString.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseSetToString = __webpack_require__(/*! ./_baseSetToString */ \"./node_modules/lodash/_baseSetToString.js\"),\n shortOut = __webpack_require__(/*! ./_shortOut */ \"./node_modules/lodash/_shortOut.js\");\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3NldFRvU3RyaW5nLmpzP2MxYzkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsc0JBQXNCLG1CQUFPLENBQUMscUVBQW9CO0FBQ2xELGVBQWUsbUJBQU8sQ0FBQyx1REFBYTs7QUFFcEM7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLFNBQVM7QUFDcEIsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsU0FBUztBQUN0QjtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fc2V0VG9TdHJpbmcuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYmFzZVNldFRvU3RyaW5nID0gcmVxdWlyZSgnLi9fYmFzZVNldFRvU3RyaW5nJyksXG4gICAgc2hvcnRPdXQgPSByZXF1aXJlKCcuL19zaG9ydE91dCcpO1xuXG4vKipcbiAqIFNldHMgdGhlIGB0b1N0cmluZ2AgbWV0aG9kIG9mIGBmdW5jYCB0byByZXR1cm4gYHN0cmluZ2AuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7RnVuY3Rpb259IGZ1bmMgVGhlIGZ1bmN0aW9uIHRvIG1vZGlmeS5cbiAqIEBwYXJhbSB7RnVuY3Rpb259IHN0cmluZyBUaGUgYHRvU3RyaW5nYCByZXN1bHQuXG4gKiBAcmV0dXJucyB7RnVuY3Rpb259IFJldHVybnMgYGZ1bmNgLlxuICovXG52YXIgc2V0VG9TdHJpbmcgPSBzaG9ydE91dChiYXNlU2V0VG9TdHJpbmcpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHNldFRvU3RyaW5nO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_setToString.js\n"); /***/ }), /***/ "./node_modules/lodash/_shortOut.js": /*!******************************************!*\ !*** ./node_modules/lodash/_shortOut.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3Nob3J0T3V0LmpzP2YzYzEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsU0FBUztBQUN0QjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fc2hvcnRPdXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogVXNlZCB0byBkZXRlY3QgaG90IGZ1bmN0aW9ucyBieSBudW1iZXIgb2YgY2FsbHMgd2l0aGluIGEgc3BhbiBvZiBtaWxsaXNlY29uZHMuICovXG52YXIgSE9UX0NPVU5UID0gODAwLFxuICAgIEhPVF9TUEFOID0gMTY7X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4gIH07XG59XG5cbm1vZHVsZS5leHBvcnRzID0gc2hvcnRPdXQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_shortOut.js\n"); /***/ }), /***/ "./node_modules/lodash/_stackClear.js": /*!********************************************!*\ !*** ./node_modules/lodash/_stackClear.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var ListCache = __webpack_require__(/*! ./_ListCache */ \"./node_modules/lodash/_ListCache.js\");\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0YWNrQ2xlYXIuanM/ZWZiNiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYzs7QUFFdEM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0YWNrQ2xlYXIuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgTGlzdENhY2hlID0gcmVxdWlyZSgnLi9fTGlzdENhY2hlJyk7XG5cbi8qKlxuICogUmVtb3ZlcyBhbGwga2V5LXZhbHVlIGVudHJpZXMgZnJvbSB0aGUgc3RhY2suXG4gKlxuICogQHByaXZhdGVcbiAqIEBuYW1lIGNsZWFyXG4gKiBAbWVtYmVyT2YgU3RhY2tcbiAqL1xuZnVuY3Rpb24gc3RhY2tDbGVhcigpIHtcbiAgdGhpcy5fX2RhdGFfXyA9IG5ldyBMaXN0Q2FjaGU7XG4gIHRoaXMuc2l6ZSA9IDA7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gc3RhY2tDbGVhcjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_stackClear.js\n"); /***/ }), /***/ "./node_modules/lodash/_stackDelete.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_stackDelete.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0YWNrRGVsZXRlLmpzPzJmY2MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19zdGFja0RlbGV0ZS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogUmVtb3ZlcyBga2V5YCBhbmQgaXRzIHZhbHVlIGZyb20gdGhlIHN0YWNrLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBkZWxldGVcbiAqIEBtZW1iZXJPZiBTdGFja1xuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSB2YWx1ZSB0byByZW1vdmUuXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgdGhlIGVudHJ5IHdhcyByZW1vdmVkLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIHN0YWNrRGVsZXRlKGtleSkge1xuICB2YXIgZGF0YSA9IHRoaXMuX19kYXRhX18sXG4gICAgICByZXN1bHQgPSBkYXRhWydkZWxldGUnXShrZXkpO1xuXG4gIHRoaXMuc2l6ZSA9IGRhdGEuc2l6ZTtcbiAgcmV0dXJuIHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBzdGFja0RlbGV0ZTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_stackDelete.js\n"); /***/ }), /***/ "./node_modules/lodash/_stackGet.js": /*!******************************************!*\ !*** ./node_modules/lodash/_stackGet.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0YWNrR2V0LmpzPzgwMmEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsRUFBRTtBQUNmO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fc3RhY2tHZXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdldHMgdGhlIHN0YWNrIHZhbHVlIGZvciBga2V5YC5cbiAqXG4gKiBAcHJpdmF0ZVxuICogQG5hbWUgZ2V0XG4gKiBAbWVtYmVyT2YgU3RhY2tcbiAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgVGhlIGtleSBvZiB0aGUgdmFsdWUgdG8gZ2V0LlxuICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIGVudHJ5IHZhbHVlLlxuICovXG5mdW5jdGlvbiBzdGFja0dldChrZXkpIHtcbiAgcmV0dXJuIHRoaXMuX19kYXRhX18uZ2V0KGtleSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gc3RhY2tHZXQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_stackGet.js\n"); /***/ }), /***/ "./node_modules/lodash/_stackHas.js": /*!******************************************!*\ !*** ./node_modules/lodash/_stackHas.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0YWNrSGFzLmpzPzU1YTMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0YWNrSGFzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDaGVja3MgaWYgYSBzdGFjayB2YWx1ZSBmb3IgYGtleWAgZXhpc3RzLlxuICpcbiAqIEBwcml2YXRlXG4gKiBAbmFtZSBoYXNcbiAqIEBtZW1iZXJPZiBTdGFja1xuICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSBlbnRyeSB0byBjaGVjay5cbiAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBhbiBlbnRyeSBmb3IgYGtleWAgZXhpc3RzLCBlbHNlIGBmYWxzZWAuXG4gKi9cbmZ1bmN0aW9uIHN0YWNrSGFzKGtleSkge1xuICByZXR1cm4gdGhpcy5fX2RhdGFfXy5oYXMoa2V5KTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBzdGFja0hhcztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_stackHas.js\n"); /***/ }), /***/ "./node_modules/lodash/_stackSet.js": /*!******************************************!*\ !*** ./node_modules/lodash/_stackSet.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var ListCache = __webpack_require__(/*! ./_ListCache */ \"./node_modules/lodash/_ListCache.js\"),\n Map = __webpack_require__(/*! ./_Map */ \"./node_modules/lodash/_Map.js\"),\n MapCache = __webpack_require__(/*! ./_MapCache */ \"./node_modules/lodash/_MapCache.js\");\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0YWNrU2V0LmpzP2QwMmMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQWdCLG1CQUFPLENBQUMseURBQWM7QUFDdEMsVUFBVSxtQkFBTyxDQUFDLDZDQUFRO0FBQzFCLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTs7QUFFcEM7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxFQUFFO0FBQ2IsYUFBYSxPQUFPO0FBQ3BCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fc3RhY2tTZXQuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgTGlzdENhY2hlID0gcmVxdWlyZSgnLi9fTGlzdENhY2hlJyksXG4gICAgTWFwID0gcmVxdWlyZSgnLi9fTWFwJyksXG4gICAgTWFwQ2FjaGUgPSByZXF1aXJlKCcuL19NYXBDYWNoZScpO1xuXG4vKiogVXNlZCBhcyB0aGUgc2l6ZSB0byBlbmFibGUgbGFyZ2UgYXJyYXkgb3B0aW1pemF0aW9ucy4gKi9cbnZhciBMQVJHRV9BUlJBWV9TSVpFID0gMjAwO1xuXG4vKipcbiAqIFNldHMgdGhlIHN0YWNrIGBrZXlgIHRvIGB2YWx1ZWAuXG4gKlxuICogQHByaXZhdGVcbiAqIEBuYW1lIHNldFxuICogQG1lbWJlck9mIFN0YWNrXG4gKiBAcGFyYW0ge3N0cmluZ30ga2V5IFRoZSBrZXkgb2YgdGhlIHZhbHVlIHRvIHNldC5cbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIHNldC5cbiAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIHN0YWNrIGNhY2hlIGluc3RhbmNlLlxuICovXG5mdW5jdGlvbiBzdGFja1NldChrZXksIHZhbHVlKSB7XG4gIHZhciBkYXRhID0gdGhpcy5fX2RhdGFfXztcbiAgaWYgKGRhdGEgaW5zdGFuY2VvZiBMaXN0Q2FjaGUpIHtcbiAgICB2YXIgcGFpcnMgPSBkYXRhLl9fZGF0YV9fO1xuICAgIGlmICghTWFwIHx8IChwYWlycy5sZW5ndGggPCBMQVJHRV9BUlJBWV9TSVpFIC0gMSkpIHtcbiAgICAgIHBhaXJzLnB1c2goW2tleSwgdmFsdWVdKTtcbiAgICAgIHRoaXMuc2l6ZSA9ICsrZGF0YS5zaXplO1xuICAgICAgcmV0dXJuIHRoaXM7XG4gICAgfVxuICAgIGRhdGEgPSB0aGlzLl9fZGF0YV9fID0gbmV3IE1hcENhY2hlKHBhaXJzKTtcbiAgfVxuICBkYXRhLnNldChrZXksIHZhbHVlKTtcbiAgdGhpcy5zaXplID0gZGF0YS5zaXplO1xuICByZXR1cm4gdGhpcztcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBzdGFja1NldDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/_stackSet.js\n"); /***/ }), /***/ "./node_modules/lodash/_strictIndexOf.js": /*!***********************************************!*\ !*** ./node_modules/lodash/_strictIndexOf.js ***! \***********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0cmljdEluZGV4T2YuanM/MDk5YSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxNQUFNO0FBQ2pCLFdBQVcsRUFBRTtBQUNiLFdBQVcsT0FBTztBQUNsQixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL19zdHJpY3RJbmRleE9mLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBBIHNwZWNpYWxpemVkIHZlcnNpb24gb2YgYF8uaW5kZXhPZmAgd2hpY2ggcGVyZm9ybXMgc3RyaWN0IGVxdWFsaXR5XG4gKiBjb21wYXJpc29ucyBvZiB2YWx1ZXMsIGkuZS4gYD09PWAuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBpbnNwZWN0LlxuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gc2VhcmNoIGZvci5cbiAqIEBwYXJhbSB7bnVtYmVyfSBmcm9tSW5kZXggVGhlIGluZGV4IHRvIHNlYXJjaCBmcm9tLlxuICogQHJldHVybnMge251bWJlcn0gUmV0dXJucyB0aGUgaW5kZXggb2YgdGhlIG1hdGNoZWQgdmFsdWUsIGVsc2UgYC0xYC5cbiAqL1xuZnVuY3Rpb24gc3RyaWN0SW5kZXhPZihhcnJheSwgdmFsdWUsIGZyb21JbmRleCkge1xuICB2YXIgaW5kZXggPSBmcm9tSW5kZXggLSAxLFxuICAgICAgbGVuZ3RoID0gYXJyYXkubGVuZ3RoO1xuXG4gIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgaWYgKGFycmF5W2luZGV4XSA9PT0gdmFsdWUpIHtcbiAgICAgIHJldHVybiBpbmRleDtcbiAgICB9XG4gIH1cbiAgcmV0dXJuIC0xO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHN0cmljdEluZGV4T2Y7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_strictIndexOf.js\n"); /***/ }), /***/ "./node_modules/lodash/_stringSize.js": /*!********************************************!*\ !*** ./node_modules/lodash/_stringSize.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var asciiSize = __webpack_require__(/*! ./_asciiSize */ \"./node_modules/lodash/_asciiSize.js\"),\n hasUnicode = __webpack_require__(/*! ./_hasUnicode */ \"./node_modules/lodash/_hasUnicode.js\"),\n unicodeSize = __webpack_require__(/*! ./_unicodeSize */ \"./node_modules/lodash/_unicodeSize.js\");\n\n/**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\nfunction stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n}\n\nmodule.exports = stringSize;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ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dHJpbmdTaXplO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_stringSize.js\n"); /***/ }), /***/ "./node_modules/lodash/_stringToPath.js": /*!**********************************************!*\ !*** ./node_modules/lodash/_stringToPath.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var memoizeCapped = __webpack_require__(/*! ./_memoizeCapped */ \"./node_modules/lodash/_memoizeCapped.js\");\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3N0cmluZ1RvUGF0aC5qcz8xOGQ4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG9CQUFvQixtQkFBTyxDQUFDLGlFQUFrQjs7QUFFOUM7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLGFBQWEsTUFBTTtBQUNuQjtBQUNBO0FBQ0E7QUFDQTtBQ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vcE5hbWUsIGZ1bmN0aW9uKG1hdGNoLCBudW1iZXIsIHF1b3RlLCBzdWJTdHJpbmcpIHtcbiAgICByZXN1bHQucHVzaChxdW90ZSA/IHN1YlN0cmluZy5yZXBsYWNlKHJlRXNjYXBlQ2hhciwgJyQxJykgOiAobnVtYmVyIHx8IG1hdGNoKSk7XG4gIH0pO1xuICByZXR1cm4gcmVzdWx0O1xufSk7XG5cbm1vZHVsZS5leHBvcnRzID0gc3RyaW5nVG9QYXRoO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_stringToPath.js\n"); /***/ }), /***/ "./node_modules/lodash/_toKey.js": /*!***************************************!*\ !*** ./node_modules/lodash/_toKey.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isSymbol = __webpack_require__(/*! ./isSymbol */ \"./node_modules/lodash/isSymbol.js\");\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3RvS2V5LmpzP2Y0ZDYiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZUFBZSxtQkFBTyxDQUFDLHFEQUFZOztBQUVuQztBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxjQUFjO0FBQzNCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL190b0tleS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBpc1N5bWJvbCA9IHJlcXVpcmUoJy4vaXNTeW1ib2wnKTtcblxuLyoqIFVzZWQgYXMgcmVmZXJlbmNlcyBmb3IgdmFyaW91cyBgTnVtYmVyYCBjb25zdGFudHMuICovXG52YXIgSU5GSU5JVFkgPSAxIC8gMDtcblxuLyoqXG4gKiBDb252ZXJ0cyBgdmFsdWVgIHRvIGEgc3RyaW5nIGtleSBpZiBpdCdzIG5vdCBhIHN0cmluZyBvciBzeW1ib2wuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGluc3BlY3QuXG4gKiBAcmV0dXJucyB7c3RyaW5nfHN5bWJvbH0gUmV0dXJucyB0aGUga2V5LlxuICovXG5mdW5jdGlvbiB0b0tleSh2YWx1ZSkge1xuICBpZiAodHlwZW9mIHZhbHVlID09ICdzdHJpbmcnIHx8IGlzU3ltYm9sKHZhbHVlKSkge1xuICAgIHJldHVybiB2YWx1ZTtcbiAgfVxuICB2YXIgcmVzdWx0ID0gKHZhbHVlICsgJycpO1xuICByZXR1cm4gKHJlc3VsdCA9PSAnMCcgJiYgKDEgLyB2YWx1ZSkgPT0gLUlORklOSVRZKSA/ICctMCcgOiByZXN1bHQ7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gdG9LZXk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_toKey.js\n"); /***/ }), /***/ "./node_modules/lodash/_toSource.js": /*!******************************************!*\ !*** ./node_modules/lodash/_toSource.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3RvU291cmNlLmpzP2RjNTciXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9fdG9Tb3VyY2UuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogVXNlZCBmb3IgYnVpbHQtaW4gbWV0aG9kIHJlZmVyZW5jZXMuICovXG52YXIgZnVuY1Byb3RvID0gRnVuY3Rpb24ucHJvdG90eXBlO1xuXG4vKiogVXNlZCB0byByZXNvbHZlIHRoZSBkZWNvbXBpbGVkIHNvdXJjZSBvZiBmdW5jdGlvbnMuICovXG52YXIgZnVuY1RvU3RyaW5nID0gZnVuY1Byb3RvLnRvU3RyaW5nO1xuXG4vKipcbiAqIENvbnZlcnRzIGBmdW5jYCB0byBpdHMgc291cmNlIGNvZGUuXG4gKlxuICogQHByaXZhdGVcbiAqIEBwYXJhbSB7RnVuY3Rpb259IGZ1bmMgVGhlIGZ1bmN0aW9uIHRvIGNvbnZlcnQuXG4gKiBAcmV0dXJucyB7c3RyaW5nfSBSZXR1cm5zIHRoZSBzb3VyY2UgY29kZS5cbiAqL1xuZnVuY3Rpb24gdG9Tb3VyY2UoZnVuYykge1xuICBpZiAoZnVuYyAhPSBudWxsKSB7XG4gICAgdHJ5IHtcbiAgICAgIHJldHVybiBmdW5jVG9TdHJpbmcuY2FsbChmdW5jKTtcbiAgICB9IGNhdGNoIChlKSB7fVxuICAgIHRyeSB7XG4gICAgICByZXR1cm4gKGZ1bmMgKyAnJyk7XG4gICAgfSBjYXRjaCAoZSkge31cbiAgfVxuICByZXR1cm4gJyc7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gdG9Tb3VyY2U7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/_toSource.js\n"); /***/ }), /***/ "./node_modules/lodash/_unicodeSize.js": /*!*********************************************!*\ !*** ./node_modules/lodash/_unicodeSize.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\nfunction unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n}\n\nmodule.exports = unicodeSize;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3VuaWNvZGVTaXplLmpzP2FiODEiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsK0NBQStDLEVBQUU7QUFDakQ7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQixhQUFhLE9BQU87QUFDcEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvX3Vu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XN1bHQgPSByZVVuaWNvZGUubGFzdEluZGV4ID0gMDtcbiAgd2hpbGUgKHJlVW5pY29kZS50ZXN0KHN0cmluZykpIHtcbiAgICArK3Jlc3VsdDtcbiAgfVxuICByZXR1cm4gcmVzdWx0O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHVuaWNvZGVTaXplO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/_unicodeSize.js\n"); /***/ }), /***/ "./node_modules/lodash/clone.js": /*!**************************************!*\ !*** ./node_modules/lodash/clone.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseClone = __webpack_require__(/*! ./_baseClone */ \"./node_modules/lodash/_baseClone.js\");\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = clone;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvY2xvbmUu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iBUaGUgb3duIGVudW1lcmFibGUgcHJvcGVydGllcyBvZiBgYXJndW1lbnRzYCBvYmplY3RzIGFyZSBjbG9uZWRcbiAqIGFzIHBsYWluIG9iamVjdHMuIEFuIGVtcHR5IG9iamVjdCBpcyByZXR1cm5lZCBmb3IgdW5jbG9uZWFibGUgdmFsdWVzIHN1Y2hcbiAqIGFzIGVycm9yIG9iamVjdHMsIGZ1bmN0aW9ucywgRE9NIG5vZGVzLCBhbmQgV2Vha01hcHMuXG4gKlxuICogQHN0YXRpY1xuICogQG1lbWJlck9mIF9cbiAqIEBzaW5jZSAwLjEuMFxuICogQGNhdGVnb3J5IExhbmdcbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGNsb25lLlxuICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIGNsb25lZCB2YWx1ZS5cbiAqIEBzZWUgXy5jbG9uZURlZXBcbiAqIEBleGFtcGxlXG4gKlxuICogdmFyIG9iamVjdHMgPSBbeyAnYSc6IDEgfSwgeyAnYic6IDIgfV07XG4gKlxuICogdmFyIHNoYWxsb3cgPSBfLmNsb25lKG9iamVjdHMpO1xuICogY29uc29sZS5sb2coc2hhbGxvd1swXSA9PT0gb2JqZWN0c1swXSk7XG4gKiAvLyA9PiB0cnVlXG4gKi9cbmZ1bmN0aW9uIGNsb25lKHZhbHVlKSB7XG4gIHJldHVybiBiYXNlQ2xvbmUodmFsdWUsIENMT05FX1NZTUJPTFNfRkxBRyk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gY2xvbmU7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/clone.js\n"); /***/ }), /***/ "./node_modules/lodash/cloneDeep.js": /*!******************************************!*\ !*** ./node_modules/lodash/cloneDeep.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseClone = __webpack_require__(/*! ./_baseClone */ \"./node_modules/lodash/_baseClone.js\");\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvY2xvbmVEZWVwLmpzPzA2NDQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0JBQWdCLG1CQUFPLENBQUMseURBQWM7O0FBRXRDO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsRUFBRTtBQUNmO0FBQ0E7QUFDQTtBQUNBLG1CQUFtQixTQUFTLEdBQUcsU0FBUztBQUN4QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9jbG9uZURlZXAuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYmFzZUNsb25lID0gcmVxdWlyZSgnLi9fYmFzZUNsb25lJyk7XG5cbi8qKiBVc2VkIHRvIGNvbXBvc2UgYml0bWFza3MgZm9yIGNsb25pbmcuICovXG52YXIgQ0xPTkVfREVFUF9GTEFHID0gMSxcbiAgICBDTE9ORV9TWU1CT0xTX0ZMQUcgPSA0O1xuXG4vKipcbiAqIFRoaXMgbWV0aG9kIGlzIGxpa2UgYF8uY2xvbmVgIGV4Y2VwdCB0aGF0IGl0IHJlY3Vyc2l2ZWx5IGNsb25lcyBgdmFsdWVgLlxuICpcbiAqIEBzdGF0aWNcbiAqIEBtZW1iZXJPZiBfXG4gKiBAc2luY2UgMS4wLjBcbiAqIEBjYXRlZ29yeSBMYW5nXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byByZWN1cnNpdmVseSBjbG9uZS5cbiAqIEByZXR1cm5zIHsqfSBSZXR1cm5zIHRoZSBkZWVwIGNsb25lZCB2YWx1ZS5cbiAqIEBzZWUgXy5jbG9uZVxuICogQGV4YW1wbGVcbiAqXG4gKiB2YXIgb2JqZWN0cyA9IFt7ICdhJzogMSB9LCB7ICdiJzogMiB9XTtcbiAqXG4gKiB2YXIgZGVlcCA9IF8uY2xvbmVEZWVwKG9iamVjdHMpO1xuICogY29uc29sZS5sb2coZGVlcFswXSA9PT0gb2JqZWN0c1swXSk7XG4gKiAvLyA9PiBmYWxzZVxuICovXG5mdW5jdGlvbiBjbG9uZURlZXAodmFsdWUpIHtcbiAgcmV0dXJuIGJhc2VDbG9uZSh2YWx1ZSwgQ0xPTkVfREVFUF9GTEFHIHwgQ0xPTkVfU1lNQk9MU19GTEFHKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBjbG9uZURlZXA7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/cloneDeep.js\n"); /***/ }), /***/ "./node_modules/lodash/constant.js": /*!*****************************************!*\ !*** ./node_modules/lodash/constant.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvY29uc3RhbnQuanM/NzJmMCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsU0FBUztBQUN0QjtBQUNBO0FBQ0Esd0NBQXdDLFNBQVM7QUFDakQ7QUFDQTtBQUNBLFdBQVcsU0FBUyxHQUFHLFNBQVM7QUFDaEM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9jb25zdGFudC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ3JlYXRlcyBhIGZ1bmN0aW9uIHRoYXQgcmV0dXJucyBgdmFsdWVgLlxuICpcbiAqIEBzdGF0aWNcbiAqIEBtZW1iZXJPZiBfXG4gKiBAc2luY2UgMi40LjBcbiAqIEBjYXRlZ29yeSBVdGlsXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byByZXR1cm4gZnJvbSB0aGUgbmV3IGZ1bmN0aW9uLlxuICogQHJldHVybnMge0Z1bmN0aW9ufSBSZXR1cm5zIHRoZSBuZXcgY29uc3RhbnQgZnVuY3Rpb24uXG4gKiBAZXhhbXBsZVxuICpcbiAqIHZhciBvYmplY3RzID0gXy50aW1lcygyLCBfLmNvbnN0YW50KHsgJ2EnOiAxIH0pKTtcbiAqXG4gKiBjb25zb2xlLmxvZyhvYmplY3RzKTtcbiAqIC8vID0+IFt7ICdhJzogMSB9LCB7ICdhJzogMSB9XVxuICpcbiAqIGNvbnNvbGUubG9nKG9iamVjdHNbMF0gPT09IG9iamVjdHNbMV0pO1xuICogLy8gPT4gdHJ1ZVxuICovXG5mdW5jdGlvbiBjb25zdGFudCh2YWx1ZSkge1xuICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIHZhbHVlO1xuICB9O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNvbnN0YW50O1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/constant.js\n"); /***/ }), /***/ "./node_modules/lodash/defaults.js": /*!*****************************************!*\ !*** ./node_modules/lodash/defaults.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseRest = __webpack_require__(/*! ./_baseRest */ \"./node_modules/lodash/_baseRest.js\"),\n eq = __webpack_require__(/*! ./eq */ \"./node_modules/lodash/eq.js\"),\n isIterateeCall = __webpack_require__(/*! ./_isIterateeCall */ \"./node_modules/lodash/_isIterateeCall.js\"),\n keysIn = __webpack_require__(/*! ./keysIn */ \"./node_modules/lodash/keysIn.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n});\n\nmodule.exports = defaults;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvZGVmYXVsdHMuanM/OTVhZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxlQUFlLG1CQUFPLENBQUMsdURBQWE7QUFDcEMsU0FBUyxtQkFBTyxDQUFDLHlDQUFNO0FBQ3ZCLHFCQUFxQixtQkFBTyxDQUFDLG1FQUFtQjtBQUNoRCxhQUFhLG1CQUFPLENBQUMsaURBQVU7O0FBRS9CO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxVQUFVO0FBQ3JCLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQSxlQUFlLFNBQVMsR0FBRyxTQUFTLEdBQUcsU0FBUztBQUNoRCxVQUFVO0FBQ1Y7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FB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vcHMubGVuZ3RoO1xuXG4gICAgd2hpbGUgKCsrcHJvcHNJbmRleCA8IHByb3BzTGVuZ3RoKSB7XG4gICAgICB2YXIga2V5ID0gcHJvcHNbcHJvcHNJbmRleF07XG4gICAgICB2YXIgdmFsdWUgPSBvYmplY3Rba2V5XTtcblxuICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAoZXEodmFsdWUsIG9iamVjdFByb3RvW2tleV0pICYmICFoYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkpIHtcbiAgICAgICAgb2JqZWN0W2tleV0gPSBzb3VyY2Vba2V5XTtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICByZXR1cm4gb2JqZWN0O1xufSk7XG5cbm1vZHVsZS5leHBvcnRzID0gZGVmYXVsdHM7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/defaults.js\n"); /***/ }), /***/ "./node_modules/lodash/each.js": /*!*************************************!*\ !*** ./node_modules/lodash/each.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("module.exports = __webpack_require__(/*! ./forEach */ \"./node_modules/lodash/forEach.js\");\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvZWFjaC5qcz9jNjQxIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlCQUFpQixtQkFBTyxDQUFDLG1EQUFXIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9lYWNoLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL2ZvckVhY2gnKTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/each.js\n"); /***/ }), /***/ "./node_modules/lodash/eq.js": /*!***********************************!*\ !*** ./node_modules/lodash/eq.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvZXEuanM/OTYzOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixXQUFXLEVBQUU7QUFDYixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBLGlCQUFpQjtBQUNqQixnQkFBZ0I7QUFDaEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG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hlciB8fCAodmFsdWUgIT09IHZhbHVlICYmIG90aGVyICE9PSBvdGhlcik7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gZXE7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/eq.js\n"); /***/ }), /***/ "./node_modules/lodash/filter.js": /*!***************************************!*\ !*** ./node_modules/lodash/filter.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayFilter = __webpack_require__(/*! ./_arrayFilter */ \"./node_modules/lodash/_arrayFilter.js\"),\n baseFilter = __webpack_require__(/*! ./_baseFilter */ \"./node_modules/lodash/_baseFilter.js\"),\n baseIteratee = __webpack_require__(/*! ./_baseIteratee */ \"./node_modules/lodash/_baseIteratee.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\");\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n */\nfunction filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, baseIteratee(predicate, 3));\n}\n\nmodule.ex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uICogLy8gPT4gb2JqZWN0cyBmb3IgWydmcmVkJ11cbiAqXG4gKiAvLyBUaGUgYF8ubWF0Y2hlc2AgaXRlcmF0ZWUgc2hvcnRoYW5kLlxuICogXy5maWx0ZXIodXNlcnMsIHsgJ2FnZSc6IDM2LCAnYWN0aXZlJzogdHJ1ZSB9KTtcbiAqIC8vID0+IG9iamVjdHMgZm9yIFsnYmFybmV5J11cbiAqXG4gKiAvLyBUaGUgYF8ubWF0Y2hlc1Byb3BlcnR5YCBpdGVyYXRlZSBzaG9ydGhhbmQuXG4gKiBfLmZpbHRlcih1c2VycywgWydhY3RpdmUnLCBmYWxzZV0pO1xuICogLy8gPT4gb2JqZWN0cyBmb3IgWydmcmVkJ11cbiAqXG4gKiAvLyBUaGUgYF8ucHJvcGVydHlgIGl0ZXJhdGVlIHNob3J0aGFuZC5cbiAqIF8uZmlsdGVyKHVzZXJzLCAnYWN0aXZlJyk7XG4gKiAvLyA9PiBvYmplY3RzIGZvciBbJ2Jhcm5leSddXG4gKi9cbmZ1bmN0aW9uIGZpbHRlcihjb2xsZWN0aW9uLCBwcmVkaWNhdGUpIHtcbiAgdmFyIGZ1bmMgPSBpc0FycmF5KGNvbGxlY3Rpb24pID8gYXJyYXlGaWx0ZXIgOiBiYXNlRmlsdGVyO1xuICByZXR1cm4gZnVuYyhjb2xsZWN0aW9uLCBiYXNlSXRlcmF0ZWUocHJlZGljYXRlLCAzKSk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gZmlsdGVyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/filter.js\n"); /***/ }), /***/ "./node_modules/lodash/find.js": /*!*************************************!*\ !*** ./node_modules/lodash/find.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var createFind = __webpack_require__(/*! ./_createFind */ \"./node_modules/lodash/_createFind.js\"),\n findIndex = __webpack_require__(/*! ./findIndex */ \"./node_modules/lodash/findIndex.js\");\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\nmodule.exports = find;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvZmluZC5qcz8yNzY5Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlCQUFpQixtQkFBTyxDQUFDLDJEQUFlO0FBQ3hDLGdCQUFnQixtQkFBTyxDQUFDLHVEQUFhOztBQUVyQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLGFBQWE7QUFDeEIsV0FBVyxTQUFTO0FBQ3BCLFdBQVcsT0FBTztBQUNsQixhQUFhLEVBQUU7QUFDZjtBQUNBO0FBQ0E7QUFDQSxNQUFNLCtDQUErQztBQUNyRCxNQUFNLGdEQUFnRDtBQUN0RCxN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/ }), /***/ "./node_modules/lodash/findIndex.js": /*!******************************************!*\ !*** ./node_modules/lodash/findIndex.js ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseFindIndex = __webpack_require__(/*! ./_baseFindIndex */ \"./node_modules/lodash/_baseFindIndex.js\"),\n baseIteratee = __webpack_require__(/*! ./_baseIteratee */ \"./node_modules/lodash/_baseIteratee.js\"),\n toInteger = __webpack_require__(/*! ./toInteger */ \"./node_modules/lodash/toInteger.js\");\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N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tcbiAqIC8vID0+IDBcbiAqXG4gKiAvLyBUaGUgYF8ubWF0Y2hlc2AgaXRlcmF0ZWUgc2hvcnRoYW5kLlxuICogXy5maW5kSW5kZXgodXNlcnMsIHsgJ3VzZXInOiAnZnJlZCcsICdhY3RpdmUnOiBmYWxzZSB9KTtcbiAqIC8vID0+IDFcbiAqXG4gKiAvLyBUaGUgYF8ubWF0Y2hlc1Byb3BlcnR5YCBpdGVyYXRlZSBzaG9ydGhhbmQuXG4gKiBfLmZpbmRJbmRleCh1c2VycywgWydhY3RpdmUnLCBmYWxzZV0pO1xuICogLy8gPT4gMFxuICpcbiAqIC8vIFRoZSBgXy5wcm9wZXJ0eWAgaXRlcmF0ZWUgc2hvcnRoYW5kLlxuICogXy5maW5kSW5kZXgodXNlcnMsICdhY3RpdmUnKTtcbiAqIC8vID0+IDJcbiAqL1xuZnVuY3Rpb24gZmluZEluZGV4KGFycmF5LCBwcmVkaWNhdGUsIGZyb21JbmRleCkge1xuICB2YXIgbGVuZ3RoID0gYXJyYXkgPT0gbnVsbCA/IDAgOiBhcnJheS5sZW5ndGg7XG4gIGlmICghbGVuZ3RoKSB7XG4gICAgcmV0dXJuIC0xO1xuICB9XG4gIHZhciBpbmRleCA9IGZyb21JbmRleCA9PSBudWxsID8gMCA6IHRvSW50ZWdlcihmcm9tSW5kZXgpO1xuICBpZiAoaW5kZXggPCAwKSB7XG4gICAgaW5kZXggPSBuYXRpdmVNYXgobGVuZ3RoICsgaW5kZXgsIDApO1xuICB9XG4gIHJldHVybiBiYXNlRmluZEluZGV4KGFycmF5LCBiYXNlSXRlcmF0ZWUocHJlZGljYXRlLCAzKSwgaW5kZXgpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGZpbmRJbmRleDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/findIndex.js\n"); /***/ }), /***/ "./node_modules/lodash/flatten.js": /*!****************************************!*\ !*** ./node_modules/lodash/flatten.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseFlatten = __webpack_require__(/*! ./_baseFlatten */ \"./node_modules/lodash/_baseFlatten.js\");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvZmxhdHRlbi5qcz80ZDhjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGtCQUFrQixtQkFBTyxDQUFDLDZEQUFnQjs7QUFFMUM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE1BQU07QUFDakIsYUFBYSxNQUFNO0FBQ25CO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvZmxhdHRlbi5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlRmxhdHRlbiA9IHJlcXVpcmUoJy4vX2Jhc2VGbGF0dGVuJyk7XG5cbi8qKlxuICogRmxhdHRlbnMgYGFycmF5YCBhIHNpbmdsZSBsZXZlbCBkZWVwLlxuICpcbiAqIEBzdGF0aWNcbiAqIEBtZW1iZXJPZiBfXG4gKiBAc2luY2UgMC4xLjBcbiAqIEBjYXRlZ29yeSBBcnJheVxuICogQHBhcmFtIHtBcnJheX0gYXJyYXkgVGhlIGFycmF5IHRvIGZsYXR0ZW4uXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG5ldyBmbGF0dGVuZWQgYXJyYXkuXG4gKiBAZXhhbXBsZVxuICpcbiAqIF8uZmxhdHRlbihbMSwgWzIsIFszLCBbNF1dLCA1XV0pO1xuICogLy8gPT4gWzEsIDIsIFszLCBbNF1dLCA1XVxuICovXG5mdW5jdGlvbiBmbGF0dGVuKGFycmF5KSB7XG4gIHZhciBsZW5ndGggPSBhcnJheSA9PSBudWxsID8gMCA6IGFycmF5Lmxlbmd0aDtcbiAgcmV0dXJuIGxlbmd0aCA/IGJhc2VGbGF0dGVuKGFycmF5LCAxKSA6IFtdO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGZsYXR0ZW47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/flatten.js\n"); /***/ }), /***/ "./node_modules/lodash/forEach.js": /*!****************************************!*\ !*** ./node_modules/lodash/forEach.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayEach = __webpack_require__(/*! ./_arrayEach */ \"./node_modules/lodash/_arrayEach.js\"),\n baseEach = __webpack_require__(/*! ./_baseEach */ \"./node_modules/lodash/_baseEach.js\"),\n castFunction = __webpack_require__(/*! ./_castFunction */ \"./node_modules/lodash/_castFunction.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\");\n\n/**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, castFunction(iteratee));\n}\n\nmodule.exports = forEach;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvZm9yRWFjaC5qcz82Y2Q0Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGdCQUFnQixtQkFBTyxDQUFDLHlEQUFjO0FBQ3RDLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTtBQUNwQyxtQkFBbUIsbUJBQU8sQ0FBQywrREFBaUI7QUFDNUMsY0FBYyxtQkFBTyxDQUFDLG1EQUFXOztBQUVqQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxhQUFhO0FBQ3hCLFdBQVcsU0FBUztBQUNwQixhQUFhLGFBQWE7QUFDMUI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUk7QUFDSjtBQUNBO0FBQ0EsY0FBYyxpQkFBaUI7QUFDL0I7QUFDQSxJQUFJO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9mb3JFYWNoLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIG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RlcmF0ZWU9Xy5pZGVudGl0eV0gVGhlIGZ1bmN0aW9uIGludm9rZWQgcGVyIGl0ZXJhdGlvbi5cbiAqIEByZXR1cm5zIHtBcnJheXxPYmplY3R9IFJldHVybnMgYGNvbGxlY3Rpb25gLlxuICogQHNlZSBfLmZvckVhY2hSaWdodFxuICogQGV4YW1wbGVcbiAqXG4gKiBfLmZvckVhY2goWzEsIDJdLCBmdW5jdGlvbih2YWx1ZSkge1xuICogICBjb25zb2xlLmxvZyh2YWx1ZSk7XG4gKiB9KTtcbiAqIC8vID0+IExvZ3MgYDFgIHRoZW4gYDJgLlxuICpcbiAqIF8uZm9yRWFjaCh7ICdhJzogMSwgJ2InOiAyIH0sIGZ1bmN0aW9uKHZhbHVlLCBrZXkpIHtcbiAqICAgY29uc29sZS5sb2coa2V5KTtcbiAqIH0pO1xuICogLy8gPT4gTG9ncyAnYScgdGhlbiAnYicgKGl0ZXJhdGlvbiBvcmRlciBpcyBub3QgZ3VhcmFudGVlZCkuXG4gKi9cbmZ1bmN0aW9uIGZvckVhY2goY29sbGVjdGlvbiwgaXRlcmF0ZWUpIHtcbiAgdmFyIGZ1bmMgPSBpc0FycmF5KGNvbGxlY3Rpb24pID8gYXJyYXlFYWNoIDogYmFzZUVhY2g7XG4gIHJldHVybiBmdW5jKGNvbGxlY3Rpb24sIGNhc3RGdW5jdGlvbihpdGVyYXRlZSkpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGZvckVhY2g7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/forEach.js\n"); /***/ }), /***/ "./node_modules/lodash/forIn.js": /*!**************************************!*\ !*** ./node_modules/lodash/forIn.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseFor = __webpack_require__(/*! ./_baseFor */ \"./node_modules/lodash/_baseFor.js\"),\n castFunction = __webpack_require__(/*! ./_castFunction */ \"./node_modules/lodash/_castFunction.js\"),\n keysIn = __webpack_require__(/*! ./keysIn */ \"./node_modules/lodash/keysIn.js\");\n\n/**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\nfunction forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, castFunction(iteratee), keysIn);\n}\n\nmodule.exports = forIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvZm9ySW4uanM/OTk0OCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFPLENBQUMscURBQVk7QUFDbEMsbUJBQW1CLG1CQUFPLENBQUMsK0RBQWlCO0FBQzVDLGFBQWEsbUJBQU8sQ0FBQyxpREFBVTs7QUFFL0I7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxTQUFTO0FBQ3BCLGFBQWEsT0FBTztBQUNwQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQTtBQUNBO0FBQ0E7QU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gIHRoaXMuYSA9IDE7XG4gKiAgIHRoaXMuYiA9IDI7XG4gKiB9XG4gKlxuICogRm9vLnByb3RvdHlwZS5jID0gMztcbiAqXG4gKiBfLmZvckluKG5ldyBGb28sIGZ1bmN0aW9uKHZhbHVlLCBrZXkpIHtcbiAqICAgY29uc29sZS5sb2coa2V5KTtcbiAqIH0pO1xuICogLy8gPT4gTG9ncyAnYScsICdiJywgdGhlbiAnYycgKGl0ZXJhdGlvbiBvcmRlciBpcyBub3QgZ3VhcmFudGVlZCkuXG4gKi9cbmZ1bmN0aW9uIGZvckluKG9iamVjdCwgaXRlcmF0ZWUpIHtcbiAgcmV0dXJuIG9iamVjdCA9PSBudWxsXG4gICAgPyBvYmplY3RcbiAgICA6IGJhc2VGb3Iob2JqZWN0LCBjYXN0RnVuY3Rpb24oaXRlcmF0ZWUpLCBrZXlzSW4pO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGZvckluO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/forIn.js\n"); /***/ }), /***/ "./node_modules/lodash/get.js": /*!************************************!*\ !*** ./node_modules/lodash/get.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGet = __webpack_require__(/*! ./_baseGet */ \"./node_modules/lodash/_baseGet.js\");\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvZ2V0LmpzPzliMDIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxtQkFBTyxDQUFDLHFEQUFZOztBQUVsQztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsYUFBYTtBQUN4QixXQUFXLEVBQUU7QUFDYixhQUFhLEVBQUU7QUFDZjtBQUNBO0FBQ0EsaUJBQWlCLFFBQVEsT0FBTyxTQUFTLEVBQUU7QUFDM0M7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvZ2V0LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VHZXQgPSByZXF1aXJlKCcuL19iYXNlR2V0Jyk7XG5cbi8qKlxuICogR2V0cyB0aGUgdmFsdWUgYXQgYHBhdGhgIG9mIGBvYmplY3RgLiBJZiB0aGUgcmVzb2x2ZWQgdmFsdWUgaXNcbiAqIGB1bmRlZmluZWRgLCB0aGUgYGRlZmF1bHRWYWx1ZWAgaXMgcmV0dXJuZWQgaW4gaXRzIHBsYWNlLlxuICpcbiAqIEBzdGF0aWNcbiAqIEBtZW1iZXJPZiBfXG4gKiBAc2luY2UgMy43LjBcbiAqIEBjYXRlZ29yeSBPYmplY3RcbiAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIG9iamVjdCB0byBxdWVyeS5cbiAqIEBwYXJhbSB7QXJyYXl8c3RyaW5nfSBwYXRoIFRoZSBwYXRoIG9mIHRoZSBwcm9wZXJ0eSB0byBnZXQuXG4gKiBAcGFyYW0geyp9IFtkZWZhdWx0VmFsdWVdIFRoZSB2YWx1ZSByZXR1cm5lZCBmb3IgYHVuZGVmaW5lZGAgcmVzb2x2ZWQgdmFsdWVzLlxuICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIHJlc29sdmVkIHZhbHVlLlxuICogQGV4YW1wbGVcbiAqXG4gKiB2YXIgb2JqZWN0ID0geyAnYSc6IFt7ICdiJzogeyAnYyc6IDMgfSB9XSB9O1xuICpcbiAqIF8uZ2V0KG9iamVjdCwgJ2FbMF0uYi5jJyk7XG4gKiAvLyA9PiAzXG4gKlxuICogXy5nZXQob2JqZWN0LCBbJ2EnLCAnMCcsICdiJywgJ2MnXSk7XG4gKiAvLyA9PiAzXG4gKlxuICogXy5nZXQob2JqZWN0LCAnYS5iLmMnLCAnZGVmYXVsdCcpO1xuICogLy8gPT4gJ2RlZmF1bHQnXG4gKi9cbmZ1bmN0aW9uIGdldChvYmplY3QsIHBhdGgsIGRlZmF1bHRWYWx1ZSkge1xuICB2YXIgcmVzdWx0ID0gb2JqZWN0ID09IG51bGwgPyB1bmRlZmluZWQgOiBiYXNlR2V0KG9iamVjdCwgcGF0aCk7XG4gIHJldHVybiByZXN1bHQgPT09IHVuZGVmaW5lZCA/IGRlZmF1bHRWYWx1ZSA6IHJlc3VsdDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBnZXQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/get.js\n"); /***/ }), /***/ "./node_modules/lodash/has.js": /*!************************************!*\ !*** ./node_modules/lodash/has.js ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseHas = __webpack_require__(/*! ./_baseHas */ \"./node_modules/lodash/_baseHas.js\"),\n hasPath = __webpack_require__(/*! ./_hasPath */ \"./node_modules/lodash/_hasPath.js\");\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaGFzLmpzPzM4NTIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxtQkFBTyxDQUFDLHFEQUFZO0FBQ2xDLGNBQWMsbUJBQU8sQ0FBQyxxREFBWTs7QUFFbEM7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsV0FBVyxhQUFhO0FBQ3hCLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0EsaUJBQWlCLE9BQU8sU0FBUztBQUNqQyx5QkFBeUIsZ0JBQWdCLFNBQVMsR0FBRztBQUNyRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvaGFzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiO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IifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/has.js\n"); /***/ }), /***/ "./node_modules/lodash/hasIn.js": /*!**************************************!*\ !*** ./node_modules/lodash/hasIn.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseHasIn = __webpack_require__(/*! ./_baseHasIn */ \"./node_modules/lodash/_baseHasIn.js\"),\n hasPath = __webpack_require__(/*! ./_hasPath */ \"./node_modules/lodash/_hasPath.js\");\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaGFzSW4uanM/ODYwNCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxjQUFjLG1CQUFPLENBQUMscURBQVk7O0FBRWxDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxPQUFPO0FBQ2xCLFdBQVcsYUFBYTtBQUN4QixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBLDBCQUEwQixnQkFBZ0IsU0FBUyxHQUFHO0FBQ3REO0FBQ0E7QU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Ki9cbmZ1bmN0aW9uIGhhc0luKG9iamVjdCwgcGF0aCkge1xuICByZXR1cm4gb2JqZWN0ICE9IG51bGwgJiYgaGFzUGF0aChvYmplY3QsIHBhdGgsIGJhc2VIYXNJbik7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaGFzSW47XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/hasIn.js\n"); /***/ }), /***/ "./node_modules/lodash/identity.js": /*!*****************************************!*\ !*** ./node_modules/lodash/identity.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaWRlbnRpdHkuanM/Y2Q5ZCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsRUFBRTtBQUNmO0FBQ0E7QUFDQSxpQkFBaUI7QUFDakI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL2lkZW50aXR5LmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBUaGlzIG1ldGhvZCByZXR1cm5zIHRoZSBmaXJzdCBhcmd1bWVudCBpdCByZWNlaXZlcy5cbiAqXG4gKiBAc3RhdGljXG4gKiBAc2luY2UgMC4xLjBcbiAqIEBtZW1iZXJPZiBfXG4gKiBAY2F0ZWdvcnkgVXRpbFxuICogQHBhcmFtIHsqfSB2YWx1ZSBBbnkgdmFsdWUuXG4gKiBAcmV0dXJucyB7Kn0gUmV0dXJucyBgdmFsdWVgLlxuICogQGV4YW1wbGVcbiAqXG4gKiB2YXIgb2JqZWN0ID0geyAnYSc6IDEgfTtcbiAqXG4gKiBjb25zb2xlLmxvZyhfLmlkZW50aXR5KG9iamVjdCkgPT09IG9iamVjdCk7XG4gKiAvLyA9PiB0cnVlXG4gKi9cbmZ1bmN0aW9uIGlkZW50aXR5KHZhbHVlKSB7XG4gIHJldHVybiB2YWx1ZTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBpZGVudGl0eTtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/identity.js\n"); /***/ }), /***/ "./node_modules/lodash/isArguments.js": /*!********************************************!*\ !*** ./node_modules/lodash/isArguments.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIsArguments = __webpack_require__(/*! ./_baseIsArguments */ \"./node_modules/lodash/_baseIsArguments.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNBcmd1bWVudHMuanM/ZDM3MCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxzQkFBc0IsbUJBQU8sQ0FBQyxxRUFBb0I7QUFDbEQsbUJBQW1CLG1CQUFPLENBQUMsNkRBQWdCOztBQUUzQztBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQSw2QkFBNkIsa0JBQWtCLEVBQUU7QUFDakQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDhDQUE4QyxrQkFBa0IsRUFBRTtBQUNsRTtBQUNBO0FBQ0E7O0FBRUEiLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvbG9kYXNoL2lzQXJndW1lbnRzLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VJc0FyZ3VtZW50cyA9IHJlcXVpcmUoJy4vX2Jhc2VJc0FyZ3VtZW50cycpLFxuICAgIGlzT2JqZWN0TGlrZSA9IHJlcXVpcmUoJy4vaXNPYmplY3RMaWtlJyk7XG5cbi8qKiBVc2VkIGZvciBidWlsdC1pbiBtZXRob2QgcmVmZXJlbmNlcy4gKi9cbnZhciBvYmplY3RQcm90byA9IE9iamVjdC5wcm90b3R5cGU7XG5cbi8qKiBVc2VkIHRvIGNoZWNrIG9iamVjdHMgZm9yIG93biBwcm9wZXJ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uXG5tb2R1bGUuZXhwb3J0cyA9IGlzQXJndW1lbnRzO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/isArguments.js\n"); /***/ }), /***/ "./node_modules/lodash/isArray.js": /*!****************************************!*\ !*** ./node_modules/lodash/isArray.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNBcnJheS5qcz82NzQ3Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNBcnJheS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ2hlY2tzIGlmIGB2YWx1ZWAgaXMgY2xhc3NpZmllZCBhcyBhbiBgQXJyYXlgIG9iamVjdC5cbiAqXG4gKiBAc3RhdGljXG4gKiBAbWVtYmVyT2YgX1xuICogQHNpbmNlIDAuMS4wXG4gKiBAY2F0ZWdvcnkgTGFuZ1xuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhbiBhcnJheSwgZWxzZSBgZmFsc2VgLlxuICogQGV4YW1wbGVcbiAqXG4gKiBfLmlzQXJyYXkoWzEsIDIsIDNdKTtcbiAqIC8vID0+IHRydWVcbiAqXG4gKiBfLmlzQXJyYXkoZG9jdW1lbnQuYm9keS5jaGlsZHJlbik7XG4gKiAvLyA9PiBmYWxzZVxuICpcbiAqIF8uaXNBcnJheSgnYWJjJyk7XG4gKiAvLyA9PiBmYWxzZVxuICpcbiAqIF8uaXNBcnJheShfLm5vb3ApO1xuICogLy8gPT4gZmFsc2VcbiAqL1xudmFyIGlzQXJyYXkgPSBBcnJheS5pc0FycmF5O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGlzQXJyYXk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/isArray.js\n"); /***/ }), /***/ "./node_modules/lodash/isArrayLike.js": /*!********************************************!*\ !*** ./node_modules/lodash/isArrayLike.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isFunction = __webpack_require__(/*! ./isFunction */ \"./node_modules/lodash/isFunction.js\"),\n isLength = __webpack_require__(/*! ./isLength */ \"./node_modules/lodash/isLength.js\");\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNBcnJheUxpa2UuanM/MzBjOSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsbUJBQU8sQ0FBQyx5REFBYztBQUN2QyxlQUFlLG1CQUFPLENBQUMscURBQVk7O0FBRW5DO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9pc0FycmF5TGlrZS5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBpc0Z1bmN0aW9uID0gcmVxdWlyZSgnLi9pc0Z1bmN0aW9uJyksXG4gICAgaXNMZW5ndGggPSByZXF1aXJlKCcuL2lzTGVuZ3RoJyk7XG5cbi8qKlxuICogQ2hlY2tzIGlmIGB2YWx1ZWAgaXMgYXJyYXktbGlrZS4gQSB2YWx1ZSBpcyBjb25zaWRlcmVkIGFycmF5LWxpa2UgaWYgaXQnc1xuICogbm90IGEgZnVuY3Rpb24gYW5kIGhhcyBhIGB2YWx1ZS5sZW5ndGhgIHRoYXQncyBhbiBpbnRlZ2VyIGdyZWF0ZXIgdGhhbiBvclxuICogZXF1YWwgdG8gYDBgIGFuZCBsZXNzIHRoYW4gb3IgZXF1YWwgdG8gYE51bWJlci5NQVhfU0FGRV9JTlRFR0VSYC5cbiAqXG4gKiBAc3RhdGljXG4gKiBAbWVtYmVyT2YgX1xuICogQHNpbmNlIDQuMC4wXG4gKiBAY2F0ZWdvcnkgTGFuZ1xuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhcnJheS1saWtlLCBlbHNlIGBmYWxzZWAuXG4gKiBAZXhhbXBsZVxuICpcbiAqIF8uaXNBcnJheUxpa2UoWzEsIDIsIDNdKTtcbiAqIC8vID0+IHRydWVcbiAqXG4gKiBfLmlzQXJyYXlMaWtlKGRvY3VtZW50LmJvZHkuY2hpbGRyZW4pO1xuICogLy8gPT4gdHJ1ZVxuICpcbiAqIF8uaXNBcnJheUxpa2UoJ2FiYycpO1xuICogLy8gPT4gdHJ1ZVxuICpcbiAqIF8uaXNBcnJheUxpa2UoXy5ub29wKTtcbiAqIC8vID0+IGZhbHNlXG4gKi9cbmZ1bmN0aW9uIGlzQXJyYXlMaWtlKHZhbHVlKSB7XG4gIHJldHVybiB2YWx1ZSAhPSBudWxsICYmIGlzTGVuZ3RoKHZhbHVlLmxlbmd0aCkgJiYgIWlzRnVuY3Rpb24odmFsdWUpO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGlzQXJyYXlMaWtlO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/isArrayLike.js\n"); /***/ }), /***/ "./node_modules/lodash/isArrayLikeObject.js": /*!**************************************************!*\ !*** ./node_modules/lodash/isArrayLikeObject.js ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNBcnJheUxpa2VPYmplY3QuanM/ZGNiZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxrQkFBa0IsbUJBQU8sQ0FBQywyREFBZTtBQUN6QyxtQkFBbUIsbUJBQU8sQ0FBQyw2REFBZ0I7O0FBRTNDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9pc0FycmF5TGlrZU9iamVjdC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBpc0FycmF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./node_modules/lodash/isArrayLikeObject.js\n"); /***/ }), /***/ "./node_modules/lodash/isBuffer.js": /*!*****************************************!*\ !*** ./node_modules/lodash/isBuffer.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\"),\n stubFalse = __webpack_require__(/*! ./stubFalse */ \"./node_modules/lodash/stubFalse.js\");\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNCdWZmZXIuanM/MGQyNCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx5REFBVyxtQkFBTyxDQUFDLCtDQUFTO0FBQ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hciBCdWZmZXIgPSBtb2R1bGVFeHBvcnRzID8gcm9vdC5CdWZmZXIgOiB1bmRlZmluZWQ7XG5cbi8qIEJ1aWx0LWluIG1ldGhvZCByZWZlcmVuY2VzIGZvciB0aG9zZSB3aXRoIHRoZSBzYW1lIG5hbWUgYXMgb3RoZXIgYGxvZGFzaGAgbWV0aG9kcy4gKi9cbnZhciBuYXRpdmVJc0J1ZmZlciA9IEJ1ZmZlciA/IEJ1ZmZlci5pc0J1ZmZlciA6IHVuZGVmaW5lZDtcblxuLyoqXG4gKiBDaGVja3MgaWYgYHZhbHVlYCBpcyBhIGJ1ZmZlci5cbiAqXG4gKiBAc3RhdGljXG4gKiBAbWVtYmVyT2YgX1xuICogQHNpbmNlIDQuMy4wXG4gKiBAY2F0ZWdvcnkgTGFuZ1xuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhIGJ1ZmZlciwgZWxzZSBgZmFsc2VgLlxuICogQGV4YW1wbGVcbiAqXG4gKiBfLmlzQnVmZmVyKG5ldyBCdWZmZXIoMikpO1xuICogLy8gPT4gdHJ1ZVxuICpcbiAqIF8uaXNCdWZmZXIobmV3IFVpbnQ4QXJyYXkoMikpO1xuICogLy8gPT4gZmFsc2VcbiAqL1xudmFyIGlzQnVmZmVyID0gbmF0aXZlSXNCdWZmZXIgfHwgc3R1YkZhbHNlO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGlzQnVmZmVyO1xuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/isBuffer.js\n"); /***/ }), /***/ "./node_modules/lodash/isEmpty.js": /*!****************************************!*\ !*** ./node_modules/lodash/isEmpty.js ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseKeys = __webpack_require__(/*! ./_baseKeys */ \"./node_modules/lodash/_baseKeys.js\"),\n getTag = __webpack_require__(/*! ./_getTag */ \"./node_modules/lodash/_getTag.js\"),\n isArguments = __webpack_require__(/*! ./isArguments */ \"./node_modules/lodash/isArguments.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\"),\n isBuffer = __webpack_require__(/*! ./isBuffer */ \"./node_modules/lodash/isBuffer.js\"),\n isPrototype = __webpack_require__(/*! ./_isPrototype */ \"./node_modules/lodash/_isPrototype.js\"),\n isTypedArray = __webpack_require__(/*! ./isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNFbXB0eS5qcz8xM2VhIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTtBQUNwQyxhQUFhLG1CQUFPLENBQUMsbURBQVc7QUFDaEMsa0JBQWtCLG1CQUFPLENBQUMsMkRBQWU7QUFDekMsY0FBYyxtQkFBTyxDQUFDLG1EQUFXO0FBQ2pDLGtCQUFrQixtQkFBTyxDQUFDLDJEQUFlO0FBQ3pDLGVBQWUsbUJBQU8sQ0FBQyxxREFBWTtBQUNuQyxrQkFBa0IsbUJBQU8sQ0FBQyw2REFBZ0I7QUFDMUMsbUJBQW1CLG1CQUFPLENBQUMsNkRBQWdCOztBQUUzQztBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGNBQWMsU0FBUztBQUN2QjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FB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gPT0gbnVsbCkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG4gIGlmIChpc0FycmF5TGlrZSh2YWx1ZSkgJiZcbiAgICAgIChpc0FycmF5KHZhbHVlKSB8fCB0eXBlb2YgdmFsdWUgPT0gJ3N0cmluZycgfHwgdHlwZW9mIHZhbHVlLnNwbGljZSA9PSAnZnVuY3Rpb24nIHx8XG4gICAgICAgIGlzQnVmZmVyKHZhbHVlKSB8fCBpc1R5cGVkQXJyYXkodmFsdWUpIHx8IGlzQXJndW1lbnRzKHZhbHVlKSkpIHtcbiAgICByZXR1cm4gIXZhbHVlLmxlbmd0aDtcbiAgfVxuICB2YXIgdGFnID0gZ2V0VGFnKHZhbHVlKTtcbiAgaWYgKHRhZyA9PSBtYXBUYWcgfHwgdGFnID09IHNldFRhZykge1xuICAgIHJldHVybiAhdmFsdWUuc2l6ZTtcbiAgfVxuICBpZiAoaXNQcm90b3R5cGUodmFsdWUpKSB7XG4gICAgcmV0dXJuICFiYXNlS2V5cyh2YWx1ZSkubGVuZ3RoO1xuICB9XG4gIGZvciAodmFyIGtleSBpbiB2YWx1ZSkge1xuICAgIGlmIChoYXNPd25Qcm9wZXJ0eS5jYWxsKHZhbHVlLCBrZXkpKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG4gIHJldHVybiB0cnVlO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGlzRW1wdHk7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/isEmpty.js\n"); /***/ }), /***/ "./node_modules/lodash/isFunction.js": /*!*******************************************!*\ !*** ./node_modules/lodash/isFunction.js ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isObject = __webpack_require__(/*! ./isObject */ \"./node_modules/lodash/isObject.js\");\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNGdW5jdGlvbi5qcz85NTIwIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlCQUFpQixtQkFBTyxDQUFDLDJEQUFlO0FBQ3hDLGVBQWUsbUJBQU8sQ0FBQyxxREFBWTs7QUFFbkM7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9pc0Z1bmN0aW9uLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGJhc2VHZXRUYWcgPS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HdoaWNoIHJldHVybnMgJ29iamVjdCcgZm9yIHR5cGVkIGFycmF5cyBhbmQgb3RoZXIgY29uc3RydWN0b3JzLlxuICB2YXIgdGFnID0gYmFzZUdldFRhZyh2YWx1ZSk7XG4gIHJldHVybiB0YWcgPT0gZnVuY1RhZyB8fCB0YWcgPT0gZ2VuVGFnIHx8IHRhZyA9PSBhc3luY1RhZyB8fCB0YWcgPT0gcHJveHlUYWc7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaXNGdW5jdGlvbjtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/isFunction.js\n"); /***/ }), /***/ "./node_modules/lodash/isLength.js": /*!*****************************************!*\ !*** ./node_modules/lodash/isLength.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNMZW5ndGguanM/YjIxOCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOzt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c0xlbmd0aChOdW1iZXIuTUlOX1ZBTFVFKTtcbiAqIC8vID0+IGZhbHNlXG4gKlxuICogXy5pc0xlbmd0aChJbmZpbml0eSk7XG4gKiAvLyA9PiBmYWxzZVxuICpcbiAqIF8uaXNMZW5ndGgoJzMnKTtcbiAqIC8vID0+IGZhbHNlXG4gKi9cbmZ1bmN0aW9uIGlzTGVuZ3RoKHZhbHVlKSB7XG4gIHJldHVybiB0eXBlb2YgdmFsdWUgPT0gJ251bWJlcicgJiZcbiAgICB2YWx1ZSA+IC0xICYmIHZhbHVlICUgMSA9PSAwICYmIHZhbHVlIDw9IE1BWF9TQUZFX0lOVEVHRVI7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaXNMZW5ndGg7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/isLength.js\n"); /***/ }), /***/ "./node_modules/lodash/isMap.js": /*!**************************************!*\ !*** ./node_modules/lodash/isMap.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIsMap = __webpack_require__(/*! ./_baseIsMap */ \"./node_modules/lodash/_baseIsMap.js\"),\n baseUnary = __webpack_require__(/*! ./_baseUnary */ \"./node_modules/lodash/_baseUnary.js\"),\n nodeUtil = __webpack_require__(/*! ./_nodeUtil */ \"./node_modules/lodash/_nodeUtil.js\");\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uI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HJ1ZWAgaWYgYHZhbHVlYCBpcyBhIG1hcCwgZWxzZSBgZmFsc2VgLlxuICogQGV4YW1wbGVcbiAqXG4gKiBfLmlzTWFwKG5ldyBNYXApO1xuICogLy8gPT4gdHJ1ZVxuICpcbiAqIF8uaXNNYXAobmV3IFdlYWtNYXApO1xuICogLy8gPT4gZmFsc2VcbiAqL1xudmFyIGlzTWFwID0gbm9kZUlzTWFwID8gYmFzZVVuYXJ5KG5vZGVJc01hcCkgOiBiYXNlSXNNYXA7XG5cbm1vZHVsZS5leHBvcnRzID0gaXNNYXA7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/isMap.js\n"); /***/ }), /***/ "./node_modules/lodash/isObject.js": /*!*****************************************!*\ !*** ./node_modules/lodash/isObject.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNPYmplY3QuanM/MWE4YyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FB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qZWN0KG51bGwpO1xuICogLy8gPT4gZmFsc2VcbiAqL1xuZnVuY3Rpb24gaXNPYmplY3QodmFsdWUpIHtcbiAgdmFyIHR5cGUgPSB0eXBlb2YgdmFsdWU7XG4gIHJldHVybiB2YWx1ZSAhPSBudWxsICYmICh0eXBlID09ICdvYmplY3QnIHx8IHR5cGUgPT0gJ2Z1bmN0aW9uJyk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaXNPYmplY3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/isObject.js\n"); /***/ }), /***/ "./node_modules/lodash/isObjectLike.js": /*!*********************************************!*\ !*** ./node_modules/lodash/isObjectLike.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNPYmplY3RMaWtlLmpzPzEzMTAiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0Esb0JBQW9CO0FBQ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n0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/isObjectLike.js\n"); /***/ }), /***/ "./node_modules/lodash/isPlainObject.js": /*!**********************************************!*\ !*** ./node_modules/lodash/isPlainObject.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n getPrototype = __webpack_require__(/*! ./_getPrototype */ \"./node_modules/lodash/_getPrototype.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n//# sourceURL=[module]\n//#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BgZmFsc2VgLlxuICogQGV4YW1wbGVcbiAqXG4gKiBmdW5jdGlvbiBGb28oKSB7XG4gKiAgIHRoaXMuYSA9IDE7XG4gKiB9XG4gKlxuICogXy5pc1BsYWluT2JqZWN0KG5ldyBGb28pO1xuICogLy8gPT4gZmFsc2VcbiAqXG4gKiBfLmlzUGxhaW5PYmplY3QoWzEsIDIsIDNdKTtcbiAqIC8vID0+IGZhbHNlXG4gKlxuICogXy5pc1BsYWluT2JqZWN0KHsgJ3gnOiAwLCAneSc6IDAgfSk7XG4gKiAvLyA9PiB0cnVlXG4gKlxuICogXy5pc1BsYWluT2JqZWN0KE9iamVjdC5jcmVhdGUobnVsbCkpO1xuICogLy8gPT4gdHJ1ZVxuICovXG5mdW5jdGlvbiBpc1BsYWluT2JqZWN0KHZhbHVlKSB7XG4gIGlmICghaXNPYmplY3RMaWtlKHZhbHVlKSB8fCBiYXNlR2V0VGFnKHZhbHVlKSAhPSBvYmplY3RUYWcpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbiAgdmFyIHByb3RvID0gZ2V0UHJvdG90eXBlKHZhbHVlKTtcbiAgaWYgKHByb3RvID09PSBudWxsKSB7XG4gICAgcmV0dXJuIHRydWU7XG4gIH1cbiAgdmFyIEN0b3IgPSBoYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3RvLCAnY29uc3RydWN0b3InKSAmJiBwcm90by5jb25zdHJ1Y3RvcjtcbiAgcmV0dXJuIHR5cGVvZiBDdG9yID09ICdmdW5jdGlvbicgJiYgQ3RvciBpbnN0YW5jZW9mIEN0b3IgJiZcbiAgICBmdW5jVG9TdHJpbmcuY2FsbChDdG9yKSA9PSBvYmplY3RDdG9yU3RyaW5nO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGlzUGxhaW5PYmplY3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/isPlainObject.js\n"); /***/ }), /***/ "./node_modules/lodash/isSet.js": /*!**************************************!*\ !*** ./node_modules/lodash/isSet.js ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIsSet = __webpack_require__(/*! ./_baseIsSet */ \"./node_modules/lodash/_baseIsSet.js\"),\n baseUnary = __webpack_require__(/*! ./_baseUnary */ \"./node_modules/lodash/_baseUnary.js\"),\n nodeUtil = __webpack_require__(/*! ./_nodeUtil */ \"./node_modules/lodash/_nodeUtil.js\");\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNTZXQuanM/ZDdlZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxnQkFBZ0IsbUJBQU8sQ0FBQyx5REFBYztBQUN0QyxlQUFlLG1CQUFPLENBQUMsdURBQWE7O0FBRXBDO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9pc1NldC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlSXNTZXQgPSByZXF1aXJlKCcuL19iYXNlSXNTZXQnKSxcbiAgICBiYXNlVW5hcnkgPSByZXF1aXJlKCcuL19iYXNlVW5hcnknKSxcbiAgICBub2RlVXRpbCA9IHJlcXVpcmUoJy4vX25vZGVVdGlsJyk7XG5cbi8qIE5vZGUuanMgaGVscGVyIHJlZmVyZW5jZXMuICovXG52YXIgbm9kZUlzU2V0ID0gbm9kZVV0aWwgJiYgbm9kZVV0aWwuaXNTZXQ7XG5cbi8qKlxuICogQ2hlY2tzIGlmIGB2YWx1ZWAgaXMgY2xhc3NpZmllZCBhcyBhIGBTZXRgIG9iamVjdC5cbiAqXG4gKiBAc3RhdGljXG4gKiBAbWVtYmVyT2YgX1xuICogQHNpbmNlIDQuMy4wXG4gKiBAY2F0ZWdvcnkgTGFuZ1xuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhIHNldCwgZWxzZSBgZmFsc2VgLlxuICogQGV4YW1wbGVcbiAqXG4gKiBfLmlzU2V0KG5ldyBTZXQpO1xuICogLy8gPT4gdHJ1ZVxuICpcbiAqIF8uaXNTZXQobmV3IFdlYWtTZXQpO1xuICogLy8gPT4gZmFsc2VcbiAqL1xudmFyIGlzU2V0ID0gbm9kZUlzU2V0ID8gYmFzZVVuYXJ5KG5vZGVJc1NldCkgOiBiYXNlSXNTZXQ7XG5cbm1vZHVsZS5leHBvcnRzID0gaXNTZXQ7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/isSet.js\n"); /***/ }), /***/ "./node_modules/lodash/isString.js": /*!*****************************************!*\ !*** ./node_modules/lodash/isString.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNTdHJpbmcuanM/ZTJhMCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsbUJBQU8sQ0FBQywyREFBZTtBQUN4QyxjQUFjLG1CQUFPLENBQUMsbURBQVc7QUFDakMsbUJBQW1CLG1CQUFPLENBQUMsNkRBQWdCOztBQUUzQztBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxFQUFFO0FBQ2IsYUFBYSxRQUFRO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNTdHJpbmcuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYmFzZUdldFRhZyA9IHJlcXVpcmUoJy4vX2Jhc2VHZXRUYWcnKSxcbiAgICBpc0FycmF5ID0gcmVxdWlyZSgnLi9pc0FycmF5JyksXG4gICAgaXNPYmplY3RMaWtlID0gcmVxdWlyZSgnLi9pc09iamVjdExpa2UnKTtcblxuLyoqIGBPYmplY3QjdG9TdHJpbmdgIHJlc3VsdCByZWZlcmVuY2VzLiAqL1xudmFyIHN0cmluZ1RhZyA9ICdbb2JqZWN0IFN0cmluZ10nO1xuXG4vKipcbiAqIENoZWNrcyBpZiBgdmFsdWVgIGlzIGNsYXNzaWZpZWQgYXMgYSBgU3RyaW5nYCBwcmltaXRpdmUgb3Igb2JqZWN0LlxuICpcbiAqIEBzdGF0aWNcbiAqIEBzaW5jZSAwLjEuMFxuICogQG1lbWJlck9mIF9cbiAqIEBjYXRlZ29yeSBMYW5nXG4gKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBjaGVjay5cbiAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBgdmFsdWVgIGlzIGEgc3RyaW5nLCBlbHNlIGBmYWxzZWAuXG4gKiBAZXhhbXBsZVxuICpcbiAqIF8uaXNTdHJpbmcoJ2FiYycpO1xuICogLy8gPT4gdHJ1ZVxuICpcbiAqIF8uaXNTdHJpbmcoMSk7XG4gKiAvLyA9PiBmYWxzZVxuICovXG5mdW5jdGlvbiBpc1N0cmluZyh2YWx1ZSkge1xuICByZXR1cm4gdHlwZW9mIHZhbHVlID09ICdzdHJpbmcnIHx8XG4gICAgKCFpc0FycmF5KHZhbHVlKSAmJiBpc09iamVjdExpa2UodmFsdWUpICYmIGJhc2VHZXRUYWcodmFsdWUpID09IHN0cmluZ1RhZyk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gaXNTdHJpbmc7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/isString.js\n"); /***/ }), /***/ "./node_modules/lodash/isSymbol.js": /*!*****************************************!*\ !*** ./node_modules/lodash/isSymbol.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNTeW1ib2wuanM/ZmZkNiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsbUJBQU8sQ0FBQywyREFBZTtBQUN4QyxtQkFBbUIsbUJBQU8sQ0FBQyw2REFBZ0I7O0FBRTNDO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLEVBQUU7QUFDYixhQUFhLFFBQVE7QUFDckI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9pc1N5bWJvbC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBiYXNlR2V0VGFnID0gcmVxdWlyZSgnLi9fYmFzZUdldFRhZycpLFxuICAgIGlzT2JqZWN0TGlrZSA9IHJlcXVpcmUoJy4vaXNPYmplY3RMaWtlJyk7XG5cbi8qKiBgT2JqZWN0I3RvU3RyaW5nYCByZXN1bHQgcmVmZXJlbmNlcy4gKi9cbnZhciBzeW1ib2xUYWcgPSAnW29iamVjdCBTeW1ib2xdJztcblxuLyoqXG4gKiBDaGVja3MgaWYgYHZhbHVlYCBpcyBjbGFzc2lmaWVkIGFzIGEgYFN5bWJvbGAgcHJpbWl0aXZlIG9yIG9iamVjdC5cbiAqXG4gKiBAc3RhdGljXG4gKiBAbWVtYmVyT2YgX1xuICogQHNpbmNlIDQuMC4wXG4gKiBAY2F0ZWdvcnkgTGFuZ1xuICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2hlY2suXG4gKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhIHN5bWJvbCwgZWxzZSBgZmFsc2VgLlxuICogQGV4YW1wbGVcbiAqXG4gKiBfLmlzU3ltYm9sKFN5bWJvbC5pdGVyYXRvcik7XG4gKiAvLyA9PiB0cnVlXG4gKlxuICogXy5pc1N5bWJvbCgnYWJjJyk7XG4gKiAvLyA9PiBmYWxzZVxuICovXG5mdW5jdGlvbiBpc1N5bWJvbCh2YWx1ZSkge1xuICByZXR1cm4gdHlwZW9mIHZhbHVlID09ICdzeW1ib2wnIHx8XG4gICAgKGlzT2JqZWN0TGlrZSh2YWx1ZSkgJiYgYmFzZUdldFRhZyh2YWx1ZSkgPT0gc3ltYm9sVGFnKTtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBpc1N5bWJvbDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/isSymbol.js\n"); /***/ }), /***/ "./node_modules/lodash/isTypedArray.js": /*!*********************************************!*\ !*** ./node_modules/lodash/isTypedArray.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ \"./node_modules/lodash/_baseIsTypedArray.js\"),\n baseUnary = __webpack_require__(/*! ./_baseUnary */ \"./node_modules/lodash/_baseUnary.js\"),\n nodeUtil = __webpack_require__(/*! ./_nodeUtil */ \"./node_modules/lodash/_nodeUtil.js\");\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNUeXBlZEFycmF5LmpzPzczYWMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsdUJBQXVCLG1CQUFPLENBQUMsdUVBQXFCO0FBQ3BELGdCQUFnQixtQkFBTyxDQUFDLHlEQUFjO0FBQ3RDLGVBQWUsbUJBQU8sQ0FBQyx1REFBYTs7QUFFcEM7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEiLCJm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3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/lodash/isTypedArray.js\n"); /***/ }), /***/ "./node_modules/lodash/isUndefined.js": /*!********************************************!*\ !*** ./node_modules/lodash/isUndefined.js ***! \********************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\nfunction isUndefined(value) {\n return value === undefined;\n}\n\nmodule.exports = isUndefined;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvaXNVbmRlZmluZWQuanM/NGNmZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsRUFBRTtBQUNiLGFBQWEsUUFBUTtBQUNyQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2xvZGFzaC9pc1VuZGVmaW5lZC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ2hlY2tzIGlmIGB2YWx1ZWAgaXMgYHVuZGVmaW5lZGAuXG4gKlxuICogQHN0YXRpY1xuICogQHNpbmNlIDAuMS4wXG4gKiBAbWVtYmVyT2YgX1xuICogQGNhdGVnb3J5IExhbmdcbiAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGNoZWNrLlxuICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIGB2YWx1ZWAgaXMgYHVuZGVmaW5lZGAsIGVsc2UgYGZhbHNlYC5cbiAqIEBleGFtcGxlXG4gKlxuICogXy5pc1VuZGVmaW5lZCh2b2lkIDApO1xuICogLy8gPT4gdHJ1ZVxuICpcbiAqIF8uaXNVbmRlZmluZWQobnVsbCk7XG4gKiAvLyA9PiBmYWxzZVxuICovXG5mdW5jdGlvbiBpc1VuZGVmaW5lZCh2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUgPT09IHVuZGVmaW5lZDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBpc1VuZGVmaW5lZDtcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/isUndefined.js\n"); /***/ }), /***/ "./node_modules/lodash/keys.js": /*!*************************************!*\ !*** ./node_modules/lodash/keys.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ \"./node_modules/lodash/_arrayLikeKeys.js\"),\n baseKeys = __webpack_require__(/*! ./_baseKeys */ \"./node_modules/lodash/_baseKeys.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\");\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmod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6Ly9lY21hLWludGVybmF0aW9uYWwub3JnL2VjbWEtMjYyLzcuMC8jc2VjLW9iamVjdC5rZXlzKVxuICogZm9yIG1vcmUgZGV0YWlscy5cbiAqXG4gKiBAc3RhdGljXG4gKiBAc2luY2UgMC4xLjBcbiAqIEBtZW1iZXJPZiBfXG4gKiBAY2F0ZWdvcnkgT2JqZWN0XG4gKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gcXVlcnkuXG4gKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIGFycmF5IG9mIHByb3BlcnR5IG5hbWVzLlxuICogQGV4YW1wbGVcbiAqXG4gKiBmdW5jdGlvbiBGb28oKSB7XG4gKiAgIHRoaXMuYSA9IDE7XG4gKiAgIHRoaXMuYiA9IDI7XG4gKiB9XG4gKlxuICogRm9vLnByb3RvdHlwZS5jID0gMztcbiAqXG4gKiBfLmtleXMobmV3IEZvbyk7XG4gKiAvLyA9PiBbJ2EnLCAnYiddIChpdGVyYXRpb24gb3JkZXIgaXMgbm90IGd1YXJhbnRlZWQpXG4gKlxuICogXy5rZXlzKCdoaScpO1xuICogLy8gPT4gWycwJywgJzEnXVxuICovXG5mdW5jdGlvbiBrZXlzKG9iamVjdCkge1xuICByZXR1cm4gaXNBcnJheUxpa2Uob2JqZWN0KSA/IGFycmF5TGlrZUtleXMob2JqZWN0KSA6IGJhc2VLZXlzKG9iamVjdCk7XG59XG5cbm1vZHVsZS5leHBvcnRzID0ga2V5cztcbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/lodash/keys.js\n"); /***/ }), /***/ "./node_modules/lodash/keysIn.js": /*!***************************************!*\ !*** ./node_modules/lodash/keysIn.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ \"./node_modules/lodash/_arrayLikeKeys.js\"),\n baseKeysIn = __webpack_require__(/*! ./_baseKeysIn */ \"./node_modules/lodash/_baseKeysIn.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\");\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gva2V5c0luLmpzPzk5MzQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0JBQW9CLG1CQUFPLENBQUMsaUVBQWtCO0FBQzlDLGlCQUFpQixtQkFBTyxDQUFDLDJEQUFlO0FBQ3hDLGtCQUFrQixtQkFBTyxDQUFDLDJEQUFlOztBQUV6QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEIsYUFBYSxNQUFNO0FBQ25CO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gva2V5c0luLmpzLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGFycmF5TGlrZUtleXM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==\n//# sourceURL=webpack-internal:///./node_modules/lodash/keysIn.js\n"); /***/ }), /***/ "./node_modules/lodash/last.js": /*!*************************************!*\ !*** ./node_modules/lodash/last.js ***! \*************************************/ /*! no static exports found */ /***/ (function(module, exports) { eval("/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9kYXNoX2N5dG9zY2FwZS8uL25vZGVfbW9kdWxlcy9sb2Rhc2gvbGFzdC5qcz80NDE2Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsV0FBVyxNQUFNO0FBQ2pCLGFBQWEsRUFBRTtBQUNmO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSIsImZpbGUiOiIuL25vZGVfbW9kdWxlcy9sb2Rhc2gvbGFzdC5qcy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2V0cyB0aGUgbGFzdCBlbGVtZW50IG9mIGBhcnJheWAuXG4gKlxuICogQHN0YXRpY1xuICogQG1lbWJlck9mIF9cbiAqIEBzaW5jZSAwLjEuMFxuICogQGNhdGVnb3J5IEFycmF5XG4gKiBAcGFyYW0ge0FycmF5fSBhcnJheSBUaGUgYXJyYXkgdG8gcXVlcnkuXG4gKiBAcmV0dXJucyB7Kn0gUmV0dXJucyB0aGUgbGFzdCBlbGVtZW50IG9mIGBhcnJheWAuXG4gKiBAZXhhbXBsZVxuICpcbiAqIF8ubGFzdChbMSwgMiwgM10pO1xuICogLy8gPT4gM1xuICovXG5mdW5jdGlvbiBsYXN0KGFycmF5KSB7XG4gIHZhciBsZW5ndGggPSBhcnJheSA9PSBudWxsID8gMCA6IGFycmF5Lmxlbmd0aDtcbiAgcmV0dXJuIGxlbmd0aCA/IGFycmF5W2xlbmd0aCAtIDFdIDogdW5kZWZpbmVkO1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGxhc3Q7XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/lodash/last.js\n"); /***/ }), /***/ "./node_modules/lodash/lodash.js": /*!***************************************!*\ !*** ./node_modules/lodash/lodash.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { eval("/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.19';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g,\n reTrimStart = /^\\s+/,\n reTrimEnd = /\\s+$/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = true && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '