{"version":3,"file":"chunk.803.235dc15d62f53b09d6e0.js","names":["r","options","console","warn","multigraph","uniqueLinkId","undefined","Map","Error","realOn","nodes","links","multiEdges","suspendEvents","createLink","fromId","toId","data","linkId","makeLinkId","isMultiEdge","hasOwnProperty","getLink","suffix","Link","prevLink","get","changes","recordLinkChange","noop","recordNodeChange","enterModification","exitModification","graphPart","version","addNode","addLink","fromNode","getNode","toNode","link","isUpdate","has","id","set","addLinkToNode","removeLink","otherId","removeLinkInstance","removeNode","getNodeCount","getLinkCount","getEdgeCount","getLinksCount","getNodesCount","getLinks","nodeId","node","forEachNode","forEachLinkedNode","callback","oriented","valuesIterator","values","nextValue","next","done","value","linkedNodeId","forEachLink","beginUpdate","endUpdate","clear","hasLink","hasNode","getLinkById","subject","reservedWords","i","length","eventsStorage","registeredEvents","Object","create","on","eventName","ctx","handlers","push","off","callbacks","splice","fire","fireArguments","arguments","Array","prototype","slice","call","callbackInfo","apply","enterModificationReal","exitModificationReal","recordLinkChangeReal","recordNodeChangeReal","changeType","Node","prevLinks","forEach","delete","size","fromNodeId","toNodeId","this","add","Set","toString","y","e","t","NodeHeap","isArray","compare","Q","setNodeId","K","n","_down","defaultCompare","a","b","NodeSearchState","parent","closed","open","distanceToSource","Number","POSITIVE_INFINITY","fScore","heapIndex","R","currentInCache","createNewState","o","cached","U","reset","l2","dx","x","d","Math","sqrt","l1","abs","item","_up","pop","peek","updateItem","pos","s","left","T","p","right","NO_PATH","freeze","J","defaultSettings","heuristic","distance","blocked","compareFScore","setHeapIndex","nodeSearchState","setH1","h1","setH2","h2","compareF1Score","f1","compareF2Score","f2","u","aStarPathSearch","pool","find","from","to","h","nodeState","H","startNode","g","m","l","de","ce","cameFrom","S","visitNeighbour","v","O","otherSearchState","E","c","_","goalReached","searchState","reconstructPath","path","$","q","fe","aStarBi","callVisitor","w","N","currentOpener","A","visitNode","openSetTo","endNode","V","P","current","reconstructBiDirectionalPath","F","pathOfNodes","I","unshift","opener","Y","k","newFScore","NBASearchState","p1","p2","g1","g2","nba","quitFast","se","minNode","forwardVisitor","f","open2Set","D","C","he","forwardSearch","lMin","reverseSearch","visitN1","visitN2","TinyQueue","constructor","top","bottom","halfLength","bestChild"],"sources":["webpack://__ember_auto_import__/node_modules/.pnpm/ngraph.graph@20.1.2/node_modules/ngraph.graph/index.js","webpack://__ember_auto_import__/node_modules/.pnpm/ngraph.events@1.4.0/node_modules/ngraph.events/index.js","webpack://__ember_auto_import__/a-star/NodeHeap.js","webpack://__ember_auto_import__/a-star/makeSearchStatePool.js","webpack://__ember_auto_import__/a-star/heuristics.js","webpack://__ember_auto_import__/a-star/defaultSettings.js","webpack://__ember_auto_import__/a-star/a-star.js","webpack://__ember_auto_import__/a-star/a-greedy-star.js","webpack://__ember_auto_import__/a-star/nba/makeNBASearchStatePool.js","webpack://__ember_auto_import__/a-star/nba/index.js","webpack://__ember_auto_import__/node_modules/.pnpm/tinyqueue@3.0.0/node_modules/tinyqueue/index.js"],"sourcesContent":["/**\n * @fileOverview Contains definition of the core graph object.\n */\n\n// TODO: need to change storage layer:\n// 1. Be able to get all nodes O(1)\n// 2. Be able to get number of links O(1)\n\n/**\n * @example\n *  var graph = require('ngraph.graph')();\n *  graph.addNode(1);     // graph has one node.\n *  graph.addLink(2, 3);  // now graph contains three nodes and one link.\n *\n */\nimport eventify from 'ngraph.events';\nexport default createGraph;\n\n/**\n * Creates a new graph\n */\nfunction createGraph(options) {\n  // Graph structure is maintained as Map of nodes and Map of links.\n  // Each node has 'links' (Set) which holds all incident links. This is\n  // efficient for lookups and iteration, while keeping the API simple.\n  options = options || {};\n  if ('uniqueLinkId' in options) {\n    console.warn(\n      'ngraph.graph: Starting from version 0.14 `uniqueLinkId` is deprecated.\\n' +\n      'Use `multigraph` option instead\\n',\n      '\\n',\n      'Note: there is also change in default behavior: From now on each graph\\n' +\n      'is considered to be not a multigraph by default (each edge is unique).'\n    );\n\n    options.multigraph = options.uniqueLinkId;\n  }\n\n  // Dear reader, the non-multigraphs do not guarantee that there is only\n  // one link for a given pair of node. When this option is set to false\n  // we can save some memory and CPU (18% faster for non-multigraph);\n  if (options.multigraph === undefined) options.multigraph = false;\n\n  if (typeof Map !== 'function') {\n    // TODO: Should we polyfill it ourselves? We don't use much operations there..\n    throw new Error('ngraph.graph requires `Map` to be defined. Please polyfill it before using ngraph');\n  }\n\n  var nodes = new Map(); // nodeId => Node\n  var links = new Map(); // linkId => Link\n  // Hash of multi-edges. Used to track ids of edges between same nodes\n  var multiEdges = {};\n  var suspendEvents = 0;\n\n  var createLink = options.multigraph ? createUniqueLink : createSingleLink,\n\n    // Our graph API provides means to listen to graph changes. Users can subscribe\n    // to be notified about changes in the graph by using `on` method. However\n    // in some cases they don't use it. To avoid unnecessary memory consumption\n    // we will not record graph changes until we have at least one subscriber.\n    // Code below supports this optimization.\n    //\n    // Accumulates all changes made during graph updates.\n    // Each change element contains:\n    //  changeType - one of the strings: 'add', 'remove' or 'update';\n    //  node - if change is related to node this property is set to changed graph's node;\n    //  link - if change is related to link this property is set to changed graph's link;\n    changes = [],\n    recordLinkChange = noop,\n    recordNodeChange = noop,\n    enterModification = noop,\n    exitModification = noop;\n\n  // this is our public API:\n  var graphPart = {\n    /**\n     * Sometimes duck typing could be slow. Giving clients a hint about data structure\n     * via explicit version number here:\n     */\n    version: 20.0,\n\n    /**\n     * Adds node to the graph. If node with given id already exists in the graph\n     * its data is extended with whatever comes in 'data' argument.\n     *\n     * @param nodeId the node's identifier. A string or number is preferred.\n     * @param [data] additional data for the node being added. If node already\n     *   exists its data object is augmented with the new one.\n     *\n     * @return {node} The newly added node or node with given id if it already exists.\n     */\n    addNode: addNode,\n\n    /**\n     * Adds a link to the graph. The function always create a new\n     * link between two nodes. If one of the nodes does not exists\n     * a new node is created.\n     *\n     * @param fromId link start node id;\n     * @param toId link end node id;\n     * @param [data] additional data to be set on the new link;\n     *\n     * @return {link} The newly created link\n     */\n    addLink: addLink,\n\n    /**\n     * Removes link from the graph. If link does not exist does nothing.\n     *\n     * @param link - object returned by addLink() or getLinks() methods.\n     *\n     * @returns true if link was removed; false otherwise.\n     */\n    removeLink: removeLink,\n\n    /**\n     * Removes node with given id from the graph. If node does not exist in the graph\n     * does nothing.\n     *\n     * @param nodeId node's identifier passed to addNode() function.\n     *\n     * @returns true if node was removed; false otherwise.\n     */\n    removeNode: removeNode,\n\n    /**\n     * Gets node with given identifier. If node does not exist undefined value is returned.\n     *\n     * @param nodeId requested node identifier;\n     *\n     * @return {node} in with requested identifier or undefined if no such node exists.\n     */\n    getNode: getNode,\n\n    /**\n     * Gets number of nodes in this graph.\n     *\n     * @return number of nodes in the graph.\n     */\n    getNodeCount: getNodeCount,\n\n    /**\n     * Gets total number of links in the graph.\n     */\n    getLinkCount: getLinkCount,\n\n    /**\n     * Synonym for `getLinkCount()`\n     */\n    getEdgeCount: getLinkCount,\n\n    /**\n     * Synonym for `getLinkCount()`\n     */\n    getLinksCount: getLinkCount,\n\n    /**\n     * Synonym for `getNodeCount()`\n     */\n    getNodesCount: getNodeCount,\n\n    /**\n     * Gets all links (inbound and outbound) from the node with given id.\n     * If node with given id is not found null is returned.\n     *\n     * @param nodeId requested node identifier.\n     *\n     * @return Set of links from and to requested node if such node exists;\n     *   otherwise null is returned.\n     */\n    getLinks: getLinks,\n\n    /**\n     * Invokes callback on each node of the graph.\n     *\n     * @param {Function(node)} callback Function to be invoked. The function\n     *   is passed one argument: visited node.\n     */\n    forEachNode: forEachNode,\n\n    /**\n     * Invokes callback on every linked (adjacent) node to the given one.\n     *\n     * @param nodeId Identifier of the requested node.\n     * @param {Function(node, link)} callback Function to be called on all linked nodes.\n     *   The function is passed two parameters: adjacent node and link object itself.\n     * @param oriented if true graph treated as oriented.\n     */\n    forEachLinkedNode: forEachLinkedNode,\n\n    /**\n     * Enumerates all links in the graph\n     *\n     * @param {Function(link)} callback Function to be called on all links in the graph.\n     *   The function is passed one parameter: graph's link object.\n     *\n     * Link object contains at least the following fields:\n     *  fromId - node id where link starts;\n     *  toId - node id where link ends,\n     *  data - additional data passed to graph.addLink() method.\n     */\n    forEachLink: forEachLink,\n\n    /**\n     * Suspend all notifications about graph changes until\n     * endUpdate is called.\n     */\n    beginUpdate: enterModification,\n\n    /**\n     * Resumes all notifications about graph changes and fires\n     * graph 'changed' event in case there are any pending changes.\n     */\n    endUpdate: exitModification,\n\n    /**\n     * Removes all nodes and links from the graph.\n     */\n    clear: clear,\n\n    /**\n     * Detects whether there is a link between two nodes.\n     * Operation complexity is O(n) where n - number of links of a node.\n     * NOTE: this function is synonym for getLink()\n     *\n     * @returns link if there is one. null otherwise.\n     */\n    hasLink: getLink,\n\n    /**\n     * Detects whether there is a node with given id\n     * \n     * Operation complexity is O(1)\n     * NOTE: this function is synonym for getNode()\n     *\n     * @returns node if there is one; Falsy value otherwise.\n     */\n    hasNode: getNode,\n\n    /**\n     * Gets an edge between two nodes.\n     * Operation complexity is O(n) where n - number of links of a node.\n     *\n     * @param {string} fromId link start identifier\n     * @param {string} toId link end identifier\n     *\n     * @returns link if there is one; undefined otherwise.\n     */\n    getLink: getLink,\n\n    /**\n     * Gets a link by its id.\n     *\n     * @param {string} linkId link identifier\n     *\n     * @returns link if there is one; undefined otherwise.\n     */\n    getLinkById: getLinkById\n  };\n\n  // this will add `on()` and `fire()` methods.\n  eventify(graphPart);\n\n  monitorSubscribers();\n\n  return graphPart;\n\n  function monitorSubscribers() {\n    var realOn = graphPart.on;\n\n    // replace real `on` with our temporary on, which will trigger change\n    // modification monitoring:\n    graphPart.on = on;\n\n    function on() {\n      // now it's time to start tracking stuff:\n      graphPart.beginUpdate = enterModification = enterModificationReal;\n      graphPart.endUpdate = exitModification = exitModificationReal;\n      recordLinkChange = recordLinkChangeReal;\n      recordNodeChange = recordNodeChangeReal;\n\n      // this will replace current `on` method with real pub/sub from `eventify`.\n      graphPart.on = realOn;\n      // delegate to real `on` handler:\n      return realOn.apply(graphPart, arguments);\n    }\n  }\n\n  function recordLinkChangeReal(link, changeType) {\n    changes.push({\n      link: link,\n      changeType: changeType\n    });\n  }\n\n  function recordNodeChangeReal(node, changeType) {\n    changes.push({\n      node: node,\n      changeType: changeType\n    });\n  }\n\n  function addNode(nodeId, data) {\n    if (nodeId === undefined) {\n      throw new Error('Invalid node identifier');\n    }\n\n    enterModification();\n\n    var node = getNode(nodeId);\n    if (!node) {\n      node = new Node(nodeId, data);\n      recordNodeChange(node, 'add');\n    } else {\n      node.data = data;\n      recordNodeChange(node, 'update');\n    }\n\n    nodes.set(nodeId, node);\n\n    exitModification();\n    return node;\n  }\n\n  function getNode(nodeId) {\n    return nodes.get(nodeId);\n  }\n\n  function removeNode(nodeId) {\n    var node = getNode(nodeId);\n    if (!node) {\n      return false;\n    }\n\n    enterModification();\n\n    var prevLinks = node.links;\n    if (prevLinks) {\n      prevLinks.forEach(removeLinkInstance);\n      node.links = null;\n    }\n\n    nodes.delete(nodeId);\n\n    recordNodeChange(node, 'remove');\n\n    exitModification();\n\n    return true;\n  }\n\n\n  function addLink(fromId, toId, data) {\n    enterModification();\n\n    var fromNode = getNode(fromId) || addNode(fromId);\n    var toNode = getNode(toId) || addNode(toId);\n\n    var link = createLink(fromId, toId, data);\n    var isUpdate = links.has(link.id);\n\n    links.set(link.id, link);\n\n    // TODO: this is not cool. On large graphs potentially would consume more memory.\n    addLinkToNode(fromNode, link);\n    if (fromId !== toId) {\n      // make sure we are not duplicating links for self-loops\n      addLinkToNode(toNode, link);\n    }\n\n    recordLinkChange(link, isUpdate ? 'update' : 'add');\n\n    exitModification();\n\n    return link;\n  }\n\n  function createSingleLink(fromId, toId, data) {\n    var linkId = makeLinkId(fromId, toId);\n    var prevLink = links.get(linkId);\n    if (prevLink) {\n      prevLink.data = data;\n      return prevLink;\n    }\n\n    return new Link(fromId, toId, data, linkId);\n  }\n\n  function createUniqueLink(fromId, toId, data) {\n    // TODO: Find a better/faster way to store multigraphs\n    var linkId = makeLinkId(fromId, toId);\n    var isMultiEdge = multiEdges.hasOwnProperty(linkId);\n    if (isMultiEdge || getLink(fromId, toId)) {\n      if (!isMultiEdge) {\n        multiEdges[linkId] = 0;\n      }\n      var suffix = '@' + (++multiEdges[linkId]);\n      linkId = makeLinkId(fromId + suffix, toId + suffix);\n    }\n\n    return new Link(fromId, toId, data, linkId);\n  }\n\n  function getNodeCount() {\n    return nodes.size;\n  }\n\n  function getLinkCount() {\n    return links.size;\n  }\n\n  function getLinks(nodeId) {\n    var node = getNode(nodeId);\n    return node ? node.links : null;\n  }\n\n  function removeLink(link, otherId) {\n    if (otherId !== undefined) {\n      link = getLink(link, otherId);\n    }\n    return removeLinkInstance(link);\n  }\n\n  function removeLinkInstance(link) {\n    if (!link) {\n      return false;\n    }\n    if (!links.get(link.id)) return false;\n\n    enterModification();\n\n    links.delete(link.id);\n\n    var fromNode = getNode(link.fromId);\n    var toNode = getNode(link.toId);\n\n    if (fromNode) {\n      fromNode.links.delete(link);\n    }\n\n    if (toNode) {\n      toNode.links.delete(link);\n    }\n\n    recordLinkChange(link, 'remove');\n\n    exitModification();\n\n    return true;\n  }\n\n  function getLink(fromNodeId, toNodeId) {\n    if (fromNodeId === undefined || toNodeId === undefined) return undefined;\n    return links.get(makeLinkId(fromNodeId, toNodeId));\n  }\n\n  function getLinkById(linkId) {\n    if (linkId === undefined) return undefined;\n    return links.get(linkId);\n  }\n\n  function clear() {\n    enterModification();\n    forEachNode(function (node) {\n      removeNode(node.id);\n    });\n    exitModification();\n  }\n\n  function forEachLink(callback) {\n    if (typeof callback === 'function') {\n      var valuesIterator = links.values();\n      var nextValue = valuesIterator.next();\n      while (!nextValue.done) {\n        if (callback(nextValue.value)) {\n          return true; // client doesn't want to proceed. Return.\n        }\n        nextValue = valuesIterator.next();\n      }\n    }\n  }\n\n  function forEachLinkedNode(nodeId, callback, oriented) {\n    var node = getNode(nodeId);\n\n    if (node && node.links && typeof callback === 'function') {\n      if (oriented) {\n        return forEachOrientedLink(node.links, nodeId, callback);\n      } else {\n        return forEachNonOrientedLink(node.links, nodeId, callback);\n      }\n    }\n  }\n\n  // eslint-disable-next-line no-shadow\n  function forEachNonOrientedLink(links, nodeId, callback) {\n    var quitFast;\n\n    var valuesIterator = links.values();\n    var nextValue = valuesIterator.next();\n    while (!nextValue.done) {\n      var link = nextValue.value;\n      var linkedNodeId = link.fromId === nodeId ? link.toId : link.fromId;\n      quitFast = callback(nodes.get(linkedNodeId), link);\n      if (quitFast) {\n        return true; // Client does not need more iterations. Break now.\n      }\n      nextValue = valuesIterator.next();\n    }\n  }\n\n  // eslint-disable-next-line no-shadow\n  function forEachOrientedLink(links, nodeId, callback) {\n    var quitFast;\n    var valuesIterator = links.values();\n    var nextValue = valuesIterator.next();\n    while (!nextValue.done) {\n      var link = nextValue.value;\n      if (link.fromId === nodeId) {\n        quitFast = callback(nodes.get(link.toId), link);\n        if (quitFast) {\n          return true; // Client does not need more iterations. Break now.\n        }\n      }\n      nextValue = valuesIterator.next();\n    }\n  }\n\n  // we will not fire anything until users of this library explicitly call `on()`\n  // method.\n  function noop() { }\n\n  // Enter, Exit modification allows bulk graph updates without firing events.\n  function enterModificationReal() {\n    suspendEvents += 1;\n  }\n\n  function exitModificationReal() {\n    suspendEvents -= 1;\n    if (suspendEvents === 0 && changes.length > 0) {\n      graphPart.fire('changed', changes);\n      changes.length = 0;\n    }\n  }\n\n  function forEachNode(callback) {\n    if (typeof callback !== 'function') {\n      throw new Error('Function is expected to iterate over graph nodes. You passed ' + callback);\n    }\n\n    var valuesIterator = nodes.values();\n    var nextValue = valuesIterator.next();\n    while (!nextValue.done) {\n      if (callback(nextValue.value)) {\n        return true; // client doesn't want to proceed. Return.\n      }\n      nextValue = valuesIterator.next();\n    }\n  }\n}\n\n/**\n * Internal structure to represent node;\n */\nfunction Node(id, data) {\n  this.id = id;\n  this.links = null;\n  this.data = data;\n}\n\nfunction addLinkToNode(node, link) {\n  if (node.links) {\n    node.links.add(link);\n  } else {\n    node.links = new Set([link]);\n  }\n}\n\n/**\n * Internal structure to represent links;\n */\nfunction Link(fromId, toId, data, id) {\n  this.fromId = fromId;\n  this.toId = toId;\n  this.data = data;\n  this.id = id;\n}\n\nfunction makeLinkId(fromId, toId) {\n  return fromId.toString() + '👉 ' + toId.toString();\n}\n","export default function eventify(subject) {\n  validateSubject(subject);\n\n  const eventsStorage = createEventsStorage(subject);\n  subject.on = eventsStorage.on;\n  subject.off = eventsStorage.off;\n  subject.fire = eventsStorage.fire;\n  return subject;\n}\n\nfunction createEventsStorage(subject) {\n  // Store all event listeners to this hash. Key is event name, value is array\n  // of callback records.\n  //\n  // A callback record consists of callback function and its optional context:\n  // { 'eventName' => [{callback: function, ctx: object}] }\n  let registeredEvents = Object.create(null);\n\n  return {\n    on: function (eventName, callback, ctx) {\n      if (typeof callback !== 'function') {\n        throw new Error('callback is expected to be a function');\n      }\n      let handlers = registeredEvents[eventName];\n      if (!handlers) {\n        handlers = registeredEvents[eventName] = [];\n      }\n      handlers.push({ callback: callback, ctx: ctx });\n\n      return subject;\n    },\n\n    off: function (eventName, callback) {\n      const wantToRemoveAll = (typeof eventName === 'undefined');\n      if (wantToRemoveAll) {\n        // Killing old events storage should be enough in this case:\n        registeredEvents = Object.create(null);\n        return subject;\n      }\n\n      if (registeredEvents[eventName]) {\n        const deleteAllCallbacksForEvent = (typeof callback !== 'function');\n        if (deleteAllCallbacksForEvent) {\n          delete registeredEvents[eventName];\n        } else {\n          const callbacks = registeredEvents[eventName];\n          for (let i = 0; i < callbacks.length; ++i) {\n            if (callbacks[i].callback === callback) {\n              callbacks.splice(i, 1);\n            }\n          }\n        }\n      }\n\n      return subject;\n    },\n\n    fire: function (eventName) {\n      const callbacks = registeredEvents[eventName];\n      if (!callbacks) {\n        return subject;\n      }\n\n      let fireArguments;\n      if (arguments.length > 1) {\n        // copy all args after eventName\n        fireArguments = Array.prototype.slice.call(arguments, 1);\n      }\n      for (let i = 0; i < callbacks.length; ++i) {\n        const callbackInfo = callbacks[i];\n        callbackInfo.callback.apply(callbackInfo.ctx, fireArguments);\n      }\n\n      return subject;\n    }\n  };\n}\n\nfunction validateSubject(subject) {\n  if (!subject) {\n    throw new Error('Eventify cannot use falsy object as events subject');\n  }\n  const reservedWords = ['on', 'fire', 'off'];\n  for (let i = 0; i < reservedWords.length; ++i) {\n    if (subject.hasOwnProperty(reservedWords[i])) {\n      throw new Error(\"Subject cannot be eventified, since it already has property '\" + reservedWords[i] + \"'\");\n    }\n  }\n}\n","/**\n * Based on https://github.com/mourner/tinyqueue\n * Copyright (c) 2017, Vladimir Agafonkin https://github.com/mourner/tinyqueue/blob/master/LICENSE\n * \n * Adapted for PathFinding needs by @anvaka\n * Copyright (c) 2017, Andrei Kashcha\n */\nexport default function NodeHeap(data, options) {\n  if (!new.target) return new NodeHeap(data, options);\n\n  if (!Array.isArray(data)) {\n    // assume first argument is our config object;\n    options = data;\n    data = [];\n  }\n\n  options = options || {};\n\n  this.data = data || [];\n  this.length = this.data.length;\n  this.compare = options.compare || defaultCompare;\n  this.setNodeId = options.setNodeId || noop;\n\n  if (this.length > 0) {\n    for (var i = (this.length >> 1); i >= 0; i--) this._down(i);\n  }\n\n  if (options.setNodeId) {\n    for (var i = 0; i < this.length; ++i) {\n      this.setNodeId(this.data[i], i);\n    }\n  }\n}\n\nfunction noop() {}\n\nfunction defaultCompare(a, b) {\n  return a - b;\n}\n\nNodeHeap.prototype = {\n\n  push: function (item) {\n    this.data.push(item);\n    this.setNodeId(item, this.length);\n    this.length++;\n    this._up(this.length - 1);\n  },\n\n  pop: function () {\n    if (this.length === 0) return undefined;\n\n    var top = this.data[0];\n    this.length--;\n\n    if (this.length > 0) {\n      this.data[0] = this.data[this.length];\n      this.setNodeId(this.data[0], 0);\n      this._down(0);\n    }\n    this.data.pop();\n\n    return top;\n  },\n\n  peek: function () {\n    return this.data[0];\n  },\n\n  updateItem: function (pos) {\n    this._down(pos);\n    this._up(pos);\n  },\n\n  _up: function (pos) {\n    var data = this.data;\n    var compare = this.compare;\n    var setNodeId = this.setNodeId;\n    var item = data[pos];\n\n    while (pos > 0) {\n      var parent = (pos - 1) >> 1;\n      var current = data[parent];\n      if (compare(item, current) >= 0) break;\n        data[pos] = current;\n\n       setNodeId(current, pos);\n       pos = parent;\n    }\n\n    data[pos] = item;\n    setNodeId(item, pos);\n  },\n\n  _down: function (pos) {\n    var data = this.data;\n    var compare = this.compare;\n    var halfLength = this.length >> 1;\n    var item = data[pos];\n    var setNodeId = this.setNodeId;\n\n    while (pos < halfLength) {\n      var left = (pos << 1) + 1;\n      var right = left + 1;\n      var best = data[left];\n\n      if (right < this.length && compare(data[right], best) < 0) {\n        left = right;\n        best = data[right];\n      }\n      if (compare(best, item) >= 0) break;\n\n      data[pos] = best;\n      setNodeId(best, pos);\n      pos = left;\n    }\n\n    data[pos] = item;\n    setNodeId(item, pos);\n  }\n};","/**\n * This class represents a single search node in the exploration tree for\n * A* algorithm.\n * \n * @param {Object} node  original node in the graph\n */\nfunction NodeSearchState(node) {\n  this.node = node;\n\n  // How we came to this node?\n  this.parent = null;\n\n  this.closed = false;\n  this.open = 0;\n\n  this.distanceToSource = Number.POSITIVE_INFINITY;\n  // the f(n) = g(n) + h(n) value\n  this.fScore = Number.POSITIVE_INFINITY;\n\n  // used to reconstruct heap when fScore is updated.\n  this.heapIndex = -1;\n};\n\nexport default function makeSearchStatePool() {\n  var currentInCache = 0;\n  var nodeCache = [];\n\n  return {\n    createNewState: createNewState,\n    reset: reset\n  };\n\n  function reset() {\n    currentInCache = 0;\n  }\n\n  function createNewState(node) {\n    var cached = nodeCache[currentInCache];\n    if (cached) {\n      // TODO: This almost duplicates constructor code. Not sure if\n      // it would impact performance if I move this code into a function\n      cached.node = node;\n      // How we came to this node?\n      cached.parent = null;\n\n      cached.closed = false;\n      cached.open = 0;\n\n      cached.distanceToSource = Number.POSITIVE_INFINITY;\n      // the f(n) = g(n) + h(n) value\n      cached.fScore = Number.POSITIVE_INFINITY;\n\n      // used to reconstruct heap when fScore is updated.\n      cached.heapIndex = -1;\n\n    } else {\n      cached = new NodeSearchState(node);\n      nodeCache[currentInCache] = cached;\n    }\n    currentInCache++;\n    return cached;\n  }\n}","export { l2, l1 };\n\n/**\n * Euclid distance (l2 norm);\n * \n * @param {*} a \n * @param {*} b \n */\nfunction l2(a, b) {\n  var dx = a.x - b.x;\n  var dy = a.y - b.y;\n  return Math.sqrt(dx * dx + dy * dy);\n}\n\n/**\n * Manhattan distance (l1 norm);\n * @param {*} a \n * @param {*} b \n */\nfunction l1(a, b) {\n  var dx = a.x - b.x;\n  var dy = a.y - b.y;\n  return Math.abs(dx) + Math.abs(dy);\n}\n","// We reuse instance of array, but we trie to freeze it as well,\n// so that consumers don't modify it. Maybe it's a bad idea.\nconst NO_PATH = [];\nif (typeof Object.freeze === 'function') Object.freeze(NO_PATH);\n\nconst defaultSettings = {\n  // Path search settings\n  heuristic: blindHeuristic,\n  distance: constantDistance,\n  blocked: neverBlocked,\n  compareFScore: compareFScore,\n  NO_PATH: NO_PATH,\n\n  // heap settings\n  setHeapIndex: setHeapIndex,\n\n  // nba:\n  setH1: setH1,\n  setH2: setH2,\n  compareF1Score: compareF1Score,\n  compareF2Score: compareF2Score,\n};\n\nexport default defaultSettings;\n\nfunction blindHeuristic(/* a, b */) {\n  // blind heuristic makes this search equal to plain Dijkstra path search.\n  return 0;\n}\n\nfunction constantDistance(/* a, b */) {\n  return 1;\n}\n\nfunction neverBlocked(/* a, b, c */) {\n  return false;\n}\n\nfunction compareFScore(a, b) {\n  var result = a.fScore - b.fScore;\n  // TODO: Can I improve speed with smarter ties-breaking?\n  // I tried distanceToSource, but it didn't seem to have much effect\n  return result;\n}\n\nfunction setHeapIndex(nodeSearchState, heapIndex) {\n  nodeSearchState.heapIndex = heapIndex;\n}\n\nfunction compareF1Score(a, b) {\n  return a.f1 - b.f1;\n}\n\nfunction compareF2Score(a, b) {\n  return a.f2 - b.f2;\n}\n\nfunction setH1(node, heapIndex) {\n  node.h1 = heapIndex;\n}\n\nfunction setH2(node, heapIndex) {\n  node.h2 = heapIndex;\n}","/**\n * Performs a uni-directional A Star search on graph.\n * \n * We will try to minimize f(n) = g(n) + h(n), where\n * g(n) is actual distance from source node to `n`, and\n * h(n) is heuristic distance from `n` to target node.\n */\nimport NodeHeap from './NodeHeap.js';\nimport makeSearchStatePool from './makeSearchStatePool.js';\nimport * as heuristics from './heuristics.js';\nimport defaultSettings from './defaultSettings.js';\n\nvar NO_PATH = defaultSettings.NO_PATH;\n\n/**\n * Creates a new instance of pathfinder. A pathfinder has just one method:\n * `find(fromId, toId)`, it may be extended in future.\n * \n * @param {ngraph.graph} graph instance. See https://github.com/anvaka/ngraph.graph\n * @param {Object} options that configures search\n * @param {Function(a, b, link)} options.blocked - a function that returns `true` if the link between \n * nodes `a` and `b` are blocked paths. This function is useful for temporarily blocking routes \n * while allowing the graph to be reused without rebuilding.\n * @param {Function(a, b)} options.heuristic - a function that returns estimated distance between\n * nodes `a` and `b`. This function should never overestimate actual distance between two\n * nodes (otherwise the found path will not be the shortest). Defaults function returns 0,\n * which makes this search equivalent to Dijkstra search.\n * @param {Function(a, b)} options.distance - a function that returns actual distance between two\n * nodes `a` and `b`. By default this is set to return graph-theoretical distance (always 1);\n * @param {Boolean} options.oriented - whether graph should be considered oriented or not.\n * \n * @returns {Object} A pathfinder with single method `find()`.\n */\nfunction aStarPathSearch(graph, options) {\n  options = options || {};\n  // whether traversal should be considered over oriented graph.\n  var oriented = options.oriented;\n\n  var blocked = options.blocked;\n  if (!blocked) blocked = defaultSettings.blocked;\n\n  var heuristic = options.heuristic;\n  if (!heuristic) heuristic = defaultSettings.heuristic;\n\n  var distance = options.distance;\n  if (!distance) distance = defaultSettings.distance;\n  var pool = makeSearchStatePool();\n\n  return {\n    /**\n     * Finds a path between node `fromId` and `toId`.\n     * @returns {Array} of nodes between `toId` and `fromId`. Empty array is returned\n     * if no path is found.\n     */\n    find: find\n  };\n\n  function find(fromId, toId) {\n    var from = graph.getNode(fromId);\n    if (!from) throw new Error('fromId is not defined in this graph: ' + fromId);\n    var to = graph.getNode(toId);\n    if (!to) throw new Error('toId is not defined in this graph: ' + toId);\n    pool.reset();\n\n    // Maps nodeId to NodeSearchState.\n    var nodeState = new Map();\n\n    // the nodes that we still need to evaluate\n    var openSet = new NodeHeap({\n      compare: defaultSettings.compareFScore,\n      setNodeId: defaultSettings.setHeapIndex\n    });\n\n    var startNode = pool.createNewState(from);\n    nodeState.set(fromId, startNode);\n\n    // For the first node, fScore is completely heuristic.\n    startNode.fScore = heuristic(from, to);\n\n    // The cost of going from start to start is zero.\n    startNode.distanceToSource = 0;\n    openSet.push(startNode);\n    startNode.open = 1;\n\n    var cameFrom;\n\n    while (openSet.length > 0) {\n      cameFrom = openSet.pop();\n      if (goalReached(cameFrom, to)) return reconstructPath(cameFrom);\n\n      // no need to visit this node anymore\n      cameFrom.closed = true;\n      graph.forEachLinkedNode(cameFrom.node.id, visitNeighbour, oriented);\n    }\n\n    // If we got here, then there is no path.\n    return NO_PATH;\n\n    function visitNeighbour(otherNode, link) {\n      var otherSearchState = nodeState.get(otherNode.id);\n      if (!otherSearchState) {\n        otherSearchState = pool.createNewState(otherNode);\n        nodeState.set(otherNode.id, otherSearchState);\n      }\n\n      if (otherSearchState.closed) {\n        // Already processed this node.\n        return;\n      }\n      if (otherSearchState.open === 0) {\n        // Remember this node.\n        openSet.push(otherSearchState);\n        otherSearchState.open = 1;\n      }\n\n      if (blocked(otherNode, cameFrom.node, link)) {\n        // Path is blocked. Ignore this route\n        return;\n      }\n\n      var tentativeDistance = cameFrom.distanceToSource + distance(otherNode, cameFrom.node, link);\n      if (tentativeDistance >= otherSearchState.distanceToSource) {\n        // This would only make our path longer. Ignore this route.\n        return;\n      }\n\n      // bingo! we found shorter path:\n      otherSearchState.parent = cameFrom;\n      otherSearchState.distanceToSource = tentativeDistance;\n      otherSearchState.fScore = tentativeDistance + heuristic(otherSearchState.node, to);\n\n      openSet.updateItem(otherSearchState.heapIndex);\n    }\n  }\n}\n\naStarPathSearch.l2 = heuristics.l2;\naStarPathSearch.l1 = heuristics.l1;\n\nexport default aStarPathSearch;\n\nfunction goalReached(searchState, targetNode) {\n  return searchState.node === targetNode;\n}\n\nfunction reconstructPath(searchState) {\n  var path = [searchState.node];\n  var parent = searchState.parent;\n\n  while (parent) {\n    path.push(parent.node);\n    parent = parent.parent;\n  }\n\n  return path;\n}\n","/**\n * Performs suboptimal, greed A Star path finding.\n * This finder does not necessary finds the shortest path. The path\n * that it finds is very close to the shortest one. It is very fast though.\n */\nimport NodeHeap from './NodeHeap.js';\nimport makeSearchStatePool from './makeSearchStatePool.js';\nimport * as heuristics from './heuristics.js';\nimport defaultSettings from './defaultSettings.js';\n\nvar BY_FROM = 1;\nvar BY_TO = 2;\nvar NO_PATH = defaultSettings.NO_PATH;\n\n/**\n * Creates a new instance of pathfinder. A pathfinder has just one method:\n * `find(fromId, toId)`, it may be extended in future.\n * \n * NOTE: Algorithm implemented in this code DOES NOT find optimal path.\n * Yet the path that it finds is always near optimal, and it finds it very fast.\n * \n * @param {ngraph.graph} graph instance. See https://github.com/anvaka/ngraph.graph\n * \n * @param {Object} options that configures search\n * @param {Function(a, b, link)} options.blocked - a function that returns `true` if the link between \n * nodes `a` and `b` are blocked paths. This function is useful for temporarily blocking routes \n * while allowing the graph to be reused without rebuilding.\n * @param {Function(a, b)} options.heuristic - a function that returns estimated distance between\n * nodes `a` and `b`.  Defaults function returns 0, which makes this search equivalent to Dijkstra search.\n * @param {Function(a, b)} options.distance - a function that returns actual distance between two\n * nodes `a` and `b`. By default this is set to return graph-theoretical distance (always 1);\n * @param {Boolean} options.oriented - whether graph should be considered oriented or not.\n * \n * @returns {Object} A pathfinder with single method `find()`.\n */\nfunction aStarBi(graph, options) {\n  options = options || {};\n  // whether traversal should be considered over oriented graph.\n  var oriented = options.oriented;\n\n  var blocked = options.blocked;\n  if (!blocked) blocked = defaultSettings.blocked;\n\n  var heuristic = options.heuristic;\n  if (!heuristic) heuristic = defaultSettings.heuristic;\n\n  var distance = options.distance;\n  if (!distance) distance = defaultSettings.distance;\n  var pool = makeSearchStatePool();\n\n  return {\n    find: find\n  };\n\n  function find(fromId, toId) {\n    // Not sure if we should return NO_PATH or throw. Throw seem to be more\n    // helpful to debug errors. So, throwing.\n    var from = graph.getNode(fromId);\n    if (!from) throw new Error('fromId is not defined in this graph: ' + fromId);\n    var to = graph.getNode(toId);\n    if (!to) throw new Error('toId is not defined in this graph: ' + toId);\n\n    if (from === to) return [from]; // trivial case.\n\n    pool.reset();\n\n    var callVisitor = oriented ? orientedVisitor : nonOrientedVisitor;\n\n    // Maps nodeId to NodeSearchState.\n    var nodeState = new Map();\n\n    var openSetFrom = new NodeHeap({\n      compare: defaultSettings.compareFScore,\n      setNodeId: defaultSettings.setHeapIndex\n    });\n\n    var openSetTo = new NodeHeap({\n      compare: defaultSettings.compareFScore,\n      setNodeId: defaultSettings.setHeapIndex\n    });\n\n\n    var startNode = pool.createNewState(from);\n    nodeState.set(fromId, startNode);\n\n    // For the first node, fScore is completely heuristic.\n    startNode.fScore = heuristic(from, to);\n    // The cost of going from start to start is zero.\n    startNode.distanceToSource = 0;\n    openSetFrom.push(startNode);\n    startNode.open = BY_FROM;\n\n    var endNode = pool.createNewState(to);\n    endNode.fScore = heuristic(to, from);\n    endNode.distanceToSource = 0;\n    openSetTo.push(endNode);\n    endNode.open = BY_TO;\n\n    // Cost of the best solution found so far. Used for accurate termination\n    var lMin = Number.POSITIVE_INFINITY;\n    var minFrom;\n    var minTo;\n\n    var currentSet = openSetFrom;\n    var currentOpener = BY_FROM;\n\n    while (openSetFrom.length > 0 && openSetTo.length > 0) {\n      if (openSetFrom.length < openSetTo.length) {\n        // we pick a set with less elements\n        currentOpener = BY_FROM;\n        currentSet = openSetFrom;\n      } else {\n        currentOpener = BY_TO;\n        currentSet = openSetTo;\n      }\n\n      var current = currentSet.pop();\n\n      // no need to visit this node anymore\n      current.closed = true;\n\n      if (current.distanceToSource > lMin) continue;\n\n      graph.forEachLinkedNode(current.node.id, callVisitor);\n\n      if (minFrom && minTo) {\n        // This is not necessary the best path, but we are so greedy that we\n        // can't resist:\n        return reconstructBiDirectionalPath(minFrom, minTo);\n      }\n    }\n\n    return NO_PATH; // No path.\n\n    function nonOrientedVisitor(otherNode, link) {\n      return visitNode(otherNode, link, current);\n    }\n\n    function orientedVisitor(otherNode, link) {\n      // For oritned graphs we need to reverse graph, when traveling\n      // backwards. So, we use non-oriented ngraph's traversal, and \n      // filter link orientation here.\n      if (currentOpener === BY_FROM) {\n        if (link.fromId === current.node.id) return visitNode(otherNode, link, current)\n      } else if (currentOpener === BY_TO) {\n        if (link.toId === current.node.id) return visitNode(otherNode, link, current);\n      }\n    }\n\n    function canExit(currentNode) {\n      var opener = currentNode.open\n      if (opener && opener !== currentOpener) {\n        return true;\n      }\n\n      return false;\n    }\n\n    function reconstructBiDirectionalPath(a, b) {\n      var pathOfNodes = [];\n      var aParent = a;\n      while(aParent) {\n        pathOfNodes.push(aParent.node);\n        aParent = aParent.parent;\n      }\n      var bParent = b;\n      while (bParent) {\n        pathOfNodes.unshift(bParent.node);\n        bParent = bParent.parent\n      }\n      return pathOfNodes;\n    }\n\n    function visitNode(otherNode, link, cameFrom) {\n      var otherSearchState = nodeState.get(otherNode.id);\n      if (!otherSearchState) {\n        otherSearchState = pool.createNewState(otherNode);\n        nodeState.set(otherNode.id, otherSearchState);\n      }\n\n      if (otherSearchState.closed) {\n        // Already processed this node.\n        return;\n      }\n\n      if (blocked(otherSearchState.node, cameFrom.node, link)) {\n        // Path is blocked. Ignore this route\n        return;\n      }\n\n      if (canExit(otherSearchState, cameFrom)) {\n        // this node was opened by alternative opener. The sets intersect now,\n        // we found an optimal path, that goes through *this* node. However, there\n        // is no guarantee that this is the global optimal solution path.\n\n        var potentialLMin = otherSearchState.distanceToSource + cameFrom.distanceToSource;\n        if (potentialLMin < lMin) {\n          minFrom = otherSearchState;\n          minTo = cameFrom\n          lMin = potentialLMin;\n        }\n        // we are done with this node.\n        return;\n      }\n\n      var tentativeDistance = cameFrom.distanceToSource + distance(otherSearchState.node, cameFrom.node, link);\n\n      if (tentativeDistance >= otherSearchState.distanceToSource) {\n        // This would only make our path longer. Ignore this route.\n        return;\n      }\n\n      // Choose target based on current working set:\n      var target = (currentOpener === BY_FROM) ? to : from;\n      var newFScore = tentativeDistance + heuristic(otherSearchState.node, target);\n      if (newFScore >= lMin) {\n        // this can't be optimal path, as we have already found a shorter path.\n        return;\n      }\n      otherSearchState.fScore = newFScore;\n\n      if (otherSearchState.open === 0) {\n        // Remember this node in the current set\n        currentSet.push(otherSearchState);\n        currentSet.updateItem(otherSearchState.heapIndex);\n\n        otherSearchState.open = currentOpener;\n      }\n\n      // bingo! we found shorter path:\n      otherSearchState.parent = cameFrom;\n      otherSearchState.distanceToSource = tentativeDistance;\n    }\n  }\n}\n\naStarBi.l2 = heuristics.l2;\naStarBi.l1 = heuristics.l1;\n\nexport default aStarBi;\n","/**\n * Creates new instance of NBASearchState. The instance stores information\n * about search state, and is used by NBA* algorithm.\n *\n * @param {Object} node - original graph node\n */\nfunction NBASearchState(node) {\n  /**\n   * Original graph node.\n   */\n  this.node = node;\n\n  /**\n   * Parent of this node in forward search\n   */\n  this.p1 = null;\n\n  /**\n   * Parent of this node in reverse search\n   */\n  this.p2 = null;\n\n  /**\n   * If this is set to true, then the node was already processed\n   * and we should not touch it anymore.\n   */\n  this.closed = false;\n\n  /**\n   * Actual distance from this node to its parent in forward search\n   */\n  this.g1 = Number.POSITIVE_INFINITY;\n\n  /**\n   * Actual distance from this node to its parent in reverse search\n   */\n  this.g2 = Number.POSITIVE_INFINITY;\n\n\n  /**\n   * Underestimated distance from this node to the path-finding source.\n   */\n  this.f1 = Number.POSITIVE_INFINITY;\n\n  /**\n   * Underestimated distance from this node to the path-finding target.\n   */\n  this.f2 = Number.POSITIVE_INFINITY;\n\n  // used to reconstruct heap when fScore is updated. TODO: do I need them both?\n\n  /**\n   * Index of this node in the forward heap.\n   */\n  this.h1 = -1;\n\n  /**\n   * Index of this node in the reverse heap.\n   */\n  this.h2 = -1;\n}\n\n/**\n * As path-finding is memory-intensive process, we want to reduce pressure on\n * garbage collector. This class helps us to recycle path-finding nodes and significantly\n * reduces the search time (~20% faster than without it).\n */\nexport default function makeNBASearchStatePool() {\n  var currentInCache = 0;\n  var nodeCache = [];\n\n  return {\n    /**\n     * Creates a new NBASearchState instance\n     */\n    createNewState: createNewState,\n\n    /**\n     * Marks all created instances available for recycling.\n     */\n    reset: reset\n  };\n\n  function reset() {\n    currentInCache = 0;\n  }\n\n  function createNewState(node) {\n    var cached = nodeCache[currentInCache];\n    if (cached) {\n      // TODO: This almost duplicates constructor code. Not sure if\n      // it would impact performance if I move this code into a function\n      cached.node = node;\n\n      // How we came to this node?\n      cached.p1 = null;\n      cached.p2 = null;\n\n      cached.closed = false;\n\n      cached.g1 = Number.POSITIVE_INFINITY;\n      cached.g2 = Number.POSITIVE_INFINITY;\n      cached.f1 = Number.POSITIVE_INFINITY;\n      cached.f2 = Number.POSITIVE_INFINITY;\n\n      // used to reconstruct heap when fScore is updated.\n      cached.h1 = -1;\n      cached.h2 = -1;\n    } else {\n      cached = new NBASearchState(node);\n      nodeCache[currentInCache] = cached;\n    }\n    currentInCache++;\n    return cached;\n  }\n}\n","import NodeHeap from '../NodeHeap.js';\nimport * as heuristics from '../heuristics.js';\nimport defaultSettings from '../defaultSettings.js';\nimport makeNBASearchStatePool from './makeNBASearchStatePool.js';\n\nvar NO_PATH = defaultSettings.NO_PATH;\n\n/**\n * Creates a new instance of pathfinder. A pathfinder has just one method:\n * `find(fromId, toId)`.\n * \n * This is implementation of the NBA* algorithm described in \n * \n *  \"Yet another bidirectional algorithm for shortest paths\" paper by Wim Pijls and Henk Post\n * \n * The paper is available here: https://repub.eur.nl/pub/16100/ei2009-10.pdf\n * \n * @param {ngraph.graph} graph instance. See https://github.com/anvaka/ngraph.graph\n * @param {Object} options that configures search\n * @param {Function(a, b, link)} options.blocked - a function that returns `true` if the link between \n * nodes `a` and `b` are blocked paths. This function is useful for temporarily blocking routes \n * while allowing the graph to be reused without rebuilding.\n * @param {Function(a, b)} options.heuristic - a function that returns estimated distance between\n * nodes `a` and `b`. This function should never overestimate actual distance between two\n * nodes (otherwise the found path will not be the shortest). Defaults function returns 0,\n * which makes this search equivalent to Dijkstra search.\n * @param {Function(a, b)} options.distance - a function that returns actual distance between two\n * nodes `a` and `b`. By default this is set to return graph-theoretical distance (always 1);\n * \n * @returns {Object} A pathfinder with single method `find()`.\n */\nfunction nba(graph, options) {\n  options = options || {};\n  // whether traversal should be considered over oriented graph.\n  var oriented = options.oriented;\n  var quitFast = options.quitFast;\n\n  var blocked = options.blocked;\n  if (!blocked) blocked = defaultSettings.blocked;\n\n  var heuristic = options.heuristic;\n  if (!heuristic) heuristic = defaultSettings.heuristic;\n\n  var distance = options.distance;\n  if (!distance) distance = defaultSettings.distance;\n\n  // During stress tests I noticed that garbage collection was one of the heaviest\n  // contributors to the algorithm's speed. So I'm using an object pool to recycle nodes.\n  var pool = makeNBASearchStatePool();\n\n  return {\n    /**\n     * Finds a path between node `fromId` and `toId`.\n     * @returns {Array} of nodes between `toId` and `fromId`. Empty array is returned\n     * if no path is found.\n     */\n    find: find\n  };\n\n  function find(fromId, toId) {\n    // I must apologize for the code duplication. This was the easiest way for me to\n    // implement the algorithm fast.\n    var from = graph.getNode(fromId);\n    if (!from) throw new Error('fromId is not defined in this graph: ' + fromId);\n    var to = graph.getNode(toId);\n    if (!to) throw new Error('toId is not defined in this graph: ' + toId);\n\n    pool.reset();\n\n    // I must also apologize for somewhat cryptic names. The NBA* is bi-directional\n    // search algorithm, which means it runs two searches in parallel. One is called\n    // forward search and it runs from source node to target, while the other one\n    // (backward search) runs from target to source.\n\n    // Everywhere where you see `1` it means it's for the forward search. `2` is for \n    // backward search.\n\n    // For oriented graph path finding, we need to reverse the graph, so that\n    // backward search visits correct link. Obviously we don't want to duplicate\n    // the graph, instead we always traverse the graph as non-oriented, and filter\n    // edges in `visitN1Oriented/visitN2Oritented`\n    var forwardVisitor = oriented ? visitN1Oriented : visitN1;\n    var reverseVisitor = oriented ? visitN2Oriented : visitN2;\n\n    // Maps nodeId to NBASearchState.\n    var nodeState = new Map();\n\n    // These two heaps store nodes by their underestimated values.\n    var open1Set = new NodeHeap({\n      compare: defaultSettings.compareF1Score,\n      setNodeId: defaultSettings.setH1\n    });\n    var open2Set = new NodeHeap({\n      compare: defaultSettings.compareF2Score,\n      setNodeId: defaultSettings.setH2\n    });\n\n    // This is where both searches will meet.\n    var minNode;\n\n    // The smallest path length seen so far is stored here:\n    var lMin = Number.POSITIVE_INFINITY;\n\n    // We start by putting start/end nodes to the corresponding heaps\n    // If variable names like `f1`, `g1` are too confusing, please refer\n    // to makeNBASearchStatePool.js file, which has detailed description.\n    var startNode = pool.createNewState(from);\n    nodeState.set(fromId, startNode); \n    startNode.g1 = 0;\n    var f1 = heuristic(from, to);\n    startNode.f1 = f1;\n    open1Set.push(startNode);\n\n    var endNode = pool.createNewState(to);\n    nodeState.set(toId, endNode);\n    endNode.g2 = 0;\n    var f2 = f1; // they should agree originally\n    endNode.f2 = f2;\n    open2Set.push(endNode)\n\n    // the `cameFrom` variable is accessed by both searches, so that we can store parents.\n    var cameFrom;\n\n    // this is the main algorithm loop:\n    while (open2Set.length && open1Set.length) {\n      if (open1Set.length < open2Set.length) {\n        forwardSearch();\n      } else {\n        reverseSearch();\n      }\n\n      if (quitFast && minNode) break;\n    }\n\n    var path = reconstructPath(minNode);\n    return path; // the public API is over\n\n    function forwardSearch() {\n      cameFrom = open1Set.pop();\n      if (cameFrom.closed) {\n        return;\n      }\n\n      cameFrom.closed = true;\n\n      if (cameFrom.f1 < lMin && (cameFrom.g1 + f2 - heuristic(from, cameFrom.node)) < lMin) {\n        graph.forEachLinkedNode(cameFrom.node.id, forwardVisitor);\n      }\n\n      if (open1Set.length > 0) {\n        // this will be used in reverse search\n        f1 = open1Set.peek().f1;\n      } \n    }\n\n    function reverseSearch() {\n      cameFrom = open2Set.pop();\n      if (cameFrom.closed) {\n        return;\n      }\n      cameFrom.closed = true;\n\n      if (cameFrom.f2 < lMin && (cameFrom.g2 + f1 - heuristic(cameFrom.node, to)) < lMin) {\n        graph.forEachLinkedNode(cameFrom.node.id, reverseVisitor);\n      }\n\n      if (open2Set.length > 0) {\n        // this will be used in forward search\n        f2 = open2Set.peek().f2;\n      }\n    }\n\n    function visitN1(otherNode, link) {\n      var otherSearchState = nodeState.get(otherNode.id);\n      if (!otherSearchState) {\n        otherSearchState = pool.createNewState(otherNode);\n        nodeState.set(otherNode.id, otherSearchState);\n      }\n\n      if (otherSearchState.closed) return;\n\n      if (blocked(cameFrom.node, otherNode, link)) return;\n\n      var tentativeDistance = cameFrom.g1 + distance(cameFrom.node, otherNode, link);\n\n      if (tentativeDistance < otherSearchState.g1) {\n        otherSearchState.g1 = tentativeDistance;\n        otherSearchState.f1 = tentativeDistance + heuristic(otherSearchState.node, to);\n        otherSearchState.p1 = cameFrom;\n        if (otherSearchState.h1 < 0) {\n          open1Set.push(otherSearchState);\n        } else {\n          open1Set.updateItem(otherSearchState.h1);\n        }\n      }\n      var potentialMin = otherSearchState.g1 + otherSearchState.g2;\n      if (potentialMin < lMin) { \n        lMin = potentialMin;\n        minNode = otherSearchState;\n      }\n    }\n\n    function visitN2(otherNode, link) {\n      var otherSearchState = nodeState.get(otherNode.id);\n      if (!otherSearchState) {\n        otherSearchState = pool.createNewState(otherNode);\n        nodeState.set(otherNode.id, otherSearchState);\n      }\n\n      if (otherSearchState.closed) return;\n\n      if (blocked(cameFrom.node, otherNode, link)) return;\n\n      var tentativeDistance = cameFrom.g2 + distance(cameFrom.node, otherNode, link);\n\n      if (tentativeDistance < otherSearchState.g2) {\n        otherSearchState.g2 = tentativeDistance;\n        otherSearchState.f2 = tentativeDistance + heuristic(from, otherSearchState.node);\n        otherSearchState.p2 = cameFrom;\n        if (otherSearchState.h2 < 0) {\n          open2Set.push(otherSearchState);\n        } else {\n          open2Set.updateItem(otherSearchState.h2);\n        }\n      }\n      var potentialMin = otherSearchState.g1 + otherSearchState.g2;\n      if (potentialMin < lMin) {\n        lMin = potentialMin;\n        minNode = otherSearchState;\n      }\n    }\n\n    function visitN2Oriented(otherNode, link) {\n      // we are going backwards, graph needs to be reversed. \n      if (link.toId === cameFrom.node.id) return visitN2(otherNode, link);\n    }\n    function visitN1Oriented(otherNode, link) {\n      // this is forward direction, so we should be coming FROM:\n      if (link.fromId === cameFrom.node.id) return visitN1(otherNode, link);\n    }\n  }\n}\n\nnba.l2 = heuristics.l2;\nnba.l1 = heuristics.l1;\n\nexport default nba;\n\nfunction reconstructPath(searchState) {\n  if (!searchState) return NO_PATH;\n\n  var path = [searchState.node];\n  var parent = searchState.p1;\n\n  while (parent) {\n    path.push(parent.node);\n    parent = parent.p1;\n  }\n\n  var child = searchState.p2;\n\n  while (child) {\n    path.unshift(child.node);\n    child = child.p2;\n  }\n  return path;\n}\n","\nexport default class TinyQueue {\n    constructor(data = [], compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0)) {\n        this.data = data;\n        this.length = this.data.length;\n        this.compare = compare;\n\n        if (this.length > 0) {\n            for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n        }\n    }\n\n    push(item) {\n        this.data.push(item);\n        this._up(this.length++);\n    }\n\n    pop() {\n        if (this.length === 0) return undefined;\n\n        const top = this.data[0];\n        const bottom = this.data.pop();\n\n        if (--this.length > 0) {\n            this.data[0] = bottom;\n            this._down(0);\n        }\n\n        return top;\n    }\n\n    peek() {\n        return this.data[0];\n    }\n\n    _up(pos) {\n        const {data, compare} = this;\n        const item = data[pos];\n\n        while (pos > 0) {\n            const parent = (pos - 1) >> 1;\n            const current = data[parent];\n            if (compare(item, current) >= 0) break;\n            data[pos] = current;\n            pos = parent;\n        }\n\n        data[pos] = item;\n    }\n\n    _down(pos) {\n        const {data, compare} = this;\n        const halfLength = this.length >> 1;\n        const item = data[pos];\n\n        while (pos < halfLength) {\n            let bestChild = (pos << 1) + 1; // initially it is the left child\n            const right = bestChild + 1;\n\n            if (right < this.length && compare(data[right], data[bestChild]) < 0) {\n                bestChild = right;\n            }\n            if (compare(data[bestChild], item) >= 0) break;\n\n            data[pos] = data[bestChild];\n            pos = bestChild;\n        }\n\n        data[pos] = item;\n    }\n}\n"],"mappings":";AAgBA,MAAAA,EAKA,SAAqBC,GAsBnB,GAjBI,iBADJA,EAAUA,GAAW,CAAC,KAEpBC,QAAQC,KACN,4GAEA,KACA,kJAIFF,EAAQG,WAAaH,EAAQI,mBAMJC,IAAvBL,EAAQG,aAA0BH,EAAQG,eAE3B,mBAARG,IAET,MAAM,IAAIC,MAAM;AAGlB,IA4NMC,EA5NFC,EAAQ,IAAIH,IACZI,EAAQ,IAAIJ,IAEZK,EAAa,CAAC,EACdC,EAAgB,EAEhBC,EAAab,EAAQG,WA8UzB,SAA0BW,EAAQC,EAAMC,GAEtC,IAAIC,EAASC,EAAWJ,EAAQC,GAC5BI,EAAcR,EAAWS,eAAeH;AAC5C,GAAIE,GAAeE,EAAQP,EAAQC,GAAO,CACnCI,IACHR,EAAWM,GAAU;AAEvB,IAAIK,EAAS,OAASX,EAAWM;AACjCA,EAASC,EAAWJ,EAASQ,EAAQP,EAAOO,EAC9C,CAEA,OAAO,IAAIC,EAAKT,EAAQC,EAAMC,EAAMC,EACtC,EAxBA,SAA0BH,EAAQC,EAAMC,GACtC,IAAIC,EAASC,EAAWJ,EAAQC,GAC5BS,EAAWd,EAAMe,IAAIR;AACzB,OAAIO,GACFA,EAASR,KAAOA,EACTQ,GAGF,IAAID,EAAKT,EAAQC,EAAMC,EAAMC,EACtC,EA/TES,EAAU,GACVC,EAAmBC,EACnBC,EAAmBD,EACnBE,EAAoBF,EACpBG,EAAmBH,EAGjBI,EAAY,CAKdC,QAAS,GAYTC,QAASA,EAaTC,QAwPF,SAAiBrB,EAAQC,EAAMC,GAC7Bc;AAEA,IAAIM,EAAWC,EAAQvB,IAAWoB,EAAQpB,GACtCwB,EAASD,EAAQtB,IAASmB,EAAQnB,GAElCwB,EAAO1B,EAAWC,EAAQC,EAAMC,GAChCwB,EA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