!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,i.rbush=t()}}(function(){return function t(i,n,e){function r(h,o){if(!n[h]){if(!i[h]){var s="function"==typeof require&&require;if(!o&&s)return s(h,!0);if(a)return a(h,!0);var l=new Error("Cannot find module '"+h+"'");throw l.code="MODULE_NOT_FOUND",l}var f=n[h]={exports:{}};i[h][0].call(f.exports,function(t){var n=i[h][1][t];return r(n?n:t)},f,f.exports,t,i,n,e)}return n[h].exports}for(var a="function"==typeof require&&require,h=0;h=t.minX&&i.maxY>=t.minY}function p(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}}function M(t,i,n,e,r){for(var a,h=[i,n];h.length;)n=h.pop(),i=h.pop(),n-i<=e||(a=i+Math.ceil((n-i)/e/2)*e,g(t,a,i,n,r),h.push(i,a,a,n))}i.exports=e;var g=t("quickselect");e.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,n=[],e=this.toBBox;if(!x(t,i))return n;for(var r,a,h,o,s=[];i;){for(r=0,a=i.children.length;r=0&&a[i].children.length>this._maxEntries;)this._split(a,i),i--;this._adjustParentBBoxes(r,a,i)},_split:function(t,i){var n=t[i],e=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,e);var h=this._chooseSplitIndex(n,r,e),o=p(n.children.splice(h,n.children.length-h));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),i?t[i-1].children.push(o):this._splitRoot(n,o)},_splitRoot:function(t,i){this.data=p([t,i]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,n){var e,r,a,o,s,l,u,c;for(l=u=1/0,e=i;e<=n-i;e++)r=h(t,0,e,this.toBBox),a=h(t,e,n,this.toBBox),o=m(r,a),s=f(r)+f(a),o=i;r--)a=t.children[r],o(f,t.leaf?s(a):a),c+=u(f);return c},_adjustParentBBoxes:function(t,i,n){for(var e=n;e>=0;e--)o(i[e],t)},_condense:function(t){for(var i,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():a(t[n],this.toBBox)},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0])),this.compareMinY=new Function("a","b",i.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},{quickselect:2}],2:[function(t,i,n){"use strict";function e(t,i,n,a,h){for(;a>n;){if(a-n>600){var o=a-n+1,s=i-n+1,l=Math.log(o),f=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*f*(o-f)/o)*(s-o/2<0?-1:1),c=Math.max(n,Math.floor(i-s*f/o+u)),m=Math.min(a,Math.floor(i+(o-s)*f/o+u));e(t,i,c,m,h)}var d=t[i],x=n,p=a;for(r(t,n,i),h(t[a],d)>0&&r(t,n,a);x0;)p--}0===h(t[n],d)?r(t,n,p):(p++,r(t,p,a)),p<=i&&(n=p+1),i<=p&&(a=p-1)}}function r(t,i,n){var e=t[i];t[i]=t[n],t[n]=e}i.exports=e},{}]},{},[1])(1)});