text: (function(d,c,a,f){var e={colliders_context:a.body};function g(i,j,h){this.options=d.extend(e,h);this.$element=i;this.last_colliders=[];this.last_colliders_coords=[];if(typeof j==="string"||j instanceof jQuery){this.$colliders=d(j,this.options.colliders_context).not(this.$element)}else{this.colliders=d(j)}this.init()}var b=g.prototype;b.init=function(){this.find_collisions()};b.overlaps=function(j,i){var h=false;var k=false;if((i.x1>=j.x1&&i.x1<=j.x2)||(i.x2>=j.x1&&i.x2<=j.x2)||(j.x1>=i.x1&&j.x2<=i.x2)){h=true}if((i.y1>=j.y1&&i.y1<=j.y2)||(i.y2>=j.y1&&i.y2<=j.y2)||(j.y1>=i.y1&&j.y2<=i.y2)){k=true}return(h&&k)};b.detect_overlapping_region=function(i,h){var k="";var j="";if(i.y1>h.cy&&i.y1<h.y2){k="N"}if(i.y2>h.y1&&i.y2<h.cy){k="S"}if(i.x1>h.cx&&i.x1<h.x2){j="W"}if(i.x2>h.x1&&i.x2<h.cx){j="E"}return(k+j)||"C"};b.calculate_overlapped_area_coords=function(i,h){var k=Math.max(i.x1,h.x1);var m=Math.max(i.y1,h.y1);var j=Math.min(i.x2,h.x2);var l=Math.min(i.y2,h.y2);return d({left:k,top:m,width:(j-k),height:(l-m)}).coords().get()};b.calculate_overlapped_area=function(h){return(h.width*h.height)};b.manage_colliders_start_stop=function(p,n,q){var o=this.last_colliders_coords;for(var m=0,h=o.length;m<h;m++){if(d.inArray(o[m],p)===-1){n.call(this,o[m])}}for(var k=0,l=p.length;k<l;k++){if(d.inArray(p[k],o)===-1){q.call(this,p[k])}}};b.find_collisions=function(r){var t=this;var l=[];var m=[];var o=(this.colliders||this.$colliders);var p=o.length;var j=t.$element.coords().update(r||false).get();while(p--){var h=t.$colliders?d(o[p]):o[p];var v=(h.isCoords)?h:h.coords();var u=v.get();var k=t.overlaps(j,u);if(!k){continue}var q=t.detect_overlapping_region(j,u);if(q==="C"){var s=t.calculate_overlapped_area_coords(j,u);var i=t.calculate_overlapped_area(s);var n={area:i,area_coords:s,region:q,coords:u,player_coords:j,el:h};if(t.options.on_overlap){t.options.on_overlap.call(this,n)}l.push(v);m.push(n)}}if(t.options.on_overlap_stop||t.options.on_overlap_start){this.manage_colliders_start_stop(l,t.options.on_overlap_start,t.options.on_overlap_stop)}this.last_colliders_coords=l;return m};b.get_closest_colliders=function(h){var i=this.find_collisions(h);i.sort(function(k,j){if(k.region==="C"&&j.region==="C"){if(k.coords.y1<j.coords.y1||k.coords.x1<j.coords.x1){return -1}else{return 1}}if(k.area<j.area){return 1}return 1});return i};d.fn.collision=function(i,h){return new g(this,i,h)}}(jQuery,window,document));