+// min bounding rectangle of node children from k to p-1
+function distBBox(node, k, p, toBBox) {
+ var bbox = empty();
+
+ for (var i = k, child; i < p; i++) {
+ child = node.children[i];
+ extend(bbox, node.leaf ? toBBox(child) : child.bbox);
+ }
+
+ return bbox;
+}
+
+
+function empty() { return [Infinity, Infinity, -Infinity, -Infinity]; }
+
+function extend(a, b) {
+ a[0] = Math.min(a[0], b[0]);
+ a[1] = Math.min(a[1], b[1]);
+ a[2] = Math.max(a[2], b[2]);
+ a[3] = Math.max(a[3], b[3]);
+ return a;
+}
+
+function compareNodeMinX(a, b) { return a.bbox[0] - b.bbox[0]; }
+function compareNodeMinY(a, b) { return a.bbox[1] - b.bbox[1]; }
+
+function bboxArea(a) { return (a[2] - a[0]) * (a[3] - a[1]); }
+function bboxMargin(a) { return (a[2] - a[0]) + (a[3] - a[1]); }
+
+function enlargedArea(a, b) {
+ return (Math.max(b[2], a[2]) - Math.min(b[0], a[0])) *
+ (Math.max(b[3], a[3]) - Math.min(b[1], a[1]));
+}
+
+function intersectionArea (a, b) {
+ var minX = Math.max(a[0], b[0]),
+ minY = Math.max(a[1], b[1]),
+ maxX = Math.min(a[2], b[2]),
+ maxY = Math.min(a[3], b[3]);
+
+ return Math.max(0, maxX - minX) *
+ Math.max(0, maxY - minY);
+}
+
+function contains(a, b) {
+ return a[0] <= b[0] &&
+ a[1] <= b[1] &&
+ b[2] <= a[2] &&
+ b[3] <= a[3];
+}
+
+function intersects (a, b) {
+ return b[0] <= a[2] &&
+ b[1] <= a[3] &&
+ b[2] >= a[0] &&
+ b[3] >= a[1];
+}
+
+
+function partitionSort(arr, left, right, k, compare) {
+ var pivot;
+
+ while (true) {
+ pivot = Math.floor((left + right) / 2);
+ pivot = partition(arr, left, right, pivot, compare);
+
+ if (k === pivot) break;
+ else if (k < pivot) right = pivot - 1;
+ else left = pivot + 1;
+ }
+
+ partition(arr, left, right, k, compare);
+}
+
+function partition(arr, left, right, pivot, compare) {
+ var k = left,
+ value = arr[pivot];
+
+ swap(arr, pivot, right);
+
+ for (var i = left; i < right; i++) {
+ if (compare(arr[i], value) < 0) {
+ swap(arr, k, i);
+ k++;
+ }
+ }
+ swap(arr, right, k);
+
+ return k;
+}
+
+function swap(arr, i, j) {
+ var tmp = arr[i];
+ arr[i] = arr[j];
+ arr[j] = tmp;
+}
+
+
+// export as AMD/CommonJS module or global variable
+if (typeof define === 'function' && define.amd) define(function() { return rbush; });
+else if (typeof module !== 'undefined') module.exports = rbush;
+else if (typeof self !== 'undefined') self.rbush = rbush;
+else window.rbush = rbush;
+
+})();(function(e){if("function"==typeof bootstrap)bootstrap("sexagesimal",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeSexagesimal=e}else"undefined"!=typeof window?window.sexagesimal=e():global.sexagesimal=e()})(function(){var define,ses,bootstrap,module,exports;