text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ppc=e():t.ppc=e()}(window,function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var o=e[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(s,o,function(e){return t[e]}.bind(null,o));return s},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=0)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});let s=0,o=[];const n="_ppcCacheIndex";let r={pixelTestFunction:(t,e,i,s)=>t+e+i>0&&s>0};e.setOptions=function(t){!function(t,e){for(let i in t)e(t[i],i)}(t,(t,e)=>{r[e]=t})};function u(t,e){const i=e%32,s=Math.floor(e/32);return 0===i?c(t,s):c(t,s)<<i>>>0|c(t,s+1)>>>32-i}function c(t,e){return e<0||e>=t.length?0:t[e]}e.Collider=class{constructor(t){if(this.pos={x:0,y:0},this.anchor={x:0,y:0},this.size={x:0,y:0},this.pixelBits=[],this.isPositionSet=!1,this.size.x=t.width,this.size.y=t.height,n in t)return void(this.pixelBits=o[t[n]]);const e=document.createElement("canvas");e.width=this.size.x,e.height=this.size.y;const i=e.getContext("2d");i.drawImage(t,0,0);const u=i.getImageData(0,0,this.size.x,this.size.y).data;let c=0;for(let t=0;t<this.size.y;t++){let t=[],e=0,i=1<<31>>>0;for(let s=0;s<this.size.x;s++)r.pixelTestFunction(u[c],u[c+1],u[c+2],u[c+3])&&(e|=i),(i>>>=1)<=0&&(t.push(e),i=1<<31>>>0,e=0),c+=4;i<1<<31>>>0&&t.push(e),this.pixelBits.push(t)}o.push(this.pixelBits),t[n]=s,s++}setPos(t,e){this.pos.x=Math.floor(t-this.size.x*this.anchor.x),this.pos.y=Math.floor(e-this.size.y*this.anchor.y),this.isPositionSet=!0}setAnchor(t,e){this.anchor.x=t,this.anchor.y=e}test(t){if(!this.isPositionSet||!t.isPositionSet)return!1;const e={x:t.pos.x-this.pos.x,y:t.pos.y-this.pos.y};if(e.x<-t.size.x||e.x>this.size.x||e.y<-t.size.y||e.y>this.size.y)return!1;const i=e.x>0?e.x:0,s=e.x>0?0:-e.x;for(let o=e.y>0?e.y:0,n=e.y>0?0:-e.y;o<this.size.y&&!(n>=t.size.y);o++,n++)for(let e=i,r=s;e<this.size.x&&!(r>=t.size.x);e+=32,r+=32)if((u(this.pixelBits[o],e)&u(t.pixelBits[n],r))>0)return!0;return!1}},e.clearCache=function(){s=0,o=[]}}])});