text: !function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=9)}({10:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();var s=function(){function t(e,i,n,s){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=e,this.y=i,this.width=n,this.height=s}return n(t,[{key:"resize",value:function(t,e){this.width=t,this.height=e}},{key:"constains",value:function(t){return t.x>this.x&&t.x<this.x+this.width&&t.y>this.y&&t.y<this.y+this.height}},{key:"intersects",value:function(t){return!(t.x-t.width>this.x+this.width||t.x+t.width<this.x-this.width||t.y-t.height>this.y+this.height||t.y+t.height<this.y-this.height)}}]),t}();e.default=s},11:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.x=e||0,this.y=i||0,this.userData=n}},9:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Point=e.Rectangle=void 0;var n=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),s=h(i(10)),r=h(i(11));function h(t){return t&&t.__esModule?t:{default:t}}var o=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.boundary=e,this.n=i,this.points=[],this.divided=!1}return n(t,[{key:"insert",value:function(t){this.boundary.constains(t)&&(this.points.length<this.n?this.points.push(t):(this.divided||this.subdivide(),this.nw.insert(t),this.ne.insert(t),this.sw.insert(t),this.se.insert(t)))}},{key:"subdivide",value:function(){var e=this.boundary,i=e.x,n=e.y,r=e.width,h=e.height,o=new s.default(i,n,r/2,h/2),u=new s.default(i+r/2,n,r/2,h/2),a=new s.default(i,n+h/2,r/2,h/2),l=new s.default(i+r/2,n+h/2,r/2,h/2);this.nw=new t(o,this.n),this.ne=new t(u,this.n),this.sw=new t(a,this.n),this.se=new t(l,this.n),this.divided=!0}},{key:"query",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(this.boundary.intersects(t)){var i=!0,n=!1,s=void 0;try{for(var r,h=this.points[Symbol.iterator]();!(i=(r=h.next()).done);i=!0){var o=r.value;t.constains(o)&&e.push(o)}}catch(t){n=!0,s=t}finally{try{!i&&h.return&&h.return()}finally{if(n)throw s}}this.divided&&(this.nw.query(t,e),this.ne.query(t,e),this.sw.query(t,e),this.se.query(t,e))}return e}},{key:"debug",value:function(t){var e=this.boundary,i=e.x,n=e.y,s=e.width,r=e.height;t.beginPath(),t.strokeStyle="#666",t.lineWidth=1,t.rect(i,n,s,r),t.stroke(),t.closePath();for(var h=0;h<this.points.length;h++)t.beginPath(),t.fillStyle="#f00",t.arc(this.points[h].x,this.points[h].y,2,0,2*Math.PI),t.fill(),t.closePath();this.divided&&(this.nw.debug(t),this.ne.debug(t),this.sw.debug(t),this.se.debug(t))}},{key:"borders",value:function(t){var e=this.boundary,i=e.x,n=e.y,s=e.width,r=e.height;t.beginPath(),t.strokeStyle="#222",t.lineWidth=1,t.rect(i,n,s,r),t.stroke(),t.closePath(),this.divided&&(this.nw.borders(t),this.ne.borders(t),this.sw.borders(t),this.se.borders(t))}}]),t}();e.default=o,e.Rectangle=s.default,e.Point=r.default}});