parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c0?1:-1}),Number.isInteger||(Number.isInteger=function(n){return"number"==typeof n&&isFinite(n)&&Math.floor(n)===n}),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array),window.Uint8Array||(window.Uint8Array=Array),window.Int32Array||(window.Int32Array=Array); },{"es6-promise-polyfill":"aj4z","object-assign":"J4Nk"}],"nSZq":[function(require,module,exports) { var define; var e;!function(i){var o=/iPhone/i,d=/iPod/i,n=/iPad/i,t=/\bAndroid(?:.+)Mobile\b/i,r=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,p=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,b=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,s=/BlackBerry/i,u=/BB10/i,f=/Opera Mini/i,c=/\b(CriOS|Chrome)(?:.+)Mobile/i,v=/Mobile(?:.+)Firefox\b/i;function h(e,i){return e.test(i)}function w(e){var i=e||("undefined"!=typeof navigator?navigator.userAgent:""),w=i.split("[FBAN");void 0!==w[1]&&(i=w[0]),void 0!==(w=i.split("Twitter"))[1]&&(i=w[0]);var m={apple:{phone:h(o,i)&&!h(b,i),ipod:h(d,i),tablet:!h(o,i)&&h(n,i)&&!h(b,i),device:(h(o,i)||h(d,i)||h(n,i))&&!h(b,i)},amazon:{phone:h(a,i),tablet:!h(a,i)&&h(p,i),device:h(a,i)||h(p,i)},android:{phone:!h(b,i)&&h(a,i)||!h(b,i)&&h(t,i),tablet:!h(b,i)&&!h(a,i)&&!h(t,i)&&(h(p,i)||h(r,i)),device:!h(b,i)&&(h(a,i)||h(p,i)||h(t,i)||h(r,i))||h(/\bokhttp\b/i,i)},windows:{phone:h(b,i),tablet:h(l,i),device:h(b,i)||h(l,i)},other:{blackberry:h(s,i),blackberry10:h(u,i),opera:h(f,i),firefox:h(v,i),chrome:h(c,i),device:h(s,i)||h(u,i)||h(f,i)||h(v,i)||h(c,i)}};return m.any=m.apple.device||m.android.device||m.windows.device||m.other.device,m.phone=m.apple.phone||m.android.phone||m.windows.phone,m.tablet=m.apple.tablet||m.android.tablet||m.windows.tablet,m}"undefined"!=typeof module&&module.exports&&"undefined"==typeof window?module.exports=w:"undefined"!=typeof module&&module.exports&&"undefined"!=typeof window?(module.exports=w(),module.exports.isMobile=w):"function"==typeof e&&e.amd?e([],i.isMobile=w()):i.isMobile=w()}(this); },{}],"t4Uo":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"isMobile",{enumerable:!0,get:function(){return e.default}}),exports.settings=void 0;var e=t(require("ismobilejs"));function t(e){return e&&e.__esModule?e:{default:e}}function r(t){var r=!0;if(e.default.tablet||e.default.phone){if(r=!1,e.default.apple.device){var a=navigator.userAgent.match(/OS (\d+)_(\d+)?/);if(a)parseInt(a[1],10)>=11&&(r=!0)}if(e.default.android.device){var i=navigator.userAgent.match(/Android\s([0-9.]*)/);if(i)parseInt(i[1],10)>=7&&(r=!0)}}return r?t:4}function a(){return!e.default.apple.device}var i={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:r(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:e.default.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:a(),CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};exports.settings=i; },{"ismobilejs":"nSZq"}],"JJlS":[function(require,module,exports) { "use strict";var e=Object.prototype.hasOwnProperty,t="~";function n(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,n,o,s,i){if("function"!=typeof o)throw new TypeError("The listener must be a function");var c=new r(o,s||e,i),f=t?t+n:n;return e._events[f]?e._events[f].fn?e._events[f]=[e._events[f],c]:e._events[f].push(c):(e._events[f]=c,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function i(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(t=!1)),i.prototype.eventNames=function(){var n,r,o=[];if(0===this._eventsCount)return o;for(r in n=this._events)e.call(n,r)&&o.push(t?r.slice(1):r);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(n)):o},i.prototype.listeners=function(e){var n=t?t+e:e,r=this._events[n];if(!r)return[];if(r.fn)return[r.fn];for(var o=0,s=r.length,i=new Array(s);o80*x){i=v=e[0],u=y=e[1];for(var Z=x;Zv&&(v=o),p>y&&(y=p);a=0!==(a=Math.max(v-i,y-u))?1/a:0}return r(s,c,x,i,u,a),c}function n(e,n,t,r,x){var i,u;if(x===D(e,n,t,r)>0)for(i=n;i=n;i-=r)u=A(i,e[i],e[i+1],u);return u&&w(u,u.next)&&(B(u),u=u.next),u}function t(e,n){if(!e)return e;n||(n=e);var t,r=e;do{if(t=!1,r.steiner||!w(r,r.next)&&0!==g(r.prev,r,r.next))r=r.next;else{if(B(r),(r=n=r.prev)===r.next)break;t=!0}}while(t||r!==n);return n}function r(e,n,f,y,o,p,a){if(e){!a&&p&&l(e,y,o,p);for(var h,s,c=e;e.prev!==e.next;)if(h=e.prev,s=e.next,p?i(e,y,o,p):x(e))n.push(h.i/f),n.push(e.i/f),n.push(s.i/f),B(e),e=s.next,c=s.next;else if((e=s)===c){a?1===a?r(e=u(t(e),n,f),n,f,y,o,p,2):2===a&&v(e,n,f,y,o,p):r(t(e),n,f,y,o,p,1);break}}}function x(e){var n=e.prev,t=e,r=e.next;if(g(n,t,r)>=0)return!1;for(var x=e.next.next;x!==e.prev;){if(Z(n.x,n.y,t.x,t.y,r.x,r.y,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;x=x.next}return!0}function i(e,n,t,r){var x=e.prev,i=e,u=e.next;if(g(x,i,u)>=0)return!1;for(var v=x.xi.x?x.x>u.x?x.x:u.x:i.x>u.x?i.x:u.x,o=x.y>i.y?x.y>u.y?x.y:u.y:i.y>u.y?i.y:u.y,p=s(v,f,n,t,r),a=s(y,o,n,t,r),l=e.prevZ,h=e.nextZ;l&&l.z>=p&&h&&h.z<=a;){if(l!==e.prev&&l!==e.next&&Z(x.x,x.y,i.x,i.y,u.x,u.y,l.x,l.y)&&g(l.prev,l,l.next)>=0)return!1;if(l=l.prevZ,h!==e.prev&&h!==e.next&&Z(x.x,x.y,i.x,i.y,u.x,u.y,h.x,h.y)&&g(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;l&&l.z>=p;){if(l!==e.prev&&l!==e.next&&Z(x.x,x.y,i.x,i.y,u.x,u.y,l.x,l.y)&&g(l.prev,l,l.next)>=0)return!1;l=l.prevZ}for(;h&&h.z<=a;){if(h!==e.prev&&h!==e.next&&Z(x.x,x.y,i.x,i.y,u.x,u.y,h.x,h.y)&&g(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function u(e,n,r){var x=e;do{var i=x.prev,u=x.next.next;!w(i,u)&&M(i,x,x.next,u)&&k(i,u)&&k(u,i)&&(n.push(i.i/r),n.push(x.i/r),n.push(u.i/r),B(x),B(x.next),x=e=u),x=x.next}while(x!==e);return t(x)}function v(e,n,x,i,u,v){var f=e;do{for(var y=f.next.next;y!==f.prev;){if(f.i!==y.i&&d(f,y)){var o=q(f,y);return f=t(f,f.next),o=t(o,o.next),r(f,n,x,i,u,v),void r(o,n,x,i,u,v)}y=y.next}f=f.next}while(f!==e)}function f(e,r,x,i){var u,v,f,p=[];for(u=0,v=r.length;u=r.next.y&&r.next.y!==r.y){var v=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(v<=x&&v>u){if(u=v,v===x){if(i===r.y)return r;if(i===r.next.y)return r.next}t=r.x=r.x&&r.x>=o&&x!==r.x&&Z(it.x||r.x===t.x&&a(t,r)))&&(t=r,l=f)),r=r.next}while(r!==y);return t}function a(e,n){return g(e.prev,e,n.prev)<0&&g(n.next,e,e.next)<0}function l(e,n,t,r){var x=e;do{null===x.z&&(x.z=s(x.x,x.y,n,t,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==e);x.prevZ.nextZ=null,x.prevZ=null,h(x)}function h(e){var n,t,r,x,i,u,v,f,y=1;do{for(t=e,e=null,i=null,u=0;t;){for(u++,r=t,v=0,n=0;n0||f>0&&r;)0!==v&&(0===f||!r||t.z<=r.z)?(x=t,t=t.nextZ,v--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;t=r}i.nextZ=null,y*=2}while(u>1);return e}function s(e,n,t,r,x){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-t)*x)|e<<8))|e<<4))|e<<2))|e<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-r)*x)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function c(e){var n=e,t=e;do{(n.x=0&&(e-u)*(r-v)-(t-u)*(n-v)>=0&&(t-u)*(i-v)-(x-u)*(r-v)>=0}function d(e,n){return e.next.i!==n.i&&e.prev.i!==n.i&&!b(e,n)&&(k(e,n)&&k(n,e)&&j(e,n)&&(g(e.prev,e,n.prev)||g(e,n.prev,n))||w(e,n)&&g(e.prev,e,e.next)>0&&g(n.prev,n,n.next)>0)}function g(e,n,t){return(n.y-e.y)*(t.x-n.x)-(n.x-e.x)*(t.y-n.y)}function w(e,n){return e.x===n.x&&e.y===n.y}function M(e,n,t,r){var x=m(g(e,n,t)),i=m(g(e,n,r)),u=m(g(t,r,e)),v=m(g(t,r,n));return x!==i&&u!==v||(!(0!==x||!z(e,t,n))||(!(0!==i||!z(e,r,n))||(!(0!==u||!z(t,e,r))||!(0!==v||!z(t,n,r)))))}function z(e,n,t){return n.x<=Math.max(e.x,t.x)&&n.x>=Math.min(e.x,t.x)&&n.y<=Math.max(e.y,t.y)&&n.y>=Math.min(e.y,t.y)}function m(e){return e>0?1:e<0?-1:0}function b(e,n){var t=e;do{if(t.i!==e.i&&t.next.i!==e.i&&t.i!==n.i&&t.next.i!==n.i&&M(t,t.next,e,n))return!0;t=t.next}while(t!==e);return!1}function k(e,n){return g(e.prev,e,e.next)<0?g(e,n,e.next)>=0&&g(e,e.prev,n)>=0:g(e,n,e.prev)<0||g(e,e.next,n)<0}function j(e,n){var t=e,r=!1,x=(e.x+n.x)/2,i=(e.y+n.y)/2;do{t.y>i!=t.next.y>i&&t.next.y!==t.y&&x<(t.next.x-t.x)*(i-t.y)/(t.next.y-t.y)+t.x&&(r=!r),t=t.next}while(t!==e);return r}function q(e,n){var t=new C(e.i,e.x,e.y),r=new C(n.i,n.x,n.y),x=e.next,i=n.prev;return e.next=n,n.prev=e,t.next=x,x.prev=t,r.next=t,t.prev=r,i.next=r,r.prev=i,r}function A(e,n,t,r){var x=new C(e,n,t);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function B(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function C(e,n,t){this.i=e,this.x=n,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function D(e,n,t,r){for(var x=0,i=n,u=t-r;i0&&(r+=e[x-1].length,t.holes.push(r))}return t}; },{}],"FIMm":[function(require,module,exports) { var global = arguments[3]; var define; var o,e=arguments[3];!function(n){var r="object"==typeof exports&&exports&&!exports.nodeType&&exports,t="object"==typeof module&&module&&!module.nodeType&&module,u="object"==typeof e&&e;u.global!==u&&u.window!==u&&u.self!==u||(n=u);var i,f,c=2147483647,l=36,s=1,p=26,a=38,d=700,h=72,v=128,g="-",w=/^xn--/,x=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},C=l-s,b=Math.floor,j=String.fromCharCode;function A(o){throw RangeError(m[o])}function I(o,e){for(var n=o.length,r=[];n--;)r[n]=e(o[n]);return r}function E(o,e){var n=o.split("@"),r="";return n.length>1&&(r=n[0]+"@",o=n[1]),r+I((o=o.replace(y,".")).split("."),e).join(".")}function F(o){for(var e,n,r=[],t=0,u=o.length;t=55296&&e<=56319&&t65535&&(e+=j((o-=65536)>>>10&1023|55296),o=56320|1023&o),e+=j(o)}).join("")}function S(o,e){return o+22+75*(o<26)-((0!=e)<<5)}function T(o,e,n){var r=0;for(o=n?b(o/d):o>>1,o+=b(o/e);o>C*p>>1;r+=l)o=b(o/C);return b(r+(C+1)*o/(o+a))}function L(o){var e,n,r,t,u,i,f,a,d,w,x,y=[],m=o.length,C=0,j=v,I=h;for((n=o.lastIndexOf(g))<0&&(n=0),r=0;r=128&&A("not-basic"),y.push(o.charCodeAt(r));for(t=n>0?n+1:0;t=m&&A("invalid-input"),((a=(x=o.charCodeAt(t++))-48<10?x-22:x-65<26?x-65:x-97<26?x-97:l)>=l||a>b((c-C)/i))&&A("overflow"),C+=a*i,!(a<(d=f<=I?s:f>=I+p?p:f-I));f+=l)i>b(c/(w=l-d))&&A("overflow"),i*=w;I=T(C-u,e=y.length+1,0==u),b(C/e)>c-j&&A("overflow"),j+=b(C/e),C%=e,y.splice(C++,0,j)}return O(y)}function M(o){var e,n,r,t,u,i,f,a,d,w,x,y,m,C,I,E=[];for(y=(o=F(o)).length,e=v,n=0,u=h,i=0;i=e&&xb((c-n)/(m=r+1))&&A("overflow"),n+=(f-e)*m,e=f,i=0;ic&&A("overflow"),x==e){for(a=n,d=l;!(a<(w=d<=u?s:d>=u+p?p:d-u));d+=l)I=a-w,C=l-w,E.push(j(S(w+I%C,0))),a=b(I/C);E.push(j(S(a,0))),u=T(n,m,r==t),n=0,++r}++n,++e}return E.join("")}if(i={version:"1.3.2",ucs2:{decode:F,encode:O},decode:L,encode:M,toASCII:function(o){return E(o,function(o){return x.test(o)?"xn--"+M(o):o})},toUnicode:function(o){return E(o,function(o){return w.test(o)?L(o.slice(4).toLowerCase()):o})}},"function"==typeof o&&"object"==typeof o.amd&&o.amd)o("punycode",function(){return i});else if(r&&t)if(module.exports==r)t.exports=i;else for(f in i)i.hasOwnProperty(f)&&(r[f]=i[f]);else n.punycode=i}(this); },{}],"YsIc":[function(require,module,exports) { "use strict";module.exports={isString:function(n){return"string"==typeof n},isObject:function(n){return"object"==typeof n&&null!==n},isNull:function(n){return null===n},isNullOrUndefined:function(n){return null==n}}; },{}],"J6GP":[function(require,module,exports) { "use strict";function r(r,e){return Object.prototype.hasOwnProperty.call(r,e)}module.exports=function(t,n,o,a){n=n||"&",o=o||"=";var s={};if("string"!=typeof t||0===t.length)return s;var p=/\+/g;t=t.split(n);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var c=t.length;u>0&&c>u&&(c=u);for(var i=0;i=0?(y=b.substr(0,d),l=b.substr(d+1)):(y=b,l=""),f=decodeURIComponent(y),v=decodeURIComponent(l),r(s,f)?e(s[f])?s[f].push(v):s[f]=[s[f],v]:s[f]=v}return s};var e=Array.isArray||function(r){return"[object Array]"===Object.prototype.toString.call(r)}; },{}],"bvhO":[function(require,module,exports) { "use strict";var n=function(n){switch(typeof n){case"string":return n;case"boolean":return n?"true":"false";case"number":return isFinite(n)?n:"";default:return""}};module.exports=function(o,u,c,a){return u=u||"&",c=c||"=",null===o&&(o=void 0),"object"==typeof o?r(t(o),function(t){var a=encodeURIComponent(n(t))+c;return e(o[t])?r(o[t],function(e){return a+encodeURIComponent(n(e))}).join(u):a+encodeURIComponent(n(o[t]))}).join(u):a?encodeURIComponent(n(a))+c+encodeURIComponent(n(o)):""};var e=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};function r(n,e){if(n.map)return n.map(e);for(var r=[],t=0;t",'"',"`"," ","\r","\n","\t"],n=["{","}","|","\\","^","`"].concat(o),i=["'"].concat(n),l=["%","/","?",";","#"].concat(i),p=["/","?","#"],c=255,u=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=require("querystring");function b(t,e,a){if(t&&s.isObject(t)&&t instanceof h)return t;var r=new h;return r.parse(t,e,a),r}function q(t){return s.isString(t)&&(t=b(t)),t instanceof h?t.format():h.prototype.format.call(t)}function O(t,s){return b(t,!1,!0).resolve(s)}function d(t,s){return t?b(t,!1,!0).resolveObject(s):s}h.prototype.parse=function(h,a,o){if(!s.isString(h))throw new TypeError("Parameter 'url' must be a string, not "+typeof h);var n=h.indexOf("?"),b=-1!==n&&n127?z+="x":z+=$[H];if(!z.match(u)){var Z=R.slice(0,U),_=R.slice(U+1),E=$.match(f);E&&(Z.push(E[1]),_.unshift(E[2])),_.length&&(O="/"+_.join(".")+O),this.hostname=Z.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=t.toASCII(this.hostname));var P=this.port?":"+this.port:"",T=this.hostname||"";this.host=T+P,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==O[0]&&(O="/"+O))}if(!m[x])for(U=0,S=i.length;U0)&&a.host.split("@"))&&(a.auth=k.shift(),a.host=a.hostname=k.shift());return a.search=t.search,a.query=t.query,s.isNull(a.pathname)&&s.isNull(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.href=a.format(),a}if(!x.length)return a.pathname=null,a.search?a.path="/"+a.search:a.path=null,a.href=a.format(),a;for(var C=x.slice(-1)[0],I=(a.host||t.host||x.length>1)&&("."===C||".."===C)||""===C,w=0,U=x.length;U>=0;U--)"."===(C=x[U])?x.splice(U,1):".."===C?(x.splice(U,1),w++):w&&(x.splice(U,1),w--);if(!d&&!j)for(;w--;w)x.unshift("..");!d||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),I&&"/"!==x.join("/").substr(-1)&&x.push("");var k,N=""===x[0]||x[0]&&"/"===x[0].charAt(0);A&&(a.hostname=a.host=N?"":x.length?x.shift():"",(k=!!(a.host&&a.host.indexOf("@")>0)&&a.host.split("@"))&&(a.auth=k.shift(),a.host=a.hostname=k.shift()));return(d=d||a.host&&x.length)&&!N&&x.unshift(""),x.length?a.pathname=x.join("/"):(a.pathname=null,a.path=null),s.isNull(a.pathname)&&s.isNull(a.search)||(a.path=(a.pathname?a.pathname:"")+(a.search?a.search:"")),a.auth=t.auth||a.auth,a.slashes=a.slashes||t.slashes,a.href=a.format(),a},h.prototype.parseHost=function(){var t=this.host,s=a.exec(t);s&&(":"!==(s=s[0])&&(this.port=s.substr(1)),t=t.substr(0,t.length-s.length)),t&&(this.hostname=t)}; },{"punycode":"FIMm","./util":"YsIc","querystring":"fk5h"}],"LQBK":[function(require,module,exports) { "use strict";var E,_,T,A,R,N,S,O,P,I,L,M,D,U;Object.defineProperty(exports,"__esModule",{value:!0}),exports.WRAP_MODES=exports.TYPES=exports.TARGETS=exports.SCALE_MODES=exports.RENDERER_TYPE=exports.PRECISION=exports.MIPMAP_MODES=exports.MASK_TYPES=exports.GC_MODES=exports.FORMATS=exports.ENV=exports.DRAW_MODES=exports.BLEND_MODES=exports.ALPHA_MODES=void 0,exports.ENV=E,function(E){E[E.WEBGL_LEGACY=0]="WEBGL_LEGACY",E[E.WEBGL=1]="WEBGL",E[E.WEBGL2=2]="WEBGL2"}(E||(exports.ENV=E={})),exports.RENDERER_TYPE=_,function(E){E[E.UNKNOWN=0]="UNKNOWN",E[E.WEBGL=1]="WEBGL",E[E.CANVAS=2]="CANVAS"}(_||(exports.RENDERER_TYPE=_={})),exports.BLEND_MODES=T,function(E){E[E.NORMAL=0]="NORMAL",E[E.ADD=1]="ADD",E[E.MULTIPLY=2]="MULTIPLY",E[E.SCREEN=3]="SCREEN",E[E.OVERLAY=4]="OVERLAY",E[E.DARKEN=5]="DARKEN",E[E.LIGHTEN=6]="LIGHTEN",E[E.COLOR_DODGE=7]="COLOR_DODGE",E[E.COLOR_BURN=8]="COLOR_BURN",E[E.HARD_LIGHT=9]="HARD_LIGHT",E[E.SOFT_LIGHT=10]="SOFT_LIGHT",E[E.DIFFERENCE=11]="DIFFERENCE",E[E.EXCLUSION=12]="EXCLUSION",E[E.HUE=13]="HUE",E[E.SATURATION=14]="SATURATION",E[E.COLOR=15]="COLOR",E[E.LUMINOSITY=16]="LUMINOSITY",E[E.NORMAL_NPM=17]="NORMAL_NPM",E[E.ADD_NPM=18]="ADD_NPM",E[E.SCREEN_NPM=19]="SCREEN_NPM",E[E.NONE=20]="NONE",E[E.SRC_OVER=0]="SRC_OVER",E[E.SRC_IN=21]="SRC_IN",E[E.SRC_OUT=22]="SRC_OUT",E[E.SRC_ATOP=23]="SRC_ATOP",E[E.DST_OVER=24]="DST_OVER",E[E.DST_IN=25]="DST_IN",E[E.DST_OUT=26]="DST_OUT",E[E.DST_ATOP=27]="DST_ATOP",E[E.ERASE=26]="ERASE",E[E.SUBTRACT=28]="SUBTRACT",E[E.XOR=29]="XOR"}(T||(exports.BLEND_MODES=T={})),exports.DRAW_MODES=A,function(E){E[E.POINTS=0]="POINTS",E[E.LINES=1]="LINES",E[E.LINE_LOOP=2]="LINE_LOOP",E[E.LINE_STRIP=3]="LINE_STRIP",E[E.TRIANGLES=4]="TRIANGLES",E[E.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",E[E.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(A||(exports.DRAW_MODES=A={})),exports.FORMATS=R,function(E){E[E.RGBA=6408]="RGBA",E[E.RGB=6407]="RGB",E[E.ALPHA=6406]="ALPHA",E[E.LUMINANCE=6409]="LUMINANCE",E[E.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",E[E.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",E[E.DEPTH_STENCIL=34041]="DEPTH_STENCIL"}(R||(exports.FORMATS=R={})),exports.TARGETS=N,function(E){E[E.TEXTURE_2D=3553]="TEXTURE_2D",E[E.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",E[E.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",E[E.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",E[E.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",E[E.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",E[E.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",E[E.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z"}(N||(exports.TARGETS=N={})),exports.TYPES=S,function(E){E[E.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",E[E.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",E[E.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",E[E.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",E[E.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",E[E.FLOAT=5126]="FLOAT",E[E.HALF_FLOAT=36193]="HALF_FLOAT"}(S||(exports.TYPES=S={})),exports.SCALE_MODES=O,function(E){E[E.NEAREST=0]="NEAREST",E[E.LINEAR=1]="LINEAR"}(O||(exports.SCALE_MODES=O={})),exports.WRAP_MODES=P,function(E){E[E.CLAMP=33071]="CLAMP",E[E.REPEAT=10497]="REPEAT",E[E.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(P||(exports.WRAP_MODES=P={})),exports.MIPMAP_MODES=I,function(E){E[E.OFF=0]="OFF",E[E.POW2=1]="POW2",E[E.ON=2]="ON"}(I||(exports.MIPMAP_MODES=I={})),exports.ALPHA_MODES=L,function(E){E[E.NPM=0]="NPM",E[E.UNPACK=1]="UNPACK",E[E.PMA=2]="PMA",E[E.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",E[E.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",E[E.PREMULTIPLY_ALPHA=2]="PREMULTIPLY_ALPHA"}(L||(exports.ALPHA_MODES=L={})),exports.GC_MODES=M,function(E){E[E.AUTO=0]="AUTO",E[E.MANUAL=1]="MANUAL"}(M||(exports.GC_MODES=M={})),exports.PRECISION=D,function(E){E.LOW="lowp",E.MEDIUM="mediump",E.HIGH="highp"}(D||(exports.PRECISION=D={})),exports.MASK_TYPES=U,function(E){E[E.NONE=0]="NONE",E[E.SCISSOR=1]="SCISSOR",E[E.STENCIL=2]="STENCIL",E[E.SPRITE=3]="SPRITE"}(U||(exports.MASK_TYPES=U={})); },{}],"G5Tu":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.clearTextureCache=T,exports.correctBlendMode=E,exports.createIndicesForQuads=D,exports.decomposeDataUri=J,exports.deprecation=G,exports.destroyTextureCache=S,exports.determineCrossOrigin=U,exports.getResolutionOfUrl=W,exports.hex2rgb=f,exports.hex2string=d,exports.isPow2=A,exports.isWebGLSupported=p,exports.log2=y,exports.nextPow2=N,exports.premultiplyRgba=w,exports.premultiplyTint=b,exports.premultiplyTintToRgba=m,exports.removeItems=_,exports.rgb2hex=x,exports.sayHello=l,exports.sign=M,exports.skipHello=u,exports.string2hex=g,exports.trimCanvas=B,exports.uid=O,Object.defineProperty(exports,"isMobile",{enumerable:!0,get:function(){return e.isMobile}}),Object.defineProperty(exports,"EventEmitter",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"earcut",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"url",{enumerable:!0,get:function(){return n.default}}),exports.premultiplyBlendMode=exports.TextureCache=exports.ProgramCache=exports.DATA_URI=exports.CanvasRenderTarget=exports.BaseTextureCache=void 0;var e=require("@pixi/settings"),t=i(require("eventemitter3")),r=i(require("earcut")),n=i(require("url")),o=require("@pixi/constants");function i(e){return e&&e.__esModule?e:{default:e}}e.settings.RETINA_PREFIX=/@([0-9\.]+)x/,e.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!0;var a,s=!1,c="5.2.0";function u(){s=!0}function l(e){if(!s){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var t=["\n %c %c %c PixiJS "+c+" - ✰ "+e+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,t)}else window.console&&window.console.log("PixiJS "+c+" - "+e+" - http://www.pixijs.com/");s=!0}}function p(){return void 0===a&&(a=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:e.settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!window.WebGLRenderingContext)return!1;var r=document.createElement("canvas"),n=r.getContext("webgl",t)||r.getContext("experimental-webgl",t),o=!(!n||!n.getContextAttributes().stencil);if(n){var i=n.getExtension("WEBGL_lose_context");i&&i.loseContext()}return n=null,o}catch(a){return!1}}()),a}function f(e,t){return(t=t||[])[0]=(e>>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t}function d(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)}function g(e){return"string"==typeof e&&"#"===e[0]&&(e=e.substr(1)),parseInt(e,16)}function x(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)}function h(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[o.BLEND_MODES.NORMAL_NPM]=o.BLEND_MODES.NORMAL,e[o.BLEND_MODES.ADD_NPM]=o.BLEND_MODES.ADD,e[o.BLEND_MODES.SCREEN_NPM]=o.BLEND_MODES.SCREEN,t[o.BLEND_MODES.NORMAL]=o.BLEND_MODES.NORMAL_NPM,t[o.BLEND_MODES.ADD]=o.BLEND_MODES.ADD_NPM,t[o.BLEND_MODES.SCREEN]=o.BLEND_MODES.SCREEN_NPM;var n=[];return n.push(t),n.push(e),n}var v=h();function E(e,t){return v[t?1:0][e]}function w(e,t,r,n){return r=r||new Float32Array(4),n||void 0===n?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]),r[3]=t,r}function b(e,t){if(1===t)return(255*t<<24)+e;if(0===t)return 0;var r=e>>16&255,n=e>>8&255,o=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((n=n*t+.5|0)<<8)+(o=o*t+.5|0)}function m(e,t,r,n){return(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(n||void 0===n)&&(r[0]*=t,r[1]*=t,r[2]*=t),r[3]=t,r}function D(e,t){void 0===t&&(t=null);var r=6*e;if((t=t||new Uint16Array(r)).length!==r)throw new Error("Out buffer length is incorrect, got "+t.length+" and expected "+r);for(var n=0,o=0;n=o||0===r)){var i=o-(r=t+r>o?o-t:r);for(n=t;n>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1}function A(e){return!(e&e-1||!e)}function y(e){var t=(e>65535)<<4,r=((e>>>=t)>255)<<3;return t|=r,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1}var R={};exports.ProgramCache=R;var L=Object.create(null);exports.TextureCache=L;var P=Object.create(null);function S(){var e;for(e in L)L[e].destroy();for(e in P)P[e].destroy()}function T(){var e;for(e in L)delete L[e];for(e in P)delete P[e]}function B(e){var t,r,n,o=e.width,i=e.height,a=e.getContext("2d"),s=a.getImageData(0,0,o,i).data,c=s.length,u={top:null,left:null,right:null,bottom:null},l=null;for(t=0;t=0?f.S:f.N:2*Math.abs(i)<=Math.abs(t)?t>0?f.E:f.W:i>0?t>0?f.SE:f.SW:t>0?f.NE:f.NW},matrixAppendRotationInv:function(t,i,s,h){void 0===s&&(s=0),void 0===h&&(h=0);var o=y[f.inv(i)];o.tx=s,o.ty=h,t.append(o)}};exports.groupD8=f;var l=function(){function t(){this.worldTransform=new e,this.localTransform=new e,this.position=new i(this.onChange,this,0,0),this.scale=new i(this.onChange,this,1,1),this.pivot=new i(this.onChange,this,0,0),this.skew=new i(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}return t.prototype.onChange=function(){this._localID++},t.prototype.updateSkew=function(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++},t.prototype.updateLocalTransform=function(){var t=this.localTransform;this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1)},t.prototype.updateTransform=function(t){var i=this.localTransform;if(this._localID!==this._currentLocalID&&(i.a=this._cx*this.scale.x,i.b=this._sx*this.scale.x,i.c=this._cy*this.scale.y,i.d=this._sy*this.scale.y,i.tx=this.position.x-(this.pivot.x*i.a+this.pivot.y*i.c),i.ty=this.position.y-(this.pivot.x*i.b+this.pivot.y*i.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var s=t.worldTransform,h=this.worldTransform;h.a=i.a*s.a+i.b*s.c,h.b=i.a*s.b+i.b*s.d,h.c=i.c*s.a+i.d*s.c,h.d=i.c*s.b+i.d*s.d,h.tx=i.tx*s.a+i.ty*s.c+s.tx,h.ty=i.tx*s.b+i.ty*s.d+s.ty,this._parentID=t._worldID,this._worldID++}},t.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},Object.defineProperty(t.prototype,"rotation",{get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())},enumerable:!0,configurable:!0}),t.IDENTITY=new t,t}();exports.Transform=l;var v=function(){function t(t,i,s,h){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),this.x=Number(t),this.y=Number(i),this.width=Number(s),this.height=Number(h),this.type=o.RECT}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(t,"EMPTY",{get:function(){return new t(0,0,0,0)},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copyFrom=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.copyTo=function(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},t.prototype.contains=function(t,i){return!(this.width<=0||this.height<=0)&&(t>=this.x&&t=this.y&&ii!=c>i&&t<(i-n)/(c-n)*(a-e)+e&&(s=!s)}return s},i}();exports.Polygon=w;var g=function(){function t(t,i,s,h,r){void 0===t&&(t=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===h&&(h=0),void 0===r&&(r=20),this.x=t,this.y=i,this.width=s,this.height=h,this.radius=r,this.type=o.RREC}return t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height,this.radius)},t.prototype.contains=function(t,i){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&i>=this.y&&i<=this.y+this.height){if(i>=this.y+this.radius&&i<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var s=t-(this.x+this.radius),h=i-(this.y+this.radius),o=this.radius*this.radius;if(s*s+h*h<=o)return!0;if((s=t-(this.x+this.width-this.radius))*s+h*h<=o)return!0;if(s*s+(h=i-(this.y+this.height-this.radius))*h<=o)return!0;if((s=t-(this.x+this.radius))*s+h*h<=o)return!0}return!1},t}();exports.RoundedRectangle=g; },{}],"nL3p":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DisplayObject=exports.Container=exports.Bounds=void 0;var t=require("@pixi/settings"),i=require("@pixi/math"),e=require("@pixi/utils");t.settings.SORTABLE_CHILDREN=!1;var s=function(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null};exports.Bounds=s,s.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},s.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},s.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((t=t||new i.Rectangle(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},s.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},s.prototype.addQuad=function(t){var i=this.minX,e=this.minY,s=this.maxX,n=this.maxY,r=t[0],o=t[1];i=rs?r:s,n=o>n?o:n,i=(r=t[2])s?r:s,n=o>n?o:n,i=(r=t[4])s?r:s,n=o>n?o:n,i=(r=t[6])s?r:s,n=o>n?o:n,this.minX=i,this.minY=e,this.maxX=s,this.maxY=n},s.prototype.addFrame=function(t,i,e,s,n){this.addFrameMatrix(t.worldTransform,i,e,s,n)},s.prototype.addFrameMatrix=function(t,i,e,s,n){var r=t.a,o=t.b,h=t.c,a=t.d,l=t.tx,d=t.ty,m=this.minX,p=this.minY,u=this.maxX,c=this.maxY,f=r*i+h*e+l,x=o*i+a*e+d;m=fu?f:u,c=x>c?x:c,m=(f=r*s+h*e+l)u?f:u,c=x>c?x:c,m=(f=r*i+h*n+l)u?f:u,c=x>c?x:c,m=(f=r*s+h*n+l)u?f:u,c=x>c?x:c,this.minX=m,this.minY=p,this.maxX=u,this.maxY=c},s.prototype.addVertexData=function(t,i,e){for(var s=this.minX,n=this.minY,r=this.maxX,o=this.maxY,h=i;hr?a:r,o=l>o?l:o}this.minX=s,this.minY=n,this.maxX=r,this.maxY=o},s.prototype.addVertices=function(t,i,e,s){this.addVerticesMatrix(t.worldTransform,i,e,s)},s.prototype.addVerticesMatrix=function(t,i,e,s,n,r){var o=t.a,h=t.b,a=t.c,l=t.d,d=t.tx,m=t.ty;n=n||0,r=r||0;for(var p=this.minX,u=this.minY,c=this.maxX,f=this.maxY,x=e;xs?t.maxX:s,this.maxY=t.maxY>n?t.maxY:n},s.prototype.addBoundsMask=function(t,i){var e=t.minX>i.minX?t.minX:i.minX,s=t.minY>i.minY?t.minY:i.minY,n=t.maxXa?n:a,this.maxY=r>l?r:l}},s.prototype.addBoundsMatrix=function(t,i){this.addFrameMatrix(i,t.minX,t.minY,t.maxX,t.maxY)},s.prototype.addBoundsArea=function(t,i){var e=t.minX>i.x?t.minX:i.x,s=t.minY>i.y?t.minY:i.y,n=t.maxXa?n:a,this.maxY=r>l?r:l}},s.prototype.pad=function(t,i){t=t||0,i=i||(0!==i?t:0),this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=i,this.maxY+=i)},s.prototype.addFramePad=function(t,i,e,s,n,r){t-=n,i-=r,e+=n,s+=r,this.minX=this.minXe?this.maxX:e,this.minY=this.minYs?this.maxY:s};var n=function(t){function e(){t.call(this),this.tempDisplayObjectParent=null,this.transform=new i.Transform,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new s,this._boundsID=0,this._lastBoundsID=-1,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={_tempDisplayObjectParent:{configurable:!0},x:{configurable:!0},y:{configurable:!0},worldTransform:{configurable:!0},localTransform:{configurable:!0},position:{configurable:!0},scale:{configurable:!0},pivot:{configurable:!0},skew:{configurable:!0},rotation:{configurable:!0},angle:{configurable:!0},zIndex:{configurable:!0},worldVisible:{configurable:!0},mask:{configurable:!0}};return e.mixin=function(t){for(var i=Object.keys(t),s=0;s1)for(var s=0;sthis.children.length)throw new Error(t+"addChildAt: The index "+i+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(i,0,t),this._boundsID++,this.onChildrenChange(i),t.emit("added",this),this.emit("childAdded",t,this,i),t},s.prototype.swapChildren=function(t,i){if(t!==i){var e=this.getChildIndex(t),s=this.getChildIndex(i);this.children[e]=i,this.children[s]=t,this.onChildrenChange(e=this.children.length)throw new Error("The index "+i+" supplied is out of bounds "+this.children.length);var s=this.getChildIndex(t);(0,e.removeItems)(this.children,s,1),this.children.splice(i,0,t),this.onChildrenChange(i)},s.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},s.prototype.removeChild=function(t){var i=arguments,s=arguments.length;if(s>1)for(var n=0;n0&&r<=n){e=this.children.splice(s,r);for(var o=0;o1&&this.children.sort(r),this.sortDirty=!1},s.prototype.updateTransform=function(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,i=this.children.length;t title : "+e.title+"
tabIndex: "+e.tabIndex},p.prototype.capHitArea=function(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0),e.x+e.width>this.renderer.width&&(e.width=this.renderer.width-e.x),e.y+e.height>this.renderer.height&&(e.height=this.renderer.height-e.y)},p.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width=n+"px",t.style.height=n+"px",t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=l,t.style.borderStyle="none",navigator.userAgent.toLowerCase().indexOf("chrome")>-1?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&null!==e.accessibleTitle?t.title=e.accessibleTitle:e.accessibleHint&&null!==e.accessibleHint||(t.title="displayObject "+e.tabIndex),e.accessibleHint&&null!==e.accessibleHint&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this.updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.displayObject=e,this.children.push(e),this.div.appendChild(e._accessibleDiv),e._accessibleDiv.tabIndex=e.tabIndex},p.prototype._onClick=function(e){var t=this.renderer.plugins.interaction;t.dispatchEvent(e.target.displayObject,"click",t.eventData),t.dispatchEvent(e.target.displayObject,"pointertap",t.eventData),t.dispatchEvent(e.target.displayObject,"tap",t.eventData)},p.prototype._onFocus=function(e){e.target.getAttribute("aria-live","off")||e.target.setAttribute("aria-live","assertive");var t=this.renderer.plugins.interaction;t.dispatchEvent(e.target.displayObject,"mouseover",t.eventData)},p.prototype._onFocusOut=function(e){e.target.getAttribute("aria-live","off")||e.target.setAttribute("aria-live","polite");var t=this.renderer.plugins.interaction;t.dispatchEvent(e.target.displayObject,"mouseout",t.eventData)},p.prototype._onKeyDown=function(e){e.keyCode===s&&this.activate()},p.prototype._onMouseMove=function(e){0===e.movementX&&0===e.movementY||this.deactivate()},p.prototype.destroy=function(){this.destroyTouchHook(),this.div=null;for(var e=0;e8)throw new Error("max arguments reached");var h=this.name,a=this.items;this._aliasCount++;for(var m=0,p=a.length;m0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))},t.prototype.add=function(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this},t.prototype.remove=function(t){var e=this.items.indexOf(t);return-1!==e&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this},t.prototype.contains=function(t){return-1!==this.items.indexOf(t)},t.prototype.removeAll=function(){return this.ensureNonAliasedItems(),this.items.length=0,this},t.prototype.destroy=function(){this.removeAll(),this.items=null,this._name=null},Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),t}();exports.Runner=t,Object.defineProperties(t.prototype,{dispatch:{value:t.prototype.emit},run:{value:t.prototype.emit}}); },{}],"F3Q6":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UPDATE_PRIORITY=exports.TickerPlugin=exports.Ticker=void 0;var t,e=require("@pixi/settings");e.settings.TARGET_FPMS=.06,exports.UPDATE_PRIORITY=t,function(t){t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY"}(t||(exports.UPDATE_PRIORITY=t={}));var i=function(){function t(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=0),void 0===s&&(s=!1),this.fn=t,this.context=e,this.priority=i,this.once=s,this.next=null,this.previous=null,this._destroyed=!1}return t.prototype.match=function(t,e){return void 0===e&&(e=null),this.fn===t&&this.context===e},t.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},t.prototype.connect=function(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this},t.prototype.destroy=function(t){void 0===t&&(t=!1),this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);var e=this.next;return this.next=t?null:e,this.previous=null,e},t}(),s=function(){function s(){var t=this;this._head=new i(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this.autoStart=!1,this.deltaTime=1,this.deltaMS=1/e.settings.TARGET_FPMS,this.elapsedMS=1/e.settings.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._protected=!1,this._lastFrame=-1,this._tick=function(e){t._requestId=null,t.started&&(t.update(e),t.started&&null===t._requestId&&t._head.next&&(t._requestId=requestAnimationFrame(t._tick)))}}return s.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))},s.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},s.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},s.prototype.add=function(e,s,n){return void 0===n&&(n=t.NORMAL),this._addListener(new i(e,s,n))},s.prototype.addOnce=function(e,s,n){return void 0===n&&(n=t.NORMAL),this._addListener(new i(e,s,n,!0))},s.prototype._addListener=function(t){var e=this._head.next,i=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}else t.connect(i);return this._startIfPossible(),this},s.prototype.remove=function(t,e){for(var i=this._head.next;i;)i=i.match(t,e)?i.destroy():i.next;return this._head.next||this._cancelIfNeeded(),this},s.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},s.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},s.prototype.destroy=function(){if(!this._protected){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}},s.prototype.update=function(t){var i;if(void 0===t&&(t=performance.now()),t>this.lastTime){if((i=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(i=this._maxElapsedMS),i*=this.speed,this._minElapsedMS){var s=t-this._lastFrame|0;if(s=0;--n){var o=c[n];if(o.test&&o.test(t,r))return new o(t,e)}return new l(t,e)}var p=function(t){function e(e,r){var i=r||{},n=i.width,o=i.height;if(!n||!o)throw new Error("BufferResource width or height invalid");t.call(this,n,o),this.data=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var n=t.gl;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.ALPHA_MODES.UNPACK),i.width===e.width&&i.height===e.height?n.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,n.texImage2D(e.target,0,i.internalFormat,e.width,e.height,0,e.format,i.type,this.data)),!0},e.prototype.dispose=function(){this.data=null},e.test=function(t){return t instanceof Float32Array||t instanceof Uint8Array||t instanceof Uint32Array},e}(a),f={scaleMode:r.SCALE_MODES.NEAREST,format:r.FORMATS.RGBA,alphaMode:r.ALPHA_MODES.NPM},v=function(t){function n(n,o){void 0===n&&(n=null),void 0===o&&(o=null),t.call(this);var s=(o=o||{}).alphaMode,h=o.mipmap,u=o.anisotropicLevel,l=o.scaleMode,c=o.width,p=o.height,f=o.wrapMode,v=o.format,_=o.type,g=o.target,y=o.resolution,m=o.resourceOptions;!n||n instanceof a||((n=d(n,m)).internal=!0),this.width=c||0,this.height=p||0,this.resolution=y||i.settings.RESOLUTION,this.mipmap=void 0!==h?h:i.settings.MIPMAP_TEXTURES,this.anisotropicLevel=void 0!==u?u:i.settings.ANISOTROPIC_LEVEL,this.wrapMode=f||i.settings.WRAP_MODE,this.scaleMode=void 0!==l?l:i.settings.SCALE_MODE,this.format=v||r.FORMATS.RGBA,this.type=_||r.TYPES.UNSIGNED_BYTE,this.target=g||r.TARGETS.TEXTURE_2D,this.alphaMode=void 0!==s?s:r.ALPHA_MODES.UNPACK,void 0!==o.premultiplyAlpha&&(this.premultiplyAlpha=o.premultiplyAlpha),this.uid=(0,e.uid)(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=c>0&&p>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.setResource(n)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var o={realWidth:{configurable:!0},realHeight:{configurable:!0}};return o.realWidth.get=function(){return Math.ceil(this.width*this.resolution-1e-4)},o.realHeight.get=function(){return Math.ceil(this.height*this.resolution-1e-4)},n.prototype.setStyle=function(t,e){var r;return void 0!==t&&t!==this.scaleMode&&(this.scaleMode=t,r=!0),void 0!==e&&e!==this.mipmap&&(this.mipmap=e,r=!0),r&&this.dirtyStyleId++,this},n.prototype.setSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t,this.height=e,this._refreshPOT(),this.update(),this},n.prototype.setRealSize=function(t,e,r){return this.resolution=r||this.resolution,this.width=t/this.resolution,this.height=e/this.resolution,this._refreshPOT(),this.update(),this},n.prototype._refreshPOT=function(){this.isPowerOfTwo=(0,e.isPow2)(this.realWidth)&&(0,e.isPow2)(this.realHeight)},n.prototype.setResolution=function(t){var e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=this.width*e/t,this.height=this.height*e/t,this.emit("update",this)),this._refreshPOT(),this)},n.prototype.setResource=function(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this},n.prototype.update=function(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))},n.prototype.onError=function(t){this.emit("error",this,t)},n.prototype.destroy=function(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete e.BaseTextureCache[this.cacheId],delete e.TextureCache[this.cacheId],this.cacheId=null),this.dispose(),n.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0},n.prototype.dispose=function(){this.emit("dispose",this)},n.from=function(t,r,o){void 0===o&&(o=i.settings.STRICT_TEXTURE_CACHE);var s="string"==typeof t,a=null;s?a=t:(t._pixiId||(t._pixiId="pixiid_"+(0,e.uid)()),a=t._pixiId);var h=e.BaseTextureCache[a];if(s&&o&&!h)throw new Error('The cacheId "'+a+'" does not exist in BaseTextureCache.');return h||((h=new n(t,r)).cacheId=a,n.addToCache(h,a)),h},n.fromBuffer=function(t,e,i,o){t=t||new Float32Array(e*i*4);var s=new p(t,{width:e,height:i}),a=t instanceof Float32Array?r.TYPES.FLOAT:r.TYPES.UNSIGNED_BYTE;return new n(s,Object.assign(f,o||{width:e,height:i,type:a}))},n.addToCache=function(t,r){r&&(-1===t.textureCacheIds.indexOf(r)&&t.textureCacheIds.push(r),e.BaseTextureCache[r]&&console.warn("BaseTexture added to the cache with an id ["+r+"] that already had an entry"),e.BaseTextureCache[r]=t)},n.removeFromCache=function(t){if("string"==typeof t){var r=e.BaseTextureCache[t];if(r){var i=r.textureCacheIds.indexOf(t);return i>-1&&r.textureCacheIds.splice(i,1),delete e.BaseTextureCache[t],r}}else if(t&&t.textureCacheIds){for(var n=0;n]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;var x=function(t){function e(e,r){if(r=r||{},!(e instanceof HTMLVideoElement)){var i=document.createElement("video");i.setAttribute("preload","auto"),i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline",""),"string"==typeof e&&(e=[e]),t.crossOrigin(i,e[0].src||e[0],r.crossorigin);for(var n=0;n0&&!1===t.paused&&!1===t.ended&&t.readyState>2},e.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},e.prototype._onPlayStart=function(){this.valid||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(n.Ticker.shared.add(this.update,this),this._isAutoUpdating=!0)},e.prototype._onPlayStop=function(){this._isAutoUpdating&&(n.Ticker.shared.remove(this.update,this),this._isAutoUpdating=!1)},e.prototype._onCanPlay=function(){var t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);var e=this.valid;this.resize(t.videoWidth,t.videoHeight),!e&&this._resolve&&(this._resolve(this),this._resolve=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()},e.prototype.dispose=function(){this._isAutoUpdating&&n.Ticker.shared.remove(this.update,this),this.source&&(this.source.removeEventListener("error",this._onError,!0),this.source.pause(),this.source.src="",this.source.load()),t.prototype.dispose.call(this)},r.autoUpdate.get=function(){return this._autoUpdate},r.autoUpdate.set=function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(n.Ticker.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(n.Ticker.shared.add(this.update,this),this._isAutoUpdating=!0))},r.updateFPS.get=function(){return this._updateFPS},r.updateFPS.set=function(t){t!==this._updateFPS&&(this._updateFPS=t)},e.test=function(t,r){return t instanceof HTMLVideoElement||e.TYPES.indexOf(r)>-1},Object.defineProperties(e.prototype,r),e}(u);x.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"];var E=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.test=function(t){return!!window.createImageBitmap&&t instanceof ImageBitmap},e}(u);c.push(l,E,g,x,m,p,y,_);var T={INSTALLED:c,autoDetectResource:d,ArrayResource:_,BufferResource:p,CanvasResource:g,CubeResource:y,ImageResource:l,ImageBitmapResource:E,SVGResource:m,VideoResource:x,Resource:a,BaseImageResource:u};exports.resources=T;var b=function(t){this.renderer=t};exports.System=b,b.prototype.destroy=function(){this.renderer=null};var S=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.upload=function(t,e,i){var n=t.gl;return n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===r.ALPHA_MODES.UNPACK),i.width===e.width&&i.height===e.height?n.texSubImage2D(e.target,0,0,0,e.width,e.height,e.format,e.type,this.data):(i.width=e.width,i.height=e.height,n.texImage2D(e.target,0,n.DEPTH_COMPONENT16,e.width,e.height,0,e.format,e.type,this.data)),!0},e}(p),w=function(e,r){this.width=Math.ceil(e||100),this.height=Math.ceil(r||100),this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new t.Runner("disposeFramebuffer",2)};exports.Framebuffer=w;var A={colorTexture:{configurable:!0}};A.colorTexture.get=function(){return this.colorTextures[0]},w.prototype.addColorTexture=function(t,e){return void 0===t&&(t=0),this.colorTextures[t]=e||new v(null,{scaleMode:0,resolution:1,mipmap:!1,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this},w.prototype.addDepthTexture=function(t){return this.depthTexture=t||new v(new S(null,{width:this.width,height:this.height}),{scaleMode:0,resolution:1,width:this.width,height:this.height,mipmap:!1,format:r.FORMATS.DEPTH_COMPONENT,type:r.TYPES.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this},w.prototype.enableDepth=function(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this},w.prototype.enableStencil=function(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this},w.prototype.resize=function(t,e){if(t=Math.ceil(t),e=Math.ceil(e),t!==this.width||e!==this.height){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(var r=0;r-1&&r.textureCacheIds.splice(i,1),delete e.TextureCache[t],r}}else if(t&&t.textureCacheIds){for(var n=0;nthis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",h="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,u="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+h+" "+a+" "+u)}this.valid=i&&n&&this.baseTexture.valid,this.trim||this.rotate||(this.orig=t),this.valid&&this.updateUvs()},n.rotate.get=function(){return this._rotate},n.rotate.set=function(t){this._rotate=t,this.valid&&this.updateUvs()},n.width.get=function(){return this.orig.width},n.height.get=function(){return this.orig.height},Object.defineProperties(r.prototype,n),r}(e.EventEmitter);function P(){var t=document.createElement("canvas");t.width=16,t.height=16;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,16,16),new O(new v(new g(t)))}function M(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}exports.Texture=O,O.EMPTY=new O(new v),M(O.EMPTY),M(O.EMPTY.baseTexture),O.WHITE=P(),M(O.WHITE),M(O.WHITE.baseTexture);var D=function(t){function e(e,r){var i=null;if(!(e instanceof C)){var n=arguments[1],o=arguments[2],s=arguments[3],a=arguments[4];console.warn("Please use RenderTexture.create("+n+", "+o+") instead of the ctor directly."),i=arguments[0],r=null,e=new C({width:n,height:o,scaleMode:s,resolution:a})}t.call(this,e,r),this.legacyRenderer=i,this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.resize=function(t,e,r){void 0===r&&(r=!0),t=Math.ceil(t),e=Math.ceil(e),this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r&&this.baseTexture.resize(t,e),this.updateUvs()},e.prototype.setResolution=function(t){var e=this.baseTexture;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))},e.create=function(t){return"number"==typeof t&&(t={width:t,height:arguments[1],scaleMode:arguments[2],resolution:arguments[3]}),new e(new C(t))},e}(O);exports.RenderTexture=D;var F=function(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0};exports.RenderTexturePool=F,F.prototype.createTexture=function(t,e){var r=new C(Object.assign({width:t,height:e,resolution:1},this.textureOptions));return new D(r)},F.prototype.getOptimalTexture=function(t,r,i){void 0===i&&(i=1);var n=F.SCREEN_KEY;t*=i,r*=i,this.enableFullScreen&&t===this._pixelsWidth&&r===this._pixelsHeight||(n=(65535&(t=(0,e.nextPow2)(t)))<<16|65535&(r=(0,e.nextPow2)(r))),this.texturePool[n]||(this.texturePool[n]=[]);var o=this.texturePool[n].pop();return o||(o=this.createTexture(t,r)),o.filterPoolKey=n,o.setResolution(i),o},F.prototype.getFilterTexture=function(t,e){var r=this.getOptimalTexture(t.width,t.height,e||t.resolution);return r.filterFrame=t.filterFrame,r},F.prototype.returnTexture=function(t){var e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)},F.prototype.returnFilterTexture=function(t){this.returnTexture(t)},F.prototype.clear=function(t){if(t=!1!==t)for(var e in this.texturePool){var r=this.texturePool[e];if(r)for(var i=0;i0&&t.height>0,r)for(var i=0;i1){for(var u=0;u=0;--i)t[i]=r[i]||null,t[i]&&(t[i]._batchLocation=i)},e.prototype.boundArray=function(t,e,r,i){for(var n=t.elements,o=t.ids,s=t.count,a=0,h=0;h=0&&l=r.ENV.WEBGL2&&(n=t.getContext("webgl2",e)),n)this.webGLVersion=2;else if(this.webGLVersion=1,!(n=t.getContext("webgl",e)||t.getContext("experimental-webgl",e)))throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=n,this.getExtensions(),n},e.prototype.getExtensions=function(){var t=this.gl;1===this.webGLVersion?Object.assign(this.extensions,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBKIT_WEBGL_depth_texture"),loseContext:t.getExtension("WEBGL_lose_context"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):2===this.webGLVersion&&Object.assign(this.extensions,{anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),colorBufferFloat:t.getExtension("EXT_color_buffer_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear")})},e.prototype.handleContextLost=function(t){t.preventDefault()},e.prototype.handleContextRestored=function(){this.renderer.runners.contextChange.run(this.gl)},e.prototype.destroy=function(){var t=this.renderer.view;t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()},e.prototype.postrender=function(){this.renderer.renderingToScreen&&this.gl.flush()},e.prototype.validateContext=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")},Object.defineProperties(e.prototype,n),e}(b),et=function(t){function e(e){t.call(this,e),this.managedFramebuffers=[],this.unknownFramebuffer=new w(10,10)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return e.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new o.Rectangle,this.hasMRT=!0,this.writeDepthTexture=!0,this.disposeAll(!0),1===this.renderer.context.webGLVersion){var e=this.renderer.context.extensions.drawBuffers,n=this.renderer.context.extensions.depthTexture;i.settings.PREFER_ENV===r.ENV.WEBGL_LEGACY&&(e=null,n=null),e?t.drawBuffers=function(t){return e.drawBuffersWEBGL(t)}:(this.hasMRT=!1,t.drawBuffers=function(){}),n||(this.writeDepthTexture=!1)}},e.prototype.bind=function(t,e){var r=this.gl;if(t){var i=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,r.bindFramebuffer(r.FRAMEBUFFER,i.framebuffer)),i.dirtyId!==t.dirtyId&&(i.dirtyId=t.dirtyId,i.dirtyFormat!==t.dirtyFormat?(i.dirtyFormat=t.dirtyFormat,this.updateFramebuffer(t)):i.dirtySize!==t.dirtySize&&(i.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(var n=0;n1&&e.drawBuffers(n),t.depthTexture)&&this.writeDepthTexture){var a=t.depthTexture;this.renderer.texture.bind(a,0),e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a._glTextures[this.CONTEXT_UID].texture,0)}r.stencil||!t.stencil&&!t.depth||(r.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,r.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.width,t.height),t.depthTexture||e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,r.stencil))},e.prototype.disposeFramebuffer=function(t,e){var r=t.glFramebuffers[this.CONTEXT_UID],i=this.gl;if(r){delete t.glFramebuffers[this.CONTEXT_UID];var n=this.managedFramebuffers.indexOf(t);n>=0&&this.managedFramebuffers.splice(n,1),t.disposeRunner.remove(this),e||(i.deleteFramebuffer(r.framebuffer),r.stencil&&i.deleteRenderbuffer(r.stencil))}},e.prototype.disposeAll=function(t){var e=this.managedFramebuffers;this.managedFramebuffers=[];for(var r=0;r=i.data.byteLength)e.bufferSubData(o,0,i.data);else{var s=i.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=i.data.byteLength,e.bufferData(o,i.data,s)}}}},e.prototype.checkCompatibility=function(t,e){var r=t.attributes,i=e.attributeData;for(var n in i)if(!r[n])throw new Error('shader and geometry incompatible, geometry missing the "'+n+'" attribute')},e.prototype.getSignature=function(t,e){var r=t.attributes,i=e.attributeData,n=["g",t.id];for(var o in r)i[o]&&n.push(o);return n.join("-")},e.prototype.initGeometryVao=function(t,e){this.checkCompatibility(t,e);var r=this.gl,i=this.CONTEXT_UID,n=this.getSignature(t,e),o=t.glVertexArrayObjects[this.CONTEXT_UID],s=o[n];if(s)return o[e.id]=s,s;var a=t.buffers,h=t.attributes,u={},l={};for(var c in a)u[c]=0,l[c]=0;for(var d in h)!h[d].size&&e.attributeData[d]?h[d].size=e.attributeData[d].size:h[d].size||console.warn("PIXI Geometry attribute '"+d+"' size cannot be determined (likely the bound shader does not have the attribute)"),u[h[d].buffer]+=h[d].size*it[h[d].type];for(var p in h){var f=h[p],v=f.size;void 0===f.stride&&(u[f.buffer]===v*it[f.type]?f.stride=0:f.stride=u[f.buffer]),void 0===f.start&&(f.start=l[f.buffer],l[f.buffer]+=v*it[f.type])}s=r.createVertexArray(),r.bindVertexArray(s);for(var _=0;_=r.ENV.WEBGL2&&(t=e.getContext("webgl2",{})),t||((t=e.getContext("webgl",{})||e.getContext("experimental-webgl",{}))?t.getExtension("WEBGL_draw_buffers"):t=null),dt=t}return dt}function ft(){if(!lt){lt=r.PRECISION.MEDIUM;var t=pt();if(t&&t.getShaderPrecisionFormat){var e=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT);lt=e.precision?r.PRECISION.HIGH:r.PRECISION.MEDIUM}}return lt}function vt(t,e,i){if("precision"!==t.substring(0,9)){var n=e;return e===r.PRECISION.HIGH&&i!==r.PRECISION.HIGH&&(n=r.PRECISION.MEDIUM),"precision "+n+" float;\n"+t}return i!==r.PRECISION.HIGH&&"precision highp"===t.substring(0,15)?t.replace("precision highp","precision mediump"):t}var _t={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function gt(t){return _t[t]}var yt=null,mt={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray"};function xt(t,e){if(!yt){var r=Object.keys(mt);yt={};for(var i=0;i0&&(e+="\nelse "),re.name?1:-1});for(var u=0;u0?this._useCurrent():t.disable(t.SCISSOR_TEST)},e.prototype._useCurrent=function(){var t=this.maskStack[this.maskStack.length-1]._scissorRect,e=this.renderer.renderTexture.current,r=this.renderer.projection,i=r.transform,n=r.sourceFrame,o=r.destinationFrame,s=e?e.resolution:this.renderer.resolution,a=(t.x-n.x)*s+o.x,h=(t.y-n.y)*s+o.y,u=t.width*s,l=t.height*s;i&&(a+=i.tx*s,h+=i.ty*s),e||(h=this.renderer.height-l-h),this.renderer.gl.scissor(a,h,u,l)},e}(te),re=function(t){function e(e){t.call(this,e),this.glConst=WebGLRenderingContext.STENCIL_TEST}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getStackLength=function(){var t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0},e.prototype.push=function(t){var e=t.maskObject,r=this.renderer.gl,i=t._stencilCounter;0===i&&(this.renderer.framebuffer.forceStencil(),r.enable(r.STENCIL_TEST)),t._stencilCounter++,r.colorMask(!1,!1,!1,!1),r.stencilFunc(r.EQUAL,i,this._getBitwiseMask()),r.stencilOp(r.KEEP,r.KEEP,r.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,this._useCurrent()},e.prototype.pop=function(t){var e=this.renderer.gl;0===this.getStackLength()?(e.disable(e.STENCIL_TEST),e.clear(e.STENCIL_BUFFER_BIT),e.clearStencil(0)):(e.colorMask(!1,!1,!1,!1),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,this._useCurrent())},e.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.getStackLength(),this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},e.prototype._getBitwiseMask=function(){return(1<>=1,r++;this.stateId=t.data}for(var i=0;ithis.checkCountMax&&(this.checkCount=0,this.run())))},e.prototype.run=function(){for(var t=this.renderer.texture,e=t.managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),e[i]=null,r=!0)}if(r){for(var o=0,s=0;s=0;r--)this.unload(t.children[r])},e}(b),ge=function(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=6408,this.internalFormat=5121};exports.GLTexture=ge;var ye=function(t){function i(e){t.call(this,e),this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new v}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.contextChange=function(){var t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion;var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(var r=0;r=1:e.mipmap=0,2===this.webGLVersion||t.isPowerOfTwo?e.wrapMode=t.wrapMode:e.wrapMode=r.WRAP_MODES.CLAMP,t.resource&&t.resource.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)},i.prototype.setStyle=function(t,e){var i=this.gl;if(e.mipmap&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);var n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===r.SCALE_MODES.LINEAR){var o=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,o)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode?i.LINEAR:i.NEAREST)},i}(b),me={FilterSystem:Z,BatchSystem:$,ContextSystem:tt,FramebufferSystem:et,GeometrySystem:nt,MaskSystem:Jt,ScissorSystem:ee,StencilSystem:re,ProjectionSystem:ie,RenderTextureSystem:oe,ShaderSystem:he,StateSystem:ve,TextureGCSystem:_e,TextureSystem:ye};exports.systems=me;var xe=new o.Matrix,Ee=function(t){function n(n,a){t.call(this),(a=Object.assign({},i.settings.RENDER_OPTIONS,a)).roundPixels&&(i.settings.ROUND_PIXELS=a.roundPixels,(0,e.deprecation)("5.0.0","Renderer roundPixels option is deprecated, please use PIXI.settings.ROUND_PIXELS",2)),this.options=a,this.type=r.RENDERER_TYPE.UNKNOWN,this.screen=new o.Rectangle(0,0,a.width,a.height),this.view=a.view||document.createElement("canvas"),this.resolution=a.resolution||i.settings.RESOLUTION,this.transparent=a.transparent,this.autoDensity=a.autoDensity||a.autoResize||!1,this.preserveDrawingBuffer=a.preserveDrawingBuffer,this.clearBeforeRender=a.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=a.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new s.Container,this._lastObjectRendered=this._tempDisplayObjectParent,this.plugins={}}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var a={width:{configurable:!0},height:{configurable:!0},backgroundColor:{configurable:!0}};return n.prototype.initPlugins=function(t){for(var e in t)this.plugins[e]=new t[e](this)},a.width.get=function(){return this.view.width},a.height.get=function(){return this.view.height},n.prototype.resize=function(t,e){this.screen.width=t,this.screen.height=e,this.view.width=t*this.resolution,this.view.height=e*this.resolution,this.autoDensity&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},n.prototype.generateTexture=function(t,e,r,i){0===(i=i||t.getLocalBounds()).width&&(i.width=1),0===i.height&&(i.height=1);var n=D.create(0|i.width,0|i.height,e,r);return xe.tx=-i.x,xe.ty=-i.y,this.render(t,n,!1,xe,!!t.parent),n},n.prototype.destroy=function(t){for(var e in this.plugins)this.plugins[e].destroy(),this.plugins[e]=null;t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.plugins=null,this.type=r.RENDERER_TYPE.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoDensity=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},a.backgroundColor.get=function(){return this._backgroundColor},a.backgroundColor.set=function(t){this._backgroundColor=t,this._backgroundColorString=(0,e.hex2string)(t),(0,e.hex2rgb)(t,this._backgroundColorRgba)},Object.defineProperties(n.prototype,a),n}(e.EventEmitter);exports.AbstractRenderer=Ee;var Te=function(i){function n(s){void 0===s&&(s={}),i.call(this,"WebGL",s),s=this.options,this.type=r.RENDERER_TYPE.WEBGL,this.gl=null,this.CONTEXT_UID=0,this.runners={destroy:new t.Runner("destroy"),contextChange:new t.Runner("contextChange",1),reset:new t.Runner("reset"),update:new t.Runner("update"),postrender:new t.Runner("postrender"),prerender:new t.Runner("prerender"),resize:new t.Runner("resize",2)},this.globalUniforms=new K({projectionMatrix:new o.Matrix},!0),this.addSystem(Jt,"mask").addSystem(tt,"context").addSystem(ve,"state").addSystem(he,"shader").addSystem(ye,"texture").addSystem(nt,"geometry").addSystem(et,"framebuffer").addSystem(ee,"scissor").addSystem(re,"stencil").addSystem(ie,"projection").addSystem(_e,"textureGC").addSystem(Z,"filter").addSystem(oe,"renderTexture").addSystem($,"batch"),this.initPlugins(n.__plugins),s.context?this.context.initFromContext(s.context):this.context.initFromOptions({alpha:this.transparent,antialias:s.antialias,premultipliedAlpha:this.transparent&&"notMultiplied"!==this.transparent,stencil:!0,preserveDrawingBuffer:s.preserveDrawingBuffer,powerPreference:this.options.powerPreference}),this.renderingToScreen=!0,(0,e.sayHello)(2===this.context.webGLVersion?"WebGL 2":"WebGL 1"),this.resize(this.options.width,this.options.height)}return i&&(n.__proto__=i),n.prototype=Object.create(i&&i.prototype),n.prototype.constructor=n,n.create=function(t){if((0,e.isWebGLSupported)())return new n(t);throw new Error('WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.')},n.prototype.addSystem=function(t,e){e||(e=t.name);var r=new t(this);if(this[e])throw new Error('Whoops! The name "'+e+'" is already in use');for(var i in this[e]=r,this.runners)this.runners[i].add(r);return this},n.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.runners.prerender.run(),this.emit("prerender"),this.projection.transform=i,!this.context.isLost){if(e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.renderTexture.bind(e),this.batch.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this.renderTexture.clear(),t.render(this),this.batch.currentRenderer.flush(),e&&e.baseTexture.update(),this.runners.postrender.run(),this.projection.transform=null,this.emit("postrender")}},n.prototype.resize=function(t,e){i.prototype.resize.call(this,t,e),this.runners.resize.run(t,e)},n.prototype.reset=function(){return this.runners.reset.run(),this},n.prototype.clear=function(){this.framebuffer.bind(),this.framebuffer.clear()},n.prototype.destroy=function(t){for(var e in this.runners.destroy.run(),this.runners)this.runners[e].destroy();i.prototype.destroy.call(this,t),this.gl=null},n.registerPlugin=function(t,e){n.__plugins=n.__plugins||{},n.__plugins[t]=e},n}(Ee);function be(t){return Te.create(t)}exports.Renderer=Te;var Se="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}";exports.defaultVertex=Se;var we="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n";exports.defaultFilterVertex=we;var Ae=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.from=function(t,r){return new e(new y(t,r))},e}(v);exports.CubeTexture=Ae;var Ce=function(){this.texArray=null,this.blend=0,this.type=r.DRAW_MODES.TRIANGLES,this.start=0,this.size=0,this.data=null};exports.BatchDrawCall=Ce;var Re=function(){this.elements=[],this.ids=[],this.count=0};exports.BatchTextureArray=Re,Re.prototype.clear=function(){for(var t=0;tthis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)},n.prototype.buildTexturesAndDrawCalls=function(){var t=this._bufferedTextures,e=this.MAX_TEXTURES,r=n._textureArrayPool,i=this.renderer.batch,o=this._tempBoundTextures,s=this.renderer.textureGC.count,a=++v._globalBatch,h=0,u=r[0],l=0;i.copyBoundTextures(o,e);for(var c=0;c=e&&(i.boundArray(u,o,a,e),this.buildDrawCalls(u,l,c),l=c,u=r[++h],++a),d._batchEnabled=a,d.touched=s,u.elements[u.count++]=d)}u.count>0&&(i.boundArray(u,o,a,e),this.buildDrawCalls(u,l,this._bufferSize),++h,++a);for(var p=0;p0&&(e+="\nelse "),r=0;p--){var u=c[p],l=this.recursiveFindHit(t,u,i,n,a);if(l){if(!u.parent)continue;a=!1,l&&(t.target&&(n=!1),s=!0)}}return o&&(n&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(r)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),i&&i(t,e,!!s))),s},c.prototype.findHit=function(t,e,i,n){this.recursiveFindHit(t,e,i,n,!1)};var p={interactive:!1,interactiveChildren:!0,hitArea:null,get buttonMode(){return"pointer"===this.cursor},set buttonMode(t){t?this.cursor="pointer":"pointer"===this.cursor&&(this.cursor=null)},cursor:null,get trackedPointers(){return void 0===this._trackedPointers&&(this._trackedPointers={}),this._trackedPointers},_trackedPointers:void 0};exports.interactiveTarget=p,i.DisplayObject.mixin(p);var u=1,l={target:null,data:{global:null}},v=function(t){function i(e,i){t.call(this),i=i||{},this.renderer=e,this.autoPreventDefault=void 0===i.autoPreventDefault||i.autoPreventDefault,this.interactionFrequency=i.interactionFrequency||10,this.mouse=new o,this.mouse.identifier=u,this.mouse.global.set(-999999),this.activeInteractionData={},this.activeInteractionData[u]=this.mouse,this.interactionDataPool=[],this.eventData=new s,this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.mouseOverRenderer=!1,this.supportsTouchEvents="ontouchstart"in window,this.supportsPointerEvents=!!window.PointerEvent,this.onPointerUp=this.onPointerUp.bind(this),this.processPointerUp=this.processPointerUp.bind(this),this.onPointerCancel=this.onPointerCancel.bind(this),this.processPointerCancel=this.processPointerCancel.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.processPointerDown=this.processPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.processPointerMove=this.processPointerMove.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.processPointerOverOut=this.processPointerOverOut.bind(this),this.onPointerOver=this.onPointerOver.bind(this),this.cursorStyles={default:"inherit",pointer:"pointer"},this.currentCursorMode=null,this.cursor=null,this.resolution=1,this.delayedEvents=[],this.search=new c,this.setTargetElement(this.renderer.view,this.renderer.resolution)}return t&&(i.__proto__=t),i.prototype=Object.create(t&&t.prototype),i.prototype.constructor=i,i.prototype.hitTest=function(t,e){return l.target=null,l.data.global=t,e||(e=this.renderer._lastObjectRendered),this.processInteractive(l,e,null,!0),l.target},i.prototype.setTargetElement=function(t,e){void 0===e&&(e=1),this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents()},i.prototype.addEvents=function(){this.interactionDOMElement&&(e.Ticker.system.add(this.update,this,e.UPDATE_PRIORITY.INTERACTION),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]="none"),this.supportsPointerEvents?(window.document.addEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("pointerover",this.onPointerOver,!0),window.addEventListener("pointercancel",this.onPointerCancel,!0),window.addEventListener("pointerup",this.onPointerUp,!0)):(window.document.addEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.addEventListener("mouseover",this.onPointerOver,!0),window.addEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.addEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.addEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.addEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.addEventListener("touchmove",this.onPointerMove,!0)),this.eventsAdded=!0)},i.prototype.removeEvents=function(){this.interactionDOMElement&&(e.Ticker.system.remove(this.update,this),window.navigator.msPointerEnabled?(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""):this.supportsPointerEvents&&(this.interactionDOMElement.style["touch-action"]=""),this.supportsPointerEvents?(window.document.removeEventListener("pointermove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("pointerleave",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("pointerover",this.onPointerOver,!0),window.removeEventListener("pointercancel",this.onPointerCancel,!0),window.removeEventListener("pointerup",this.onPointerUp,!0)):(window.document.removeEventListener("mousemove",this.onPointerMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onPointerOut,!0),this.interactionDOMElement.removeEventListener("mouseover",this.onPointerOver,!0),window.removeEventListener("mouseup",this.onPointerUp,!0)),this.supportsTouchEvents&&(this.interactionDOMElement.removeEventListener("touchstart",this.onPointerDown,!0),this.interactionDOMElement.removeEventListener("touchcancel",this.onPointerCancel,!0),this.interactionDOMElement.removeEventListener("touchend",this.onPointerUp,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onPointerMove,!0)),this.interactionDOMElement=null,this.eventsAdded=!1)},i.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTimethis.maxSegments&&(i=this.maxSegments),i}};exports.GRAPHICS_CURVES=n;var h=function(){this.reset()};exports.FillStyle=h,h.prototype.clone=function(){var t=new h;return t.color=this.color,t.alpha=this.alpha,t.texture=this.texture,t.matrix=this.matrix,t.visible=this.visible,t},h.prototype.reset=function(){this.color=16777215,this.alpha=1,this.texture=t.Texture.WHITE,this.matrix=null,this.visible=!1},h.prototype.destroy=function(){this.texture=null,this.matrix=null};var a={build:function(t){t.points=t.shape.points.slice()},triangulate:function(t,e){var r=t.points,s=t.holes,n=e.points,h=e.indices;if(r.length>=6){for(var a=[],o=0;o196*v*v?(A=P-D,C=M-T,A/=E=Math.sqrt(A*A+C*C),C/=E,A*=v,C*=v,d.push(m-A*B,S-C*B),d.push(m+A*R,S+C*R),d.push(m-A*R*B,S-C*B),y++):(d.push(m+(j-m)*B,S+(k-S)*B),d.push(m-(j-m)*R,S-(k-S)*R))}}b=s[2*(f-2)],x=s[2*(f-2)+1],m=s[2*(f-1)],P=-(x-(S=s[2*(f-1)+1])),M=b-m,P/=E=Math.sqrt(P*P+M*M),M/=E,P*=v,M*=v,d.push(m-P*B,S-M*B),d.push(m+P*R,S+M*R);for(var N=i.indices,W=0;Wh?l:h,a=(u=r[p+1])o?u:o;r.push(n,a,h,a,h,o,n,o);for(var c=r.length/2,d=0;du*a}},x.arc=function(t,i,r,s,h,a,o,l,u){for(var p=o-a,c=n._segmentsCount(Math.abs(p)*h,40*Math.ceil(Math.abs(p)/e.PI_2)),d=p/(2*c),f=2*d,y=Math.cos(d),g=Math.sin(d),v=c-1,b=v%1/v,x=0;x<=v;++x){var m=d+a+f*(x+b*x),S=Math.cos(m),_=-Math.sin(m);u.push((y*S+g*_)*h+r,(y*-_+g*S)*h+s)}};var m=function(){};m.curveLength=function(t,e,i,r,s,n,h,a){for(var o=0,l=0,u=0,p=0,c=0,d=0,f=0,y=0,g=0,v=0,b=0,x=t,m=e,S=1;S<=10;++S)v=x-(y=(f=(d=(c=1-(l=S/10))*c)*c)*t+3*d*l*i+3*c*(u=l*l)*s+(p=u*l)*h),b=m-(g=f*e+3*d*l*r+3*c*u*n+p*a),x=y,m=g,o+=Math.sqrt(v*v+b*b);return o},m.curveTo=function(t,e,i,r,s,h,a){var o=a[a.length-2],l=a[a.length-1];a.length-=2;var u=n._segmentsCount(m.curveLength(o,l,t,e,i,r,s,h)),p=0,c=0,d=0,f=0,y=0;a.push(o,l);for(var g=1,v=0;g<=u;++g)d=(c=(p=1-(v=g/u))*p)*p,y=(f=v*v)*v,a.push(d*o+3*c*v*t+3*p*f*i+y*s,d*l+3*c*v*e+3*p*f*r+y*h)};var S=function(){};S.curveLength=function(t,e,i,r,s,n){var h=t-2*i+s,a=e-2*r+n,o=2*i-2*t,l=2*r-2*e,u=4*(h*h+a*a),p=4*(h*o+a*l),c=o*o+l*l,d=2*Math.sqrt(u+p+c),f=Math.sqrt(u),y=2*u*f,g=2*Math.sqrt(c),v=p/f;return(y*d+f*p*(d-g)+(4*c*u-p*p)*Math.log((2*f+v+d)/(v+g)))/(4*y)},S.curveTo=function(t,e,i,r,s){for(var h=s[s.length-2],a=s[s.length-1],o=n._segmentsCount(S.curveLength(h,a,t,e,i,r)),l=0,u=0,p=1;p<=o;++p){var c=p/o;l=h+(t-h)*c,u=a+(e-a)*c,s.push(l+(t+(i-t)*c-l)*c,u+(e+(r-e)*c-u)*c)}};var _=function(){this.reset()};_.prototype.begin=function(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i},_.prototype.end=function(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start},_.prototype.reset=function(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0};var w={};w[e.SHAPES.POLY]=a,w[e.SHAPES.CIRC]=o,w[e.SHAPES.ELIP]=o,w[e.SHAPES.RECT]=l,w[e.SHAPES.RREC]=u;var P=[],M=[],D={buildPoly:a,buildCircle:o,buildRectangle:l,buildRoundedRectangle:u,FILL_COMMANDS:w,BATCH_POOL:P,DRAW_CALL_POOL:M,buildLine:d,buildComplexPoly:g,bezierCurveTo:v,Star:b,ArcUtils:x,BezierUtils:m,QuadraticUtils:S,BatchPart:_};exports.graphicsUtils=D;var T=function(t,e,i,r){void 0===e&&(e=null),void 0===i&&(i=null),void 0===r&&(r=null),this.shape=t,this.lineStyle=i,this.fillStyle=e,this.matrix=r,this.type=t.type,this.points=[],this.holes=[]};exports.GraphicsData=T,T.prototype.clone=function(){return new T(this.shape,this.fillStyle,this.lineStyle,this.matrix)},T.prototype.destroy=function(){this.shape=null,this.holes.length=0,this.holes=null,this.points.length=0,this.points=null,this.lineStyle=null,this.fillStyle=null};var A=new e.Point,C=new s.Bounds,E=function(n){function h(){n.call(this),this.points=[],this.colors=[],this.uvs=[],this.indices=[],this.textureIds=[],this.graphicsData=[],this.dirty=0,this.batchDirty=-1,this.cacheDirty=-1,this.clearDirty=0,this.drawCalls=[],this.batches=[],this.shapeIndex=0,this._bounds=new s.Bounds,this.boundsDirty=-1,this.boundsPadding=0,this.batchable=!1,this.indicesUint16=null,this.uvsFloat32=null,this.closePointEps=1e-4}n&&(h.__proto__=n),h.prototype=Object.create(n&&n.prototype),h.prototype.constructor=h;var o={bounds:{configurable:!0}};return o.bounds.get=function(){return this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.calculateBounds()),this._bounds},h.prototype.invalidate=function(){this.boundsDirty=-1,this.dirty++,this.batchDirty++,this.shapeIndex=0,this.points.length=0,this.colors.length=0,this.uvs.length=0,this.indices.length=0,this.textureIds.length=0;for(var t=0;t0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this},h.prototype.drawShape=function(t,e,i,r){var s=new T(t,e,i,r);return this.graphicsData.push(s),this.dirty++,this},h.prototype.drawHole=function(t,e){if(!this.graphicsData.length)return null;var i=new T(t,null,null,e),r=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=r.lineStyle,r.holes.push(i),this.dirty++,this},h.prototype.destroy=function(t){n.prototype.destroy.call(this,t);for(var e=0;e0&&(s=(i=this.batches[this.batches.length-1]).style);for(var n=this.shapeIndex;n0&&(i=null)),i||((i=P.pop()||new _).begin(u,c,d),this.batches.push(i),s=u);var f=this.points.length/2;0===l?this.processFill(h):this.processLine(h);var y=this.points.length/2-f;this.addUvs(this.points,t,u.texture,f,y,u.matrix)}}}if(i){var g=this.indices.length,v=this.points.length/2;i.end(g,v),this.indicesUint16=new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}else this.batchable=!0}}else this.batchable=!0},h.prototype._compareStyles=function(t,e){return!(!t||!e)&&(t.texture.baseTexture===e.texture.baseTexture&&(t.color+t.alpha===e.color+e.alpha&&!!t.native==!!e.native))},h.prototype.validateBatching=function(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(var t=0,e=this.graphicsData.length;t0&&((h=M.pop())||((h=new t.BatchDrawCall).textures=new t.BatchTextureArray),this.drawCalls.push(h)),h.start=c,h.size=0,h.textures.count=0,h.type=p),g.touched=1,g._batchEnabled=e,g._batchLocation=a,g.wrapMode=10497,h.textures.elements[h.textures.count++]=g,a++)),h.size+=f.size,c+=f.size,l=g._batchLocation,this.addColors(s,y.color,y.alpha,f.attribSize),this.addTextureIds(n,l,f.attribSize)}t.BaseTexture._globalBatch=e,this.packAttributes()},h.prototype.packAttributes=function(){for(var t=this.points,e=this.uvs,i=this.colors,r=this.textureIds,s=new ArrayBuffer(3*t.length*4),n=new Float32Array(s),h=new Uint32Array(s),a=0,o=0;o>16)+(65280&e)+((255&e)<<16),h=(0,i.premultiplyTint)(n,r);s-- >0;)t.push(h)},h.prototype.addTextureIds=function(t,e,i){for(;i-- >0;)t.push(e)},h.prototype.addUvs=function(t,e,i,r,s,n){for(var h=0,a=e.length,o=i.frame;h0&&e.alpha>0;return u?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._lineStyle,{visible:u},e)):this._lineStyle.reset(),this},n.prototype.startPoly=function(){if(this.currentPath){var t=this.currentPath.points,i=this.currentPath.points.length;i>2&&(this.drawShape(this.currentPath),this.currentPath=new e.Polygon,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[i-2],t[i-1]))}else this.currentPath=new e.Polygon,this.currentPath.closeStroke=!1},n.prototype.finishPoly=function(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)},n.prototype.moveTo=function(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this},n.prototype.lineTo=function(t,e){this.currentPath||this.moveTo(0,0);var i=this.currentPath.points,r=i[i.length-2],s=i[i.length-1];return r===t&&s===e||i.push(t,e),this},n.prototype._initCurve=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.currentPath?0===this.currentPath.points.length&&(this.currentPath.points=[t,e]):this.moveTo(t,e)},n.prototype.quadraticCurveTo=function(t,e,i,r){this._initCurve();var s=this.currentPath.points;return 0===s.length&&this.moveTo(0,0),S.curveTo(t,e,i,r,s),this},n.prototype.bezierCurveTo=function(t,e,i,r,s,n){return this._initCurve(),m.curveTo(t,e,i,r,s,n,this.currentPath.points),this},n.prototype.arcTo=function(t,e,i,r,s){this._initCurve(t,e);var n=this.currentPath.points,h=x.curveTo(t,e,i,r,s,n);if(h){var a=h.cx,o=h.cy,l=h.radius,u=h.startAngle,p=h.endAngle,c=h.anticlockwise;this.arc(a,o,l,u,p,c)}return this},n.prototype.arc=function(t,i,r,s,n,h){if(void 0===h&&(h=!1),s===n)return this;if(!h&&n<=s?n+=e.PI_2:h&&s<=n&&(s+=e.PI_2),0===n-s)return this;var a=t+Math.cos(s)*r,o=i+Math.sin(s)*r,l=this.geometry.closePointEps,u=this.currentPath?this.currentPath.points:null;if(u){var p=Math.abs(u[u.length-2]-a),c=Math.abs(u[u.length-1]-o);p0;return a?(e.matrix&&(e.matrix=e.matrix.clone(),e.matrix.invert()),Object.assign(this._fillStyle,{visible:a},e)):this._fillStyle.reset(),this},n.prototype.endFill=function(){return this.finishPoly(),this._fillStyle.reset(),this},n.prototype.drawRect=function(t,i,r,s){return this.drawShape(new e.Rectangle(t,i,r,s))},n.prototype.drawRoundedRect=function(t,i,r,s,n){return this.drawShape(new e.RoundedRectangle(t,i,r,s,n))},n.prototype.drawCircle=function(t,i,r){return this.drawShape(new e.Circle(t,i,r))},n.prototype.drawEllipse=function(t,i,r,s){return this.drawShape(new e.Ellipse(t,i,r,s))},n.prototype.drawPolygon=function(t){var i=arguments,r=t,s=!0;if(r.points&&(s=r.closeStroke,r=r.points),!Array.isArray(r)){r=new Array(arguments.length);for(var n=0;n>16&255)/255*s,n.tint[1]=(r>>8&255)/255*s,n.tint[2]=(255&r)/255*s,n.tint[3]=s,t.shader.bind(e),t.geometry.bind(i,e),t.state.set(this.state);for(var a=0,o=h.length;a>16)+(65280&n)+((255&n)<<16)}}},n.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID){this._transformID=this.transform._worldID;for(var t=this.transform.worldTransform,e=t.a,i=t.b,r=t.c,s=t.d,n=t.tx,h=t.ty,a=this.geometry.points,o=this.vertexData,l=0,u=0;u=r&&n.x=s&&n.y>16)+(65280&t)+((255&t)<<16)},a.texture.get=function(){return this._texture},a.texture.set=function(t){this._texture!==t&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=t||i.Texture.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.valid?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))},Object.defineProperties(u.prototype,a),u}(s.Container);exports.Sprite=u; },{"@pixi/math":"oNQC","@pixi/utils":"G5Tu","@pixi/core":"p2j5","@pixi/constants":"LQBK","@pixi/display":"nL3p","@pixi/settings":"t4Uo"}],"T62s":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextStyle=exports.TextMetrics=exports.Text=exports.TEXT_GRADIENT=void 0;var t=require("@pixi/sprite"),e=require("@pixi/core"),i=require("@pixi/settings"),n=require("@pixi/math"),r=require("@pixi/utils"),o={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1};exports.TEXT_GRADIENT=o;var s={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:o.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100,leading:0},a=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],h=function(t){this.styleID=0,this.reset(),u(this,t,t)};exports.TextStyle=h;var l={align:{configurable:!0},breakWords:{configurable:!0},dropShadow:{configurable:!0},dropShadowAlpha:{configurable:!0},dropShadowAngle:{configurable:!0},dropShadowBlur:{configurable:!0},dropShadowColor:{configurable:!0},dropShadowDistance:{configurable:!0},fill:{configurable:!0},fillGradientType:{configurable:!0},fillGradientStops:{configurable:!0},fontFamily:{configurable:!0},fontSize:{configurable:!0},fontStyle:{configurable:!0},fontVariant:{configurable:!0},fontWeight:{configurable:!0},letterSpacing:{configurable:!0},lineHeight:{configurable:!0},leading:{configurable:!0},lineJoin:{configurable:!0},miterLimit:{configurable:!0},padding:{configurable:!0},stroke:{configurable:!0},strokeThickness:{configurable:!0},textBaseline:{configurable:!0},trim:{configurable:!0},whiteSpace:{configurable:!0},wordWrap:{configurable:!0},wordWrapWidth:{configurable:!0}};function f(t){return"number"==typeof t?(0,r.hex2string)(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function d(t){if(Array.isArray(t)){for(var e=0;e=0;i--){var n=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&a.indexOf(n)<0&&(n='"'+n+'"'),e[i]=n}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},Object.defineProperties(h.prototype,l);var g=function(t,e,i,n,r,o,s,a,h){this.text=t,this.style=e,this.width=i,this.height=n,this.lines=r,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=h};exports.TextMetrics=g,g.measureText=function(t,e,i,n){void 0===n&&(n=g._canvas),i=null==i?e.wordWrap:i;var r=e.toFontString(),o=g.measureFont(r);0===o.fontSize&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);var s=n.getContext("2d");s.font=r;for(var a=(i?g.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),h=new Array(a.length),l=0,f=0;fu)if(""!==o&&(s+=g.addLine(o),o="",r=0),g.canBreakWords(S,e.breakWords))for(var v=S.split(""),m=0;mu&&(s+=g.addLine(o),c=!1,o="",r=0),o+=b,r+=D}else{o.length>0&&(s+=g.addLine(o),o="",r=0);var W=_===p.length-1;s+=g.addLine(S,!W),c=!1,o="",r=0}else x+r>u&&(c=!1,s+=g.addLine(o),o="",r=0),(o.length>0||!g.isBreakingSpace(S)||c)&&(o+=S,r+=x)}return s+=g.addLine(o,!1)},g.addLine=function(t,e){return void 0===e&&(e=!0),t=g.trimRight(t),t=e?t+"\n":t},g.getFromCache=function(t,e,i,n){var r=i[t];if(void 0===r){var o=t.length*e;r=n.measureText(t).width+o,i[t]=r}return r},g.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},g.collapseNewlines=function(t){return"normal"===t},g.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;e>=0;e--){var i=t[e];if(!g.isBreakingSpace(i))break;t=t.slice(0,-1)}return t},g.isNewline=function(t){return"string"==typeof t&&g._newlines.indexOf(t.charCodeAt(0))>=0},g.isBreakingSpace=function(t){return"string"==typeof t&&g._breakingSpaces.indexOf(t.charCodeAt(0))>=0},g.tokenize=function(t){var e=[],i="";if("string"!=typeof t)return e;for(var n=0;ns;--d){for(var _=0;_0};var u=function(t){var i=this;this.limiter=new n(e.settings.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){i.queue&&i.prepareItems()},this.registerFindHook(d),this.registerFindHook(f),this.registerFindHook(a),this.registerFindHook(h),this.registerFindHook(p),this.registerUploadHook(l),this.registerUploadHook(c)};function a(e,i){var r=!1;if(e&&e._textures&&e._textures.length)for(var s=0;s=0;r--)this.add(e.children[r]);return this},u.prototype.destroy=function(){this.ticking&&r.Ticker.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null};var x=function(e){function t(t){e.call(this,t),this.uploadHookHelper=this.renderer,this.registerFindHook(g),this.registerUploadHook(k),this.registerUploadHook(m)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(u);function k(e,i){return i instanceof t.BaseTexture&&(i._glTextures[e.CONTEXT_UID]||e.texture.bind(i),!0)}function m(e,t){if(!(t instanceof i.Graphics))return!1;var r=t.geometry;t.finishPoly(),r.updateBatches();for(var s=r.batches,o=0;o0||t.responseType===r.XHR_RESPONSE_TYPE.BUFFER)?i=f:i===T&&(i=p),(i/100|0)===O){if(this.xhrType===r.XHR_RESPONSE_TYPE.TEXT)this.data=e,this.type=r.TYPE.TEXT;else if(this.xhrType===r.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(e),this.type=r.TYPE.JSON}catch(o){return void this.abort("Error trying to parse loaded json: "+o)}else if(this.xhrType===r.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var s=new DOMParser;this.data=s.parseFromString(e,"text/xml")}else{var n=document.createElement("div");n.innerHTML=e,this.data=n}this.type=r.TYPE.XML}catch(o){return void this.abort("Error trying to parse loaded xml: "+o)}else this.data=t.response||e;this.complete()}else this.abort("["+t.status+"] "+t.statusText+": "+t.responseURL)},i._determineCrossOrigin=function(e,r){if(0===e.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";r=r||window.location,_||(_=document.createElement("a")),_.href=e;var i=!(e=(0,t.default)(_.href,{strictMode:!0})).port&&""===r.port||e.port===r.port,s=e.protocol?e.protocol+":":"";return e.host===r.hostname&&i&&s===r.protocol?"":"anonymous"},i._determineXhrType=function(){return r._xhrTypeMap[this.extension]||r.XHR_RESPONSE_TYPE.TEXT},i._determineLoadType=function(){return r._loadTypeMap[this.extension]||r.LOAD_TYPE.XHR},i._getExtension=function(){var t=this.url,e="";if(this.isDataUrl){var r=t.indexOf("/");e=t.substring(r+1,t.indexOf(";",r))}else{var i=t.indexOf("?"),s=t.indexOf("#"),n=Math.min(i>-1?i:t.length,s>-1?s:t.length);e=(t=t.substring(0,n)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},i._getMimeFromXhrType=function(t){switch(t){case r.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case r.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case r.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case r.XHR_RESPONSE_TYPE.JSON:return"application/json";case r.XHR_RESPONSE_TYPE.DEFAULT:case r.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},l(r,[{key:"isDataUrl",get:function(){return this._hasFlag(r.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(r.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(r.STATUS_FLAGS.LOADING)}}]),r}();function P(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function S(t){return t.toString().replace("object ","")}exports.Resource=m,m.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},m.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},m.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},m.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},m._loadTypeMap={gif:m.LOAD_TYPE.IMAGE,png:m.LOAD_TYPE.IMAGE,bmp:m.LOAD_TYPE.IMAGE,jpg:m.LOAD_TYPE.IMAGE,jpeg:m.LOAD_TYPE.IMAGE,tif:m.LOAD_TYPE.IMAGE,tiff:m.LOAD_TYPE.IMAGE,webp:m.LOAD_TYPE.IMAGE,tga:m.LOAD_TYPE.IMAGE,svg:m.LOAD_TYPE.IMAGE,"svg+xml":m.LOAD_TYPE.IMAGE,mp3:m.LOAD_TYPE.AUDIO,ogg:m.LOAD_TYPE.AUDIO,wav:m.LOAD_TYPE.AUDIO,mp4:m.LOAD_TYPE.VIDEO,webm:m.LOAD_TYPE.VIDEO},m._xhrTypeMap={xhtml:m.XHR_RESPONSE_TYPE.DOCUMENT,html:m.XHR_RESPONSE_TYPE.DOCUMENT,htm:m.XHR_RESPONSE_TYPE.DOCUMENT,xml:m.XHR_RESPONSE_TYPE.DOCUMENT,tmx:m.XHR_RESPONSE_TYPE.DOCUMENT,svg:m.XHR_RESPONSE_TYPE.DOCUMENT,tsx:m.XHR_RESPONSE_TYPE.DOCUMENT,gif:m.XHR_RESPONSE_TYPE.BLOB,png:m.XHR_RESPONSE_TYPE.BLOB,bmp:m.XHR_RESPONSE_TYPE.BLOB,jpg:m.XHR_RESPONSE_TYPE.BLOB,jpeg:m.XHR_RESPONSE_TYPE.BLOB,tif:m.XHR_RESPONSE_TYPE.BLOB,tiff:m.XHR_RESPONSE_TYPE.BLOB,webp:m.XHR_RESPONSE_TYPE.BLOB,tga:m.XHR_RESPONSE_TYPE.BLOB,json:m.XHR_RESPONSE_TYPE.JSON,text:m.XHR_RESPONSE_TYPE.TEXT,txt:m.XHR_RESPONSE_TYPE.TEXT,ttf:m.XHR_RESPONSE_TYPE.BUFFER,otf:m.XHR_RESPONSE_TYPE.BUFFER},m.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function b(t){for(var e="",r=0;r>2,s[1]=(3&i[0])<<4|i[1]>>4,s[2]=(15&i[1])<<2|i[2]>>6,s[3]=63&i[2],r-(t.length-1)){case 2:s[3]=64,s[2]=64;break;case 1:s[3]=64}for(var o=0;o16384&&(o=16384),this._properties=[!1,!0,!1,!1,!1],this._maxSize=e,this._batchSize=o,this._buffers=null,this._bufferUpdateIDs=[],this._updateID=0,this.interactiveChildren=!1,this.blendMode=t.BLEND_MODES.NORMAL,this.autoResize=s,this.roundPixels=!0,this.baseTexture=null,this.setProperties(r),this._tint=0,this.tintRgb=new Float32Array(4),this.tint=16777215}i&&(r.__proto__=i),r.prototype=Object.create(i&&i.prototype),r.prototype.constructor=r;var o={tint:{configurable:!0}};return r.prototype.setProperties=function(t){t&&(this._properties[0]="vertices"in t||"scale"in t?!!t.vertices||!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="tint"in t||"alpha"in t?!!t.tint||!!t.alpha:this._properties[4])},r.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},o.tint.get=function(){return this._tint},o.tint.set=function(t){this._tint=t,(0,e.hex2rgb)(t,this.tintRgb)},r.prototype.render=function(t){var e=this;this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.valid||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.batch.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},r.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.lengthr&&!t.autoResize&&(a=r);var n=t._buffers;n||(n=t._buffers=this.generateBuffers(t));var h=i[0]._texture.baseTexture;this.renderer.state.setBlendMode((0,e.correctBlendMode)(t.blendMode,h.alphaMode));var u=s.gl,p=t.worldTransform.copyTo(this.tempMatrix);p.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=p.toArray(!0),this.shader.uniforms.uColor=(0,e.premultiplyRgba)(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,h.alphaMode),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);for(var d=!1,l=0,c=0;lo&&(f=o),c>=n.length&&n.push(this._generateOneMoreBuffer(t));var y=n[c];y.uploadDynamic(i,l,f);var v=t._bufferUpdateIDs[c]||0;(d=d||y._updateID0,p=h.alpha,d=p<1&&u?(0,e.premultiplyTint)(h._tintRGB,p):h._tintRGB+(255*p<<24);o[a]=d,o[a+s]=d,o[a+2*s]=d,o[a+3*s]=d,a+=4*s}},s.prototype.destroy=function(){i.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null},s}(r.ObjectRenderer);exports.ParticleRenderer=u; },{"@pixi/constants":"LQBK","@pixi/utils":"G5Tu","@pixi/display":"nL3p","@pixi/core":"p2j5","@pixi/math":"oNQC"}],"LQzI":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SpritesheetLoader=exports.Spritesheet=void 0;var e=require("@pixi/math"),t=require("@pixi/core"),s=require("@pixi/utils"),r=require("@pixi/loaders"),i=function(e,t,s){void 0===s&&(s=null),this.baseTexture=e,this.textures={},this.animations={},this.data=t,this.resolution=this._updateResolution(s||(this.baseTexture.resource?this.baseTexture.resource.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null};exports.Spritesheet=i;var o={BATCH_SIZE:{configurable:!0}};o.BATCH_SIZE.get=function(){return 1e3},i.prototype._updateResolution=function(e){var t=this.data.meta.scale,r=(0,s.getResolutionOfUrl)(e,null);return null===r&&(r=void 0!==t?parseFloat(t):1),1!==r&&this.baseTexture.setResolution(r),r},i.prototype.parse=function(e){this._batchIndex=0,this._callback=e,this._frameKeys.length<=i.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},i.prototype._processFrames=function(s){for(var r=s,o=i.BATCH_SIZE;r-s=i&&n.x=o&&n.y0&&n.x>l&&(++_,(0,a.removeItems)(o,1+d-_,1+b-d),b=d,d=-1,h.push(m),p=Math.max(p,m),x++,n.x=0,n.y+=t.lineHeight,f=null))}else h.push(c),p=Math.max(p,c),++x,++_,n.x=0,n.y+=t.lineHeight,f=null}var O=g.charAt(g.length-1);"\r"!==O&&"\n"!==O&&(/(?:\s)/.test(O)&&(c=m),h.push(c),p=Math.max(p,c));for(var E=[],I=0;I<=x;I++){var H=0;"right"===this._font.align?H=p-h[I]:"center"===this._font.align&&(H=(p-h[I])/2),E.push(H)}for(var L=o.length,B=this.tint,S=0;S=0?t:16777215,this.dirty=!0},o.align.get=function(){return this._font.align},o.align.set=function(t){this._font.align=t||"left",this.dirty=!0},o.anchor.get=function(){return this._anchor},o.anchor.set=function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copyFrom(t)},o.font.get=function(){return this._font},o.font.set=function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):s.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)},o.text.get=function(){return this._text},o.text.set=function(t){t=String(null==t?"":t),this._text!==t&&(this._text=t,this.dirty=!0)},o.maxWidth.get=function(){return this._maxWidth},o.maxWidth.set=function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)},o.maxLineHeight.get=function(){return this.validate(),this._maxLineHeight},o.textWidth.get=function(){return this.validate(),this._textWidth},o.letterSpacing.get=function(){return this._letterSpacing},o.letterSpacing.set=function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)},o.textHeight.get=function(){return this.validate(),this._textHeight},s.registerFont=function(e,r){var o={},h=e.getElementsByTagName("info")[0],g=e.getElementsByTagName("common")[0],u=e.getElementsByTagName("page"),l=(0,a.getResolutionOfUrl)(u[0].getAttribute("file"),n.settings.RESOLUTION),f={};o.font=h.getAttribute("face"),o.size=parseInt(h.getAttribute("size"),10),o.lineHeight=parseInt(g.getAttribute("lineHeight"),10)/l,o.chars={},r instanceof t.Texture&&(r=[r]);for(var c=0;c=i&&(e=t-o-1),u+=a=a.replace("%value%",r[e]),u+="\n"}return s=(s=s.replace("%blur%",u)).replace("%size%",t)}var u=function(t){function r(r,n,l,u,o){var a=i(o=o||5,r),h=s(o);t.call(this,a,h),this.horizontal=r,this.resolution=u||e.settings.RESOLUTION,this._quality=0,this.quality=l||4,this.blur=n||8}t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r;var n={blur:{configurable:!0},quality:{configurable:!0}};return r.prototype.apply=function(t,e,r,i){if(r?this.horizontal?this.uniforms.strength=1/r.width*(r.width/e.width):this.uniforms.strength=1/r.height*(r.height/e.height):this.horizontal?this.uniforms.strength=1/t.renderer.width*(t.renderer.width/e.width):this.uniforms.strength=1/t.renderer.height*(t.renderer.height/e.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{var n=t.getFilterTexture(),l=t.renderer,s=e,u=n;this.state.blend=!1,t.applyFilter(this,s,u,!1);for(var o=1;o 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n",o=function(o){function n(){var n={m:new Float32Array([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]),uAlpha:1};o.call(this,t.defaultFilterVertex,r,n),this.alpha=1}o&&(n.__proto__=o),n.prototype=Object.create(o&&o.prototype),n.prototype.constructor=n;var e={matrix:{configurable:!0},alpha:{configurable:!0}};return n.prototype._loadMatrix=function(t,r){void 0===r&&(r=!1);var o=t;r&&(this._multiply(o,this.uniforms.m,t),o=this._colorMatrix(o)),this.uniforms.m=o},n.prototype._multiply=function(t,r,o){return t[0]=r[0]*o[0]+r[1]*o[5]+r[2]*o[10]+r[3]*o[15],t[1]=r[0]*o[1]+r[1]*o[6]+r[2]*o[11]+r[3]*o[16],t[2]=r[0]*o[2]+r[1]*o[7]+r[2]*o[12]+r[3]*o[17],t[3]=r[0]*o[3]+r[1]*o[8]+r[2]*o[13]+r[3]*o[18],t[4]=r[0]*o[4]+r[1]*o[9]+r[2]*o[14]+r[3]*o[19]+r[4],t[5]=r[5]*o[0]+r[6]*o[5]+r[7]*o[10]+r[8]*o[15],t[6]=r[5]*o[1]+r[6]*o[6]+r[7]*o[11]+r[8]*o[16],t[7]=r[5]*o[2]+r[6]*o[7]+r[7]*o[12]+r[8]*o[17],t[8]=r[5]*o[3]+r[6]*o[8]+r[7]*o[13]+r[8]*o[18],t[9]=r[5]*o[4]+r[6]*o[9]+r[7]*o[14]+r[8]*o[19]+r[9],t[10]=r[10]*o[0]+r[11]*o[5]+r[12]*o[10]+r[13]*o[15],t[11]=r[10]*o[1]+r[11]*o[6]+r[12]*o[11]+r[13]*o[16],t[12]=r[10]*o[2]+r[11]*o[7]+r[12]*o[12]+r[13]*o[17],t[13]=r[10]*o[3]+r[11]*o[8]+r[12]*o[13]+r[13]*o[18],t[14]=r[10]*o[4]+r[11]*o[9]+r[12]*o[14]+r[13]*o[19]+r[14],t[15]=r[15]*o[0]+r[16]*o[5]+r[17]*o[10]+r[18]*o[15],t[16]=r[15]*o[1]+r[16]*o[6]+r[17]*o[11]+r[18]*o[16],t[17]=r[15]*o[2]+r[16]*o[7]+r[17]*o[12]+r[18]*o[17],t[18]=r[15]*o[3]+r[16]*o[8]+r[17]*o[13]+r[18]*o[18],t[19]=r[15]*o[4]+r[16]*o[9]+r[17]*o[14]+r[18]*o[19]+r[19],t},n.prototype._colorMatrix=function(t){var r=new Float32Array(t);return r[4]/=255,r[9]/=255,r[14]/=255,r[19]/=255,r},n.prototype.brightness=function(t,r){var o=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.greyscale=function(t,r){var o=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.blackAndWhite=function(t){this._loadMatrix([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},n.prototype.hue=function(t,r){t=(t||0)/180*Math.PI;var o=Math.cos(t),n=Math.sin(t),e=1/3,a=(0,Math.sqrt)(e),i=[o+(1-o)*e,e*(1-o)-a*n,e*(1-o)+a*n,0,0,e*(1-o)+a*n,o+e*(1-o),e*(1-o)-a*n,0,0,e*(1-o)-a*n,e*(1-o)+a*n,o+e*(1-o),0,0,0,0,0,1,0];this._loadMatrix(i,r)},n.prototype.contrast=function(t,r){var o=(t||0)+1,n=-.5*(o-1),e=[o,0,0,0,n,0,o,0,0,n,0,0,o,0,n,0,0,0,1,0];this._loadMatrix(e,r)},n.prototype.saturate=function(t,r){void 0===t&&(t=0);var o=2*t/3+1,n=-.5*(o-1),e=[o,n,n,0,0,n,o,n,0,0,n,n,o,0,0,0,0,0,1,0];this._loadMatrix(e,r)},n.prototype.desaturate=function(){this.saturate(-1)},n.prototype.negative=function(t){this._loadMatrix([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},n.prototype.sepia=function(t){this._loadMatrix([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},n.prototype.technicolor=function(t){this._loadMatrix([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},n.prototype.polaroid=function(t){this._loadMatrix([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},n.prototype.toBGR=function(t){this._loadMatrix([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},n.prototype.kodachrome=function(t){this._loadMatrix([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},n.prototype.browni=function(t){this._loadMatrix([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},n.prototype.vintage=function(t){this._loadMatrix([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},n.prototype.colorTone=function(t,r,o,n,e){var a=((o=o||16770432)>>16&255)/255,i=(o>>8&255)/255,l=(255&o)/255,u=((n=n||3375104)>>16&255)/255,p=(n>>8&255)/255,s=(255&n)/255,c=[.3,.59,.11,0,0,a,i,l,t=t||.2,0,u,p,s,r=r||.15,0,a-u,i-p,l-s,0,0];this._loadMatrix(c,e)},n.prototype.night=function(t,r){var o=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.predator=function(t,r){var o=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(o,r)},n.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},n.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},e.matrix.get=function(){return this.uniforms.m},e.matrix.set=function(t){this.uniforms.m=t},e.alpha.get=function(){return this.uniforms.uAlpha},e.alpha.set=function(t){this.uniforms.uAlpha=t},Object.defineProperties(n.prototype,e),n}(t.Filter);exports.ColorMatrixFilter=o,o.prototype.grayscale=o.prototype.greyscale; },{"@pixi/core":"p2j5"}],"rpU2":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DisplacementFilter=void 0;var t=require("@pixi/core"),r=require("@pixi/math"),e="attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n",i="varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n",n=function(t){function n(n,o){var a=new r.Matrix;n.renderable=!1,t.call(this,e,i,{mapSampler:n._texture,filterMatrix:a,scale:{x:1,y:1},rotation:new Float32Array([1,0,0,1])}),this.maskSprite=n,this.maskMatrix=a,null==o&&(o=20),this.scale=new r.Point(o,o)}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var o={map:{configurable:!0}};return n.prototype.apply=function(t,r,e,i){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y;var n=this.maskSprite.transform.worldTransform,o=Math.sqrt(n.a*n.a+n.b*n.b),a=Math.sqrt(n.c*n.c+n.d*n.d);0!==o&&0!==a&&(this.uniforms.rotation[0]=n.a/o,this.uniforms.rotation[1]=n.b/o,this.uniforms.rotation[2]=n.c/a,this.uniforms.rotation[3]=n.d/a),t.applyFilter(this,r,e,i)},o.map.get=function(){return this.uniforms.mapSampler},o.map.set=function(t){this.uniforms.mapSampler=t},Object.defineProperties(n.prototype,o),n}(t.Filter);exports.DisplacementFilter=n; },{"@pixi/core":"p2j5","@pixi/math":"oNQC"}],"zKIa":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FXAAFilter=void 0;var n=require("@pixi/core"),e="\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputPixel;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",r='varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputPixel;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputPixel.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n',o=function(n){function o(){n.call(this,e,r)}return n&&(o.__proto__=n),o.prototype=Object.create(n&&n.prototype),o.prototype.constructor=o,o}(n.Filter);exports.FXAAFilter=o; },{"@pixi/core":"p2j5"}],"nEkq":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.NoiseFilter=void 0;var e=require("@pixi/core"),o="precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n",r=function(r){function n(n,i){void 0===n&&(n=.5),void 0===i&&(i=Math.random()),r.call(this,e.defaultFilterVertex,o,{uNoise:0,uSeed:0}),this.noise=n,this.seed=i}r&&(n.__proto__=r),n.prototype=Object.create(r&&r.prototype),n.prototype.constructor=n;var i={noise:{configurable:!0},seed:{configurable:!0}};return i.noise.get=function(){return this.uniforms.uNoise},i.noise.set=function(e){this.uniforms.uNoise=e},i.seed.get=function(){return this.uniforms.uSeed},i.seed.set=function(e){this.uniforms.uSeed=e},Object.defineProperties(n.prototype,i),n}(e.Filter);exports.NoiseFilter=r; },{"@pixi/core":"p2j5"}],"fh0A":[function(require,module,exports) { "use strict";var t=require("@pixi/core"),a=require("@pixi/sprite"),e=require("@pixi/display"),i=require("@pixi/math"),s=require("@pixi/utils"),r=require("@pixi/settings"),n=new i.Matrix;e.DisplayObject.prototype._cacheAsBitmap=!1,e.DisplayObject.prototype._cacheData=!1;var h=function(){this.textureCacheId=null,this.originalRender=null,this.originalRenderCanvas=null,this.originalCalculateBounds=null,this.originalGetLocalBounds=null,this.originalUpdateTransform=null,this.originalHitTest=null,this.originalDestroy=null,this.originalMask=null,this.originalFilterArea=null,this.sprite=null};Object.defineProperties(e.DisplayObject.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){var a;this._cacheAsBitmap!==t&&(this._cacheAsBitmap=t,t?(this._cacheData||(this._cacheData=new h),(a=this._cacheData).originalRender=this.render,a.originalRenderCanvas=this.renderCanvas,a.originalUpdateTransform=this.updateTransform,a.originalCalculateBounds=this.calculateBounds,a.originalGetLocalBounds=this.getLocalBounds,a.originalDestroy=this.destroy,a.originalContainsPoint=this.containsPoint,a.originalMask=this._mask,a.originalFilterArea=this.filterArea,this.render=this._renderCached,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((a=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.render=a.originalRender,this.renderCanvas=a.originalRenderCanvas,this.calculateBounds=a.originalCalculateBounds,this.getLocalBounds=a.originalGetLocalBounds,this.destroy=a.originalDestroy,this.updateTransform=a.originalUpdateTransform,this.containsPoint=a.originalContainsPoint,this._mask=a.originalMask,this.filterArea=a.originalFilterArea))}}}),e.DisplayObject.prototype._renderCached=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObject(t),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._render(t))},e.DisplayObject.prototype._initCachedDisplayObject=function(e){if(!this._cacheData||!this._cacheData.sprite){var i=this.alpha;this.alpha=1,e.batch.flush();var h=this.getLocalBounds().clone();if(this.filters){var o=this.filters[0].padding;h.pad(o)}h.ceil(r.settings.RESOLUTION);var c=e.renderTexture.current,l=e.renderTexture.sourceFrame,d=e.projection.transform,p=t.RenderTexture.create(h.width,h.height),u="cacheAsBitmap_"+(0,s.uid)();this._cacheData.textureCacheId=u,t.BaseTexture.addToCache(p.baseTexture,u),t.Texture.addToCache(p,u);var _=n;_.tx=-h.x,_.ty=-h.y,this.transform.worldTransform.identity(),this.render=this._cacheData.originalRender,e.render(this,p,!0,_,!0),e.projection.transform=d,e.renderTexture.bind(c,l),this.render=this._renderCached,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var D=new a.Sprite(p);D.transform.worldTransform=this.transform.worldTransform,D.anchor.x=-h.x/h.width,D.anchor.y=-h.y/h.height,D.alpha=i,D._bounds=this._bounds,this._cacheData.sprite=D,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=D.containsPoint.bind(D)}},e.DisplayObject.prototype._renderCachedCanvas=function(t){!this.visible||this.worldAlpha<=0||!this.renderable||(this._initCachedDisplayObjectCanvas(t),this._cacheData.sprite.worldAlpha=this.worldAlpha,this._cacheData.sprite._renderCanvas(t))},e.DisplayObject.prototype._initCachedDisplayObjectCanvas=function(e){if(!this._cacheData||!this._cacheData.sprite){var i=this.getLocalBounds(),h=this.alpha;this.alpha=1;var o=e.context;i.ceil(r.settings.RESOLUTION);var c=t.RenderTexture.create(i.width,i.height),l="cacheAsBitmap_"+(0,s.uid)();this._cacheData.textureCacheId=l,t.BaseTexture.addToCache(c.baseTexture,l),t.Texture.addToCache(c,l);var d=n;this.transform.localTransform.copyTo(d),d.invert(),d.tx-=i.x,d.ty-=i.y,this.renderCanvas=this._cacheData.originalRenderCanvas,e.render(this,c,!0,d,!1),e.context=o,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var p=new a.Sprite(c);p.transform.worldTransform=this.transform.worldTransform,p.anchor.x=-i.x/i.width,p.anchor.y=-i.y/i.height,p.alpha=h,p._bounds=this._bounds,this._cacheData.sprite=p,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=e._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=p.containsPoint.bind(p)}},e.DisplayObject.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},e.DisplayObject.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},e.DisplayObject.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,t.BaseTexture.removeFromCache(this._cacheData.textureCacheId),t.Texture.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},e.DisplayObject.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)}; },{"@pixi/core":"p2j5","@pixi/sprite":"ueA8","@pixi/display":"nL3p","@pixi/math":"oNQC","@pixi/utils":"G5Tu","@pixi/settings":"t4Uo"}],"CSWr":[function(require,module,exports) { "use strict";var e=require("@pixi/display");e.DisplayObject.prototype.name=null,e.Container.prototype.getChildByName=function(e){for(var i=0;i>16)+(65280&t)+((255&t)<<16),this._colorDirty=!0)},a.tint.get=function(){return this._tint},i.prototype.update=function(){if(this._colorDirty){this._colorDirty=!1;var t=this.texture.baseTexture;(0,s.premultiplyTintToRgba)(this._tint,this._alpha,this.uniforms.uColor,t.alphaMode)}this.uvMatrix.update()&&(this.uniforms.uTextureMatrix=this.uvMatrix.mapCoord)},Object.defineProperties(i.prototype,a),i}(t.Shader);exports.MeshMaterial=f;var p=function(e){function i(i,a,s){e.call(this);var n=new t.Buffer(i),o=new t.Buffer(a,!0),u=new t.Buffer(s,!0,!0);this.addAttribute("aVertexPosition",n,2,!1,r.TYPES.FLOAT).addAttribute("aTextureCoord",o,2,!1,r.TYPES.FLOAT).addIndex(u),this._updateId=-1}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var a={vertexDirtyId:{configurable:!0}};return a.vertexDirtyId.get=function(){return this.buffers[0]._updateID},Object.defineProperties(i.prototype,a),i}(t.Geometry);exports.MeshGeometry=p; },{"@pixi/core":"p2j5","@pixi/math":"oNQC","@pixi/constants":"LQBK","@pixi/display":"nL3p","@pixi/settings":"t4Uo","@pixi/utils":"G5Tu"}],"kDGc":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SimpleRope=exports.SimplePlane=exports.SimpleMesh=exports.RopeGeometry=exports.PlaneGeometry=exports.NineSlicePlane=void 0;var t=require("@pixi/mesh"),e=require("@pixi/constants"),i=require("@pixi/core"),r=function(t){function e(e,i,r,h){void 0===e&&(e=100),void 0===i&&(i=100),void 0===r&&(r=10),void 0===h&&(h=10),t.call(this),this.segWidth=r,this.segHeight=h,this.width=e,this.height=i,this.build()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.build=function(){for(var t=this.segWidth*this.segHeight,e=[],i=[],r=[],h=this.segWidth-1,o=this.segHeight-1,s=this.width/h,a=this.height/o,n=0;n0){var g=a.x-t[p].x,f=a.y-t[p].y,c=Math.sqrt(g*g+f*f);a=t[p],s+=c/n}else s=p/(u-1);h[d]=s,h[d+1]=0,h[d+2]=s,h[d+3]=1}for(var l=0,_=0;_0?this.textureScale*this.width/2:this.width/2;r/=p,h/=p,r*=d,h*=d,o[u]=n.x+r,o[u+1]=n.y+h,o[u+2]=n.x-r,o[u+3]=n.y-h,i=n}this.buffers[0].update()}},e.prototype.update=function(){this.textureScale>0?this.build():this.updateVertices()},e}(t.MeshGeometry);exports.RopeGeometry=h;var o=function(i){function r(r,o,s){void 0===s&&(s=0);var a=new h(r.height,o,s),n=new t.MeshMaterial(r);s>0&&(r.baseTexture.wrapMode=e.WRAP_MODES.REPEAT),i.call(this,a,n),this.autoUpdate=!0}return i&&(r.__proto__=i),r.prototype=Object.create(i&&i.prototype),r.prototype.constructor=r,r.prototype._render=function(t){(this.autoUpdate||this.geometry.width!==this.shader.texture.height)&&(this.geometry.width=this.shader.texture.height,this.geometry.update()),i.prototype._render.call(this,t)},r}(t.Mesh);exports.SimpleRope=o;var s=function(e){function h(h,o,s){var a=new r(h.width,h.height,o,s),n=new t.MeshMaterial(i.Texture.WHITE);e.call(this,a,n),this.texture=h}e&&(h.__proto__=e),h.prototype=Object.create(e&&e.prototype),h.prototype.constructor=h;var o={texture:{configurable:!0}};return h.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this.geometry.width=this.shader.texture.width,this.geometry.height=this.shader.texture.height,this.geometry.build()},o.texture.set=function(t){this.shader.texture!==t&&(this.shader.texture=t,this._textureID=-1,t.baseTexture.valid?this.textureUpdated():t.once("update",this.textureUpdated,this))},o.texture.get=function(){return this.shader.texture},h.prototype._render=function(t){this._textureID!==this.shader.texture._updateID&&this.textureUpdated(),e.prototype._render.call(this,t)},Object.defineProperties(h.prototype,o),h}(t.Mesh);exports.SimplePlane=s;var a=function(e){function r(r,h,o,s,a){void 0===r&&(r=i.Texture.EMPTY);var n=new t.MeshGeometry(h,o,s);n.getBuffer("aVertexPosition").static=!1;var u=new t.MeshMaterial(r);e.call(this,n,u,null,a),this.autoUpdate=!0}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r;var h={vertices:{configurable:!0}};return h.vertices.get=function(){return this.geometry.getBuffer("aVertexPosition").data},h.vertices.set=function(t){this.geometry.getBuffer("aVertexPosition").data=t},r.prototype._render=function(t){this.autoUpdate&&this.geometry.getBuffer("aVertexPosition").update(),e.prototype._render.call(this,t)},Object.defineProperties(r.prototype,h),r}(t.Mesh);exports.SimpleMesh=a;var n=10,u=function(t){function e(e,r,h,o,s){t.call(this,i.Texture.WHITE,4,4),this._origWidth=e.orig.width,this._origHeight=e.orig.height,this._width=this._origWidth,this._height=this._origHeight,this._leftWidth=void 0!==r?r:n,this._rightWidth=void 0!==o?o:n,this._topHeight=void 0!==h?h:n,this._bottomHeight=void 0!==s?s:n,this.texture=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={vertices:{configurable:!0},width:{configurable:!0},height:{configurable:!0},leftWidth:{configurable:!0},rightWidth:{configurable:!0},topHeight:{configurable:!0},bottomHeight:{configurable:!0}};return e.prototype.textureUpdated=function(){this._textureID=this.shader.texture._updateID,this._refresh()},r.vertices.get=function(){return this.geometry.getBuffer("aVertexPosition").data},r.vertices.set=function(t){this.geometry.getBuffer("aVertexPosition").data=t},e.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._topHeight+this._bottomHeight,i=this._height>e?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*i,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*i,t[25]=t[27]=t[29]=t[31]=this._height},e.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,i=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*i,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*i,t[6]=t[14]=t[22]=t[30]=this._width},r.width.get=function(){return this._width},r.width.set=function(t){this._width=t,this._refresh()},r.height.get=function(){return this._height},r.height.set=function(t){this._height=t,this._refresh()},r.leftWidth.get=function(){return this._leftWidth},r.leftWidth.set=function(t){this._leftWidth=t,this._refresh()},r.rightWidth.get=function(){return this._rightWidth},r.rightWidth.set=function(t){this._rightWidth=t,this._refresh()},r.topHeight.get=function(){return this._topHeight},r.topHeight.set=function(t){this._topHeight=t,this._refresh()},r.bottomHeight.get=function(){return this._bottomHeight},r.bottomHeight.set=function(t){this._bottomHeight=t,this._refresh()},e.prototype._refresh=function(){var t=this.texture,e=this.geometry.buffers[1].data;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var i=1/this._origWidth,r=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=i*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-i*this._rightWidth,e[9]=e[11]=e[13]=e[15]=r*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-r*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.geometry.buffers[0].update(),this.geometry.buffers[1].update()},Object.defineProperties(e.prototype,r),e}(s);exports.NineSlicePlane=u; },{"@pixi/mesh":"Ihaq","@pixi/constants":"LQBK","@pixi/core":"p2j5"}],"GC82":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnimatedSprite=void 0;var t=require("@pixi/core"),e=require("@pixi/sprite"),r=require("@pixi/ticker"),i=function(e){function i(r,i){e.call(this,r[0]instanceof t.Texture?r[0]:r[0].texture),this._textures=null,this._durations=null,this.textures=r,this._autoUpdate=!1!==i,this.animationSpeed=1,this.loop=!0,this.updateAnchor=!1,this.onComplete=null,this.onFrameChange=null,this.onLoop=null,this._currentTime=0,this.playing=!1}e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i;var s={totalFrames:{configurable:!0},textures:{configurable:!0},currentFrame:{configurable:!0}};return i.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&r.Ticker.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&r.Ticker.shared.add(this.update,this,r.UPDATE_PRIORITY.HIGH))},i.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},i.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t,r=this.currentFrame;if(null!==this._durations){var i=this._currentTime%1*this._durations[this.currentFrame];for(i+=e/60*1e3;i<0;)this._currentTime--,i+=this._durations[this.currentFrame];var s=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*s,this._currentTime+=s;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(this.animationSpeed>0&&this.currentFramer&&this.onLoop()),this.updateTexture())},i.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this.uvs=this._texture._uvs.uvsFloat32,this.updateAnchor&&this._anchor.copyFrom(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},i.prototype.destroy=function(t){this.stop(),e.prototype.destroy.call(this,t),this.onComplete=null,this.onFrameChange=null,this.onLoop=null},i.fromFrames=function(e){for(var r=[],s=0;s128)throw new Error("Only flag values between 1-128 are supported");var e=this.getFlagIndex(t),s=1<128)throw new Error("Flag at unsupported index");var s=this.getFlagIndex(e),a=1<=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},e=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,o,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var i=n(require("./flags")),o=function(){function n(t,e){this._id=0,this._stateId=0,this._pixiObj=null,this._scene=null,this._tags=new Set,this.flags=new i.default,this.components=new Map,this.attributes=new Map,this.componentsToAdd=new Array,this._id=n.idCounter++,this._pixiObj=e,this._pixiObj.name=t}return Object.defineProperty(n.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pixiObj",{get:function(){return this._pixiObj},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scene",{get:function(){return this._scene},set:function(t){this._scene=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"rawAttributes",{get:function(){return this.attributes},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"rawComponents",{get:function(){return this.components},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"tags",{get:function(){return new Set(this._tags)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"isOnScene",{get:function(){return null!==this.scene},enumerable:!0,configurable:!0}),n.prototype.getAllFlags=function(){return this.flags.getAllFlags()},n.prototype.addComponent=function(t,e){if(void 0===e&&(e=!1),e){if(!this.isOnScene)throw new Error("This object hasn't been added to the scene yet");this.initComponent(t),t.onUpdate(this.scene.currentDelta,this.scene.currentAbsolute)}else this.componentsToAdd.push(t)},n.prototype.removeComponent=function(t){t.isRunning&&(t._isFinished=!0,t.onFinish()),t.onRemove(),t._lastUpdate=0,t.owner=null,this.components.delete(t.id),this.isOnScene&&this.scene._onComponentRemoved(t,this)},n.prototype.removeAllComponents=function(){var n,i;try{for(var o=t(this.components),r=o.next();!r.done;r=o.next()){var s=e(r.value,2)[1];this.removeComponent(s)}}catch(a){n={error:a}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},n.prototype.findComponentByName=function(n){var i,o;try{for(var r=t(this.components),s=r.next();!s.done;s=r.next()){var a=e(s.value,2)[1];if(a.name===n)return a}}catch(h){i={error:h}}finally{try{s&&!s.done&&(o=r.return)&&o.call(r)}finally{if(i)throw i.error}}return null},n.prototype.assignAttribute=function(t,e){if(this.attributes.has(t)){var n=this.attributes.get(t);this.attributes.set(t,e),this.isOnScene&&this.scene._onAttributeChanged(t,n,e,this)}else this.attributes.set(t,e),this.isOnScene&&this.scene._onAttributeAdded(t,e,this)},n.prototype.getAttribute=function(t){return this.attributes.get(t)},n.prototype.removeAttribute=function(t){if(this.attributes.has(t)){var e=this.attributes.get(t);return this.attributes.delete(t),this.isOnScene&&this.scene._onAttributeRemoved(t,e,this),!0}return!1},n.prototype.addTag=function(t){this._tags.add(t),this.isOnScene&&this.scene._onTagAdded(t,this)},n.prototype.removeTag=function(t){this._tags.has(t)&&(this._tags.delete(t),this.isOnScene&&this.scene._onTagRemoved(t,this))},n.prototype.hasTag=function(t){return this._tags.has(t)},n.prototype.setFlag=function(t){this.flags.setFlag(t),this.isOnScene&&this.scene._onFlagChanged(t,!0,this)},n.prototype.resetFlag=function(t){this.flags.resetFlag(t),this.isOnScene&&this.scene._onFlagChanged(t,!1,this)},n.prototype.hasFlag=function(t){return this.flags.hasFlag(t)},n.prototype.invertFlag=function(t){this.flags.invertFlag(t),this.isOnScene&&this.scene._onFlagChanged(t,this.flags.hasFlag(t),this)},Object.defineProperty(n.prototype,"stateId",{get:function(){return this._stateId},set:function(t){var e=this.stateId;this._stateId=t,this.isOnScene&&this.scene._onStateChanged(e,t,this)},enumerable:!0,configurable:!0}),n.prototype.onChildAdded=function(t){this.scene._onObjectAdded(t)},n.prototype.onChildRemoved=function(t){t.removeAllComponents(),this.scene._onObjectRemoved(t)},n.prototype.update=function(n,i){var o,r,s,a;this.initAllComponents();try{for(var h=t(this.components),u=h.next();!u.done;u=h.next()){var l=e(u.value,2)[1];if(l.isRunning)if(0===l.frequency)l.onUpdate(n,i),l._lastUpdate=i;else if(i-l._lastUpdate>=1e3/l.frequency){var c=0===l._lastUpdate?1e3/l.frequency:i-l._lastUpdate;l.onUpdate(c,i),l._lastUpdate=i}}}catch(y){o={error:y}}finally{try{u&&!u.done&&(r=h.return)&&r.call(h)}finally{if(o)throw o.error}}try{for(var p=t(this.pixiObj.children),d=p.next();!d.done;d=p.next()){var f=d.value;f&&f._proxy&&f._proxy.update(n,i)}}catch(g){s={error:g}}finally{try{d&&!d.done&&(a=p.return)&&a.call(p)}finally{if(s)throw s.error}}},n.prototype.initAllComponents=function(){var t=this;0!==this.componentsToAdd.length&&(this.componentsToAdd.forEach(function(e){return t.initComponent(e)}),this.componentsToAdd=[])},n.prototype.initComponent=function(t){if(!this.isOnScene)throw new Error("The object must be on the scene before its components are initialized");if(null!==t.owner)throw new Error("The component "+t.name+":"+t.id+" seems to already have a game object assigned!");t.owner=this.pixiObj,this.components.set(t.id,t),this.scene._onComponentAdded(t,this),t._isFinished=!1,t.onInit()},n.idCounter=0,n}();exports.default=o; },{"./flags":"rNXP"}],"Sn3S":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(r,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(r,e)};return function(r,e){function o(){this.constructor=r}t(r,e),r.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),r=this&&this.__read||function(t,r){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var o,n,i=e.call(t),p=[];try{for(;(void 0===r||r-- >0)&&!(o=i.next()).done;)p.push(o.value)}catch(a){n={error:a}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(n)throw n.error}}return p},e=this&&this.__spread||function(){for(var t=[],e=0;e=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var e in t)Object.hasOwnProperty.call(t,e)&&(r[e]=t[e]);return r.default=t,r};Object.defineProperty(exports,"__esModule",{value:!0});var p=n(require("./game-object-proxy")),a=i(require("pixi.js")),y=function(r){function n(t){void 0===t&&(t="");var e=r.call(this)||this;return e._proxy=new p.default(t,e),e}return t(n,r),Object.defineProperty(n.prototype,"id",{get:function(){return this._proxy.id},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pixiObj",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scene",{get:function(){return this._proxy.scene},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"parentGameObject",{get:function(){return this.parent},enumerable:!0,configurable:!0}),n.prototype.asContainer=function(){return this},n.prototype.asParticleContainer=function(){throw new Error("Can't cast this object to particle container!")},n.prototype.asSprite=function(){throw new Error("Can't cast this object to sprite!")},n.prototype.asTilingSprite=function(){throw new Error("Can't cast this object to tiling sprite!")},n.prototype.asText=function(){throw new Error("Can't cast this object to text!")},n.prototype.asBitmapText=function(){throw new Error("Can't cast this object to bitmap text!")},n.prototype.asGraphics=function(){throw new Error("Can't cast this object to graphics")},n.prototype.asMesh=function(){throw new Error("Can't cast this object to mesh")},n.prototype.addChild=function(){for(var t,n,i=[],p=0;p=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},e=this&&this.__read||function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,s,n=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=n.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(s)throw s.error}}return o},i=this&&this.__spread||function(){for(var t=[],i=0;i=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var n=t(require("./message")),i=function(){function t(){this.owner=null,this.scene=null,this.removeWhenFinished=!0,this._isFinished=!1,this._id=0,this._id=t.idCounter++,this.frequency=0,this._lastUpdate=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name||this.constructor.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRunning",{get:function(){return!this._isFinished},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFinished",{get:function(){return this._isFinished},enumerable:!0,configurable:!0}),t.prototype.onInit=function(){},t.prototype.onMessage=function(e){},t.prototype.onUpdate=function(e,t){},t.prototype.onRemove=function(){},t.prototype.onFinish=function(){},t.prototype.subscribe=function(){for(var t,n,i=[],o=0;o=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),d=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)d.push(o.value)}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return d},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var r=o(require("../engine/component")),i=require("../engine/constants"),d=function(o){function r(){var e=null!==o&&o.apply(this,arguments)||this;return e.debugElement=null,e.msgElement=null,e}return e(r,o),r.prototype.onInit=function(){this.initDebugWindow(),this.subscribe(i.Messages.ANY)},r.prototype.onMessage=function(e){if(-1===[i.Messages.COMPONENT_ADDED,i.Messages.COMPONENT_REMOVED,i.Messages.OBJECT_ADDED,i.Messages.OBJECT_REMOVED].indexOf(e.action)){var t=document.createElement("tr"),n=document.createElement("td"),o=document.createElement("td"),r=document.createElement("td"),d=document.createElement("td");n.style.color="black",o.style.color="red",r.style.color="blue",d.style.color="green",n.innerText=(this.scene.currentAbsolute/1e3).toFixed(2),o.innerText=e.action,r.innerText=e.component?e.component.name:"n/a",d.innerText=e.gameObject?e.gameObject.name:"n/a",t.appendChild(n),t.appendChild(o),t.appendChild(r),t.appendChild(d),this.msgElement.insertBefore(t,this.msgElement.childNodes[0])}e.action===i.Messages.OBJECT_ADDED?this.addGameObject(e.gameObject):e.action===i.Messages.COMPONENT_ADDED?this.addComponent(e.component,e.gameObject):e.action===i.Messages.COMPONENT_REMOVED?this.removeComponent(e.component,e.gameObject):e.action===i.Messages.OBJECT_REMOVED?document.getElementById("node_"+e.gameObject.id).remove():e.action===i.Messages.SCENE_CLEAR&&(this.debugElement.innerHTML="")},r.prototype.onUpdate=function(e,t){},r.prototype.addGameObject=function(e){var o,r,i,d,l=this.getObjectId(e),a=document.getElementById(l);if(!a){if(null!==e.pixiObj.parent){var c=document.createElement("ul");a=document.createElement("li"),c.appendChild(a),a.id=this.getObjectId(e);var s=document.getElementById(this.getObjectId(e.pixiObj.parent));null==s&&(this.addGameObject(e.parentGameObject),s=document.getElementById(this.getObjectId(e.pixiObj.parent))),s.appendChild(c)}else(a=document.createElement("li")).id=this.getObjectId(e),this.debugElement.childNodes[0].appendChild(a);var m=document.createElement("span");m.style.color="red",m.innerText=e.id+":"+e.name,a.appendChild(m);try{for(var u=t(["components"]),p=u.next();!p.done;p=u.next()){var y=p.value,h=document.createElement("ul");h.id=this.getObjectId(e)+"_"+y,a.appendChild(h)}}catch(b){o={error:b}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(o)throw o.error}}try{for(var g=t(e._proxy.rawComponents),f=g.next();!f.done;f=g.next()){var E=n(f.value,2)[1];this.addComponent(E,e)}}catch(O){i={error:O}}finally{try{f&&!f.done&&(d=g.return)&&d.call(g)}finally{if(i)throw i.error}}}},r.prototype.removeGameObject=function(e){document.getElementById(this.getObjectId(e)).remove()},r.prototype.addComponent=function(e,t){null===document.getElementById(this.getObjectId(t))&&this.addGameObject(t);var n=document.getElementById(this.getComponentSectionId(t)),o=document.createElement("li"),r=document.createElement("span");r.style.color="blue",o.id=this.getComponentId(e),n.appendChild(o),o.appendChild(r),r.innerText=e.name},r.prototype.removeComponent=function(e,t){document.getElementById(this.getComponentId(e)).remove()},r.prototype.getObjectId=function(e){return"node_"+e.id},r.prototype.getObjectInfoSectionId=function(e){return"node_"+e.id+"_info"},r.prototype.getComponentSectionId=function(e){return"node_"+e.id+"_components"},r.prototype.getComponentId=function(e){return"cmp_"+e.id},r.prototype.initDebugWindow=function(){var e=document.getElementById("debug");e||((e=document.createElement("div")).id="debug",e.style.width="500px",e.style.height="700px",e.style.overflow="scroll",e.style.cssFloat="left",e.style.backgroundColor="#FFF",e.style.fontFamily="'Courier New', monospace",document.getElementsByTagName("body")[0].appendChild(e)),e.innerHTML="";var t=document.createElement("ul");e.appendChild(t);var n=document.getElementById("debug_msg");if(!n){(n=document.createElement("div")).id="debug_msg",n.style.width="500px",n.style.height="700px",n.style.overflow="scroll",n.style.cssFloat="left",n.style.backgroundColor="#FFF",n.style.fontFamily="'Courier New', monospace";var o=document.createElement("table");n.appendChild(o),document.getElementsByTagName("body")[0].appendChild(n)}this.debugElement=e,this.msgElement=n.children[0]},r}(r.default);exports.default=d; },{"../engine/component":"pk3I","../engine/constants":"JhNs"}],"TQ1f":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=function(){return function(){}}();exports.QueryCondition=e,exports.queryConditionCheck=function(e,o){return!!e&&((void 0===o.ownerId||e.id===o.ownerId)&&((void 0===o.ownerName||e.name===o.ownerName)&&(!(void 0!==o.ownerTag&&!e.hasTag(o.ownerTag))&&((void 0===o.ownerState||e.stateId===o.ownerState)&&!(void 0!==o.ownerFlag&&!e.hasFlag(o.ownerFlag))))))}; },{}],"IfSq":[function(require,module,exports) { "use strict";var e=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},t=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,s,a=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(r){s={error:r}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(s)throw s.error}}return o},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var i=n(require("./message")),s=require("./constants"),a=require("./game-object"),o=require("../utils/lookup-map"),r=n(require("../components/debug-component")),c=require("../utils/query-condition"),l=function(){return function(){this.delay=0,this.time=0,this.action=null}}(),g=function(){function n(e,t,n){this.stage=null,this.componentNotifyDisabled=!1,this.name=e,this.subscribers=new o.LookupMap,this.gameObjects=new Map,this.initConfig(n),this.app=t,this.clearScene()}return Object.defineProperty(n.prototype,"currentDelta",{get:function(){return this._currentDelta},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"currentAbsolute",{get:function(){return this._currentAbsolute},enumerable:!0,configurable:!0}),n.prototype.invokeWithDelay=function(e,t){this.pendingInvocations.push({delay:e,time:0,action:t})},n.prototype.addGlobalComponent=function(e,t){void 0===t&&(t=!1),this.stage.addComponent(e,t)},n.prototype.findGlobalComponentByName=function(e){return this.stage.findComponentByName(e)},n.prototype.removeGlobalComponent=function(e){this.stage.removeComponent(e)},n.prototype.assignGlobalAttribute=function(e,t){this.stage.assignAttribute(e,t)},n.prototype.getGlobalAttribute=function(e){return this.stage.getAttribute(e)},n.prototype.removeGlobalAttribute=function(e){return this.stage.removeAttribute(e)},n.prototype.getObjectById=function(e){return this.gameObjects.has(e)?this.gameObjects.get(e):null},n.prototype.findObjectsByQuery=function(n){var i,s,a=[];try{for(var o=e(this.gameObjects),r=o.next();!r.done;r=o.next()){var l=t(r.value,2)[1];c.queryConditionCheck(l,n)&&a.push(l)}}catch(g){i={error:g}}finally{try{r&&!r.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return a},n.prototype.findObjectsByName=function(e){if(!this.config.namesSearchEnabled)throw new Error("Searching by name is not enabled. See SceneConfig");return this.gameObjectNames.findAll(e)},n.prototype.findObjectByName=function(e){if(!this.config.namesSearchEnabled)throw new Error("Searching by name is not enabled. See SceneConfig");return this.gameObjectNames.findFirst(e)},n.prototype.findObjectsByTag=function(e){if(!this.config.tagsSearchEnabled)throw new Error("Searching by tag is not enabled. See SceneConfig");return this.gameObjectTags.findAll(e)},n.prototype.findObjectByTag=function(e){if(!this.config.tagsSearchEnabled)throw new Error("Searching by tag is not enabled. See SceneConfig");return this.gameObjectTags.findFirst(e)},n.prototype.findObjectsByFlag=function(e){if(!this.config.flagsSearchEnabled)throw new Error("Searching by flags is not enabled. See SceneConfig");return this.gameObjectFlags.findAll(e)},n.prototype.findObjectByFlag=function(e){if(!this.config.flagsSearchEnabled)throw new Error("Searching by flags is not enabled. See SceneConfig");return this.gameObjectFlags.findFirst(e)},n.prototype.findObjectsByState=function(e){if(!this.config.statesSearchEnabled)throw new Error("Searching by states is not enabled. See SceneConfig");return this.gameObjectStates.findAll(e)},n.prototype.findObjectByState=function(e){if(!this.config.statesSearchEnabled)throw new Error("Searching by states is not enabled. See SceneConfig");return this.gameObjectStates.findFirst(e)},n.prototype.sendMessage=function(e){this.subscribers.findAll(e.action).forEach(function(t){e.expired||null!=e.component&&e.component.id===t.id||t.onMessage(e)}),this.subscribers.findAll(s.Messages.ANY).forEach(function(t){return t.onMessage(e)})},n.prototype.clearSceneAsync=function(e){var t=this;this.invokeWithDelay(0,function(){return t.clearScene(e)})},n.prototype.clearScene=function(n){var c,l,g,h;if(this.updating)throw new Error("Scene can't be cleared during update. Use invokeWithDelay() instead!");this.sendMessage(new i.default(s.Messages.SCENE_CLEAR,null,null,this.name));try{for(var u=e(this.gameObjects),f=u.next();!f.done;f=u.next()){var b=t(f.value,2)[1];try{for(var d=(g=void 0,e(b._proxy.rawComponents)),p=d.next();!p.done;p=d.next()){var m=t(p.value,2)[1];m.isRunning&&(m._isFinished=!0,m.onFinish()),m.onRemove(),m.owner=null}}catch(O){g={error:O}}finally{try{p&&!p.done&&(h=d.return)&&h.call(d)}finally{if(g)throw g.error}}}}catch(E){c={error:E}}finally{try{f&&!f.done&&(l=u.return)&&l.call(u)}finally{if(c)throw c.error}}n&&this.initConfig(n),this.subscribers.clear(),this.config.namesSearchEnabled&&(this.gameObjectNames?this.gameObjectNames.clear():this.gameObjectNames=new o.LookupMap),this.config.statesSearchEnabled&&(this.gameObjectStates?this.gameObjectStates.clear():this.gameObjectStates=new o.LookupMap),this.config.tagsSearchEnabled&&(this.gameObjectTags?this.gameObjectTags.clear():this.gameObjectTags=new o.LookupMap),this.config.flagsSearchEnabled&&(this.gameObjectFlags?this.gameObjectFlags.clear():this.gameObjectFlags=new o.LookupMap),this.sceneCleared=!0,this.gameObjects.clear(),this.pendingInvocations=[],this._currentDelta=this._currentAbsolute=0;var y=new a.Container("stage");this.app.stage=y,y._proxy.scene=this,this.stage=y,this.config.debugEnabled&&this.addGlobalComponent(new r.default,!0),this._onObjectAdded(y._proxy)},n.prototype._update=function(e,t){this.sceneCleared&&(this.sceneCleared=!1),this._currentDelta=e,this._currentAbsolute=t,this.updating=!0,this.stage._proxy.update(e,t),this.updating=!1;for(var n=this.pendingInvocations.length;n--;){var i=this.pendingInvocations[n];if(i.time+=e,i.time>=i.delay&&(this.pendingInvocations.splice(n,1),i.action(),this.sceneCleared))break}},n.prototype._subscribeComponent=function(e,t){this.subscribers.insert(e,t)},n.prototype._unsubscribeComponent=function(e,t){this.subscribers.remove(e,t)},n.prototype._onObjectAdded=function(e){var t=this,n=e.pixiObj;this.config.namesSearchEnabled&&this.gameObjectNames.insert(n.name,n),this.config.flagsSearchEnabled&&e.getAllFlags().forEach(function(e){return t.gameObjectFlags.insert(e,n)}),this.config.tagsSearchEnabled&&e.tags.forEach(function(e){return t.gameObjectTags.insert(e,n)}),this.config.statesSearchEnabled&&this.gameObjectStates.insert(n.stateId,n),this.gameObjects.set(e.id,e.pixiObj),e.scene=this,this.componentNotifyDisabled=!0,e.initAllComponents(),this.componentNotifyDisabled=!1,this.sendMessage(new i.default(s.Messages.OBJECT_ADDED,null,n))},n.prototype._onObjectRemoved=function(e){var t=e.pixiObj;this.config.namesSearchEnabled&&this.gameObjectNames.remove(t.name,t),this.config.flagsSearchEnabled&&this.gameObjectFlags.removeItem(t),this.config.statesSearchEnabled&&this.gameObjectStates.removeItem(t),this.config.tagsSearchEnabled&&this.gameObjectTags.removeItem(t),this.gameObjects.delete(e.id),this.sendMessage(new i.default(s.Messages.OBJECT_REMOVED,null,t))},n.prototype._onComponentAdded=function(e,t){e.scene=this,this.componentNotifyDisabled||this.sendMessage(new i.default(s.Messages.COMPONENT_ADDED,e,t.pixiObj))},n.prototype._onComponentRemoved=function(e,t){this.subscribers.removeItem(e),this.sendMessage(new i.default(s.Messages.COMPONENT_REMOVED,e,t.pixiObj))},n.prototype._onStateChanged=function(e,t,n){if(this.config.statesSearchEnabled&&(this.gameObjectStates.remove(e,n.pixiObj),this.gameObjectStates.insert(t,n.pixiObj)),this.config.notifyStateChanges){var a={previous:e,current:t};this.sendMessage(new i.default(s.Messages.STATE_CHANGED,null,n.pixiObj,a))}},n.prototype._onAttributeAdded=function(e,t,n){if(this.config.notifyAttributeChanges){var a={key:e,type:s.Messages.ATTRIBUTE_ADDED,previousValue:null,currentValue:t};this.sendMessage(new i.default(s.Messages.ATTRIBUTE_ADDED,null,n.pixiObj,a))}},n.prototype._onAttributeChanged=function(e,t,n,a){if(this.config.notifyAttributeChanges){var o={key:e,type:s.Messages.ATTRIBUTE_CHANGED,previousValue:t,currentValue:n};this.sendMessage(new i.default(s.Messages.ATTRIBUTE_CHANGED,null,a.pixiObj,o))}},n.prototype._onAttributeRemoved=function(e,t,n){if(this.config.notifyAttributeChanges){var a={key:e,type:s.Messages.ATTRIBUTE_REMOVED,previousValue:t,currentValue:null};this.sendMessage(new i.default(s.Messages.ATTRIBUTE_REMOVED,null,n.pixiObj,a))}},n.prototype._onFlagChanged=function(e,t,n){if(this.config.flagsSearchEnabled&&(t?this.gameObjectFlags.insert(e,n.pixiObj):this.gameObjectFlags.remove(e,n.pixiObj)),this.config.notifyFlagChanges){var a={flag:e,isSet:t};this.sendMessage(new i.default(s.Messages.FLAG_CHANGED,null,n.pixiObj,a))}},n.prototype._onTagAdded=function(e,t){if(this.config.tagsSearchEnabled&&this.gameObjectTags.insert(e,t.pixiObj),this.config.notifyTagChanges){var n={tag:e,type:s.Messages.TAG_ADDED};this.sendMessage(new i.default(s.Messages.TAG_ADDED,null,t.pixiObj,n))}},n.prototype._onTagRemoved=function(e,t){if(this.config.tagsSearchEnabled&&this.gameObjectTags.remove(e,t.pixiObj),this.config.notifyTagChanges){var n={tag:e,type:s.Messages.TAG_REMOVED};this.sendMessage(new i.default(s.Messages.TAG_REMOVED,null,t.pixiObj,n))}},n.prototype.initConfig=function(e){this.config={flagsSearchEnabled:e&&e.flagsSearchEnabled,namesSearchEnabled:!e||void 0===e.namesSearchEnabled||e.namesSearchEnabled,tagsSearchEnabled:!e||void 0===e.tagsSearchEnabled||e.tagsSearchEnabled,statesSearchEnabled:e&&e.statesSearchEnabled,notifyAttributeChanges:e&&e.notifyAttributeChanges,notifyStateChanges:e&&e.notifyStateChanges,notifyFlagChanges:e&&e.notifyFlagChanges,notifyTagChanges:e&&e.notifyTagChanges,debugEnabled:e&&e.debugEnabled}},n}();exports.default=g; },{"./message":"lHSJ","./constants":"JhNs","./game-object":"Sn3S","../utils/lookup-map":"kihX","../components/debug-component":"owWq","../utils/query-condition":"TQ1f"}],"Vy0Z":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isMobileDevice=function(){return/(iphone|ipod|ipad|android)/gi.test(navigator.userAgent)},exports.isPdfPrint=function(){return window.location.search.match(/print-pdf/gi)},exports.resizeContainer=function(e,t,n){var i,r=!1;window.innerWidth/window.innerHeight>t/n?i=window.innerHeight/n:(i=window.innerWidth/t,r=!0);var o=function(){return setTimeout(function(){window.scrollTo(0,1)},10)};exports.isMobileDevice()&&(document.documentElement.style.setProperty("--vh",.01*window.innerHeight+"px"),window.addEventListener("load",o,!1),window.addEventListener("orientationchange",o,!1));var s="scale("+i+")",d=r?window.innerHeight/2-n/2:(i-1)*n/2;e.style.setProperty("position","absolute"),e.style.setProperty("MozTransform",s),e.style.setProperty("transform",s),e.style.setProperty("WebkitTransform",s),e.style.setProperty("top",d+"px"),e.style.setProperty("left",(i-1)*t/2+(window.innerWidth-t*i)/2+"px")}; },{}],"rHyk":[function(require,module,exports) { "use strict";var t=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var e in t)Object.hasOwnProperty.call(t,e)&&(i[e]=t[e]);return i.default=t,i},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("pixi.js"));window.PIXI=e;var n=i(require("./scene")),s=require("../utils/functions"),r=function(){function t(t){var i=this;this.app=null,this.lastTime=0,this.gameTime=0,this.scene=null,this.ticker=null,this.resizeHandler=function(t){return s.resizeContainer(i.app.view,i.width,i.height)},this.options=t}return t.prototype.init=function(t,i,s,r,o,a){void 0===r&&(r=1),void 0===a&&(a=!0),this.width=i,this.height=s,this.resizeToScreen=a&&(!o||!o.debugEnabled),(o=o||{}).debugEnabled=o.debugEnabled||/[?&]debug/.test(location.search),this.app=new e.Application({width:i/r,height:s/r,view:t,resolution:r,transparent:!(!this.options||void 0===this.options.transparent)&&this.options.transparent,antialias:!this.options||void 0===this.options.antialias||this.options.antialias,backgroundColor:this.options&&void 0!==this.options.backgroundColor?this.options.backgroundColor:0}),this.scene=new n.default("default",this.app,o),this.resizeToScreen&&this.initResizeHandler(),this.ticker=this.app.ticker,this.ticker.autoStart=!1,this.ticker.stop(),this._running=!0,this.loop(performance.now())},Object.defineProperty(t.prototype,"running",{get:function(){return this._running},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.app.destroy(!1),this._running=!1,this.resizeToScreen&&window.removeEventListener("resize",this.resizeHandler)},t.prototype.loop=function(t){var i=this,e=Math.min(t-this.lastTime,300);this.lastTime=t,this.gameTime+=e,this.scene._update(e,this.gameTime),this._running&&(this.ticker.update(this.gameTime),requestAnimationFrame(function(t){return i.loop(t)}))},t.prototype.initResizeHandler=function(){var t=this.width,i=this.height;s.resizeContainer(this.app.view,t,i),window.addEventListener("resize",this.resizeHandler)},t}();exports.default=r; },{"pixi.js":"wbEC","./scene":"IfSq","../utils/functions":"Vy0Z"}],"rjqD":[function(require,module,exports) { "use strict";var t=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},e=this&&this.__read||function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,s,n=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=n.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(i=n.return)&&i.call(n)}finally{if(s)throw s.error}}return o},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e};Object.defineProperty(exports,"__esModule",{value:!0});var s,n=require("./game-object"),o=i(require("./component")),a=r(require("pixi.js"));!function(t){t[t.Graphics=0]="Graphics",t[t.Container=1]="Container",t[t.ParticleContainer=2]="ParticleContainer",t[t.Sprite=3]="Sprite",t[t.TilingSprite=4]="TilingSprite",t[t.Text=5]="Text",t[t.BitmapText=6]="BitmapText",t[t.Mesh=7]="Mesh"}(s||(s={}));var h=function(){return function(){}}(),l=function(){function i(t){this.type=s.Container,this.scene=t,this.clear()}return i.prototype.anchor=function(t,e){return"number"==typeof t?(this.anchorX=t,this.anchorY=null!=e?e:this.anchorX):(this.anchorX=t.x,this.anchorY=t.y),this},i.prototype.virtualAnchor=function(t,e){return"number"==typeof t?(this.virtAnchorX=t,this.virtAnchorY=null!=e?e:this.virtAnchorX):(this.virtAnchorX=t.x,this.virtAnchorY=t.y),this},i.prototype.relativePos=function(t,e){return"number"==typeof t?(this.relPosX=t,this.relPosY=null!=e?e:this.relPosX):(this.relPosX=t.x,this.relPosY=t.y),this},i.prototype.localPos=function(t,e){return"number"==typeof t?(this.locPosX=t,this.locPosY=null!=e?e:this.locPosX):(this.locPosX=t.x,this.locPosY=t.y),this},i.prototype.globalPos=function(t,e){return"number"==typeof t?(this.absPosX=t,this.absPosY=null!=e?e:this.absPosX):(this.absPosX=t.x,this.absPosY=t.y),this},i.prototype.scale=function(t,e){return"number"==typeof t?(this.scaleX=t,this.scaleY=null!=e?e:this.scaleX):(this.scaleX=t.x,this.scaleY=t.y),this},i.prototype.withAttribute=function(t,e){return this.attributes.set(t,e),this},i.prototype.withComponent=function(t){return t instanceof o.default?this.components.push(t):this.componentBuilders.push(t),this},i.prototype.withFlag=function(t){return this.flags.push(t),this},i.prototype.withState=function(t){return this.state=t,this},i.prototype.withTag=function(t){return this.tags.add(t),this},i.prototype.withParent=function(t){return this.parent=t,this},i.prototype.withChild=function(t){return this.children.push(t),this},i.prototype.asContainer=function(t){return void 0===t&&(t=""),this.type=s.Container,this.parameters={name:t},this},i.prototype.asGraphics=function(t){return void 0===t&&(t=""),this.type=s.Graphics,this.parameters={name:t},this},i.prototype.asParticleContainer=function(t){return void 0===t&&(t=""),this.type=s.ParticleContainer,this.parameters={name:t},this},i.prototype.asSprite=function(t,e){return void 0===e&&(e=""),this.type=s.Sprite,this.parameters={name:e,texture:t},this},i.prototype.asTilingSprite=function(t,e,i,r){return void 0===r&&(r=""),this.type=s.TilingSprite,this.parameters={name:r,texture:t,width:e,height:i},this},i.prototype.asText=function(t,e,i){return void 0===t&&(t=""),void 0===e&&(e=""),this.type=s.Text,this.parameters={name:t,text:e,fontStyle:i},this},i.prototype.asBitmapText=function(t,e,i,r,n){return void 0===t&&(t=""),void 0===e&&(e=""),this.type=s.BitmapText,this.parameters={name:t,text:e,fontName:i,fontSize:r,fontColor:n},this},i.prototype.asMesh=function(t,e,i){return void 0===t&&(t=""),this.type=s.Mesh,this.parameters={name:t,geometry:e,shader:i},this},i.prototype.buildInto=function(t,e){void 0===e&&(e=!0),this.existingObject=t;var i=this.build(e);return this.existingObject=null,i},i.prototype.build=function(i){var r,o,h,l,c,p,u,f,y,m,d;if(void 0===i&&(i=!0),null!==this.existingObject)d=this.existingObject;else switch(this.type){case s.Container:d=new n.Container(this.parameters.name);break;case s.Graphics:d=new n.Graphics(this.parameters.name);break;case s.ParticleContainer:d=new n.ParticleContainer(this.parameters.name);break;case s.Sprite:d=new n.Sprite(this.parameters.name,this.parameters.texture.clone());break;case s.TilingSprite:d=new n.TilingSprite(this.parameters.name,this.parameters.texture.clone(),this.parameters.width,this.parameters.height);break;case s.Text:(d=new n.Text(this.parameters.name,this.parameters.text)).style=this.parameters.fontStyle;break;case s.BitmapText:d=new n.BitmapText(this.parameters.name,this.parameters.text,this.parameters.fontName,this.parameters.fontSize,this.parameters.fontColor);break;case s.Mesh:d=new n.Mesh(this.parameters.name,this.parameters.geometry,this.parameters.shader)}try{for(var x=t(this.components),v=x.next();!v.done;v=x.next()){var b=v.value;d.addComponent(b)}}catch(q){r={error:q}}finally{try{v&&!v.done&&(o=x.return)&&o.call(x)}finally{if(r)throw r.error}}this.components=[];try{for(var P=t(this.componentBuilders),X=P.next();!X.done;X=P.next()){var Y=X.value;d.addComponent(Y())}}catch(z){h={error:z}}finally{try{X&&!X.done&&(l=P.return)&&l.call(P)}finally{if(h)throw h.error}}try{for(var g=t(this.attributes),w=g.next();!w.done;w=g.next()){var S=e(w.value,2),T=S[0],C=S[1];d.assignAttribute(T,C)}}catch(E){c={error:E}}finally{try{w&&!w.done&&(p=g.return)&&p.call(g)}finally{if(c)throw c.error}}try{for(var j=t(this.flags),O=j.next();!O.done;O=j.next()){var A=O.value;d.setFlag(A)}}catch(F){u={error:F}}finally{try{O&&!O.done&&(f=j.return)&&f.call(j)}finally{if(u)throw u.error}}null!==this.state&&(d.stateId=this.state),0!==this.tags.size&&this.tags.forEach(function(t){return d.addTag(t)});var _,M=d.pixiObj;(null!==this.scaleX&&(M.scale.x=this.scaleX),null!==this.scaleY&&(M.scale.y=this.scaleY),null!==this.relPosX)&&((_=new a.Point).x=this.relPosX*this.scene.app.screen.width/this.scene.stage.scale.x,M.position.x=M.toLocal(_).x,null!==this.scaleX&&(M.position.x*=this.scaleX));null!==this.relPosY&&((_=new a.Point).y=this.relPosY*this.scene.app.screen.height/this.scene.stage.scale.y,M.position.y=M.toLocal(_).y,null!==this.scaleY&&(M.position.y*=this.scaleY));(null!==this.locPosX&&(null!==this.relPosX?M.position.x+=this.locPosX:M.position.x=this.locPosX),null!==this.locPosY&&(null!==this.relPosY?M.position.y+=this.locPosY:M.position.y=this.locPosY),null!==this.absPosX)&&((_=new a.Point).x=this.absPosX,M.position.x=M.toLocal(_,this.scene.stage.pixiObj).x,null!==this.scaleX&&(M.position.x*=this.scaleX));null!==this.absPosY&&((_=new a.Point).y=this.absPosY,M.position.y=M.toLocal(_,this.scene.stage.pixiObj).y,null!==this.scaleY&&(M.position.y*=this.scaleY));if(null!==this.anchorX&&(M instanceof n.Sprite||M instanceof n.Text?M.anchor.x=this.anchorX:M.pivot.x=this.anchorX*M.width),null!==this.anchorY&&(M instanceof n.Sprite||M instanceof n.Text?M.anchor.y=this.anchorY:M.pivot.y=this.anchorY*M.height),null!==this.virtAnchorX){var B=this.virtAnchorX-(null===this.anchorX?0:this.anchorX);M.position.x-=B*M.width}if(null!==this.virtAnchorY){B=this.virtAnchorY-(null===this.anchorY?0:this.anchorY);M.position.y-=B*M.height}null!==this.parent&&this.parent.pixiObj.addChild(d.pixiObj);try{for(var k=t(this.children),G=k.next();!G.done;G=k.next()){var L=G.value.withParent(d).build(i);d.pixiObj.addChild(L.pixiObj)}}catch(I){y={error:I}}finally{try{G&&!G.done&&(m=k.return)&&m.call(k)}finally{if(y)throw y.error}}return i&&this.clear(),d},i.prototype.clear=function(){return this.locPosX=null,this.locPosY=null,this.anchorX=null,this.anchorY=null,this.relPosX=null,this.relPosY=null,this.absPosX=null,this.absPosY=null,this.scaleX=null,this.scaleY=null,this.components=[],this.componentBuilders=[],this.attributes=new Map,this.flags=[],this.state=null,this.tags=new Set,this.virtAnchorX=null,this.virtAnchorY=null,this.parent=null,this.children=[],this.existingObject=null,this.type=s.Container,this.parameters={name:""},this},i}();exports.default=l; },{"./game-object":"Sn3S","./component":"pk3I","pixi.js":"wbEC"}],"z9pI":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),e=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var i=r(require("../engine/component")),n=require("../utils/query-condition"),a=1,s=2,u=3,o=4,h=5,c=6,p=7,m=8,l=9,y=10,d=11,f=12,P=13,g=14,v=15,b=16,k=17,x=18,q=19,N=20,A=21,I=22,w=23,C=function(){function t(){this.topNode=null,this.size=0,this.topNode=null,this.size=0}return t.prototype.push=function(t){this.topNode=t,this.size+=1},t.prototype.pop=function(){var t=this.topNode;return this.topNode=this.topNode.previous,this.size-=1,t},t.prototype.top=function(){return this.topNode},t}(),_=function(){function t(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null),this.key=0,this.param1=null,this.param2=null,this.param3=null,this.param1A=null,this.param2A=null,this.param3A=null,this.cached=!1,this.next=null,this.previous=null,this.key=t,this.param1=e,this.param2=r,this.param3=i,this.param1A=null,this.param2A=null,this.param3A=null}return t.prototype.cacheParams=function(){this.cached||(null!=this.param1&&(this.param1A="function"==typeof this.param1?this.param1():this.param1),null!=this.param2&&(this.param2A="function"==typeof this.param2?this.param2():this.param2),null!=this.param3&&(this.param3A="function"==typeof this.param3?this.param3():this.param3),this.cached=!0)},t.prototype.getParam1=function(){return this.cached||this.cacheParams(),this.param1A},t.prototype.setParam1=function(t){this.param1A=t},t.prototype.getParam2=function(){return this.cached||this.cacheParams(),this.param2A},t.prototype.setParam2=function(t){this.param2A=t},t.prototype.getParam3=function(){return this.cached||this.cacheParams(),this.param3A},t.prototype.setParam3=function(t){this.param3A=t},t.prototype.resetCache=function(){this.param1A=this.param2A=this.param3A=null,this.cached=!1},t}(),S=function(r){function i(){var t=null!==r&&r.apply(this,arguments)||this;return t.scopeStack=new C,t.current=null,t.head=null,t.tail=null,t.tmpParam=null,t.tmpParam2=null,t}return t(i,r),i.prototype.beginRepeat=function(t){return this.enqueue(a,t,0===t),this},i.prototype.endRepeat=function(){return this.enqueue(s),this},i.prototype.execute=function(t){return this.enqueue(u,t),this},i.prototype.beginWhile=function(t){return this.enqueue(o,t),this},i.prototype.endWhile=function(){return this.enqueue(h),this},i.prototype.beginInterval=function(t){return this.enqueue(c,t),this},i.prototype.endInterval=function(){return this.enqueue(p),this},i.prototype.beginIf=function(t){return this.enqueue(m,t),this},i.prototype.else=function(){return this.enqueue(l),this},i.prototype.endIf=function(){return this.enqueue(y),this},i.prototype.addComponent=function(t,e){return void 0===e&&(e=null),this.enqueue(f,t,e),this},i.prototype.addComponentAndWait=function(t,e){return void 0===e&&(e=null),this.enqueue(P,t,e),this},i.prototype.addComponentsAndWait=function(t,e){return void 0===e&&(e=null),this.enqueue(w,t,e),this},i.prototype.waitTime=function(t){return this.enqueue(d,t),this},i.prototype.waitForFinish=function(t){return this.enqueue(g,t),this},i.prototype.waitUntil=function(t){return this.enqueue(v,t),this},i.prototype.waitFrames=function(t){return this.enqueue(b,t),this},i.prototype.waitForMessage=function(t){return this.enqueue(k,t),this},i.prototype.waitForMessageConditional=function(t,e){return this.enqueue(x,t,e),this},i.prototype.removeComponent=function(t,e){return void 0===e&&(e=null),this.enqueue(q,t,e),this},i.prototype.removeGameObjectsByQuery=function(t){return this.enqueue(N,t),this},i.prototype.removeGameObject=function(t){return this.enqueue(A,t),this},i.prototype.setState=function(t){return this.enqueue(I,t),this},i.prototype.onMessage=function(t){this.current&&(this.current.key===k&&this.current.param1===t.action||this.current.key===x&&this.current.param1===t.action&&n.queryConditionCheck(t.gameObject,this.current.param2))&&(this.tmpParam2=!0)},i.prototype.onUpdate=function(t,r){var i,n,C,_;if(null!==this.owner)if(null==this.current&&(this.current=this.dequeue()),null!=this.current)switch(this.current.key){case a:this.current.cacheParams(),this.scopeStack.push(this.current),this.gotoNextImmediately(t,r);break;case s:var S=this.scopeStack.pop();S.setParam1(S.getParam1()-1),!0===S.getParam2()||S.getParam1()>0?(this.current=S,this.onUpdate(t,r)):(S.resetCache(),this.gotoNextImmediately(t,r));break;case u:this.current.param1(this),this.gotoNextImmediately(t,r);break;case o:this.scopeStack.push(this.current),this.gotoNextImmediately(t,r);break;case h:var O=this.scopeStack.pop();O.param1()?(this.current=O,this.onUpdate(t,r)):this.gotoNextImmediately(t,r);break;case c:this.current.cached||this.current.cacheParams(),null==this.tmpParam?this.tmpParam=r:r-this.tmpParam>=this.current.getParam1()&&(this.tmpParam=null,this.current.resetCache(),this.scopeStack.push(this.current),this.gotoNextImmediately(t,r));break;case p:this.current=this.scopeStack.pop(),this.onUpdate(t,r);break;case m:if(this.current.param1()){this.gotoNextImmediately(t,r);break}for(var j=1;;)if(this.current=this.dequeue(),this.current.key===m&&j++,this.current.key===y&&j--,1===j&&this.current.key===l||0===j&&this.current.key===y){this.gotoNext();break}this.onUpdate(t,r);break;case l:for(var U=1;;)if(this.current=this.dequeue(),this.current.key===m&&U++,this.current.key===y&&U--,0===U&&this.current.key===y){this.gotoNext();break}this.onUpdate(t,r);break;case y:this.gotoNextImmediately(t,r);break;case d:this.current.cacheParams(),null==this.tmpParam&&(this.tmpParam=r),r-this.tmpParam>this.current.getParam1()&&(this.tmpParam=null,this.current.resetCache(),this.gotoNextImmediately(t,r));break;case f:(null!=this.current.getParam2()?this.current.getParam2():this.owner).addComponent(this.current.getParam1()),this.gotoNextImmediately(t,r);break;case P:if(!this.current.cached)this.current.cacheParams(),(null!=this.current.param2A?this.current.param2A:this.owner).addComponent(this.current.param1A);this.current.getParam1().isRunning||(this.tmpParam=null,this.current.resetCache(),this.gotoNextImmediately(t,r));break;case w:if(!this.current.cached){this.current.cacheParams();var F=null!=this.current.param2A?this.current.param2A:this.owner;try{for(var M=e(this.current.param1A),R=M.next();!R.done;R=M.next()){var z=R.value;F.addComponent(z)}}catch(Q){i={error:Q}}finally{try{R&&!R.done&&(n=M.return)&&n.call(M)}finally{if(i)throw i.error}}}this.current.getParam1().find(function(t){return t.isRunning})||(this.tmpParam=null,this.current.resetCache(),this.gotoNextImmediately(t,r));break;case g:this.current.cached||this.current.cacheParams(),this.current.getParam1().isRunning||(this.current.resetCache(),this.gotoNextImmediately(t,r));break;case v:this.current.param1()||this.gotoNextImmediately(t,r);break;case b:null==this.tmpParam&&(this.tmpParam=0),++this.tmpParam>this.current.param1&&(this.tmpParam=null,this.gotoNextImmediately(t,r));break;case k:case x:!0===this.tmpParam?!0===this.tmpParam2&&(this.unsubscribe(this.current.param1),this.tmpParam=this.tmpParam2=null,this.gotoNextImmediately(t,r)):(this.tmpParam=!0,this.tmpParam2=!1,this.subscribe(this.current.param1));break;case q:(null!=this.current.param2?this.current.param2:this.owner).removeComponentByClass(this.current.param1),this.gotoNextImmediately(t,r);break;case N:var W=this.scene.findObjectsByQuery(this.current.param1);try{for(var B=e(W),G=B.next();!G.done;G=B.next()){G.value.remove()}}catch(T){C={error:T}}finally{try{G&&!G.done&&(_=B.return)&&_.call(B)}finally{if(C)throw C.error}}this.gotoNextImmediately(t,r);break;case A:this.current.param1.remove(),this.gotoNextImmediately(t,r);break;case I:this.state=this.current.param1,this.gotoNextImmediately(t,r)}else this.finish()},i.prototype.enqueue=function(t,e,r,i){void 0===e&&(e=null),void 0===r&&(r=null),void 0===i&&(i=null);var n=new _(t,e,r,i);if(null!=this.current&&this.current!==this.head){var a=this.current.next;this.current.next=n,n.next=a,n.previous=this.current,a.previous=n}else null==this.head?this.head=this.tail=n:(this.tail.next=n,n.previous=this.tail,this.tail=n),null==this.current&&(this.current=this.head)},i.prototype.dequeue=function(){return null==this.current||null==this.current.next?null:(this.current=this.current.next,this.current)},i.prototype.gotoNext=function(){this.current=this.current.next},i.prototype.gotoNextImmediately=function(t,e){this.current=this.current.next,this.onUpdate(t,e)},i}(i.default);exports.default=S; },{"../engine/component":"pk3I","../utils/query-condition":"TQ1f"}],"OHJr":[function(require,module,exports) { "use strict";var n=this&&this.__extends||function(){var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])})(t,e)};return function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),t=this&&this.__values||function(n){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&n[t],o=0;if(e)return e.call(n);if(n&&"number"==typeof n.length)return{next:function(){return n&&o>=n.length&&(n=void 0),{value:n&&n[o++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},e=this&&this.__read||function(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var o,r,i=e.call(n),s=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(a){r={error:a}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(r)throw r.error}}return s},o=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(exports,"__esModule",{value:!0});var r=o(require("../engine/component")),i=require("../utils/query-condition"),s=function(o){function r(n){var t=o.call(this)||this;return t.onInitFunc=null,t.onMessageHandlers=new Map,t.onMessageConditionalHandlers=new Map,t.onUpdateFunc=null,t.onRemoveFunc=null,t.onFinishFunc=null,t.timeout=0,t.firstRun=0,t._name=n,t}return n(r,o),Object.defineProperty(r.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),r.prototype.doOnInit=function(n){return this.onInitFunc=n,this},r.prototype.doOnMessage=function(n,t){return this.onMessageHandlers.set(n,{handler:t,onlyOnce:!1}),this},r.prototype.doOnMessageOnce=function(n,t){return this.onMessageHandlers.set(n,{handler:t,onlyOnce:!0}),this},r.prototype.doOnMessageConditional=function(n,t,e){return this.onMessageConditionalHandlers.has(n)||this.onMessageConditionalHandlers.set(n,new Set),this.onMessageConditionalHandlers.get(n).add({onlyOnce:!1,handler:e,condition:t}),this},r.prototype.doOnUpdate=function(n){return this.onUpdateFunc=n,this},r.prototype.doOnRemove=function(n){return this.onRemoveFunc=n,this},r.prototype.doOnFinish=function(n){return this.onFinishFunc=n,this},r.prototype.setFrequency=function(n){return this.frequency=n,this},r.prototype.setTimeout=function(n){return this.timeout=n,this},r.prototype.onInit=function(){var n,o,r,i;null!=this.onInitFunc&&this.onInitFunc(this);try{for(var s=t(this.onMessageHandlers),a=s.next();!a.done;a=s.next()){var u=e(a.value,1)[0];this.subscribe(u)}}catch(h){n={error:h}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}try{for(var l=t(this.onMessageConditionalHandlers),c=l.next();!c.done;c=l.next()){u=e(c.value,1)[0];this.subscribe(u)}}catch(d){r={error:d}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}},r.prototype.onMessage=function(n){var e,o;this.onMessageHandlers.has(n.action)&&((u=this.onMessageHandlers.get(n.action)).handler(this,n),u.onlyOnce&&(this.onMessageHandlers.delete(n.action),this.unsubscribe(n.action)));if(this.onMessageConditionalHandlers.has(n.action)){var r=this.onMessageConditionalHandlers.get(n.action);try{for(var s=t(r),a=s.next();!a.done;a=s.next()){var u=a.value;n.gameObject&&i.queryConditionCheck(n.gameObject,u.condition)&&u.handler(this,n)}}catch(l){e={error:l}}finally{try{a&&!a.done&&(o=s.return)&&o.call(s)}finally{if(e)throw e.error}}}},r.prototype.onUpdate=function(n,t){0===this.firstRun&&(this.firstRun=t),0!==this.timeout&&t-this.firstRun>=this.timeout?this.finish():null!=this.onUpdateFunc&&this.onUpdateFunc(this,n,t)},r.prototype.onRemove=function(){null!=this.onRemoveFunc&&this.onRemoveFunc(this)},r.prototype.onFinish=function(){null!=this.onFinishFunc&&this.onFinishFunc(this)},r}(r.default);exports.GenericComponent=s; },{"../engine/component":"pk3I","../utils/query-condition":"TQ1f"}],"X5E7":[function(require,module,exports) { "use strict";var e=this&&this.__extends||function(){var e=function(t,_){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var _ in t)t.hasOwnProperty(_)&&(e[_]=t[_])})(t,_)};return function(t,_){function E(){this.constructor=t}e(t,_),t.prototype=null===_?Object.create(_):(E.prototype=_.prototype,new E)}}(),t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var _,E=t(require("../engine/component"));!function(e){e[e.KEY_LEFT=37]="KEY_LEFT",e[e.KEY_UP=38]="KEY_UP",e[e.KEY_RIGHT=39]="KEY_RIGHT",e[e.KEY_DOWN=40]="KEY_DOWN",e[e.KEY_CTRL=17]="KEY_CTRL",e[e.KEY_ALT=18]="KEY_ALT",e[e.KEY_SPACE=32]="KEY_SPACE",e[e.KEY_SHIFT=16]="KEY_SHIFT",e[e.KEY_ENTER=13]="KEY_ENTER",e[e.KEY_A=65]="KEY_A",e[e.KEY_B=66]="KEY_B",e[e.KEY_C=67]="KEY_C",e[e.KEY_D=68]="KEY_D",e[e.KEY_E=69]="KEY_E",e[e.KEY_F=70]="KEY_F",e[e.KEY_G=71]="KEY_G",e[e.KEY_H=72]="KEY_H",e[e.KEY_I=73]="KEY_I",e[e.KEY_J=74]="KEY_J",e[e.KEY_K=75]="KEY_K",e[e.KEY_L=76]="KEY_L",e[e.KEY_M=77]="KEY_M",e[e.KEY_N=78]="KEY_N",e[e.KEY_O=79]="KEY_O",e[e.KEY_P=80]="KEY_P",e[e.KEY_Q=81]="KEY_Q",e[e.KEY_R=82]="KEY_R",e[e.KEY_S=83]="KEY_S",e[e.KEY_T=84]="KEY_T",e[e.KEY_U=85]="KEY_U",e[e.KEY_V=86]="KEY_V",e[e.KEY_W=87]="KEY_W",e[e.KEY_X=88]="KEY_X",e[e.KEY_Y=89]="KEY_Y",e[e.KEY_Z=90]="KEY_Z"}(_=exports.Keys||(exports.Keys={}));var K=function(t){function _(){var e=t.call(this)||this;return e.keys=new Set,e.onKeyDown=function(t){e.keys.add(t.keyCode)},e.onKeyUp=function(t){e.keys.delete(t.keyCode)},e._name=_.name,e}return e(_,t),_.prototype.onInit=function(){document.addEventListener("keyup",this.onKeyUp,!1),document.addEventListener("keydown",this.onKeyDown,!1)},_.prototype.onRemove=function(){document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("keydown",this.onKeyDown)},_.prototype.isKeyPressed=function(e){return this.keys.has(e)},_}(E.default);exports.KeyInputComponent=K; },{"../engine/component":"pk3I"}],"wnZQ":[function(require,module,exports) { "use strict";var e=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),t=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(o){i={error:o}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return a};Object.defineProperty(exports,"__esModule",{value:!0});var r,i=require("./key-input-component"),s=require("../engine/game-object");!function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.RIGHT=2]="RIGHT",e[e.LEFT=3]="LEFT",e[e.X=4]="X",e[e.Y=5]="Y",e[e.A=6]="A",e[e.B=7]="B"}(r=exports.GamepadButtons||(exports.GamepadButtons={}));var a=function(a){function o(e){var t=a.call(this)||this;return t.pressedButtons=new Map,t.renderRequired=!1,t.pointerDown=function(e){var n=e.data.identifier,r=t.getPressedButton(t.getPos(e.data.originalEvent));null!=r&&(t.pressedButtons.set(n,r),t.renderRequired=!0)},t.pointerUp=function(e){var n=e.data.identifier;t.pressedButtons.delete(n),t.renderRequired=!0},t.pointerMove=function(e){var n=e.data.identifier,r=t.getPressedButton(t.getPos(e.data.originalEvent));null!==r?(t.pressedButtons.set(n,r),t.renderRequired=!0):(t.pressedButtons.delete(n),t.renderRequired=!0)},t._name=i.KeyInputComponent.name,t.keyMapper=e,t}return e(o,a),o.prototype.onInit=function(){this.gamePadRenderer=new s.Graphics("gamepad"),this.renderButtons()},o.prototype.renderButtons=function(){this.gamePadRenderer.clear();var e=this.scene.app.screen.width,t=this.scene.app.screen.height,n=.15*e,r=.85*e,i=.75*t,s=.14*t,a=s/1.8;if(!this.buttons){this.buttons=[new PIXI.Rectangle(n-a/2,i-a/2-a,a,a),new PIXI.Rectangle(n-a/2,i-a/2+a,a,a),new PIXI.Rectangle(n-a/2-a,i-a/2,a,a),new PIXI.Rectangle(n-a/2+a,i-a/2,a,a),new PIXI.Rectangle(r-a/2,i-a/2-a,a,a),new PIXI.Rectangle(r-a/2,i-a/2+a,a,a),new PIXI.Rectangle(r-a/2-a,i-a/2,a,a),new PIXI.Rectangle(r-a/2+a,i-a/2,a,a)];var o=1.3*a;this.buttonHitRects=[new PIXI.Rectangle(n-o/2,i-o/2-o,o,o),new PIXI.Rectangle(n-o/2,i-o/2+o,o,o),new PIXI.Rectangle(n-o/2-o,i-o/2,o,o),new PIXI.Rectangle(n-o/2+o,i-o/2,o,o),new PIXI.Rectangle(r-o/2,i-o/2-o,o,o),new PIXI.Rectangle(r-o/2,i-o/2+o,o,o),new PIXI.Rectangle(r-o/2-o,i-o/2,o,o),new PIXI.Rectangle(r-o/2+o,i-o/2,o,o)]}this.gamePadRenderer.beginFill(4473924,.5),this.gamePadRenderer.drawCircle(n,i,s),this.gamePadRenderer.drawRect(n-a/2,i-a/2,a,a),this.gamePadRenderer.beginFill(11184810,this.keys.has(this.keyMapper.KEY_UP)?.8:.5),this.gamePadRenderer.drawRect(this.buttons[0].x,this.buttons[0].y,this.buttons[0].width,this.buttons[0].height),this.gamePadRenderer.beginFill(11184810,this.keys.has(this.keyMapper.KEY_DOWN)?.8:.5),this.gamePadRenderer.drawRect(this.buttons[1].x,this.buttons[1].y,this.buttons[1].width,this.buttons[1].height),this.gamePadRenderer.beginFill(11184810,this.keys.has(this.keyMapper.KEY_LEFT)?.8:.5),this.gamePadRenderer.drawRect(this.buttons[2].x,this.buttons[2].y,this.buttons[2].width,this.buttons[2].height),this.gamePadRenderer.beginFill(11184810,this.keys.has(this.keyMapper.KEY_RIGHT)?.8:.5),this.gamePadRenderer.drawRect(this.buttons[3].x,this.buttons[3].y,this.buttons[3].width,this.buttons[3].height),this.gamePadRenderer.beginFill(11184810,.5),this.gamePadRenderer.drawPolygon([n,i-1.3*a,n+a/3,i-a/1.5,n-a/3,i-a/1.5]),this.gamePadRenderer.drawPolygon([n,i+1.3*a,n+a/3,i+a/1.5,n-a/3,i+a/1.5]),this.gamePadRenderer.drawPolygon([n+1.3*a,i,n+a/1.5,i-a/3,n+a/1.5,i+a/3]),this.gamePadRenderer.drawPolygon([n-1.3*a,i,n-a/1.5,i-a/3,n-a/1.5,i+a/3]),this.gamePadRenderer.beginFill(4473924,.5),this.gamePadRenderer.drawCircle(r,i,s),this.gamePadRenderer.beginFill(this.keyMapper.KEY_B?15328623:4473924,this.keys.has(this.keyMapper.KEY_B)?1:.2),this.gamePadRenderer.drawCircle(r,i-a,a/1.8),this.gamePadRenderer.beginFill(this.keyMapper.KEY_Y?15298415:4473924,this.keys.has(this.keyMapper.KEY_Y)?1:.2),this.gamePadRenderer.drawCircle(r,i+a,a/1.8),this.gamePadRenderer.beginFill(this.keyMapper.KEY_A?7334278:4473924,this.keys.has(this.keyMapper.KEY_A)?1:.2),this.gamePadRenderer.drawCircle(r-a,i,a/1.8),this.gamePadRenderer.beginFill(this.keyMapper.KEY_X?7303657:4473924,this.keys.has(this.keyMapper.KEY_X)?1:.2),this.gamePadRenderer.drawCircle(r+a,i,a/1.8),this.gamePadRenderer.endFill(),this.gamePadRenderer.on("touchstart",this.pointerDown),this.gamePadRenderer.on("touchend",this.pointerUp),this.gamePadRenderer.on("touchendoutside",this.pointerUp),this.gamePadRenderer.on("touchcancel",this.pointerUp),this.gamePadRenderer.on("touchmove",this.pointerMove),this.gamePadRenderer.interactive=!0,this.owner.asContainer().sortableChildren=!0,this.gamePadRenderer.zIndex=1e3,this.owner.asContainer().addChild(this.gamePadRenderer)},o.prototype.onRemove=function(){this.gamePadRenderer.removeListener("touchstart",this.pointerDown),this.gamePadRenderer.removeListener("touchend",this.pointerUp),this.gamePadRenderer.removeListener("touchendoutside",this.pointerUp),this.gamePadRenderer.removeListener("touchcancel",this.pointerUp),this.gamePadRenderer.removeListener("touchmove",this.pointerMove)},o.prototype.onUpdate=function(e,i){var s,a;this.keys.clear();try{for(var o=t(this.pressedButtons),h=o.next();!h.done;h=o.next()){var d=n(h.value,2)[1];d===r.UP&&this.keyMapper.KEY_UP&&this.keys.add(this.keyMapper.KEY_UP),d===r.DOWN&&this.keyMapper.KEY_DOWN&&this.keys.add(this.keyMapper.KEY_DOWN),d===r.LEFT&&this.keyMapper.KEY_LEFT&&this.keys.add(this.keyMapper.KEY_LEFT),d===r.RIGHT&&this.keyMapper.KEY_RIGHT&&this.keys.add(this.keyMapper.KEY_RIGHT),d===r.X&&this.keyMapper.KEY_X&&this.keys.add(this.keyMapper.KEY_X),d===r.Y&&this.keyMapper.KEY_Y&&this.keys.add(this.keyMapper.KEY_Y),d===r.A&&this.keyMapper.KEY_A&&this.keys.add(this.keyMapper.KEY_A),d===r.B&&this.keyMapper.KEY_B&&this.keys.add(this.keyMapper.KEY_B)}}catch(p){s={error:p}}finally{try{h&&!h.done&&(a=o.return)&&a.call(o)}finally{if(s)throw s.error}}this.renderRequired&&(this.renderButtons(),this.renderRequired=!1)},o.prototype.getPos=function(e){var t=this.scene.app.view.getBoundingClientRect(),n=this.scene.app.renderer.resolution,r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY;return{posX:Math.round((r-t.left)/(t.right-t.left)*this.scene.app.view.width/n),posY:Math.round((i-t.top)/(t.bottom-t.top)*this.scene.app.view.height/n)}},o.prototype.getPressedButton=function(e){return this.buttonHitRects[0].contains(e.posX,e.posY)?r.UP:this.buttonHitRects[1].contains(e.posX,e.posY)?r.DOWN:this.buttonHitRects[2].contains(e.posX,e.posY)?r.LEFT:this.buttonHitRects[3].contains(e.posX,e.posY)?r.RIGHT:this.buttonHitRects[4].contains(e.posX,e.posY)?r.B:this.buttonHitRects[5].contains(e.posX,e.posY)?r.Y:this.buttonHitRects[6].contains(e.posX,e.posY)?r.A:this.buttonHitRects[7].contains(e.posX,e.posY)?r.X:null},o}(i.KeyInputComponent);exports.VirtualGamepadComponent=a; },{"./key-input-component":"X5E7","../engine/game-object":"Sn3S"}],"zbVQ":[function(require,module,exports) { "use strict";var e=this&&this.__extends||function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),t=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var o,s=n(require("../engine/component")),i=n(require("../engine/message"));!function(e){e.POINTER_TAP="pointer-tap",e.POINTER_DOWN="pointer-down",e.POINTER_OVER="pointer-over",e.POINTER_RELEASE="pointer-release"}(o=exports.PointerMessages||(exports.PointerMessages={}));var r=function(n){function s(e,t,s,i){void 0===e&&(e=!0),void 0===t&&(t=!1),void 0===s&&(s=!1),void 0===i&&(i=!1);var r=n.call(this)||this;return r.lastTouch=null,r.handleStart=function(e){e.preventDefault();var t=e instanceof TouchEvent;t&&1===e.changedTouches.length?r.lastTouch=e.changedTouches[0]:r.lastTouch=e,r.handlePointerDown&&r.sendMessage(o.POINTER_DOWN,{mousePos:r.getMousePos(r.scene.app.view,e,t),isTouch:t})},r.handleMove=function(e){e.preventDefault();var t=void 0!==e.changedTouches;r.sendMessage(o.POINTER_OVER,{mousePos:r.getMousePos(r.scene.app.view,e,t),isTouch:t})},r.handleEnd=function(e){var t,n;e.preventDefault();var s=e instanceof TouchEvent;null!=r.lastTouch&&(s&&1===e.changedTouches.length?(t=e.changedTouches[0].pageX,n=e.changedTouches[0].pageY):(t=e.pageX,n=e.pageY),Math.abs(r.lastTouch.pageX-t)<10&&Math.abs(r.lastTouch.pageY-n)<10&&(s||r.handleClick)?r.sendMessage(o.POINTER_TAP,{mousePos:r.getMousePos(r.scene.app.view,e,s),isTouch:s}):r.sendMessage(o.POINTER_RELEASE,{mousePos:r.getMousePos(r.scene.app.view,e,s),isTouch:s}))},r.handleClick=e,r.handlePointerDown=t,r.handlePointerOver=s,r.handlePointerRelease=i,r}return e(s,n),s.prototype.onInit=function(){this.lastTouch=null,this.messagesToSend=[];var e=this.scene.app.view;e.addEventListener("touchstart",this.handleStart,!1),e.addEventListener("touchend",this.handleEnd,!1),e.addEventListener("mousedown",this.handleStart,!1),(this.handlePointerRelease||this.handleClick)&&e.addEventListener("mouseup",this.handleEnd,!1),this.handlePointerOver&&(e.addEventListener("mousemove",this.handleMove,!1),e.addEventListener("touchmove",this.handleMove,!1))},s.prototype.onUpdate=function(e,n){var o,s;try{for(var i=t(this.messagesToSend),r=i.next();!r.done;r=i.next()){var a=r.value;this.scene.sendMessage(a)}}catch(h){o={error:h}}finally{try{r&&!r.done&&(s=i.return)&&s.call(i)}finally{if(o)throw o.error}}this.messagesToSend=[]},s.prototype.onFinish=function(){var e=this.scene.app.view;e.removeEventListener("touchstart",this.handleStart),e.removeEventListener("touchend",this.handleEnd),e.removeEventListener("mousedown",this.handleStart),(this.handlePointerRelease||this.handleClick)&&e.removeEventListener("mouseup",this.handleEnd),this.handlePointerOver&&(e.removeEventListener("mousemove",this.handleMove),e.removeEventListener("touchmove",this.handleMove))},s.prototype.sendMessage=function(e,t){void 0===t&&(t=null),this.messagesToSend.push(new i.default(e,this,this.owner,t))},s.prototype.getMousePos=function(e,t,n){var o=e.getBoundingClientRect(),s=this.scene.app.renderer.resolution,i=n?t.changedTouches[0].clientX:t.clientX,r=n?t.changedTouches[0].clientY:t.clientY;return{posX:Math.round((i-o.left)/(o.right-o.left)*this.scene.app.view.width/s),posY:Math.round((r-o.top)/(o.bottom-o.top)*this.scene.app.view.height/s)}},s}(s.default);exports.PointerInputComponent=r; },{"../engine/component":"pk3I","../engine/message":"lHSJ"}],"zNlD":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(){function t(t,e){this._x=t,this._y=null==e?this._x:e}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!0,configurable:!0}),t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.multiply=function(e){return new t(e*this.x,e*this.y)},t.prototype.divide=function(e){return new t(this.x/e,this.y/e)},t.prototype.distance=function(e){return new t(this.x-e.x,this.y-e.y).magnitude()},t.prototype.squareDistance=function(e){return new t(this.x-e.x,this.y-e.y).magnitudeSquared()},t.prototype.manhattanDistance=function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},t.prototype.normalize=function(){var e=this.magnitude();return new t(this.x/e,this.y/e)},t.prototype.magnitudeSquared=function(){return this.dot(this)},t.prototype.magnitude=function(){return Math.sqrt(this.magnitudeSquared())},t.prototype.angle=function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},t.prototype.dot=function(t){return this.x*t.x+this.y*t.y},t.prototype.limit=function(e){var n=this.magnitudeSquared();return e=this.duration&&(this.infinite?this.timeSoFar=0:this.finish())},e}(e.default);exports.default=r; },{"./base-component":"OLeo"}],"xaq9":[function(require,module,exports) { "use strict";var e;Object.defineProperty(exports,"__esModule",{value:!0}),function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"}(e=exports.Direction||(exports.Direction={})); },{}],"DtGS":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function o(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../utils"),o=i(require("./base-component")),s=require("../direction"),r=10,a=function(i){function o(t,e,o,s){var r=i.call(this)||this;return r.position=t,r.direction=e,r.duration=s,r.eatingAnim=o,r}return t(o,i),o.prototype.onInit=function(){switch(i.prototype.onInit.call(this),this.timeSoFar=0,this.realPosFrom=e.mapToWorld(this.position.x,this.position.y),this.direction){case s.Direction.LEFT:this.realPosTo=e.mapToWorld(this.position.x-1,this.position.y);break;case s.Direction.RIGHT:this.realPosTo=e.mapToWorld(this.position.x+1,this.position.y);break;case s.Direction.UP:this.realPosTo=e.mapToWorld(this.position.x,this.position.y-1);break;case s.Direction.DOWN:this.realPosTo=e.mapToWorld(this.position.x,this.position.y+1)}this.distance=this.realPosFrom.distance(this.realPosTo),this.distanceVec=this.realPosTo.subtract(this.realPosFrom)},o.prototype.onUpdate=function(t,i){var e=this.owner.pixiObj.texture;this.timeSoFar+=t;var o=this.owner.pixiObj.position,a=Math.min(this.distance,this.timeSoFar/this.duration*this.distance);if(o.x=this.realPosFrom.x+this.distanceVec.x*(a/this.distance),o.y=this.realPosFrom.y+this.distanceVec.y*(a/this.distance),this.eatingAnim){var n=Math.floor(a/this.distance*(r-1));8===n&&(n=6),9===n&&(n=0);var c=void 0;switch(this.direction){case s.Direction.LEFT:c=this.spriteSheetData.pacman_walk_left;break;case s.Direction.RIGHT:c=this.spriteSheetData.pacman_walk_right;break;case s.Direction.DOWN:c=this.spriteSheetData.pacman_walk_down;break;case s.Direction.UP:c=this.spriteSheetData.pacman_walk_up}e.frame=new PIXI.Rectangle(c.x+n*c.w,c.y,c.w,c.h)}else switch(this.direction){case s.Direction.LEFT:e.frame=new PIXI.Rectangle(256,0,32,32);break;case s.Direction.RIGHT:e.frame=new PIXI.Rectangle(0,0,32,32);break;case s.Direction.DOWN:e.frame=new PIXI.Rectangle(0,32,32,32);break;case s.Direction.UP:e.frame=new PIXI.Rectangle(256,32,32,32)}a>=this.distance&&this.finish()},o}(o.default);exports.default=a; },{"../utils":"xUyy","./base-component":"OLeo","../direction":"xaq9"}],"mGcY":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),e=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("../../../../libs/pixi-component")),s=require("../constants"),o=require("../utils"),r=i(require("./pacman-walk-anim")),a=i(require("./base-component")),u=require("../direction"),c=i(require("./sprite-animator")),l=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),Object.defineProperty(i.prototype,"unit",{get:function(){return this.owner.getAttribute(s.Attributes.GAME_UNIT)},enumerable:!0,configurable:!0}),i.prototype.onInit=function(){e.prototype.onInit.call(this),this.subscribe(s.Messages.PACMAN_KILLED,s.Messages.VICTORY,s.Messages.PACMAN_REVIVED)},i.prototype.onMessage=function(t){if(t.action===s.Messages.PACMAN_KILLED)this.currentWalkAnim&&(this.currentWalkAnim.finish(),this.currentWalkAnim=null),this.owner.addComponent(new c.default(this.spriteSheetData.pacman_death,this.spriteSheetData.pacman_death.frames*(200/this.model.gameSpeed),!1));else if(t.action===s.Messages.VICTORY)this.currentWalkAnim&&(this.currentWalkAnim.finish(),this.currentWalkAnim=null),this.owner.addComponent(new c.default(this.spriteSheetData.pacman_win,this.spriteSheetData.pacman_win.frames*(500/this.model.gameSpeed),!1));else if(t.action===s.Messages.PACMAN_REVIVED){var e=this.spriteSheetData.pacman_walk_left;this.owner.asSprite().texture.frame=new PIXI.Rectangle(e.x,e.y,e.w,e.h)}},i.prototype.followDirection=function(t){var e=this;if(this.unit.state!==s.UnitState.STANDING||this.model.state!==s.GameState.DEFAULT&&this.model.state!==s.GameState.RUSH_MODE)return!1;var i=this.unit.pos.x,o=this.unit.pos.y;switch(t){case u.Direction.LEFT:if(!this.unit.canGoLeft())return!1;i--;break;case u.Direction.RIGHT:if(!this.unit.canGoRight())return!1;i++;break;case u.Direction.UP:if(!this.unit.canGoUp())return!1;o--;break;case u.Direction.DOWN:if(!this.unit.canGoDown())return!1;o++}var a=new n.Vector(i,o);this.unit.state=s.UnitState.WALKING,this.unit.dir=t,this.currentWalkAnim&&(this.currentWalkAnim.finish(),this.currentWalkAnim=null),this.owner.addComponent((new n.ChainComponent).execute(function(){return e.currentWalkAnim=new r.default(e.unit.pos,t,e.model.isSomethingEatable(a),150)}).addComponentAndWait(function(){return e.currentWalkAnim}).execute(function(){e.unit.state===s.UnitState.WALKING&&(e.confirmPositionChange(t),e.unit.pos.equals(e.model.easternTunnelPos)?(e.unit.pos=e.model.westernTunnelPos.clone(),e.followDirection(u.Direction.LEFT)):e.unit.pos.equals(e.model.westernTunnelPos)&&(e.unit.pos=e.model.easternTunnelPos.clone(),e.followDirection(u.Direction.DOWN)),e.isRunning&&e.onUpdate(0,0))}),!0)},i.prototype.confirmPositionChange=function(t){this.unit.state=s.UnitState.STANDING,this.unit.dir=t,this.unit.makeStep();var e=o.mapToWorld(this.unit.pos.x,this.unit.pos.y);this.owner.pixiObj.position.set(e.x,e.y);var i=this.model.map.getTile(this.unit.pos.x,this.unit.pos.y).specialFunction;i===s.SpecFunctions.PELLET?this.model.eatPellet(this.unit.pos)&&this.sendMessage(s.Messages.BONUS_TAKEN,this.unit.pos):i===s.SpecFunctions.PACDOT&&this.model.eatPacDot(this.unit.pos)&&this.sendMessage(s.Messages.PACDOT_EATEN,this.unit.pos),this.model.keyPos.x===this.unit.pos.x&&this.model.keyPos.y===this.unit.pos.y&&(this.model.fetchKey(),this.sendMessage(s.Messages.KEY_FETCHED))},i}(a.default);exports.PacmanController=l;var h=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return t(i,e),i.prototype.onUpdate=function(t,e){var i=this.scene.stage.findComponentByName(n.KeyInputComponent.name);this.unit.state===s.UnitState.STANDING&&(i.isKeyPressed(n.Keys.KEY_LEFT)?this.followDirection(u.Direction.LEFT):i.isKeyPressed(n.Keys.KEY_RIGHT)?this.followDirection(u.Direction.RIGHT):i.isKeyPressed(n.Keys.KEY_UP)?this.followDirection(u.Direction.UP):i.isKeyPressed(n.Keys.KEY_DOWN)&&this.followDirection(u.Direction.DOWN))},i}(l);exports.PacmanKeyController=h; },{"../../../../libs/pixi-component":"rNDA","../constants":"vwVm","../utils":"xUyy","./pacman-walk-anim":"DtGS","./base-component":"OLeo","../direction":"xaq9","./sprite-animator":"zF2w"}],"nlAJ":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(e,a){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a])})(e,a)};return function(e,a){function n(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(n.prototype=a.prototype,new n)}}(),e=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("../../../../libs/pixi-component")),i=a(require("./base-component")),o=require("../constants"),s=a(require("./sprite-animator")),r=function(e){function a(){var t=null!==e&&e.apply(this,arguments)||this;return t.pendingAnimation=null,t}return t(a,e),a.prototype.onInit=function(){e.prototype.onInit.call(this),this.gateState=o.GateState.CLOSED},a.prototype.onUpdate=function(t,e){var a=this;this.isAtGate()&&this.model.keyTaken&&(this.gateState===o.GateState.CLOSED||this.gateState===o.GateState.CLOSING)&&(this.gateState===o.GateState.CLOSED?(this.pendingAnimation=new s.default(this.spriteSheetData.gate,this.spriteSheetData.gate.frames*(200/this.model.gameSpeed),!1,!1),this.owner.addComponent((new n.ChainComponent).addComponentAndWait(function(){return a.pendingAnimation}).execute(function(){return a.confirmGateStateChange()}),!0)):this.pendingAnimation&&this.pendingAnimation.isRunning&&this.pendingAnimation.invert(),this.gateState=o.GateState.OPENING),this.isAtGate()||this.gateState!==o.GateState.OPEN&&this.gateState!==o.GateState.OPENING||(this.gateState===o.GateState.OPEN?(this.pendingAnimation=new s.default(this.spriteSheetData.gate,this.spriteSheetData.gate.frames*(500/this.model.gameSpeed),!1,!0),this.gateState=o.GateState.CLOSING,this.owner.addComponent((new n.ChainComponent).waitTime(2e3).execute(function(){a.model.map.getTile(a.model.gatePos.x,a.model.gatePos.y).state=o.GateState.CLOSED}).addComponentAndWait(function(){return a.pendingAnimation}).execute(function(){return a.confirmGateStateChange()}),!0)):(this.pendingAnimation&&this.pendingAnimation.isRunning&&this.pendingAnimation.invert(),this.model.map.getTile(this.model.gatePos.x,this.model.gatePos.y).state=o.GateState.CLOSED,this.gateState=o.GateState.CLOSING))},a.prototype.confirmGateStateChange=function(){this.gateState===o.GateState.OPENING?(this.gateState=o.GateState.OPEN,this.model.map.getTile(this.model.gatePos.x,this.model.gatePos.y).state=o.GateState.OPEN):this.gateState===o.GateState.CLOSING&&(this.gateState=o.GateState.CLOSED,this.model.map.getTile(this.model.gatePos.x,this.model.gatePos.y).state=o.GateState.CLOSED)},a.prototype.isAtGate=function(){return this.model.gatePos.x===this.model.pacman.pos.x&&Math.abs(this.model.gatePos.y-this.model.pacman.pos.y)<=1},a}(i.default);exports.default=r; },{"../../../../libs/pixi-component":"rNDA","./base-component":"OLeo","../constants":"vwVm","./sprite-animator":"zF2w"}],"KSbh":[function(require,module,exports) { "use strict";var e=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s};Object.defineProperty(exports,"__esModule",{value:!0}),exports.isMobileDevice=function(){return/(iphone|ipod|ipad|android)/gi.test(navigator.userAgent)},exports.isPdfPrint=function(){return window.location.search.match(/print-pdf/gi)},exports.resizeContainer=function(e,t,r){var n,o=!1;window.innerWidth/window.innerHeight>t/r?n=window.innerHeight/r:(n=window.innerWidth/t,o=!0);var i=function(){return setTimeout(function(){window.scrollTo(0,1)},10)};exports.isMobileDevice()&&(document.documentElement.style.setProperty("--vh",.01*window.innerHeight+"px"),window.addEventListener("load",i,!1),window.addEventListener("orientationchange",i,!1));var s="scale("+n+")",a=o?window.innerHeight/2-r/2:(n-1)*r/2;e.style.setProperty("position","absolute"),e.style.setProperty("MozTransform",s),e.style.setProperty("transform",s),e.style.setProperty("WebkitTransform",s),e.style.setProperty("top",a+"px"),e.style.setProperty("left",(n-1)*t/2+(window.innerWidth-t*n)/2+"px")},exports.shuffle=function(t){for(var r,n=t.length-1;n>0;n--){var o=Math.floor(Math.random()*(n+1));r=e([t[o],t[n]],2),t[n]=r[0],t[o]=r[1]}return t},exports.checkTime=function(e,t,r){return t-e>1e3/r}; },{}],"Z06w":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),e=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var i=e(require("../../../../libs/pixi-component")),r=require("../constants"),a=n(require("./base-component")),o=n(require("./sprite-animator")),s=require("../../../utils/functions"),u=function(e){function n(t){var n=e.call(this)||this;return n.lastSpawn=0,n.isSpawning=!1,n.spawnFrequency=t,n.maxSpawnFrequency=t,n}return t(n,e),n.prototype.onInit=function(){e.prototype.onInit.call(this),this.lastSpawn=0,this.factory=this.owner.scene.getGlobalAttribute(r.Attributes.FACTORY)},n.prototype.onUpdate=function(t,e){var n=this;if(0===this.lastSpawn&&(this.lastSpawn=e),this.model.spiders.size<=10&&s.checkTime(this.lastSpawn,e,this.spawnFrequency/60)&&!this.isSpawning&&(this.model.state===r.GameState.DEFAULT||this.model.state===r.GameState.RUSH_MODE)){this.isSpawning=!0,this.lastSpawn=e,this.spawnFrequency=this.maxSpawnFrequency/2+Math.random()*this.maxSpawnFrequency/2;var a=this.owner.getAttribute(r.Attributes.SPRITE_DATA);this.owner.addComponent((new i.ChainComponent).addComponentAndWait(new o.default(a,a.frames*(500/this.model.gameSpeed),!1,!1)).execute(function(){return n.factory.spawnSpider(n.scene,n.model)}).waitTime(2e3).addComponentAndWait(new o.default(a,a.frames*(500/this.model.gameSpeed),!1,!0)).execute(function(){return n.isSpawning=!1}))}},n}(a.default);exports.default=u; },{"../../../../libs/pixi-component":"rNDA","../constants":"vwVm","./base-component":"OLeo","./sprite-animator":"zF2w","../../../utils/functions":"KSbh"}],"OJyB":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t[e]=i[e])})(i,e)};return function(i,e){function o(){this.constructor=i}t(i,e),i.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}}(),i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../utils"),o=i(require("./base-component")),s=require("../direction"),r=function(i){function o(t,e,o){var s=i.call(this)||this;return s.position=t,s.direction=e,s.duration=o,s}return t(o,i),o.prototype.onInit=function(){switch(i.prototype.onInit.call(this),this.timeSoFar=0,this.realPosFrom=e.mapToWorld(this.position.x,this.position.y),this.direction){case s.Direction.LEFT:this.realPosTo=e.mapToWorld(this.position.x-1,this.position.y);break;case s.Direction.RIGHT:this.realPosTo=e.mapToWorld(this.position.x+1,this.position.y);break;case s.Direction.UP:this.realPosTo=e.mapToWorld(this.position.x,this.position.y-1);break;case s.Direction.DOWN:this.realPosTo=e.mapToWorld(this.position.x,this.position.y+1)}this.distance=this.realPosFrom.distance(this.realPosTo),this.distanceVec=this.realPosTo.subtract(this.realPosFrom)},o.prototype.onUpdate=function(t,i){var e=this.owner.pixiObj.texture;this.timeSoFar+=t;var o=this.owner.pixiObj.position,r=Math.min(this.distance,this.timeSoFar/this.duration*this.distance);o.x=this.realPosFrom.x+this.distanceVec.x*(r/this.distance),o.y=this.realPosFrom.y+this.distanceVec.y*(r/this.distance);var n,a=Math.floor(r/this.distance*7)%7,h=this.model.isRushMode?2:0;switch(this.direction){case s.Direction.LEFT:n=this.spriteSheetData.spider_walk_left;break;case s.Direction.RIGHT:n=this.spriteSheetData.spider_walk_right;break;case s.Direction.DOWN:n=this.spriteSheetData.spider_walk_down;break;case s.Direction.UP:n=this.spriteSheetData.spider_walk_up}e.frame=new PIXI.Rectangle(n.x+a*n.w,n.y+h*n.h,n.w,n.h),r>=this.distance&&this.finish()},o}(o.default);exports.default=r; },{"../utils":"xUyy","./base-component":"OLeo","../direction":"xaq9"}],"l2Y9":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),e=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var i=e(require("../../../../libs/pixi-component")),o=require("../constants"),r=n(require("./spider-walk-anim")),s=n(require("./base-component")),a=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasDirection=!1,t}return t(n,e),n.prototype.onInit=function(){e.prototype.onInit.call(this),this.unit=this.owner.getAttribute(o.Attributes.GAME_UNIT),this.subscribe(o.Messages.VICTORY,o.Messages.DEFEAT,o.Messages.PACMAN_KILLED)},n.prototype.onMessage=function(t){t.action!==o.Messages.VICTORY&&t.action!==o.Messages.DEFEAT&&t.action!==o.Messages.PACMAN_KILLED||(this.model.killSpider(this.unit),this.owner.remove())},n.prototype.onUpdate=function(t,e){this.walk()},n.prototype.walk=function(){var t=this;if(!this.hasDirection){var e=null,n=this.model.map.search(this.unit.pos,this.model.pacman.pos);if(n)e=n[0];else if(this.unit.canMakeStep())e=this.unit.dir;else{var s=this.unit.getWalkableDirections();e=s[Math.floor(Math.random()*s.length)]}null!=e&&(this.hasDirection=!0,this.unit.state=o.UnitState.WALKING,this.owner.addComponent((new i.ChainComponent).addComponentAndWait(function(){return new r.default(t.unit.pos,e,500)}).execute(function(){t.unit.state=o.UnitState.STANDING,t.hasDirection=!1,t.unit.dir=e,t.unit.makeStep()})))}},n}(s.default);exports.default=a; },{"../../../../libs/pixi-component":"rNDA","../constants":"vwVm","./spider-walk-anim":"OJyB","./base-component":"OLeo"}],"zr7w":[function(require,module,exports) { "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=require("@pixi/loaders"),e=require("@pixi/ticker"),n=require("@pixi/utils"),o=require("@pixi/core"),i=function(){function t(t,e){this._output=e,this._input=t}return Object.defineProperty(t.prototype,"destination",{get:function(){return this._input},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._filters},set:function(t){var e=this;if(this._filters&&(this._filters.forEach(function(t){t&&t.disconnect()}),this._filters=null,this._input.connect(this._output)),t&&t.length){this._filters=t.slice(0),this._input.disconnect();var n=null;t.forEach(function(t){null===n?e._input.connect(t.destination):n.connect(t.destination),n=t}),n.connect(this._output)}},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this.filters=null,this._input=null,this._output=null},t}(),r=function(){function t(t,e){this.init(t,e)}return t.prototype.init=function(t,e){this.destination=t,this.source=e||t},t.prototype.connect=function(t){this.source.connect(t)},t.prototype.disconnect=function(){this.source.disconnect()},t.prototype.destroy=function(){this.disconnect(),this.destination=null,this.source=null},t}(),s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function u(t,e){function n(){this.constructor=t}s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a,c=function(){return(c=Object.assign||function(t){for(var e,n=1,o=arguments.length;n10&&(t/=1e3),t||0},Object.defineProperty(n.prototype,"_enabled",{set:function(t){e.Ticker.shared.remove(this._updateListener,this),t&&e.Ticker.shared.add(this._updateListener,this)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"progress",{get:function(){return this._progress},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),n.prototype.destroy=function(){this.removeAllListeners(),this._internalStop(),this._gain&&(this._gain.disconnect(),this._gain=null),this._media&&(this._media.context.events.off("refresh",this.refresh,this),this._media.context.events.off("refreshPaused",this.refreshPaused,this),this._media=null),this._end=null,this._speed=1,this._volume=1,this._loop=!1,this._elapsed=0,this._duration=0,this._paused=!1,this._muted=!1,this._pausedReal=!1},n.prototype.toString=function(){return"[WebAudioInstance id="+this.id+"]"},n.prototype._now=function(){return this._media.context.audioContext.currentTime},n.prototype._updateListener=function(){this._update()},n.prototype._update=function(t){if(void 0===t&&(t=!1),this._source){var e=this._now(),n=e-this._lastUpdate;if(n>0||t){var o=this._source.playbackRate.value;this._elapsed+=n*o,this._lastUpdate=e;var i=this._duration,r=void 0;if(this._source.loopStart){var s=this._source.loopEnd-this._source.loopStart;r=(this._source.loopStart+this._elapsed%s)/i}else r=this._elapsed%i/i;this._progress=r,this.emit("progress",this._progress,i)}}},n.prototype.init=function(t){this._media=t,t.context.events.on("refresh",this.refresh,this),t.context.events.on("refreshPaused",this.refreshPaused,this)},n.prototype._internalStop=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.stop(0),this._source.disconnect(),this._source=null)},n.prototype._onComplete=function(){this._source&&(this._enabled=!1,this._source.onended=null,this._source.disconnect()),this._source=null,this._progress=1,this.emit("progress",1,this._duration),this.emit("end",this)},n}(n.EventEmitter),g=function(t){function e(e){var n=this,o=e.audioContext,i=o.createBufferSource(),r=o.createGain(),s=o.createAnalyser();return i.connect(s),s.connect(r),r.connect(e.destination),(n=t.call(this,s,r)||this).context=e,n.bufferSource=i,n.gain=r,n.analyser=s,n}return u(e,t),Object.defineProperty(e.prototype,"script",{get:function(){return this._script||(this._script=this.context.audioContext.createScriptProcessor(e.BUFFER_SIZE),this._script.connect(this.context.destination)),this._script},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.bufferSource.disconnect(),this._script&&this._script.disconnect(),this.gain.disconnect(),this.analyser.disconnect(),this.bufferSource=null,this._script=null,this.gain=null,this.analyser=null,this.context=null},e.prototype.cloneBufferSource=function(){var t=this.bufferSource,e=this.context.audioContext.createBufferSource();e.buffer=t.buffer,_.setParamValue(e.playbackRate,t.playbackRate.value),e.loop=t.loop;var n=this.context.audioContext.createGain();return e.connect(n),n.connect(this.destination),{source:e,gain:n}},Object.defineProperty(e.prototype,"bufferSize",{get:function(){return this.script.bufferSize},enumerable:!0,configurable:!0}),e.BUFFER_SIZE=0,e}(i),b=function(){function t(){}return t.prototype.init=function(t){this.parent=t,this._nodes=new g(this.context),this._source=this._nodes.bufferSource,this.source=t.options.source},t.prototype.destroy=function(){this.parent=null,this._nodes.destroy(),this._nodes=null,this._source=null,this.source=null},t.prototype.create=function(){return new m(this)},Object.defineProperty(t.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isPlayable",{get:function(){return!!this._source&&!!this._source.buffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this._nodes.filters},set:function(t){this._nodes.filters=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._source.buffer.duration},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._source.buffer},set:function(t){this._source.buffer=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodes",{get:function(){return this._nodes},enumerable:!0,configurable:!0}),t.prototype.load=function(t){this.source?this._decode(this.source,t):this.parent.url?this._loadUrl(t):t&&t(new Error("sound.url or sound.source must be set"))},t.prototype._loadUrl=function(t){var e=this,n=new XMLHttpRequest,o=this.parent.url;n.open("GET",o,!0),n.responseType="arraybuffer",n.onload=function(){e.source=n.response,e._decode(n.response,t)},n.send()},t.prototype._decode=function(t,e){var n=this;this.parent.context.decode(t,function(t,o){if(t)e&&e(t);else{n.parent.isLoaded=!0,n.buffer=o;var i=n.parent.autoPlayStart();e&&e(null,n.parent,i)}})},t}(),v=function(t){function e(){var o=this,i=window,r=new e.AudioContext,s=r.createDynamicsCompressor(),u=r.createAnalyser();return u.connect(s),s.connect(r.destination),(o=t.call(this,u,s)||this)._ctx=r,o._offlineCtx=new e.OfflineAudioContext(1,2,i.OfflineAudioContext?r.sampleRate:44100),o._unlocked=!1,o.compressor=s,o.analyser=u,o.events=new n.EventEmitter,o.volume=1,o.speed=1,o.muted=!1,o.paused=!1,"running"!==r.state&&(o._unlock(),o._unlock=o._unlock.bind(o),document.addEventListener("mousedown",o._unlock,!0),document.addEventListener("touchstart",o._unlock,!0),document.addEventListener("touchend",o._unlock,!0)),o}return u(e,t),e.prototype._unlock=function(){this._unlocked||(this.playEmptySound(),"running"===this._ctx.state&&(document.removeEventListener("mousedown",this._unlock,!0),document.removeEventListener("touchend",this._unlock,!0),document.removeEventListener("touchstart",this._unlock,!0),this._unlocked=!0))},e.prototype.playEmptySound=function(){var t=this._ctx.createBufferSource();t.buffer=this._ctx.createBuffer(1,1,22050),t.connect(this._ctx.destination),t.start(0,0,0),"suspended"===t.context.state&&t.context.resume()},Object.defineProperty(e,"AudioContext",{get:function(){var t=window;return t.AudioContext||t.webkitAudioContext||null},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OfflineAudioContext",{get:function(){var t=window;return t.OfflineAudioContext||t.webkitOfflineAudioContext||null},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this);var e=this._ctx;void 0!==e.close&&e.close(),this.events.removeAllListeners(),this.analyser.disconnect(),this.compressor.disconnect(),this.analyser=null,this.compressor=null,this.events=null,this._offlineCtx=null,this._ctx=null},Object.defineProperty(e.prototype,"audioContext",{get:function(){return this._ctx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offlineContext",{get:function(){return this._offlineCtx},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paused",{get:function(){return this._paused},set:function(t){t&&"running"===this._ctx.state?this._ctx.suspend():t||"suspended"!==this._ctx.state||this._ctx.resume(),this._paused=t},enumerable:!0,configurable:!0}),e.prototype.refresh=function(){this.events.emit("refresh")},e.prototype.refreshPaused=function(){this.events.emit("refreshPaused")},e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this._paused},e.prototype.decode=function(t,e){this._offlineCtx.decodeAudioData(t,function(t){e(null,t)},function(t){e(new Error(t.message||"Unable to decode file"))})},e}(i),P={WebAudioMedia:b,WebAudioInstance:m,WebAudioNodes:g,WebAudioContext:v,WebAudioUtils:_},x={Filter:r,EqualizerFilter:function(t){function e(n,o,i,r,s,u,a,c,h,l){void 0===n&&(n=0),void 0===o&&(o=0),void 0===i&&(i=0),void 0===r&&(r=0),void 0===s&&(s=0),void 0===u&&(u=0),void 0===a&&(a=0),void 0===c&&(c=0),void 0===h&&(h=0),void 0===l&&(l=0);var f=this;if(!p().useLegacy){var d=[{f:e.F32,type:"lowshelf",gain:n},{f:e.F64,type:"peaking",gain:o},{f:e.F125,type:"peaking",gain:i},{f:e.F250,type:"peaking",gain:r},{f:e.F500,type:"peaking",gain:s},{f:e.F1K,type:"peaking",gain:u},{f:e.F2K,type:"peaking",gain:a},{f:e.F4K,type:"peaking",gain:c},{f:e.F8K,type:"peaking",gain:h},{f:e.F16K,type:"highshelf",gain:l}].map(function(t){var e=p().context.audioContext.createBiquadFilter();return e.type=t.type,_.setParamValue(e.Q,1),e.frequency.value=t.f,_.setParamValue(e.gain,t.gain),e});(f=t.call(this,d[0],d[d.length-1])||this).bands=d,f.bandsMap={};for(var y=0;y0&&f.bands[y-1].connect(m),f.bandsMap[m.frequency.value]=m}return f}f=t.call(this,null)||this}return u(e,t),e.prototype.setGain=function(t,e){if(void 0===e&&(e=0),!this.bandsMap[t])throw new Error("No band found for frequency "+t);_.setParamValue(this.bandsMap[t].gain,e)},e.prototype.getGain=function(t){if(!this.bandsMap[t])throw new Error("No band found for frequency "+t);return this.bandsMap[t].gain.value},Object.defineProperty(e.prototype,"f32",{get:function(){return this.getGain(e.F32)},set:function(t){this.setGain(e.F32,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f64",{get:function(){return this.getGain(e.F64)},set:function(t){this.setGain(e.F64,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f125",{get:function(){return this.getGain(e.F125)},set:function(t){this.setGain(e.F125,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f250",{get:function(){return this.getGain(e.F250)},set:function(t){this.setGain(e.F250,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f500",{get:function(){return this.getGain(e.F500)},set:function(t){this.setGain(e.F500,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f1k",{get:function(){return this.getGain(e.F1K)},set:function(t){this.setGain(e.F1K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f2k",{get:function(){return this.getGain(e.F2K)},set:function(t){this.setGain(e.F2K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f4k",{get:function(){return this.getGain(e.F4K)},set:function(t){this.setGain(e.F4K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f8k",{get:function(){return this.getGain(e.F8K)},set:function(t){this.setGain(e.F8K,t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"f16k",{get:function(){return this.getGain(e.F16K)},set:function(t){this.setGain(e.F16K,t)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.bands.forEach(function(t){_.setParamValue(t.gain,0)})},e.prototype.destroy=function(){this.bands.forEach(function(t){t.disconnect()}),this.bands=null,this.bandsMap=null},e.F32=32,e.F64=64,e.F125=125,e.F250=250,e.F500=500,e.F1K=1e3,e.F2K=2e3,e.F4K=4e3,e.F8K=8e3,e.F16K=16e3,e}(r),DistortionFilter:function(t){function e(e){void 0===e&&(e=0);var n=this;if(!p().useLegacy){var o=p().context.audioContext.createWaveShaper();return(n=t.call(this,o)||this)._distortion=o,n.amount=e,n}n=t.call(this,null)||this}return u(e,t),Object.defineProperty(e.prototype,"amount",{get:function(){return this._amount},set:function(t){t*=1e3,this._amount=t;for(var e,n=new Float32Array(44100),o=Math.PI/180,i=0;i<44100;++i)e=2*i/44100-1,n[i]=(3+t)*e*20*o/(Math.PI+t*Math.abs(e));this._distortion.curve=n,this._distortion.oversample="4x"},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._distortion=null,t.prototype.destroy.call(this)},e}(r),StereoFilter:function(t){function e(e){void 0===e&&(e=0);var n=this;if(!p().useLegacy){var o,i,r,s=p().context.audioContext;return s.createStereoPanner?r=o=s.createStereoPanner():((i=s.createPanner()).panningModel="equalpower",r=i),(n=t.call(this,r)||this)._stereo=o,n._panner=i,n.pan=e,n}n=t.call(this,null)||this}return u(e,t),Object.defineProperty(e.prototype,"pan",{get:function(){return this._pan},set:function(t){this._pan=t,this._stereo?_.setParamValue(this._stereo.pan,t):this._panner.setPosition(t,0,1-Math.abs(t))},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this._stereo=null,this._panner=null},e}(r),ReverbFilter:function(t){function e(e,n,o){void 0===e&&(e=3),void 0===n&&(n=2),void 0===o&&(o=!1);var i=this;if(!p().useLegacy)return(i=t.call(this,null)||this)._seconds=i._clamp(e,1,50),i._decay=i._clamp(n,0,100),i._reverse=o,i._rebuild(),i;i=t.call(this,null)||this}return u(e,t),e.prototype._clamp=function(t,e,n){return Math.min(n,Math.max(e,t))},Object.defineProperty(e.prototype,"seconds",{get:function(){return this._seconds},set:function(t){this._seconds=this._clamp(t,1,50),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decay",{get:function(){return this._decay},set:function(t){this._decay=this._clamp(t,0,100),this._rebuild()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reverse",{get:function(){return this._reverse},set:function(t){this._reverse=t,this._rebuild()},enumerable:!0,configurable:!0}),e.prototype._rebuild=function(){for(var t,e=p().context.audioContext,n=e.sampleRate,o=n*this._seconds,i=e.createBuffer(2,o,n),r=i.getChannelData(0),s=i.getChannelData(1),u=0;u=this._end&&!this._source.loop&&this._onComplete()},n.prototype._onComplete=function(){e.Ticker.shared.remove(this._onUpdate,this),this._internalStop(),this.emit("progress",1,this._duration),this.emit("end",this)},n.prototype.destroy=function(){e.Ticker.shared.remove(this._onUpdate,this),this.removeAllListeners();var t=this._source;t&&(t.onended=null,t.onplay=null,t.onpause=null,this._internalStop()),this._source=null,this._speed=1,this._volume=1,this._loop=!1,this._end=null,this._start=0,this._duration=0,this._playing=!1,this._pausedReal=!1,this._paused=!1,this._muted=!1,this._media&&(this._media.context.off("refresh",this.refresh,this),this._media.context.off("refreshPaused",this.refreshPaused,this),this._media=null)},n.prototype.toString=function(){return"[HTMLAudioInstance id="+this.id+"]"},n.PADDING=.1,n}(n.EventEmitter),E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.init=function(t){this.parent=t,this._source=t.options.source||new Audio,t.url&&(this._source.src=t.url)},e.prototype.create=function(){return new j(this)},Object.defineProperty(e.prototype,"isPlayable",{get:function(){return!!this._source&&4===this._source.readyState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._source.duration},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this.parent.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.removeAllListeners(),this.parent=null,this._source&&(this._source.src="",this._source.load(),this._source=null)},Object.defineProperty(e.prototype,"source",{get:function(){return this._source},enumerable:!0,configurable:!0}),e.prototype.load=function(t){var e=this._source,n=this.parent;if(4!==e.readyState){if(!n.url)return t(new Error("sound.url or sound.source must be set"));e.src=n.url;var o=function(){e.removeEventListener("canplaythrough",i),e.removeEventListener("load",i),e.removeEventListener("abort",r),e.removeEventListener("error",s)},i=function(){o(),n.isLoaded=!0;var e=n.autoPlayStart();t&&t(null,n,e)},r=function(){o(),t&&t(new Error("Sound loading has been aborted"))},s=function(){o();var n="Failed to load audio element (code: "+e.error.code+")";t&&t(new Error(n))};e.addEventListener("canplaythrough",i,!1),e.addEventListener("load",i,!1),e.addEventListener("abort",r,!1),e.addEventListener("error",s,!1),e.load()}else{n.isLoaded=!0;var u=n.autoPlayStart();t&&setTimeout(function(){t(null,n,u)},0)}},e}(n.EventEmitter),w=function(t){function e(){var e=t.call(this)||this;return e.speed=1,e.volume=1,e.muted=!1,e.paused=!1,e}return u(e,t),e.prototype.refresh=function(){this.emit("refresh")},e.prototype.refreshPaused=function(){this.emit("refreshPaused")},Object.defineProperty(e.prototype,"filters",{get:function(){return null},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"audioContext",{get:function(){return null},enumerable:!0,configurable:!0}),e.prototype.toggleMute=function(){return this.muted=!this.muted,this.refresh(),this.muted},e.prototype.togglePause=function(){return this.paused=!this.paused,this.refreshPaused(),this.paused},e.prototype.destroy=function(){this.removeAllListeners()},e}(n.EventEmitter),A={HTMLAudioMedia:E,HTMLAudioInstance:j,HTMLAudioContext:w},L=["mp3","ogg","oga","opus","mpeg","wav","m4a","aiff","wma","mid"],F=(h={m4a:"mp4",oga:"ogg"},l=document.createElement("audio"),f={},d=/^no$/,L.forEach(function(t){var e=h[t]||t,n=l.canPlayType("audio/"+t).replace(d,""),o=l.canPlayType("audio/"+e).replace(d,"");f[t]=!!n||!!o}),Object.freeze(f)),C=/\.(\{([^\}]+)\})(\?.*)?$/;function S(t){var e=C,n="string"==typeof t?t:t.url;if(e.test(n)){for(var o=e.exec(n),i=o[2].split(","),r=i[i.length-1],s=0,u=i.length;s-1?t.sound=p().add(t.name,{loaded:e,preload:!0,url:t.url,source:t.data}):e()},e}(),M=function(){function t(t,e){this.parent=t,Object.assign(this,e),this.duration=this.end-this.start}return t.prototype.play=function(t){return this.parent.play({complete:t,speed:this.speed||this.parent.speed,end:this.end,start:this.start,loop:this.loop})},t.prototype.destroy=function(){this.parent=null},t}(),T=function(){function t(t,e){this.media=t,this.options=e,this._instances=[],this._sprites={},this.media.init(this);var n=e.complete;this._autoPlayOptions=n?{complete:n}:null,this.isLoaded=!1,this.isPlaying=!1,this.autoPlay=e.autoPlay,this.singleInstance=e.singleInstance,this.preload=e.preload||this.autoPlay,this.url=e.url,this.speed=e.speed,this.volume=e.volume,this.loop=e.loop,e.sprites&&this.addSprites(e.sprites),this.preload&&this._preload(e.loaded)}return t.from=function(e){var n={};return"string"==typeof e?n.url=e:e instanceof ArrayBuffer||e instanceof HTMLAudioElement?n.source=e:n=e,(n=c({autoPlay:!1,singleInstance:!1,url:null,source:null,preload:!1,volume:1,speed:1,complete:null,loaded:null,loop:!1},n)).url&&(n.url=S(n.url)),Object.freeze(n),new t(p().useLegacy?new E:new b,n)},Object.defineProperty(t.prototype,"context",{get:function(){return p().context},enumerable:!0,configurable:!0}),t.prototype.pause=function(){return this.isPlaying=!1,this.paused=!0,this},t.prototype.resume=function(){return this.isPlaying=this._instances.length>0,this.paused=!1,this},Object.defineProperty(t.prototype,"paused",{get:function(){return this._paused},set:function(t){this._paused=t,this.refreshPaused()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this._speed},set:function(t){this._speed=t,this.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filters",{get:function(){return this.media.filters},set:function(t){this.media.filters=t},enumerable:!0,configurable:!0}),t.prototype.addSprites=function(t,e){if("object"==typeof t){var n={};for(var o in t)n[o]=this.addSprites(o,t[o]);return n}if("string"==typeof t){var i=new M(this,e);return this._sprites[t]=i,i}},t.prototype.destroy=function(){this._removeInstances(),this.removeSprites(),this.media.destroy(),this.media=null,this._sprites=null,this._instances=null},t.prototype.removeSprites=function(t){if(t){var e=this._sprites[t];void 0!==e&&(e.destroy(),delete this._sprites[t])}else for(var n in this._sprites)this.removeSprites(n);return this},Object.defineProperty(t.prototype,"isPlayable",{get:function(){return this.isLoaded&&this.media&&this.media.isPlayable},enumerable:!0,configurable:!0}),t.prototype.stop=function(){if(!this.isPlayable)return this.autoPlay=!1,this._autoPlayOptions=null,this;this.isPlaying=!1;for(var t=this._instances.length-1;t>=0;t--)this._instances[t].stop();return this},t.prototype.play=function(t,e){var n,o=this;if("string"==typeof t?n={sprite:r=t,loop:this.loop,complete:e}:"function"==typeof t?(n={}).complete=t:n=t,(n=c({complete:null,loaded:null,sprite:null,end:null,start:0,volume:1,speed:1,muted:!1,loop:!1},n||{})).sprite){var i=n.sprite,r=this._sprites[i];n.start=r.start,n.end=r.end,n.speed=r.speed||1,n.loop=r.loop||n.loop,delete n.sprite}if(n.offset&&(n.start=n.offset),!this.isLoaded)return new Promise(function(t,e){o.autoPlay=!0,o._autoPlayOptions=n,o._preload(function(o,i,r){o?e(o):(n.loaded&&n.loaded(o,i,r),t(r))})});this.singleInstance&&this._removeInstances();var s=this._createInstance();return this._instances.push(s),this.isPlaying=!0,s.once("end",function(){n.complete&&n.complete(o),o._onComplete(s)}),s.once("stop",function(){o._onComplete(s)}),s.play(n),s},t.prototype.refresh=function(){for(var t=this._instances.length,e=0;e=0;t--)this._poolInstance(this._instances[t]);this._instances.length=0},t.prototype._onComplete=function(t){if(this._instances){var e=this._instances.indexOf(t);e>-1&&this._instances.splice(e,1),this.isPlaying=this._instances.length>0}this._poolInstance(t)},t.prototype._createInstance=function(){if(t._pool.length>0){var e=t._pool.pop();return e.init(this.media),e}return this.media.create()},t.prototype._poolInstance=function(e){e.destroy(),t._pool.indexOf(e)<0&&t._pool.push(e)},t._pool=[],t}(),R=function(){function t(){this.init()}return t.prototype.init=function(){return this.supported&&(this._webAudioContext=new v),this._htmlAudioContext=new w,this._sounds={},this.useLegacy=!this.supported,this},Object.defineProperty(t.prototype,"context",{get:function(){return this._context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"filtersAll",{get:function(){return this.useLegacy?[]:this._context.filters},set:function(t){this.useLegacy||(this._context.filters=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supported",{get:function(){return null!==v.AudioContext},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){if("object"==typeof t){var n={};for(var o in t){var i=this._getOptions(t[o],e);n[o]=this.add(o,i)}return n}if("string"==typeof t){if(e instanceof T)return this._sounds[t]=e,e;i=this._getOptions(e);var r=T.from(i);return this._sounds[t]=r,r}},t.prototype._getOptions=function(t,e){var n;return n="string"==typeof t?{url:t}:t instanceof ArrayBuffer||t instanceof HTMLAudioElement?{source:t}:t,c({},n,e||{})},Object.defineProperty(t.prototype,"useLegacy",{get:function(){return this._useLegacy},set:function(t){k.legacy=t,this._useLegacy=t,this._context=!t&&this.supported?this._webAudioContext:this._htmlAudioContext},enumerable:!0,configurable:!0}),t.prototype.remove=function(t){return this.exists(t,!0),this._sounds[t].destroy(),delete this._sounds[t],this},Object.defineProperty(t.prototype,"volumeAll",{get:function(){return this._context.volume},set:function(t){this._context.volume=t,this._context.refresh()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"speedAll",{get:function(){return this._context.speed},set:function(t){this._context.speed=t,this._context.refresh()},enumerable:!0,configurable:!0}),t.prototype.togglePauseAll=function(){return this._context.togglePause()},t.prototype.pauseAll=function(){return this._context.paused=!0,this._context.refreshPaused(),this},t.prototype.resumeAll=function(){return this._context.paused=!1,this._context.refreshPaused(),this},t.prototype.toggleMuteAll=function(){return this._context.toggleMute()},t.prototype.muteAll=function(){return this._context.muted=!0,this._context.refresh(),this},t.prototype.unmuteAll=function(){return this._context.muted=!1,this._context.refresh(),this},t.prototype.removeAll=function(){for(var t in this._sounds)this._sounds[t].destroy(),delete this._sounds[t];return this},t.prototype.stopAll=function(){for(var t in this._sounds)this._sounds[t].stop();return this},t.prototype.exists=function(t,e){return void 0===e&&(e=!1),!!this._sounds[t]},t.prototype.find=function(t){return this.exists(t,!0),this._sounds[t]},t.prototype.play=function(t,e){return this.find(t).play(e)},t.prototype.stop=function(t){return this.find(t).stop()},t.prototype.pause=function(t){return this.find(t).pause()},t.prototype.resume=function(t){return this.find(t).resume()},t.prototype.volume=function(t,e){var n=this.find(t);return void 0!==e&&(n.volume=e),n.volume},t.prototype.speed=function(t,e){var n=this.find(t);return void 0!==e&&(n.speed=e),n.speed},t.prototype.duration=function(t){return this.find(t).duration},t.prototype.close=function(){return this.removeAll(),this._sounds=null,this._webAudioContext&&(this._webAudioContext.destroy(),this._webAudioContext=null),this._htmlAudioContext&&(this._htmlAudioContext.destroy(),this._htmlAudioContext=null),this._context=null,this},t}(),G=0,I={get PLAY_ID(){return G},playOnce:function(t,e){var n="alias"+G++;return p().add(n,{url:t,preload:!0,autoPlay:!0,loaded:function(t){t&&(p().remove(n),e&&e(t))},complete:function(){p().remove(n),e&&e(null)}}),n},render:function(t,e){var n=document.createElement("canvas");e=c({width:512,height:128,fill:"black"},e||{}),n.width=e.width,n.height=e.height;var i=o.BaseTexture.from(n);if(!(t.media instanceof b))return i;var r=t.media,s=n.getContext("2d");s.fillStyle=e.fill;for(var u=r.buffer.getChannelData(0),a=Math.ceil(u.length/e.width),p=e.height/2,h=0;hf&&(f=_)}s.fillRect(h,(1+l)*p,1,Math.max(1,(f-l)*p))}return i},resolveUrl:S,sineTone:function(t,e){void 0===t&&(t=200),void 0===e&&(e=1);var n=T.from({singleInstance:!0});if(!(n.media instanceof b))return n;for(var o=n.media,i=n.context.audioContext.createBuffer(1,48e3*e,48e3),r=i.getChannelData(0),s=0;s=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,n,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var n=require("../constants"),i=require("../direction"),a=o(require("./base-component")),s=function(o){function a(){return null!==o&&o.apply(this,arguments)||this}return t(a,o),a.prototype.onInit=function(){o.prototype.onInit.call(this)},a.prototype.onMessage=function(t){},a.prototype.onUpdate=function(t,e){this.model.pacman.state===n.UnitState.DEAD||this.model.state!==n.GameState.DEFAULT&&this.model.state!==n.GameState.RUSH_MODE||this.checkProximity()},a.prototype.checkProximity=function(){var t,o,a=this.model.pacman.pos,s=this.model.spiders;try{for(var c=e(s),l=c.next();!l.done;l=c.next()){var u=r(l.value,2)[1],h=u.pos,p=a.subtract(h);if(Math.abs(p.x)<=1&&Math.abs(p.y)<=1){var d=!1;Math.abs(p.x)<=0&&Math.abs(p.y)<=0&&(d=!0),0!==Math.abs(p.y)||-1!==p.x||u.dir!==i.Direction.LEFT||this.model.pacman.state!==n.UnitState.STANDING&&this.model.pacman.dir!==i.Direction.RIGHT||(d=!0),0!==Math.abs(p.y)||1!==p.x||u.dir!==i.Direction.RIGHT||this.model.pacman.state!==n.UnitState.STANDING&&this.model.pacman.dir!==i.Direction.LEFT||(d=!0),0!==Math.abs(p.x)||-1!==p.y||u.dir!==i.Direction.UP||this.model.pacman.state!==n.UnitState.STANDING&&this.model.pacman.dir!==i.Direction.DOWN||(d=!0),0!==Math.abs(p.x)||1!==p.y||u.dir!==i.Direction.DOWN||this.model.pacman.state!==n.UnitState.STANDING&&this.model.pacman.dir!==i.Direction.UP||(d=!0),d&&this.sendMessage(n.Messages.PACMAN_SPIDER_COLLISION,u)}}}catch(f){t={error:f}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(t)throw t.error}}},a}(a.default);exports.default=s; },{"../constants":"vwVm","../direction":"xaq9","./base-component":"OLeo"}],"CyLO":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),e=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var o=e(require("./base-component")),n=require("../constants"),r=require("../utils"),i=function(e){function o(){var t=e.call(this)||this;return t.frequency=.1,t}return t(o,e),o.prototype.onInit=function(){e.prototype.onInit.call(this),this.subscribe(n.Messages.KEY_FETCHED),this.owner.visible=!1},o.prototype.onMessage=function(t){t.action===n.Messages.KEY_FETCHED&&this.owner.remove()},o.prototype.onUpdate=function(t,e){var o=this.model.spawnKey();if(o){var n=r.mapToWorld(o.x,o.y);this.owner.position.set(n.x,n.y),this.owner.visible=!0}},o}(o.default);exports.default=i; },{"./base-component":"OLeo","../constants":"vwVm","../utils":"xUyy"}],"KWUs":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),e=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var n=e(require("./base-component")),o=require("../constants"),r=require("../utils"),i=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n.prototype.onInit=function(){e.prototype.onInit.call(this),this.subscribe(o.Messages.PACMAN_KILLED)},n.prototype.onMessage=function(t){if(t.action===o.Messages.PACMAN_KILLED){var e=r.getLifeIconIdentifier(this.model.livesNum);this.scene.findObjectByName(e).remove()}},n}(n.default);exports.PacmanLivesComponent=i; },{"./base-component":"OLeo","../constants":"vwVm","../utils":"xUyy"}],"hkM6":[function(require,module,exports) { "use strict";var e=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},t=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)Object.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t.default=e,t};Object.defineProperty(exports,"__esModule",{value:!0});var a=e(require("./components/item-collector")),i=t(require("../../../libs/pixi-component")),r=require("./constants"),s=e(require("./components/sprite-animator")),n=require("./components/pacman-controller"),o=e(require("./components/gate-controller")),p=e(require("./components/spider-spawner")),l=e(require("./components/spider-controller")),u=require("./components/sound-component"),d=require("./utils"),m=e(require("./components/game-controller")),c=e(require("./components/proximity-checker")),h=e(require("./components/key-controller")),w=require("./components/pacman-lives-component"),b=function(){function e(e){this.spritesData=e,this.spriteSheet=PIXI.BaseTexture.from(r.Assets.SPRITESHEET)}return e.prototype.initializeLevel=function(e,t){var n=this;e.clearScene(),t.initLevel(2),e.assignGlobalAttribute(r.Attributes.FACTORY,this),e.assignGlobalAttribute(r.Attributes.MODEL,t),e.assignGlobalAttribute(r.Attributes.SPRITESHEET_DATA,this.spritesData),PIXI.utils.isMobile.any?e.addGlobalComponent(new i.VirtualGamepadComponent({KEY_LEFT:i.Keys.KEY_LEFT,KEY_RIGHT:i.Keys.KEY_RIGHT,KEY_UP:i.Keys.KEY_UP,KEY_DOWN:i.Keys.KEY_DOWN})):e.addGlobalComponent(new i.KeyInputComponent),e.addGlobalComponent(new a.default),e.addGlobalComponent(new m.default),e.addGlobalComponent(new c.default),e.addGlobalComponent(new w.PacmanLivesComponent),e.addGlobalComponent(u.soundComponent());var l=new i.Builder(e),b=l.withParent(e.stage).asContainer(r.Names.LAYER_ITEMS).build();l.withParent(e.stage).asContainer(r.Names.LAYER_CREATURES).build();var f=l.withParent(e.stage).asContainer(r.Names.LAYER_BGR).build();l.globalPos(r.defaultPositions.river).withComponent(new s.default(this.spritesData.river,this.spritesData.river.frames*(100/t.gameSpeed),!0)).asSprite(this.createTexture(this.spritesData.river),r.Names.RIVER).withParent(f).build(),l.globalPos(r.defaultPositions.fountain).withComponent(new s.default(this.spritesData.fountain,this.spritesData.fountain.frames*(100/t.gameSpeed),!0)).asSprite(this.createTexture(this.spritesData.fountain),r.Names.FOUNTAIN).withParent(f).build(),l.globalPos(r.defaultPositions.gate).withAttribute(r.Attributes.SPRITE_DATA,this.spritesData.gate).withComponent(new o.default).asSprite(this.createTexture(this.spritesData.gate),r.Names.GATE).withParent(f).build(),l.globalPos(r.defaultPositions.spiderSpawner).withComponent(new p.default(15)).withAttribute(r.Attributes.SPRITE_DATA,this.spritesData.spider_gate).asSprite(this.createTexture(this.spritesData.spider_gate),r.Names.SPIDER_GATE).withParent(f).build();for(var P=0;P=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},t=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var t={};if(null!=r)for(var e in r)Object.hasOwnProperty.call(r,e)&&(t[e]=r[e]);return t.default=r,t};Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("./struct-utils"));exports.indexOf=function(r,t,n){for(var o=n||e.defaultEquals,u=r.length,i=0;i=0;u--)if(o(r[u],t))return u;return-1},exports.contains=function(r,t,e){return exports.indexOf(r,t,e)>=0},exports.remove=function(r,t,e){var n=exports.indexOf(r,t,e);return!(n<0)&&(r.splice(n,1),!0)},exports.frequency=function(r,t,n){for(var o=n||e.defaultEquals,u=r.length,i=0,f=0;f=r.length||e<0||e>=r.length)return!1;var n=r[t];return r[t]=r[e],r[e]=n,!0},exports.toString=function(r){return"["+r.toString()+"]"},exports.forEach=function(t,e){var n,o;try{for(var u=r(t),i=u.next();!i.done;i=u.next()){if(!1===e(i.value))return}}catch(f){n={error:f}}finally{try{i&&!i.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}}; },{"./struct-utils":"T5R3"}],"QdN6":[function(require,module,exports) { "use strict";var t=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(exports,"__esModule",{value:!0});var e=t(require("./struct-utils")),n=t(require("./arrays")),s=function(){function t(){this.firstNode=null,this.lastNode=null,this.nElements=0}return t.prototype.add=function(t,n){if(e.isUndefined(n)&&(n=this.nElements),n<0||n>this.nElements||e.isUndefined(t))return!1;var s=this.createNode(t);if(0===this.nElements||null===this.lastNode)this.firstNode=s,this.lastNode=s;else if(n===this.nElements)this.lastNode.next=s,this.lastNode=s;else if(0===n)s.next=this.firstNode,this.firstNode=s;else{var i=this.nodeAtIndex(n-1);if(null===i)return!1;s.next=i.next,i.next=s}return this.nElements++,!0},t.prototype.first=function(){if(null!==this.firstNode)return this.firstNode.element},t.prototype.last=function(){if(null!==this.lastNode)return this.lastNode.element},t.prototype.elementAtIndex=function(t){var e=this.nodeAtIndex(t);if(null!==e)return e.element},t.prototype.indexOf=function(t,n){var s=n||e.defaultEquals;if(e.isUndefined(t))return-1;for(var i=this.firstNode,r=0;null!==i;){if(s(i.element,t))return r;r++,i=i.next}return-1},t.prototype.contains=function(t,e){return this.indexOf(t,e)>=0},t.prototype.remove=function(t,n){var s=n||e.defaultEquals;if(this.nElements<1||e.isUndefined(t))return!1;for(var i=null,r=this.firstNode;null!==r;){if(s(r.element,t))return null===i?(this.firstNode=r.next,r===this.lastNode&&(this.lastNode=null)):r===this.lastNode?(this.lastNode=i,i.next=r.next,r.next=null):(i.next=r.next,r.next=null),this.nElements--,!0;i=r,r=r.next}return!1},t.prototype.clear=function(){this.firstNode=null,this.lastNode=null,this.nElements=0},t.prototype.equals=function(n,s){var i=s||e.defaultEquals;return n instanceof t&&(this.size()===n.size()&&this.equalsAux(this.firstNode,n.firstNode,i))},t.prototype.removeElementAtIndex=function(t){if(!(t<0||t>=this.nElements||null===this.firstNode||null===this.lastNode)){var e;if(1===this.nElements)e=this.firstNode.element,this.firstNode=null,this.lastNode=null;else{var n=this.nodeAtIndex(t-1);null===n?(e=this.firstNode.element,this.firstNode=this.firstNode.next):n.next===this.lastNode&&(e=this.lastNode.element,this.lastNode=n),null!==n&&null!==n.next&&(e=n.next.element,n.next=n.next.next)}return this.nElements--,e}},t.prototype.forEach=function(t){for(var e=this.firstNode;null!==e&&!1!==t(e.element);)e=e.next},t.prototype.reverse=function(){for(var t=null,e=this.firstNode,n=null;null!==e;)n=e.next,e.next=t,t=e,e=n;n=this.firstNode,this.firstNode=this.lastNode,this.lastNode=n},t.prototype.toArray=function(){for(var t=[],e=this.firstNode;null!==e;)t.push(e.element),e=e.next;return t},t.prototype.size=function(){return this.nElements},t.prototype.isEmpty=function(){return this.nElements<=0},t.prototype.toString=function(){return n.toString(this.toArray())},t.prototype.equalsAux=function(t,e,n){for(;null!==t&&null!==e;){if(!n(t.element,e.element))return!1;t=t.next,e=e.next}return!0},t.prototype.nodeAtIndex=function(t){if(t<0||t>=this.nElements)return null;if(t===this.nElements-1)return this.lastNode;for(var e=this.firstNode,n=0;n=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},e=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),c=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)c.push(r.value)}catch(u){i={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return c},n=this&&this.__spread||function(){for(var t=[],n=0;np.x?o.Direction.LEFT:l.yp.y?o.Direction.UP:void 0));return g=g.reverse()}var v=this.getNeighbors(f);try{for(var G=(r=void 0,t(v)),x=G.next();!x.done;x=G.next()){var b=x.value;h.has(s(b))||(a.enqueue(b),h.set(s(b),f))}}catch(T){r={error:T}}finally{try{x&&!x.done&&(i=G.return)&&i.call(G)}finally{if(r)throw r.error}}}return null},r}();exports.GameMap=a; },{"./constants":"vwVm","./direction":"xaq9","../../../libs/pixi-component":"rNDA","../../../libs/pixi-math/structs/queue":"qhF9"}],"ng4Q":[function(require,module,exports) { "use strict";var t=this&&this.__extends||function(){var t=function(r,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(r,i)};return function(r,i){function e(){this.constructor=r}t(r,i),r.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}}(),r=this&&this.__values||function(t){var r="function"==typeof Symbol&&Symbol.iterator,i=r&&t[r],e=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(exports,"__esModule",{value:!0});var i,e=require("./map"),n=require("../../../libs/pixi-component");!function(t){t.NONE="",t.PATHS=":paths",t.FUNCTIONS=":functions"}(i||(i={}));var o=function(){return function(){this.blocks=new Map}}(),s=function(){function t(){this.gridWidth=0,this.gridHeight=0,this.tokens=[]}return t.prototype.parseLine=function(t,i){var e,n,o=0;try{for(var s=r(t),h=s.next();!h.done;h=s.next()){var a=h.value;if(this.parseLetter(a))o++;else if(" "!==a)throw new Error("Unexpected token "+a+" on line "+i+":"+(o+1))}}catch(u){e={error:u}}finally{try{h&&!h.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}if(0!==o){if(0===this.gridWidth)this.gridWidth=o;else if(this.gridWidth!==o)throw new Error("Wrong number of tokens on line "+i+"; expected "+this.gridWidth+", found "+o);this.gridHeight++}},t.prototype.finalize=function(t){if(t.gridWidth&&t.gridWidth!==this.gridWidth||t.gridHeight&&t.gridHeight!==this.gridHeight)throw new Error("Error while parsing paths, unexpected size of the map: expected "+this.gridWidth+"x"+this.gridHeight+", found "+t.gridWidth+"x"+t.gridHeight);t.gridWidth=this.gridWidth,t.gridHeight=this.gridHeight;for(var r=this.gridWidth*this.gridHeight,i=0;is[1].pos.x?s[0].pos:s[1].pos,this._westernTunnelPos=s[0].pos.x>s[1].pos.x?s[1].pos:s[0].pos,this._spiders=new Map,this._spiderGatePos=this.map.getTileByFunction(i.SpecFunctions.SPIDER_GATE).pos,this._spiderSpawnPos=this.map.getTileByFunction(i.SpecFunctions.SPIDER_SPAWNER).pos},o.prototype.spawnSpider=function(){var e=new t.GameUnit(this.spiderSpawnPos.clone(),this.map);return this._spiders.set(e.id,e),e},o.prototype.killSpider=function(e){e.state=i.UnitState.DEAD,this._spiders.delete(e.id)},o.prototype.killPacman=function(){this.pacman.state=i.UnitState.DEAD,this._livesNum--},o.prototype.spawnKey=function(){if(!this.keyTaken){var e=this.map.getTilesByFunction(i.SpecFunctions.PACDOT),t=this.pacdots;if(e.length-t.size>10){var n=e[Math.floor(Math.random()*e.length)];return this._keyPosition=n.pos,this._keyPosition}}return null},o.prototype.loadMap=function(t){if("string"==typeof t){var n=(new e.MapLoader).loadMap(t);this._map=n}else this._map=t},o.prototype.isSomethingEatable=function(e){var t=this.mapToIndex(e);return this.pacdots.has(t)||this.pellets.has(t)||this.mapToIndex(this._keyPosition)===t},o.prototype.eatPacDot=function(e){var t=this.mapToIndex(e);return!!this.pacdots.has(t)&&(this.pacdots.delete(t),!0)},o.prototype.eatPellet=function(e,t){void 0===t&&(t=!0);var n=this.mapToIndex(e);return!!this.pellets.has(n)&&(this.pellets.delete(n),t&&(this.state=i.GameState.RUSH_MODE),!0)},o.prototype.fetchKey=function(){this._keyTaken=!0,this._keyPosition=new n.Vector(-1,-1)},o.prototype.mapToIndex=function(e){return e.y*this.map.gridWidth+e.x},o}();exports.default=o; },{"./map-loader":"ng4Q","./game-unit":"X2wc","../../../libs/pixi-component":"rNDA","./constants":"vwVm"}],"OICs":[function(require,module,exports) { "use strict";var e=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var s={};if(null!=e)for(var a in e)Object.hasOwnProperty.call(e,a)&&(s[a]=e[a]);return s.default=e,s},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0});var a=e(require("../../../libs/pixi-component")),t=require("./constants"),n=s(require("./pacman-factory")),i=s(require("./pacman-model")),r=function(){function e(){var e=this;this.engine=new a.GameLoop;var s=document.getElementById("gameCanvas");this.engine.init(s,640,360,1,null,!0),this.engine.app.loader.reset().add(t.Assets.SPRITES,"./assets/game_pacman/sprites.json").add(t.Assets.MAP,"./assets/game_pacman/map.txt").add(t.Assets.SPRITESHEET,"./assets/game_pacman/sprites.png").add(t.Assets.BACKGROUND,"./assets/game_pacman/map.png").add(t.Assets.SND_DEATH,"./assets/game_pacman/death.mp3").add(t.Assets.SND_PACDOT,"./assets/game_pacman/pacdot.mp3").add(t.Assets.SND_PELLET,"./assets/game_pacman/pellet.mp3").add(t.Assets.SND_RUSHKILL,"./assets/game_pacman/rushkill.mp3").load(function(){return e.onAssetsLoaded()})}return e.prototype.onAssetsLoaded=function(){var e=this.engine.app.loader.resources,s=new n.default(e[t.Assets.SPRITES].data),a=new i.default;a.loadMap(e[t.Assets.MAP].data),s.initializeLevel(this.engine.scene,a),window.scene=this.engine.scene},e}();exports.default=new r; },{"../../../libs/pixi-component":"rNDA","./constants":"vwVm","./pacman-factory":"hkM6","./pacman-model":"Nq6A"}]},{},["OICs"], null)