"use strict";var p={exports:{}},y;function q(){return y||(y=1,(function(k){var u={single_source_shortest_paths:function(s,t,e){var r={},i={};i[t]=0;var n=u.PriorityQueue.make();n.push(t,0);for(var f,c,o,h,_,v,a,d,l;!n.empty();){f=n.pop(),c=f.value,h=f.cost,_=s[c]||{};for(o in _)_.hasOwnProperty(o)&&(v=_[o],a=h+v,d=i[o],l=typeof i[o]>"u",(l||d>a)&&(i[o]=a,n.push(o,a),r[o]=c))}if(typeof e<"u"&&typeof i[e]>"u"){var m=["Could not find a path from ",t," to ",e,"."].join("");throw new Error(m)}return r},extract_shortest_path_from_predecessor_list:function(s,t){for(var e=[],r=t;r;)e.push(r),s[r],r=s[r];return e.reverse(),e},find_path:function(s,t,e){var r=u.single_source_shortest_paths(s,t,e);return u.extract_shortest_path_from_predecessor_list(r,e)},PriorityQueue:{make:function(s){var t=u.PriorityQueue,e={},r;s=s||{};for(r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e.queue=[],e.sorter=s.sorter||t.default_sorter,e},default_sorter:function(s,t){return s.cost-t.cost},push:function(s,t){var e={value:s,cost:t};this.queue.push(e),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};k.exports=u})(p)),p.exports}exports.requireDijkstra=q;
