iwmlib/lib/pixi/scrollbox.min.js

1 line
529 KiB
JavaScript

!function o(s,a,u){function h(e,t){if(!a[e]){if(!s[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(l)return l(e,!0);var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}var n=a[e]={exports:{}};s[e][0].call(n.exports,function(t){return h(s[e][1][t]||t)},n,n.exports,o,s,a,u)}return a[e].exports}for(var l="function"==typeof require&&require,t=0;t<u.length;t++)h(u[t]);return h}({1:[function(t,e,r){e.exports={boxWidth:100,boxHeight:100,scrollbarSize:10,scrollbarBackground:14540253,scrollbarBackgroundAlpha:1,scrollbarForeground:8947848,scrollbarForegroundAlpha:1,dragScroll:!0,stopPropagation:!0,scrollbarOffsetHorizontal:0,scrollbarOffsetVertical:0,underflow:"top-left",fadeScrollbar:!1,fadeWait:3e3,fadeEase:"easeInOutSine"}},{}],2:[function(t,e,r){"use strict";e.exports=function(t,e){for(var r in t=t||{},e)void 0===t[r]&&(t[r]=e[r]);return t}},{}],3:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("pixi.js"),s=t("pixi-viewport"),a=t("pixi-ease"),u=t("./defaults"),h=t("./defaults.json"),l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,o.Container),i(c,[{key:"_drawScrollbars",value:function(){this._isScrollbarHorizontal="scroll"===this.overflowX||-1===["hidden","none"].indexOf(this.overflowX)&&this.scrollWidth>this.options.boxWidth,this._isScrollbarVertical="scroll"===this.overflowY||-1===["hidden","none"].indexOf(this.overflowY)&&this.scrollHeight>this.options.boxHeight,this.scrollbar.clear();var t={left:0};t.right=this.scrollWidth+(this._isScrollbarVertical?this.options.scrollbarSize:0),t.top=0,t.bottom=this.scrollHeight+(this.isScrollbarHorizontal?this.options.scrollbarSize:0);var e=this.scrollWidth+(this.isScrollbarVertical?this.options.scrollbarSize:0),r=this.scrollHeight+(this.isScrollbarHorizontal?this.options.scrollbarSize:0);this.scrollbarTop=this.content.top/r*this.boxHeight,this.scrollbarTop=this.scrollbarTop<0?0:this.scrollbarTop,this.scrollbarHeight=this.boxHeight/r*this.boxHeight,this.scrollbarHeight=this.scrollbarTop+this.scrollbarHeight>this.boxHeight?this.boxHeight-this.scrollbarTop:this.scrollbarHeight,this.scrollbarLeft=this.content.left/e*this.boxWidth,this.scrollbarLeft=this.scrollbarLeft<0?0:this.scrollbarLeft,this.scrollbarWidth=this.boxWidth/e*this.boxWidth,this.scrollbarWidth=this.scrollbarWidth+this.scrollbarLeft>this.boxWidth?this.boxWidth-this.scrollbarLeft:this.scrollbarWidth,this.isScrollbarVertical&&this.scrollbar.beginFill(this.options.scrollbarBackground,this.options.scrollbarBackgroundAlpha).drawRect(this.boxWidth-this.scrollbarSize+this.options.scrollbarOffsetVertical,0,this.scrollbarSize,this.boxHeight).endFill(),this.isScrollbarHorizontal&&this.scrollbar.beginFill(this.options.scrollbarBackground,this.options.scrollbarBackgroundAlpha).drawRect(0,this.boxHeight-this.scrollbarSize+this.options.scrollbarOffsetHorizontal,this.boxWidth,this.scrollbarSize).endFill(),this.isScrollbarVertical&&this.scrollbar.beginFill(this.options.scrollbarForeground,this.options.scrollbarForegroundAlpha).drawRect(this.boxWidth-this.scrollbarSize+this.options.scrollbarOffsetVertical,this.scrollbarTop,this.scrollbarSize,this.scrollbarHeight).endFill(),this.isScrollbarHorizontal&&this.scrollbar.beginFill(this.options.scrollbarForeground,this.options.scrollbarForegroundAlpha).drawRect(this.scrollbarLeft,this.boxHeight-this.scrollbarSize+this.options.scrollbarOffsetHorizontal,this.scrollbarWidth,this.scrollbarSize).endFill(),this.activateFade()}},{key:"_drawMask",value:function(){this._maskContent.beginFill(0).drawRect(0,0,this.boxWidth,this.boxHeight).endFill(),this.content.mask=this._maskContent}},{key:"update",value:function(){if(this.content.mask=null,this._maskContent.clear(),!this._disabled&&(this._drawScrollbars(),this._drawMask(),this.options.dragScroll)){var t=this.isScrollbarHorizontal&&this.isScrollbarVertical?"all":this.isScrollbarHorizontal?"x":"y";null!==t&&this.content.drag({clampWheel:!0,direction:t}).clamp({direction:t,underflow:this.options.underflow})}}},{key:"activateFade",value:function(){var t=this;if(this.options.fade){this.fade&&this.ease.remove(this.fade),this.scrollbar.alpha=1;var e=!0===this.options.fade?1e3:this.options.fade;this.fade=this.ease.to(this.scrollbar,{alpha:0},e,{wait:this.options.fadeWait,ease:this.options.fadeEase}),this.fade.on("each",function(){return t.content.dirty=!0})}}},{key:"scrollbarDown",value:function(t){var e=this.toLocal(t.data.global);return this.isScrollbarHorizontal&&e.y>this.boxHeight-this.scrollbarSize?(e.x>=this.scrollbarLeft&&e.x<=this.scrollbarLeft+this.scrollbarWidth?this.pointerDown={type:"horizontal",last:e}:(e.x>this.scrollbarLeft?this.content.left+=this.content.worldScreenWidth:this.content.left-=this.content.worldScreenWidth,this.update()),void(this.options.stopPropagation&&t.stopPropagation())):this.isScrollbarVertical&&e.x>this.boxWidth-this.scrollbarSize?(e.y>=this.scrollbarTop&&e.y<=this.scrollbarTop+this.scrollbarWidth?this.pointerDown={type:"vertical",last:e}:(e.y>this.scrollbarTop?this.content.top+=this.content.worldScreenHeight:this.content.top-=this.content.worldScreenHeight,this.update()),void(this.options.stopPropagation&&t.stopPropagation())):void 0}},{key:"scrollbarMove",value:function(t){if(this.pointerDown){if("horizontal"===this.pointerDown.type){var e=this.toLocal(t.data.global);this.content.left+=e.x-this.pointerDown.last.x,this.pointerDown.last=e,this.update()}else if("vertical"===this.pointerDown.type){var r=this.toLocal(t.data.global);this.content.top+=r.y-this.pointerDown.last.y,this.pointerDown.last=r,this.update()}this.options.stopPropagation&&t.stopPropagation()}}},{key:"scrollbarUp",value:function(){this.pointerDown=null}},{key:"resize",value:function(t){this.options.boxWidth=void 0!==t.boxWidth?t.boxWidth:this.options.boxWidth,this.options.boxHeight=void 0!==t.boxHeight?t.boxHeight:this.options.boxHeight,t.scrollWidth&&(this.scrollWidth=t.scrollWidth),t.scrollHeight&&(this.scrollHeight=t.scrollHeight),this.content.resize(this.options.boxWidth,this.options.boxHeight,this.scrollWidth,this.scrollHeight),this.update()}},{key:"ensureVisible",value:function(t,e,r,i){this.content.ensureVisible(t,e,r,i),this._drawScrollbars()}},{key:"scrollbarOffsetHorizontal",get:function(){return this.options.scrollbarOffsetHorizontal},set:function(t){this.options.scrollbarOffsetHorizontal=t}},{key:"scrollbarOffsetVertical",get:function(){return this.options.scrollbarOffsetVertical},set:function(t){this.options.scrollbarOffsetVertical=t}},{key:"disable",get:function(){return this._disabled},set:function(t){this._disabled!==t&&(this._disabled=t,this.update())}},{key:"stopPropagation",get:function(){return this.options.stopPropagation},set:function(t){this.options.stopPropagation=t}},{key:"dragScroll",get:function(){return this.options.dragScroll},set:function(t){(this.options.dragScroll=t)?this.content.drag():this.content.removePlugin("drag"),this.update()}},{key:"boxWidth",get:function(){return this.options.boxWidth},set:function(t){this.options.boxWidth=t,this.content.screenWidth=t,this.update()}},{key:"overflow",get:function(){return this.options.overflow},set:function(t){this.options.overflow=t,this.options.overflowX=t,this.options.overflowY=t,this.update()}},{key:"overflowX",get:function(){return this.options.overflowX},set:function(t){this.options.overflowX=t,this.update()}},{key:"overflowY",get:function(){return this.options.overflowY},set:function(t){this.options.overflowY=t,this.update()}},{key:"boxHeight",get:function(){return this.options.boxHeight},set:function(t){this.options.boxHeight=t,this.content.screenHeight=t,this.update()}},{key:"scrollbarSize",get:function(){return this.options.scrollbarSize},set:function(t){this.options.scrollbarSize=t}},{key:"contentWidth",get:function(){return this.options.boxWidth-(this.isScrollbarVertical?this.options.scrollbarSize:0)}},{key:"contentHeight",get:function(){return this.options.boxHeight-(this.isScrollbarHorizontal?this.options.scrollbarSize:0)}},{key:"isScrollbarVertical",get:function(){return this._isScrollbarVertical}},{key:"isScrollbarHorizontal",get:function(){return this._isScrollbarHorizontal}},{key:"scrollTop",get:function(){return this.content.top}},{key:"scrollLeft",get:function(){return this.content.left}},{key:"scrollWidth",get:function(){return this._scrollWidth||this.content.width},set:function(t){this._scrollWidth=t}},{key:"scrollHeight",get:function(){return this._scrollHeight||this.content.height},set:function(t){this._scrollHeight=t}}]),c);function c(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this));return e.options=u(t,h),e.ease=new a.list,e.content=e.addChild(new s({passiveWheel:e.options.stopPropagation,stopPropagation:e.options.stopPropagation,screenWidth:e.options.boxWidth,screenHeight:e.options.boxHeight})),e.content.decelerate().on("moved",function(){return e._drawScrollbars()}),e.scrollbar=e.addChild(new o.Graphics),e.scrollbar.interactive=!0,e.scrollbar.on("pointerdown",e.scrollbarDown,e),e.interactive=!0,e.on("pointermove",e.scrollbarMove,e),e.on("pointerup",e.scrollbarUp,e),e.on("pointercancel",e.scrollbarUp,e),e.on("pointerupoutside",e.scrollbarUp,e),e._maskContent=e.addChild(new o.Graphics),e.update(),e}o&&o.extras&&(o.extras.Scrollbox=l),e.exports=l},{"./defaults":2,"./defaults.json":1,"pixi-ease":14,"pixi-viewport":52,"pixi.js":169}],4:[function(t,e,r){"use strict";function i(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(0<t)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t<e)},r.max=function(t,e){return t^(t^e)&-(t<e)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(65535<t)<<4,e|=r=(255<(t>>>=e))<<3,e|=r=(15<(t>>>=r))<<2,(e|=r=(3<(t>>>=r))<<1)|(t>>>=r)>>1},r.log10=function(t){return 1e9<=t?9:1e8<=t?8:1e7<=t?7:1e6<=t?6:1e5<=t?5:1e4<=t?4:1e3<=t?3:100<=t?2:10<=t?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,i=e,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;t[e]=i<<n&255}}(n),r.reverse=function(t){return n[255&t]<<24|n[t>>>8&255]<<16|n[t>>>16&255]<<8|n[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return 1+e|(~e&-~e)-1>>>i(t)+1}},{}],5:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i,n,o,s,a,u,h,l=e&&e.length,c=l?e[0]*r:t.length,f=v(t,0,c,r,!0),d=[];if(!f||f.next===f.prev)return d;if(l&&(f=function(t,e,r,i){var n,o,s,a,u,h=[];for(n=0,o=e.length;n<o;n++)s=e[n]*i,a=n<o-1?e[n+1]*i:t.length,(u=v(t,s,a,i,!1))===u.next&&(u.steiner=!0),h.push(x(u));for(h.sort(m),n=0;n<h.length;n++)b(h[n],r),r=y(r,r.next);return r}(t,e,f,r)),t.length>80*r){i=o=t[0],n=s=t[1];for(var p=r;p<c;p+=r)(a=t[p])<i&&(i=a),(u=t[p+1])<n&&(n=u),o<a&&(o=a),s<u&&(s=u);h=0!==(h=Math.max(o-i,s-n))?1/h:0}return g(f,d,r,i,n,h),d}function v(t,e,r,i,n){var o,s;if(n===0<M(t,e,r,i))for(o=e;o<r;o+=i)s=u(o,t[o],t[o+1],s);else for(o=r-i;e<=o;o-=i)s=u(o,t[o],t[o+1],s);return s&&a(s,s.next)&&(S(s),s=s.next),s}function y(t,e){if(!t)return t;e||(e=t);var r,i=t;do{if(r=!1,i.steiner||!a(i,i.next)&&0!==T(i.prev,i,i.next))i=i.next;else{if(S(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function g(t,e,r,i,n,o,s){if(t){!s&&o&&function(t,e,r,i){var n=t;for(;null===n.z&&(n.z=_(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next,n!==t;);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,s,a,u,h=1;do{for(r=t,o=t=null,s=0;r;){for(s++,i=r,e=a=0;e<h&&(a++,i=i.nextZ);e++);for(u=h;0<a||0<u&&i;)0!==a&&(0===u||!i||r.z<=i.z)?(r=(n=r).nextZ,a--):(i=(n=i).nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,h*=2}while(1<s)}(n)}(t,i,n,o);for(var a,u,h=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?c(t,i,n,o):l(t))e.push(a.i/r),e.push(t.i/r),e.push(u.i/r),S(t),t=u.next,h=u.next;else if((t=u)===h){s?1===s?g(t=f(t,e,r),e,r,i,n,o,2):2===s&&d(t,e,r,i,n,o):g(y(t),e,r,i,n,o,1);break}}}function l(t){var e=t.prev,r=t,i=t.next;if(0<=T(e,r,i))return!1;for(var n=t.next.next;n!==t.prev;){if(w(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&0<=T(n.prev,n,n.next))return!1;n=n.next}return!0}function c(t,e,r,i){var n=t.prev,o=t,s=t.next;if(0<=T(n,o,s))return!1;for(var a=n.x<o.x?n.x<s.x?n.x:s.x:o.x<s.x?o.x:s.x,u=n.y<o.y?n.y<s.y?n.y:s.y:o.y<s.y?o.y:s.y,h=n.x>o.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=_(a,u,e,r,i),f=_(h,l,e,r,i),d=t.prevZ,p=t.nextZ;d&&d.z>=c&&p&&p.z<=f;){if(d!==t.prev&&d!==t.next&&w(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==t.prev&&p!==t.next&&w(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&w(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&w(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function f(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!a(n,o)&&p(n,i,i.next,o)&&E(n,o)&&E(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),S(i),S(i.next),i=t=o),i=i.next}while(i!==t);return i}function d(t,e,r,i,n,o){var s,a,u=t;do{for(var h=u.next.next;h!==u.prev;){if(u.i!==h.i&&(a=h,(s=u).next.i!==a.i&&s.prev.i!==a.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&p(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(s,a)&&E(s,a)&&E(a,s)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==t;);return i}(s,a))){var l=O(u,h);return u=y(u,u.next),l=y(l,l.next),g(u,e,r,i,n,o),void g(l,e,r,i,n,o)}h=h.next}u=u.next}while(u!==t)}function m(t,e){return t.x-e.x}function b(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&s<a){if((s=a)===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!r)return null;if(n===s)return r.prev;var u,h=r,l=r.x,c=r.y,f=1/0;i=r.next;for(;i!==h;)n>=i.x&&i.x>=l&&n!==i.x&&w(o<c?n:s,o,l,c,o<c?s:n,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(n-i.x))<f||u===f&&i.x>r.x)&&E(i,t)&&(r=i,f=u),i=i.next;return r}(t,e)){var r=O(e,t);y(r,r.next)}}function _(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function x(t){for(var e=t,r=t;(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),(e=e.next)!==t;);return r}function w(t,e,r,i,n,o,s,a){return 0<=(n-s)*(e-a)-(t-s)*(o-a)&&0<=(t-s)*(i-a)-(r-s)*(e-a)&&0<=(r-s)*(o-a)-(n-s)*(i-a)}function T(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function a(t,e){return t.x===e.x&&t.y===e.y}function p(t,e,r,i){return!!(a(t,e)&&a(r,i)||a(t,i)&&a(r,e))||0<T(t,e,r)!=0<T(t,e,i)&&0<T(r,i,t)!=0<T(r,i,e)}function E(t,e){return T(t.prev,t,t.next)<0?0<=T(t,e,t.next)&&0<=T(t,t.prev,e):T(t,e,t.prev)<0||T(t,t.next,e)<0}function O(t,e){var r=new s(t.i,t.x,t.y),i=new s(e.i,e.x,e.y),n=t.next,o=e.prev;return(t.next=e).prev=t,(r.next=n).prev=r,(i.next=r).prev=i,(o.next=i).prev=o,i}function u(t,e,r,i){var n=new s(t,e,r);return i?(n.next=i.next,(n.prev=i).next.prev=n,i.next=n):(n.prev=n).next=n,n}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function s(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(t,e,r,i){for(var n=0,o=e,s=r-i;o<r;o+=i)n+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return n}e.exports=i,(e.exports.default=i).deviation=function(t,e,r,i){var n=e&&e.length,o=n?e[0]*r:t.length,s=Math.abs(M(t,0,o,r));if(n)for(var a=0,u=e.length;a<u;a++){var h=e[a]*r,l=a<u-1?e[a+1]*r:t.length;s-=Math.abs(M(t,h,l,r))}var c=0;for(a=0;a<i.length;a+=3){var f=i[a]*r,d=i[a+1]*r,p=i[a+2]*r;c+=Math.abs((t[f]-t[p])*(t[1+d]-t[1+f])-(t[f]-t[d])*(t[1+p]-t[1+f]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},i.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var s=0;s<e;s++)r.vertices.push(t[n][o][s]);0<n&&(i+=t[n-1].length,r.holes.push(i))}return r}},{}],6:[function(t,e,r){"use strict";var i=Object.prototype.hasOwnProperty,d="~";function n(){}function a(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,r,i,n){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new a(r,i||t,n),s=d?d+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],o]:t._events[s].push(o):(t._events[s]=o,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(d=!1)),s.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(d?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=d?d+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,n=r.length,o=new Array(n);i<n;i++)o[i]=r[i].fn;return o},s.prototype.listenerCount=function(t){var e=d?d+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,n,o){var s=d?d+t:t;if(!this._events[s])return!1;var a,u,h=this._events[s],l=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),l){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,r),!0;case 4:return h.fn.call(h.context,e,r,i),!0;case 5:return h.fn.call(h.context,e,r,i,n),!0;case 6:return h.fn.call(h.context,e,r,i,n,o),!0}for(u=1,a=new Array(l-1);u<l;u++)a[u-1]=arguments[u];h.fn.apply(h.context,a)}else{var c,f=h.length;for(u=0;u<f;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),l){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,r);break;case 4:h[u].fn.call(h[u].context,e,r,i);break;default:if(!a)for(c=1,a=new Array(l-1);c<l;c++)a[c-1]=arguments[c];h[u].fn.apply(h[u].context,a)}}return!0},s.prototype.on=function(t,e,r){return o(this,t,e,r,!1)},s.prototype.once=function(t,e,r){return o(this,t,e,r,!0)},s.prototype.removeListener=function(t,e,r,i){var n=d?d+t:t;if(!this._events[n])return this;if(!e)return h(this,n),this;var o=this._events[n];if(o.fn)o.fn!==e||i&&!o.once||r&&o.context!==r||h(this,n);else{for(var s=0,a=[],u=o.length;s<u;s++)(o[s].fn!==e||i&&!o[s].once||r&&o[s].context!==r)&&a.push(o[s]);a.length?this._events[n]=1===a.length?a[0]:a:h(this,n)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=d?d+t:t,this._events[e]&&h(this,e)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=d,s.EventEmitter=s,void 0!==e&&(e.exports=s)},{}],7:[function(t,e,r){function n(t,e){return t.test(e)}function i(t){var e=t||("undefined"!=typeof navigator?navigator.userAgent:""),r=e.split("[FBAN");void 0!==r[1]&&(e=r[0]),void 0!==(r=e.split("Twitter"))[1]&&(e=r[0]);var i={apple:{phone:n(s,e)&&!n(d,e),ipod:n(a,e),tablet:!n(s,e)&&n(u,e)&&!n(d,e),device:(n(s,e)||n(a,e)||n(u,e))&&!n(d,e)},amazon:{phone:n(c,e),tablet:!n(c,e)&&n(f,e),device:n(c,e)||n(f,e)},android:{phone:!n(d,e)&&n(c,e)||!n(d,e)&&n(h,e),tablet:!n(d,e)&&!n(c,e)&&!n(h,e)&&(n(f,e)||n(l,e)),device:!n(d,e)&&(n(c,e)||n(f,e)||n(h,e)||n(l,e))},windows:{phone:n(d,e),tablet:n(p,e),device:n(d,e)||n(p,e)},other:{blackberry:n(v,e),blackberry10:n(y,e),opera:n(g,e),firefox:n(b,e),chrome:n(m,e),device:n(v,e)||n(y,e)||n(g,e)||n(b,e)||n(m,e)}};return i.any=i.apple.device||i.android.device||i.windows.device||i.other.device,i.phone=i.apple.phone||i.android.phone||i.windows.phone,i.tablet=i.apple.tablet||i.android.tablet||i.windows.tablet,i}var o,s,a,u,h,l,c,f,d,p,v,y,g,m,b;o=this,s=/iPhone/i,a=/iPod/i,u=/iPad/i,h=/\bAndroid(?:.+)Mobile\b/i,l=/Android/i,c=/\bAndroid(?:.+)SD4930UR\b/i,f=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,d=/Windows Phone/i,p=/\bWindows(?:.+)ARM\b/i,v=/BlackBerry/i,y=/BB10/i,g=/Opera Mini/i,m=/\b(CriOS|Chrome)(?:.+)Mobile/i,b=/\Mobile(?:.+)Firefox\b/i,void 0!==e&&e.exports&&"undefined"==typeof window?e.exports=i:void 0!==e&&e.exports&&"undefined"!=typeof window?e.exports=i():"function"==typeof define&&define.amd?define([],o.isMobile=i()):o.isMobile=i()},{}],8:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=(i(a,[{key:"detach",value:function(){return null!==this._owner&&(this._owner.detach(this),!0)}}]),a);function a(t,e,r){void 0===e&&(e=!1),o(this,a),this._fn=t,this._once=e,this._thisArg=r,this._next=this._prev=this._owner=null}function u(t,e){return t._head?(t._tail._next=e)._prev=t._tail:t._head=e,(t._tail=e)._owner=t,e}var h=(i(l,[{key:"handlers",value:function(){var t=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],e=this._head;if(t)return!!e;for(var r=[];e;)r.push(e),e=e._next;return r}},{key:"has",value:function(t){if(!(t instanceof s))throw new Error("MiniSignal#has(): First arg must be a MiniSignalBinding object.");return t._owner===this}},{key:"dispatch",value:function(){var t=this._head;if(!t)return!1;for(;t;)t._once&&this.detach(t),t._fn.apply(t._thisArg,arguments),t=t._next;return!0}},{key:"add",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#add(): First arg must be a Function.");return u(this,new s(t,!1,e))}},{key:"once",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if("function"!=typeof t)throw new Error("MiniSignal#once(): First arg must be a Function.");return u(this,new s(t,!0,e))}},{key:"detach",value:function(t){if(!(t instanceof s))throw new Error("MiniSignal#detach(): First arg must be a MiniSignalBinding object.");return t._owner!==this||(t._prev&&(t._prev._next=t._next),t._next&&(t._next._prev=t._prev),t===this._head?(this._head=t._next,null===t._next&&(this._tail=null)):t===this._tail&&(this._tail=t._prev,this._tail._next=null),t._owner=null),this}},{key:"detachAll",value:function(){var t=this._head;if(!t)return this;for(this._head=this._tail=null;t;)t._owner=null,t=t._next;return this}}]),l);function l(){o(this,l),this._head=this._tail=void 0}h.MiniSignalBinding=s,r.default=h,e.exports=r.default},{}],9:[function(t,e,r){"use strict";var u=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(t){i[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,i,n=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),o=1;o<arguments.length;o++){for(var s in r=Object(arguments[o]))h.call(r,s)&&(n[s]=r[s]);if(u){i=u(r);for(var a=0;a<i.length;a++)l.call(r,i[a])&&(n[i[a]]=r[i[a]])}}return n}},{}],10:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||{};for(var i={key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},r=i.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=14;o--;)n[i.key[o]]=r[o]||"";return n[i.q.name]={},n[i.key[12]].replace(i.q.parser,function(t,e,r){e&&(n[i.q.name][e]=r)}),n}},{}],11:[function(t,e,r){(function(){var n;(function(t){"object"==typeof r?e.exports=t:"function"==typeof define&&define.amd?define([],t):this.penner=t})(n={linear:function(t,e,r,i){return r*t/i+e},easeInQuad:function(t,e,r,i){return r*(t/=i)*t+e},easeOutQuad:function(t,e,r,i){return-r*(t/=i)*(t-2)+e},easeInOutQuad:function(t,e,r,i){return(t/=i/2)<1?r/2*t*t+e:-r/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,r,i){return r*(t/=i)*t*t+e},easeOutCubic:function(t,e,r,i){return r*((t=t/i-1)*t*t+1)+e},easeInOutCubic:function(t,e,r,i){return(t/=i/2)<1?r/2*t*t*t+e:r/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,r,i){return r*(t/=i)*t*t*t+e},easeOutQuart:function(t,e,r,i){return-r*((t=t/i-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,r,i){return(t/=i/2)<1?r/2*t*t*t*t+e:-r/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,r,i){return r*(t/=i)*t*t*t*t+e},easeOutQuint:function(t,e,r,i){return r*((t=t/i-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,r,i){return(t/=i/2)<1?r/2*t*t*t*t*t+e:r/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,r,i){return-r*Math.cos(t/i*(Math.PI/2))+r+e},easeOutSine:function(t,e,r,i){return r*Math.sin(t/i*(Math.PI/2))+e},easeInOutSine:function(t,e,r,i){return-r/2*(Math.cos(Math.PI*t/i)-1)+e},easeInExpo:function(t,e,r,i){return 0===t?e:r*Math.pow(2,10*(t/i-1))+e},easeOutExpo:function(t,e,r,i){return t===i?e+r:r*(1-Math.pow(2,-10*t/i))+e},easeInOutExpo:function(t,e,r,i){return(t/=i/2)<1?r/2*Math.pow(2,10*(t-1))+e:r/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,r,i){return-r*(Math.sqrt(1-(t/=i)*t)-1)+e},easeOutCirc:function(t,e,r,i){return r*Math.sqrt(1-(t=t/i-1)*t)+e},easeInOutCirc:function(t,e,r,i){return(t/=i/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+e:r/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(t,e,r,i){var n,o,s;return s=1.70158,(o=0)===t||(t/=i),o||(o=.3*i),s=(n=r)<Math.abs(r)?(n=r,o/4):o/(2*Math.PI)*Math.asin(r/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t*i-s)*(2*Math.PI)/o)+e},easeOutElastic:function(t,e,r,i){var n,o,s;return s=1.70158,(o=0)===t||(t/=i),o||(o=.3*i),s=(n=r)<Math.abs(r)?(n=r,o/4):o/(2*Math.PI)*Math.asin(r/n),n*Math.pow(2,-10*t)*Math.sin((t*i-s)*(2*Math.PI)/o)+r+e},easeInOutElastic:function(t,e,r,i){var n,o,s;return s=1.70158,(o=0)===t||(t/=i/2),o||(o=i*(.3*1.5)),s=(n=r)<Math.abs(r)?(n=r,o/4):o/(2*Math.PI)*Math.asin(r/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t*i-s)*(2*Math.PI)/o)*-.5+e:n*Math.pow(2,-10*(t-=1))*Math.sin((t*i-s)*(2*Math.PI)/o)*.5+r+e},easeInBack:function(t,e,r,i,n){return void 0===n&&(n=1.70158),r*(t/=i)*t*((n+1)*t-n)+e},easeOutBack:function(t,e,r,i,n){return void 0===n&&(n=1.70158),r*((t=t/i-1)*t*((n+1)*t+n)+1)+e},easeInOutBack:function(t,e,r,i,n){return void 0===n&&(n=1.70158),(t/=i/2)<1?r/2*(t*t*((1+(n*=1.525))*t-n))+e:r/2*((t-=2)*t*((1+(n*=1.525))*t+n)+2)+e},easeInBounce:function(t,e,r,i){return r-n.easeOutBounce(i-t,0,r,i)+e},easeOutBounce:function(t,e,r,i){return(t/=i)<1/2.75?r*(7.5625*t*t)+e:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+e:r*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(t,e,r,i){return t<i/2?.5*n.easeInBounce(2*t,0,r,i)+e:.5*n.easeOutBounce(2*t-i,0,r,i)+.5*r+e}})}).call(this)},{}],12:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:s(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(r):void 0}var o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,t("./wait")),i(a,[{key:"save",value:function(){var t=s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"save",this).call(this);return t.angle=this.angle,t.speed=this.speed,t}},{key:"load",value:function(t){s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"load",this).call(this,t),this.angle=t.angle,this.speed=t.speed}},{key:"calculate",value:function(t){this.object.x+=this.cos*t*this.speed,this.object.y+=this.sin*t*this.speed}},{key:"reverse",value:function(){this.angle+=Math.PI}},{key:"angle",get:function(){return this._angle},set:function(t){this._angle=t,this.sin=Math.sin(this._angle),this.cos=Math.cos(this._angle)}}]),a);function a(t,e,r,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),n=n||{};var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,n));return o.type="Angle",n.load?o.load(n.load):(o.angle=e,o.speed=r,o.duration=i||0),o}e.exports=o},{"./wait":22}],13:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:s(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(r):void 0}var a=t("yy-angle"),o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,t("./wait")),i(u,[{key:"save",value:function(){if(this.options.cancel)return null;var t=s(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"save",this).call(this);return t.speed=this.speed,t.keepAlive=this.options.keepAlive,t}},{key:"load",value:function(t){s(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"load",this).call(this,t),this.speed=t.speed,this.options.keepAlive=t.keepAlive}},{key:"calculate",value:function(t){var e=a.angleTwoPoints(this.object.position,this.target),r=a.differenceAngles(e,this.object.rotation);if(0===r){if(this.emit("done",this.object),!this.options.keepAlive)return!0}else{var i=a.differenceAnglesSign(e,this.object.rotation),n=this.speed*t,o=r<n?r:n;this.object.rotation+=o*i}}}]),u);function u(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),i=i||{};var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,t,i));return n.type="Face",n.target=e,i.load?n.load(i.load):n.speed=r,n}e.exports=o},{"./wait":22,"yy-angle":220}],14:[function(t,e,r){"use strict";var i={list:t("./list"),wait:t("./wait"),to:t("./to"),shake:t("./shake"),tint:t("./tint"),face:t("./face"),angle:t("./angle"),target:t("./target"),movie:t("./movie"),load:t("./load")};e.exports=i},{"./angle":12,"./face":13,"./list":15,"./load":16,"./movie":17,"./shake":18,"./target":19,"./tint":20,"./to":21,"./wait":22}],15:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("pixi.js"),s=t("eventemitter3"),a=t("./angle"),u=t("./face"),h=t("./load"),l=t("./movie"),c=t("./shake"),f=t("./target"),d=t("./tint"),p=t("./to"),v=t("./wait"),y=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(g,s),i(g,[{key:"add",value:function(){var t=void 0,e=!0,r=!1,i=void 0;try{for(var n,o=arguments[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){var s=n.value;if(Array.isArray(s)){var a=!0,u=!1,h=void 0;try{for(var l,c=s[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var f=l.value;t||(t=f),this.list.push(f)}}catch(t){u=!0,h=t}finally{try{!a&&c.return&&c.return()}finally{if(u)throw h}}}else t=s,this.list.push(s)}}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}return this.empty=!1,t}},{key:"remove",value:function(t){if(this.inUpdate)this.removeWaiting.push(t);else if(Array.isArray(t)){var e=!0,r=!1,i=void 0;try{for(var n,o=t[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){var s=n.value,a=this.list.indexOf(s);-1!==a&&this.list.splice(a,1)}}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}}else{var u=this.list.indexOf(t);-1!==u&&this.list.splice(u,1)}}},{key:"removeAll",value:function(){this.inUpdate?this.removeAllWaiting=!0:this.list=[]}},{key:"update",value:function(t){this.inUpdate=!0;for(var e=0,r=this.list.length;e<r;e++)this.list[e]&&this.list[e].update(t)&&(this.list.splice(e,1),e--,r--);for(this.emit("each",this),0!==this.list.length||this.empty||(this.emit("done",this),this.empty=!0),this.inUpdate=!1,this.removeAllWaiting&&(this.removeAll(),this.removeAllWaiting=!1);this.removeWaiting.length;)this.remove(this.removeWaiting.pop())}},{key:"to",value:function(){return this.add(new(Function.prototype.bind.apply(p,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"angle",value:function(){return this.add(new(Function.prototype.bind.apply(a,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"face",value:function(){return this.add(new(Function.prototype.bind.apply(u,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"load",value:function(){return this.add(new(Function.prototype.bind.apply(h,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"movie",value:function(){return this.add(new(Function.prototype.bind.apply(l,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"shake",value:function(){return this.add(new(Function.prototype.bind.apply(c,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"target",value:function(){return this.add(new(Function.prototype.bind.apply(f,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"tint",value:function(){return this.add(new(Function.prototype.bind.apply(d,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"wait",value:function(){return this.add(new(Function.prototype.bind.apply(v,[null].concat(Array.prototype.slice.call(arguments)))))}},{key:"count",get:function(){return this.list.length}},{key:"countRunning",get:function(){var t=0,e=!0,r=!1,i=void 0;try{for(var n,o=this.list[Symbol.iterator]();!(e=(n=o.next()).done);e=!0)n.value.pause||t++}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}return t}}]),g);function g(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,g),t=t||{};var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));if(!t.noTicker){var r=t.ticker||(o.Ticker?o.Ticker.shared:o.ticker.shared);r.add(function(){return e.update(16.66*r.deltaTime)})}return e.list=[],e.empty=!0,e.removeWaiting=[],e.removeAllWaiting=!1,e}e.exports=y},{"./angle":12,"./face":13,"./load":16,"./movie":17,"./shake":18,"./target":19,"./tint":20,"./to":21,"./wait":22,eventemitter3:6,"pixi.js":169}],16:[function(t,e,r){"use strict";var i=t("./wait"),n=t("./to"),o=t("./tint"),s=t("./shake"),a=t("./angle"),u=t("./face"),h=t("./target"),l=t("./movie");e.exports=function(t,e){if(!e)return null;var r={load:e};switch(e.type){case"Wait":return new i(t,r);case"To":return new n(t,null,null,r);case"Tint":return new o(t,null,null,r);case"Shake":return new s(t,null,null,r);case"Angle":return new a(t,null,null,null,r);case"Face":return new u(t[0],t[1],null,r);case"Target":return new h(t[0],t[1],null,r);case"Movie":return new l(t,t[1],null,r)}}},{"./angle":12,"./face":13,"./movie":17,"./shake":18,"./target":19,"./tint":20,"./to":21,"./wait":22}],17:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:s(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(r):void 0}var o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,t("./wait")),i(a,[{key:"save",value:function(){var t=s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"save",this).call(this);return t.goto=this.goto,t.current=this.current,t.length=this.length,t.interval=this.interval,t}},{key:"load",value:function(t){s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"load",this).call(this,t),this.goto=t.goto,this.current=t.current,this.interval=t.current}},{key:"restart",value:function(){this.current=0,this.time=0,this.isReverse=!1}},{key:"reverse",value:function(){this.isReverse=!this.isReverse}},{key:"calculate",value:function(){var t=Math.round(this.options.ease(this.time,0,this.length-1,this.duration));if(this.isReverse&&(t=this.length-1-t),this.list)for(var e=0;e<this.list.length;e++)this.list[e].texture=this.textures[t];else this.object.texture=this.textures[t]}}]),a);function a(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i=i||{};var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i));return n.type="Movie",Array.isArray(t)&&(n.list=t,n.object=n.list[0]),i.load?n.load(i.load):(n.textures=e,n.duration=r,n.current=0,n.length=e.length,n.interval=r/n.length,n.isReverse=!1,n.restart()),n}e.exports=o},{"./wait":22}],18:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:s(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(r):void 0}var o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,t("./wait")),i(a,[{key:"save",value:function(){var t=s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"save",this).call(this);return t.start=this.start,t.amount=this.amount,t}},{key:"load",value:function(t){s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"load",this).call(this,t),this.start=t.start,this.amount=t.amount}},{key:"calculate",value:function(){var t=this.object,e=this.start,r=this.amount;if(this.array)for(var i=this.list,n=0;n<i.length;n++){var o=i[n],s=e[n];o.x=s.x+Math.floor(Math.random()*r*2)-r,o.y=s.y+Math.floor(Math.random()*r*2)-r}t.x=e.x+Math.floor(Math.random()*r*2)-r,t.y=e.y+Math.floor(Math.random()*r*2)-r}},{key:"done",value:function(){var t=this.object,e=this.start;if(this.array)for(var r=this.list,i=0;i<r.length;i++){var n=r[i],o=e[i];n.x=o.x,n.y=o.y}else t.x=e.x,t.y=e.y}}]),a);function a(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i=i||{};var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i));if(n.type="Shake",Array.isArray(t)&&(n.array=!0,n.list=t),i.load)n.load(i.load);else{if(n.list){n.start=[];for(var o=0;o<t.length;o++){var s=t[o];n.start[o]={x:s.x,y:s.y}}}else n.start={x:t.x,y:t.y};n.amount=e,n.duration=r}return n}e.exports=o},{"./wait":22}],19:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:s(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(r):void 0}var o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,t("./wait")),i(a,[{key:"save",value:function(){var t=s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"save",this).call(this);return t.speed=this.speed,t.keepAlive=this.options.keepAlive,t}},{key:"load",value:function(t){s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"load",this).call(this,t),this.speed=t.speed,this.options.keepAlive=t.keepAlive}},{key:"calculate",value:function(t){var e=this.target.x-this.object.x,r=this.target.y-this.object.y;if(0==e&&0==r){if(this.emit("done",this.object),!this.options.keepAlive)return!0}else{var i=Math.atan2(r,e);this.object.x+=Math.cos(i)*t*this.speed,this.object.y+=Math.sin(i)*t*this.speed,0<=e!=0<=this.target.x-this.object.x&&(this.object.x=this.target.x),0<=r!=0<=this.target.y-this.object.y&&(this.object.y=this.target.y)}}}]),a);function a(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i=i||{};var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i));return n.type="Target",n.target=e,i.load?n.load(i.load):n.speed=r,n}e.exports=o},{"./wait":22}],20:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:s(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(r):void 0}var y=t("yy-color"),o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,t("./wait")),i(a,[{key:"save",value:function(){var t=s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"save",this).call(this);return t.start=this.start,t.to=this.to,t}},{key:"load",value:function(t){s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"load",this).call(this,t),this.start=t.start,this.to=t.to}},{key:"calculate",value:function(){var t=this.options.ease(this.time,0,1,this.duration);if(this.tints)for(var e=1/(this.tints.length-1),r=e,i=1;i<this.tints.length;i++){if(t<=r){var n=y.blend(1-(r-t)/e,this.tints[i-1],this.tints[i]);if(this.list){var o=!0,s=!1,a=void 0;try{for(var u,h=this.list[Symbol.iterator]();!(o=(u=h.next()).done);o=!0)u.value.tint=n}catch(t){s=!0,a=t}finally{try{!o&&h.return&&h.return()}finally{if(s)throw a}}}else this.object.tint=n;break}r+=e}else{var l=y.blend(t,this.start,this.to);if(this.list){var c=!0,f=!1,d=void 0;try{for(var p,v=this.list[Symbol.iterator]();!(c=(p=v.next()).done);c=!0)p.value.tint=l}catch(t){f=!0,d=t}finally{try{!c&&v.return&&v.return()}finally{if(f)throw d}}}else this.object.tint=l}}},{key:"reverse",value:function(){if(this.tints){for(var t=[],e=this.tints.length-1;0<=e;e--)t.push(this.tints[e]);this.tints=t}else{var r=this.to;this.to=this.start,this.start=r}}}]),a);function a(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i=i||{};var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i));return n.type="Tint",Array.isArray(t)&&(n.list=t,n.object=n.list[0]),n.duration=r,i.load?n.load(i.load):Array.isArray(e)?n.tints=[n.object.tint].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}(e)):(n.start=n.object.tint,n.to=e),n}e.exports=o},{"./wait":22,"yy-color":221}],21:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,e);if(void 0===i){var n=Object.getPrototypeOf(t);return null===n?void 0:s(n,e,r)}if("value"in i)return i.value;var o=i.get;return void 0!==o?o.call(r):void 0}var o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,t("./wait")),i(a,[{key:"fixScale",value:function(){void 0===this.goto.scale||Number.isNaN(this.goto.scale)||(this.goto.scale={x:this.goto.scale,y:this.goto.scale})}},{key:"save",value:function(){var t=s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"save",this).call(this);return t.goto=this.goto,t.start=this.start,t.delta=this.delta,t.keys=this.keys,t}},{key:"load",value:function(t){s(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"load",this).call(this,t),this.goto=t.goto,this.start=t.start,this.delta=t.delta,this.keys=t.keys}},{key:"restart",value:function(){var t=0,e=this.start=[],r=this.delta=[],i=this.keys=[],n=this.goto,o=this.object;for(var s in n){if(isNaN(n[s])){i[t]={key:s,children:[]},e[t]=[],r[t]=[];var a=0;for(var u in n[s])i[t].children[a]=u,e[t][a]=parseFloat(o[s][u]),e[t][a]=this._correctDOM(u,e[t][a]),e[t][a]=isNaN(this.start[t][a])?0:e[t][a],r[t][a]=n[s][u]-e[t][a],a++}else e[t]=parseFloat(o[s]),e[t]=this._correctDOM(s,e[t]),e[t]=isNaN(this.start[t])?0:e[t],r[t]=n[s]-e[t],i[t]=s;t++}this.time=0}},{key:"reverse",value:function(){for(var t=this.object,e=this.keys,r=this.goto,i=this.delta,n=this.start,o=0,s=e.length;o<s;o++){var a=e[o];if(isNaN(r[a]))for(var u=0,h=a.children.length;u<h;u++)i[o][u]=-i[o][u],n[o][u]=parseFloat(t[a.key][a.children[u]]),n[o][u]=isNaN(n[o][u])?0:n[o][u];else i[o]=-i[o],n[o]=parseFloat(t[a]),n[o]=isNaN(n[o])?0:n[o]}}},{key:"calculate",value:function(){for(var t=this.object,e=this.list,r=this.keys,i=this.goto,n=this.time,o=this.start,s=this.delta,a=this.duration,u=this.options.ease,h=0,l=this.keys.length;h<l;h++){var c=r[h];if(isNaN(i[c]))for(var f=c.key,d=0,p=c.children.length;d<p;d++){var v=c.children[d],y=t[f][v]=a<=n?o[h][d]+s[h][d]:u(n,o[h][d],s[h][d],a);if(e)for(var g=1,m=e.length;g<m;g++)e[g][f][v]=y}else{var b=r[h],_=t[b]=a<=n?o[h]+s[h]:u(n,o[h],s[h],a);if(e)for(var x=1,w=this.list.length;x<w;x++)e[x][b]=_}}}}]),a);function a(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),i=i||{};var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t,i));return n.type="To",Array.isArray(t)&&(n.list=t,n.object=n.list[0]),i.load?n.load(i.load):(n.goto=e,n.fixScale(),n.duration=r,n.restart()),n}e.exports=o},{"./wait":22}],22:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("penner"),s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,t("eventemitter3")),i(a,[{key:"save",value:function(){var t={type:this.type,time:this.time,duration:this.duration,ease:this.options.easeName},e=this.options;return e.wait&&(t.wait=e.wait),void 0!==e.id&&(t.id=e.id),e.pause&&(t.pause=e.pause),e.repeat&&(t.repeat=e.repeat),e.reverse&&(t.reverse=e.reverse),t}},{key:"load",value:function(t){this.options.wait=t.wait,this.options.pause=t.pause,this.options.repeat=t.repeat,this.options.reverse=t.reverse,this.options.id=t.id,this.options.ease=t.ease,this.options.ease&&"function"!=typeof this.options.ease&&(this.options.easeName=this.options.ease,this.options.ease=o[this.options.ease]),this.options.ease||(this.options.ease=o.linear),this.time=t.time,this.duration=t.duration}},{key:"end",value:function(t){if(this.options.reverse)this.reverse(),this.time=t,this.options.repeat?!0!==this.options.repeat&&this.options.repeat--:!0===this.options.reverse?this.options.reverse=!1:this.options.reverse--,this.emit("loop",this.list||this.object);else{if(!this.options.repeat)return this.done(),this.emit("done",this.list||this.object,t),!0;this.time=t,!0!==this.options.repeat&&this.options.repeat--,this.emit("loop",this.list||this.object)}}},{key:"update",value:function(t){var e=this.options;if(!e.pause){if(e.wait){if(e.wait-=t,!(e.wait<=0))return void this.emit("wait",t,this.list||this.object);t=-e.wait,e.wait=!1}this.first||(this.first=!0,this.emit("first",this.list||this.object)),this.time+=t;var r=0,i=this.duration,n=this.time;0!==i&&i<n&&(r=n-i,this.time=n=i);var o=this.calculate(t);return this.emit("each",t,this.list||this.object,this),"Wait"===this.type||0!==i&&n===i?this.end(r):o||n===i}}},{key:"_correctDOM",value:function(t,e){switch(t){case"opacity":return isNaN(e)?1:e}return e}},{key:"reverse",value:function(){}},{key:"calculate",value:function(){}},{key:"done",value:function(){}},{key:"pause",set:function(t){this.options.pause=t},get:function(){return this.options.pause}}]),a);function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return r.object=t,r.options=e||{},r.type="Wait",r.options.load?r.load(r.options.load):r.time=0,r.options.ease&&"function"!=typeof r.options.ease&&(r.options.easeName=r.options.ease,r.options.ease=o[r.options.ease]),r.options.ease||(r.options.ease=o.linear),r}e.exports=s},{eventemitter3:6,penner:11}],23:[function(t,e,r){function n(t,e,r,i){this.gl=t,this.buffer=t.createBuffer(),this.type=e||t.ARRAY_BUFFER,this.drawType=i||t.STATIC_DRAW,this.data=o,r&&this.upload(r),this._updateID=0}var o=new ArrayBuffer(0);n.prototype.upload=function(t,e,r){r||this.bind();var i=this.gl;t=t||this.data,e=e||0,this.data.byteLength>=t.byteLength?i.bufferSubData(this.type,e,t):i.bufferData(this.type,t,this.drawType),this.data=t},n.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},n.createVertexBuffer=function(t,e,r){return new n(t,t.ARRAY_BUFFER,e,r)},n.createIndexBuffer=function(t,e,r){return new n(t,t.ELEMENT_ARRAY_BUFFER,e,r)},n.create=function(t,e,r,i){return new n(t,e,r,i)},n.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},e.exports=n},{}],24:[function(t,e,r){function s(t,e,r){this.gl=t,this.framebuffer=t.createFramebuffer(),this.stencil=null,this.texture=null,this.width=e||100,this.height=r||100}var a=t("./GLTexture");s.prototype.enableTexture=function(t){var e=this.gl;this.texture=t||new a(e),this.texture.bind(),this.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0)},s.prototype.enableStencil=function(){if(!this.stencil){var t=this.gl;this.stencil=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencil),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height)}},s.prototype.clear=function(t,e,r,i){this.bind();var n=this.gl;n.clearColor(t,e,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},s.prototype.bind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer)},s.prototype.unbind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)},s.prototype.resize=function(t,e){var r=this.gl;this.width=t,this.height=e,this.texture&&this.texture.uploadData(null,t,e),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e))},s.prototype.destroy=function(){var t=this.gl;this.texture&&this.texture.destroy(),t.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},s.createRGBA=function(t,e,r,i){var n=a.fromData(t,null,e,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(t,e,r);return o.enableTexture(n),o.unbind(),o},s.createFloat32=function(t,e,r,i){var n=new a.fromData(t,i,e,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(t,e,r);return o.enableTexture(n),o.unbind(),o},e.exports=s},{"./GLTexture":26}],25:[function(t,e,r){function i(t,e,r,i,n){this.gl=t,i&&(e=u(e,i),r=u(r,i)),this.program=o(t,e,r,n),this.attributes=s(t,this.program),this.uniformData=a(t,this.program),this.uniforms=h(t,this.uniformData)}var o=t("./shader/compileProgram"),s=t("./shader/extractAttributes"),a=t("./shader/extractUniforms"),u=t("./shader/setPrecision"),h=t("./shader/generateUniformAccessObject");i.prototype.bind=function(){return this.gl.useProgram(this.program),this},i.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},e.exports=i},{"./shader/compileProgram":31,"./shader/extractAttributes":33,"./shader/extractUniforms":34,"./shader/generateUniformAccessObject":35,"./shader/setPrecision":39}],26:[function(t,e,r){function o(t,e,r,i,n){this.gl=t,this.texture=t.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=e||-1,this.height=r||-1,this.format=i||t.RGBA,this.type=n||t.UNSIGNED_BYTE}var n=!(o.prototype.upload=function(t){this.bind();var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=t.videoWidth||t.width,i=t.videoHeight||t.height;i!==this.height||r!==this.width?e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,this.type,t):e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.format,this.type,t),this.width=r,this.height=i});o.prototype.uploadData=function(t,e,r){this.bind();var i=this.gl;if(t instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,e,r,0,this.format,this.type,t||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,e,r,this.format,this.type,t||null),this.width=e,this.height=r},o.prototype.bind=function(t){var e=this.gl;void 0!==t&&e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)},o.prototype.unbind=function(){var t=this.gl;t.bindTexture(t.TEXTURE_2D,null)},o.prototype.minFilter=function(t){var e=this.gl;this.bind(),this.mipmap?e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR:e.NEAREST)},o.prototype.magFilter=function(t){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t?e.LINEAR:e.NEAREST)},o.prototype.enableMipmap=function(){var t=this.gl;this.bind(),this.mipmap=!0,t.generateMipmap(t.TEXTURE_2D)},o.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},o.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},o.prototype.enableWrapClamp=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)},o.prototype.enableWrapRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)},o.prototype.enableWrapMirrorRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.MIRRORED_REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.MIRRORED_REPEAT)},o.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},o.fromSource=function(t,e,r){var i=new o(t);return i.premultiplyAlpha=r||!1,i.upload(e),i},o.fromData=function(t,e,r,i){var n=new o(t);return n.uploadData(e,r,i),n},e.exports=o},{}],27:[function(t,e,r){var n=t("./setVertexAttribArrays");function i(t,e){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=e,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=t.getParameter(t.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=t,this.attributes=[],this.indexBuffer=null,this.dirty=!1}i.prototype.constructor=i,(e.exports=i).FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var t=this.gl,e=null,r=0;r<this.attributes.length;r++){var i=this.attributes[r];e!==i.buffer&&(i.buffer.bind(),e=i.buffer),t.vertexAttribPointer(i.attribute.location,i.attribute.size,i.type||t.FLOAT,i.normalized||!1,i.stride||0,i.start||0)}return n(t,this.attributes,this.nativeState),this.indexBuffer&&this.indexBuffer.bind(),this},i.prototype.addAttribute=function(t,e,r,i,n,o){return this.attributes.push({buffer:t,attribute:e,location:e.location,type:r||this.gl.FLOAT,normalized:i||!1,stride:n||0,start:o||0}),this.dirty=!0,this},i.prototype.addIndex=function(t){return this.indexBuffer=t,this.dirty=!0,this},i.prototype.clear=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.attributes.length=0,this.indexBuffer=null,this},i.prototype.draw=function(t,e,r){var i=this.gl;return this.indexBuffer?i.drawElements(t,e||this.indexBuffer.data.length,i.UNSIGNED_SHORT,2*(r||0)):i.drawArrays(t,r,e||this.getSize()),this},i.prototype.destroy=function(){this.gl=null,this.indexBuffer=null,this.attributes=null,this.nativeState=null,this.nativeVao&&this.nativeVaoExtension.deleteVertexArrayOES(this.nativeVao),this.nativeVaoExtension=null,this.nativeVao=null},i.prototype.getSize=function(){var t=this.attributes[0];return t.buffer.data.length/(t.stride/4||t.attribute.size)}},{"./setVertexAttribArrays":30}],28:[function(t,e,r){e.exports=function(t,e){var r=t.getContext("webgl",e)||t.getContext("experimental-webgl",e);if(!r)throw new Error("This browser does not support webGL. Try using the canvas renderer");return r}},{}],29:[function(t,e,r){var i={createContext:t("./createContext"),setVertexAttribArrays:t("./setVertexAttribArrays"),GLBuffer:t("./GLBuffer"),GLFramebuffer:t("./GLFramebuffer"),GLShader:t("./GLShader"),GLTexture:t("./GLTexture"),VertexArrayObject:t("./VertexArrayObject"),shader:t("./shader")};void 0!==e&&e.exports&&(e.exports=i),"undefined"!=typeof window&&(window.PIXI=window.PIXI||{},window.PIXI.glCore=i)},{"./GLBuffer":23,"./GLFramebuffer":24,"./GLShader":25,"./GLTexture":26,"./VertexArrayObject":27,"./createContext":28,"./setVertexAttribArrays":30,"./shader":36}],30:[function(t,e,r){e.exports=function(t,e,r){var i;if(r){var n=r.tempAttribState,o=r.attribState;for(i=0;i<n.length;i++)n[i]=!1;for(i=0;i<e.length;i++)n[e[i].attribute.location]=!0;for(i=0;i<o.length;i++)o[i]!==n[i]&&(o[i]=n[i],r.attribState[i]?t.enableVertexAttribArray(i):t.disableVertexAttribArray(i))}else for(i=0;i<e.length;i++){var s=e[i];t.enableVertexAttribArray(s.attribute.location)}}},{}],31:[function(t,e,r){var u=function(t,e,r){var i=t.createShader(e);return t.shaderSource(i,r),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS)?i:(console.log(t.getShaderInfoLog(i)),null)};e.exports=function(t,e,r,i){var n=u(t,t.VERTEX_SHADER,e),o=u(t,t.FRAGMENT_SHADER,r),s=t.createProgram();if(t.attachShader(s,n),t.attachShader(s,o),i)for(var a in i)t.bindAttribLocation(s,i[a],a);return t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS)||(console.error("Pixi.js Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(s,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(s)&&console.warn("Pixi.js Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(s)),t.deleteProgram(s),s=null),t.deleteShader(n),t.deleteShader(o),s}},{}],32:[function(t,e,r){var i=function(t){for(var e=new Array(t),r=0;r<e.length;r++)e[r]=!1;return e};e.exports=function(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"sampler2D":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"bool":return!1;case"bvec2":return i(2*e);case"bvec3":return i(3*e);case"bvec4":return i(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}},{}],33:[function(t,e,r){var a=t("./mapType"),u=t("./mapSize"),h=function(t,e,r,i){gl.vertexAttribPointer(this.location,this.size,t||gl.FLOAT,e||!1,r||0,i||0)};e.exports=function(t,e){for(var r={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n=0;n<i;n++){var o=t.getActiveAttrib(e,n),s=a(t,o.type);r[o.name]={type:s,size:u(s),location:t.getAttribLocation(e,o.name),pointer:h}}return r}},{"./mapSize":37,"./mapType":38}],34:[function(t,e,r){var u=t("./mapType"),h=t("./defaultValue");e.exports=function(t,e){for(var r={},i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n=0;n<i;n++){var o=t.getActiveUniform(e,n),s=o.name.replace(/\[.*?\]/,""),a=u(t,o.type);r[s]={type:a,size:o.size,location:t.getUniformLocation(e,s),value:h(a,o.size)}}return r}},{"./defaultValue":32,"./mapType":38}],35:[function(t,e,r){var l=function(t){return function(){return this.data[t].value}},n={float:function(t,e,r){t.uniform1f(e,r)},vec2:function(t,e,r){t.uniform2f(e,r[0],r[1])},vec3:function(t,e,r){t.uniform3f(e,r[0],r[1],r[2])},vec4:function(t,e,r){t.uniform4f(e,r[0],r[1],r[2],r[3])},int:function(t,e,r){t.uniform1i(e,r)},ivec2:function(t,e,r){t.uniform2i(e,r[0],r[1])},ivec3:function(t,e,r){t.uniform3i(e,r[0],r[1],r[2])},ivec4:function(t,e,r){t.uniform4i(e,r[0],r[1],r[2],r[3])},bool:function(t,e,r){t.uniform1i(e,r)},bvec2:function(t,e,r){t.uniform2i(e,r[0],r[1])},bvec3:function(t,e,r){t.uniform3i(e,r[0],r[1],r[2])},bvec4:function(t,e,r){t.uniform4i(e,r[0],r[1],r[2],r[3])},mat2:function(t,e,r){t.uniformMatrix2fv(e,!1,r)},mat3:function(t,e,r){t.uniformMatrix3fv(e,!1,r)},mat4:function(t,e,r){t.uniformMatrix4fv(e,!1,r)},sampler2D:function(t,e,r){t.uniform1i(e,r)}},o={float:function(t,e,r){t.uniform1fv(e,r)},vec2:function(t,e,r){t.uniform2fv(e,r)},vec3:function(t,e,r){t.uniform3fv(e,r)},vec4:function(t,e,r){t.uniform4fv(e,r)},int:function(t,e,r){t.uniform1iv(e,r)},ivec2:function(t,e,r){t.uniform2iv(e,r)},ivec3:function(t,e,r){t.uniform3iv(e,r)},ivec4:function(t,e,r){t.uniform4iv(e,r)},bool:function(t,e,r){t.uniform1iv(e,r)},bvec2:function(t,e,r){t.uniform2iv(e,r)},bvec3:function(t,e,r){t.uniform3iv(e,r)},bvec4:function(t,e,r){t.uniform4iv(e,r)},sampler2D:function(t,e,r){t.uniform1iv(e,r)}};function c(r,i){return function(t){this.data[r].value=t;var e=this.data[r].location;1===i.size?n[i.type](this.gl,e,t):o[i.type](this.gl,e,t)}}function f(t,e){for(var r=e,i=0;i<t.length-1;i++){var n=r[t[i]]||{data:{}};r[t[i]]=n,r=n}return r}e.exports=function(t,e){var r={data:{}};r.gl=t;for(var i=Object.keys(e),n=0;n<i.length;n++){var o=i[n],s=o.split("."),a=s[s.length-1],u=f(s,r),h=e[o];u.data[a]=h,u.gl=t,Object.defineProperty(u,a,{get:l(a),set:c(a,h)})}return r}},{}],36:[function(t,e,r){e.exports={compileProgram:t("./compileProgram"),defaultValue:t("./defaultValue"),extractAttributes:t("./extractAttributes"),extractUniforms:t("./extractUniforms"),generateUniformAccessObject:t("./generateUniformAccessObject"),setPrecision:t("./setPrecision"),mapSize:t("./mapSize"),mapType:t("./mapType")}},{"./compileProgram":31,"./defaultValue":32,"./extractAttributes":33,"./extractUniforms":34,"./generateUniformAccessObject":35,"./mapSize":37,"./mapType":38,"./setPrecision":39}],37:[function(t,e,r){var i={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};e.exports=function(t){return i[t]}},{}],38:[function(t,e,r){var o=null,s={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"};e.exports=function(t,e){if(!o){var r=Object.keys(s);o={};for(var i=0;i<r.length;++i){var n=r[i];o[t[n]]=s[n]}}return o[e]}},{}],39:[function(t,e,r){e.exports=function(t,e){return"precision"!==t.substring(0,9)?"precision "+e+" float;\n"+t:t}},{}],40:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./utils"),s=t("./plugin");function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t));return e=e||{},r.time=e.time||150,r.ease=o.ease(e.ease,"easeInOutSine"),r.friction=e.friction||.5,e.sides=e.sides||"all",e.sides&&("all"===e.sides?r.top=r.bottom=r.left=r.right=!0:"horizontal"===e.sides?r.right=r.left=!0:"vertical"===e.sides?r.top=r.bottom=!0:(r.top=-1!==e.sides.indexOf("top"),r.bottom=-1!==e.sides.indexOf("bottom"),r.left=-1!==e.sides.indexOf("left"),r.right=-1!==e.sides.indexOf("right"))),r.parseUnderflow(e.underflow||"center"),r.last={},r.reset(),r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,s),i(a,[{key:"parseUnderflow",value:function(t){"center"===(t=t.toLowerCase())?(this.underflowX=0,this.underflowY=0):(this.underflowX=-1!==t.indexOf("left")?-1:-1!==t.indexOf("right")?1:0,this.underflowY=-1!==t.indexOf("top")?-1:-1!==t.indexOf("bottom")?1:0)}},{key:"isActive",value:function(){return null!==this.toX||null!==this.toY}},{key:"down",value:function(){this.toX=this.toY=null}},{key:"up",value:function(){this.bounce()}},{key:"update",value:function(t){if(!this.paused){if(this.bounce(),this.toX){var e=this.toX;e.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-x"}),e.time>=this.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.time)}if(this.toY){var r=this.toY;r.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time)}}}},{key:"calcUnderflowX",value:function(){var t=void 0;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}},{key:"calcUnderflowY",value:function(){var t=void 0;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}},{key:"bounce",value:function(){if(!this.paused){var t=void 0,e=this.parent.plugins.decelerate;e&&(e.x||e.y)&&(e.x&&e.percentChangeX===e.friction||e.y&&e.percentChangeY===e.friction)&&(((t=this.parent.OOB()).left&&this.left||t.right&&this.right)&&(e.percentChangeX=this.friction),(t.top&&this.top||t.bottom&&this.bottom)&&(e.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(e=e||{},!(r.active||i.active||this.toX&&this.toY||e.x&&e.y)){var n=(t=t||this.parent.OOB()).cornerPoint;if(!this.toX&&!e.x){var o=null;t.left&&this.left?o=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():0:t.right&&this.right&&(o=this.parent.screenWorldWidth<this.parent.screenWidth?this.calcUnderflowX():-n.x),null!==o&&this.parent.x!==o&&(this.toX={time:0,start:this.parent.x,delta:o-this.parent.x,end:o},this.parent.emit("bounce-x-start",this.parent))}if(!this.toY&&!e.y){var s=null;t.top&&this.top?s=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():0:t.bottom&&this.bottom&&(s=this.parent.screenWorldHeight<this.parent.screenHeight?this.calcUnderflowY():-n.y),null!==s&&this.parent.y!==s&&(this.toY={time:0,start:this.parent.y,delta:s-this.parent.y,end:s},this.parent.emit("bounce-y-start",this.parent))}}}}},{key:"reset",value:function(){this.toX=this.toY=null}}]),a)},{"./plugin":48,"./utils":51}],41:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./plugin");function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t));return r.minWidth=e.minWidth,r.minHeight=e.minHeight,r.maxWidth=e.maxWidth,r.maxHeight=e.maxHeight,r.clamp(),r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,o),i(s,[{key:"resize",value:function(){this.clamp()}},{key:"clamp",value:function(){if(!this.paused){var t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight;if(this.minWidth&&t<this.minWidth){var r=this.parent.scale.x;this.parent.fitWidth(this.minWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/r,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.maxWidth&&t>this.maxWidth){var i=this.parent.scale.x;this.parent.fitWidth(this.maxWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.minHeight&&e<this.minHeight){var n=this.parent.scale.y;this.parent.fitHeight(this.minHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/n,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.maxHeight&&e>this.maxHeight){var o=this.parent.scale.y;this.parent.fitHeight(this.maxHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/o,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}}}}]),s)},{"./plugin":48}],42:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./plugin"),s=t("./utils");function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),e=e||{};var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t));return void 0===e.direction?(r.left=s.defaults(e.left,null),r.right=s.defaults(e.right,null),r.top=s.defaults(e.top,null),r.bottom=s.defaults(e.bottom,null)):(r.left="x"===e.direction||"all"===e.direction||null,r.right="x"===e.direction||"all"===e.direction||null,r.top="y"===e.direction||"all"===e.direction||null,r.bottom="y"===e.direction||"all"===e.direction||null),r.parseUnderflow(e.underflow||"center"),r.move(),r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,o),i(a,[{key:"parseUnderflow",value:function(t){"none"===(t=t.toLowerCase())?this.noUnderflow=!0:("center"===t?this.underflowX=this.underflowY=0:(this.underflowX=-1!==t.indexOf("left")?-1:-1!==t.indexOf("right")?1:0,this.underflowY=-1!==t.indexOf("top")?-1:-1!==t.indexOf("bottom")?1:0),this.noUnderflow=!1)}},{key:"move",value:function(){this.update()}},{key:"update",value:function(){if(!this.paused){var t={x:this.parent.x,y:this.parent.y},e=this.parent.plugins.decelerate||{};if(null!==this.left||null!==this.right){var r=void 0;if(this.parent.screenWorldWidth<this.parent.screenWidth){if(!this.noUnderflow)switch(this.underflowX){case-1:0!==this.parent.x&&(r=!(this.parent.x=0));break;case 1:this.parent.x!==this.parent.screenWidth-this.parent.screenWorldWidth&&(this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth,r=!0);break;default:this.parent.x!==(this.parent.screenWidth-this.parent.screenWorldWidth)/2&&(this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2,r=!0)}}else null!==this.left&&this.parent.left<(!0===this.left?0:this.left)&&(this.parent.x=-(!0===this.left?0:this.left)*this.parent.scale.x,r=!(e.x=0)),null!==this.right&&this.parent.right>(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,r=!(e.x=0));r&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var i=void 0;if(this.parent.screenWorldHeight<this.parent.screenHeight){if(!this.noUnderflow)switch(this.underflowY){case-1:0!==this.parent.y&&(i=!(this.parent.y=0));break;case 1:this.parent.y!==this.parent.screenHeight-this.parent.screenWorldHeight&&(this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight,i=!0);break;default:this.parent.y!==(this.parent.screenHeight-this.parent.screenWorldHeight)/2&&(this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2,i=!0)}}else null!==this.top&&this.parent.top<(!0===this.top?0:this.top)&&(this.parent.y=-(!0===this.top?0:this.top)*this.parent.scale.y,i=!(e.y=0)),null!==this.bottom&&this.parent.bottom>(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,i=!(e.y=0));i&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-y"})}}}}]),a)},{"./plugin":48,"./utils":51}],43:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./plugin");function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t));return e=e||{},r.friction=e.friction||.95,r.bounce=e.bounce||.5,r.minSpeed=void 0!==e.minSpeed?e.minSpeed:.01,r.saved=[],r.reset(),r.parent.on("moved",function(t){return r.moved(t)}),r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,o),i(s,[{key:"down",value:function(){this.saved=[],this.x=this.y=!1}},{key:"isActive",value:function(){return this.x||this.y}},{key:"move",value:function(){if(!this.paused){var t=this.parent.countDownPointers();(1===t||1<t&&!this.parent.plugins.pinch)&&(this.saved.push({x:this.parent.x,y:this.parent.y,time:performance.now()}),60<this.saved.length&&this.saved.splice(0,30))}}},{key:"moved",value:function(t){if(this.saved.length){var e=this.saved[this.saved.length-1];"clamp-x"===t.type?e.x===t.original.x&&(e.x=this.parent.x):"clamp-y"===t.type&&e.y===t.original.y&&(e.y=this.parent.y)}}},{key:"up",value:function(){if(0===this.parent.countDownPointers()&&this.saved.length){var t=performance.now(),e=!0,r=!1,i=void 0;try{for(var n,o=this.saved[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){var s=n.value;if(s.time>=t-100){var a=t-s.time;this.x=(this.parent.x-s.x)/a,this.y=(this.parent.y-s.y)/a,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(t){void 0!==(t=t||{}).x&&(this.x=t.x,this.percentChangeX=this.friction),void 0!==t.y&&(this.y=t.y,this.percentChangeY=this.friction)}},{key:"update",value:function(t){if(!this.paused){var e=void 0;this.x&&(this.parent.x+=this.x*t,this.x*=this.percentChangeX,Math.abs(this.x)<this.minSpeed&&(this.x=0),e=!0),this.y&&(this.parent.y+=this.y*t,this.y*=this.percentChangeY,Math.abs(this.y)<this.minSpeed&&(this.y=0),e=!0),e&&this.parent.emit("moved",{viewport:this.parent,type:"decelerate"})}}},{key:"reset",value:function(){this.x=this.y=null}}]),s)},{"./plugin":48}],44:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var a=t("pixi.js"),o=t("./utils"),s=t("./plugin");function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),e=e||{};var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,t));return r.moved=!1,r.wheelActive=o.defaults(e.wheel,!0),r.wheelScroll=e.wheelScroll||1,r.reverse=e.reverse?1:-1,r.clampWheel=e.clampWheel,r.factor=e.factor||1,r.xDirection=!e.direction||"all"===e.direction||"x"===e.direction,r.yDirection=!e.direction||"all"===e.direction||"y"===e.direction,r.parseUnderflow(e.underflow||"center"),r.mouseButtons(e.mouseButtons),r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s),i(u,[{key:"mouseButtons",value:function(t){this.mouse=t&&"all"!==t?[-1!==t.indexOf("left"),-1!==t.indexOf("middle"),-1!==t.indexOf("right")]:[1,1,1]}},{key:"parseUnderflow",value:function(t){"center"===(t=t.toLowerCase())?(this.underflowX=0,this.underflowY=0):(this.underflowX=-1!==t.indexOf("left")?-1:-1!==t.indexOf("right")?1:0,this.underflowY=-1!==t.indexOf("top")?-1:-1!==t.indexOf("bottom")?1:0)}},{key:"checkButtons",value:function(t){var e="mouse"===t.data.pointerType,r=this.parent.countDownPointers();return!(!this.parent.parent||!(1===r||1<r&&!this.parent.plugins.pinch)||e&&!this.mouse[t.data.button])}},{key:"down",value:function(t){if(!this.paused){if(this.checkButtons(t)){var e=this.parent.parent.toLocal(t.data.global);return this.last={x:t.data.global.x,y:t.data.global.y,parent:e},this.current=t.data.pointerId,!0}this.last=null}}},{key:"move",value:function(t){if(!this.paused&&this.last&&this.current===t.data.pointerId){var e=t.data.global.x,r=t.data.global.y,i=this.parent.countDownPointers();if(1===i||1<i&&!this.parent.plugins.pinch){var n=e-this.last.x,o=r-this.last.y;if(this.moved||this.xDirection&&this.parent.checkThreshold(n)||this.yDirection&&this.parent.checkThreshold(o)){var s=this.parent.parent.toLocal(t.data.global);return this.xDirection&&(this.parent.x+=(s.x-this.last.parent.x)*this.factor),this.yDirection&&(this.parent.y+=(s.y-this.last.parent.y)*this.factor),this.last={x:e,y:r,parent:s},this.moved||this.parent.emit("drag-start",{screen:new a.Point(this.last.x,this.last.y),world:this.parent.toWorld(this.last),viewport:this.parent}),this.moved=!0,this.parent.emit("moved",{viewport:this.parent,type:"drag"}),!0}}else this.moved=!1}}},{key:"up",value:function(){var t=this.parent.getTouchPointers();if(1===t.length){var e=t[0];if(e.last){var r=this.parent.parent.toLocal(e.last);this.last={x:e.last.x,y:e.last.y,parent:r},this.current=e.last.data.pointerId}return!(this.moved=!1)}if(this.last&&this.moved)return this.parent.emit("drag-end",{screen:new a.Point(this.last.x,this.last.y),world:this.parent.toWorld(this.last),viewport:this.parent}),this.last=this.moved=!1,!0}},{key:"wheel",value:function(t){if(!this.paused&&this.wheelActive){var e=this.parent.plugins.wheel;if(!e)return this.xDirection&&(this.parent.x+=t.deltaX*this.wheelScroll*this.reverse),this.yDirection&&(this.parent.y+=t.deltaY*this.wheelScroll*this.reverse),this.clampWheel&&this.clamp(),this.parent.emit("wheel-scroll",this.parent),this.parent.emit("moved",this.parent),this.parent.passiveWheel||t.preventDefault(),!0}}},{key:"resume",value:function(){this.last=null,this.paused=!1}},{key:"clamp",value:function(){var t=this.parent.plugins.decelerate||{};if("y"!==this.clampWheel)if(this.parent.screenWorldWidth<this.parent.screenWidth)switch(this.underflowX){case-1:this.parent.x=0;break;case 1:this.parent.x=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:this.parent.x=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}else this.parent.left<0?(this.parent.x=0,t.x=0):this.parent.right>this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeight<this.parent.screenHeight)switch(this.underflowY){case-1:this.parent.y=0;break;case 1:this.parent.y=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:this.parent.y=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}else this.parent.top<0&&(this.parent.y=0,t.y=0),this.parent.bottom>this.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}},{key:"active",get:function(){return this.moved}}]),u)},{"./plugin":48,"./utils":51,"pixi.js":169}],45:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./plugin");function s(t,e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t));return r=r||{},i.speed=r.speed||0,i.acceleration=r.acceleration||0,i.velocity={x:0,y:0},i.target=e,i.radius=r.radius,i}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,o),i(s,[{key:"update",value:function(t){if(!this.paused){var e=this.parent.center,r=this.target.x,i=this.target.y;if(this.radius){if(!(Math.sqrt(Math.pow(this.target.y-e.y,2)+Math.pow(this.target.x-e.x,2))>this.radius))return;var n=Math.atan2(this.target.y-e.y,this.target.x-e.x);r=this.target.x-Math.cos(n)*this.radius,i=this.target.y-Math.sin(n)*this.radius}var o=r-e.x,s=i-e.y;if(o||s)if(this.speed)if(this.acceleration){var a=Math.atan2(i-e.y,r-e.x),u=Math.sqrt(Math.pow(o,2)+Math.pow(s,2));if(u){var h=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.acceleration);this.velocity=h<u?{x:Math.min(this.velocity.x+this.acceleration*t,this.speed),y:Math.min(this.velocity.y+this.acceleration*t,this.speed)}:{x:Math.max(this.velocity.x-this.acceleration*this.speed,0),y:Math.max(this.velocity.y-this.acceleration*this.speed,0)};var l=Math.cos(a)*this.velocity.x,c=Math.sin(a)*this.velocity.y,f=Math.abs(l)>Math.abs(o)?r:e.x+l,d=Math.abs(c)>Math.abs(s)?i:e.y+c;this.parent.moveCenter(f,d),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{var p=Math.atan2(i-e.y,r-e.x),v=Math.cos(p)*this.speed,y=Math.sin(p)*this.speed,g=Math.abs(v)>Math.abs(o)?r:e.x+v,m=Math.abs(y)>Math.abs(s)?i:e.y+y;this.parent.moveCenter(g,m),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(r,i),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),s)},{"./plugin":48}],46:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./utils"),s=t("./plugin");function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t));return e=e||{},r.options=e,r.reverse=e.reverse?1:-1,r.noDecelerate=e.noDecelerate,r.linear=e.linear,r.radiusSquared=Math.pow(e.radius,2),r.resize(),r.speed=e.speed||8,r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,s),i(a,[{key:"resize",value:function(){var t=this.options,e=t.distance;o.exists(e)?(this.left=e,this.top=e,this.right=window.innerWidth-e,this.bottom=window.innerHeight-e):this.radius||(this.left=o.exists(t.left)?t.left:null,this.top=o.exists(t.top)?t.top:null,this.right=o.exists(t.right)?window.innerWidth-t.right:null,this.bottom=o.exists(t.bottom)?window.innerHeight-t.bottom:null)}},{key:"down",value:function(){this.options.allowButtons||(this.horizontal=this.vertical=null)}},{key:"move",value:function(t){if(!("MOUSE"!==t.data.identifier&&1!==t.data.identifier||!this.options.allowButtons&&0!==t.data.buttons)){var e=t.data.global.x,r=t.data.global.y;if(this.radiusSquared){var i=this.parent.toScreen(this.parent.center);if(Math.pow(i.x-e,2)+Math.pow(i.y-r,2)>=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-e);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&e<this.left?this.horizontal=1*this.reverse*this.speed*.06:o.exists(this.right)&&e>this.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&r<this.top?this.vertical=1*this.reverse*this.speed*.06:o.exists(this.bottom)&&r>this.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var t=this.parent.plugins.decelerate;this.horizontal&&t&&!this.noDecelerate&&t.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var t=this.parent.plugins.decelerate;this.vertical&&t&&!this.noDecelerate&&t.activate({y:this.vertical*this.speed*this.reverse/(1e3/60)})}},{key:"up",value:function(){this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null}},{key:"update",value:function(){if(!this.paused&&(this.horizontal||this.vertical)){var t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.speed),this.vertical&&(t.y+=this.vertical*this.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),a)},{"./plugin":48,"./utils":51}],47:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./plugin");function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t));return e=e||{},r.percent=e.percent||1,r.noDrag=e.noDrag,r.center=e.center,r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,o),i(s,[{key:"down",value:function(){if(2<=this.parent.countDownPointers())return this.active=!0}},{key:"move",value:function(t){if(!this.paused&&this.active){var e=t.data.global.x,r=t.data.global.y,i=this.parent.getTouchPointers();if(2<=i.length){var n=i[0],o=i[1],s=n.last&&o.last?Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2)):null;if(n.pointerId===t.data.pointerId?n.last={x:e,y:r,data:t.data}:o.pointerId===t.data.pointerId&&(o.last={x:e,y:r,data:t.data}),s){var a=void 0,u={x:n.last.x+(o.last.x-n.last.x)/2,y:n.last.y+(o.last.y-n.last.y)/2};this.center||(a=this.parent.toLocal(u));var h=(Math.sqrt(Math.pow(o.last.x-n.last.x,2)+Math.pow(o.last.y-n.last.y,2))-s)/this.parent.screenWidth*this.parent.scale.x*this.percent;this.parent.scale.x+=h,this.parent.scale.y+=h,this.parent.emit("zoomed",{viewport:this.parent,type:"pinch"});var l=this.parent.plugins["clamp-zoom"];if(l&&l.clamp(),this.center)this.parent.moveCenter(this.center);else{var c=this.parent.toGlobal(a);this.parent.x+=u.x-c.x,this.parent.y+=u.y-c.y,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})}!this.noDrag&&this.lastCenter&&(this.parent.x+=u.x-this.lastCenter.x,this.parent.y+=u.y-this.lastCenter.y,this.parent.emit("moved",{viewport:this.parent,type:"pinch"})),this.lastCenter=u,this.moved=!0}else this.pinching||(this.parent.emit("pinch-start",this.parent),this.pinching=!0);return!0}}}},{key:"up",value:function(){if(this.pinching&&this.parent.touches.length<=1)return this.active=!1,this.lastCenter=null,this.pinching=!1,this.moved=!1,this.parent.emit("pinch-end",this.parent),!0}}]),s)},{"./plugin":48}],48:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),this.parent=t,this.paused=!1}e.exports=(i(o,[{key:"down",value:function(t){}},{key:"move",value:function(t){}},{key:"up",value:function(t){}},{key:"wheel",value:function(t){}},{key:"update",value:function(){}},{key:"resize",value:function(){}},{key:"reset",value:function(){}},{key:"pause",value:function(){this.paused=!0}},{key:"resume",value:function(){this.paused=!1}}]),o)},{}],49:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./plugin"),s=t("./utils");function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t));return e=e||{},r.width=e.width,r.height=e.height,0<r.width&&(r.x_scale=t._screenWidth/r.width),0<r.height&&(r.y_scale=t._screenHeight/r.height),r.xIndependent=s.exists(r.x_scale),r.yIndependent=s.exists(r.y_scale),r.x_scale=r.xIndependent?r.x_scale:r.y_scale,r.y_scale=r.yIndependent?r.y_scale:r.x_scale,r.time=s.defaults(e.time,1e3),r.ease=s.ease(e.ease,"easeInOutSine"),r.center=e.center,r.noMove=e.noMove,r.stopOnResize=e.stopOnResize,r.removeOnInterrupt=e.removeOnInterrupt,r.removeOnComplete=s.defaults(e.removeOnComplete,!0),r.interrupt=s.defaults(e.interrupt,!0),0===r.time?(t.container.scale.x=r.x_scale,t.container.scale.y=r.y_scale,r.removeOnComplete&&r.parent.removePlugin("snap-zoom")):e.forceStart&&r.createSnapping(),r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,o),i(a,[{key:"createSnapping",value:function(){var t=this.parent.scale;this.snapping={time:0,startX:t.x,startY:t.y,deltaX:this.x_scale-t.x,deltaY:this.y_scale-t.y},this.parent.emit("snap-zoom-start",this.parent)}},{key:"resize",value:function(){this.snapping=null,0<this.width&&(this.x_scale=this.parent._screenWidth/this.width),0<this.height&&(this.y_scale=this.parent._screenHeight/this.height),this.x_scale=this.xIndependent?this.x_scale:this.y_scale,this.y_scale=this.yIndependent?this.y_scale:this.x_scale}},{key:"reset",value:function(){this.snapping=null}},{key:"wheel",value:function(){this.removeOnInterrupt&&this.parent.removePlugin("snap-zoom")}},{key:"down",value:function(){this.removeOnInterrupt?this.parent.removePlugin("snap-zoom"):this.interrupt&&(this.snapping=null)}},{key:"update",value:function(t){if(!(this.paused||this.interrupt&&0!==this.parent.countDownPointers())){var e=void 0;if(this.center||this.noMove||(e=this.parent.center),this.snapping){if(this.snapping){var r=this.snapping;if(r.time+=t,r.time>=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(e))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function t(e,r,i){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,r);if(void 0===n){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,i)}if("value"in n)return n.value;var s=n.get;return void 0!==s?s.call(i):void 0}(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"resume",this).call(this)}}]),a)},{"./plugin":48,"./utils":51}],50:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./plugin"),s=t("./utils");function a(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,t));return i=i||{},n.friction=i.friction||.8,n.time=i.time||1e3,n.ease=s.ease(i.ease,"easeInOutSine"),n.x=e,n.y=r,n.topLeft=i.topLeft,n.interrupt=s.defaults(i.interrupt,!0),n.removeOnComplete=i.removeOnComplete,n.removeOnInterrupt=i.removeOnInterrupt,i.forceStart&&n.startEase(),n}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,o),i(a,[{key:"snapStart",value:function(){this.percent=0,this.snapping={time:0};var t=this.topLeft?this.parent.corner:this.parent.center;this.deltaX=this.x-t.x,this.deltaY=this.y-t.y,this.startX=t.x,this.startY=t.y,this.parent.emit("snap-start",this.parent)}},{key:"wheel",value:function(){this.removeOnInterrupt&&this.parent.removePlugin("snap")}},{key:"down",value:function(){this.removeOnInterrupt?this.parent.removePlugin("snap"):this.interrupt&&(this.snapping=null)}},{key:"up",value:function(){if(0===this.parent.countDownPointers()){var t=this.parent.plugins.decelerate;t&&(t.x||t.y)&&(t.percentChangeX=t.percentChangeY=this.friction)}}},{key:"update",value:function(t){if(!(this.paused||this.interrupt&&0!==this.parent.countDownPointers()))if(this.snapping){var e=this.snapping;e.time+=t;var r=void 0,i=void 0,n=void 0;if(e.time>this.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(e.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var s=this.topLeft?this.parent.corner:this.parent.center;s.x===this.x&&s.y===this.y||this.snapStart()}}}]),a)},{"./plugin":48,"./utils":51}],51:[function(t,e,r){"use strict";var i=t("penner");function n(t){return null!=t}e.exports={exists:n,defaults:function(t,e){return null!=t?t:e},ease:function(t,e){return n(t)?"function"==typeof t?t:"string"==typeof t?i[t]:void 0:i[e]}}},{penner:11}],52:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("pixi.js"),s=t("./utils"),a=t("./drag"),u=t("./pinch"),h=t("./clamp"),l=t("./clamp-zoom"),c=t("./decelerate"),f=t("./bounce"),d=t("./snap"),p=t("./snap-zoom"),v=t("./follow"),y=t("./wheel"),g=t("./mouse-edges"),m=["drag","pinch","wheel","follow","mouse-edges","decelerate","bounce","snap-zoom","clamp-zoom","snap","clamp"],b=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(_,o.Container),i(_,[{key:"removeListeners",value:function(){this.ticker.remove(this.tickerFunction),this.div.removeEventListener("wheel",this.wheelFunction)}},{key:"destroy",value:function(t){(function t(e,r,i){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,r);if(void 0===n){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,i)}if("value"in n)return n.value;var s=n.get;return void 0!==s?s.call(i):void 0})(_.prototype.__proto__||Object.getPrototypeOf(_.prototype),"destroy",this).call(this,t),this.removeListeners()}},{key:"update",value:function(t){if(!this.pause){var e=!0,r=!1,i=void 0;try{for(var n,o=this.pluginsList[Symbol.iterator]();!(e=(n=o.next()).done);e=!0)n.value.update(t)}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}this.lastViewport&&(this.lastViewport.x!==this.x||this.lastViewport.y!==this.y?this.moving=!0:this.moving&&(this.emit("moved-end",this),this.moving=!1),this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y?this.zooming=!0:this.zooming&&(this.emit("zoomed-end",this),this.zooming=!1)),this.forceHitArea||(this.hitArea.x=this.left,this.hitArea.y=this.top,this.hitArea.width=this.worldScreenWidth,this.hitArea.height=this.worldScreenHeight),this._dirty=this._dirty||!this.lastViewport||this.lastViewport.x!==this.x||this.lastViewport.y!==this.y||this.lastViewport.scaleX!==this.scale.x||this.lastViewport.scaleY!==this.scale.y,this.lastViewport={x:this.x,y:this.y,scaleX:this.scale.x,scaleY:this.scale.y}}}},{key:"resize",value:function(t,e,r,i){this._screenWidth=t||window.innerWidth,this._screenHeight=e||window.innerHeight,r&&(this._worldWidth=r),i&&(this._worldHeight=i),this.resizePlugins()}},{key:"resizePlugins",value:function(){var t=!0,e=!1,r=void 0;try{for(var i,n=this.pluginsList[Symbol.iterator]();!(t=(i=n.next()).done);t=!0)i.value.resize()}catch(t){e=!0,r=t}finally{try{!t&&n.return&&n.return()}finally{if(e)throw r}}}},{key:"getVisibleBounds",value:function(){return{x:this.left,y:this.top,width:this.worldScreenWidth,height:this.worldScreenHeight}}},{key:"listeners",value:function(t){var e=this;this.interactive=!0,this.forceHitArea||(this.hitArea=new o.Rectangle(0,0,this.worldWidth,this.worldHeight)),this.on("pointerdown",this.down),this.on("pointermove",this.move),this.on("pointerup",this.up),this.on("pointerupoutside",this.up),this.on("pointercancel",this.up),this.on("pointerout",this.up),this.wheelFunction=function(t){return e.handleWheel(t)},t.addEventListener("wheel",this.wheelFunction,{passive:this.passiveWheel}),this.isMouseDown=!1}},{key:"down",value:function(t){if(!this.pause&&this.worldVisible){if("mouse"===t.data.pointerType?this.isMouseDown=!0:this.touches.push(t.data.pointerId),1===this.countDownPointers()){this.last=t.data.global.clone();var e=this.plugins.decelerate,r=this.plugins.bounce;e&&e.isActive()||r&&r.isActive()?this.clickedAvailable=!1:this.clickedAvailable=!0}else this.clickedAvailable=!1;var i=void 0,n=!0,o=!1,s=void 0;try{for(var a,u=this.pluginsList[Symbol.iterator]();!(n=(a=u.next()).done);n=!0)a.value.down(t)&&(i=!0)}catch(t){o=!0,s=t}finally{try{!n&&u.return&&u.return()}finally{if(o)throw s}}i&&this.stopEvent&&t.stopPropagation()}}},{key:"checkThreshold",value:function(t){return Math.abs(t)>=this.threshold}},{key:"move",value:function(t){if(!this.pause&&this.worldVisible){var e=void 0,r=!0,i=!1,n=void 0;try{for(var o,s=this.pluginsList[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)o.value.move(t)&&(e=!0)}catch(t){i=!0,n=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw n}}if(this.clickedAvailable){var a=t.data.global.x-this.last.x,u=t.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(u))&&(this.clickedAvailable=!1)}e&&this.stopEvent&&t.stopPropagation()}}},{key:"up",value:function(t){if(!this.pause&&this.worldVisible){if("mouse"===t.data.pointerType&&(this.isMouseDown=!1),"mouse"!==t.data.pointerType)for(var e=0;e<this.touches.length;e++)if(this.touches[e]===t.data.pointerId){this.touches.splice(e,1);break}var r=void 0,i=!0,n=!1,o=void 0;try{for(var s,a=this.pluginsList[Symbol.iterator]();!(i=(s=a.next()).done);i=!0)s.value.up(t)&&(r=!0)}catch(t){n=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(n)throw o}}this.clickedAvailable&&0===this.countDownPointers()&&(this.emit("clicked",{screen:this.last,world:this.toWorld(this.last),viewport:this}),this.clickedAvailable=!1),r&&this.stopEvent&&t.stopPropagation()}}},{key:"getPointerPosition",value:function(t){var e=new o.Point;return this.interaction?this.interaction.mapPositionToPoint(e,t.clientX,t.clientY):(e.x=t.clientX,e.y=t.clientY),e}},{key:"handleWheel",value:function(t){if(!this.pause&&this.worldVisible){var e=this.toLocal(this.getPointerPosition(t));if(this.left<=e.x&&e.x<=this.right&&this.top<=e.y&&e.y<=this.bottom){var r=void 0,i=!0,n=!1,o=void 0;try{for(var s,a=this.pluginsList[Symbol.iterator]();!(i=(s=a.next()).done);i=!0)s.value.wheel(t)&&(r=!0)}catch(t){n=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(n)throw o}}return r}}}},{key:"toWorld",value:function(){if(2!==arguments.length)return this.toLocal(arguments[0]);var t=arguments[0],e=arguments[1];return this.toLocal({x:t,y:e})}},{key:"toScreen",value:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return this.toGlobal({x:t,y:e})}var r=arguments[0];return this.toGlobal(r)}},{key:"moveCenter",value:function(){var t=void 0,e=void 0;return e=isNaN(arguments[0])?(t=arguments[0].x,arguments[0].y):(t=arguments[0],arguments[1]),this.position.set((this.worldScreenWidth/2-t)*this.scale.x,(this.worldScreenHeight/2-e)*this.scale.y),this._reset(),this}},{key:"moveCorner",value:function(){return 1===arguments.length?this.position.set(-arguments[0].x*this.scale.x,-arguments[0].y*this.scale.y):this.position.set(-arguments[0]*this.scale.x,-arguments[1]*this.scale.y),this._reset(),this}},{key:"fitWidth",value:function(t,e){var r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],i=arguments[3],n=void 0;e&&(n=this.center),t=t||this.worldWidth,this.scale.x=this.screenWidth/t,r&&(this.scale.y=this.scale.x);var o=this.plugins["clamp-zoom"];return!i&&o&&o.clamp(),e&&this.moveCenter(n),this}},{key:"fitHeight",value:function(t,e){var r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],i=arguments[3],n=void 0;e&&(n=this.center),t=t||this.worldHeight,this.scale.y=this.screenHeight/t,r&&(this.scale.x=this.scale.y);var o=this.plugins["clamp-zoom"];return!i&&o&&o.clamp(),e&&this.moveCenter(n),this}},{key:"fitWorld",value:function(t){var e=void 0;t&&(e=this.center),this.scale.x=this.screenWidth/this.worldWidth,this.scale.y=this.screenHeight/this.worldHeight,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;var r=this.plugins["clamp-zoom"];return r&&r.clamp(),t&&this.moveCenter(e),this}},{key:"fit",value:function(t,e,r){var i=void 0;t&&(i=this.center),e=e||this.worldWidth,r=r||this.worldHeight,this.scale.x=this.screenWidth/e,this.scale.y=this.screenHeight/r,this.scale.x<this.scale.y?this.scale.y=this.scale.x:this.scale.x=this.scale.y;var n=this.plugins["clamp-zoom"];return n&&n.clamp(),t&&this.moveCenter(i),this}},{key:"zoomPercent",value:function(t,e){var r=void 0;e&&(r=this.center);var i=this.scale.x+this.scale.x*t;this.scale.set(i);var n=this.plugins["clamp-zoom"];return n&&n.clamp(),e&&this.moveCenter(r),this}},{key:"zoom",value:function(t,e){return this.fitWidth(t+this.worldScreenWidth,e),this}},{key:"snapZoom",value:function(t){return this.plugins["snap-zoom"]=new p(this,t),this.pluginsSort(),this}},{key:"OOB",value:function(){var t={};return t.left=this.left<0,t.right=this.right>this._worldWidth,t.top=this.top<0,t.bottom=this.bottom>this._worldHeight,t.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},t}},{key:"countDownPointers",value:function(){return(this.isMouseDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e){var i=e[r];-1!==this.touches.indexOf(i.pointerId)&&t.push(i)}return t}},{key:"getPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e)t.push(e[r]);return t}},{key:"_reset",value:function(){this.plugins.bounce&&(this.plugins.bounce.reset(),this.plugins.bounce.bounce()),this.plugins.decelerate&&this.plugins.decelerate.reset(),this.plugins.snap&&this.plugins.snap.reset(),this.plugins.clamp&&this.plugins.clamp.update(),this.plugins["clamp-zoom"]&&this.plugins["clamp-zoom"].clamp()}},{key:"userPlugin",value:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:m.length;this.plugins[t]=e;var i=m.indexOf(t);-1!==i&&m.splice(i,1),m.splice(r,0,t),this.pluginsSort()}},{key:"removePlugin",value:function(t){this.plugins[t]&&(this.plugins[t]=null,this.emit(t+"-remove"),this.pluginsSort())}},{key:"pausePlugin",value:function(t){this.plugins[t]&&this.plugins[t].pause()}},{key:"resumePlugin",value:function(t){this.plugins[t]&&this.plugins[t].resume()}},{key:"pluginsSort",value:function(){var t=!0,e=!(this.pluginsList=[]),r=void 0;try{for(var i,n=m[Symbol.iterator]();!(t=(i=n.next()).done);t=!0){var o=i.value;this.plugins[o]&&this.pluginsList.push(this.plugins[o])}}catch(t){e=!0,r=t}finally{try{!t&&n.return&&n.return()}finally{if(e)throw r}}}},{key:"drag",value:function(t){return this.plugins.drag=new a(this,t),this.pluginsSort(),this}},{key:"clamp",value:function(t){return this.plugins.clamp=new h(this,t),this.pluginsSort(),this}},{key:"decelerate",value:function(t){return this.plugins.decelerate=new c(this,t),this.pluginsSort(),this}},{key:"bounce",value:function(t){return this.plugins.bounce=new f(this,t),this.pluginsSort(),this}},{key:"pinch",value:function(t){return this.plugins.pinch=new u(this,t),this.pluginsSort(),this}},{key:"snap",value:function(t,e,r){return this.plugins.snap=new d(this,t,e,r),this.pluginsSort(),this}},{key:"follow",value:function(t,e){return this.plugins.follow=new v(this,t,e),this.pluginsSort(),this}},{key:"wheel",value:function(t){return this.plugins.wheel=new y(this,t),this.pluginsSort(),this}},{key:"clampZoom",value:function(t){return this.plugins["clamp-zoom"]=new l(this,t),this.pluginsSort(),this}},{key:"mouseEdges",value:function(t){return this.plugins["mouse-edges"]=new g(this,t),this.pluginsSort(),this}},{key:"ensureVisible",value:function(t,e,r,i){t<this.left?this.left=t:t+r>this.right&&(this.right=t+r),e<this.top?this.top=e:e+i>this.bottom&&(this.bottom=e+i)}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(t){this._screenWidth=t}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(t){this._screenHeight=t}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(t){this._worldWidth=t,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(t){this._worldHeight=t,this.resizePlugins()}},{key:"worldScreenWidth",get:function(){return this.screenWidth/this.scale.x}},{key:"worldScreenHeight",get:function(){return this.screenHeight/this.scale.y}},{key:"screenWorldWidth",get:function(){return this.worldWidth*this.scale.x}},{key:"screenWorldHeight",get:function(){return this.worldHeight*this.scale.y}},{key:"center",get:function(){return new o.Point(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)},set:function(t){this.moveCenter(t)}},{key:"corner",get:function(){return new o.Point(-this.x/this.scale.x,-this.y/this.scale.y)},set:function(t){this.moveCorner(t)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(t){this.x=-t*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(t){this.x=-t*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(t){this.y=-t*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(t){this.y=-t*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(t){this._dirty=t}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=!1,this.hitArea=new o.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(t){this._pause=t,this.lastViewport=null,this.moving=!1,this.zooming=!1,t&&(this.touches=[],this.isMouseDown=!1)}}]),_);function _(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,_),t=t||{};var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));return e.plugins={},e.pluginsList=[],e._screenWidth=t.screenWidth||window.innerWidth,e._screenHeight=t.screenHeight||window.innerHeight,e._worldWidth=t.worldWidth,e._worldHeight=t.worldHeight,e.hitAreaFullScreen=s.defaults(t.hitAreaFullScreen,!0),e.forceHitArea=t.forceHitArea,e.passiveWheel=s.defaults(t.passiveWheel,!0),e.stopEvent=t.stopPropagation,e.threshold=s.defaults(t.threshold,5),e.interaction=t.interaction||null,e.div=t.divWheel||document.body,e.listeners(e.div),e.div.oncontextmenu=function(t){return t.preventDefault()},e.touches=[],t.noTicker||(e.ticker=t.ticker||(o.Ticker?o.Ticker.shared:o.ticker.shared),e.tickerFunction=function(){return e.update(e.ticker.elapsedMS)},e.ticker.add(e.tickerFunction)),e}void 0!==o&&(o.extras?o.extras.Viewport=b:o.extras={Viewport:b}),e.exports=b},{"./bounce":40,"./clamp":42,"./clamp-zoom":41,"./decelerate":43,"./drag":44,"./follow":45,"./mouse-edges":46,"./pinch":47,"./snap":50,"./snap-zoom":49,"./utils":51,"./wheel":53,"pixi.js":169}],53:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./plugin");function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,t));return e=e||{},r.percent=e.percent||.1,r.center=e.center,r.reverse=e.reverse,r.smooth=e.smooth,r.interrupt=void 0===e.interrupt||e.interrupt,r}e.exports=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,o),i(s,[{key:"down",value:function(){this.interrupt&&(this.smoothing=null)}},{key:"update",value:function(){if(this.smoothing){var t=this.smoothingCenter,e=this.smoothing,r=void 0;this.center||(r=this.parent.toLocal(t)),this.parent.scale.x+=e.x,this.parent.scale.y+=e.y,this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});var i=this.parent.plugins["clamp-zoom"];if(i&&i.clamp(),this.center)this.parent.moveCenter(this.center);else{var n=this.parent.toGlobal(r);this.parent.x+=t.x-n.x,this.parent.y+=t.y-n.y}this.smoothingCount++,this.smoothingCount>=this.smooth&&(this.smoothing=null)}}},{key:"wheel",value:function(t){if(!this.paused){var e=this.parent.getPointerPosition(t),r=(this.reverse?-1:1)*-t.deltaY*(t.deltaMode?120:1)/500,i=Math.pow(2,(1+this.percent)*r);if(this.smooth){var n=this.smoothing?this.smoothing.x*(this.smooth-this.smoothingCount):0,o=this.smoothing?this.smoothing.y*(this.smooth-this.smoothingCount):0;this.smoothing={x:((this.parent.scale.x+n)*i-this.parent.scale.x)/this.smooth,y:((this.parent.scale.y+o)*i-this.parent.scale.y)/this.smooth},this.smoothingCount=0,this.smoothingCenter=e}else{var s=void 0;this.center||(s=this.parent.toLocal(e)),this.parent.scale.x*=i,this.parent.scale.y*=i,this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});var a=this.parent.plugins["clamp-zoom"];if(a&&a.clamp(),this.center)this.parent.moveCenter(this.center);else{var u=this.parent.toGlobal(s);this.parent.x+=e.x-u.x,this.parent.y+=e.y-u.y}}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:t.deltaX,dy:t.deltaY,dz:t.deltaZ},event:t,viewport:this.parent}),this.parent.passiveWheel||t.preventDefault()}}}]),s)},{"./plugin":48}],54:[function(t,e,r){"use strict";r.__esModule=!0;var u=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),i=o(t("ismobilejs")),n=o(t("./accessibleTarget"));function o(t){return t&&t.__esModule?t:{default:t}}u.utils.mixins.delayMixin(u.DisplayObject.prototype,n.default);var s=(a.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2,e.style.backgroundColor="#FF0000",e.title="HOOK DIV",e.addEventListener("focus",function(){t.isMobileAccessabillity=!0,t.activate(),document.body.removeChild(e)}),document.body.appendChild(e)},a.prototype.activate=function(){this.isActive||(this.isActive=!0,window.document.addEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode&&this.renderer.view.parentNode.appendChild(this.div))},a.prototype.deactivate=function(){this.isActive&&!this.isMobileAccessabillity&&(this.isActive=!1,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode&&this.div.parentNode.removeChild(this.div))},a.prototype.updateAccessibleObjects=function(t){if(t.visible){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);for(var e=t.children,r=0;r<e.length;r++)this.updateAccessibleObjects(e[r])}},a.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,r=t.height/this.renderer.height,i=this.div;i.style.left=t.left+"px",i.style.top=t.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var n=0;n<this.children.length;n++){var o=this.children[n];if(o.renderId!==this.renderId)o._accessibleActive=!1,u.utils.removeItems(this.children,n,1),this.div.removeChild(o._accessibleDiv),this.pool.push(o._accessibleDiv),o._accessibleDiv=null,n--,0===this.children.length&&this.deactivate();else{i=o._accessibleDiv;var s=o.hitArea,a=o.worldTransform;o.hitArea?(i.style.left=(a.tx+s.x*a.a)*e+"px",i.style.top=(a.ty+s.y*a.d)*r+"px",i.style.width=s.width*a.a*e+"px",i.style.height=s.height*a.d*r+"px"):(s=o.getBounds(),this.capHitArea(s),i.style.left=s.x*e+"px",i.style.top=s.y*r+"px",i.style.width=s.width*e+"px",i.style.height=s.height*r+"px",i.title!==o.accessibleTitle&&null!==o.accessibleTitle&&(i.title=o.accessibleTitle),i.getAttribute("aria-label")!==o.accessibleHint&&null!==o.accessibleHint&&i.setAttribute("aria-label",o.accessibleHint))}}this.renderId++}},a.prototype.capHitArea=function(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0),t.x+t.width>this.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},a.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",-1<navigator.userAgent.toLowerCase().indexOf("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle&&null!==t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleHint&&null!==t.accessibleHint||(e.title="displayObject "+t.tabIndex),t.accessibleHint&&null!==t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,(t._accessibleDiv=e).displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},a.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},a.prototype._onFocus=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","assertive");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},a.prototype._onFocusOut=function(t){t.target.getAttribute("aria-live","off")||t.target.setAttribute("aria-live","polite");var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},a.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},a.prototype._onMouseMove=function(t){0===t.movementX&&0===t.movementY||this.deactivate()},a.prototype.destroy=function(){this.div=null;for(var t=0;t<this.children.length;t++)this.children[t].div=null;window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null},a);function a(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),!i.default.tablet&&!i.default.phone||navigator.isCocoonJS||this.createTouchHook();var e=document.createElement("div");e.style.width="100px",e.style.height="100px",e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.zIndex=2,this.div=e,this.pool=[],this.renderId=0,this.debug=!1,this.renderer=t,this.children=[],this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this.isActive=!1,this.isMobileAccessabillity=!1,window.addEventListener("keydown",this._onKeyDown,!1)}r.default=s,u.WebGLRenderer.registerPlugin("accessibility",s),u.CanvasRenderer.registerPlugin("accessibility",s)},{"../core":79,"./accessibleTarget":55,ismobilejs:7}],55:[function(t,e,r){"use strict";r.__esModule=!0,r.default={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:!1}},{}],56:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./accessibleTarget");Object.defineProperty(r,"accessibleTarget",{enumerable:!0,get:function(){return o(i).default}});var n=t("./AccessibilityManager");function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"AccessibilityManager",{enumerable:!0,get:function(){return o(n).default}})},{"./AccessibilityManager":54,"./accessibleTarget":55}],57:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("./autoDetectRenderer"),s=l(t("./display/Container")),a=t("./ticker"),u=l(t("./settings")),h=t("./const");function l(t){return t&&t.__esModule?t:{default:t}}var c=(f.prototype.render=function(){this.renderer.render(this.stage)},f.prototype.stop=function(){this._ticker.stop()},f.prototype.start=function(){this._ticker.start()},f.prototype.destroy=function(t,e){if(this._ticker){var r=this._ticker;this.ticker=null,r.destroy()}this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null,this._options=null},i(f,[{key:"ticker",set:function(t){this._ticker&&this._ticker.remove(this.render,this),(this._ticker=t)&&t.add(this.render,this,h.UPDATE_PRIORITY.LOW)},get:function(){return this._ticker}},{key:"view",get:function(){return this.renderer.view}},{key:"screen",get:function(){return this.renderer.screen}}]),f);function f(t,e,r,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),"number"==typeof t&&(t=Object.assign({width:t,height:e||u.default.RENDER_OPTIONS.height,forceCanvas:!!i,sharedTicker:!!n},r)),this._options=t=Object.assign({autoStart:!0,sharedTicker:!1,forceCanvas:!1,sharedLoader:!1},t),this.renderer=(0,o.autoDetectRenderer)(t),this.stage=new s.default,this._ticker=null,this.ticker=t.sharedTicker?a.shared:new a.Ticker,t.autoStart&&this.start()}r.default=c},{"./autoDetectRenderer":59,"./const":60,"./display/Container":62,"./settings":115,"./ticker":135}],58:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("pixi-gl-core"),o=t("./settings"),s=(i=o)&&i.__esModule?i:{default:i};function a(t,e){if(t instanceof Array){if("precision"!==t[0].substring(0,9)){var r=t.slice(0);return r.unshift("precision "+e+" float;"),r}}else if("precision"!==t.trim().substring(0,9))return"precision "+e+" float;\n"+t;return t}var u,h=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,u=n.GLShader),l);function l(t,e,r,i,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,u.call(this,t,a(e,n||s.default.PRECISION_VERTEX),a(r,n||s.default.PRECISION_FRAGMENT),void 0,i))}r.default=h},{"./settings":115,"pixi-gl-core":29}],59:[function(t,e,r){"use strict";r.__esModule=!0,r.autoDetectRenderer=function(t,e,r,i){var n=t&&t.forceCanvas;void 0!==i&&(n=i);return n||!o.isWebGLSupported()?new s.default(t,e,r):new a.default(t,e,r)};var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("./utils")),s=i(t("./renderers/canvas/CanvasRenderer")),a=i(t("./renderers/webgl/WebGLRenderer"));function i(t){return t&&t.__esModule?t:{default:t}}},{"./renderers/canvas/CanvasRenderer":91,"./renderers/webgl/WebGLRenderer":98,"./utils":139}],60:[function(t,e,r){"use strict";r.__esModule=!0;r.VERSION="4.8.7",r.PI_2=2*Math.PI,r.RAD_TO_DEG=180/Math.PI,r.DEG_TO_RAD=Math.PI/180,r.RENDERER_TYPE={UNKNOWN:0,WEBGL:1,CANVAS:2},r.BLEND_MODES={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,NORMAL_NPM:17,ADD_NPM:18,SCREEN_NPM:19},r.DRAW_MODES={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},r.SCALE_MODES={LINEAR:0,NEAREST:1},r.WRAP_MODES={CLAMP:0,REPEAT:1,MIRRORED_REPEAT:2},r.GC_MODES={AUTO:0,MANUAL:1},r.URL_FILE_EXTENSION=/\.(\w{3,4})(?:$|\?|#)/i,r.DATA_URI=/^\s*data:(?:([\w-]+)\/([\w+.-]+))?(?:;charset=([\w-]+))?(?:;(base64))?,(.*)/i,r.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],61:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("../math");var n=(o.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},o.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},o.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)},o.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)},o.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=o<e?o:e,r=s<r?s:r,i=i<o?o:i,n=n<s?s:n,e=(o=t[2])<e?o:e,r=(s=t[3])<r?s:r,i=i<o?o:i,n=n<s?s:n,e=(o=t[4])<e?o:e,r=(s=t[5])<r?s:r,i=i<o?o:i,n=n<s?s:n,e=(o=t[6])<e?o:e,r=(s=t[7])<r?s:r,i=i<o?o:i,n=n<s?s:n,this.minX=e,this.minY=r,this.maxX=i,this.maxY=n},o.prototype.addFrame=function(t,e,r,i,n){var o=t.worldTransform,s=o.a,a=o.b,u=o.c,h=o.d,l=o.tx,c=o.ty,f=this.minX,d=this.minY,p=this.maxX,v=this.maxY,y=s*e+u*r+l,g=a*e+h*r+c;f=y<f?y:f,d=g<d?g:d,p=p<y?y:p,v=v<g?g:v,f=(y=s*i+u*r+l)<f?y:f,d=(g=a*i+h*r+c)<d?g:d,p=p<y?y:p,v=v<g?g:v,f=(y=s*e+u*n+l)<f?y:f,d=(g=a*e+h*n+c)<d?g:d,p=p<y?y:p,v=v<g?g:v,f=(y=s*i+u*n+l)<f?y:f,d=(g=a*i+h*n+c)<d?g:d,p=p<y?y:p,v=v<g?g:v,this.minX=f,this.minY=d,this.maxX=p,this.maxY=v},o.prototype.addVertices=function(t,e,r,i){for(var n=t.worldTransform,o=n.a,s=n.b,a=n.c,u=n.d,h=n.tx,l=n.ty,c=this.minX,f=this.minY,d=this.maxX,p=this.maxY,v=r;v<i;v+=2){var y=e[v],g=e[v+1],m=o*y+a*g+h,b=u*g+s*y+l;c=m<c?m:c,f=b<f?b:f,d=d<m?m:d,p=p<b?b:p}this.minX=c,this.minY=f,this.maxX=d,this.maxY=p},o.prototype.addBounds=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY;this.minX=t.minX<e?t.minX:e,this.minY=t.minY<r?t.minY:r,this.maxX=t.maxX>i?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},o.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxX<e.maxX?t.maxX:e.maxX,o=t.maxY<e.maxY?t.maxY:e.maxY;if(r<=n&&i<=o){var s=this.minX,a=this.minY,u=this.maxX,h=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=u<n?n:u,this.maxY=h<o?o:h}},o.prototype.addBoundsArea=function(t,e){var r=t.minX>e.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxX<e.x+e.width?t.maxX:e.x+e.width,o=t.maxY<e.y+e.height?t.maxY:e.y+e.height;if(r<=n&&i<=o){var s=this.minX,a=this.minY,u=this.maxX,h=this.maxY;this.minX=r<s?r:s,this.minY=i<a?i:a,this.maxX=u<n?n:u,this.maxY=h<o?o:h}},o);function o(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}r.default=n},{"../math":84}],62:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o,s=t("../utils"),a=t("./DisplayObject"),u=(o=a)&&o.__esModule?o:{default:o};var h,l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,h=u.default),c.prototype.onChildrenChange=function(){},c.prototype.addChild=function(t){var e=arguments.length;if(1<e)for(var r=0;r<e;r++)this.addChild(arguments[r]);else t.parent&&t.parent.removeChild(t),t.parent=this,t.transform._parentID=-1,this.children.push(t),this._boundsID++,this.onChildrenChange(this.children.length-1),t.emit("added",this);return t},c.prototype.addChildAt=function(t,e){if(e<0||e>this.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),t},c.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r<i?r:i)}},c.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},c.prototype.setChildIndex=function(t,e){if(e<0||e>=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);(0,s.removeItems)(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},c.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},c.prototype.removeChild=function(t){var e=arguments.length;if(1<e)for(var r=0;r<e;r++)this.removeChild(arguments[r]);else{var i=this.children.indexOf(t);if(-1===i)return null;t.parent=null,t.transform._parentID=-1,(0,s.removeItems)(this.children,i,1),this._boundsID++,this.onChildrenChange(i),t.emit("removed",this)}return t},c.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,e.transform._parentID=-1,(0,s.removeItems)(this.children,t,1),this._boundsID++,this.onChildrenChange(t),e.emit("removed",this),e},c.prototype.removeChildren=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=arguments[1],r=t,i="number"==typeof e?e:this.children.length,n=i-r,o=void 0;if(0<n&&n<=i){o=this.children.splice(r,n);for(var s=0;s<o.length;++s)o[s].parent=null,o[s].transform&&(o[s].transform._parentID=-1);this._boundsID++,this.onChildrenChange(t);for(var a=0;a<o.length;++a)o[a].emit("removed",this);return o}if(0==n&&0===this.children.length)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},c.prototype.updateTransform=function(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(var t=0,e=this.children.length;t<e;++t){var r=this.children[t];r.visible&&r.updateTransform()}},c.prototype.calculateBounds=function(){this._bounds.clear(),this._calculateBounds();for(var t=0;t<this.children.length;t++){var e=this.children[t];e.visible&&e.renderable&&(e.calculateBounds(),e._mask?(e._mask.calculateBounds(),this._bounds.addBoundsMask(e._bounds,e._mask._bounds)):e.filterArea?this._bounds.addBoundsArea(e._bounds,e.filterArea):this._bounds.addBounds(e._bounds))}this._lastBoundsID=this._boundsID},c.prototype._calculateBounds=function(){},c.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable)if(this._mask||this._filters)this.renderAdvancedWebGL(t);else{this._renderWebGL(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].renderWebGL(t)}},c.prototype.renderAdvancedWebGL=function(t){t.flush();var e=this._filters,r=this._mask;if(e){this._enabledFilters||(this._enabledFilters=[]);for(var i=this._enabledFilters.length=0;i<e.length;i++)e[i].enabled&&this._enabledFilters.push(e[i]);this._enabledFilters.length&&t.filterManager.pushFilter(this,this._enabledFilters)}r&&t.maskManager.pushMask(this,this._mask),this._renderWebGL(t);for(var n=0,o=this.children.length;n<o;n++)this.children[n].renderWebGL(t);t.flush(),r&&t.maskManager.popMask(this,this._mask),e&&this._enabledFilters&&this._enabledFilters.length&&t.filterManager.popFilter()},c.prototype._renderWebGL=function(t){},c.prototype._renderCanvas=function(t){},c.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask),this._renderCanvas(t);for(var e=0,r=this.children.length;e<r;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},c.prototype.destroy=function(t){h.prototype.destroy.call(this);var e="boolean"==typeof t?t:t&&t.children,r=this.removeChildren(0,this.children.length);if(e)for(var i=0;i<r.length;++i)r[i].destroy(t)},i(c,[{key:"width",get:function(){return this.scale.x*this.getLocalBounds().width},set:function(t){var e=this.getLocalBounds().width;this.scale.x=0!==e?t/e:1,this._width=t}},{key:"height",get:function(){return this.scale.y*this.getLocalBounds().height},set:function(t){var e=this.getLocalBounds().height;this.scale.y=0!==e?t/e:1,this._height=t}}]),c);function c(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,h.call(this));return t.children=[],t}(r.default=l).prototype.containerUpdateTransform=l.prototype.updateTransform},{"../utils":139,"./DisplayObject":63}],63:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=f(t("eventemitter3")),s=t("../const"),a=f(t("../settings")),u=f(t("./TransformStatic")),h=f(t("./Transform")),l=f(t("./Bounds")),c=t("../math");function f(t){return t&&t.__esModule?t:{default:t}}var d,p=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(v,d=o.default),v.prototype.updateTransform=function(){this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._bounds.updateID++},v.prototype._recursivePostUpdateTransform=function(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)},v.prototype.getBounds=function(t,e){return t||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._boundsID!==this._lastBoundsID&&this.calculateBounds(),e||(this._boundsRect||(this._boundsRect=new c.Rectangle),e=this._boundsRect),this._bounds.getRectangle(e)},v.prototype.getLocalBounds=function(t){var e=this.transform,r=this.parent;this.parent=null,this.transform=this._tempDisplayObjectParent.transform,t||(this._localBoundsRect||(this._localBoundsRect=new c.Rectangle),t=this._localBoundsRect);var i=this.getBounds(!1,t);return this.parent=r,this.transform=e,i},v.prototype.toGlobal=function(t,e){return 2<arguments.length&&void 0!==arguments[2]&&arguments[2]||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(t,e)},v.prototype.toLocal=function(t,e,r,i){return e&&(t=e.toGlobal(t,r,i)),i||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(t,r)},v.prototype.renderWebGL=function(t){},v.prototype.renderCanvas=function(t){},v.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},v.prototype.setTransform=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0,s=6<arguments.length&&void 0!==arguments[6]?arguments[6]:0,a=7<arguments.length&&void 0!==arguments[7]?arguments[7]:0,u=8<arguments.length&&void 0!==arguments[8]?arguments[8]:0;return this.position.x=t,this.position.y=e,this.scale.x=r||1,this.scale.y=i||1,this.rotation=n,this.skew.x=o,this.skew.y=s,this.pivot.x=a,this.pivot.y=u,this},v.prototype.destroy=function(){this.removeAllListeners(),this.parent&&this.parent.removeChild(this),this.transform=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.filterArea=null,this.interactive=!1,this.interactiveChildren=!1,this._destroyed=!0},i(v,[{key:"_tempDisplayObjectParent",get:function(){return null===this.tempDisplayObjectParent&&(this.tempDisplayObjectParent=new v),this.tempDisplayObjectParent}},{key:"x",get:function(){return this.position.x},set:function(t){this.transform.position.x=t}},{key:"y",get:function(){return this.position.y},set:function(t){this.transform.position.y=t}},{key:"worldTransform",get:function(){return this.transform.worldTransform}},{key:"localTransform",get:function(){return this.transform.localTransform}},{key:"position",get:function(){return this.transform.position},set:function(t){this.transform.position.copy(t)}},{key:"scale",get:function(){return this.transform.scale},set:function(t){this.transform.scale.copy(t)}},{key:"pivot",get:function(){return this.transform.pivot},set:function(t){this.transform.pivot.copy(t)}},{key:"skew",get:function(){return this.transform.skew},set:function(t){this.transform.skew.copy(t)}},{key:"rotation",get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t}},{key:"worldVisible",get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},{key:"mask",get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0,this._mask.isMask=!1),this._mask=t,this._mask&&(this._mask.renderable=!1,this._mask.isMask=!0)}},{key:"filters",get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}]),v);function v(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,v);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,d.call(this)),e=a.default.TRANSFORM_MODE===s.TRANSFORM_MODE.STATIC?u.default:h.default;return t.tempDisplayObjectParent=null,t.transform=new e,t.alpha=1,t.visible=!0,t.renderable=!0,t.parent=null,t.worldAlpha=1,t.filterArea=null,t._filters=null,t._enabledFilters=null,t._bounds=new l.default,t._boundsID=0,t._lastBoundsID=-1,t._boundsRect=null,t._localBoundsRect=null,t._mask=null,t._destroyed=!1,t}(r.default=p).prototype.displayObjectUpdateTransform=p.prototype.updateTransform},{"../const":60,"../math":84,"../settings":115,"./Bounds":61,"./Transform":64,"./TransformStatic":66,eventemitter3:204}],64:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o,s=t("../math"),a=t("./TransformBase"),u=(o=a)&&o.__esModule?o:{default:o};var h,l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,h=u.default),c.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)},c.prototype.updateLocalTransform=function(){var t=this.localTransform;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)},c.prototype.updateTransform=function(t){var e=this.localTransform;e.a=this._cx*this.scale.x,e.b=this._sx*this.scale.x,e.c=this._cy*this.scale.y,e.d=this._sy*this.scale.y,e.tx=this.position.x-(this.pivot.x*e.a+this.pivot.y*e.c),e.ty=this.position.y-(this.pivot.x*e.b+this.pivot.y*e.d);var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._worldID++},c.prototype.setFromMatrix=function(t){t.decompose(this)},i(c,[{key:"rotation",get:function(){return this._rotation},set:function(t){this._rotation=t,this.updateSkew()}}]),c);function c(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,h.call(this));return t.position=new s.Point(0,0),t.scale=new s.Point(1,1),t.skew=new s.ObservablePoint(t.updateSkew,t,0,0),t.pivot=new s.Point(0,0),t._rotation=0,t._cx=1,t._sx=0,t._cy=0,t._sy=1,t}r.default=l},{"../math":84,"./TransformBase":65}],65:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("../math");var n=(o.prototype.updateLocalTransform=function(){},o.prototype.updateTransform=function(t){var e=t.worldTransform,r=this.worldTransform,i=this.localTransform;r.a=i.a*e.a+i.b*e.c,r.b=i.a*e.b+i.b*e.d,r.c=i.c*e.a+i.d*e.c,r.d=i.c*e.b+i.d*e.d,r.tx=i.tx*e.a+i.ty*e.c+e.tx,r.ty=i.tx*e.b+i.ty*e.d+e.ty,this._worldID++},o);function o(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),this.worldTransform=new i.Matrix,this.localTransform=new i.Matrix,this._worldID=0,this._parentID=0}(r.default=n).prototype.updateWorldTransform=n.prototype.updateTransform,n.IDENTITY=new n},{"../math":84}],66:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o,s=t("../math"),a=t("./TransformBase"),u=(o=a)&&o.__esModule?o:{default:o};var h,l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,h=u.default),c.prototype.onChange=function(){this._localID++},c.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++},c.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)},c.prototype.updateTransform=function(t){var e=this.localTransform;if(this._localID!==this._currentLocalID&&(e.a=this._cx*this.scale._x,e.b=this._sx*this.scale._x,e.c=this._cy*this.scale._y,e.d=this._sy*this.scale._y,e.tx=this.position._x-(this.pivot._x*e.a+this.pivot._y*e.c),e.ty=this.position._y-(this.pivot._x*e.b+this.pivot._y*e.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==t._worldID){var r=t.worldTransform,i=this.worldTransform;i.a=e.a*r.a+e.b*r.c,i.b=e.a*r.b+e.b*r.d,i.c=e.c*r.a+e.d*r.c,i.d=e.c*r.b+e.d*r.d,i.tx=e.tx*r.a+e.ty*r.c+r.tx,i.ty=e.tx*r.b+e.ty*r.d+r.ty,this._parentID=t._worldID,this._worldID++}},c.prototype.setFromMatrix=function(t){t.decompose(this),this._localID++},i(c,[{key:"rotation",get:function(){return this._rotation},set:function(t){this._rotation!==t&&(this._rotation=t,this.updateSkew())}}]),c);function c(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,h.call(this));return t.position=new s.ObservablePoint(t.onChange,t,0,0),t.scale=new s.ObservablePoint(t.onChange,t,1,1),t.pivot=new s.ObservablePoint(t.onChange,t,0,0),t.skew=new s.ObservablePoint(t.updateSkew,t,0,0),t._rotation=0,t._cx=1,t._sx=0,t._cy=0,t._sy=1,t._localID=0,t._currentLocalID=0,t}r.default=l},{"../math":84,"./TransformBase":65}],67:[function(t,e,r){"use strict";r.__esModule=!0;var i=d(t("../display/Container")),o=d(t("../textures/RenderTexture")),s=d(t("../textures/Texture")),n=d(t("./GraphicsData")),a=d(t("../sprites/Sprite")),u=t("../math"),h=t("../utils"),E=t("../const"),l=d(t("../display/Bounds")),c=d(t("./utils/bezierCurveTo")),f=d(t("../renderers/canvas/CanvasRenderer"));function d(t){return t&&t.__esModule?t:{default:t}}var p,v=void 0,y=new u.Matrix,g=new u.Point,m=new Float32Array(4),b=new Float32Array(4),_=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(T,p=i.default),T.prototype.clone=function(){var t=new T;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.lineAlignment=this.lineAlignment,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e<this.graphicsData.length;++e)t.graphicsData.push(this.graphicsData[e].clone());return t.currentPath=t.graphicsData[t.graphicsData.length-1],t.updateLocalBounds(),t},T.prototype._quadraticCurveLength=function(t,e,r,i,n,o){var s=t-2*r+n,a=e-2*i+o,u=2*r-2*t,h=2*i-2*e,l=4*(s*s+a*a),c=4*(s*u+a*h),f=u*u+h*h,d=2*Math.sqrt(l+c+f),p=Math.sqrt(l),v=2*l*p,y=2*Math.sqrt(f),g=c/p;return(v*d+p*c*(d-y)+(4*f*l-c*c)*Math.log((2*p+g+d)/(g+y)))/(4*v)},T.prototype._bezierCurveLength=function(t,e,r,i,n,o,s,a){for(var u=0,h=0,l=0,c=0,f=0,d=0,p=0,v=0,y=0,g=0,m=0,b=t,_=e,x=1;x<=10;++x)g=b-(v=(p=(d=(f=1-(h=x/10))*f)*f)*t+3*d*h*r+3*f*(l=h*h)*n+(c=l*h)*s),m=_-(y=p*e+3*d*h*i+3*f*l*o+c*a),b=v,_=y,u+=Math.sqrt(g*g+m*m);return u},T.prototype._segmentsCount=function(t){var e=Math.ceil(t/T.CURVES.maxLength);return e<T.CURVES.minSegments?e=T.CURVES.minSegments:e>T.CURVES.maxSegments&&(e=T.CURVES.maxSegments),e},T.prototype.lineStyle=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:.5;if(this.lineWidth=t,this.lineColor=e,this.lineAlpha=r,this.lineAlignment=i,this.currentPath)if(this.currentPath.shape.points.length){var n=new u.Polygon(this.currentPath.shape.points.slice(-2));n.closed=!1,this.drawShape(n)}else this.currentPath.lineWidth=this.lineWidth,this.currentPath.lineColor=this.lineColor,this.currentPath.lineAlpha=this.lineAlpha,this.currentPath.lineAlignment=this.lineAlignment;return this},T.prototype.moveTo=function(t,e){var r=new u.Polygon([t,e]);return r.closed=!1,this.drawShape(r),this},T.prototype.lineTo=function(t,e){var r=this.currentPath.shape.points,i=r[r.length-2],n=r[r.length-1];return i===t&&n===e||(r.push(t,e),this.dirty++),this},T.prototype.quadraticCurveTo=function(t,e,r,i){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var n=this.currentPath.shape.points,o=0,s=0;0===n.length&&this.moveTo(0,0);for(var a=n[n.length-2],u=n[n.length-1],h=T.CURVES.adaptive?this._segmentsCount(this._quadraticCurveLength(a,u,t,e,r,i)):20,l=1;l<=h;++l){var c=l/h;o=a+(t-a)*c,s=u+(e-u)*c,n.push(o+(t+(r-t)*c-o)*c,s+(e+(i-e)*c-s)*c)}return this.dirty++,this},T.prototype.bezierCurveTo=function(t,e,r,i,n,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var s=this.currentPath.shape.points,a=s[s.length-2],u=s[s.length-1];s.length-=2;var h=T.CURVES.adaptive?this._segmentsCount(this._bezierCurveLength(a,u,t,e,r,i,n,o)):20;return(0,c.default)(a,u,t,e,r,i,n,o,h,s),this.dirty++,this},T.prototype.arcTo=function(t,e,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1]-e,u=s-t,h=i-e,l=r-t,c=Math.abs(a*l-u*h);if(c<1e-8||0===n)o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e);else{var f=a*a+u*u,d=h*h+l*l,p=a*h+u*l,v=n*Math.sqrt(f)/c,y=n*Math.sqrt(d)/c,g=v*p/f,m=y*p/d,b=v*l+y*u,_=v*h+y*a,x=u*(y+g),w=a*(y+g),T=l*(v+m),E=h*(v+m),O=Math.atan2(w-_,x-b),S=Math.atan2(E-_,T-b);this.arc(b+t,_+e,n,O,S,l*a<u*h)}return this.dirty++,this},T.prototype.arc=function(t,e,r,i,n){var o=5<arguments.length&&void 0!==arguments[5]&&arguments[5];if(i===n)return this;!o&&n<=i?n+=E.PI_2:o&&i<=n&&(i+=E.PI_2);var s=n-i,a=T.CURVES.adaptive?this._segmentsCount(Math.abs(s)*r):40*Math.ceil(Math.abs(s)/E.PI_2);if(0==s)return this;var u=t+Math.cos(i)*r,h=e+Math.sin(i)*r,l=this.currentPath?this.currentPath.shape.points:null;if(l){var c=Math.abs(l[l.length-2]-u),f=Math.abs(l[l.length-1]-h);c<.001&&f<.001||l.push(u,h)}else this.moveTo(u,h),l=this.currentPath.shape.points;for(var d=s/(2*a),p=2*d,v=Math.cos(d),y=Math.sin(d),g=a-1,m=g%1/g,b=0;b<=g;++b){var _=d+i+p*(b+m*b),x=Math.cos(_),w=-Math.sin(_);l.push((v*x+y*w)*r+t,(v*-w+y*x)*r+e)}return this.dirty++,this},T.prototype.beginFill=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;return this.filling=!0,this.fillColor=t,this.fillAlpha=e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},T.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},T.prototype.drawRect=function(t,e,r,i){return this.drawShape(new u.Rectangle(t,e,r,i)),this},T.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new u.RoundedRectangle(t,e,r,i,n)),this},T.prototype.drawCircle=function(t,e,r){return this.drawShape(new u.Circle(t,e,r)),this},T.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new u.Ellipse(t,e,r,i)),this},T.prototype.drawPolygon=function(t){var e=t,r=!0;if(e instanceof u.Polygon&&(r=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var i=0;i<e.length;++i)e[i]=arguments[i]}var n=new u.Polygon(e);return n.closed=r,this.drawShape(n),this},T.prototype.drawStar=function(t,e,r,i,n){var o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;n=n||i/2;for(var s=-1*Math.PI/2+o,a=2*r,u=E.PI_2/a,h=[],l=0;l<a;l++){var c=l%2?n:i,f=l*u+s;h.push(t+c*Math.cos(f),e+c*Math.sin(f))}return this.drawPolygon(h)},T.prototype.clear=function(){return(this.lineWidth||this.filling||0<this.graphicsData.length)&&(this.lineWidth=0,this.lineAlignment=.5,this.filling=!1,this.boundsDirty=-1,this.canvasTintDirty=-1,this.dirty++,this.clearDirty++,this.graphicsData.length=0),this.currentPath=null,this._spriteRect=null,this},T.prototype.isFastRect=function(){return 1===this.graphicsData.length&&this.graphicsData[0].shape.type===E.SHAPES.RECT&&!this.graphicsData[0].lineWidth},T.prototype._renderWebGL=function(t){this.dirty!==this.fastRectDirty&&(this.fastRectDirty=this.dirty,this._fastRect=this.isFastRect()),this._fastRect?this._renderSpriteRect(t):(t.setObjectRenderer(t.plugins.graphics),t.plugins.graphics.render(this))},T.prototype._renderSpriteRect=function(t){var e=this.graphicsData[0].shape;this._spriteRect||(this._spriteRect=new a.default(new s.default(s.default.WHITE)));var r=this._spriteRect,i=this.graphicsData[0].fillColor;if(16777215===this.tint)r.tint=i;else if(this.tint!==this._prevRectTint||i!==this._prevRectFillColor){var n=m,o=b;(0,h.hex2rgb)(i,n),(0,h.hex2rgb)(this.tint,o),n[0]*=o[0],n[1]*=o[1],n[2]*=o[2],r.tint=(0,h.rgb2hex)(n),this._prevRectTint=this.tint,this._prevRectFillColor=i}r.alpha=this.graphicsData[0].fillAlpha,r.worldAlpha=this.worldAlpha*r.alpha,r.blendMode=this.blendMode,r._texture._frame.width=e.width,r._texture._frame.height=e.height,r.transform.worldTransform=this.transform.worldTransform,r.anchor.set(-e.x/e.width,-e.y/e.height),r._onAnchorUpdate(),r._renderWebGL(t)},T.prototype._renderCanvas=function(t){!0!==this.isMask&&t.plugins.graphics.render(this)},T.prototype._calculateBounds=function(){this.boundsDirty!==this.dirty&&(this.boundsDirty=this.dirty,this.updateLocalBounds(),this.cachedSpriteDirty=!0);var t=this._localBounds;this._bounds.addFrame(this.transform,t.minX,t.minY,t.maxX,t.maxY)},T.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,g);for(var e=this.graphicsData,r=0;r<e.length;++r){var i=e[r];if(i.fill&&i.shape&&i.shape.contains(g.x,g.y)){if(i.holes)for(var n=0;n<i.holes.length;n++)if(i.holes[n].contains(g.x,g.y))return!1;return!0}}return!1},T.prototype.updateLocalBounds=function(){var t=1/0,e=-1/0,r=1/0,i=-1/0;if(this.graphicsData.length)for(var n=0,o=0,s=0,a=0,u=0,h=0;h<this.graphicsData.length;h++){var l=this.graphicsData[h],c=l.type,f=l.lineWidth*l.lineAlignment;if(n=l.shape,c===E.SHAPES.RECT||c===E.SHAPES.RREC)o=n.x-f,s=n.y-f,t=o<t?o:t,e=e<o+(a=n.width+2*f)?o+a:e,r=s<r?s:r,i=i<s+(u=n.height+2*f)?s+u:i;else if(c===E.SHAPES.CIRC)o=n.x,s=n.y,t=o-(a=n.radius+f)<t?o-a:t,e=e<o+a?o+a:e,r=s-(u=n.radius+f)<r?s-u:r,i=i<s+u?s+u:i;else if(c===E.SHAPES.ELIP)o=n.x,s=n.y,t=o-(a=n.width+f)<t?o-a:t,e=e<o+a?o+a:e,r=s-(u=n.height+f)<r?s-u:r,i=i<s+u?s+u:i;else for(var d=n.points,p=0,v=0,y=0,g=0,m=0,b=0,_=0,x=0,w=0;w+2<d.length;w+=2)o=d[w],s=d[w+1],p=d[w+2],v=d[w+3],y=Math.abs(p-o),g=Math.abs(v-s),u=2*f,(a=Math.sqrt(y*y+g*g))<1e-9||(t=(_=(p+o)/2)-(m=(u/a*g+y)/2)<t?_-m:t,e=e<_+m?_+m:e,r=(x=(v+s)/2)-(b=(u/a*y+g)/2)<r?x-b:r,i=i<x+b?x+b:i)}else i=r=e=t=0;var T=this.boundsPadding;this._localBounds.minX=t-T,this._localBounds.maxX=e+T,this._localBounds.minY=r-T,this._localBounds.maxY=i+T},T.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new n.default(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,this.nativeLines,t,this.lineAlignment);return this.graphicsData.push(e),e.type===E.SHAPES.POLY&&(e.shape.closed=e.shape.closed,this.currentPath=e),this.dirty++,e},T.prototype.generateCanvasTexture=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,r=this.getLocalBounds(),i=o.default.create(r.width,r.height,t,e);v||(v=new f.default),this.transform.updateLocalTransform(),this.transform.localTransform.copy(y),y.invert(),y.tx-=r.x,y.ty-=r.y,v.render(this,i,!0,y);var n=s.default.fromCanvas(i.baseTexture._canvasRenderTarget.canvas,t,"graphics");return n.baseTexture.resolution=e,n.baseTexture.update(),n},T.prototype.closePath=function(){var t=this.currentPath;return t&&t.shape&&t.shape.close(),this},T.prototype.addHole=function(){var t=this.graphicsData.pop();return this.currentPath=this.graphicsData[this.graphicsData.length-1],this.currentPath.addHole(t.shape),this.currentPath=null,this},T.prototype.destroy=function(t){p.prototype.destroy.call(this,t);for(var e=0;e<this.graphicsData.length;++e)this.graphicsData[e].destroy();for(var r in this._webGL)for(var i=0;i<this._webGL[r].data.length;++i)this._webGL[r].data[i].destroy();this._spriteRect&&this._spriteRect.destroy(),this.graphicsData=null,this.currentPath=null,this._webGL=null,this._localBounds=null},T);function T(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,T);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,p.call(this));return e.fillAlpha=1,e.lineWidth=0,e.nativeLines=t,e.lineColor=0,e.lineAlignment=.5,e.graphicsData=[],e.tint=16777215,e._prevTint=16777215,e.blendMode=E.BLEND_MODES.NORMAL,e.currentPath=null,e._webGL={},e.isMask=!1,e.boundsPadding=0,e._localBounds=new l.default,e.dirty=0,e.fastRectDirty=-1,e.clearDirty=0,e.boundsDirty=-1,e.cachedSpriteDirty=!1,e._spriteRect=null,e._fastRect=!1,e._prevRectTint=null,e._prevRectFillColor=null,e}(r.default=_)._SPRITE_TEXTURE=null,_.CURVES={adaptive:!1,maxLength:10,minSegments:8,maxSegments:2048}},{"../const":60,"../display/Bounds":61,"../display/Container":62,"../math":84,"../renderers/canvas/CanvasRenderer":91,"../sprites/Sprite":116,"../textures/RenderTexture":127,"../textures/Texture":129,"../utils":139,"./GraphicsData":68,"./utils/bezierCurveTo":70}],68:[function(t,e,r){"use strict";r.__esModule=!0;var i=(h.prototype.clone=function(){return new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.fill,this.nativeLines,this.shape,this.lineAlignment)},h.prototype.addHole=function(t){this.holes.push(t)},h.prototype.destroy=function(){this.shape=null,this.holes=null},h);function h(t,e,r,i,n,o,s,a,u){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),this.lineWidth=t,this.lineAlignment=u,this.nativeLines=s,this.lineColor=e,this.lineAlpha=r,this._lineTint=e,this.fillColor=i,this.fillAlpha=n,this._fillTint=i,this.fill=o,this.holes=[],this.shape=a,this.type=a.type}r.default=i},{}],69:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("../../renderers/canvas/CanvasRenderer"),o=(i=n)&&i.__esModule?i:{default:i},N=t("../../const");var s=(a.prototype.render=function(t){var e=this.renderer,r=e.context,i=t.worldAlpha,n=t.transform.worldTransform,o=e.resolution;r.setTransform(n.a*o,n.b*o,n.c*o,n.d*o,n.tx*o,n.ty*o),t.canvasTintDirty===t.dirty&&t._prevTint===t.tint||this.updateGraphicsTint(t),e.setBlendMode(t.blendMode);for(var s=0;s<t.graphicsData.length;s++){var a=t.graphicsData[s],u=a.shape,h=a._fillTint,l=a._lineTint;if(r.lineWidth=a.lineWidth,a.type===N.SHAPES.POLY){r.beginPath();var c=u.points,f=a.holes,d=void 0,p=void 0;r.moveTo(c[0],c[1]);for(var v=2;v<c.length;v+=2)r.lineTo(c[v],c[v+1]);if(u.closed&&r.closePath(),0<f.length){for(var y=d=0;y<c.length;y+=2)d+=c[y]*c[y+3]-c[y+1]*c[y+2];for(var g=0;g<f.length;g++){c=f[g].points;for(var m=p=0;m<c.length;m+=2)p+=c[m]*c[m+3]-c[m+1]*c[m+2];if(r.moveTo(c[0],c[1]),p*d<0)for(var b=2;b<c.length;b+=2)r.lineTo(c[b],c[b+1]);else for(var _=c.length-2;2<=_;_-=2)r.lineTo(c[_],c[_+1]);f[g].closed&&r.closePath()}}a.fill&&(r.globalAlpha=a.fillAlpha*i,r.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),r.fill()),a.lineWidth&&(r.globalAlpha=a.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.stroke())}else if(a.type===N.SHAPES.RECT)!a.fillColor&&0!==a.fillColor||(r.globalAlpha=a.fillAlpha*i,r.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),r.fillRect(u.x,u.y,u.width,u.height)),a.lineWidth&&(r.globalAlpha=a.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.strokeRect(u.x,u.y,u.width,u.height));else if(a.type===N.SHAPES.CIRC)r.beginPath(),r.arc(u.x,u.y,u.radius,0,2*Math.PI),r.closePath(),a.fill&&(r.globalAlpha=a.fillAlpha*i,r.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),r.fill()),a.lineWidth&&(r.globalAlpha=a.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.stroke());else if(a.type===N.SHAPES.ELIP){var x=2*u.width,w=2*u.height,T=u.x-x/2,E=u.y-w/2;r.beginPath();var O=x/2*.5522848,S=w/2*.5522848,M=T+x,P=E+w,C=T+x/2,A=E+w/2;r.moveTo(T,A),r.bezierCurveTo(T,A-S,C-O,E,C,E),r.bezierCurveTo(C+O,E,M,A-S,M,A),r.bezierCurveTo(M,A+S,C+O,P,C,P),r.bezierCurveTo(C-O,P,T,A+S,T,A),r.closePath(),a.fill&&(r.globalAlpha=a.fillAlpha*i,r.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),r.fill()),a.lineWidth&&(r.globalAlpha=a.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.stroke())}else if(a.type===N.SHAPES.RREC){var R=u.x,I=u.y,D=u.width,k=u.height,L=u.radius,j=Math.min(D,k)/2|0;L=j<L?j:L,r.beginPath(),r.moveTo(R,I+L),r.lineTo(R,I+k-L),r.quadraticCurveTo(R,I+k,R+L,I+k),r.lineTo(R+D-L,I+k),r.quadraticCurveTo(R+D,I+k,R+D,I+k-L),r.lineTo(R+D,I+L),r.quadraticCurveTo(R+D,I,R+D-L,I),r.lineTo(R+L,I),r.quadraticCurveTo(R,I,R,I+L),r.closePath(),!a.fillColor&&0!==a.fillColor||(r.globalAlpha=a.fillAlpha*i,r.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),r.fill()),a.lineWidth&&(r.globalAlpha=a.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.stroke())}}},a.prototype.updateGraphicsTint=function(t){t._prevTint=t.tint,t.canvasTintDirty=t.dirty;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n<t.graphicsData.length;++n){var o=t.graphicsData[n],s=0|o.fillColor,a=0|o.lineColor;o._fillTint=((s>>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},a.prototype.renderPolygon=function(t,e,r){r.moveTo(t[0],t[1]);for(var i=1;i<t.length/2;++i)r.lineTo(t[2*i],t[2*i+1]);e&&r.closePath()},a.prototype.destroy=function(){this.renderer=null},a);function a(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.renderer=t}r.default=s,o.default.registerPlugin("graphics",s)},{"../../const":60,"../../renderers/canvas/CanvasRenderer":91}],70:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e,r,i,n,o,s,a,u){var h=9<arguments.length&&void 0!==arguments[9]?arguments[9]:[],l=0,c=0,f=0,d=0,p=0;h.push(t,e);for(var v=1,y=0;v<=u;++v)f=(c=(l=1-(y=v/u))*l)*l,p=(d=y*y)*y,h.push(f*t+3*c*y*r+3*l*d*n+p*s,f*e+3*c*y*i+3*l*d*o+p*a);return h}},{}],71:[function(t,e,r){"use strict";r.__esModule=!0;var h=t("../../utils"),l=t("../../const"),i=a(t("../../renderers/webgl/utils/ObjectRenderer")),n=a(t("../../renderers/webgl/WebGLRenderer")),o=a(t("./WebGLGraphicsData")),s=a(t("./shaders/PrimitiveShader")),c=a(t("./utils/buildPoly")),f=a(t("./utils/buildRectangle")),d=a(t("./utils/buildRoundedRectangle")),p=a(t("./utils/buildCircle"));function a(t){return t&&t.__esModule?t:{default:t}}var u,v=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(y,u=i.default),y.prototype.onContextChange=function(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.primitiveShader=new s.default(this.gl)},y.prototype.destroy=function(){i.default.prototype.destroy.call(this);for(var t=0;t<this.graphicsDataPool.length;++t)this.graphicsDataPool[t].destroy();this.graphicsDataPool=null},y.prototype.render=function(t){var e=this.renderer,r=e.gl,i=void 0,n=t._webGL[this.CONTEXT_UID];n&&t.dirty===n.dirty||(this.updateGraphics(t),n=t._webGL[this.CONTEXT_UID]);var o=this.primitiveShader;e.bindShader(o),e.state.setBlendMode(t.blendMode);for(var s=0,a=n.data.length;s<a;s++){var u=(i=n.data[s]).shader;e.bindShader(u),u.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),u.uniforms.tint=(0,h.hex2rgb)(t.tint),u.uniforms.alpha=t.worldAlpha,e.bindVao(i.vao),i.nativeLines?r.drawArrays(r.LINES,0,i.points.length/6):i.vao.draw(r.TRIANGLE_STRIP,i.indices.length)}},y.prototype.updateGraphics=function(t){var e=this.renderer.gl,r=t._webGL[this.CONTEXT_UID];if(r||(r=t._webGL[this.CONTEXT_UID]={lastIndex:0,data:[],gl:e,clearDirty:-1,dirty:-1}),r.dirty=t.dirty,t.clearDirty!==r.clearDirty){r.clearDirty=t.clearDirty;for(var i=0;i<r.data.length;i++)this.graphicsDataPool.push(r.data[i]);r.data.length=0,r.lastIndex=0}for(var n=void 0,o=void 0,s=r.lastIndex;s<t.graphicsData.length;s++){var a=t.graphicsData[s];n=this.getWebGLData(r,0),a.nativeLines&&a.lineWidth&&(o=this.getWebGLData(r,0,!0),r.lastIndex++),a.type===l.SHAPES.POLY&&(0,c.default)(a,n,o),a.type===l.SHAPES.RECT?(0,f.default)(a,n,o):a.type===l.SHAPES.CIRC||a.type===l.SHAPES.ELIP?(0,p.default)(a,n,o):a.type===l.SHAPES.RREC&&(0,d.default)(a,n,o),r.lastIndex++}this.renderer.bindVao(null);for(var u=0;u<r.data.length;u++)(n=r.data[u]).dirty&&n.upload()},y.prototype.getWebGLData=function(t,e,r){var i=t.data[t.data.length-1];return(!i||i.nativeLines!==r||32e4<i.points.length)&&((i=this.graphicsDataPool.pop()||new o.default(this.renderer.gl,this.primitiveShader,this.renderer.state.attribsState)).nativeLines=r,i.reset(e),t.data.push(i)),i.dirty=!0,i},y);function y(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,y);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,u.call(this,t));return e.graphicsDataPool=[],e.primitiveShader=null,e.gl=t.gl,e.CONTEXT_UID=0,e}r.default=v,n.default.registerPlugin("graphics",v)},{"../../const":60,"../../renderers/webgl/WebGLRenderer":98,"../../renderers/webgl/utils/ObjectRenderer":108,"../../utils":139,"./WebGLGraphicsData":72,"./shaders/PrimitiveShader":73,"./utils/buildCircle":74,"./utils/buildPoly":76,"./utils/buildRectangle":77,"./utils/buildRoundedRectangle":78}],72:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("pixi-gl-core"),o=(i=n)&&i.__esModule?i:{default:i};var s=(a.prototype.reset=function(){this.points.length=0,this.indices.length=0},a.prototype.upload=function(){this.glPoints=new Float32Array(this.points),this.buffer.upload(this.glPoints),this.glIndices=new Uint16Array(this.indices),this.indexBuffer.upload(this.glIndices),this.dirty=!1},a.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.vao.destroy(),this.buffer.destroy(),this.indexBuffer.destroy(),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null},a);function a(t,e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=o.default.GLBuffer.createVertexBuffer(t),this.indexBuffer=o.default.GLBuffer.createIndexBuffer(t),this.dirty=!0,this.nativeLines=!1,this.glPoints=null,this.glIndices=null,this.shader=e,this.vao=new o.default.VertexArrayObject(t,r).addIndex(this.indexBuffer).addAttribute(this.buffer,e.attributes.aVertexPosition,t.FLOAT,!1,24,0).addAttribute(this.buffer,e.attributes.aColor,t.FLOAT,!1,24,8)}r.default=s},{"pixi-gl-core":29}],73:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("../../../Shader"),o=(i=n)&&i.__esModule?i:{default:i};var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.default),u);function u(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,t,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"].join("\n"),["varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n")))}r.default=a},{"../../../Shader":58}],74:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e,r){var i=t.shape,n=i.x,o=i.y,s=void 0,a=void 0;a=t.type===w.SHAPES.CIRC?(s=i.radius,i.radius):(s=i.width,i.height);if(0===s||0===a)return;var u=Math.floor(30*Math.sqrt(i.radius))||Math.floor(15*Math.sqrt(i.width+i.height)),h=2*Math.PI/u;if(t.fill){var l=(0,T.hex2rgb)(t.fillColor),c=t.fillAlpha,f=l[0]*c,d=l[1]*c,p=l[2]*c,v=e.points,y=e.indices,g=v.length/6;y.push(g);for(var m=0;m<u+1;m++)v.push(n,o,f,d,p,c),v.push(n+Math.sin(h*m)*s,o+Math.cos(h*m)*a,f,d,p,c),y.push(g++,g++);y.push(g-1)}if(t.lineWidth){var b=t.points;t.points=[];for(var _=0;_<u;_++)t.points.push(n+Math.sin(h*-_)*s,o+Math.cos(h*-_)*a);t.points.push(t.points[0],t.points[1]),(0,x.default)(t,e,r),t.points=b}};var i,n=t("./buildLine"),x=(i=n)&&i.__esModule?i:{default:i},w=t("../../../const"),T=t("../../../utils")},{"../../../const":60,"../../../utils":139,"./buildLine":75}],75:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e,r){t.nativeLines?function(t,e){var r=0,i=t.points;if(0===i.length)return;var n=e.points,o=i.length/2,s=(0,Y.hex2rgb)(t.lineColor),a=t.lineAlpha,u=s[0]*a,h=s[1]*a,l=s[2]*a;for(r=1;r<o;r++){var c=i[2*(r-1)],f=i[2*(r-1)+1],d=i[2*r],p=i[2*r+1];n.push(c,f),n.push(u,h,l,a),n.push(d,p),n.push(u,h,l,a)}}(t,r):function(t,e){var r=t.points;if(0===r.length)return;var i=new z.Point(r[0],r[1]),n=new z.Point(r[r.length-2],r[r.length-1]);if(i.x===n.x&&i.y===n.y){(r=r.slice()).pop(),r.pop();var o=(n=new z.Point(r[r.length-2],r[r.length-1])).x+.5*(i.x-n.x),s=n.y+.5*(i.y-n.y);r.unshift(o,s),r.push(o,s)}var a=e.points,u=e.indices,h=r.length/2,l=r.length,c=a.length/6,f=t.lineWidth/2,d=(0,Y.hex2rgb)(t.lineColor),p=t.lineAlpha,v=d[0]*p,y=d[1]*p,g=d[2]*p,m=r[0],b=r[1],_=r[2],x=r[3],w=0,T=0,E=-(b-x),O=m-_,S=0,M=0,P=0,C=0,A=Math.sqrt(E*E+O*O);E/=A,O/=A,E*=f,O*=f;var R=t.lineAlignment,I=2*(1-R),D=2*R;a.push(m-E*I,b-O*I,v,y,g,p),a.push(m+E*D,b+O*D,v,y,g,p);for(var k=1;k<h-1;++k){m=r[2*(k-1)],b=r[2*(k-1)+1],_=r[2*k],x=r[2*k+1],w=r[2*(k+1)],T=r[2*(k+1)+1],E=-(b-x),O=m-_,A=Math.sqrt(E*E+O*O),E/=A,O/=A,E*=f,O*=f,S=-(x-T),M=_-w,A=Math.sqrt(S*S+M*M),S/=A,M/=A;var L=-O+b-(-O+x),j=-E+_-(-E+m),N=(-E+m)*(-O+x)-(-E+_)*(-O+b),B=-(M*=f)+T-(-M+x),F=-(S*=f)+_-(-S+w),U=(-S+w)*(-M+x)-(-S+_)*(-M+T),W=L*F-B*j;if(Math.abs(W)<.1)W+=10.1,a.push(_-E*I,x-O*I,v,y,g,p),a.push(_+E*D,x+O*D,v,y,g,p);else{var H=(j*U-F*N)/W,X=(B*N-L*U)/W;196*f*f<(H-_)*(H-_)+(X-x)*(X-x)?(P=E-S,C=O-M,A=Math.sqrt(P*P+C*C),P/=A,C/=A,P*=f,C*=f,a.push(_-P*I,x-C*I),a.push(v,y,g,p),a.push(_+P*D,x+C*D),a.push(v,y,g,p),a.push(_-P*D*I,x-C*I),a.push(v,y,g,p),l++):(a.push(_+(H-_)*I,x+(X-x)*I),a.push(v,y,g,p),a.push(_-(H-_)*D,x-(X-x)*D),a.push(v,y,g,p))}}m=r[2*(h-2)],b=r[2*(h-2)+1],_=r[2*(h-1)],x=r[2*(h-1)+1],E=-(b-x),O=m-_,A=Math.sqrt(E*E+O*O),E/=A,O/=A,E*=f,O*=f,a.push(_-E*I,x-O*I),a.push(v,y,g,p),a.push(_+E*D,x+O*D),a.push(v,y,g,p),u.push(c);for(var G=0;G<l;++G)u.push(c++);u.push(c-1)}(t,e)};var z=t("../../../math"),Y=t("../../../utils")},{"../../../math":84,"../../../utils":139}],76:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e,r){t.points=t.shape.points.slice();var i=t.points;if(t.fill&&6<=i.length){for(var n=[],o=t.holes,s=0;s<o.length;s++){var a=o[s];n.push(i.length/2),i=i.concat(a.points)}var u=e.points,h=e.indices,l=i.length/2,c=(0,x.hex2rgb)(t.fillColor),f=t.fillAlpha,d=c[0]*f,p=c[1]*f,v=c[2]*f,y=(0,w.default)(i,n,2);if(!y)return;for(var g=u.length/6,m=0;m<y.length;m+=3)h.push(y[m]+g),h.push(y[m]+g),h.push(y[m+1]+g),h.push(y[m+2]+g),h.push(y[m+2]+g);for(var b=0;b<l;b++)u.push(i[2*b],i[2*b+1],d,p,v,f)}0<t.lineWidth&&(0,_.default)(t,e,r)};var _=i(t("./buildLine")),x=t("../../../utils"),w=i(t("earcut"));function i(t){return t&&t.__esModule?t:{default:t}}},{"../../../utils":139,"./buildLine":75,earcut:5}],77:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e,r){var i=t.shape,n=i.x,o=i.y,s=i.width,a=i.height;if(t.fill){var u=(0,m.hex2rgb)(t.fillColor),h=t.fillAlpha,l=u[0]*h,c=u[1]*h,f=u[2]*h,d=e.points,p=e.indices,v=d.length/6;d.push(n,o),d.push(l,c,f,h),d.push(n+s,o),d.push(l,c,f,h),d.push(n,o+a),d.push(l,c,f,h),d.push(n+s,o+a),d.push(l,c,f,h),p.push(v,v,1+v,2+v,3+v,3+v)}if(t.lineWidth){var y=t.points;t.points=[n,o,n+s,o,n+s,o+a,n,o+a,n,o],(0,g.default)(t,e,r),t.points=y}};var i,n=t("./buildLine"),g=(i=n)&&i.__esModule?i:{default:i},m=t("../../../utils")},{"../../../utils":139,"./buildLine":75}],78:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e,r){var i=t.shape,n=i.x,o=i.y,s=i.width,a=i.height,u=i.radius,h=[];if(h.push(n+u,o),M(n+s-u,o,n+s,o,n+s,o+u,h),M(n+s,o+a-u,n+s,o+a,n+s-u,o+a,h),M(n+u,o+a,n,o+a,n,o+a-u,h),M(n,o+u,n,o,n+u+1e-10,o,h),t.fill){for(var l=(0,S.hex2rgb)(t.fillColor),c=t.fillAlpha,f=l[0]*c,d=l[1]*c,p=l[2]*c,v=e.points,y=e.indices,g=v.length/6,m=(0,E.default)(h,null,2),b=0,_=m.length;b<_;b+=3)y.push(m[b]+g),y.push(m[b]+g),y.push(m[b+1]+g),y.push(m[b+2]+g),y.push(m[b+2]+g);for(var x=0,w=h.length;x<w;x++)v.push(h[x],h[++x],f,d,p,c)}if(t.lineWidth){var T=t.points;t.points=h,(0,O.default)(t,e,r),t.points=T}};var E=i(t("earcut")),O=i(t("./buildLine")),S=t("../../../utils");function i(t){return t&&t.__esModule?t:{default:t}}function v(t,e,r){return t+(e-t)*r}function M(t,e,r,i,n,o){for(var s=6<arguments.length&&void 0!==arguments[6]?arguments[6]:[],a=0,u=0,h=0,l=0,c=0,f=0,d=0,p=0;d<=20;++d)a=v(t,r,p=d/20),u=v(e,i,p),h=v(r,n,p),l=v(i,o,p),c=v(a,h,p),f=v(u,l,p),s.push(c,f);return s}},{"../../../utils":139,"./buildLine":75,earcut:5}],79:[function(t,e,r){"use strict";r.__esModule=!0,r.autoDetectRenderer=r.Application=r.Filter=r.SpriteMaskFilter=r.Quad=r.RenderTarget=r.ObjectRenderer=r.WebGLManager=r.Shader=r.CanvasRenderTarget=r.TextureUvs=r.VideoBaseTexture=r.BaseRenderTexture=r.RenderTexture=r.BaseTexture=r.TextureMatrix=r.Texture=r.Spritesheet=r.CanvasGraphicsRenderer=r.GraphicsRenderer=r.GraphicsData=r.Graphics=r.TextMetrics=r.TextStyle=r.Text=r.SpriteRenderer=r.CanvasTinter=r.CanvasSpriteRenderer=r.Sprite=r.TransformBase=r.TransformStatic=r.Transform=r.Container=r.DisplayObject=r.Bounds=r.glCore=r.WebGLRenderer=r.CanvasRenderer=r.ticker=r.utils=r.settings=void 0;var i=t("./const");Object.keys(i).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(r,t,{enumerable:!0,get:function(){return i[t]}})});var n=t("./math");Object.keys(n).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(r,t,{enumerable:!0,get:function(){return n[t]}})});var o=t("pixi-gl-core");Object.defineProperty(r,"glCore",{enumerable:!0,get:function(){return V(o).default}});var s=t("./display/Bounds");Object.defineProperty(r,"Bounds",{enumerable:!0,get:function(){return V(s).default}});var a=t("./display/DisplayObject");Object.defineProperty(r,"DisplayObject",{enumerable:!0,get:function(){return V(a).default}});var u=t("./display/Container");Object.defineProperty(r,"Container",{enumerable:!0,get:function(){return V(u).default}});var h=t("./display/Transform");Object.defineProperty(r,"Transform",{enumerable:!0,get:function(){return V(h).default}});var l=t("./display/TransformStatic");Object.defineProperty(r,"TransformStatic",{enumerable:!0,get:function(){return V(l).default}});var c=t("./display/TransformBase");Object.defineProperty(r,"TransformBase",{enumerable:!0,get:function(){return V(c).default}});var f=t("./sprites/Sprite");Object.defineProperty(r,"Sprite",{enumerable:!0,get:function(){return V(f).default}});var d=t("./sprites/canvas/CanvasSpriteRenderer");Object.defineProperty(r,"CanvasSpriteRenderer",{enumerable:!0,get:function(){return V(d).default}});var p=t("./sprites/canvas/CanvasTinter");Object.defineProperty(r,"CanvasTinter",{enumerable:!0,get:function(){return V(p).default}});var v=t("./sprites/webgl/SpriteRenderer");Object.defineProperty(r,"SpriteRenderer",{enumerable:!0,get:function(){return V(v).default}});var y=t("./text/Text");Object.defineProperty(r,"Text",{enumerable:!0,get:function(){return V(y).default}});var g=t("./text/TextStyle");Object.defineProperty(r,"TextStyle",{enumerable:!0,get:function(){return V(g).default}});var m=t("./text/TextMetrics");Object.defineProperty(r,"TextMetrics",{enumerable:!0,get:function(){return V(m).default}});var b=t("./graphics/Graphics");Object.defineProperty(r,"Graphics",{enumerable:!0,get:function(){return V(b).default}});var _=t("./graphics/GraphicsData");Object.defineProperty(r,"GraphicsData",{enumerable:!0,get:function(){return V(_).default}});var x=t("./graphics/webgl/GraphicsRenderer");Object.defineProperty(r,"GraphicsRenderer",{enumerable:!0,get:function(){return V(x).default}});var w=t("./graphics/canvas/CanvasGraphicsRenderer");Object.defineProperty(r,"CanvasGraphicsRenderer",{enumerable:!0,get:function(){return V(w).default}});var T=t("./textures/Spritesheet");Object.defineProperty(r,"Spritesheet",{enumerable:!0,get:function(){return V(T).default}});var E=t("./textures/Texture");Object.defineProperty(r,"Texture",{enumerable:!0,get:function(){return V(E).default}});var O=t("./textures/TextureMatrix");Object.defineProperty(r,"TextureMatrix",{enumerable:!0,get:function(){return V(O).default}});var S=t("./textures/BaseTexture");Object.defineProperty(r,"BaseTexture",{enumerable:!0,get:function(){return V(S).default}});var M=t("./textures/RenderTexture");Object.defineProperty(r,"RenderTexture",{enumerable:!0,get:function(){return V(M).default}});var P=t("./textures/BaseRenderTexture");Object.defineProperty(r,"BaseRenderTexture",{enumerable:!0,get:function(){return V(P).default}});var C=t("./textures/VideoBaseTexture");Object.defineProperty(r,"VideoBaseTexture",{enumerable:!0,get:function(){return V(C).default}});var A=t("./textures/TextureUvs");Object.defineProperty(r,"TextureUvs",{enumerable:!0,get:function(){return V(A).default}});var R=t("./renderers/canvas/utils/CanvasRenderTarget");Object.defineProperty(r,"CanvasRenderTarget",{enumerable:!0,get:function(){return V(R).default}});var I=t("./Shader");Object.defineProperty(r,"Shader",{enumerable:!0,get:function(){return V(I).default}});var D=t("./renderers/webgl/managers/WebGLManager");Object.defineProperty(r,"WebGLManager",{enumerable:!0,get:function(){return V(D).default}});var k=t("./renderers/webgl/utils/ObjectRenderer");Object.defineProperty(r,"ObjectRenderer",{enumerable:!0,get:function(){return V(k).default}});var L=t("./renderers/webgl/utils/RenderTarget");Object.defineProperty(r,"RenderTarget",{enumerable:!0,get:function(){return V(L).default}});var j=t("./renderers/webgl/utils/Quad");Object.defineProperty(r,"Quad",{enumerable:!0,get:function(){return V(j).default}});var N=t("./renderers/webgl/filters/spriteMask/SpriteMaskFilter");Object.defineProperty(r,"SpriteMaskFilter",{enumerable:!0,get:function(){return V(N).default}});var B=t("./renderers/webgl/filters/Filter");Object.defineProperty(r,"Filter",{enumerable:!0,get:function(){return V(B).default}});var F=t("./Application");Object.defineProperty(r,"Application",{enumerable:!0,get:function(){return V(F).default}});var U=t("./autoDetectRenderer");Object.defineProperty(r,"autoDetectRenderer",{enumerable:!0,get:function(){return U.autoDetectRenderer}});var W=Y(t("./utils")),H=Y(t("./ticker")),X=V(t("./settings")),G=V(t("./renderers/canvas/CanvasRenderer")),z=V(t("./renderers/webgl/WebGLRenderer"));function Y(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function V(t){return t&&t.__esModule?t:{default:t}}r.settings=X.default,r.utils=W,r.ticker=H,r.CanvasRenderer=G.default,r.WebGLRenderer=z.default},{"./Application":57,"./Shader":58,"./autoDetectRenderer":59,"./const":60,"./display/Bounds":61,"./display/Container":62,"./display/DisplayObject":63,"./display/Transform":64,"./display/TransformBase":65,"./display/TransformStatic":66,"./graphics/Graphics":67,"./graphics/GraphicsData":68,"./graphics/canvas/CanvasGraphicsRenderer":69,"./graphics/webgl/GraphicsRenderer":71,"./math":84,"./renderers/canvas/CanvasRenderer":91,"./renderers/canvas/utils/CanvasRenderTarget":93,"./renderers/webgl/WebGLRenderer":98,"./renderers/webgl/filters/Filter":100,"./renderers/webgl/filters/spriteMask/SpriteMaskFilter":103,"./renderers/webgl/managers/WebGLManager":107,"./renderers/webgl/utils/ObjectRenderer":108,"./renderers/webgl/utils/Quad":109,"./renderers/webgl/utils/RenderTarget":110,"./settings":115,"./sprites/Sprite":116,"./sprites/canvas/CanvasSpriteRenderer":117,"./sprites/canvas/CanvasTinter":118,"./sprites/webgl/SpriteRenderer":120,"./text/Text":122,"./text/TextMetrics":123,"./text/TextStyle":124,"./textures/BaseRenderTexture":125,"./textures/BaseTexture":126,"./textures/RenderTexture":127,"./textures/Spritesheet":128,"./textures/Texture":129,"./textures/TextureMatrix":130,"./textures/TextureUvs":131,"./textures/VideoBaseTexture":132,"./ticker":135,"./utils":139,"pixi-gl-core":29}],80:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("./Matrix"),l=(i=n)&&i.__esModule?i:{default:i};var c=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],f=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],d=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],p=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],v=[],y=[];function g(t){return t<0?-1:0<t?1:0}!function(){for(var t=0;t<16;t++){var e=[];y.push(e);for(var r=0;r<16;r++)for(var i=g(c[t]*c[r]+d[t]*f[r]),n=g(f[t]*c[r]+p[t]*f[r]),o=g(c[t]*d[r]+d[t]*p[r]),s=g(f[t]*d[r]+p[t]*p[r]),a=0;a<16;a++)if(c[a]===i&&f[a]===n&&d[a]===o&&p[a]===s){e.push(a);break}}for(var u=0;u<16;u++){var h=new l.default;h.set(c[u],f[u],d[u],p[u],0,0),v.push(h)}}();var o={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return c[t]},uY:function(t){return f[t]},vX:function(t){return d[t]},vY:function(t){return p[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return y[t][e]},sub:function(t,e){return y[t][o.inv(e)]},rotate180:function(t){return 4^t},isVertical:function(t){return 2==(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?0<=e?o.S:o.N:2*Math.abs(e)<=Math.abs(t)?0<t?o.E:o.W:0<e?0<t?o.SE:o.SW:0<t?o.NE:o.NW},matrixAppendRotationInv:function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,n=v[o.inv(e)];n.tx=r,n.ty=i,t.append(n)}};r.default=o},{"./Matrix":81}],81:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o,s=t("./Point"),a=(o=s)&&o.__esModule?o:{default:o},u=t("../const");var h=(l.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},l.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},l.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0),r[8]=1,r},l.prototype.apply=function(t,e){e=e||new a.default;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},l.prototype.applyInverse=function(t,e){e=e||new a.default;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,n=t.y;return e.x=this.d*r*i+-this.c*r*n+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*n+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},l.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},l.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},l.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},l.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},l.prototype.setTransform=function(t,e,r,i,n,o,s,a,u){return this.a=Math.cos(s+u)*n,this.b=Math.sin(s+u)*n,this.c=-Math.sin(s-a)*o,this.d=Math.cos(s-a)*o,this.tx=t-(r*this.a+i*this.c),this.ty=e-(r*this.b+i*this.d),this},l.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},l.prototype.decompose=function(t){var e=this.a,r=this.b,i=this.c,n=this.d,o=-Math.atan2(-i,n),s=Math.atan2(r,e),a=Math.abs(o+s);return a<1e-5||Math.abs(u.PI_2-a)<1e-5?(t.rotation=s,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=o,t.skew.y=s),t.scale.x=Math.sqrt(e*e+r*r),t.scale.y=Math.sqrt(i*i+n*n),t.position.x=this.tx,t.position.y=this.ty,t},l.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},l.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},l.prototype.clone=function(){var t=new l;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},l.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i(l,null,[{key:"IDENTITY",get:function(){return new l}},{key:"TEMP_MATRIX",get:function(){return new l}}]),l);function l(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:1,n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this.array=null}r.default=h},{"../const":60,"./Point":83}],82:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=(s.prototype.clone=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;return new s(t||this.cb,e||this.scope,this._x,this._y)},s.prototype.set=function(t,e){var r=t||0,i=e||(0!==e?r:0);this._x===r&&this._y===i||(this._x=r,this._y=i,this.cb.call(this.scope))},s.prototype.copy=function(t){this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.cb.call(this.scope))},s.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},i(s,[{key:"x",get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}},{key:"y",get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}]),s);function s(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this._x=r,this._y=i,this.cb=t,this.scope=e}r.default=o},{}],83:[function(t,e,r){"use strict";r.__esModule=!0;var i=(n.prototype.clone=function(){return new n(this.x,this.y)},n.prototype.copy=function(t){this.set(t.x,t.y)},n.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},n.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)},n);function n(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.x=t,this.y=e}r.default=i},{}],84:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./Point");Object.defineProperty(r,"Point",{enumerable:!0,get:function(){return f(i).default}});var n=t("./ObservablePoint");Object.defineProperty(r,"ObservablePoint",{enumerable:!0,get:function(){return f(n).default}});var o=t("./Matrix");Object.defineProperty(r,"Matrix",{enumerable:!0,get:function(){return f(o).default}});var s=t("./GroupD8");Object.defineProperty(r,"GroupD8",{enumerable:!0,get:function(){return f(s).default}});var a=t("./shapes/Circle");Object.defineProperty(r,"Circle",{enumerable:!0,get:function(){return f(a).default}});var u=t("./shapes/Ellipse");Object.defineProperty(r,"Ellipse",{enumerable:!0,get:function(){return f(u).default}});var h=t("./shapes/Polygon");Object.defineProperty(r,"Polygon",{enumerable:!0,get:function(){return f(h).default}});var l=t("./shapes/Rectangle");Object.defineProperty(r,"Rectangle",{enumerable:!0,get:function(){return f(l).default}});var c=t("./shapes/RoundedRectangle");function f(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"RoundedRectangle",{enumerable:!0,get:function(){return f(c).default}})},{"./GroupD8":80,"./Matrix":81,"./ObservablePoint":82,"./Point":83,"./shapes/Circle":85,"./shapes/Ellipse":86,"./shapes/Polygon":87,"./shapes/Rectangle":88,"./shapes/RoundedRectangle":89}],85:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("./Rectangle"),o=(i=n)&&i.__esModule?i:{default:i},s=t("../../const");var a=(u.prototype.clone=function(){return new u(this.x,this.y,this.radius)},u.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.radius*this.radius,i=this.x-t,n=this.y-e;return(i*=i)+(n*=n)<=r},u.prototype.getBounds=function(){return new o.default(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)},u);function u(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),this.x=t,this.y=e,this.radius=r,this.type=s.SHAPES.CIRC}r.default=a},{"../../const":60,"./Rectangle":88}],86:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("./Rectangle"),o=(i=n)&&i.__esModule?i:{default:i},s=t("../../const");var a=(u.prototype.clone=function(){return new u(this.x,this.y,this.width,this.height)},u.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return(r*=r)+(i*=i)<=1},u.prototype.getBounds=function(){return new o.default(this.x-this.width,this.y-this.height,this.width,this.height)},u);function u(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),this.x=t,this.y=e,this.width=r,this.height=i,this.type=s.SHAPES.ELIP}r.default=a},{"../../const":60,"./Rectangle":88}],87:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("../Point"),s=(i=n)&&i.__esModule?i:{default:i},a=t("../../const");var o=(u.prototype.clone=function(){return new u(this.points.slice())},u.prototype.close=function(){var t=this.points;t[0]===t[t.length-2]&&t[1]===t[t.length-1]||t.push(t[0],t[1])},u.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;n<i;o=n++){var s=this.points[2*n],a=this.points[2*n+1],u=this.points[2*o],h=this.points[2*o+1];e<a!=e<h&&t<(e-a)/(h-a)*(u-s)+s&&(r=!r)}return r},u);function u(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),Array.isArray(e[0])&&(e=e[0]),e[0]instanceof s.default){for(var i=[],n=0,o=e.length;n<o;n++)i.push(e[n].x,e[n].y);e=i}this.closed=!0,this.points=e,this.type=a.SHAPES.POLY}r.default=o},{"../../const":60,"../Point":83}],88:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("../../const");var s=(a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height)},a.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},a.prototype.contains=function(t,e){return!(this.width<=0||this.height<=0)&&t>=this.x&&t<this.x+this.width&&e>=this.y&&e<this.y+this.height},a.prototype.pad=function(t,e){t=t||0,e=e||(0!==e?t:0),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e},a.prototype.fit=function(t){var e=Math.max(this.x,t.x),r=Math.min(this.x+this.width,t.x+t.width),i=Math.max(this.y,t.y),n=Math.min(this.y+this.height,t.y+t.height);this.x=e,this.width=Math.max(r-e,0),this.y=i,this.height=Math.max(n-i,0)},a.prototype.enlarge=function(t){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),i=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.width=r-e,this.y=i,this.height=n-i},a.prototype.ceil=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:.001,r=Math.ceil((this.x+this.width-e)*t)/t,i=Math.ceil((this.y+this.height-e)*t)/t;this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=r-this.x,this.height=i-this.y},i(a,[{key:"left",get:function(){return this.x}},{key:"right",get:function(){return this.x+this.width}},{key:"top",get:function(){return this.y}},{key:"bottom",get:function(){return this.y+this.height}}],[{key:"EMPTY",get:function(){return new a(0,0,0,0)}}]),a);function a(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.x=Number(t),this.y=Number(e),this.width=Number(r),this.height=Number(i),this.type=o.SHAPES.RECT}r.default=s},{"../../const":60}],89:[function(t,e,r){"use strict";r.__esModule=!0;var o=t("../../const");var i=(s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.radius)},s.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},s);function s(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,n=4<arguments.length&&void 0!==arguments[4]?arguments[4]:20;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this.x=t,this.y=e,this.width=r,this.height=i,this.radius=n,this.type=o.SHAPES.RREC}r.default=i},{"../../const":60}],90:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("../utils"),s=t("../math"),a=t("../const"),u=f(t("../settings")),h=f(t("../display/Container")),l=f(t("../textures/RenderTexture")),c=f(t("eventemitter3"));function f(t){return t&&t.__esModule?t:{default:t}}var d,p=new s.Matrix,v=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(y,d=c.default),y.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.autoResize&&(this.view.style.width=t+"px",this.view.style.height=e+"px")},y.prototype.generateTexture=function(t,e,r,i){i=i||t.getLocalBounds();var n=l.default.create(0|i.width,0|i.height,e,r);return p.tx=-i.x,p.ty=-i.y,this.render(t,n,!1,p,!!t.parent),n},y.prototype.destroy=function(t){t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.type=a.RENDERER_TYPE.UNKNOWN,this.view=null,this.screen=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.options=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this.roundPixels=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this._tempDisplayObjectParent=null,this._lastObjectRendered=null},i(y,[{key:"width",get:function(){return this.view.width}},{key:"height",get:function(){return this.view.height}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=(0,o.hex2string)(t),(0,o.hex2rgb)(t,this._backgroundColorRgba)}}]),y);function y(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,y);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,d.call(this));return(0,o.sayHello)(t),"number"==typeof e&&(e=Object.assign({width:e,height:r||u.default.RENDER_OPTIONS.height},i)),e=Object.assign({},u.default.RENDER_OPTIONS,e),n.options=e,n.type=a.RENDERER_TYPE.UNKNOWN,n.screen=new s.Rectangle(0,0,e.width,e.height),n.view=e.view||document.createElement("canvas"),n.resolution=e.resolution||u.default.RESOLUTION,n.transparent=e.transparent,n.autoResize=e.autoResize||!1,n.blendModes=null,n.preserveDrawingBuffer=e.preserveDrawingBuffer,n.clearBeforeRender=e.clearBeforeRender,n.roundPixels=e.roundPixels,n._backgroundColor=0,n._backgroundColorRgba=[0,0,0,0],n._backgroundColorString="#000000",n.backgroundColor=e.backgroundColor||n._backgroundColor,n._tempDisplayObjectParent=new h.default,n._lastObjectRendered=n._tempDisplayObjectParent,n}r.default=v},{"../const":60,"../display/Container":62,"../math":84,"../settings":115,"../textures/RenderTexture":127,"../utils":139,eventemitter3:204}],91:[function(t,e,r){"use strict";r.__esModule=!0;var i=u(t("../SystemRenderer")),n=u(t("./utils/CanvasMaskManager")),l=u(t("./utils/CanvasRenderTarget")),o=u(t("./utils/mapCanvasBlendModesToPixi")),s=t("../../utils"),c=t("../../const"),a=u(t("../../settings"));function u(t){return t&&t.__esModule?t:{default:t}}var h,f=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(d,h=i.default),d.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender");var o=this.resolution;e?((e=e.baseTexture||e)._canvasRenderTarget||(e._canvasRenderTarget=new l.default(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):this.context=this.rootContext;var s=this.context;if(e||(this._lastObjectRendered=t),!n){var a=t.parent,u=this._tempDisplayObjectParent.transform.worldTransform;i?(i.copy(u),this._tempDisplayObjectParent.transform._worldID=-1):u.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}s.save(),s.setTransform(1,0,0,1,0,0),s.globalAlpha=1,this._activeBlendMode=c.BLEND_MODES.NORMAL,s.globalCompositeOperation=this.blendModes[c.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(s.fillStyle="black",s.clear()),(void 0!==r?r:this.clearBeforeRender)&&this.renderingToScreen&&(this.transparent?s.clearRect(0,0,this.width,this.height):(s.fillStyle=this._backgroundColorString,s.fillRect(0,0,this.width,this.height)));var h=this.context;this.context=s,t.renderCanvas(this),this.context=h,s.restore(),this.resolution=o,this.emit("postrender")}},d.prototype.clear=function(t){var e=this.context;t=t||this._backgroundColorString,!this.transparent&&t?(e.fillStyle=t,e.fillRect(0,0,this.width,this.height)):e.clearRect(0,0,this.width,this.height)},d.prototype.setBlendMode=function(t){this._activeBlendMode!==t&&(this._activeBlendMode=t,this.context.globalCompositeOperation=this.blendModes[t])},d.prototype.destroy=function(t){this.destroyPlugins(),h.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},d.prototype.resize=function(t,e){h.prototype.resize.call(this,t,e),this.smoothProperty&&(this.rootContext[this.smoothProperty]=a.default.SCALE_MODE===c.SCALE_MODES.LINEAR)},d.prototype.invalidateBlendMode=function(){this._activeBlendMode=this.blendModes.indexOf(this.context.globalCompositeOperation)},d);function d(t,e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,h.call(this,"Canvas",t,e,r));return i.type=c.RENDERER_TYPE.CANVAS,i.rootContext=i.view.getContext("2d",{alpha:i.transparent}),i.context=i.rootContext,i.refresh=!0,i.maskManager=new n.default(i),i.smoothProperty="imageSmoothingEnabled",i.rootContext.imageSmoothingEnabled||(i.rootContext.webkitImageSmoothingEnabled?i.smoothProperty="webkitImageSmoothingEnabled":i.rootContext.mozImageSmoothingEnabled?i.smoothProperty="mozImageSmoothingEnabled":i.rootContext.oImageSmoothingEnabled?i.smoothProperty="oImageSmoothingEnabled":i.rootContext.msImageSmoothingEnabled&&(i.smoothProperty="msImageSmoothingEnabled")),i.initPlugins(),i.blendModes=(0,o.default)(),i._activeBlendMode=null,i.renderingToScreen=!1,i.resize(i.options.width,i.options.height),i}r.default=f,s.pluginTarget.mixin(f)},{"../../const":60,"../../settings":115,"../../utils":139,"../SystemRenderer":90,"./utils/CanvasMaskManager":92,"./utils/CanvasRenderTarget":93,"./utils/mapCanvasBlendModesToPixi":95}],92:[function(t,e,r){"use strict";r.__esModule=!0;var I=t("../../../const");var i=(n.prototype.pushMask=function(t){var e=this.renderer;e.context.save();var r=t.alpha,i=t.transform.worldTransform,n=e.resolution;e.context.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t._texture||(this.renderGraphicsShape(t),e.context.clip()),t.worldAlpha=r},n.prototype.renderGraphicsShape=function(t){var e=this.renderer.context,r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;i<r;i++){var n=t.graphicsData[i],o=n.shape;if(n.type===I.SHAPES.POLY){var s=o.points,a=n.holes,u=void 0,h=void 0;e.moveTo(s[0],s[1]);for(var l=2;l<s.length;l+=2)e.lineTo(s[l],s[l+1]);if(s[0]===s[s.length-2]&&s[1]===s[s.length-1]&&e.closePath(),0<a.length){for(var c=u=0;c<s.length;c+=2)u+=s[c]*s[c+3]-s[c+1]*s[c+2];for(var f=0;f<a.length;f++){s=a[f].points;for(var d=h=0;d<s.length;d+=2)h+=s[d]*s[d+3]-s[d+1]*s[d+2];if(e.moveTo(s[0],s[1]),h*u<0)for(var p=2;p<s.length;p+=2)e.lineTo(s[p],s[p+1]);else for(var v=s.length-2;2<=v;v-=2)e.lineTo(s[v],s[v+1])}}}else if(n.type===I.SHAPES.RECT)e.rect(o.x,o.y,o.width,o.height),e.closePath();else if(n.type===I.SHAPES.CIRC)e.arc(o.x,o.y,o.radius,0,2*Math.PI),e.closePath();else if(n.type===I.SHAPES.ELIP){var y=2*o.width,g=2*o.height,m=o.x-y/2,b=o.y-g/2,_=y/2*.5522848,x=g/2*.5522848,w=m+y,T=b+g,E=m+y/2,O=b+g/2;e.moveTo(m,O),e.bezierCurveTo(m,O-x,E-_,b,E,b),e.bezierCurveTo(E+_,b,w,O-x,w,O),e.bezierCurveTo(w,O+x,E+_,T,E,T),e.bezierCurveTo(E-_,T,m,O+x,m,O),e.closePath()}else if(n.type===I.SHAPES.RREC){var S=o.x,M=o.y,P=o.width,C=o.height,A=o.radius,R=Math.min(P,C)/2|0;A=R<A?R:A,e.moveTo(S,M+A),e.lineTo(S,M+C-A),e.quadraticCurveTo(S,M+C,S+A,M+C),e.lineTo(S+P-A,M+C),e.quadraticCurveTo(S+P,M+C,S+P,M+C-A),e.lineTo(S+P,M+A),e.quadraticCurveTo(S+P,M,S+P-A,M),e.lineTo(S+A,M),e.quadraticCurveTo(S,M,S,M+A),e.closePath()}}}},n.prototype.popMask=function(t){t.context.restore(),t.invalidateBlendMode()},n.prototype.destroy=function(){},n);function n(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.renderer=t}r.default=i},{"../../../const":60}],93:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o,s=t("../../../settings"),a=(o=s)&&o.__esModule?o:{default:o};var u=(h.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},h.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},h.prototype.destroy=function(){this.context=null,this.canvas=null},i(h,[{key:"width",get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},{key:"height",get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}]),h);function h(t,e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||a.default.RESOLUTION,this.resize(t,e)}r.default=u},{"../../../settings":115}],94:[function(t,e,r){"use strict";function s(t){var e=document.createElement("canvas");e.width=6,e.height=1;var r=e.getContext("2d");return r.fillStyle=t,r.fillRect(0,0,6,1),e}r.__esModule=!0,r.default=function(){if("undefined"==typeof document)return!1;var t=s("#ff00ff"),e=s("#ffff00"),r=document.createElement("canvas");r.width=6,r.height=1;var i=r.getContext("2d");i.globalCompositeOperation="multiply",i.drawImage(t,0,0),i.drawImage(e,2,0);var n=i.getImageData(2,0,1,1);if(!n)return!1;var o=n.data;return 255===o[0]&&0===o[1]&&0===o[2]}},{}],95:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];(0,s.default)()?(t[n.BLEND_MODES.NORMAL]="source-over",t[n.BLEND_MODES.ADD]="lighter",t[n.BLEND_MODES.MULTIPLY]="multiply",t[n.BLEND_MODES.SCREEN]="screen",t[n.BLEND_MODES.OVERLAY]="overlay",t[n.BLEND_MODES.DARKEN]="darken",t[n.BLEND_MODES.LIGHTEN]="lighten",t[n.BLEND_MODES.COLOR_DODGE]="color-dodge",t[n.BLEND_MODES.COLOR_BURN]="color-burn",t[n.BLEND_MODES.HARD_LIGHT]="hard-light",t[n.BLEND_MODES.SOFT_LIGHT]="soft-light",t[n.BLEND_MODES.DIFFERENCE]="difference",t[n.BLEND_MODES.EXCLUSION]="exclusion",t[n.BLEND_MODES.HUE]="hue",t[n.BLEND_MODES.SATURATION]="saturate",t[n.BLEND_MODES.COLOR]="color",t[n.BLEND_MODES.LUMINOSITY]="luminosity"):(t[n.BLEND_MODES.NORMAL]="source-over",t[n.BLEND_MODES.ADD]="lighter",t[n.BLEND_MODES.MULTIPLY]="source-over",t[n.BLEND_MODES.SCREEN]="source-over",t[n.BLEND_MODES.OVERLAY]="source-over",t[n.BLEND_MODES.DARKEN]="source-over",t[n.BLEND_MODES.LIGHTEN]="source-over",t[n.BLEND_MODES.COLOR_DODGE]="source-over",t[n.BLEND_MODES.COLOR_BURN]="source-over",t[n.BLEND_MODES.HARD_LIGHT]="source-over",t[n.BLEND_MODES.SOFT_LIGHT]="source-over",t[n.BLEND_MODES.DIFFERENCE]="source-over",t[n.BLEND_MODES.EXCLUSION]="source-over",t[n.BLEND_MODES.HUE]="source-over",t[n.BLEND_MODES.SATURATION]="source-over",t[n.BLEND_MODES.COLOR]="source-over",t[n.BLEND_MODES.LUMINOSITY]="source-over");return t[n.BLEND_MODES.NORMAL_NPM]=t[n.BLEND_MODES.NORMAL],t[n.BLEND_MODES.ADD_NPM]=t[n.BLEND_MODES.ADD],t[n.BLEND_MODES.SCREEN_NPM]=t[n.BLEND_MODES.SCREEN],t};var i,n=t("../../../const"),o=t("./canUseNewCanvasBlendModes"),s=(i=o)&&i.__esModule?i:{default:i}},{"../../../const":60,"./canUseNewCanvasBlendModes":94}],96:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("../../const"),o=t("../../settings"),s=(i=o)&&i.__esModule?i:{default:i};var a=(u.prototype.update=function(){this.count++,this.mode!==n.GC_MODES.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run()))},u.prototype.run=function(){for(var t=this.renderer.textureManager,e=t._managedTextures,r=!1,i=0;i<e.length;i++){var n=e[i];!n._glRenderTargets&&this.count-n.touched>this.maxIdle&&(t.destroyTexture(n,!0),r=!(e[i]=null))}if(r){for(var o=0,s=0;s<e.length;s++)null!==e[s]&&(e[o++]=e[s]);e.length=o}},u.prototype.unload=function(t){var e=this.renderer.textureManager;t._texture&&t._texture._glRenderTargets&&e.destroyTexture(t._texture,!0);for(var r=t.children.length-1;0<=r;r--)this.unload(t.children[r])},u);function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=s.default.GC_MAX_IDLE,this.checkCountMax=s.default.GC_MAX_CHECK_COUNT,this.mode=s.default.GC_MODE}r.default=a},{"../../const":60,"../../settings":115}],97:[function(t,e,r){"use strict";r.__esModule=!0;var i,u=t("pixi-gl-core"),h=t("../../const"),n=t("./utils/RenderTarget"),l=(i=n)&&i.__esModule?i:{default:i},a=t("../../utils");var o=(s.prototype.bindTexture=function(){},s.prototype.getTexture=function(){},s.prototype.updateTexture=function(t,e){var r=this.gl,i=!!t._glRenderTargets;if(!t.hasLoaded)return null;var n=this.renderer.boundTextures;if(void 0===e)for(var o=e=0;o<n.length;++o)if(n[o]===t){e=o;break}n[e]=t,r.activeTexture(r.TEXTURE0+e);var s=t._glTextures[this.renderer.CONTEXT_UID];if(s)i?t._glRenderTargets[this.renderer.CONTEXT_UID].resize(t.width,t.height):s.upload(t.source);else{if(i){var a=new l.default(this.gl,t.width,t.height,t.scaleMode,t.resolution);a.resize(t.width,t.height),s=(t._glRenderTargets[this.renderer.CONTEXT_UID]=a).texture,this.renderer._activeRenderTarget.root||this.renderer._activeRenderTarget.frameBuffer.bind()}else(s=new u.GLTexture(this.gl,null,null,null,null)).bind(e),s.premultiplyAlpha=!0,s.upload(t.source);t._glTextures[this.renderer.CONTEXT_UID]=s,t.on("update",this.updateTexture,this),t.on("dispose",this.destroyTexture,this),this._managedTextures.push(t),t.isPowerOfTwo?(t.mipmap&&s.enableMipmap(),t.wrapMode===h.WRAP_MODES.CLAMP?s.enableWrapClamp():t.wrapMode===h.WRAP_MODES.REPEAT?s.enableWrapRepeat():s.enableWrapMirrorRepeat()):s.enableWrapClamp(),t.scaleMode===h.SCALE_MODES.NEAREST?s.enableNearestScaling():s.enableLinearScaling()}return s},s.prototype.destroyTexture=function(t,e){if((t=t.baseTexture||t).hasLoaded){var r=this.renderer,i=r.CONTEXT_UID,n=t._glTextures,o=t._glRenderTargets;if(n[i]&&(r.unbindTexture(t),n[i].destroy(),t.off("update",this.updateTexture,this),t.off("dispose",this.destroyTexture,this),delete n[i],!e)){var s=this._managedTextures.indexOf(t);-1!==s&&(0,a.removeItems)(this._managedTextures,s,1)}o&&o[i]&&(r._activeRenderTarget===o[i]&&r.bindRenderTarget(r.rootRenderTarget),o[i].destroy(),delete o[i])}},s.prototype.removeAll=function(){for(var t=0;t<this._managedTextures.length;++t){var e=this._managedTextures[t];e._glTextures[this.renderer.CONTEXT_UID]&&delete e._glTextures[this.renderer.CONTEXT_UID]}},s.prototype.destroy=function(){for(var t=0;t<this._managedTextures.length;++t){var e=this._managedTextures[t];this.destroyTexture(e,!0),e.off("update",this.updateTexture,this),e.off("dispose",this.destroyTexture,this)}this._managedTextures=null},s);function s(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this.renderer=t,this.gl=t.gl,this._managedTextures=[]}r.default=o},{"../../const":60,"../../utils":139,"./utils/RenderTarget":110,"pixi-gl-core":29}],98:[function(t,e,r){"use strict";r.__esModule=!0;var i=m(t("../SystemRenderer")),n=m(t("./managers/MaskManager")),o=m(t("./managers/StencilManager")),s=m(t("./managers/FilterManager")),a=m(t("./utils/RenderTarget")),u=m(t("./utils/ObjectRenderer")),h=m(t("./TextureManager")),l=m(t("../../textures/BaseTexture")),c=m(t("./TextureGarbageCollector")),f=m(t("./WebGLState")),d=m(t("./utils/mapWebGLDrawModesToPixi")),p=m(t("./utils/validateContext")),v=t("../../utils"),y=m(t("pixi-gl-core")),g=t("../../const");function m(t){return t&&t.__esModule?t:{default:t}}var b,_=0,x=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(w,b=i.default),w.prototype._initContext=function(){var t=this.gl;t.isContextLost()&&t.getExtension("WEBGL_lose_context")&&t.getExtension("WEBGL_lose_context").restoreContext();var e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this._activeShader=null,this._activeVao=null,this.boundTextures=new Array(e),this.emptyTextures=new Array(e),this._unknownBoundTextures=!1,this.textureManager=new h.default(this),this.filterManager=new s.default(this),this.textureGC=new c.default(this),this.state.resetToDefault(),this.rootRenderTarget=new a.default(t,this.width,this.height,null,this.resolution,!0),this.rootRenderTarget.clearColor=this._backgroundColorRgba,this.bindRenderTarget(this.rootRenderTarget);var r=new y.default.GLTexture.fromData(t,null,1,1),i={_glTextures:{}};i._glTextures[this.CONTEXT_UID]={};for(var n=0;n<e;n++){var o=new l.default;o._glTextures[this.CONTEXT_UID]=r,this.boundTextures[n]=i,this.emptyTextures[n]=o,this.bindTexture(null,n)}this.emit("context",t),this.resize(this.screen.width,this.screen.height)},w.prototype.render=function(t,e,r,i,n){if(this.renderingToScreen=!e,this.emit("prerender"),this.gl&&!this.gl.isContextLost()){if(this._nextTextureLocation=0,e||(this._lastObjectRendered=t),!n){var o=t.parent;t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=o}this.bindRenderTexture(e,i),this.currentRenderer.start(),(void 0!==r?r:this.clearBeforeRender)&&this._activeRenderTarget.clear(),t.renderWebGL(this),this.currentRenderer.flush(),this.textureGC.update(),this.emit("postrender")}},w.prototype.setObjectRenderer=function(t){this.currentRenderer!==t&&(this.currentRenderer.stop(),this.currentRenderer=t,this.currentRenderer.start())},w.prototype.flush=function(){this.setObjectRenderer(this.emptyRenderer)},w.prototype.resize=function(t,e){i.default.prototype.resize.call(this,t,e),this.rootRenderTarget.resize(t,e),this._activeRenderTarget===this.rootRenderTarget&&(this.rootRenderTarget.activate(),this._activeShader&&(this._activeShader.uniforms.projectionMatrix=this.rootRenderTarget.projectionMatrix.toArray(!0)))},w.prototype.setBlendMode=function(t){this.state.setBlendMode(t)},w.prototype.clear=function(t){this._activeRenderTarget.clear(t)},w.prototype.setTransform=function(t){this._activeRenderTarget.transform=t},w.prototype.clearRenderTexture=function(t,e){var r=t.baseTexture._glRenderTargets[this.CONTEXT_UID];return r&&r.clear(e),this},w.prototype.bindRenderTexture=function(t,e){var r=void 0;if(t){var i=t.baseTexture;i._glRenderTargets[this.CONTEXT_UID]||this.textureManager.updateTexture(i,0),this.unbindTexture(i),(r=i._glRenderTargets[this.CONTEXT_UID]).setFrame(t.frame)}else r=this.rootRenderTarget;return r.transform=e,this.bindRenderTarget(r),this},w.prototype.bindRenderTarget=function(t){return t!==this._activeRenderTarget&&((this._activeRenderTarget=t).activate(),this._activeShader&&(this._activeShader.uniforms.projectionMatrix=t.projectionMatrix.toArray(!0)),this.stencilManager.setMaskStack(t.stencilMaskStack)),this},w.prototype.bindShader=function(t,e){return this._activeShader!==t&&((this._activeShader=t).bind(),!1!==e&&(t.uniforms.projectionMatrix=this._activeRenderTarget.projectionMatrix.toArray(!0))),this},w.prototype.bindTexture=function(t,e,r){if((t=(t=t||this.emptyTextures[e]).baseTexture||t).touched=this.textureGC.count,r)e=e||0;else{for(var i=0;i<this.boundTextures.length;i++)if(this.boundTextures[i]===t)return i;void 0===e&&(this._nextTextureLocation++,this._nextTextureLocation%=this.boundTextures.length,e=this.boundTextures.length-this._nextTextureLocation-1)}var n=this.gl,o=t._glTextures[this.CONTEXT_UID];return o?(this.boundTextures[e]=t,n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,o.texture)):this.textureManager.updateTexture(t,e),e},w.prototype.unbindTexture=function(t){var e=this.gl;if(t=t.baseTexture||t,this._unknownBoundTextures){this._unknownBoundTextures=!1;for(var r=0;r<this.boundTextures.length;r++)this.boundTextures[r]===this.emptyTextures[r]&&(e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,this.emptyTextures[r]._glTextures[this.CONTEXT_UID].texture))}for(var i=0;i<this.boundTextures.length;i++)this.boundTextures[i]===t&&(this.boundTextures[i]=this.emptyTextures[i],e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,this.emptyTextures[i]._glTextures[this.CONTEXT_UID].texture));return this},w.prototype.createVao=function(){return new y.default.VertexArrayObject(this.gl,this.state.attribState)},w.prototype.bindVao=function(t){return this._activeVao===t||(t?t.bind():this._activeVao&&this._activeVao.unbind(),this._activeVao=t),this},w.prototype.reset=function(){this.setObjectRenderer(this.emptyRenderer),this.bindVao(null),this._activeShader=null,this._activeRenderTarget=this.rootRenderTarget,this._unknownBoundTextures=!0;for(var t=0;t<this.boundTextures.length;t++)this.boundTextures[t]=this.emptyTextures[t];return this.rootRenderTarget.activate(),this.state.resetToDefault(),this},w.prototype.handleContextLost=function(t){t.preventDefault()},w.prototype.handleContextRestored=function(){this.textureManager.removeAll(),this.filterManager.destroy(!0),this._initContext()},w.prototype.destroy=function(t){this.destroyPlugins(),this.view.removeEventListener("webglcontextlost",this.handleContextLost),this.view.removeEventListener("webglcontextrestored",this.handleContextRestored),this.textureManager.destroy(),b.prototype.destroy.call(this,t),this.uid=0,this.maskManager.destroy(),this.stencilManager.destroy(),this.filterManager.destroy(),this.maskManager=null,this.filterManager=null,this.textureManager=null,this.currentRenderer=null,this.handleContextLost=null,this.handleContextRestored=null,this._contextOptions=null,this.gl.useProgram(null),this.gl.getExtension("WEBGL_lose_context")&&this.gl.getExtension("WEBGL_lose_context").loseContext(),this.gl=null},w);function w(t,e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,w);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,b.call(this,"WebGL",t,e,r));return i.legacy=i.options.legacy,i.legacy&&(y.default.VertexArrayObject.FORCE_NATIVE=!0),i.type=g.RENDERER_TYPE.WEBGL,i.handleContextLost=i.handleContextLost.bind(i),i.handleContextRestored=i.handleContextRestored.bind(i),i.view.addEventListener("webglcontextlost",i.handleContextLost,!1),i.view.addEventListener("webglcontextrestored",i.handleContextRestored,!1),i._contextOptions={alpha:i.transparent,antialias:i.options.antialias,premultipliedAlpha:i.transparent&&"notMultiplied"!==i.transparent,stencil:!0,preserveDrawingBuffer:i.options.preserveDrawingBuffer,powerPreference:i.options.powerPreference},i._backgroundColorRgba[3]=i.transparent?0:1,i.maskManager=new n.default(i),i.stencilManager=new o.default(i),i.emptyRenderer=new u.default(i),i.currentRenderer=i.emptyRenderer,i.textureManager=null,i.filterManager=null,i.initPlugins(),i.options.context&&(0,p.default)(i.options.context),i.gl=i.options.context||y.default.createContext(i.view,i._contextOptions),i.CONTEXT_UID=_++,i.state=new f.default(i.gl),i.renderingToScreen=!0,i.boundTextures=null,i._activeShader=null,i._activeVao=null,i._activeRenderTarget=null,i._initContext(),i.drawModes=(0,d.default)(i.gl),i._nextTextureLocation=0,i.setBlendMode(0),i}r.default=x,v.pluginTarget.mixin(x)},{"../../const":60,"../../textures/BaseTexture":126,"../../utils":139,"../SystemRenderer":90,"./TextureGarbageCollector":96,"./TextureManager":97,"./WebGLState":99,"./managers/FilterManager":104,"./managers/MaskManager":105,"./managers/StencilManager":106,"./utils/ObjectRenderer":108,"./utils/RenderTarget":110,"./utils/mapWebGLDrawModesToPixi":113,"./utils/validateContext":114,"pixi-gl-core":29}],99:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("./utils/mapWebGLBlendModesToPixi"),o=(i=n)&&i.__esModule?i:{default:i};var s=(a.prototype.push=function(){var t=this.stack[this.stackIndex];t||(t=this.stack[this.stackIndex]=new Uint8Array(16)),++this.stackIndex;for(var e=0;e<this.activeState.length;e++)t[e]=this.activeState[e]},a.prototype.pop=function(){var t=this.stack[--this.stackIndex];this.setState(t)},a.prototype.setState=function(t){this.setBlend(t[0]),this.setDepthTest(t[1]),this.setFrontFace(t[2]),this.setCullFace(t[3]),this.setBlendMode(t[4])},a.prototype.setBlend=function(t){t=t?1:0,this.activeState[0]!==t&&(this.activeState[0]=t,this.gl[t?"enable":"disable"](this.gl.BLEND))},a.prototype.setBlendMode=function(t){if(t!==this.activeState[4]){this.activeState[4]=t;var e=this.blendModes[t];2===e.length?this.gl.blendFunc(e[0],e[1]):this.gl.blendFuncSeparate(e[0],e[1],e[2],e[3])}},a.prototype.setDepthTest=function(t){t=t?1:0,this.activeState[1]!==t&&(this.activeState[1]=t,this.gl[t?"enable":"disable"](this.gl.DEPTH_TEST))},a.prototype.setCullFace=function(t){t=t?1:0,this.activeState[3]!==t&&(this.activeState[3]=t,this.gl[t?"enable":"disable"](this.gl.CULL_FACE))},a.prototype.setFrontFace=function(t){t=t?1:0,this.activeState[2]!==t&&(this.activeState[2]=t,this.gl.frontFace(this.gl[t?"CW":"CCW"]))},a.prototype.resetAttributes=function(){for(var t=0;t<this.attribState.tempAttribState.length;t++)this.attribState.tempAttribState[t]=0;for(var e=0;e<this.attribState.attribState.length;e++)this.attribState.attribState[e]=0;for(var r=1;r<this.maxAttribs;r++)this.gl.disableVertexAttribArray(r)},a.prototype.resetToDefault=function(){this.nativeVaoExtension&&this.nativeVaoExtension.bindVertexArrayOES(null),this.resetAttributes();for(var t=0;t<this.activeState.length;++t)this.activeState[t]=32;this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.setState(this.defaultState)},a);function a(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.activeState=new Uint8Array(16),this.defaultState=new Uint8Array(16),this.defaultState[0]=1,this.stackIndex=0,this.stack=[],this.gl=t,this.maxAttribs=t.getParameter(t.MAX_VERTEX_ATTRIBS),this.attribState={tempAttribState:new Array(this.maxAttribs),attribState:new Array(this.maxAttribs)},this.blendModes=(0,o.default)(t),this.nativeVaoExtension=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object")}r.default=s},{"./utils/mapWebGLBlendModesToPixi":112}],100:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=h(t("./extractUniformsFromSrc")),s=t("../../../utils"),a=t("../../../const"),u=h(t("../../../settings"));function h(t){return t&&t.__esModule?t:{default:t}}var l={},c=(f.prototype.apply=function(t,e,r,i,n){t.applyFilter(this,e,r,i)},i(f,[{key:"blendMode",get:function(){return this._blendMode},set:function(t){this._blendMode=t}}],[{key:"defaultVertexSrc",get:function(){return["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 projectionMatrix;","uniform mat3 filterMatrix;","varying vec2 vTextureCoord;","varying vec2 vFilterCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;"," vTextureCoord = aTextureCoord ;","}"].join("\n")}},{key:"defaultFragmentSrc",get:function(){return["varying vec2 vTextureCoord;","varying vec2 vFilterCoord;","uniform sampler2D uSampler;","uniform sampler2D filterSampler;","void main(void){"," vec4 masky = texture2D(filterSampler, vFilterCoord);"," vec4 sample = texture2D(uSampler, vTextureCoord);"," vec4 color;"," if(mod(vFilterCoord.x, 1.0) > 0.5)"," {"," color = vec4(1.0, 0.0, 0.0, 1.0);"," }"," else"," {"," color = vec4(0.0, 1.0, 0.0, 1.0);"," }"," gl_FragColor = mix(sample, masky, 0.5);"," gl_FragColor *= sample.a;","}"].join("\n")}}]),f);function f(t,e,r){for(var i in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),this.vertexSrc=t||f.defaultVertexSrc,this.fragmentSrc=e||f.defaultFragmentSrc,this._blendMode=a.BLEND_MODES.NORMAL,this.uniformData=r||(0,o.default)(this.vertexSrc,this.fragmentSrc,"projectionMatrix|uSampler"),this.uniforms={},this.uniformData)this.uniforms[i]=this.uniformData[i].value,this.uniformData[i].type&&(this.uniformData[i].type=this.uniformData[i].type.toLowerCase());this.glShaders={},l[this.vertexSrc+this.fragmentSrc]||(l[this.vertexSrc+this.fragmentSrc]=(0,s.uid)()),this.glShaderKey=l[this.vertexSrc+this.fragmentSrc],this.padding=4,this.resolution=u.default.FILTER_RESOLUTION,this.enabled=!0,this.autoFit=!0}r.default=c},{"../../../const":60,"../../../settings":115,"../../../utils":139,"./extractUniformsFromSrc":101}],101:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e,r){var i=o(t),n=o(e);return Object.assign(i,n)};var i,n=t("pixi-gl-core");var c=((i=n)&&i.__esModule?i:{default:i}).default.shader.defaultValue;function o(t){for(var e=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,n=t.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o<n.length;o++){var s=n[o].trim();if(-1<s.indexOf("uniform")){var a=s.split(" "),u=a[1],h=a[2],l=1;-1<h.indexOf("[")&&(h=(i=h.split(/\[|]/))[0],l*=Number(i[1])),h.match(e)||(r[h]={value:c(u,l),name:h,type:u})}}return r}},{"pixi-gl-core":29}],102:[function(t,e,r){"use strict";r.__esModule=!0,r.calculateScreenSpaceMatrix=function(t,e,r){var i=t.identity();return i.translate(e.x/r.width,e.y/r.height),i.scale(r.width,r.height),i},r.calculateNormalizedScreenSpaceMatrix=function(t,e,r){var i=t.identity();i.translate(e.x/r.width,e.y/r.height);var n=r.width/e.width,o=r.height/e.height;return i.scale(n,o),i},r.calculateSpriteMatrix=function(t,e,r,i){var n=i._texture.orig,o=t.set(r.width,0,0,r.height,e.x,e.y),s=i.worldTransform.copy(a.Matrix.TEMP_MATRIX);return s.invert(),o.prepend(s),o.scale(1/n.width,1/n.height),o.translate(i.anchor.x,i.anchor.y),o};var a=t("../../../math")},{"../../../math":84}],103:[function(t,e,r){"use strict";r.__esModule=!0;var i=o(t("../Filter")),n=t("../../../../math"),s=(t("path"),o(t("../../../../textures/TextureMatrix")));function o(t){return t&&t.__esModule?t:{default:t}}var a,u=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,a=i.default),h.prototype.apply=function(t,e,r,i){var n=this.maskSprite,o=this.maskSprite.texture;o.valid&&(o.transform||(o.transform=new s.default(o,0)),o.transform.update(),this.uniforms.mask=o,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,n).prepend(o.transform.mapCoord),this.uniforms.alpha=n.worldAlpha,this.uniforms.maskClamp=o.transform.uClampFrame,t.applyFilter(this,e,r,i))},h);function h(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h);var e=new n.Matrix,r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,a.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n","varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n\n original *= (masky.r * masky.a * alpha * clip);\n\n gl_FragColor = original;\n}\n"));return t.renderable=!1,r.maskSprite=t,r.maskMatrix=e,r}r.default=u},{"../../../../math":84,"../../../../textures/TextureMatrix":130,"../Filter":100,path:224}],104:[function(t,e,r){"use strict";r.__esModule=!0;var i=l(t("./WebGLManager")),a=l(t("../utils/RenderTarget")),n=l(t("../utils/Quad")),o=t("../../../math"),u=l(t("../../../Shader")),s=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../filters/filterTransforms")),h=l(t("bit-twiddle"));function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var p=(f.prototype.clear=function(){this.filters=null,this.target=null,this.renderTarget=null},f);function f(){c(this,f),this.renderTarget=null,this.target=null,this.resolution=1,this.sourceFrame=new o.Rectangle,this.destinationFrame=new o.Rectangle,this.filters=[]}var d,v="screen",y=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(g,d=i.default),g.prototype.pushFilter=function(t,e){var r=this.renderer,i=this.filterData;if(!i){i=this.renderer._activeRenderTarget.filterStack;var n=new p;n.sourceFrame=n.destinationFrame=this.renderer._activeRenderTarget.size,n.renderTarget=r._activeRenderTarget,this.renderer._activeRenderTarget.filterData=i={index:0,stack:[n]},this.filterData=i}var o=i.stack[++i.index],s=i.stack[0].destinationFrame;o||(o=i.stack[i.index]=new p);var a=t.filterArea&&0===t.filterArea.x&&0===t.filterArea.y&&t.filterArea.width===r.screen.width&&t.filterArea.height===r.screen.height,u=e[0].resolution,h=0|e[0].padding,l=a?r.screen:t.filterArea||t.getBounds(!0),c=o.sourceFrame,f=o.destinationFrame;c.x=(l.x*u|0)/u,c.y=(l.y*u|0)/u,c.width=(l.width*u|0)/u,c.height=(l.height*u|0)/u,a||(i.stack[0].renderTarget.transform||e[0].autoFit&&c.fit(s),c.pad(h)),f.width=c.width,f.height=c.height;var d=this.getPotRenderTarget(r.gl,c.width,c.height,u);o.target=t,o.filters=e,o.resolution=u,(o.renderTarget=d).setFrame(f,c),r.bindRenderTarget(d),d.clear()},g.prototype.popFilter=function(){var t=this.filterData,e=t.stack[t.index-1],r=t.stack[t.index];this.quad.map(r.renderTarget.size,r.sourceFrame).upload();var i=r.filters;if(1===i.length)i[0].apply(this,r.renderTarget,e.renderTarget,!1,r),this.freePotRenderTarget(r.renderTarget);else{var n=r.renderTarget,o=this.getPotRenderTarget(this.renderer.gl,r.sourceFrame.width,r.sourceFrame.height,r.resolution);o.setFrame(r.destinationFrame,r.sourceFrame),o.clear();var s=0;for(s=0;s<i.length-1;++s){i[s].apply(this,n,o,!0,r);var a=n;n=o,o=a}i[s].apply(this,n,e.renderTarget,!1,r),this.freePotRenderTarget(n),this.freePotRenderTarget(o)}r.clear(),t.index--,0===t.index&&(this.filterData=null)},g.prototype.applyFilter=function(t,e,r,i){var n=this.renderer,o=n.gl,s=t.glShaders[n.CONTEXT_UID];s||(t.glShaderKey?(s=this.shaderCache[t.glShaderKey])||(s=new u.default(this.gl,t.vertexSrc,t.fragmentSrc),t.glShaders[n.CONTEXT_UID]=this.shaderCache[t.glShaderKey]=s,this.managedFilters.push(t)):(s=t.glShaders[n.CONTEXT_UID]=new u.default(this.gl,t.vertexSrc,t.fragmentSrc),this.managedFilters.push(t)),n.bindVao(null),this.quad.initVao(s)),n.bindVao(this.quad.vao),n.bindRenderTarget(r),i&&(o.disable(o.SCISSOR_TEST),n.clear(),o.enable(o.SCISSOR_TEST)),r===n.maskManager.scissorRenderTarget&&n.maskManager.pushScissorMask(null,n.maskManager.scissorData),n.bindShader(s);var a=this.renderer.emptyTextures[0];this.renderer.boundTextures[0]=a,this.syncUniforms(s,t),n.state.setBlendMode(t.blendMode),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,e.texture.texture),this.quad.vao.draw(this.renderer.gl.TRIANGLES,6,0),o.bindTexture(o.TEXTURE_2D,a._glTextures[this.renderer.CONTEXT_UID].texture)},g.prototype.syncUniforms=function(t,e){var r=e.uniformData,i=e.uniforms,n=1,o=void 0;if(t.uniforms.filterArea){o=this.filterData.stack[this.filterData.index];var s=t.uniforms.filterArea;s[0]=o.renderTarget.size.width,s[1]=o.renderTarget.size.height,s[2]=o.sourceFrame.x,s[3]=o.sourceFrame.y,t.uniforms.filterArea=s}if(t.uniforms.filterClamp){o=o||this.filterData.stack[this.filterData.index];var a=t.uniforms.filterClamp;a[0]=0,a[1]=0,a[2]=(o.sourceFrame.width-1)/o.renderTarget.size.width,a[3]=(o.sourceFrame.height-1)/o.renderTarget.size.height,t.uniforms.filterClamp=a}for(var u in r)if(t.uniforms.data[u]){var h=r[u].type;if("sampler2d"===h&&0!==i[u]){if(i[u].baseTexture)t.uniforms[u]=this.renderer.bindTexture(i[u].baseTexture,n);else{t.uniforms[u]=n;var l=this.renderer.gl;this.renderer.boundTextures[n]=this.renderer.emptyTextures[n],l.activeTexture(l.TEXTURE0+n),i[u].texture.bind()}n++}else if("mat3"===h)void 0!==i[u].a?t.uniforms[u]=i[u].toArray(!0):t.uniforms[u]=i[u];else if("vec2"===h)if(void 0!==i[u].x){var c=t.uniforms[u]||new Float32Array(2);c[0]=i[u].x,c[1]=i[u].y,t.uniforms[u]=c}else t.uniforms[u]=i[u];else"float"===h?t.uniforms.data[u].value!==r[u]&&(t.uniforms[u]=i[u]):t.uniforms[u]=i[u]}},g.prototype.getRenderTarget=function(t,e){var r=this.filterData.stack[this.filterData.index],i=this.getPotRenderTarget(this.renderer.gl,r.sourceFrame.width,r.sourceFrame.height,e||r.resolution);return i.setFrame(r.destinationFrame,r.sourceFrame),i},g.prototype.returnRenderTarget=function(t){this.freePotRenderTarget(t)},g.prototype.calculateScreenSpaceMatrix=function(t){var e=this.filterData.stack[this.filterData.index];return s.calculateScreenSpaceMatrix(t,e.sourceFrame,e.renderTarget.size)},g.prototype.calculateNormalizedScreenSpaceMatrix=function(t){var e=this.filterData.stack[this.filterData.index];return s.calculateNormalizedScreenSpaceMatrix(t,e.sourceFrame,e.renderTarget.size,e.destinationFrame)},g.prototype.calculateSpriteMatrix=function(t,e){var r=this.filterData.stack[this.filterData.index];return s.calculateSpriteMatrix(t,r.sourceFrame,r.renderTarget.size,e)},g.prototype.destroy=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.renderer,r=this.managedFilters;e.off("prerender",this.onPrerender,this);for(var i=0;i<r.length;i++)t||r[i].glShaders[e.CONTEXT_UID].destroy(),delete r[i].glShaders[e.CONTEXT_UID];this.shaderCache={},t?this.pool={}:this.emptyPool()},g.prototype.getPotRenderTarget=function(t,e,r,i){var n=v;r*=i,(e*=i)===this._screenWidth&&r===this._screenHeight||(n=(65535&(e=h.default.nextPow2(e)))<<16|65535&(r=h.default.nextPow2(r))),this.pool[n]||(this.pool[n]=[]);var o=this.pool[n].pop();if(!o){var s=this.renderer.boundTextures[0];t.activeTexture(t.TEXTURE0),o=new a.default(t,e,r,null,1),t.bindTexture(t.TEXTURE_2D,s._glTextures[this.renderer.CONTEXT_UID].texture)}return o.resolution=i,o.defaultFrame.width=o.size.width=e/i,o.defaultFrame.height=o.size.height=r/i,o.filterPoolKey=n,o},g.prototype.emptyPool=function(){for(var t in this.pool){var e=this.pool[t];if(e)for(var r=0;r<e.length;r++)e[r].destroy(!0)}this.pool={}},g.prototype.freePotRenderTarget=function(t){this.pool[t.filterPoolKey].push(t)},g.prototype.onPrerender=function(){if(this._screenWidth!==this.renderer.view.width||this._screenHeight!==this.renderer.view.height){this._screenWidth=this.renderer.view.width,this._screenHeight=this.renderer.view.height;var t=this.pool[v];if(t)for(var e=0;e<t.length;e++)t[e].destroy(!0);this.pool[v]=[]}},g);function g(t){c(this,g);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,d.call(this,t));return e.gl=e.renderer.gl,e.quad=new n.default(e.gl,t.state.attribState),e.shaderCache={},e.pool={},e.filterData=null,e.managedFilters=[],e.renderer.on("prerender",e.onPrerender,e),e._screenWidth=t.view.width,e._screenHeight=t.view.height,e}r.default=y},{"../../../Shader":58,"../../../math":84,"../filters/filterTransforms":102,"../utils/Quad":109,"../utils/RenderTarget":110,"./WebGLManager":107,"bit-twiddle":4}],105:[function(t,e,r){"use strict";r.__esModule=!0;var i=o(t("./WebGLManager")),n=o(t("../filters/spriteMask/SpriteMaskFilter"));function o(t){return t&&t.__esModule?t:{default:t}}var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=i.default),u.prototype.pushMask=function(t,e){if(e.texture)this.pushSpriteMask(t,e);else if(this.enableScissor&&!this.scissor&&this.renderer._activeRenderTarget.root&&!this.renderer.stencilManager.stencilMaskStack.length&&e.isFastRect()){var r=e.worldTransform,i=Math.atan2(r.b,r.a);(i=Math.round(i*(180/Math.PI)))%90?this.pushStencilMask(e):this.pushScissorMask(t,e)}else this.pushStencilMask(e)},u.prototype.popMask=function(t,e){e.texture?this.popSpriteMask(t,e):this.enableScissor&&!this.renderer.stencilManager.stencilMaskStack.length?this.popScissorMask(t,e):this.popStencilMask(t,e)},u.prototype.pushSpriteMask=function(t,e){var r=this.alphaMaskPool[this.alphaMaskIndex];r||(r=this.alphaMaskPool[this.alphaMaskIndex]=[new n.default(e)]),r[0].resolution=this.renderer.resolution,r[0].maskSprite=e;var i=t.filterArea;t.filterArea=e.getBounds(!0),this.renderer.filterManager.pushFilter(t,r),t.filterArea=i,this.alphaMaskIndex++},u.prototype.popSpriteMask=function(){this.renderer.filterManager.popFilter(),this.alphaMaskIndex--},u.prototype.pushStencilMask=function(t){this.renderer.currentRenderer.stop(),this.renderer.stencilManager.pushStencil(t)},u.prototype.popStencilMask=function(){this.renderer.currentRenderer.stop(),this.renderer.stencilManager.popStencil()},u.prototype.pushScissorMask=function(t,e){e.renderable=!0;var r=this.renderer._activeRenderTarget,i=e.getBounds();i.fit(r.size),e.renderable=!1,this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST);var n=this.renderer.resolution;this.renderer.gl.scissor(i.x*n,(r.root?r.size.height-i.y-i.height:i.y)*n,i.width*n,i.height*n),this.scissorRenderTarget=r,this.scissorData=e,this.scissor=!0},u.prototype.popScissorMask=function(){this.scissorRenderTarget=null,this.scissorData=null,this.scissor=!1;var t=this.renderer.gl;t.disable(t.SCISSOR_TEST)},u);function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,t));return e.scissor=!1,e.scissorData=null,e.scissorRenderTarget=null,e.enableScissor=!0,e.alphaMaskPool=[],e.alphaMaskIndex=0,e}r.default=a},{"../filters/spriteMask/SpriteMaskFilter":103,"./WebGLManager":107}],106:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("./WebGLManager"),o=(i=n)&&i.__esModule?i:{default:i};var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.default),u.prototype.setMaskStack=function(t){this.stencilMaskStack=t;var e=this.renderer.gl;0===t.length?e.disable(e.STENCIL_TEST):e.enable(e.STENCIL_TEST)},u.prototype.pushStencil=function(t){this.renderer.setObjectRenderer(this.renderer.plugins.graphics),this.renderer._activeRenderTarget.attachStencilBuffer();var e=this.renderer.gl,r=this.stencilMaskStack.length;0===r&&e.enable(e.STENCIL_TEST),this.stencilMaskStack.push(t),e.colorMask(!1,!1,!1,!1),e.stencilFunc(e.EQUAL,r,this._getBitwiseMask()),e.stencilOp(e.KEEP,e.KEEP,e.INCR),this.renderer.plugins.graphics.render(t),this._useCurrent()},u.prototype.popStencil=function(){this.renderer.setObjectRenderer(this.renderer.plugins.graphics);var t=this.renderer.gl,e=this.stencilMaskStack.pop();0===this.stencilMaskStack.length?(t.disable(t.STENCIL_TEST),t.clear(t.STENCIL_BUFFER_BIT),t.clearStencil(0)):(t.colorMask(!1,!1,!1,!1),t.stencilOp(t.KEEP,t.KEEP,t.DECR),this.renderer.plugins.graphics.render(e),this._useCurrent())},u.prototype._useCurrent=function(){var t=this.renderer.gl;t.colorMask(!0,!0,!0,!0),t.stencilFunc(t.EQUAL,this.stencilMaskStack.length,this._getBitwiseMask()),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)},u.prototype._getBitwiseMask=function(){return(1<<this.stencilMaskStack.length)-1},u.prototype.destroy=function(){o.default.prototype.destroy.call(this),this.stencilMaskStack.stencilStack=null},u);function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,t));return e.stencilMaskStack=null,e}r.default=a},{"./WebGLManager":107}],107:[function(t,e,r){"use strict";r.__esModule=!0;var i=(n.prototype.onContextChange=function(){},n.prototype.destroy=function(){this.renderer.off("context",this.onContextChange,this),this.renderer=null},n);function n(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.renderer=t,this.renderer.on("context",this.onContextChange,this)}r.default=i},{}],108:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("../managers/WebGLManager"),o=(i=n)&&i.__esModule?i:{default:i};var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.default),u.prototype.start=function(){},u.prototype.stop=function(){this.flush()},u.prototype.flush=function(){},u.prototype.render=function(t){},u);function u(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.apply(this,arguments))}r.default=a},{"../managers/WebGLManager":107}],109:[function(t,e,r){"use strict";r.__esModule=!0;var i=o(t("pixi-gl-core")),n=o(t("../../../utils/createIndicesForQuads"));function o(t){return t&&t.__esModule?t:{default:t}}var s=(a.prototype.initVao=function(t){this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer,t.attributes.aVertexPosition,this.gl.FLOAT,!1,16,0).addAttribute(this.vertexBuffer,t.attributes.aTextureCoord,this.gl.FLOAT,!1,16,8)},a.prototype.map=function(t,e){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this},a.prototype.upload=function(){for(var t=0;t<4;t++)this.interleaved[4*t]=this.vertices[2*t],this.interleaved[4*t+1]=this.vertices[2*t+1],this.interleaved[4*t+2]=this.uvs[2*t],this.interleaved[4*t+3]=this.uvs[2*t+1];return this.vertexBuffer.upload(this.interleaved),this},a.prototype.destroy=function(){var t=this.gl;t.deleteBuffer(this.vertexBuffer),t.deleteBuffer(this.indexBuffer)},a);function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.gl=t,this.vertices=new Float32Array([-1,-1,1,-1,1,1,-1,1]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.interleaved=new Float32Array(16);for(var r=0;r<4;r++)this.interleaved[4*r]=this.vertices[2*r],this.interleaved[4*r+1]=this.vertices[2*r+1],this.interleaved[4*r+2]=this.uvs[2*r],this.interleaved[4*r+3]=this.uvs[2*r+1];this.indices=(0,n.default)(1),this.vertexBuffer=i.default.GLBuffer.createVertexBuffer(t,this.interleaved,t.STATIC_DRAW),this.indexBuffer=i.default.GLBuffer.createIndexBuffer(t,this.indices,t.STATIC_DRAW),this.vao=new i.default.VertexArrayObject(t,e)}r.default=s},{"../../../utils/createIndicesForQuads":137,"pixi-gl-core":29}],110:[function(t,e,r){"use strict";r.__esModule=!0;var i,s=t("../../../math"),a=t("../../../const"),n=t("../../../settings"),u=(i=n)&&i.__esModule?i:{default:i},h=t("pixi-gl-core");var o=(l.prototype.clear=function(t){var e=t||this.clearColor;this.frameBuffer.clear(e[0],e[1],e[2],e[3])},l.prototype.attachStencilBuffer=function(){this.root||this.frameBuffer.enableStencil()},l.prototype.setFrame=function(t,e){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||this.destinationFrame},l.prototype.activate=function(){var t=this.gl;this.frameBuffer.bind(),this.calculateProjection(this.destinationFrame,this.sourceFrame),this.transform&&this.projectionMatrix.append(this.transform),this.destinationFrame!==this.sourceFrame?(t.enable(t.SCISSOR_TEST),t.scissor(0|this.destinationFrame.x,0|this.destinationFrame.y,this.destinationFrame.width*this.resolution|0,this.destinationFrame.height*this.resolution|0)):t.disable(t.SCISSOR_TEST),t.viewport(0|this.destinationFrame.x,0|this.destinationFrame.y,this.destinationFrame.width*this.resolution|0,this.destinationFrame.height*this.resolution|0)},l.prototype.calculateProjection=function(t,e){var r=this.projectionMatrix;e=e||t,r.identity(),this.root?(r.a=1/t.width*2,r.d=-1/t.height*2,r.tx=-1-e.x*r.a,r.ty=1-e.y*r.d):(r.a=1/t.width*2,r.d=1/t.height*2,r.tx=-1-e.x*r.a,r.ty=-1-e.y*r.d)},l.prototype.resize=function(t,e){if(t|=0,e|=0,this.size.width!==t||this.size.height!==e){this.size.width=t,this.size.height=e,this.defaultFrame.width=t,this.defaultFrame.height=e,this.frameBuffer.resize(t*this.resolution,e*this.resolution);var r=this.frame||this.size;this.calculateProjection(r)}},l.prototype.destroy=function(){this.frameBuffer.stencil&&this.gl.deleteRenderbuffer(this.frameBuffer.stencil),this.frameBuffer.destroy(),this.frameBuffer=null,this.texture=null},l);function l(t,e,r,i,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this.gl=t,this.frameBuffer=null,this.texture=null,this.clearColor=[0,0,0,0],this.size=new s.Rectangle(0,0,1,1),this.resolution=n||u.default.RESOLUTION,this.projectionMatrix=new s.Matrix,this.transform=null,this.frame=null,this.defaultFrame=new s.Rectangle,this.destinationFrame=null,this.sourceFrame=null,this.stencilBuffer=null,this.stencilMaskStack=[],this.filterData=null,this.filterPoolKey="",this.scaleMode=void 0!==i?i:u.default.SCALE_MODE,this.root=o||!1,this.root?(this.frameBuffer=new h.GLFramebuffer(t,100,100),this.frameBuffer.framebuffer=null):(this.frameBuffer=h.GLFramebuffer.createRGBA(t,100,100),this.scaleMode===a.SCALE_MODES.NEAREST?this.frameBuffer.texture.enableNearestScaling():this.frameBuffer.texture.enableLinearScaling(),this.texture=this.frameBuffer.texture),this.setFrame(),this.resize(e,r)}r.default=o},{"../../../const":60,"../../../math":84,"../../../settings":115,"pixi-gl-core":29}],111:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e){var r=!e;if(0===t)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");if(r){var i=document.createElement("canvas");i.width=1,i.height=1,e=s.default.createContext(i)}var n=e.createShader(e.FRAGMENT_SHADER);for(;;){var o=a.replace(/%forloop%/gi,u(t));if(e.shaderSource(n,o),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS))break;t=t/2|0}r&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").loseContext();return t};var i,n=t("pixi-gl-core"),s=(i=n)&&i.__esModule?i:{default:i};var a=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");function u(t){for(var e="",r=0;r<t;++r)0<r&&(e+="\nelse "),r<t-1&&(e+="if(test == "+r+".0){}");return e}},{"pixi-gl-core":29}],112:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return e[i.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.ADD]=[t.ONE,t.DST_ALPHA],e[i.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR],e[i.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.NORMAL_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA],e[i.BLEND_MODES.ADD_NPM]=[t.SRC_ALPHA,t.DST_ALPHA,t.ONE,t.DST_ALPHA],e[i.BLEND_MODES.SCREEN_NPM]=[t.SRC_ALPHA,t.ONE_MINUS_SRC_COLOR,t.ONE,t.ONE_MINUS_SRC_COLOR],e};var i=t("../../../const")},{"../../../const":60}],113:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return e[i.DRAW_MODES.POINTS]=t.POINTS,e[i.DRAW_MODES.LINES]=t.LINES,e[i.DRAW_MODES.LINE_LOOP]=t.LINE_LOOP,e[i.DRAW_MODES.LINE_STRIP]=t.LINE_STRIP,e[i.DRAW_MODES.TRIANGLES]=t.TRIANGLES,e[i.DRAW_MODES.TRIANGLE_STRIP]=t.TRIANGLE_STRIP,e[i.DRAW_MODES.TRIANGLE_FAN]=t.TRIANGLE_FAN,e};var i=t("../../../const")},{"../../../const":60}],114:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){t.getContextAttributes().stencil||console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly")}},{}],115:[function(t,e,r){"use strict";r.__esModule=!0;var i=o(t("./utils/maxRecommendedTextures")),n=o(t("./utils/canUploadSameBuffer"));function o(t){return t&&t.__esModule?t:{default:t}}r.default={TARGET_FPMS:.06,MIPMAP_TEXTURES:!0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:(0,i.default)(32),SPRITE_BATCH_SIZE:4096,RETINA_PREFIX:/@([0-9\.]+)x/,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoResize:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,roundPixels:!1,width:800,height:600,legacy:!1},TRANSFORM_MODE:0,GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:0,SCALE_MODE:0,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:"mediump",CAN_UPLOAD_SAME_BUFFER:(0,n.default)(),MESH_CANVAS_PADDING:0}},{"./utils/canUploadSameBuffer":136,"./utils/maxRecommendedTextures":141}],116:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("../math"),s=t("../utils"),a=t("../const"),u=l(t("../textures/Texture")),h=l(t("../display/Container"));function l(t){return t&&t.__esModule?t:{default:t}}var c,f=new o.Point,d=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(p,c=h.default),p.prototype._onTextureUpdate=function(){this._textureID=-1,this._textureTrimmedID=-1,this.cachedTint=16777215,this._width&&(this.scale.x=(0,s.sign)(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=(0,s.sign)(this.scale.y)*this._height/this._texture.orig.height)},p.prototype._onAnchorUpdate=function(){this._transformID=-1,this._transformTrimmedID=-1},p.prototype.calculateVertices=function(){if(this._transformID!==this.transform._worldID||this._textureID!==this._texture._updateID){this._transformID=this.transform._worldID,this._textureID=this._texture._updateID;var t=this._texture,e=this.transform.worldTransform,r=e.a,i=e.b,n=e.c,o=e.d,s=e.tx,a=e.ty,u=this.vertexData,h=t.trim,l=t.orig,c=this._anchor,f=0,d=0,p=0,v=0;p=h?(f=(d=h.x-c._x*l.width)+h.width,(v=h.y-c._y*l.height)+h.height):(f=(d=-c._x*l.width)+l.width,(v=-c._y*l.height)+l.height),u[0]=r*d+n*v+s,u[1]=o*v+i*d+a,u[2]=r*f+n*v+s,u[3]=o*v+i*f+a,u[4]=r*f+n*p+s,u[5]=o*p+i*f+a,u[6]=r*d+n*p+s,u[7]=o*p+i*d+a}},p.prototype.calculateTrimmedVertices=function(){if(this.vertexTrimmedData){if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return}else this.vertexTrimmedData=new Float32Array(8);this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;var t=this._texture,e=this.vertexTrimmedData,r=t.orig,i=this._anchor,n=this.transform.worldTransform,o=n.a,s=n.b,a=n.c,u=n.d,h=n.tx,l=n.ty,c=-i._x*r.width,f=c+r.width,d=-i._y*r.height,p=d+r.height;e[0]=o*c+a*d+h,e[1]=u*d+s*c+l,e[2]=o*f+a*d+h,e[3]=u*d+s*f+l,e[4]=o*f+a*p+h,e[5]=u*p+s*f+l,e[6]=o*c+a*p+h,e[7]=u*p+s*c+l},p.prototype._renderWebGL=function(t){this.calculateVertices(),t.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},p.prototype._renderCanvas=function(t){t.plugins[this.pluginName].render(this)},p.prototype._calculateBounds=function(){var t=this._texture.trim,e=this._texture.orig;!t||t.width===e.width&&t.height===e.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))},p.prototype.getLocalBounds=function(t){return 0===this.children.length?(this._bounds.minX=this._texture.orig.width*-this._anchor._x,this._bounds.minY=this._texture.orig.height*-this._anchor._y,this._bounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._bounds.maxY=this._texture.orig.height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new o.Rectangle),t=this._localBoundsRect),this._bounds.getRectangle(t)):c.prototype.getLocalBounds.call(this,t)},p.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,f);var e=this._texture.orig.width,r=this._texture.orig.height,i=-e*this.anchor.x,n=0;return f.x>=i&&f.x<i+e&&(n=-r*this.anchor.y,f.y>=n&&f.y<n+r)},p.prototype.destroy=function(t){if(c.prototype.destroy.call(this,t),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,"boolean"==typeof t?t:t&&t.texture){var e="boolean"==typeof t?t:t&&t.baseTexture;this._texture.destroy(!!e)}this._texture=null,this.shader=null},p.from=function(t){return new p(u.default.from(t))},p.fromFrame=function(t){var e=s.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return new p(e)},p.fromImage=function(t,e,r){return new p(u.default.fromImage(t,e,r))},i(p,[{key:"width",get:function(){return Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){var e=(0,s.sign)(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}},{key:"height",get:function(){return Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){var e=(0,s.sign)(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}},{key:"anchor",get:function(){return this._anchor},set:function(t){this._anchor.copy(t)}},{key:"tint",get:function(){return this._tint},set:function(t){this._tint=t,this._tintRGB=(t>>16)+(65280&t)+((255&t)<<16)}},{key:"texture",get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}]),p);function p(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,c.call(this));return e._anchor=new o.ObservablePoint(e._onAnchorUpdate,e,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),e._texture=null,e._width=0,e._height=0,e._tint=null,e._tintRGB=null,e.tint=16777215,e.blendMode=a.BLEND_MODES.NORMAL,e.shader=null,e.cachedTint=16777215,e.texture=t||u.default.EMPTY,e.vertexData=new Float32Array(8),e.vertexTrimmedData=null,e._transformID=-1,e._textureID=-1,e._transformTrimmedID=-1,e._textureTrimmedID=-1,e.pluginName="sprite",e}r.default=d},{"../const":60,"../display/Container":62,"../math":84,"../textures/Texture":129,"../utils":139}],117:[function(t,e,r){"use strict";r.__esModule=!0;var i=n(t("../../renderers/canvas/CanvasRenderer")),l=t("../../const"),c=t("../../math"),f=n(t("./CanvasTinter"));function n(t){return t&&t.__esModule?t:{default:t}}var d=new c.Matrix,o=(s.prototype.render=function(t){var e=t._texture,r=this.renderer,i=e._frame.width,n=e._frame.height,o=t.transform.worldTransform,s=0,a=0;if(!(e.orig.width<=0||e.orig.height<=0)&&e.baseTexture.source&&(r.setBlendMode(t.blendMode),e.valid)){r.context.globalAlpha=t.worldAlpha;var u=e.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==u&&(r.context[r.smoothProperty]=u),a=e.trim?(s=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(s=(.5-t.anchor.x)*e.orig.width,(.5-t.anchor.y)*e.orig.height),e.rotate&&(o.copy(d),o=d,c.GroupD8.matrixAppendRotationInv(o,e.rotate,s,a),a=s=0),s-=i/2,a-=n/2,r.roundPixels?(r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution|0,o.ty*r.resolution|0),s|=0,a|=0):r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution,o.ty*r.resolution);var h=e.baseTexture.resolution;16777215!==t.tint?(t.cachedTint===t.tint&&t.tintedTexture.tintId===t._texture._updateID||(t.cachedTint=t.tint,t.tintedTexture=f.default.getTintedTexture(t,t.tint)),r.context.drawImage(t.tintedTexture,0,0,i*h,n*h,s*r.resolution,a*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(e.baseTexture.source,e._frame.x*h,e._frame.y*h,i*h,n*h,s*r.resolution,a*r.resolution,i*r.resolution,n*r.resolution)}},s.prototype.destroy=function(){this.renderer=null},s);function s(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this.renderer=t}r.default=o,i.default.registerPlugin("sprite",o)},{"../../const":60,"../../math":84,"../../renderers/canvas/CanvasRenderer":91,"./CanvasTinter":118}],118:[function(t,e,r){"use strict";r.__esModule=!0;var i,d=t("../../utils"),n=t("../../renderers/canvas/utils/canUseNewCanvasBlendModes");var a={getTintedTexture:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=a.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n=r.tintCache[i],o=void 0;if(n){if(n.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=a.canvas||document.createElement("canvas");if(a.tintMethod(r,e,o),o.tintId=r._updateID,a.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=o,a.canvas=null;return o},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=(0,d.hex2rgb)(e),a=s[0],u=s[1],h=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,f=0;f<c.length;f+=4)c[f+0]*=a,c[f+1]*=u,c[f+2]*=h;i.putImageData(l,0,0)},roundColor:function(t){var e=a.cacheStepsPerColorChannel,r=(0,d.hex2rgb)(t);return r[0]=Math.min(255,r[0]/e*e),r[1]=Math.min(255,r[1]/e*e),r[2]=Math.min(255,r[2]/e*e),(0,d.rgb2hex)(r)},cacheStepsPerColorChannel:8,convertTintToImage:!1,canUseMultiply:(0,((i=n)&&i.__esModule?i:{default:i}).default)(),tintMethod:0};a.tintMethod=a.canUseMultiply?a.tintWithMultiply:a.tintWithPerPixel,r.default=a},{"../../renderers/canvas/utils/canUseNewCanvasBlendModes":94,"../../utils":139}],119:[function(t,e,r){"use strict";r.__esModule=!0;var i=(n.prototype.destroy=function(){this.vertices=null,this.positions=null,this.uvs=null,this.colors=null},n);function n(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.vertices=new ArrayBuffer(t),this.float32View=new Float32Array(this.vertices),this.uint32View=new Uint32Array(this.vertices)}r.default=i},{}],120:[function(t,e,r){"use strict";r.__esModule=!0;var i=h(t("../../renderers/webgl/utils/ObjectRenderer")),n=h(t("../../renderers/webgl/WebGLRenderer")),o=h(t("../../utils/createIndicesForQuads")),s=h(t("./generateMultiTextureShader")),a=h(t("../../renderers/webgl/utils/checkMaxIfStatmentsInShader")),u=h(t("./BatchBuffer")),N=h(t("../../settings")),B=t("../../utils"),F=h(t("pixi-gl-core")),U=h(t("bit-twiddle"));function h(t){return t&&t.__esModule?t:{default:t}}var l,W=0,H=0,c=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(f,l=i.default),f.prototype.onContextChange=function(){var t=this.renderer.gl;this.renderer.legacy?this.MAX_TEXTURES=1:(this.MAX_TEXTURES=Math.min(t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),N.default.SPRITE_MAX_TEXTURES),this.MAX_TEXTURES=(0,a.default)(this.MAX_TEXTURES,t)),this.shader=(0,s.default)(t,this.MAX_TEXTURES),this.indexBuffer=F.default.GLBuffer.createIndexBuffer(t,this.indices,t.STATIC_DRAW),this.renderer.bindVao(null);for(var e=this.shader.attributes,r=0;r<this.vaoMax;r++){var i=this.vertexBuffers[r]=F.default.GLBuffer.createVertexBuffer(t,null,t.STREAM_DRAW),n=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(i,e.aVertexPosition,t.FLOAT,!1,this.vertByteSize,0).addAttribute(i,e.aTextureCoord,t.UNSIGNED_SHORT,!0,this.vertByteSize,8).addAttribute(i,e.aColor,t.UNSIGNED_BYTE,!0,this.vertByteSize,12);e.aTextureId&&n.addAttribute(i,e.aTextureId,t.FLOAT,!1,this.vertByteSize,16),this.vaos[r]=n}this.vao=this.vaos[0],this.currentBlendMode=99999,this.boundTextures=new Array(this.MAX_TEXTURES)},f.prototype.onPrerender=function(){this.vertexCount=0},f.prototype.render=function(t){this.currentIndex>=this.size&&this.flush(),t._texture._uvs&&(this.sprites[this.currentIndex++]=t)},f.prototype.flush=function(){if(0!==this.currentIndex){var t=this.renderer.gl,e=this.MAX_TEXTURES,r=U.default.nextPow2(this.currentIndex),i=U.default.log2(r),n=this.buffers[i],o=this.sprites,s=this.groups,a=n.float32View,u=n.uint32View,h=this.boundTextures,l=this.renderer.boundTextures,c=this.renderer.textureGC.count,f=0,d=void 0,p=void 0,v=1,y=0,g=s[0],m=void 0,b=void 0,_=B.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];g.textureCount=0,g.start=0,g.blend=_,W++;var x=void 0;for(x=0;x<e;++x){var w=l[x];w._enabled!==W?((h[x]=w)._virtalBoundId=x,w._enabled=W):h[x]=this.renderer.emptyTextures[x]}for(W++,x=0;x<this.currentIndex;++x){var T=o[x];o[x]=null,d=T._texture.baseTexture;var E=B.premultiplyBlendMode[Number(d.premultipliedAlpha)][T.blendMode];if(_!==E&&(_=E,p=null,y=e,W++),p!==d&&(p=d)._enabled!==W){if(y===e&&(W++,g.size=x-g.start,y=0,(g=s[v++]).blend=_,g.textureCount=0,g.start=x),d.touched=c,-1===d._virtalBoundId)for(var O=0;O<e;++O){var S=(O+H)%e,M=h[S];if(M._enabled!==W){H++,M._virtalBoundId=-1,h[d._virtalBoundId=S]=d;break}}d._enabled=W,g.textureCount++,g.ids[y]=d._virtalBoundId,g.textures[y++]=d}if(m=T.vertexData,b=T._texture._uvs.uvsUint32,this.renderer.roundPixels){var P=this.renderer.resolution;a[f]=(m[0]*P|0)/P,a[f+1]=(m[1]*P|0)/P,a[f+5]=(m[2]*P|0)/P,a[f+6]=(m[3]*P|0)/P,a[f+10]=(m[4]*P|0)/P,a[f+11]=(m[5]*P|0)/P,a[f+15]=(m[6]*P|0)/P,a[f+16]=(m[7]*P|0)/P}else a[f]=m[0],a[f+1]=m[1],a[f+5]=m[2],a[f+6]=m[3],a[f+10]=m[4],a[f+11]=m[5],a[f+15]=m[6],a[f+16]=m[7];u[f+2]=b[0],u[f+7]=b[1],u[f+12]=b[2],u[f+17]=b[3];var C=Math.min(T.worldAlpha,1),A=C<1&&d.premultipliedAlpha?(0,B.premultiplyTint)(T._tintRGB,C):T._tintRGB+(255*C<<24);u[f+3]=u[f+8]=u[f+13]=u[f+18]=A,a[f+4]=a[f+9]=a[f+14]=a[f+19]=d._virtalBoundId,f+=20}if(g.size=x-g.start,N.default.CAN_UPLOAD_SAME_BUFFER)this.vertexBuffers[this.vertexCount].upload(n.vertices,0,!0);else{if(this.vaoMax<=this.vertexCount){this.vaoMax++;var R=this.shader.attributes,I=this.vertexBuffers[this.vertexCount]=F.default.GLBuffer.createVertexBuffer(t,null,t.STREAM_DRAW),D=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(I,R.aVertexPosition,t.FLOAT,!1,this.vertByteSize,0).addAttribute(I,R.aTextureCoord,t.UNSIGNED_SHORT,!0,this.vertByteSize,8).addAttribute(I,R.aColor,t.UNSIGNED_BYTE,!0,this.vertByteSize,12);R.aTextureId&&D.addAttribute(I,R.aTextureId,t.FLOAT,!1,this.vertByteSize,16),this.vaos[this.vertexCount]=D}this.renderer.bindVao(this.vaos[this.vertexCount]),this.vertexBuffers[this.vertexCount].upload(n.vertices,0,!1),this.vertexCount++}for(x=0;x<e;++x)l[x]._virtalBoundId=-1;for(x=0;x<v;++x){for(var k=s[x],L=k.textureCount,j=0;j<L;j++)p=k.textures[j],l[k.ids[j]]!==p&&this.renderer.bindTexture(p,k.ids[j],!0),p._virtalBoundId=-1;this.renderer.state.setBlendMode(k.blend),t.drawElements(t.TRIANGLES,6*k.size,t.UNSIGNED_SHORT,6*k.start*2)}this.currentIndex=0}},f.prototype.start=function(){this.renderer.bindShader(this.shader),N.default.CAN_UPLOAD_SAME_BUFFER&&(this.renderer.bindVao(this.vaos[this.vertexCount]),this.vertexBuffers[this.vertexCount].bind())},f.prototype.stop=function(){this.flush()},f.prototype.destroy=function(){for(var t=0;t<this.vaoMax;t++)this.vertexBuffers[t]&&this.vertexBuffers[t].destroy(),this.vaos[t]&&this.vaos[t].destroy();this.indexBuffer&&this.indexBuffer.destroy(),this.renderer.off("prerender",this.onPrerender,this),l.prototype.destroy.call(this),this.shader&&(this.shader.destroy(),this.shader=null),this.vertexBuffers=null,this.vaos=null,this.indexBuffer=null,this.indices=null,this.sprites=null;for(var e=0;e<this.buffers.length;++e)this.buffers[e].destroy()},f);function f(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,l.call(this,t));e.vertSize=5,e.vertByteSize=4*e.vertSize,e.size=N.default.SPRITE_BATCH_SIZE,e.buffers=[];for(var r=1;r<=U.default.nextPow2(e.size);r*=2)e.buffers.push(new u.default(4*r*e.vertByteSize));e.indices=(0,o.default)(e.size),e.shader=null,e.currentIndex=0,e.groups=[];for(var i=0;i<e.size;i++)e.groups[i]={textures:[],textureCount:0,ids:[],size:0,start:0,blend:0};return e.sprites=[],e.vertexBuffers=[],e.vaos=[],e.vaoMax=2,e.vertexCount=0,e.renderer.on("prerender",e.onPrerender,e),e}r.default=c,n.default.registerPlugin("sprite",c)},{"../../renderers/webgl/WebGLRenderer":98,"../../renderers/webgl/utils/ObjectRenderer":108,"../../renderers/webgl/utils/checkMaxIfStatmentsInShader":111,"../../settings":115,"../../utils":139,"../../utils/createIndicesForQuads":137,"./BatchBuffer":119,"./generateMultiTextureShader":121,"bit-twiddle":4,"pixi-gl-core":29}],121:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e){var r=a;r=(r=r.replace(/%count%/gi,e)).replace(/%forloop%/gi,function(t){var e="";e+="\n",e+="\n";for(var r=0;r<t;r++)0<r&&(e+="\nelse "),r<t-1&&(e+="if(vTextureId < "+r+".5)"),e+="\n{",e+="\n\tcolor = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"}(e));for(var i=new s.default(t,"precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor;\n}\n",r),n=[],o=0;o<e;o++)n[o]=o;return i.bind(),i.uniforms.uSamplers=n,i};var i,n=t("../../Shader"),s=(i=n)&&i.__esModule?i:{default:i};t("path");var a=["varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n")},{"../../Shader":58,path:224}],122:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=f(t("../sprites/Sprite")),s=f(t("../textures/Texture")),a=t("../math"),u=t("../utils"),v=t("../const"),h=f(t("../settings")),l=f(t("./TextStyle")),g=f(t("./TextMetrics")),c=f(t("../utils/trimCanvas"));function f(t){return t&&t.__esModule?t:{default:t}}var d,p={texture:!0,children:!1,baseTexture:!0},y=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(m,d=o.default),m.prototype.updateText=function(t){var e=this._style;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),this.dirty||!t){this._font=this._style.toFontString();var r=this.context,i=g.default.measureText(this._text,this._style,this._style.wordWrap,this.canvas),n=i.width,o=i.height,s=i.lines,a=i.lineHeight,u=i.lineWidths,h=i.maxLineWidth,l=i.fontProperties;this.canvas.width=Math.ceil((Math.max(1,n)+2*e.padding)*this.resolution),this.canvas.height=Math.ceil((Math.max(1,o)+2*e.padding)*this.resolution),r.scale(this.resolution,this.resolution),r.clearRect(0,0,this.canvas.width,this.canvas.height),r.font=this._font,r.strokeStyle=e.stroke,r.lineWidth=e.strokeThickness,r.textBaseline=e.textBaseline,r.lineJoin=e.lineJoin,r.miterLimit=e.miterLimit;var c=void 0,f=void 0;if(e.dropShadow){r.fillStyle=e.dropShadowColor,r.globalAlpha=e.dropShadowAlpha,r.shadowBlur=e.dropShadowBlur,0<e.dropShadowBlur&&(r.shadowColor=e.dropShadowColor);for(var d=Math.cos(e.dropShadowAngle)*e.dropShadowDistance,p=Math.sin(e.dropShadowAngle)*e.dropShadowDistance,v=0;v<s.length;v++)c=e.strokeThickness/2,f=e.strokeThickness/2+v*a+l.ascent,"right"===e.align?c+=h-u[v]:"center"===e.align&&(c+=(h-u[v])/2),e.fill&&(this.drawLetterSpacing(s[v],c+d+e.padding,f+p+e.padding),e.stroke&&e.strokeThickness&&(r.strokeStyle=e.dropShadowColor,this.drawLetterSpacing(s[v],c+d+e.padding,f+p+e.padding,!0),r.strokeStyle=e.stroke))}r.shadowBlur=0,r.globalAlpha=1,r.fillStyle=this._generateFillStyle(e,s);for(var y=0;y<s.length;y++)c=e.strokeThickness/2,f=e.strokeThickness/2+y*a+l.ascent,"right"===e.align?c+=h-u[y]:"center"===e.align&&(c+=(h-u[y])/2),e.stroke&&e.strokeThickness&&this.drawLetterSpacing(s[y],c+e.padding,f+e.padding,!0),e.fill&&this.drawLetterSpacing(s[y],c+e.padding,f+e.padding);this.updateTexture()}},m.prototype.drawLetterSpacing=function(t,e,r){var i=3<arguments.length&&void 0!==arguments[3]&&arguments[3],n=this._style.letterSpacing;if(0!==n)for(var o=String.prototype.split.call(t,""),s=e,a=0,u="";a<t.length;)u=o[a++],i?this.context.strokeText(u,s,r):this.context.fillText(u,s,r),s+=this.context.measureText(u).width+n;else i?this.context.strokeText(t,e,r):this.context.fillText(t,e,r)},m.prototype.updateTexture=function(){var t=this.canvas;if(this._style.trim){var e=(0,c.default)(t);e.data&&(t.width=e.width,t.height=e.height,this.context.putImageData(e.data,0,0))}var r=this._texture,i=this._style,n=i.trim?0:i.padding,o=r.baseTexture;o.hasLoaded=!0,o.resolution=this.resolution,o.realWidth=t.width,o.realHeight=t.height,o.width=t.width/this.resolution,o.height=t.height/this.resolution,r.trim.width=r._frame.width=t.width/this.resolution,r.trim.height=r._frame.height=t.height/this.resolution,r.trim.x=-n,r.trim.y=-n,r.orig.width=r._frame.width-2*n,r.orig.height=r._frame.height-2*n,this._onTextureUpdate(),o.emit("update",o),this.dirty=!1},m.prototype.renderWebGL=function(t){this.resolution!==t.resolution&&(this.resolution=t.resolution,this.dirty=!0),this.updateText(!0),d.prototype.renderWebGL.call(this,t)},m.prototype._renderCanvas=function(t){this.resolution!==t.resolution&&(this.resolution=t.resolution,this.dirty=!0),this.updateText(!0),d.prototype._renderCanvas.call(this,t)},m.prototype.getLocalBounds=function(t){return this.updateText(!0),d.prototype.getLocalBounds.call(this,t)},m.prototype._calculateBounds=function(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)},m.prototype._onStyleChange=function(){this.dirty=!0},m.prototype._generateFillStyle=function(t,e){if(!Array.isArray(t.fill))return t.fill;if(navigator.isCocoonJS)return t.fill[0];var r=void 0,i=void 0,n=void 0,o=void 0,s=this.canvas.width/this.resolution,a=this.canvas.height/this.resolution,u=t.fill.slice(),h=t.fillGradientStops.slice();if(!h.length)for(var l=u.length+1,c=1;c<l;++c)h.push(c/l);if(u.unshift(t.fill[0]),h.unshift(0),u.push(t.fill[t.fill.length-1]),h.push(1),t.fillGradientType===v.TEXT_GRADIENT.LINEAR_VERTICAL){r=this.context.createLinearGradient(s/2,0,s/2,a),i=(u.length+1)*e.length;for(var f=n=0;f<e.length;f++){n+=1;for(var d=0;d<u.length;d++)o="number"==typeof h[d]?h[d]/e.length+f/e.length:n/i,r.addColorStop(o,u[d]),n++}}else{r=this.context.createLinearGradient(0,a/2,s,a/2),i=u.length+1,n=1;for(var p=0;p<u.length;p++)o="number"==typeof h[p]?h[p]:n/i,r.addColorStop(o,u[p]),n++}return r},m.prototype.destroy=function(t){"boolean"==typeof t&&(t={children:t}),t=Object.assign({},p,t),d.prototype.destroy.call(this,t),this.context=null,this.canvas=null,this._style=null},i(m,[{key:"width",get:function(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width},set:function(t){this.updateText(!0);var e=(0,u.sign)(this.scale.x)||1;this.scale.x=e*t/this._texture.orig.width,this._width=t}},{key:"height",get:function(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height},set:function(t){this.updateText(!0);var e=(0,u.sign)(this.scale.y)||1;this.scale.y=e*t/this._texture.orig.height,this._height=t}},{key:"style",get:function(){return this._style},set:function(t){(t=t||{})instanceof l.default?this._style=t:this._style=new l.default(t),this.localStyleID=-1,this.dirty=!0}},{key:"text",get:function(){return this._text},set:function(t){t=String(""===t||null==t?" ":t),this._text!==t&&(this._text=t,this.dirty=!0)}}]),m);function m(t,e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,m),(r=r||document.createElement("canvas")).width=3,r.height=3;var i=s.default.fromCanvas(r,h.default.SCALE_MODE,"text");i.orig=new a.Rectangle,i.trim=new a.Rectangle;var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,d.call(this,i));return s.default.addToCache(n._texture,n._texture.baseTexture.textureCacheIds[0]),n.canvas=r,n.context=n.canvas.getContext("2d"),n.resolution=h.default.RESOLUTION,n._text=null,n._style=null,n._styleListener=null,n._font="",n.text=t,n.style=e,n.localStyleID=-1,n}r.default=y},{"../const":60,"../math":84,"../settings":115,"../sprites/Sprite":116,"../textures/Texture":129,"../utils":139,"../utils/trimCanvas":144,"./TextMetrics":123,"./TextStyle":124}],123:[function(t,e,r){"use strict";r.__esModule=!0;var i=(M.measureText=function(t,e,r){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:M._canvas;r=null==r?e.wordWrap:r;var n=e.toFontString(),o=M.measureFont(n),s=i.getContext("2d");s.font=n;for(var a=(r?M.wordWrap(t,e,i):t).split(/(?:\r\n|\r|\n)/),u=new Array(a.length),h=0,l=0;l<a.length;l++){var c=s.measureText(a[l]).width+(a[l].length-1)*e.letterSpacing;u[l]=c,h=Math.max(h,c)}var f=h+e.strokeThickness;e.dropShadow&&(f+=e.dropShadowDistance);var d=e.lineHeight||o.fontSize+e.strokeThickness,p=Math.max(d,o.fontSize+e.strokeThickness)+(a.length-1)*(d+e.leading);return e.dropShadow&&(p+=e.dropShadowDistance),new M(t,e,f,p,a,u,d+e.leading,h,o)},M.wordWrap=function(t,e){for(var r=(2<arguments.length&&void 0!==arguments[2]?arguments[2]:M._canvas).getContext("2d"),i=0,n="",o="",s={},a=e.letterSpacing,u=e.whiteSpace,h=M.collapseSpaces(u),l=M.collapseNewlines(u),c=!h,f=e.wordWrapWidth+a,d=M.tokenize(t),p=0;p<d.length;p++){var v=d[p];if(M.isNewline(v)){if(!l){o+=M.addLine(n),c=!h,n="",i=0;continue}v=" "}if(h){var y=M.isBreakingSpace(v),g=M.isBreakingSpace(n[n.length-1]);if(y&&g)continue}var m=M.getFromCache(v,a,s,r);if(f<m)if(""!==n&&(o+=M.addLine(n),n="",i=0),M.canBreakWords(v,e.breakWords))for(var b=v.split(""),_=0;_<b.length;_++){for(var x=b[_],w=1;b[_+w];){var T=b[_+w],E=x[x.length-1];if(M.canBreakChars(E,T,v,_,e.breakWords))break;x+=T,w++}_+=x.length-1;var O=M.getFromCache(x,a,s,r);f<O+i&&(o+=M.addLine(n),c=!1,n="",i=0),n+=x,i+=O}else{0<n.length&&(o+=M.addLine(n),n="",i=0);var S=p===d.length-1;o+=M.addLine(v,!S),c=!1,n="",i=0}else f<m+i&&(c=!1,o+=M.addLine(n),n="",i=0),(0<n.length||!M.isBreakingSpace(v)||c)&&(n+=v,i+=m)}return o+=M.addLine(n,!1)},M.addLine=function(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];return t=M.trimRight(t),t=e?t+"\n":t},M.getFromCache=function(t,e,r,i){var n=r[t];if(void 0===n){var o=t.length*e;n=i.measureText(t).width+o,r[t]=n}return n},M.collapseSpaces=function(t){return"normal"===t||"pre-line"===t},M.collapseNewlines=function(t){return"normal"===t},M.trimRight=function(t){if("string"!=typeof t)return"";for(var e=t.length-1;0<=e;e--){var r=t[e];if(!M.isBreakingSpace(r))break;t=t.slice(0,-1)}return t},M.isNewline=function(t){return"string"==typeof t&&0<=M._newlines.indexOf(t.charCodeAt(0))},M.isBreakingSpace=function(t){return"string"==typeof t&&0<=M._breakingSpaces.indexOf(t.charCodeAt(0))},M.tokenize=function(t){var e=[],r="";if("string"!=typeof t)return e;for(var i=0;i<t.length;i++){var n=t[i];M.isBreakingSpace(n)||M.isNewline(n)?(""!==r&&(e.push(r),r=""),e.push(n)):r+=n}return""!==r&&e.push(r),e},M.canBreakWords=function(t,e){return e},M.canBreakChars=function(t,e,r,i,n){return!0},M.measureFont=function(t){if(M._fonts[t])return M._fonts[t];var e={},r=M._canvas,i=M._context;i.font=t;var n=M.METRICS_STRING+M.BASELINE_SYMBOL,o=Math.ceil(i.measureText(n).width),s=Math.ceil(i.measureText(M.BASELINE_SYMBOL).width),a=2*s;s=s*M.BASELINE_MULTIPLIER|0,r.width=o,r.height=a,i.fillStyle="#f00",i.fillRect(0,0,o,a),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(n,0,s);var u=i.getImageData(0,0,o,a).data,h=u.length,l=4*o,c=0,f=0,d=!1;for(c=0;c<s;++c){for(var p=0;p<l;p+=4)if(255!==u[f+p]){d=!0;break}if(d)break;f+=l}for(e.ascent=s-c,f=h-l,d=!1,c=a;s<c;--c){for(var v=0;v<l;v+=4)if(255!==u[f+v]){d=!0;break}if(d)break;f-=l}return e.descent=c-s,e.fontSize=e.ascent+e.descent,M._fonts[t]=e},M.clearMetrics=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";t?delete M._fonts[t]:M._fonts={}},M);function M(t,e,r,i,n,o,s,a,u){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,M),this.text=t,this.style=e,this.width=r,this.height=i,this.lines=n,this.lineWidths=o,this.lineHeight=s,this.maxLineWidth=a,this.fontProperties=u}r.default=i;var n=document.createElement("canvas");n.width=n.height=10,i._canvas=n,i._context=n.getContext("2d"),i._fonts={},i.METRICS_STRING="|Éq",i.BASELINE_SYMBOL="M",i.BASELINE_MULTIPLIER=1.4,i._newlines=[10,13],i._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},{}],124:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("../const"),s=t("../utils");var a={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:o.TEXT_GRADIENT.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},u=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],h=(l.prototype.clone=function(){var t={};return d(t,this,a),new l(t)},l.prototype.reset=function(){d(this,a,a)},l.prototype.toFontString=function(){var t="number"==typeof this.fontSize?this.fontSize+"px":this.fontSize,e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(var r=e.length-1;0<=r;r--){var i=e[r].trim();!/([\"\'])[^\'\"]+\1/.test(i)&&u.indexOf(i)<0&&(i='"'+i+'"'),e[r]=i}return this.fontStyle+" "+this.fontVariant+" "+this.fontWeight+" "+t+" "+e.join(",")},i(l,[{key:"align",get:function(){return this._align},set:function(t){this._align!==t&&(this._align=t,this.styleID++)}},{key:"breakWords",get:function(){return this._breakWords},set:function(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}},{key:"dropShadow",get:function(){return this._dropShadow},set:function(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}},{key:"dropShadowAlpha",get:function(){return this._dropShadowAlpha},set:function(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}},{key:"dropShadowAngle",get:function(){return this._dropShadowAngle},set:function(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}},{key:"dropShadowBlur",get:function(){return this._dropShadowBlur},set:function(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}},{key:"dropShadowColor",get:function(){return this._dropShadowColor},set:function(t){var e=f(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}},{key:"dropShadowDistance",get:function(){return this._dropShadowDistance},set:function(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}},{key:"fill",get:function(){return this._fill},set:function(t){var e=f(t);this._fill!==e&&(this._fill=e,this.styleID++)}},{key:"fillGradientType",get:function(){return this._fillGradientType},set:function(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}},{key:"fillGradientStops",get:function(){return this._fillGradientStops},set:function(t){!function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(t[r]!==e[r])return!1;return!0}(this._fillGradientStops,t)&&(this._fillGradientStops=t,this.styleID++)}},{key:"fontFamily",get:function(){return this._fontFamily},set:function(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}},{key:"fontSize",get:function(){return this._fontSize},set:function(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}},{key:"fontStyle",get:function(){return this._fontStyle},set:function(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}},{key:"fontVariant",get:function(){return this._fontVariant},set:function(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}},{key:"fontWeight",get:function(){return this._fontWeight},set:function(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}},{key:"letterSpacing",get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}},{key:"lineHeight",get:function(){return this._lineHeight},set:function(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}},{key:"leading",get:function(){return this._leading},set:function(t){this._leading!==t&&(this._leading=t,this.styleID++)}},{key:"lineJoin",get:function(){return this._lineJoin},set:function(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}},{key:"miterLimit",get:function(){return this._miterLimit},set:function(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}},{key:"padding",get:function(){return this._padding},set:function(t){this._padding!==t&&(this._padding=t,this.styleID++)}},{key:"stroke",get:function(){return this._stroke},set:function(t){var e=f(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}},{key:"strokeThickness",get:function(){return this._strokeThickness},set:function(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}},{key:"textBaseline",get:function(){return this._textBaseline},set:function(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}},{key:"trim",get:function(){return this._trim},set:function(t){this._trim!==t&&(this._trim=t,this.styleID++)}},{key:"whiteSpace",get:function(){return this._whiteSpace},set:function(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}},{key:"wordWrap",get:function(){return this._wordWrap},set:function(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}},{key:"wordWrapWidth",get:function(){return this._wordWrapWidth},set:function(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}}]),l);function l(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this.styleID=0,this.reset(),d(this,t,t)}function c(t){return"number"==typeof t?(0,s.hex2string)(t):("string"==typeof t&&0===t.indexOf("0x")&&(t=t.replace("0x","#")),t)}function f(t){if(Array.isArray(t)){for(var e=0;e<t.length;++e)t[e]=c(t[e]);return t}return c(t)}function d(t,e,r){for(var i in r)Array.isArray(e[i])?t[i]=e[i].slice():t[i]=e[i]}r.default=h},{"../const":60,"../utils":139}],125:[function(t,e,r){"use strict";r.__esModule=!0;var i=n(t("./BaseTexture")),o=n(t("../settings"));function n(t){return t&&t.__esModule?t:{default:t}}var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=i.default),u.prototype.resize=function(t,e){t=Math.ceil(t),e=Math.ceil(e),t===this.width&&e===this.height||(this.valid=0<t&&0<e,this.width=t,this.height=e,this.realWidth=this.width*this.resolution,this.realHeight=this.height*this.resolution,this.valid&&this.emit("update",this))},u.prototype.destroy=function(){s.prototype.destroy.call(this,!0),this.renderer=null},u);function u(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:100,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100,r=arguments[2],i=arguments[3];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,null,r));return n.resolution=i||o.default.RESOLUTION,n.width=Math.ceil(t),n.height=Math.ceil(e),n.realWidth=n.width*n.resolution,n.realHeight=n.height*n.resolution,n.scaleMode=void 0!==r?r:o.default.SCALE_MODE,n.hasLoaded=!0,n._glRenderTargets={},n._canvasRenderTarget=null,n.valid=!1,n}r.default=a},{"../settings":115,"./BaseTexture":126}],126:[function(t,e,r){"use strict";r.__esModule=!0;var s=t("../utils"),n=u(t("../settings")),i=u(t("eventemitter3")),a=u(t("../utils/determineCrossOrigin")),o=u(t("bit-twiddle"));function u(t){return t&&t.__esModule?t:{default:t}}var h,l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,h=i.default),c.prototype.update=function(){"svg"!==this.imageType&&(this.realWidth=this.source.naturalWidth||this.source.videoWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.videoHeight||this.source.height,this._updateDimensions()),this.emit("update",this)},c.prototype._updateDimensions=function(){this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=o.default.isPow2(this.realWidth)&&o.default.isPow2(this.realHeight)},c.prototype.loadSource=function(t){var e=this.isLoading;this.hasLoaded=!1,this.isLoading=!1,e&&this.source&&(this.source.onload=null,this.source.onerror=null);var r=!this.source;if(((this.source=t).src&&t.complete||t.getContext)&&t.width&&t.height)this._updateImageType(),"svg"===this.imageType?this._loadSvgSource():this._sourceLoaded(),r&&this.emit("loaded",this);else if(!t.getContext){this.isLoading=!0;var i=this;if(t.onload=function(){i._updateImageType(),t.onload=null,t.onerror=null,i.isLoading&&(i.isLoading=!1,i._sourceLoaded(),"svg"!==i.imageType?i.emit("loaded",i):i._loadSvgSource())},t.onerror=function(){t.onload=null,t.onerror=null,i.isLoading&&(i.isLoading=!1,i.emit("error",i))},t.complete&&t.src){if(t.onload=null,t.onerror=null,"svg"===i.imageType)return void i._loadSvgSource();this.isLoading=!1,t.width&&t.height?(this._sourceLoaded(),e&&this.emit("loaded",this)):e&&this.emit("error",this)}}},c.prototype._updateImageType=function(){if(this.imageUrl){var t=(0,s.decomposeDataUri)(this.imageUrl),e=void 0;if(t&&"image"===t.mediaType){var r=t.subType.split("+")[0];if(!(e=(0,s.getUrlFileExtension)("."+r)))throw new Error("Invalid image type in data URI.")}else(e=(0,s.getUrlFileExtension)(this.imageUrl))||(e="png");this.imageType=e}},c.prototype._loadSvgSource=function(){if("svg"===this.imageType){var t=(0,s.decomposeDataUri)(this.imageUrl);t?this._loadSvgSourceUsingDataUri(t):this._loadSvgSourceUsingXhr()}},c.prototype._loadSvgSourceUsingDataUri=function(t){var e=void 0;if("base64"===t.encoding){if(!atob)throw new Error("Your browser doesn't support base64 conversions.");e=atob(t.data)}else e=t.data;this._loadSvgSourceUsingString(e)},c.prototype._loadSvgSourceUsingXhr=function(){var t=this,e=new XMLHttpRequest;e.onload=function(){if(e.readyState!==e.DONE||200!==e.status)throw new Error("Failed to load SVG using XHR.");t._loadSvgSourceUsingString(e.response)},e.onerror=function(){return t.emit("error",t)},e.open("GET",this.imageUrl,!0),e.send()},c.prototype._loadSvgSourceUsingString=function(t){var e=(0,s.getSvgSize)(t),r=e.width,i=e.height;if(!r||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");this.realWidth=Math.round(r*this.sourceScale),this.realHeight=Math.round(i*this.sourceScale),this._updateDimensions();var n=document.createElement("canvas");n.width=this.realWidth,n.height=this.realHeight,n._pixiId="canvas_"+(0,s.uid)(),n.getContext("2d").drawImage(this.source,0,0,r,i,0,0,this.realWidth,this.realHeight),this.origSource=this.source,this.source=n,c.addToCache(this,n._pixiId),this.isLoading=!1,this._sourceLoaded(),this.emit("loaded",this)},c.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.update()},c.prototype.destroy=function(){this.imageUrl&&(delete s.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")),this.source=null,this.dispose(),c.removeFromCache(this),this.textureCacheIds=null,this._destroyed=!0},c.prototype.dispose=function(){this.emit("dispose",this)},c.prototype.updateSourceImage=function(t){this.source.src=t,this.loadSource(this.source)},c.fromImage=function(t,e,r,i){var n=s.BaseTextureCache[t];if(!n){var o=new Image;void 0===e&&0!==t.indexOf("data:")?o.crossOrigin=(0,a.default)(t):e&&(o.crossOrigin="string"==typeof e?e:"anonymous"),(n=new c(o,r)).imageUrl=t,i&&(n.sourceScale=i),n.resolution=(0,s.getResolutionOfUrl)(t),o.src=t,c.addToCache(n,t)}return n},c.fromCanvas=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"canvas";t._pixiId||(t._pixiId=r+"_"+(0,s.uid)());var i=s.BaseTextureCache[t._pixiId];return i||(i=new c(t,e),c.addToCache(i,t._pixiId)),i},c.from=function(t,e,r){if("string"==typeof t)return c.fromImage(t,void 0,e,r);if(t instanceof HTMLImageElement){var i=t.src,n=s.BaseTextureCache[i];return n||((n=new c(t,e)).imageUrl=i,r&&(n.sourceScale=r),n.resolution=(0,s.getResolutionOfUrl)(i),c.addToCache(n,i)),n}return t instanceof HTMLCanvasElement?c.fromCanvas(t,e):t},c.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),s.BaseTextureCache[e]&&console.warn("BaseTexture added to the cache with an id ["+e+"] that already had an entry"),s.BaseTextureCache[e]=t)},c.removeFromCache=function(t){if("string"==typeof t){var e=s.BaseTextureCache[t];if(e){var r=e.textureCacheIds.indexOf(t);return-1<r&&e.textureCacheIds.splice(r,1),delete s.BaseTextureCache[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)delete s.BaseTextureCache[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},c);function c(t,e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,h.call(this));return i.uid=(0,s.uid)(),i.touched=0,i.resolution=r||n.default.RESOLUTION,i.width=100,i.height=100,i.realWidth=100,i.realHeight=100,i.scaleMode=void 0!==e?e:n.default.SCALE_MODE,i.hasLoaded=!1,i.isLoading=!1,i.source=null,i.origSource=null,i.imageType=null,i.sourceScale=1,i.premultipliedAlpha=!0,i.imageUrl=null,i.isPowerOfTwo=!1,i.mipmap=n.default.MIPMAP_TEXTURES,i.wrapMode=n.default.WRAP_MODE,i._glTextures={},i._enabled=0,i._virtalBoundId=-1,i._destroyed=!1,i.textureCacheIds=[],t&&i.loadSource(t),i}r.default=l},{"../settings":115,"../utils":139,"../utils/determineCrossOrigin":138,"bit-twiddle":4,eventemitter3:204}],127:[function(t,e,r){"use strict";r.__esModule=!0;var u=n(t("./BaseRenderTexture")),i=n(t("./Texture"));function n(t){return t&&t.__esModule?t:{default:t}}var h,o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,h=i.default),l.prototype.resize=function(t,e,r){t=Math.ceil(t),e=Math.ceil(e),this.valid=0<t&&0<e,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r||this.baseTexture.resize(t,e),this._updateUvs()},l.create=function(t,e,r,i){return new l(new u.default(t,e,r,i))},l);function l(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l);var r=null;if(!(t instanceof u.default)){var i=arguments[1],n=arguments[2],o=arguments[3],s=arguments[4];console.warn("Please use RenderTexture.create("+i+", "+n+") instead of the ctor directly."),r=arguments[0],e=null,t=new u.default(i,n,o,s)}var a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,h.call(this,t,e));return a.legacyRenderer=r,a.valid=!0,a._updateUvs(),a}r.default=o},{"./BaseRenderTexture":125,"./Texture":129}],128:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var c=t("../"),o=t("../utils");var s=(i(f,null,[{key:"BATCH_SIZE",get:function(){return 1e3}}]),f.prototype._updateResolution=function(t){var e=this.data.meta.scale,r=(0,o.getResolutionOfUrl)(t,null);return null===r&&(r=void 0!==e?parseFloat(e):1),1!==r&&(this.baseTexture.resolution=r,this.baseTexture.update()),r},f.prototype.parse=function(t){this._batchIndex=0,this._callback=t,this._frameKeys.length<=f.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()},f.prototype._processFrames=function(t){for(var e=t,r=f.BATCH_SIZE,i=this.baseTexture.sourceScale;e-t<r&&e<this._frameKeys.length;){var n=this._frameKeys[e],o=this._frames[n],s=o.frame;if(s){var a=null,u=null,h=!1!==o.trimmed&&o.sourceSize?o.sourceSize:o.frame,l=new c.Rectangle(0,0,Math.floor(h.w*i)/this.resolution,Math.floor(h.h*i)/this.resolution);a=o.rotated?new c.Rectangle(Math.floor(s.x*i)/this.resolution,Math.floor(s.y*i)/this.resolution,Math.floor(s.h*i)/this.resolution,Math.floor(s.w*i)/this.resolution):new c.Rectangle(Math.floor(s.x*i)/this.resolution,Math.floor(s.y*i)/this.resolution,Math.floor(s.w*i)/this.resolution,Math.floor(s.h*i)/this.resolution),!1!==o.trimmed&&o.spriteSourceSize&&(u=new c.Rectangle(Math.floor(o.spriteSourceSize.x*i)/this.resolution,Math.floor(o.spriteSourceSize.y*i)/this.resolution,Math.floor(s.w*i)/this.resolution,Math.floor(s.h*i)/this.resolution)),this.textures[n]=new c.Texture(this.baseTexture,a,l,u,o.rotated?2:0,o.anchor),c.Texture.addToCache(this.textures[n],n)}e++}},f.prototype._processAnimations=function(){var t=this.data.animations||{};for(var e in t){this.animations[e]=[];var r=t[e],i=Array.isArray(r),n=0;for(r=i?r:r[Symbol.iterator]();;){var o;if(i){if(n>=r.length)break;o=r[n++]}else{if((n=r.next()).done)break;o=n.value}var s=o;this.animations[e].push(this.textures[s])}}},f.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},f.prototype._nextBatch=function(){var t=this;this._processFrames(this._batchIndex*f.BATCH_SIZE),this._batchIndex++,setTimeout(function(){t._batchIndex*f.BATCH_SIZE<t._frameKeys.length?t._nextBatch():(t._processAnimations(),t._parseComplete())},0)},f.prototype.destroy=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];for(var e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&this.baseTexture.destroy(),this.baseTexture=null},f);function f(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),this.baseTexture=t,this.textures={},this.animations={},this.data=e,this.resolution=this._updateResolution(r||this.baseTexture.imageUrl),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}r.default=s},{"../":79,"../utils":139}],129:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=f(t("./BaseTexture")),s=f(t("./VideoBaseTexture")),a=f(t("./TextureUvs")),u=f(t("eventemitter3")),h=t("../math"),l=t("../utils"),c=f(t("../settings"));function f(t){return t&&t.__esModule?t:{default:t}}var d,p=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(v,d=u.default),v.prototype.update=function(){this.baseTexture.update()},v.prototype.onBaseTextureLoaded=function(t){this._updateID++,this.noFrame?this.frame=new h.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.baseTexture.on("update",this.onBaseTextureUpdated,this),this.emit("update",this)},v.prototype.onBaseTextureUpdated=function(t){this._updateID++,this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},v.prototype.destroy=function(t){this.baseTexture&&(t&&(l.TextureCache[this.baseTexture.imageUrl]&&v.removeFromCache(this.baseTexture.imageUrl),this.baseTexture.destroy()),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,v.removeFromCache(this),this.textureCacheIds=null},v.prototype.clone=function(){return new v(this.baseTexture,this.frame,this.orig,this.trim,this.rotate,this.defaultAnchor)},v.prototype._updateUvs=function(){this._uvs||(this._uvs=new a.default),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++},v.fromImage=function(t,e,r,i){var n=l.TextureCache[t];return n||(n=new v(o.default.fromImage(t,e,r,i)),v.addToCache(n,t)),n},v.fromFrame=function(t){var e=l.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},v.fromCanvas=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"canvas";return new v(o.default.fromCanvas(t,e,r))},v.fromVideo=function(t,e,r,i){return"string"==typeof t?v.fromVideoUrl(t,e,r,i):new v(s.default.fromVideo(t,e,i))},v.fromVideoUrl=function(t,e,r,i){return new v(s.default.fromUrl(t,e,r,i))},v.from=function(t){if("string"!=typeof t)return t instanceof HTMLImageElement?new v(o.default.from(t)):t instanceof HTMLCanvasElement?v.fromCanvas(t,c.default.SCALE_MODE,"HTMLCanvasElement"):t instanceof HTMLVideoElement?v.fromVideo(t):t instanceof o.default?new v(t):t;var e=l.TextureCache[t];return e||(null!==t.match(/\.(mp4|webm|ogg|h264|avi|mov)$/)?v.fromVideoUrl(t):v.fromImage(t))},v.fromLoader=function(t,e,r){var i=new o.default(t,void 0,(0,l.getResolutionOfUrl)(e)),n=new v(i);return i.imageUrl=e,r||(r=e),o.default.addToCache(n.baseTexture,r),v.addToCache(n,r),r!==e&&(o.default.addToCache(n.baseTexture,e),v.addToCache(n,e)),n},v.addToCache=function(t,e){e&&(-1===t.textureCacheIds.indexOf(e)&&t.textureCacheIds.push(e),l.TextureCache[e]&&console.warn("Texture added to the cache with an id ["+e+"] that already had an entry"),l.TextureCache[e]=t)},v.removeFromCache=function(t){if("string"==typeof t){var e=l.TextureCache[t];if(e){var r=e.textureCacheIds.indexOf(t);return-1<r&&e.textureCacheIds.splice(r,1),delete l.TextureCache[t],e}}else if(t&&t.textureCacheIds){for(var i=0;i<t.textureCacheIds.length;++i)l.TextureCache[t.textureCacheIds[i]]===t&&delete l.TextureCache[t.textureCacheIds[i]];return t.textureCacheIds.length=0,t}return null},i(v,[{key:"frame",get:function(){return this._frame},set:function(t){this._frame=t,this.noFrame=!1;var e=t.x,r=t.y,i=t.width,n=t.height,o=e+i>this.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",u="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,h="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+a+" "+h)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=t),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),v);function v(t,e,r,i,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,v);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,d.call(this));if(s.noFrame=!1,e||(s.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof v&&(t=t.baseTexture),s.baseTexture=t,s._frame=e,s.trim=i,s.valid=!1,s.requiresUpdate=!1,s._uvs=null,s.orig=r||e,s._rotate=Number(n||0),!0===n)s._rotate=2;else if(s._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return t.hasLoaded?(s.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",s.onBaseTextureUpdated,s)),s.frame=e):t.once("loaded",s.onBaseTextureLoaded,s),s.defaultAnchor=o?new h.Point(o.x,o.y):new h.Point(0,0),s._updateID=0,s.transform=null,s.textureCacheIds=[],s}function y(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}(r.default=p).EMPTY=new p(new o.default),y(p.EMPTY),y(p.EMPTY.baseTexture),p.WHITE=function(){var t=document.createElement("canvas");t.width=10,t.height=10;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,10,10),new p(new o.default(t))}(),y(p.WHITE),y(p.WHITE.baseTexture)},{"../math":84,"../settings":115,"../utils":139,"./BaseTexture":126,"./TextureUvs":131,"./VideoBaseTexture":132,eventemitter3:204}],130:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o,s=t("../math/Matrix"),a=(o=s)&&o.__esModule?o:{default:o};var h=new a.default,u=(l.prototype.multiplyUvs=function(t,e){void 0===e&&(e=t);for(var r=this.mapCoord,i=0;i<t.length;i+=2){var n=t[i],o=t[i+1];e[i]=n*r.a+o*r.c+r.tx,e[i+1]=n*r.b+o*r.d+r.ty}return e},l.prototype.update=function(t){var e=this._texture;if(!e||!e.valid)return!1;if(!t&&this._lastTextureID===e._updateID)return!1;this._lastTextureID=e._updateID;var r=e._uvs;this.mapCoord.set(r.x1-r.x0,r.y1-r.y0,r.x3-r.x0,r.y3-r.y0,r.x0,r.y0);var i=e.orig,n=e.trim;n&&(h.set(i.width/n.width,0,0,i.height/n.height,-n.x/n.width,-n.y/n.height),this.mapCoord.append(h));var o=e.baseTexture,s=this.uClampFrame,a=this.clampMargin/o.resolution,u=this.clampOffset;return s[0]=(e._frame.x+a+u)/o.width,s[1]=(e._frame.y+a+u)/o.height,s[2]=(e._frame.x+e._frame.width-a+u)/o.width,s[3]=(e._frame.y+e._frame.height-a+u)/o.height,this.uClampOffset[0]=u/o.realWidth,this.uClampOffset[1]=u/o.realHeight,!0},i(l,[{key:"texture",get:function(){return this._texture},set:function(t){this._texture=t,this._lastTextureID=-1}}]),l);function l(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this._texture=t,this.mapCoord=new a.default,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._lastTextureID=-1,this.clampOffset=0,this.clampMargin=void 0===e?.5:e}r.default=u},{"../math/Matrix":81}],131:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("../math/GroupD8"),h=(i=n)&&i.__esModule?i:{default:i};var o=(s.prototype.set=function(t,e,r){var i=e.width,n=e.height;if(r){var o=t.width/2/i,s=t.height/2/n,a=t.x/i+o,u=t.y/n+s;r=h.default.add(r,h.default.NW),this.x0=a+o*h.default.uX(r),this.y0=u+s*h.default.uY(r),r=h.default.add(r,2),this.x1=a+o*h.default.uX(r),this.y1=u+s*h.default.uY(r),r=h.default.add(r,2),this.x2=a+o*h.default.uX(r),this.y2=u+s*h.default.uY(r),r=h.default.add(r,2),this.x3=a+o*h.default.uX(r),this.y3=u+s*h.default.uY(r)}else this.x0=t.x/i,this.y0=t.y/n,this.x1=(t.x+t.width)/i,this.y1=t.y/n,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/n,this.x3=t.x/i,this.y3=(t.y+t.height)/n;this.uvsUint32[0]=(65535&Math.round(65535*this.y0))<<16|65535&Math.round(65535*this.x0),this.uvsUint32[1]=(65535&Math.round(65535*this.y1))<<16|65535&Math.round(65535*this.x1),this.uvsUint32[2]=(65535&Math.round(65535*this.y2))<<16|65535&Math.round(65535*this.x2),this.uvsUint32[3]=(65535&Math.round(65535*this.y3))<<16|65535&Math.round(65535*this.x3)},s);function s(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsUint32=new Uint32Array(4)}r.default=o},{"../math/GroupD8":80}],132:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=l(t("./BaseTexture")),s=t("../utils"),a=t("../ticker"),u=t("../const"),h=l(t("../utils/determineCrossOrigin"));function l(t){return t&&t.__esModule?t:{default:t}}var c,f=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(d,c=o.default),d.prototype._isSourcePlaying=function(){var t=this.source;return 0<t.currentTime&&!1===t.paused&&!1===t.ended&&2<t.readyState},d.prototype._isSourceReady=function(){return 3===this.source.readyState||4===this.source.readyState},d.prototype._onPlayStart=function(){this.hasLoaded||this._onCanPlay(),!this._isAutoUpdating&&this.autoUpdate&&(a.shared.add(this.update,this,u.UPDATE_PRIORITY.HIGH),this._isAutoUpdating=!0)},d.prototype._onPlayStop=function(){this._isAutoUpdating&&(a.shared.remove(this.update,this),this._isAutoUpdating=!1)},d.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.__loaded||(this.__loaded=!0,this.emit("loaded",this)),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.source.play())},d.prototype.destroy=function(){this._isAutoUpdating&&a.shared.remove(this.update,this),this.source&&this.source._pixiId&&(o.default.removeFromCache(this.source._pixiId),delete this.source._pixiId,this.source.pause(),this.source.src="",this.source.load()),c.prototype.destroy.call(this)},d.fromVideo=function(t,e,r){t._pixiId||(t._pixiId="video_"+(0,s.uid)());var i=s.BaseTextureCache[t._pixiId];return i||(i=new d(t,e,r),o.default.addToCache(i,t._pixiId)),i},d.fromUrl=function(t,e,r,i){var n=document.createElement("video");n.setAttribute("webkit-playsinline",""),n.setAttribute("playsinline","");var o=Array.isArray(t)?t[0].src||t[0]:t.src||t;if(void 0===r&&0!==o.indexOf("data:")?n.crossOrigin=(0,h.default)(o):r&&(n.crossOrigin="string"==typeof r?r:"anonymous"),Array.isArray(t))for(var s=0;s<t.length;++s)n.appendChild(p(t[s].src||t[s],t[s].mime));else n.appendChild(p(o,t.mime));return n.load(),d.fromVideo(n,e,i)},i(d,[{key:"autoUpdate",get:function(){return this._autoUpdate},set:function(t){t!==this._autoUpdate&&(this._autoUpdate=t,!this._autoUpdate&&this._isAutoUpdating?(a.shared.remove(this.update,this),this._isAutoUpdating=!1):this._autoUpdate&&!this._isAutoUpdating&&(a.shared.add(this.update,this,u.UPDATE_PRIORITY.HIGH),this._isAutoUpdating=!0))}}]),d);function d(t,e){var r=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,c.call(this,t,e));return i.width=t.videoWidth,i.height=t.videoHeight,i._autoUpdate=!0,i._isAutoUpdating=!1,i.autoPlay=r,i.update=i.update.bind(i),i._onCanPlay=i._onCanPlay.bind(i),t.addEventListener("play",i._onPlayStart.bind(i)),t.addEventListener("pause",i._onPlayStop.bind(i)),i.hasLoaded=!1,i.__loaded=!1,i._isSourceReady()?i._onCanPlay():(t.addEventListener("canplay",i._onCanPlay),t.addEventListener("canplaythrough",i._onCanPlay)),i}function p(t,e){if(!e){var r=t.split("?").shift().toLowerCase();e="video/"+r.substr(r.lastIndexOf(".")+1)}var i=document.createElement("source");return i.src=t,i.type=e,i}(r.default=f).fromUrls=f.fromUrl},{"../const":60,"../ticker":135,"../utils":139,"../utils/determineCrossOrigin":138,"./BaseTexture":126}],133:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=u(t("../settings")),s=t("../const"),a=u(t("./TickerListener"));function u(t){return t&&t.__esModule?t:{default:t}}var h=(l.prototype._requestIfNeeded=function(){null===this._requestId&&this._head.next&&(this.lastTime=performance.now(),this._requestId=requestAnimationFrame(this._tick))},l.prototype._cancelIfNeeded=function(){null!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=null)},l.prototype._startIfPossible=function(){this.started?this._requestIfNeeded():this.autoStart&&this.start()},l.prototype.add=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:s.UPDATE_PRIORITY.NORMAL;return this._addListener(new a.default(t,e,r))},l.prototype.addOnce=function(t,e){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:s.UPDATE_PRIORITY.NORMAL;return this._addListener(new a.default(t,e,r,!0))},l.prototype._addListener=function(t){var e=this._head.next,r=this._head;if(e){for(;e;){if(t.priority>e.priority){t.connect(r);break}e=(r=e).next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},l.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},l.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},l.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},l.prototype.destroy=function(){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null},l.prototype.update=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:performance.now(),e=void 0;if(t>this.lastTime){(e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*o.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=t},i(l,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(Math.max(0,t)/1e3,o.default.TARGET_FPMS);this._maxElapsedMS=1/e}}]),l);function l(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this._head=new a.default(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this.autoStart=!1,this.deltaTime=1,this.elapsedMS=1/o.default.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&null===e._requestId&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}r.default=h},{"../const":60,"../settings":115,"./TickerListener":134}],134:[function(t,e,r){"use strict";r.__esModule=!0;var i=(n.prototype.match=function(t,e){return e=e||null,this.fn===t&&this.context===e},n.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},n.prototype.connect=function(t){(this.previous=t).next&&(t.next.previous=this),this.next=t.next,t.next=this},n.prototype.destroy=function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];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},n);function n(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,i=3<arguments.length&&void 0!==arguments[3]&&arguments[3];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.fn=t,this.context=e,this.priority=r,this.once=i,this.next=null,this.previous=null,this._destroyed=!1}r.default=i},{}],135:[function(t,e,r){"use strict";r.__esModule=!0,r.Ticker=r.shared=void 0;var i,n=t("./Ticker"),o=(i=n)&&i.__esModule?i:{default:i};var s=new o.default;s.autoStart=!0,s.destroy=function(){},r.shared=s,r.Ticker=o.default},{"./Ticker":133}],136:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(){return!(navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform))}},{}],137:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;i<e;i+=6,n+=4)r[i+0]=n+0,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return r}},{}],138:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:window.location;if(0===t.indexOf("data:"))return"";e=e||window.location,s||(s=document.createElement("a"));s.href=t;var r=!(t=o.default.parse(s.href)).port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"};var i,n=t("url"),o=(i=n)&&i.__esModule?i:{default:i};var s=void 0},{url:230}],139:[function(t,e,r){"use strict";r.__esModule=!0,r.premultiplyBlendMode=r.BaseTextureCache=r.TextureCache=r.earcut=r.mixins=r.pluginTarget=r.EventEmitter=r.removeItems=r.isMobile=void 0,r.uid=function(){return++p},r.hex2rgb=function(t,e){return(e=e||[])[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},r.hex2string=function(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)},r.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},r.getResolutionOfUrl=function(t,e){var r=n.default.RETINA_PREFIX.exec(t);if(r)return parseFloat(r[1]);return void 0!==e?e:1},r.decomposeDataUri=function(t){var e=i.DATA_URI.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]};return},r.getUrlFileExtension=function(t){var e=i.URL_FILE_EXTENSION.exec(t);if(e)return e[1].toLowerCase();return},r.getSvgSize=function(t){var e=i.SVG_SIZE.exec(t),r={};e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7])));return r},r.skipHello=function(){v=!0},r.sayHello=function(t){if(v)return;if(-1<navigator.userAgent.toLowerCase().indexOf("chrome")){var e=["\n %c %c %c PixiJS "+i.VERSION+" - ✰ "+t+" ✰ %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,e)}else window.console&&window.console.log("PixiJS "+i.VERSION+" - "+t+" - http://www.pixijs.com/");v=!0},r.isWebGLSupported=function(){var t={stencil:!0,failIfMajorPerformanceCaveat:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t),i=!(!r||!r.getContextAttributes().stencil);if(r){var n=r.getExtension("WEBGL_lose_context");n&&n.loseContext()}return r=null,i}catch(t){return!1}},r.sign=function(t){return 0===t?0:t<0?-1:1},r.destroyTextureCache=function(){var t=void 0;for(t in y)y[t].destroy();for(t in g)g[t].destroy()},r.clearTextureCache=function(){var t=void 0;for(t in y)delete y[t];for(t in g)delete g[t]},r.correctBlendMode=function(t,e){return m[e?1:0][t]},r.premultiplyTint=function(t,e){if(1===e)return(255*e<<24)+t;if(0===e)return 0;var r=t>>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)},r.premultiplyRgba=function(t,e,r,i){r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]);return r[3]=e,r},r.premultiplyTintToRgba=function(t,e,r,i){(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,!i&&void 0!==i||(r[0]*=e,r[1]*=e,r[2]*=e);return r[3]=e,r};var i=t("../const"),n=d(t("../settings")),o=d(t("eventemitter3")),s=d(t("./pluginTarget")),a=f(t("./mixin")),u=f(t("ismobilejs")),h=d(t("remove-array-items")),l=d(t("./mapPremultipliedBlendModes")),c=d(t("earcut"));function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var p=0,v=!1;r.isMobile=u,r.removeItems=h.default,r.EventEmitter=o.default,r.pluginTarget=s.default,r.mixins=a,r.earcut=c.default;var y=r.TextureCache=Object.create(null),g=r.BaseTextureCache=Object.create(null);var m=r.premultiplyBlendMode=(0,l.default)()},{"../const":60,"../settings":115,"./mapPremultipliedBlendModes":140,"./mixin":142,"./pluginTarget":143,earcut:5,eventemitter3:204,ismobilejs:7,"remove-array-items":205}],140:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,t[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,t[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,e[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,e[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,e[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i};var n=t("../const")},{"../const":60}],141:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){if(o.default.tablet||o.default.phone)return 4;return t};var i,n=t("ismobilejs"),o=(i=n)&&i.__esModule?i:{default:i}},{ismobilejs:7}],142:[function(t,e,r){"use strict";function i(t,e){if(t&&e)for(var r=Object.keys(e),i=0;i<r.length;++i){var n=r[i];Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}}r.__esModule=!0,r.mixin=i,r.delayMixin=function(t,e){n.push(t,e)},r.performMixins=function(){for(var t=0;t<n.length;t+=2)i(n[t],n[t+1]);n.length=0};var n=[]},{}],143:[function(t,e,r){"use strict";r.__esModule=!0,r.default={mixin:function(t){!function(r){r.__plugins={},r.registerPlugin=function(t,e){r.__plugins[t]=e},r.prototype.initPlugins=function(){for(var t in this.plugins=this.plugins||{},r.__plugins)this.plugins[t]=new r.__plugins[t](this)},r.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}(t)}}},{}],144:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){var e=t.width,r=t.height,i=t.getContext("2d"),n=i.getImageData(0,0,e,r).data,o=n.length,s={top:null,left:null,right:null,bottom:null},a=null,u=void 0,h=void 0,l=void 0;for(u=0;u<o;u+=4)0!==n[u+3]&&(h=u/4%e,l=~~(u/4/e),null===s.top&&(s.top=l),null===s.left?s.left=h:h<s.left&&(s.left=h),null===s.right?s.right=h+1:s.right<h&&(s.right=h+1),null===s.bottom?s.bottom=l:s.bottom<l&&(s.bottom=l));null!==s.top&&(e=s.right-s.left,r=s.bottom-s.top+1,a=i.getImageData(s.left,s.top,e,r));return{height:r,width:e,data:a}}},{}],145:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(r){var t=r.mesh,e=r.particles,i=r.extras,n=r.filters,o=r.prepare,s=r.loaders,a=r.interaction;Object.defineProperties(r,{SpriteBatch:{get:function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")}},AssetLoader:{get:function(){throw new ReferenceError("The loader system was overhauled in PixiJS v3, please see the new PIXI.loaders.Loader class.")}},Stage:{get:function(){return p("You do not need to use a PIXI Stage any more, you can simply render any container."),r.Container}},DisplayObjectContainer:{get:function(){return p("DisplayObjectContainer has been shortened to Container, please use Container from now on."),r.Container}},Strip:{get:function(){return p("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),t.Mesh}},Rope:{get:function(){return p("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),t.Rope}},ParticleContainer:{get:function(){return p("The ParticleContainer class has been moved to particles.ParticleContainer, please use particles.ParticleContainer from now on."),e.ParticleContainer}},MovieClip:{get:function(){return p("The MovieClip class has been moved to extras.AnimatedSprite, please use extras.AnimatedSprite."),i.AnimatedSprite}},TilingSprite:{get:function(){return p("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),i.TilingSprite}},BitmapText:{get:function(){return p("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),i.BitmapText}},blendModes:{get:function(){return p("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),r.BLEND_MODES}},scaleModes:{get:function(){return p("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),r.SCALE_MODES}},BaseTextureCache:{get:function(){return p("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),r.utils.BaseTextureCache}},TextureCache:{get:function(){return p("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),r.utils.TextureCache}},math:{get:function(){return p("The math namespace is deprecated, please access members already accessible on PIXI."),r}},AbstractFilter:{get:function(){return p("AstractFilter has been renamed to Filter, please use PIXI.Filter"),r.Filter}},TransformManual:{get:function(){return p("TransformManual has been renamed to TransformBase, please update your pixi-spine"),r.TransformBase}},TARGET_FPMS:{get:function(){return p("PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS"),r.settings.TARGET_FPMS},set:function(t){p("PIXI.TARGET_FPMS has been deprecated, please use PIXI.settings.TARGET_FPMS"),r.settings.TARGET_FPMS=t}},FILTER_RESOLUTION:{get:function(){return p("PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION"),r.settings.FILTER_RESOLUTION},set:function(t){p("PIXI.FILTER_RESOLUTION has been deprecated, please use PIXI.settings.FILTER_RESOLUTION"),r.settings.FILTER_RESOLUTION=t}},RESOLUTION:{get:function(){return p("PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION"),r.settings.RESOLUTION},set:function(t){p("PIXI.RESOLUTION has been deprecated, please use PIXI.settings.RESOLUTION"),r.settings.RESOLUTION=t}},MIPMAP_TEXTURES:{get:function(){return p("PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES"),r.settings.MIPMAP_TEXTURES},set:function(t){p("PIXI.MIPMAP_TEXTURES has been deprecated, please use PIXI.settings.MIPMAP_TEXTURES"),r.settings.MIPMAP_TEXTURES=t}},SPRITE_BATCH_SIZE:{get:function(){return p("PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE"),r.settings.SPRITE_BATCH_SIZE},set:function(t){p("PIXI.SPRITE_BATCH_SIZE has been deprecated, please use PIXI.settings.SPRITE_BATCH_SIZE"),r.settings.SPRITE_BATCH_SIZE=t}},SPRITE_MAX_TEXTURES:{get:function(){return p("PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES"),r.settings.SPRITE_MAX_TEXTURES},set:function(t){p("PIXI.SPRITE_MAX_TEXTURES has been deprecated, please use PIXI.settings.SPRITE_MAX_TEXTURES"),r.settings.SPRITE_MAX_TEXTURES=t}},RETINA_PREFIX:{get:function(){return p("PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX"),r.settings.RETINA_PREFIX},set:function(t){p("PIXI.RETINA_PREFIX has been deprecated, please use PIXI.settings.RETINA_PREFIX"),r.settings.RETINA_PREFIX=t}},DEFAULT_RENDER_OPTIONS:{get:function(){return p("PIXI.DEFAULT_RENDER_OPTIONS has been deprecated, please use PIXI.settings.DEFAULT_RENDER_OPTIONS"),r.settings.RENDER_OPTIONS}}});for(var u=[{parent:"TRANSFORM_MODE",target:"TRANSFORM_MODE"},{parent:"GC_MODES",target:"GC_MODE"},{parent:"WRAP_MODES",target:"WRAP_MODE"},{parent:"SCALE_MODES",target:"SCALE_MODE"},{parent:"PRECISION",target:"PRECISION_FRAGMENT"}],h=function(t){var e=u[t];Object.defineProperty(r[e.parent],"DEFAULT",{get:function(){return p("PIXI."+e.parent+".DEFAULT has been deprecated, please use PIXI.settings."+e.target),r.settings[e.target]},set:function(t){p("PIXI."+e.parent+".DEFAULT has been deprecated, please use PIXI.settings."+e.target),r.settings[e.target]=t}})},l=0;l<u.length;l++)h(l);Object.defineProperties(r.settings,{PRECISION:{get:function(){return p("PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT"),r.settings.PRECISION_FRAGMENT},set:function(t){p("PIXI.settings.PRECISION has been deprecated, please use PIXI.settings.PRECISION_FRAGMENT"),r.settings.PRECISION_FRAGMENT=t}}}),i.AnimatedSprite&&Object.defineProperties(i,{MovieClip:{get:function(){return p("The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on."),i.AnimatedSprite}}});i&&Object.defineProperties(i,{TextureTransform:{get:function(){return p("The TextureTransform class has been renamed to TextureMatrix, please use PIXI.TextureMatrix from now on."),r.TextureMatrix}}});r.DisplayObject.prototype.generateTexture=function(t,e,r){return p("generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)"),t.generateTexture(this,e,r)},r.Graphics.prototype.generateTexture=function(t,e){return p("graphics generate texture has moved to the renderer. Or to render a graphics to a texture using canvas please use generateCanvasTexture"),this.generateCanvasTexture(t,e)},r.GroupD8.isSwapWidthHeight=function(t){return p("GroupD8.isSwapWidthHeight was renamed to GroupD8.isVertical"),r.GroupD8.isVertical(t)},r.RenderTexture.prototype.render=function(t,e,r,i){this.legacyRenderer.render(t,this,r,e,!i),p("RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)")},r.RenderTexture.prototype.getImage=function(t){return p("RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)"),this.legacyRenderer.extract.image(t)},r.RenderTexture.prototype.getBase64=function(t){return p("RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)"),this.legacyRenderer.extract.base64(t)},r.RenderTexture.prototype.getCanvas=function(t){return p("RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)"),this.legacyRenderer.extract.canvas(t)},r.RenderTexture.prototype.getPixels=function(t){return p("RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)"),this.legacyRenderer.pixels(t)},r.Sprite.prototype.setTexture=function(t){this.texture=t,p("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},i.BitmapText&&(i.BitmapText.prototype.setText=function(t){this.text=t,p("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")});r.Text.prototype.setText=function(t){this.text=t,p("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},r.Text.calculateFontProperties=function(t){return p("Text.calculateFontProperties is now deprecated, please use the TextMetrics.measureFont"),r.TextMetrics.measureFont(t)},Object.defineProperties(r.Text,{fontPropertiesCache:{get:function(){return p("Text.fontPropertiesCache is deprecated"),r.TextMetrics._fonts}},fontPropertiesCanvas:{get:function(){return p("Text.fontPropertiesCanvas is deprecated"),r.TextMetrics._canvas}},fontPropertiesContext:{get:function(){return p("Text.fontPropertiesContext is deprecated"),r.TextMetrics._context}}}),r.Text.prototype.setStyle=function(t){this.style=t,p("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},r.Text.prototype.determineFontProperties=function(t){return p("determineFontProperties is now deprecated, please use TextMetrics.measureFont method"),r.TextMetrics.measureFont(t)},r.Text.getFontStyle=function(t){return p("getFontStyle is now deprecated, please use TextStyle.toFontString() instead"),(t=t||{})instanceof r.TextStyle||(t=new r.TextStyle(t)),t.toFontString()},Object.defineProperties(r.TextStyle.prototype,{font:{get:function(){p("text style property 'font' is now deprecated, please use the 'fontFamily', 'fontSize', 'fontStyle', 'fontVariant' and 'fontWeight' properties from now on");var t="number"==typeof this._fontSize?this._fontSize+"px":this._fontSize;return this._fontStyle+" "+this._fontVariant+" "+this._fontWeight+" "+t+" "+this._fontFamily},set:function(t){p("text style property 'font' is now deprecated, please use the 'fontFamily','fontSize',fontStyle','fontVariant' and 'fontWeight' properties from now on"),1<t.indexOf("italic")?this._fontStyle="italic":-1<t.indexOf("oblique")?this._fontStyle="oblique":this._fontStyle="normal",-1<t.indexOf("small-caps")?this._fontVariant="small-caps":this._fontVariant="normal";var e=t.split(" "),r=-1;this._fontSize=26;for(var i=0;i<e.length;++i)if(e[i].match(/(px|pt|em|%)/)){r=i,this._fontSize=e[i];break}this._fontWeight="normal";for(var n=0;n<r;++n)if(e[n].match(/(bold|bolder|lighter|100|200|300|400|500|600|700|800|900)/)){this._fontWeight=e[n];break}if(-1<r&&r<e.length-1){this._fontFamily="";for(var o=r+1;o<e.length;++o)this._fontFamily+=e[o]+" ";this._fontFamily=this._fontFamily.slice(0,-1)}else this._fontFamily="Arial";this.styleID++}}}),r.Texture.prototype.setFrame=function(t){this.frame=t,p("setFrame is now deprecated, please use the frame property, e.g: myTexture.frame = frame;")},r.Texture.addTextureToCache=function(t,e){r.Texture.addToCache(t,e),p("Texture.addTextureToCache is deprecated, please use Texture.addToCache from now on.")},r.Texture.removeTextureFromCache=function(t){return p("Texture.removeTextureFromCache is deprecated, please use Texture.removeFromCache from now on. Be aware that Texture.removeFromCache does not automatically its BaseTexture from the BaseTextureCache. For that, use BaseTexture.removeFromCache"),r.BaseTexture.removeFromCache(t),r.Texture.removeFromCache(t)},Object.defineProperties(n,{AbstractFilter:{get:function(){return p("AstractFilter has been renamed to Filter, please use PIXI.Filter"),r.AbstractFilter}},SpriteMaskFilter:{get:function(){return p("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),r.SpriteMaskFilter}},VoidFilter:{get:function(){return p("VoidFilter has been renamed to AlphaFilter, please use PIXI.filters.AlphaFilter"),n.AlphaFilter}}}),r.utils.uuid=function(){return p("utils.uuid() is deprecated, please use utils.uid() from now on."),r.utils.uid()},r.utils.canUseNewCanvasBlendModes=function(){return p("utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on"),r.CanvasTinter.canUseMultiply};var c=!0;Object.defineProperty(r.utils,"_saidHello",{set:function(t){t&&(p("PIXI.utils._saidHello is deprecated, please use PIXI.utils.skipHello()"),this.skipHello()),c=t},get:function(){return c}}),o.BasePrepare&&(o.BasePrepare.prototype.register=function(t,e){return p("renderer.plugins.prepare.register is now deprecated, please use renderer.plugins.prepare.registerFindHook & renderer.plugins.prepare.registerUploadHook"),t&&this.registerFindHook(t),e&&this.registerUploadHook(e),this});o.canvas&&Object.defineProperty(o.canvas,"UPLOADS_PER_FRAME",{set:function(){p("PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer")},get:function(){return p("PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use renderer.plugins.prepare.limiter"),NaN}});o.webgl&&Object.defineProperty(o.webgl,"UPLOADS_PER_FRAME",{set:function(){p("PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer")},get:function(){return p("PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use renderer.plugins.prepare.limiter"),NaN}});if(s.Loader){var f=s.Resource,d=s.Loader;Object.defineProperties(f.prototype,{isJson:{get:function(){return p("The isJson property is deprecated, please use `resource.type === Resource.TYPE.JSON`."),this.type===f.TYPE.JSON}},isXml:{get:function(){return p("The isXml property is deprecated, please use `resource.type === Resource.TYPE.XML`."),this.type===f.TYPE.XML}},isImage:{get:function(){return p("The isImage property is deprecated, please use `resource.type === Resource.TYPE.IMAGE`."),this.type===f.TYPE.IMAGE}},isAudio:{get:function(){return p("The isAudio property is deprecated, please use `resource.type === Resource.TYPE.AUDIO`."),this.type===f.TYPE.AUDIO}},isVideo:{get:function(){return p("The isVideo property is deprecated, please use `resource.type === Resource.TYPE.VIDEO`."),this.type===f.TYPE.VIDEO}}}),Object.defineProperties(d.prototype,{before:{get:function(){return p("The before() method is deprecated, please use pre()."),this.pre}},after:{get:function(){return p("The after() method is deprecated, please use use()."),this.use}}})}a.interactiveTarget&&Object.defineProperty(a.interactiveTarget,"defaultCursor",{set:function(t){p("Property defaultCursor has been replaced with 'cursor'. "),this.cursor=t},get:function(){return p("Property defaultCursor has been replaced with 'cursor'. "),this.cursor}});a.InteractionManager&&(Object.defineProperty(a.InteractionManager,"defaultCursorStyle",{set:function(t){p("Property defaultCursorStyle has been replaced with 'cursorStyles.default'. "),this.cursorStyles.default=t},get:function(){return p("Property defaultCursorStyle has been replaced with 'cursorStyles.default'. "),this.cursorStyles.default}}),Object.defineProperty(a.InteractionManager,"currentCursorStyle",{set:function(t){p("Property currentCursorStyle has been removed.See the currentCursorMode property, which works differently."),this.currentCursorMode=t},get:function(){return p("Property currentCursorStyle has been removed.See the currentCursorMode property, which works differently."),this.currentCursorMode}}))};var i={};function p(t){if(!i[t]){var e=(new Error).stack;void 0===e?console.warn("Deprecation Warning: ",t):(e=e.split("\n").splice(3).join("\n"),console.groupCollapsed?(console.groupCollapsed("%cDeprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",t),console.warn(e),console.groupEnd()):(console.warn("Deprecation Warning: ",t),console.warn(e))),i[t]=!0}}},{}],146:[function(t,e,r){"use strict";r.__esModule=!0;var l=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core"));var c=new l.Rectangle,i=(n.prototype.image=function(t){var e=new Image;return e.src=this.base64(t),e},n.prototype.base64=function(t){return this.canvas(t).toDataURL()},n.prototype.canvas=function(t){var e=this.renderer,r=void 0,i=void 0,n=void 0,o=void 0;t&&(o=t instanceof l.RenderTexture?t:e.generateTexture(t)),o?(r=o.baseTexture._canvasRenderTarget.context,i=o.baseTexture._canvasRenderTarget.resolution,n=o.frame):(r=e.rootContext,i=e.resolution,(n=c).width=this.renderer.width,n.height=this.renderer.height);var s=n.width*i,a=n.height*i,u=new l.CanvasRenderTarget(s,a,1),h=r.getImageData(n.x*i,n.y*i,s,a);return u.context.putImageData(h,0,0),u.canvas},n.prototype.pixels=function(t){var e=this.renderer,r=void 0,i=void 0,n=void 0,o=void 0;return t&&(o=t instanceof l.RenderTexture?t:e.generateTexture(t)),o?(r=o.baseTexture._canvasRenderTarget.context,i=o.baseTexture._canvasRenderTarget.resolution,n=o.frame):(r=e.rootContext,(n=c).width=e.width,n.height=e.height),r.getImageData(0,0,n.width*i,n.height*i).data},n.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},n);function n(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(this.renderer=t).extract=this}r.default=i,l.CanvasRenderer.registerPlugin("extract",i)},{"../../core":79}],147:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./webgl/WebGLExtract");Object.defineProperty(r,"webgl",{enumerable:!0,get:function(){return o(i).default}});var n=t("./canvas/CanvasExtract");function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"canvas",{enumerable:!0,get:function(){return o(n).default}})},{"./canvas/CanvasExtract":146,"./webgl/WebGLExtract":148}],148:[function(t,e,r){"use strict";r.__esModule=!0;var p=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core"));var v=new p.Rectangle,i=(n.prototype.image=function(t){var e=new Image;return e.src=this.base64(t),e},n.prototype.base64=function(t){return this.canvas(t).toDataURL()},n.prototype.canvas=function(t){var e=this.renderer,r=void 0,i=void 0,n=void 0,o=!1,s=void 0,a=!1;t&&(t instanceof p.RenderTexture?s=t:(s=this.renderer.generateTexture(t),a=!0)),s?(i=(r=s.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID]).resolution,n=s.frame,o=!1):(i=(r=this.renderer.rootRenderTarget).resolution,o=!0,(n=v).width=r.size.width,n.height=r.size.height);var u=n.width*i,h=n.height*i,l=new p.CanvasRenderTarget(u,h,1);if(r){e.bindRenderTarget(r);var c=new Uint8Array(4*u*h),f=e.gl;f.readPixels(n.x*i,n.y*i,u,h,f.RGBA,f.UNSIGNED_BYTE,c);var d=l.context.getImageData(0,0,u,h);d.data.set(c),l.context.putImageData(d,0,0),o&&(l.context.scale(1,-1),l.context.drawImage(l.canvas,0,-h))}return a&&s.destroy(!0),l.canvas},n.prototype.pixels=function(t){var e=this.renderer,r=void 0,i=void 0,n=void 0,o=void 0,s=!1;t&&(t instanceof p.RenderTexture?o=t:(o=this.renderer.generateTexture(t),s=!0)),o?(i=(r=o.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID]).resolution,n=o.frame):(i=(r=this.renderer.rootRenderTarget).resolution,(n=v).width=r.size.width,n.height=r.size.height);var a=n.width*i,u=n.height*i,h=new Uint8Array(4*a*u);if(r){e.bindRenderTarget(r);var l=e.gl;l.readPixels(n.x*i,n.y*i,a,u,l.RGBA,l.UNSIGNED_BYTE,h)}return s&&o.destroy(!0),h},n.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},n);function n(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(this.renderer=t).extract=this}r.default=i,p.WebGLRenderer.registerPlugin("extract",i)},{"../../core":79}],149:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core"));var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.Sprite),u.prototype.stop=function(){this.playing&&(this.playing=!1,this._autoUpdate&&o.ticker.shared.remove(this.update,this))},u.prototype.play=function(){this.playing||(this.playing=!0,this._autoUpdate&&o.ticker.shared.add(this.update,this,o.UPDATE_PRIORITY.HIGH))},u.prototype.gotoAndStop=function(t){this.stop();var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture()},u.prototype.gotoAndPlay=function(t){var e=this.currentFrame;this._currentTime=t,e!==this.currentFrame&&this.updateTexture(),this.play()},u.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 n=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);i>=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;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&&(0<this.animationSpeed&&this.currentFrame<r?this.onLoop():this.animationSpeed<0&&this.currentFrame>r&&this.onLoop()),this.updateTexture())},u.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},u.prototype.destroy=function(t){this.stop(),s.prototype.destroy.call(this,t)},u.fromFrames=function(t){for(var e=[],r=0;r<t.length;++r)e.push(o.Texture.fromFrame(t[r]));return new u(e)},u.fromImages=function(t){for(var e=[],r=0;r<t.length;++r)e.push(o.Texture.fromImage(t[r]));return new u(e)},i(u,[{key:"totalFrames",get:function(){return this._textures.length}},{key:"textures",get:function(){return this._textures},set:function(t){if(t[0]instanceof o.Texture)this._textures=t,this._durations=null;else{this._textures=[],this._durations=[];for(var e=0;e<t.length;e++)this._textures.push(t[e].texture),this._durations.push(t[e].time)}this.gotoAndStop(0),this.updateTexture()}},{key:"currentFrame",get:function(){var t=Math.floor(this._currentTime)%this._textures.length;return t<0&&(t+=this._textures.length),t}}]),u);function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,t[0]instanceof o.Texture?t[0]:t[0].texture));return r._textures=null,r._durations=null,r.textures=t,r._autoUpdate=!1!==e,r.animationSpeed=1,r.loop=!0,r.updateAnchor=!1,r.onComplete=null,r.onFrameChange=null,r.onLoop=null,r._currentTime=0,r.playing=!1,r}r.default=a},{"../core":79}],150:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var A=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),o=s(t("../core/math/ObservablePoint")),T=t("../core/utils"),E=s(t("../core/settings"));function s(t){return t&&t.__esModule?t:{default:t}}var a,u=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(R,a=A.Container),R.prototype.updateText=function(){for(var t=R.fonts[this._font.name],e=this._font.size/t.size,r=new A.Point,i=[],n=[],o=this.text.replace(/(?:\r\n|\r)/g,"\n"),s=o.length,a=this._maxWidth*t.size/this._font.size,u=null,h=0,l=0,c=0,f=-1,d=0,p=0,v=0,y=0;y<s;y++){var g=o.charCodeAt(y),m=o.charAt(y);if(/(?:\s)/.test(m)&&(f=y,d=h),"\r"!==m&&"\n"!==m){var b=t.chars[g];b&&(u&&b.kerning[u]&&(r.x+=b.kerning[u]),i.push({texture:b.texture,line:c,charCode:g,position:new A.Point(r.x+b.xOffset+this._letterSpacing/2,r.y+b.yOffset)}),r.x+=b.xAdvance+this._letterSpacing,h=r.x,v=Math.max(v,b.yOffset+b.texture.height),u=g,-1!==f&&0<a&&r.x>a&&(++p,A.utils.removeItems(i,1+f-p,1+y-f),y=f,f=-1,n.push(d),l=Math.max(l,d),c++,r.x=0,r.y+=t.lineHeight,u=null))}else n.push(h),l=Math.max(l,h),++c,++p,r.x=0,r.y+=t.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(h=d),n.push(h),l=Math.max(l,h));for(var x=[],w=0;w<=c;w++){var T=0;"right"===this._font.align?T=l-n[w]:"center"===this._font.align&&(T=(l-n[w])/2),x.push(T)}for(var E=i.length,O=this.tint,S=0;S<E;S++){var M=this._glyphs[S];M?M.texture=i[S].texture:(M=new A.Sprite(i[S].texture),this._glyphs.push(M)),M.position.x=(i[S].position.x+x[i[S].line])*e,M.position.y=i[S].position.y*e,M.scale.x=M.scale.y=e,M.tint=O,M.parent||this.addChild(M)}for(var P=E;P<this._glyphs.length;++P)this.removeChild(this._glyphs[P]);if(this._textWidth=l*e,this._textHeight=(r.y+t.lineHeight)*e,0!==this.anchor.x||0!==this.anchor.y)for(var C=0;C<E;C++)this._glyphs[C].x-=this._textWidth*this.anchor.x,this._glyphs[C].y-=this._textHeight*this.anchor.y;this._maxLineHeight=v*e},R.prototype.updateTransform=function(){this.validate(),this.containerUpdateTransform()},R.prototype.getLocalBounds=function(){return this.validate(),a.prototype.getLocalBounds.call(this)},R.prototype.validate=function(){this.dirty&&(this.updateText(),this.dirty=!1)},R.registerFont=function(t,e){var r={},i=t.getElementsByTagName("info")[0],n=t.getElementsByTagName("common")[0],o=t.getElementsByTagName("page"),s=(0,T.getResolutionOfUrl)(o[0].getAttribute("file"),E.default.RESOLUTION),a={};r.font=i.getAttribute("face"),r.size=parseInt(i.getAttribute("size"),10),r.lineHeight=parseInt(n.getAttribute("lineHeight"),10)/s,r.chars={},e instanceof A.Texture&&(e=[e]);for(var u=0;u<o.length;u++){var h=o[u].getAttribute("id"),l=o[u].getAttribute("file");a[h]=e instanceof Array?e[u]:e[l]}for(var c=t.getElementsByTagName("char"),f=0;f<c.length;f++){var d=c[f],p=parseInt(d.getAttribute("id"),10),v=d.getAttribute("page")||0,y=new A.Rectangle(parseInt(d.getAttribute("x"),10)/s+a[v].frame.x/s,parseInt(d.getAttribute("y"),10)/s+a[v].frame.y/s,parseInt(d.getAttribute("width"),10)/s,parseInt(d.getAttribute("height"),10)/s);r.chars[p]={xOffset:parseInt(d.getAttribute("xoffset"),10)/s,yOffset:parseInt(d.getAttribute("yoffset"),10)/s,xAdvance:parseInt(d.getAttribute("xadvance"),10)/s,kerning:{},texture:new A.Texture(a[v].baseTexture,y),page:v}}for(var g=t.getElementsByTagName("kerning"),m=0;m<g.length;m++){var b=g[m],_=parseInt(b.getAttribute("first"),10)/s,x=parseInt(b.getAttribute("second"),10)/s,w=parseInt(b.getAttribute("amount"),10)/s;r.chars[x]&&(r.chars[x].kerning[_]=w)}return R.fonts[r.font]=r},i(R,[{key:"tint",get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&0<=t?t:16777215,this.dirty=!0}},{key:"align",get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},{key:"anchor",get:function(){return this._anchor},set:function(t){"number"==typeof t?this._anchor.set(t):this._anchor.copy(t)}},{key:"font",get:function(){return this._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=2<=t.length?parseInt(t[0],10):R.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)}},{key:"text",get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}},{key:"maxWidth",get:function(){return this._maxWidth},set:function(t){this._maxWidth!==t&&(this._maxWidth=t,this.dirty=!0)}},{key:"maxLineHeight",get:function(){return this.validate(),this._maxLineHeight}},{key:"textWidth",get:function(){return this.validate(),this._textWidth}},{key:"letterSpacing",get:function(){return this._letterSpacing},set:function(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.dirty=!0)}},{key:"textHeight",get:function(){return this.validate(),this._textHeight}}]),R);function R(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,R);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,a.call(this));return r._textWidth=0,r._textHeight=0,r._glyphs=[],r._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},r.font=e.font,r._text=t,r._maxWidth=0,r._maxLineHeight=0,r._letterSpacing=0,r._anchor=new o.default(function(){r.dirty=!0},r,0,0),r.dirty=!1,r.updateText(),r}(r.default=u).fonts={}},{"../core":79,"../core/math/ObservablePoint":82,"../core/settings":115,"../core/utils":139}],151:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o,x=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),s=t("../core/sprites/canvas/CanvasTinter"),w=(o=s)&&o.__esModule?o:{default:o};var a,u=new x.Point,h=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,a=x.Sprite),l.prototype._onTextureUpdate=function(){this.uvTransform&&(this.uvTransform.texture=this._texture),this.cachedTint=16777215},l.prototype._renderWebGL=function(t){var e=this._texture;e&&e.valid&&(this.tileTransform.updateLocalTransform(),this.uvTransform.update(),t.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this))},l.prototype._renderCanvas=function(t){var e=this._texture;if(e.baseTexture.hasLoaded){var r=t.context,i=this.worldTransform,n=t.resolution,o=2===e.rotate,s=e.baseTexture,a=s.resolution,u=this.tilePosition.x/this.tileScale.x%e.orig.width*a,h=this.tilePosition.y/this.tileScale.y%e.orig.height*a;if(this._textureID!==this._texture._updateID||this.cachedTint!==this.tint){this._textureID=this._texture._updateID;var l=new x.CanvasRenderTarget(e.orig.width,e.orig.height,a);if(16777215!==this.tint)this.tintedTexture=w.default.getTintedTexture(this,this.tint),l.context.drawImage(this.tintedTexture,0,0);else{var c=e._frame.x*a,f=e._frame.y*a,d=e._frame.width*a,p=e._frame.height*a,v=(e.trim?e.trim.width:e.orig.width)*a,y=(e.trim?e.trim.height:e.orig.height)*a,g=(e.trim?e.trim.x:0)*a,m=(e.trim?e.trim.y:0)*a;o?(l.context.rotate(-Math.PI/2),l.context.translate(-y,0),l.context.drawImage(s.source,c,f,d,p,-m,g,y,v)):l.context.drawImage(s.source,c,f,d,p,g,m,v,y)}this.cachedTint=this.tint,this._canvasPattern=l.context.createPattern(l.canvas,"repeat")}r.globalAlpha=this.worldAlpha,r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t.setBlendMode(this.blendMode),r.fillStyle=this._canvasPattern,r.scale(this.tileScale.x/a,this.tileScale.y/a);var b=this.anchor.x*-this._width*a,_=this.anchor.y*-this._height*a;this.uvRespectAnchor?(r.translate(u,h),r.fillRect(b-u,_-h,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a)):(r.translate(u+b,h+_),r.fillRect(-u,-h,this._width/this.tileScale.x*a,this._height/this.tileScale.y*a))}},l.prototype._calculateBounds=function(){var t=this._width*-this._anchor._x,e=this._height*-this._anchor._y,r=this._width*(1-this._anchor._x),i=this._height*(1-this._anchor._y);this._bounds.addFrame(this.transform,t,e,r,i)},l.prototype.getLocalBounds=function(t){return 0===this.children.length?(this._bounds.minX=this._width*-this._anchor._x,this._bounds.minY=this._height*-this._anchor._y,this._bounds.maxX=this._width*(1-this._anchor._x),this._bounds.maxY=this._height*(1-this._anchor._y),t||(this._localBoundsRect||(this._localBoundsRect=new x.Rectangle),t=this._localBoundsRect),this._bounds.getRectangle(t)):a.prototype.getLocalBounds.call(this,t)},l.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var e=this._width,r=this._height,i=-e*this.anchor._x;if(u.x>=i&&u.x<i+e){var n=-r*this.anchor._y;if(u.y>=n&&u.y<n+r)return!0}return!1},l.prototype.destroy=function(t){a.prototype.destroy.call(this,t),this.tileTransform=null,this.uvTransform=null},l.from=function(t,e,r){return new l(x.Texture.from(t),e,r)},l.fromFrame=function(t,e,r){var i=x.utils.TextureCache[t];if(!i)throw new Error('The frameId "'+t+'" does not exist in the texture cache '+this);return new l(i,e,r)},l.fromImage=function(t,e,r,i,n){return new l(x.Texture.fromImage(t,i,n),e,r)},i(l,[{key:"clampMargin",get:function(){return this.uvTransform.clampMargin},set:function(t){this.uvTransform.clampMargin=t,this.uvTransform.update(!0)}},{key:"tileScale",get:function(){return this.tileTransform.scale},set:function(t){this.tileTransform.scale.copy(t)}},{key:"tilePosition",get:function(){return this.tileTransform.position},set:function(t){this.tileTransform.position.copy(t)}},{key:"width",get:function(){return this._width},set:function(t){this._width=t}},{key:"height",get:function(){return this._height},set:function(t){this._height=t}}]),l);function l(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:100,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:100;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,a.call(this,t));return i.tileTransform=new x.TransformStatic,i._width=e,i._height=r,i._canvasPattern=null,i.uvTransform=t.transform||new x.TextureMatrix(t),i.pluginName="tilingSprite",i.uvRespectAnchor=!1,i}r.default=h},{"../core":79,"../core/sprites/canvas/CanvasTinter":118}],152:[function(t,e,r){"use strict";var l=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),c=i(t("../core/textures/Texture")),f=i(t("../core/textures/BaseTexture")),d=t("../core/utils");function i(t){return t&&t.__esModule?t:{default:t}}var n=l.DisplayObject,p=new l.Matrix;n.prototype._cacheAsBitmap=!1,n.prototype._cacheData=!1;function o(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),this.textureCacheId=null,this.originalRenderWebGL=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(n.prototype,{cacheAsBitmap:{get:function(){return this._cacheAsBitmap},set:function(t){if(this._cacheAsBitmap!==t){var e=void 0;(this._cacheAsBitmap=t)?(this._cacheData||(this._cacheData=new o),(e=this._cacheData).originalRenderWebGL=this.renderWebGL,e.originalRenderCanvas=this.renderCanvas,e.originalUpdateTransform=this.updateTransform,e.originalCalculateBounds=this.calculateBounds,e.originalGetLocalBounds=this.getLocalBounds,e.originalDestroy=this.destroy,e.originalContainsPoint=this.containsPoint,e.originalMask=this._mask,e.originalFilterArea=this.filterArea,this.renderWebGL=this._renderCachedWebGL,this.renderCanvas=this._renderCachedCanvas,this.destroy=this._cacheAsBitmapDestroy):((e=this._cacheData).sprite&&this._destroyCachedDisplayObject(),this.renderWebGL=e.originalRenderWebGL,this.renderCanvas=e.originalRenderCanvas,this.calculateBounds=e.originalCalculateBounds,this.getLocalBounds=e.originalGetLocalBounds,this.destroy=e.originalDestroy,this.updateTransform=e.originalUpdateTransform,this.containsPoint=e.originalContainsPoint,this._mask=e.originalMask,this.filterArea=e.originalFilterArea)}}}}),n.prototype._renderCachedWebGL=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._renderWebGL(t))},n.prototype._initCachedDisplayObject=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.alpha;this.alpha=1,t.currentRenderer.flush();var r=this.getLocalBounds().clone();if(this._filters&&this._filters.length){var i=this._filters[0].padding;r.pad(i)}r.ceil(l.settings.RESOLUTION);var n=t._activeRenderTarget,o=t.filterManager.filterStack,s=l.RenderTexture.create(r.width,r.height),a="cacheAsBitmap_"+(0,d.uid)();this._cacheData.textureCacheId=a,f.default.addToCache(s.baseTexture,a),c.default.addToCache(s,a);var u=p;u.tx=-r.x,u.ty=-r.y,this.transform.worldTransform.identity(),this.renderWebGL=this._cacheData.originalRenderWebGL,t.render(this,s,!0,u,!0),t.bindRenderTarget(n),t.filterManager.filterStack=o,this.renderWebGL=this._renderCachedWebGL,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var h=new l.Sprite(s);h.transform.worldTransform=this.transform.worldTransform,h.anchor.x=-r.x/r.width,h.anchor.y=-r.y/r.height,h.alpha=e,h._bounds=this._bounds,this._cacheData.sprite=h,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=h.containsPoint.bind(h)}},n.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))},n.prototype._initCachedDisplayObjectCanvas=function(t){if(!this._cacheData||!this._cacheData.sprite){var e=this.getLocalBounds(),r=this.alpha;this.alpha=1;var i=t.context;e.ceil(l.settings.RESOLUTION);var n=l.RenderTexture.create(e.width,e.height),o="cacheAsBitmap_"+(0,d.uid)();this._cacheData.textureCacheId=o,f.default.addToCache(n.baseTexture,o),c.default.addToCache(n,o);var s=p;this.transform.localTransform.copy(s),s.invert(),s.tx-=e.x,s.ty-=e.y,this.renderCanvas=this._cacheData.originalRenderCanvas,t.render(this,n,!0,s,!1),t.context=i,this.renderCanvas=this._renderCachedCanvas,this.updateTransform=this.displayObjectUpdateTransform,this.calculateBounds=this._calculateCachedBounds,this.getLocalBounds=this._getCachedLocalBounds,this._mask=null,this.filterArea=null;var a=new l.Sprite(n);a.transform.worldTransform=this.transform.worldTransform,a.anchor.x=-e.x/e.width,a.anchor.y=-e.y/e.height,a.alpha=r,a._bounds=this._bounds,this._cacheData.sprite=a,this.transform._parentID=-1,this.parent?this.updateTransform():(this.parent=t._tempDisplayObjectParent,this.updateTransform(),this.parent=null),this.containsPoint=a.containsPoint.bind(a)}},n.prototype._calculateCachedBounds=function(){this._bounds.clear(),this._cacheData.sprite.transform._worldID=this.transform._worldID,this._cacheData.sprite._calculateBounds(),this._lastBoundsID=this._boundsID},n.prototype._getCachedLocalBounds=function(){return this._cacheData.sprite.getLocalBounds()},n.prototype._destroyCachedDisplayObject=function(){this._cacheData.sprite._texture.destroy(!0),this._cacheData.sprite=null,f.default.removeFromCache(this._cacheData.textureCacheId),c.default.removeFromCache(this._cacheData.textureCacheId),this._cacheData.textureCacheId=null},n.prototype._cacheAsBitmapDestroy=function(t){this.cacheAsBitmap=!1,this.destroy(t)}},{"../core":79,"../core/textures/BaseTexture":126,"../core/textures/Texture":129,"../core/utils":139}],153:[function(t,e,r){"use strict";var i=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core"));i.DisplayObject.prototype.name=null,i.Container.prototype.getChildByName=function(t){for(var e=0;e<this.children.length;e++)if(this.children[e].name===t)return this.children[e];return null}},{"../core":79}],154:[function(t,e,r){"use strict";var i=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core"));i.DisplayObject.prototype.getGlobalPosition=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new i.Point,e=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return this.parent?this.parent.toGlobal(this.position,t,e):(t.x=this.position.x,t.y=this.position.y),t}},{"../core":79}],155:[function(t,e,r){"use strict";r.__esModule=!0,r.BitmapText=r.TilingSpriteRenderer=r.TilingSprite=r.AnimatedSprite=void 0;var i=t("./AnimatedSprite");Object.defineProperty(r,"AnimatedSprite",{enumerable:!0,get:function(){return a(i).default}});var n=t("./TilingSprite");Object.defineProperty(r,"TilingSprite",{enumerable:!0,get:function(){return a(n).default}});var o=t("./webgl/TilingSpriteRenderer");Object.defineProperty(r,"TilingSpriteRenderer",{enumerable:!0,get:function(){return a(o).default}});var s=t("./BitmapText");function a(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"BitmapText",{enumerable:!0,get:function(){return a(s).default}}),t("./cacheAsBitmap"),t("./getChildByName"),t("./getGlobalPosition")},{"./AnimatedSprite":149,"./BitmapText":150,"./TilingSprite":151,"./cacheAsBitmap":152,"./getChildByName":153,"./getGlobalPosition":154,"./webgl/TilingSpriteRenderer":156}],156:[function(t,e,r){"use strict";r.__esModule=!0;var p=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),v=t("../../core/const");t("path");var i,y=new p.Matrix,n=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,i=p.ObjectRenderer),o.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new p.Shader(t,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = mod(vTextureCoord - uClampOffset, vec2(1.0, 1.0)) + uClampOffset;\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 sample = texture2D(uSampler, coord);\n gl_FragColor = sample * uColor;\n}\n"),this.simpleShader=new p.Shader(t,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 sample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = sample * uColor;\n}\n"),this.renderer.bindVao(null),this.quad=new p.Quad(t,this.renderer.state.attribState),this.quad.initVao(this.shader)},o.prototype.render=function(t){var e=this.renderer,r=this.quad;e.bindVao(r.vao);var i=r.vertices;i[0]=i[6]=t._width*-t.anchor.x,i[1]=i[3]=t._height*-t.anchor.y,i[2]=i[4]=t._width*(1-t.anchor.x),i[5]=i[7]=t._height*(1-t.anchor.y),t.uvRespectAnchor&&((i=r.uvs)[0]=i[6]=-t.anchor.x,i[1]=i[3]=-t.anchor.y,i[2]=i[4]=1-t.anchor.x,i[5]=i[7]=1-t.anchor.y),r.upload();var n=t._texture,o=n.baseTexture,s=t.tileTransform.localTransform,a=t.uvTransform,u=o.isPowerOfTwo&&n.frame.width===o.width&&n.frame.height===o.height;u&&(o._glTextures[e.CONTEXT_UID]?u=o.wrapMode!==v.WRAP_MODES.CLAMP:o.wrapMode===v.WRAP_MODES.CLAMP&&(o.wrapMode=v.WRAP_MODES.REPEAT));var h=u?this.simpleShader:this.shader;e.bindShader(h);var l=n.width,c=n.height,f=t._width,d=t._height;y.set(s.a*l/f,s.b*l/d,s.c*c/f,s.d*c/d,s.tx/f,s.ty/d),y.invert(),u?y.prepend(a.mapCoord):(h.uniforms.uMapCoord=a.mapCoord.toArray(!0),h.uniforms.uClampFrame=a.uClampFrame,h.uniforms.uClampOffset=a.uClampOffset),h.uniforms.uTransform=y.toArray(!0),h.uniforms.uColor=p.utils.premultiplyTintToRgba(t.tint,t.worldAlpha,h.uniforms.uColor,o.premultipliedAlpha),h.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),h.uniforms.uSampler=e.bindTexture(n),e.setBlendMode(p.utils.correctBlendMode(t.blendMode,o.premultipliedAlpha)),r.vao.draw(this.renderer.gl.TRIANGLES,6,0)},o);function o(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,i.call(this,t));return e.shader=null,e.simpleShader=null,e.quad=null,e}r.default=n,p.WebGLRenderer.registerPlugin("tilingSprite",n)},{"../../core":79,"../../core/const":60,path:224}],157:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core"));t("path");var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.Filter),i(u,[{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t}}]),u);function u(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,"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}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n"));return e.alpha=t,e.glShaderKey="alpha",e}r.default=a},{"../../core":79,path:224}],158:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),s=u(t("./BlurXFilter")),a=u(t("./BlurYFilter"));function u(t){return t&&t.__esModule?t:{default:t}}var h,l=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,h=o.Filter),c.prototype.apply=function(t,e,r){var i=t.getRenderTarget(!0);this.blurXFilter.apply(t,e,i,!0),this.blurYFilter.apply(t,i,r,!1),t.returnRenderTarget(i)},i(c,[{key:"blur",get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t,this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}},{key:"quality",get:function(){return this.blurXFilter.quality},set:function(t){this.blurXFilter.quality=this.blurYFilter.quality=t}},{key:"blurX",get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t,this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}},{key:"blurY",get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t,this.padding=2*Math.max(Math.abs(this.blurXFilter.strength),Math.abs(this.blurYFilter.strength))}},{key:"blendMode",get:function(){return this.blurYFilter._blendMode},set:function(t){this.blurYFilter._blendMode=t}}]),c);function c(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,h.call(this));return n.blurXFilter=new s.default(t,e,r,i),n.blurYFilter=new a.default(t,e,r,i),n.padding=0,n.resolution=r||o.settings.RESOLUTION,n.quality=e||4,n.blur=t||8,n}r.default=l},{"../../core":79,"./BlurXFilter":159,"./BlurYFilter":160}],159:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var a=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),c=o(t("./generateBlurVertSource")),f=o(t("./generateBlurFragSource")),d=o(t("./getMaxBlurKernelSize"));function o(t){return t&&t.__esModule?t:{default:t}}var u,s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,u=a.Filter),h.prototype.apply=function(t,e,r,i){if(this.firstRun){var n=t.renderer.gl,o=(0,d.default)(n);this.vertexSrc=(0,c.default)(o,!0),this.fragmentSrc=(0,f.default)(o),this.firstRun=!1}if(this.uniforms.strength=1/r.size.width*(r.size.width/e.size.width),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{for(var s=t.getRenderTarget(!0),a=e,u=s,h=0;h<this.passes-1;h++){t.applyFilter(this,a,u,!0);var l=u;u=a,a=l}t.applyFilter(this,a,r,i),t.returnRenderTarget(s)}},i(h,[{key:"blur",get:function(){return this.strength},set:function(t){this.padding=2*Math.abs(t),this.strength=t}},{key:"quality",get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t}}]),h);function h(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),i=i||5;var n=(0,c.default)(i,!0),o=(0,f.default)(i),s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,u.call(this,n,o));return s.resolution=r||a.settings.RESOLUTION,s._quality=0,s.quality=e||4,s.strength=t||8,s.firstRun=!0,s}r.default=s},{"../../core":79,"./generateBlurFragSource":161,"./generateBlurVertSource":162,"./getMaxBlurKernelSize":163}],160:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var a=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),c=o(t("./generateBlurVertSource")),f=o(t("./generateBlurFragSource")),d=o(t("./getMaxBlurKernelSize"));function o(t){return t&&t.__esModule?t:{default:t}}var u,s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,u=a.Filter),h.prototype.apply=function(t,e,r,i){if(this.firstRun){var n=t.renderer.gl,o=(0,d.default)(n);this.vertexSrc=(0,c.default)(o,!1),this.fragmentSrc=(0,f.default)(o),this.firstRun=!1}if(this.uniforms.strength=1/r.size.height*(r.size.height/e.size.height),this.uniforms.strength*=this.strength,this.uniforms.strength/=this.passes,1===this.passes)t.applyFilter(this,e,r,i);else{for(var s=t.getRenderTarget(!0),a=e,u=s,h=0;h<this.passes-1;h++){t.applyFilter(this,a,u,!0);var l=u;u=a,a=l}t.applyFilter(this,a,r,i),t.returnRenderTarget(s)}},i(h,[{key:"blur",get:function(){return this.strength},set:function(t){this.padding=2*Math.abs(t),this.strength=t}},{key:"quality",get:function(){return this._quality},set:function(t){this._quality=t,this.passes=t}}]),h);function h(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),i=i||5;var n=(0,c.default)(i,!1),o=(0,f.default)(i),s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,u.call(this,n,o));return s.resolution=r||a.settings.RESOLUTION,s._quality=0,s.quality=e||4,s.strength=t||8,s.firstRun=!0,s}r.default=s},{"../../core":79,"./generateBlurFragSource":161,"./generateBlurVertSource":162,"./getMaxBlurKernelSize":163}],161:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){for(var e=u[t],r=e.length,i=h,n="",o=void 0,s=0;s<t;s++){var a="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;".replace("%index%",s);r<=(o=s)&&(o=t-s-1),a=a.replace("%value%",e[o]),n+=a,n+="\n"}return i=(i=i.replace("%blur%",n)).replace("%size%",t)};var u={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},h=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join("\n")},{}],162:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e){var r=Math.ceil(t/2),i=u,n="",o=void 0;o=e?"vBlurTexCoords[%index%] = aTextureCoord + vec2(%sampleIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %sampleIndex% * strength);";for(var s=0;s<t;s++){var a=o.replace("%index%",s);a=a.replace("%sampleIndex%",s-(r-1)+".0"),n+=a,n+="\n"}return i=(i=i.replace("%blur%",n)).replace("%size%",t)};var u=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform float strength;","uniform mat3 projectionMatrix;","varying vec2 vBlurTexCoords[%size%];","void main(void)","{","gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);","%blur%","}"].join("\n")},{}],163:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){var e=t.getParameter(t.MAX_VARYING_VECTORS),r=15;for(;e<r;)r-=2;return r}},{}],164:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core"));t("path");var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.Filter),u.prototype._loadMatrix=function(t){var e=t;1<arguments.length&&void 0!==arguments[1]&&arguments[1]&&(this._multiply(e,this.uniforms.m,t),e=this._colorMatrix(e)),this.uniforms.m=e},u.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19]+e[4],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19]+e[9],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19]+e[14],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19]+e[19],t},u.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},u.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},u.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},u.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)},u.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=(0,Math.sqrt)(1/3),o=[r+1/3*(1-r),1/3*(1-r)-n*i,1/3*(1-r)+n*i,0,0,1/3*(1-r)+n*i,r+1/3*(1-r),1/3*(1-r)-n*i,0,0,1/3*(1-r)-n*i,1/3*(1-r)+n*i,r+1/3*(1-r),0,0,0,0,0,1,0];this._loadMatrix(o,e)},u.prototype.contrast=function(t,e){var r=(t||0)+1,i=-.5*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},u.prototype.saturate=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=arguments[1],r=2*t/3+1,i=-.5*(r-1),n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},u.prototype.desaturate=function(){this.saturate(-1)},u.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)},u.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)},u.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)},u.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)},u.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)},u.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)},u.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)},u.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)},u.prototype.colorTone=function(t,e,r,i,n){var o=((r=r||16770432)>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,u=((i=i||3375104)>>16&255)/255,h=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,u,h,l,e=e||.15,0,o-u,s-h,a-l,0,0];this._loadMatrix(c,n)},u.prototype.night=function(t,e){var r=[-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(r,e)},u.prototype.predator=function(t,e){var r=[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(r,e)},u.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)},u.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)},i(u,[{key:"matrix",get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t}}]),u);function u(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,"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}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 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"));return t.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],t.alpha=1,t}(r.default=a).prototype.grayscale=a.prototype.greyscale},{"../../core":79,path:224}],165:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core"));t("path");var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.Filter),u.prototype.apply=function(t,e,r){this.uniforms.filterMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x,this.uniforms.scale.y=this.scale.y,t.applyFilter(this,e,r)},i(u,[{key:"map",get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t}}]),u);function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var r=new o.Matrix;t.renderable=!1;var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vFilterCoord = ( filterMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vTextureCoord = aTextureCoord;\n}","varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy *= scale / filterArea.xy;\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), filterClamp.xy, filterClamp.zw));\n}\n"));return i.maskSprite=t,i.maskMatrix=r,i.uniforms.mapSampler=t._texture,i.uniforms.filterMatrix=r,i.uniforms.scale={x:1,y:1},null==e&&(e=20),i.scale=new o.Point(e,e),i}r.default=a},{"../../core":79,path:224}],166:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core"));t("path");var n,o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,n=i.Filter),s);function s(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,n.call(this,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\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\nuniform vec4 filterArea;\n\nvarying vec2 vTextureCoord;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\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 = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n\n vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n texcoords(fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}",'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\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 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\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 vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n vec4 color;\n\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n'))}r.default=o},{"../../core":79,path:224}],167:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return c(i).default}});var n=t("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return c(n).default}});var o=t("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return c(o).default}});var s=t("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return c(s).default}});var a=t("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return c(a).default}});var u=t("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return c(u).default}});var h=t("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return c(h).default}});var l=t("./alpha/AlphaFilter");function c(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return c(l).default}})},{"./alpha/AlphaFilter":157,"./blur/BlurFilter":158,"./blur/BlurXFilter":159,"./blur/BlurYFilter":160,"./colormatrix/ColorMatrixFilter":164,"./displacement/DisplacementFilter":165,"./fxaa/FXAAFilter":166,"./noise/NoiseFilter":168}],168:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core"));t("path");var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.Filter),i(u,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(t){this.uniforms.uNoise=t}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(t){this.uniforms.uSeed=t}}]),u);function u(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:.5,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Math.random();!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,"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}","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"));return r.noise=t,r.seed=e,r}r.default=a},{"../../core":79,path:224}],169:[function(g,t,m){(function(t){"use strict";m.__esModule=!0,m.loader=m.prepare=m.particles=m.mesh=m.loaders=m.interaction=m.filters=m.extras=m.extract=m.accessibility=void 0;var e=g("./polyfill");Object.keys(e).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(m,t,{enumerable:!0,get:function(){return e[t]}})});var r=g("./core");Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(m,t,{enumerable:!0,get:function(){return r[t]}})});var i,n=g("./deprecation"),o=(i=n)&&i.__esModule?i:{default:i},s=v(g("./accessibility")),a=v(g("./extract")),u=v(g("./extras")),h=v(g("./filters")),l=v(g("./interaction")),c=v(g("./loaders")),f=v(g("./mesh")),d=v(g("./particles")),p=v(g("./prepare"));function v(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}r.utils.mixins.performMixins();var y=c.shared||null;m.accessibility=s,m.extract=a,m.extras=u,m.filters=h,m.interaction=l,m.loaders=c,m.mesh=f,m.particles=d,m.prepare=p,m.loader=y,"function"==typeof o.default&&(0,o.default)(m),t.PIXI=m}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./accessibility":56,"./core":79,"./deprecation":145,"./extract":147,"./extras":155,"./filters":167,"./interaction":174,"./loaders":177,"./mesh":186,"./particles":189,"./polyfill":196,"./prepare":200}],170:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core"));var s=(a.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)},a.prototype.copyEvent=function(t){t.isPrimary&&(this.isPrimary=!0),this.button=t.button,this.buttons=Number.isInteger(t.buttons)?t.buttons:t.which,this.width=t.width,this.height=t.height,this.tiltX=t.tiltX,this.tiltY=t.tiltY,this.pointerType=t.pointerType,this.pressure=t.pressure,this.rotationAngle=t.rotationAngle,this.twist=t.twist||0,this.tangentialPressure=t.tangentialPressure||0},a.prototype.reset=function(){this.isPrimary=!1},i(a,[{key:"pointerId",get:function(){return this.identifier}}]),a);function a(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.global=new o.Point,this.target=null,this.originalEvent=null,this.identifier=null,this.isPrimary=!1,this.button=0,this.buttons=0,this.width=0,this.height=0,this.tiltX=0,this.tiltY=0,this.pointerType=null,this.pressure=0,this.rotationAngle=0,this.twist=0,this.tangentialPressure=0}r.default=s},{"../core":79}],171:[function(t,e,r){"use strict";r.__esModule=!0;var i=(n.prototype.stopPropagation=function(){this.stopped=!0},n.prototype.reset=function(){this.stopped=!1,this.currentTarget=null,this.target=null},n);function n(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.stopped=!1,this.target=null,this.currentTarget=null,this.type=null,this.data=null}r.default=i},{}],172:[function(t,e,r){"use strict";r.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),o=h(t("./InteractionData")),s=h(t("./InteractionEvent")),d=h(t("./InteractionTrackingData")),a=h(t("eventemitter3")),u=h(t("./interactiveTarget"));function h(t){return t&&t.__esModule?t:{default:t}}n.utils.mixins.delayMixin(n.DisplayObject.prototype,u.default);var l,c={target:null,data:{global:null}},f=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(p,l=a.default),p.prototype.hitTest=function(t,e){return c.target=null,c.data.global=t,e||(e=this.renderer._lastObjectRendered),this.processInteractive(c,e,null,!0),c.target},p.prototype.setTargetElement=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;this.removeEvents(),this.interactionDOMElement=t,this.resolution=e,this.addEvents()},p.prototype.addEvents=function(){this.interactionDOMElement&&(n.ticker.shared.add(this.update,this,n.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)},p.prototype.removeEvents=function(){this.interactionDOMElement&&(n.ticker.shared.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)},p.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.interactionDOMElement))if(this.didMove)this.didMove=!1;else{for(var e in this.cursor=null,this.activeInteractionData)if(this.activeInteractionData.hasOwnProperty(e)){var r=this.activeInteractionData[e];if(r.originalEvent&&"touch"!==r.pointerType){var i=this.configureInteractionEventForDOMEvent(this.eventData,r.originalEvent,r);this.processInteractive(i,this.renderer._lastObjectRendered,this.processPointerOverOut,!0)}}this.setCursorMode(this.cursor)}},p.prototype.setCursorMode=function(t){if(t=t||"default",this.currentCursorMode!==t){this.currentCursorMode=t;var e=this.cursorStyles[t];if(e)switch(void 0===e?"undefined":i(e)){case"string":this.interactionDOMElement.style.cursor=e;break;case"function":e(t);break;case"object":Object.assign(this.interactionDOMElement.style,e)}else"string"!=typeof t||Object.prototype.hasOwnProperty.call(this.cursorStyles,t)||(this.interactionDOMElement.style.cursor=t)}},p.prototype.dispatchEvent=function(t,e,r){r.stopped||(r.currentTarget=t,r.type=e,t.emit(e,r),t[e]&&t[e](r))},p.prototype.mapPositionToPoint=function(t,e,r){var i=void 0;i=this.interactionDOMElement.parentElement?this.interactionDOMElement.getBoundingClientRect():{x:0,y:0,width:0,height:0};var n=navigator.isCocoonJS?this.resolution:1/this.resolution;t.x=(e-i.left)*(this.interactionDOMElement.width/i.width)*n,t.y=(r-i.top)*(this.interactionDOMElement.height/i.height)*n},p.prototype.processInteractive=function(t,e,r,i,n){if(!e||!e.visible)return!1;var o=t.data.global,s=!1,a=n=e.interactive||n,u=!0;if(e.hitArea?(i&&(e.worldTransform.applyInverse(o,this._tempPoint),e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)?s=!0:u=i=!1),a=!1):e._mask&&i&&(e._mask.containsPoint(o)||(u=i=!1)),u&&e.interactiveChildren&&e.children)for(var h=e.children,l=h.length-1;0<=l;l--){var c=h[l],f=this.processInteractive(t,c,r,i,a);if(f){if(!c.parent)continue;a=!1,f&&(t.target&&(i=!1),s=!0)}}return n&&(i&&!t.target&&!e.hitArea&&e.containsPoint&&e.containsPoint(o)&&(s=!0),e.interactive&&(s&&!t.target&&(t.target=e),r&&r(t,e,!!s))),s},p.prototype.onPointerDown=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&t.preventDefault();for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);if(s.data.originalEvent=t,this.processInteractive(s,this.renderer._lastObjectRendered,this.processPointerDown,!0),this.emit("pointerdown",s),"touch"===n.pointerType)this.emit("touchstart",s);else if("mouse"===n.pointerType||"pen"===n.pointerType){var a=2===n.button;this.emit(a?"rightdown":"mousedown",this.eventData)}}}},p.prototype.processPointerDown=function(t,e,r){var i=t.data,n=t.data.identifier;if(r)if(e.trackedPointers[n]||(e.trackedPointers[n]=new d.default(n)),this.dispatchEvent(e,"pointerdown",t),"touch"===i.pointerType)this.dispatchEvent(e,"touchstart",t);else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;o?e.trackedPointers[n].rightDown=!0:e.trackedPointers[n].leftDown=!0,this.dispatchEvent(e,o?"rightdown":"mousedown",t)}},p.prototype.onPointerComplete=function(t,e,r){for(var i=this.normalizeToPointerData(t),n=i.length,o=t.target!==this.interactionDOMElement?"outside":"",s=0;s<n;s++){var a=i[s],u=this.getInteractionDataForPointerId(a),h=this.configureInteractionEventForDOMEvent(this.eventData,a,u);if(h.data.originalEvent=t,this.processInteractive(h,this.renderer._lastObjectRendered,r,e||!o),this.emit(e?"pointercancel":"pointerup"+o,h),"mouse"===a.pointerType||"pen"===a.pointerType){var l=2===a.button;this.emit(l?"rightup"+o:"mouseup"+o,h)}else"touch"===a.pointerType&&(this.emit(e?"touchcancel":"touchend"+o,h),this.releaseInteractionDataForPointerId(a.pointerId,u))}},p.prototype.onPointerCancel=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!0,this.processPointerCancel)},p.prototype.processPointerCancel=function(t,e){var r=t.data,i=t.data.identifier;void 0!==e.trackedPointers[i]&&(delete e.trackedPointers[i],this.dispatchEvent(e,"pointercancel",t),"touch"===r.pointerType&&this.dispatchEvent(e,"touchcancel",t))},p.prototype.onPointerUp=function(t){this.supportsTouchEvents&&"touch"===t.pointerType||this.onPointerComplete(t,!1,this.processPointerUp)},p.prototype.processPointerUp=function(t,e,r){var i=t.data,n=t.data.identifier,o=e.trackedPointers[n],s="touch"===i.pointerType,a="mouse"===i.pointerType||"pen"===i.pointerType,u=!1;if(a){var h=2===i.button,l=d.default.FLAGS,c=h?l.RIGHT_DOWN:l.LEFT_DOWN,f=void 0!==o&&o.flags&c;r?(this.dispatchEvent(e,h?"rightup":"mouseup",t),f&&(this.dispatchEvent(e,h?"rightclick":"click",t),u=!0)):f&&this.dispatchEvent(e,h?"rightupoutside":"mouseupoutside",t),o&&(h?o.rightDown=!1:o.leftDown=!1)}r?(this.dispatchEvent(e,"pointerup",t),s&&this.dispatchEvent(e,"touchend",t),o&&(a&&!u||this.dispatchEvent(e,"pointertap",t),s&&(this.dispatchEvent(e,"tap",t),o.over=!1))):o&&(this.dispatchEvent(e,"pointerupoutside",t),s&&this.dispatchEvent(e,"touchendoutside",t)),o&&o.none&&delete e.trackedPointers[n]},p.prototype.onPointerMove=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t);"mouse"!==e[0].pointerType&&"pen"!==e[0].pointerType||(this.didMove=!0,this.cursor=null);for(var r=e.length,i=0;i<r;i++){var n=e[i],o=this.getInteractionDataForPointerId(n),s=this.configureInteractionEventForDOMEvent(this.eventData,n,o);s.data.originalEvent=t;var a="touch"!==n.pointerType||this.moveWhenInside;this.processInteractive(s,this.renderer._lastObjectRendered,this.processPointerMove,a),this.emit("pointermove",s),"touch"===n.pointerType&&this.emit("touchmove",s),"mouse"!==n.pointerType&&"pen"!==n.pointerType||this.emit("mousemove",s)}"mouse"===e[0].pointerType&&this.setCursorMode(this.cursor)}},p.prototype.processPointerMove=function(t,e,r){var i=t.data,n="touch"===i.pointerType,o="mouse"===i.pointerType||"pen"===i.pointerType;o&&this.processPointerOverOut(t,e,r),this.moveWhenInside&&!r||(this.dispatchEvent(e,"pointermove",t),n&&this.dispatchEvent(e,"touchmove",t),o&&this.dispatchEvent(e,"mousemove",t))},p.prototype.onPointerOut=function(t){if(!this.supportsTouchEvents||"touch"!==t.pointerType){var e=this.normalizeToPointerData(t)[0];"mouse"===e.pointerType&&(this.mouseOverRenderer=!1,this.setCursorMode(null));var r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);i.data.originalEvent=e,this.processInteractive(i,this.renderer._lastObjectRendered,this.processPointerOverOut,!1),this.emit("pointerout",i),"mouse"===e.pointerType||"pen"===e.pointerType?this.emit("mouseout",i):this.releaseInteractionDataForPointerId(r.identifier)}},p.prototype.processPointerOverOut=function(t,e,r){var i=t.data,n=t.data.identifier,o="mouse"===i.pointerType||"pen"===i.pointerType,s=e.trackedPointers[n];r&&!s&&(s=e.trackedPointers[n]=new d.default(n)),void 0!==s&&(r&&this.mouseOverRenderer?(s.over||(s.over=!0,this.dispatchEvent(e,"pointerover",t),o&&this.dispatchEvent(e,"mouseover",t)),o&&null===this.cursor&&(this.cursor=e.cursor)):s.over&&(s.over=!1,this.dispatchEvent(e,"pointerout",this.eventData),o&&this.dispatchEvent(e,"mouseout",t),s.none&&delete e.trackedPointers[n]))},p.prototype.onPointerOver=function(t){var e=this.normalizeToPointerData(t)[0],r=this.getInteractionDataForPointerId(e),i=this.configureInteractionEventForDOMEvent(this.eventData,e,r);"mouse"===(i.data.originalEvent=e).pointerType&&(this.mouseOverRenderer=!0),this.emit("pointerover",i),"mouse"!==e.pointerType&&"pen"!==e.pointerType||this.emit("mouseover",i)},p.prototype.getInteractionDataForPointerId=function(t){var e=t.pointerId,r=void 0;return 1===e||"mouse"===t.pointerType?r=this.mouse:this.activeInteractionData[e]?r=this.activeInteractionData[e]:((r=this.interactionDataPool.pop()||new o.default).identifier=e,this.activeInteractionData[e]=r),r.copyEvent(t),r},p.prototype.releaseInteractionDataForPointerId=function(t){var e=this.activeInteractionData[t];e&&(delete this.activeInteractionData[t],e.reset(),this.interactionDataPool.push(e))},p.prototype.configureInteractionEventForDOMEvent=function(t,e,r){return t.data=r,this.mapPositionToPoint(r.global,e.clientX,e.clientY),navigator.isCocoonJS&&"touch"===e.pointerType&&(r.global.x=r.global.x/this.resolution,r.global.y=r.global.y/this.resolution),"touch"===e.pointerType&&(e.globalX=r.global.x,e.globalY=r.global.y),r.originalEvent=e,t.reset(),t},p.prototype.normalizeToPointerData=function(t){var e=[];if(this.supportsTouchEvents&&t instanceof TouchEvent)for(var r=0,i=t.changedTouches.length;r<i;r++){var n=t.changedTouches[r];void 0===n.button&&(n.button=t.touches.length?1:0),void 0===n.buttons&&(n.buttons=t.touches.length?1:0),void 0===n.isPrimary&&(n.isPrimary=1===t.touches.length&&"touchstart"===t.type),void 0===n.width&&(n.width=n.radiusX||1),void 0===n.height&&(n.height=n.radiusY||1),void 0===n.tiltX&&(n.tiltX=0),void 0===n.tiltY&&(n.tiltY=0),void 0===n.pointerType&&(n.pointerType="touch"),void 0===n.pointerId&&(n.pointerId=n.identifier||0),void 0===n.pressure&&(n.pressure=n.force||.5),void 0===n.twist&&(n.twist=0),void 0===n.tangentialPressure&&(n.tangentialPressure=0),void 0===n.layerX&&(n.layerX=n.offsetX=n.clientX),void 0===n.layerY&&(n.layerY=n.offsetY=n.clientY),n.isNormalized=!0,e.push(n)}else!(t instanceof MouseEvent)||this.supportsPointerEvents&&t instanceof window.PointerEvent||(void 0===t.isPrimary&&(t.isPrimary=!0),void 0===t.width&&(t.width=1),void 0===t.height&&(t.height=1),void 0===t.tiltX&&(t.tiltX=0),void 0===t.tiltY&&(t.tiltY=0),void 0===t.pointerType&&(t.pointerType="mouse"),void 0===t.pointerId&&(t.pointerId=1),void 0===t.pressure&&(t.pressure=.5),void 0===t.twist&&(t.twist=0),void 0===t.tangentialPressure&&(t.tangentialPressure=0),t.isNormalized=!0),e.push(t);return e},p.prototype.destroy=function(){this.removeEvents(),this.removeAllListeners(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactionDOMElement=null,this.onPointerDown=null,this.processPointerDown=null,this.onPointerUp=null,this.processPointerUp=null,this.onPointerCancel=null,this.processPointerCancel=null,this.onPointerMove=null,this.processPointerMove=null,this.onPointerOut=null,this.processPointerOverOut=null,this.onPointerOver=null,this._tempPoint=null},p);function p(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,l.call(this));return e=e||{},r.renderer=t,r.autoPreventDefault=void 0===e.autoPreventDefault||e.autoPreventDefault,r.interactionFrequency=e.interactionFrequency||10,r.mouse=new o.default,r.mouse.identifier=1,r.mouse.global.set(-999999),r.activeInteractionData={},r.activeInteractionData[1]=r.mouse,r.interactionDataPool=[],r.eventData=new s.default,r.interactionDOMElement=null,r.moveWhenInside=!1,r.eventsAdded=!1,r.mouseOverRenderer=!1,r.supportsTouchEvents="ontouchstart"in window,r.supportsPointerEvents=!!window.PointerEvent,r.onPointerUp=r.onPointerUp.bind(r),r.processPointerUp=r.processPointerUp.bind(r),r.onPointerCancel=r.onPointerCancel.bind(r),r.processPointerCancel=r.processPointerCancel.bind(r),r.onPointerDown=r.onPointerDown.bind(r),r.processPointerDown=r.processPointerDown.bind(r),r.onPointerMove=r.onPointerMove.bind(r),r.processPointerMove=r.processPointerMove.bind(r),r.onPointerOut=r.onPointerOut.bind(r),r.processPointerOverOut=r.processPointerOverOut.bind(r),r.onPointerOver=r.onPointerOver.bind(r),r.cursorStyles={default:"inherit",pointer:"pointer"},r.currentCursorMode=null,r.cursor=null,r._tempPoint=new n.Point,r.resolution=1,r.setTargetElement(r.renderer.view,r.renderer.resolution),r}r.default=f,n.WebGLRenderer.registerPlugin("interaction",f),n.CanvasRenderer.registerPlugin("interaction",f)},{"../core":79,"./InteractionData":170,"./InteractionEvent":171,"./InteractionTrackingData":173,"./interactiveTarget":175,eventemitter3:204}],173:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=(s.prototype._doSet=function(t,e){this._flags=e?this._flags|t:this._flags&~t},i(s,[{key:"pointerId",get:function(){return this._pointerId}},{key:"flags",get:function(){return this._flags},set:function(t){this._flags=t}},{key:"none",get:function(){return this._flags===this.constructor.FLAGS.NONE}},{key:"over",get:function(){return 0!=(this._flags&this.constructor.FLAGS.OVER)},set:function(t){this._doSet(this.constructor.FLAGS.OVER,t)}},{key:"rightDown",get:function(){return 0!=(this._flags&this.constructor.FLAGS.RIGHT_DOWN)},set:function(t){this._doSet(this.constructor.FLAGS.RIGHT_DOWN,t)}},{key:"leftDown",get:function(){return 0!=(this._flags&this.constructor.FLAGS.LEFT_DOWN)},set:function(t){this._doSet(this.constructor.FLAGS.LEFT_DOWN,t)}}]),s);function s(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this._pointerId=t,this._flags=s.FLAGS.NONE}(r.default=o).FLAGS=Object.freeze({NONE:0,OVER:1,LEFT_DOWN:2,RIGHT_DOWN:4})},{}],174:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./InteractionData");Object.defineProperty(r,"InteractionData",{enumerable:!0,get:function(){return u(i).default}});var n=t("./InteractionManager");Object.defineProperty(r,"InteractionManager",{enumerable:!0,get:function(){return u(n).default}});var o=t("./interactiveTarget");Object.defineProperty(r,"interactiveTarget",{enumerable:!0,get:function(){return u(o).default}});var s=t("./InteractionTrackingData");Object.defineProperty(r,"InteractionTrackingData",{enumerable:!0,get:function(){return u(s).default}});var a=t("./InteractionEvent");function u(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"InteractionEvent",{enumerable:!0,get:function(){return u(a).default}})},{"./InteractionData":170,"./InteractionEvent":171,"./InteractionManager":172,"./InteractionTrackingData":173,"./interactiveTarget":175}],175:[function(t,e,r){"use strict";r.__esModule=!0,r.default={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}},{}],176:[function(t,e,r){"use strict";r.__esModule=!0,r.parse=v,r.default=function(){return function(e,r){if(e.data&&e.type===p.Resource.TYPE.XML)if(0!==e.data.getElementsByTagName("page").length&&0!==e.data.getElementsByTagName("info").length&&null!==e.data.getElementsByTagName("info")[0].getAttribute("face")){var t=e.isDataUrl?"":d.dirname(e.url);e.isDataUrl&&("."===t&&(t=""),this.baseUrl&&t&&"/"===this.baseUrl.charAt(this.baseUrl.length-1)&&(t+="/")),(t=t.replace(this.baseUrl,""))&&"/"!==t.charAt(t.length-1)&&(t+="/");for(var i=e.data.getElementsByTagName("page"),n={},o=function(t){n[t.metadata.pageFile]=t.texture,Object.keys(n).length===i.length&&(v(e,n),r())},s=0;s<i.length;++s){var a=i[s].getAttribute("file"),u=t+a,h=!1;for(var l in this.resources){var c=this.resources[l];if(c.url===u){c.metadata.pageFile=a,c.texture?o(c):c.onAfterMiddleware.add(o),h=!0;break}}if(!h){var f={crossOrigin:e.crossOrigin,loadType:p.Resource.LOAD_TYPE.IMAGE,metadata:Object.assign({pageFile:a},e.metadata.imageMetadata),parentResource:e};this.add(u,f,o)}}}else r();else r()}};var d=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("path")),p=t("resource-loader"),i=t("../extras");function v(t,e){t.bitmapFont=i.BitmapText.registerFont(t.data,e)}},{"../extras":155,path:224,"resource-loader":210}],177:[function(t,e,r){"use strict";r.__esModule=!0,r.shared=r.Resource=r.textureParser=r.getResourcePath=r.spritesheetParser=r.parseBitmapFontData=r.bitmapFontParser=r.Loader=void 0;var i=t("./bitmapFontParser");Object.defineProperty(r,"bitmapFontParser",{enumerable:!0,get:function(){return h(i).default}}),Object.defineProperty(r,"parseBitmapFontData",{enumerable:!0,get:function(){return i.parse}});var n=t("./spritesheetParser");Object.defineProperty(r,"spritesheetParser",{enumerable:!0,get:function(){return h(n).default}}),Object.defineProperty(r,"getResourcePath",{enumerable:!0,get:function(){return n.getResourcePath}});var o=t("./textureParser");Object.defineProperty(r,"textureParser",{enumerable:!0,get:function(){return h(o).default}});var s=t("resource-loader");Object.defineProperty(r,"Resource",{enumerable:!0,get:function(){return s.Resource}});var a=h(t("../core/Application")),u=h(t("./loader"));function h(t){return t&&t.__esModule?t:{default:t}}r.Loader=u.default;var l=new u.default;l.destroy=function(){},r.shared=l;var c=a.default.prototype;c._loader=null,Object.defineProperty(c,"loader",{get:function(){if(!this._loader){var t=this._options.sharedLoader;this._loader=t?l:new u.default}return this._loader}}),c._parentDestroy=c.destroy,c.destroy=function(t,e){this._loader&&(this._loader.destroy(),this._loader=null),this._parentDestroy(t,e)}},{"../core/Application":57,"./bitmapFontParser":176,"./loader":178,"./spritesheetParser":179,"./textureParser":180,"resource-loader":210}],178:[function(t,e,r){"use strict";r.__esModule=!0;var i=h(t("resource-loader")),n=t("resource-loader/lib/middlewares/parsing/blob"),o=h(t("eventemitter3")),s=h(t("./textureParser")),a=h(t("./spritesheetParser")),u=h(t("./bitmapFontParser"));function h(t){return t&&t.__esModule?t:{default:t}}var l,c=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(f,l=i.default),f.addPixiMiddleware=function(t){f._pixiMiddleware.push(t)},f.prototype.destroy=function(){this.removeAllListeners(),this.reset()},f);function f(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,l.call(this,t,e));o.default.call(i);for(var r=0;r<f._pixiMiddleware.length;++r)i.use(f._pixiMiddleware[r]());return i.onStart.add(function(t){return i.emit("start",t)}),i.onProgress.add(function(t,e){return i.emit("progress",t,e)}),i.onError.add(function(t,e,r){return i.emit("error",t,e,r)}),i.onLoad.add(function(t,e){return i.emit("load",t,e)}),i.onComplete.add(function(t,e){return i.emit("complete",t,e)}),i}for(var d in r.default=c,o.default.prototype)c.prototype[d]=o.default.prototype[d];c._pixiMiddleware=[n.blobMiddlewareFactory,s.default,a.default,u.default];var p=i.default.Resource;p.setExtensionXhrType("fnt",p.XHR_RESPONSE_TYPE.DOCUMENT)},{"./bitmapFontParser":176,"./spritesheetParser":179,"./textureParser":180,eventemitter3:204,"resource-loader":210,"resource-loader/lib/middlewares/parsing/blob":211}],179:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(){return function(r,i){var t=r.name+"_image";if(r.data&&r.type===o.Resource.TYPE.JSON&&r.data.frames&&!this.resources[t]){var e={crossOrigin:r.crossOrigin,metadata:r.metadata.imageMetadata,parentResource:r},n=u(r,this.baseUrl);this.add(t,n,e,function(t){if(t.error)i(t.error);else{var e=new a.Spritesheet(t.texture.baseTexture,r.data,r.url);e.parse(function(){r.spritesheet=e,r.textures=e.textures,i()})}})}else i()}},r.getResourcePath=u;var i,o=t("resource-loader"),n=t("url"),s=(i=n)&&i.__esModule?i:{default:i},a=t("../core");function u(t,e){return t.isDataUrl?t.data.meta.image:s.default.resolve(t.url.replace(e,""),t.data.meta.image)}},{"../core":79,"resource-loader":210,url:230}],180:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(){return function(t,e){t.data&&t.type===n.Resource.TYPE.IMAGE&&(t.texture=s.default.fromLoader(t.data,t.url,t.name)),e()}};var i,n=t("resource-loader"),o=t("../core/textures/Texture"),s=(i=o)&&i.__esModule?i:{default:i}},{"../core/textures/Texture":129,"resource-loader":210}],181:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o,s=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),a=t("../core/textures/Texture"),u=(o=a)&&o.__esModule?o:{default:o};var h,l=new s.Point,c=new s.Polygon,f=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(d,h=s.Container),d.prototype._renderWebGL=function(t){this.refresh(),t.setObjectRenderer(t.plugins[this.pluginName]),t.plugins[this.pluginName].render(this)},d.prototype._renderCanvas=function(t){this.refresh(),t.plugins[this.pluginName].render(this)},d.prototype._onTextureUpdate=function(){this._uvTransform.texture=this._texture,this.refresh()},d.prototype.multiplyUvs=function(){this.uploadUvTransform||this._uvTransform.multiplyUvs(this.uvs)},d.prototype.refresh=function(t){this.autoUpdate&&this.vertexDirty++,this._uvTransform.update(t)&&this._refresh()},d.prototype._refresh=function(){},d.prototype._calculateBounds=function(){this._bounds.addVertices(this.transform,this.vertices,0,this.vertices.length)},d.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,l);for(var e=this.vertices,r=c.points,i=this.indices,n=this.indices.length,o=this.drawMode===d.DRAW_MODES.TRIANGLES?3:1,s=0;s+2<n;s+=o){var a=2*i[s],u=2*i[s+1],h=2*i[s+2];if(r[0]=e[a],r[1]=e[1+a],r[2]=e[u],r[3]=e[1+u],r[4]=e[h],r[5]=e[1+h],c.contains(l.x,l.y))return!0}return!1},d.prototype.destroy=function(t){for(var e in this._glDatas){var r=this._glDatas[e];r.destroy?r.destroy():(r.vertexBuffer&&(r.vertexBuffer.destroy(),r.vertexBuffer=null),r.indexBuffer&&(r.indexBuffer.destroy(),r.indexBuffer=null),r.uvBuffer&&(r.uvBuffer.destroy(),r.uvBuffer=null),r.vao&&(r.vao.destroy(),r.vao=null))}this._glDatas=null,h.prototype.destroy.call(this,t)},i(d,[{key:"texture",get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t)&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this))}},{key:"tint",get:function(){return s.utils.rgb2hex(this.tintRgb)},set:function(t){this.tintRgb=s.utils.hex2rgb(t,this.tintRgb)}}]),d);function d(t,e,r,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,h.call(this));return o._texture=t||u.default.EMPTY,o.uvs=r||new Float32Array([0,0,1,0,1,1,0,1]),o.vertices=e||new Float32Array([0,0,100,0,100,100,0,100]),o.indices=i||new Uint16Array([0,1,3,2]),o.dirty=0,o.indexDirty=0,o.vertexDirty=0,o.autoUpdate=!0,o.blendMode=s.BLEND_MODES.NORMAL,o.canvasPadding=s.settings.MESH_CANVAS_PADDING,o.drawMode=n||d.DRAW_MODES.TRIANGLE_MESH,o.shader=null,o.tintRgb=new Float32Array([1,1,1]),o._glDatas={},o._uvTransform=new s.TextureMatrix(o._texture),o.uploadUvTransform=!1,o.pluginName="mesh",o}(r.default=f).DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":79,"../core/textures/Texture":129}],182:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=s(t("./Plane")),x=s(t("../core/sprites/canvas/CanvasTinter"));function s(t){return t&&t.__esModule?t:{default:t}}var a,u=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,a=o.default),h.prototype.updateHorizontalVertices=function(){var t=this.vertices,e=this._topHeight+this._bottomHeight,r=this._height>e?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},h.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},h.prototype._renderCanvas=function(t){var e=t.context,r=this.worldTransform,i=t.resolution,n=16777215!==this.tint,o=this._texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=x.default.getTintedTexture(this,this.tint));var s=n?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var a=this.vertices,u=this._canvasUvs,h=n?0:o.frame.x,l=n?0:o.frame.y,c=h+o.frame.width,f=l+o.frame.height;u[0]=h,u[1]=h+this._leftWidth,u[2]=c-this._rightWidth,u[3]=c,u[4]=l,u[5]=l+this._topHeight,u[6]=f-this._bottomHeight,u[7]=f;for(var d=0;d<8;d++)u[d]*=o.baseTexture.resolution;e.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),t.roundPixels?e.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i|0,r.ty*i|0):e.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i);for(var p=0;p<3;p++)for(var v=0;v<3;v++){var y=2*v+8*p,g=Math.max(1,u[v+1]-u[v]),m=Math.max(1,u[p+5]-u[p+4]),b=Math.max(1,a[10+y]-a[y]),_=Math.max(1,a[11+y]-a[1+y]);e.drawImage(s,u[v],u[p+4],g,m,a[y],a[1+y],b,_)}},h.prototype._refresh=function(){a.prototype._refresh.call(this);var t=this.uvs,e=this._texture;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var r=1/this._origWidth,i=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=r*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-r*this._rightWidth,t[9]=t[11]=t[13]=t[15]=i*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},i(h,[{key:"width",get:function(){return this._width},set:function(t){this._width=t,this._refresh()}},{key:"height",get:function(){return this._height},set:function(t){this._height=t,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()}}]),h);function h(t,e,r,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,a.call(this,t,4,4));return o._origWidth=t.orig.width,o._origHeight=t.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=void 0!==e?e:10,o._rightWidth=void 0!==i?i:10,o._topHeight=void 0!==r?r:10,o._bottomHeight=void 0!==n?n:10,o._cachedTint=16777215,o._tintedTexture=null,o._canvasUvs=null,o.refresh(!0),o}r.default=u},{"../core/sprites/canvas/CanvasTinter":118,"./Plane":183}],183:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("./Mesh"),o=(i=n)&&i.__esModule?i:{default:i};var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.default),u.prototype._refresh=function(){for(var t=this._texture,e=this.verticesX*this.verticesY,r=[],i=[],n=[],o=this.verticesX-1,s=this.verticesY-1,a=t.width/o,u=t.height/s,h=0;h<e;h++){var l=h%this.verticesX,c=h/this.verticesX|0;r.push(l*a,c*u),i.push(l/o,c/s)}for(var f=o*s,d=0;d<f;d++){var p=d%o,v=d/o|0,y=v*this.verticesX+p,g=v*this.verticesX+p+1,m=(1+v)*this.verticesX+p,b=(1+v)*this.verticesX+p+1;n.push(y,g,m),n.push(g,b,m)}this.vertices=new Float32Array(r),this.uvs=new Float32Array(i),this.colors=new Float32Array([]),this.indices=new Uint16Array(n),this.dirty++,this.indexDirty++,this.multiplyUvs()},u.prototype._onTextureUpdate=function(){o.default.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},u);function u(t,e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var i=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,t));return i._ready=!0,i.verticesX=e||10,i.verticesY=r||10,i.drawMode=o.default.DRAW_MODES.TRIANGLES,i.refresh(),i}r.default=a},{"./Mesh":181}],184:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("./Mesh"),o=(i=n)&&i.__esModule?i:{default:i};var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.default),u.prototype._refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){this.vertices.length/4!==t.length&&(this.vertices=new Float32Array(4*t.length),this.uvs=new Float32Array(4*t.length),this.colors=new Float32Array(2*t.length),this.indices=new Uint16Array(2*t.length));var e=this.uvs,r=this.indices,i=this.colors;e[0]=0,e[1]=0,e[2]=0,e[3]=1,i[0]=1,i[1]=1,r[0]=0,r[1]=1;for(var n=t.length,o=1;o<n;o++){var s=4*o,a=o/(n-1);e[s]=a,e[s+1]=0,e[s+2]=a,e[s+3]=1,i[s=2*o]=1,i[s+1]=1,r[s=2*o]=s,r[s+1]=s+1}this.dirty++,this.indexDirty++,this.multiplyUvs(),this.refreshVertices()}},u.prototype.refreshVertices=function(){var t=this.points;if(!(t.length<1))for(var e=t[0],r=void 0,i=0,n=0,o=this.vertices,s=t.length,a=0;a<s;a++){var u=t[a],h=4*a;n=-((r=a<t.length-1?t[a+1]:u).x-e.x),i=r.y-e.y;var l=10*(1-a/(s-1));1<l&&(l=1);var c=Math.sqrt(i*i+n*n),f=this._texture.height/2;i/=c,n/=c,i*=f,n*=f,o[h]=u.x+i,o[1+h]=u.y+n,o[2+h]=u.x-i,o[3+h]=u.y-n,e=u}},u.prototype.updateTransform=function(){this.autoUpdate&&this.refreshVertices(),this.containerUpdateTransform()},u);function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,t));return r.points=e,r.vertices=new Float32Array(4*e.length),r.uvs=new Float32Array(4*e.length),r.colors=new Float32Array(2*e.length),r.indices=new Uint16Array(2*e.length),r.autoUpdate=!0,r.refresh(),r}r.default=a},{"./Mesh":181}],185:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),o=t("../Mesh"),s=(i=o)&&i.__esModule?i:{default:i};var a=(u.prototype.render=function(t){var e=this.renderer,r=e.context,i=t.worldTransform,n=e.resolution;e.roundPixels?r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n|0,i.ty*n|0):r.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),e.context.globalAlpha=t.worldAlpha,e.setBlendMode(t.blendMode),t.drawMode===s.default.DRAW_MODES.TRIANGLE_MESH?this._renderTriangleMesh(t):this._renderTriangles(t)},u.prototype._renderTriangleMesh=function(t){for(var e=t.vertices.length/2,r=0;r<e-2;r++){var i=2*r;this._renderDrawTriangle(t,i,2+i,4+i)}},u.prototype._renderTriangles=function(t){for(var e=t.indices,r=e.length,i=0;i<r;i+=3){var n=2*e[i],o=2*e[i+1],s=2*e[i+2];this._renderDrawTriangle(t,n,o,s)}},u.prototype._renderDrawTriangle=function(t,e,r,i){var n=this.renderer.context,o=t.uvs,s=t.vertices,a=t._texture;if(a.valid){var u=a.baseTexture,h=u.source,l=u.width,c=u.height,f=void 0,d=void 0,p=void 0,v=void 0,y=void 0,g=void 0;if(t.uploadUvTransform){var m=t._uvTransform.mapCoord;f=(o[e]*m.a+o[e+1]*m.c+m.tx)*u.width,d=(o[r]*m.a+o[r+1]*m.c+m.tx)*u.width,p=(o[i]*m.a+o[i+1]*m.c+m.tx)*u.width,v=(o[e]*m.b+o[e+1]*m.d+m.ty)*u.height,y=(o[r]*m.b+o[r+1]*m.d+m.ty)*u.height,g=(o[i]*m.b+o[i+1]*m.d+m.ty)*u.height}else f=o[e]*u.width,d=o[r]*u.width,p=o[i]*u.width,v=o[e+1]*u.height,y=o[r+1]*u.height,g=o[i+1]*u.height;var b=s[e],_=s[r],x=s[i],w=s[e+1],T=s[r+1],E=s[i+1],O=t.canvasPadding/this.renderer.resolution;if(0<O){var S=O/Math.abs(t.worldTransform.a),M=O/Math.abs(t.worldTransform.d),P=(b+_+x)/3,C=(w+T+E)/3,A=b-P,R=w-C,I=Math.sqrt(A*A+R*R);b=P+A/I*(I+S),w=C+R/I*(I+M),R=T-C,_=P+(A=_-P)/(I=Math.sqrt(A*A+R*R))*(I+S),T=C+R/I*(I+M),R=E-C,x=P+(A=x-P)/(I=Math.sqrt(A*A+R*R))*(I+S),E=C+R/I*(I+M)}n.save(),n.beginPath(),n.moveTo(b,w),n.lineTo(_,T),n.lineTo(x,E),n.closePath(),n.clip();var D=f*y+v*p+d*g-y*p-v*d-f*g,k=b*y+v*x+_*g-y*x-v*_-b*g,L=f*_+b*p+d*x-_*p-b*d-f*x,j=f*y*x+v*_*p+b*d*g-b*y*p-v*d*x-f*_*g,N=w*y+v*E+T*g-y*E-v*T-w*g,B=f*T+w*p+d*E-T*p-w*d-f*E,F=f*y*E+v*T*p+w*d*g-w*y*p-v*d*E-f*T*g;n.transform(k/D,N/D,L/D,B/D,j/D,F/D),n.drawImage(h,0,0,l*u.resolution,c*u.resolution,0,0,l,c),n.restore(),this.renderer.invalidateBlendMode()}},u.prototype.renderMeshFlat=function(t){var e=this.renderer.context,r=t.vertices,i=r.length/2;e.beginPath();for(var n=1;n<i-2;++n){var o=2*n,s=r[o],a=r[1+o],u=r[2+o],h=r[3+o],l=r[4+o],c=r[5+o];e.moveTo(s,a),e.lineTo(u,h),e.lineTo(l,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},u.prototype.destroy=function(){this.renderer=null},u);function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),this.renderer=t}r.default=a,n.CanvasRenderer.registerPlugin("mesh",a)},{"../../core":79,"../Mesh":181}],186:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./Mesh");Object.defineProperty(r,"Mesh",{enumerable:!0,get:function(){return h(i).default}});var n=t("./webgl/MeshRenderer");Object.defineProperty(r,"MeshRenderer",{enumerable:!0,get:function(){return h(n).default}});var o=t("./canvas/CanvasMeshRenderer");Object.defineProperty(r,"CanvasMeshRenderer",{enumerable:!0,get:function(){return h(o).default}});var s=t("./Plane");Object.defineProperty(r,"Plane",{enumerable:!0,get:function(){return h(s).default}});var a=t("./NineSlicePlane");Object.defineProperty(r,"NineSlicePlane",{enumerable:!0,get:function(){return h(a).default}});var u=t("./Rope");function h(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"Rope",{enumerable:!0,get:function(){return h(u).default}})},{"./Mesh":181,"./NineSlicePlane":182,"./Plane":183,"./Rope":184,"./canvas/CanvasMeshRenderer":185,"./webgl/MeshRenderer":187}],187:[function(t,e,r){"use strict";r.__esModule=!0;var s=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),a=i(t("pixi-gl-core")),u=i(t("../Mesh"));t("path");function i(t){return t&&t.__esModule?t:{default:t}}var n,h=s.Matrix.IDENTITY,o=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,n=s.ObjectRenderer),l.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new s.Shader(t,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n","varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n")},l.prototype.render=function(t){var e=this.renderer,r=e.gl,i=t._texture;if(i.valid){var n=t._glDatas[e.CONTEXT_UID];n||(e.bindVao(null),(n={shader:this.shader,vertexBuffer:a.default.GLBuffer.createVertexBuffer(r,t.vertices,r.STREAM_DRAW),uvBuffer:a.default.GLBuffer.createVertexBuffer(r,t.uvs,r.STREAM_DRAW),indexBuffer:a.default.GLBuffer.createIndexBuffer(r,t.indices,r.STATIC_DRAW),vao:null,dirty:t.dirty,indexDirty:t.indexDirty,vertexDirty:t.vertexDirty}).vao=new a.default.VertexArrayObject(r).addIndex(n.indexBuffer).addAttribute(n.vertexBuffer,n.shader.attributes.aVertexPosition,r.FLOAT,!1,8,0).addAttribute(n.uvBuffer,n.shader.attributes.aTextureCoord,r.FLOAT,!1,8,0),t._glDatas[e.CONTEXT_UID]=n),e.bindVao(n.vao),t.dirty!==n.dirty&&(n.dirty=t.dirty,n.uvBuffer.upload(t.uvs)),t.indexDirty!==n.indexDirty&&(n.indexDirty=t.indexDirty,n.indexBuffer.upload(t.indices)),t.vertexDirty!==n.vertexDirty&&(n.vertexDirty=t.vertexDirty,n.vertexBuffer.upload(t.vertices)),e.bindShader(n.shader),n.shader.uniforms.uSampler=e.bindTexture(i),e.state.setBlendMode(s.utils.correctBlendMode(t.blendMode,i.baseTexture.premultipliedAlpha)),n.shader.uniforms.uTransform&&(t.uploadUvTransform?n.shader.uniforms.uTransform=t._uvTransform.mapCoord.toArray(!0):n.shader.uniforms.uTransform=h.toArray(!0)),n.shader.uniforms.translationMatrix=t.worldTransform.toArray(!0),n.shader.uniforms.uColor=s.utils.premultiplyRgba(t.tintRgb,t.worldAlpha,n.shader.uniforms.uColor,i.baseTexture.premultipliedAlpha);var o=t.drawMode===u.default.DRAW_MODES.TRIANGLE_MESH?r.TRIANGLE_STRIP:r.TRIANGLES;n.vao.draw(o,t.indices.length,0)}},l);function l(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,n.call(this,t));return e.shader=null,e}r.default=o,s.WebGLRenderer.registerPlugin("mesh",o)},{"../../core":79,"../Mesh":181,path:224,"pixi-gl-core":29}],188:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),s=t("../core/utils");var a,u=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,a=o.Container),h.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])},h.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},h.prototype.renderWebGL=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.hasLoaded||this.baseTexture.once("update",function(){return e.onChildrenChange(0)})),t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},h.prototype.onChildrenChange=function(t){for(var e=Math.floor(t/this._batchSize);this._bufferUpdateIDs.length<e;)this._bufferUpdateIDs.push(0);this._bufferUpdateIDs[e]=++this._updateID},h.prototype.renderCanvas=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var e=t.context,r=this.worldTransform,i=!0,n=0,o=0,s=0,a=0;t.setBlendMode(this.blendMode),e.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var u=0;u<this.children.length;++u){var h=this.children[u];if(h.visible){var l=h._texture.frame;if(e.globalAlpha=this.worldAlpha*h.alpha,h.rotation%(2*Math.PI)==0)i&&(e.setTransform(r.a,r.b,r.c,r.d,r.tx*t.resolution,r.ty*t.resolution),i=!1),n=h.anchor.x*(-l.width*h.scale.x)+h.position.x+.5,o=h.anchor.y*(-l.height*h.scale.y)+h.position.y+.5,s=l.width*h.scale.x,a=l.height*h.scale.y;else{i||(i=!0),h.displayObjectUpdateTransform();var c=h.worldTransform;t.roundPixels?e.setTransform(c.a,c.b,c.c,c.d,c.tx*t.resolution|0,c.ty*t.resolution|0):e.setTransform(c.a,c.b,c.c,c.d,c.tx*t.resolution,c.ty*t.resolution),n=h.anchor.x*-l.width+.5,o=h.anchor.y*-l.height+.5,s=l.width,a=l.height}var f=h._texture.baseTexture.resolution;e.drawImage(h._texture.baseTexture.source,l.x*f,l.y*f,l.width*f,l.height*f,n*t.resolution,o*t.resolution,s*t.resolution,a*t.resolution)}}}},h.prototype.destroy=function(t){if(a.prototype.destroy.call(this,t),this._buffers)for(var e=0;e<this._buffers.length;++e)this._buffers[e].destroy();this._properties=null,this._buffers=null,this._bufferUpdateIDs=null},i(h,[{key:"tint",get:function(){return this._tint},set:function(t){this._tint=t,(0,s.hex2rgb)(t,this.tintRgb)}}]),h);function h(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1500,e=arguments[1],r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:16384,i=3<arguments.length&&void 0!==arguments[3]&&arguments[3];!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,a.call(this));return 16384<r&&(r=16384),t<r&&(r=t),n._properties=[!1,!0,!1,!1,!1],n._maxSize=t,n._batchSize=r,n._glBuffers={},n._bufferUpdateIDs=[],n._updateID=0,n.interactiveChildren=!1,n.blendMode=o.BLEND_MODES.NORMAL,n.autoResize=i,n.roundPixels=!0,n.baseTexture=null,n.setProperties(e),n._tint=0,n.tintRgb=new Float32Array(4),n.tint=16777215,n}r.default=u},{"../core":79,"../core/utils":139}],189:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./ParticleContainer");Object.defineProperty(r,"ParticleContainer",{enumerable:!0,get:function(){return o(i).default}});var n=t("./webgl/ParticleRenderer");function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"ParticleRenderer",{enumerable:!0,get:function(){return o(n).default}})},{"./ParticleContainer":188,"./webgl/ParticleRenderer":191}],190:[function(t,e,r){"use strict";r.__esModule=!0;var d=i(t("pixi-gl-core")),p=i(t("../../core/utils/createIndicesForQuads"));function i(t){return t&&t.__esModule?t:{default:t}}var n=(s.prototype.initBuffers=function(){var t=this.gl,e=0;this.indices=(0,p.default)(this.size),this.indexBuffer=d.default.GLBuffer.createIndexBuffer(t,this.indices,t.STATIC_DRAW);for(var r=this.dynamicStride=0;r<this.dynamicProperties.length;++r){var i=this.dynamicProperties[r];i.offset=e,e+=i.size,this.dynamicStride+=i.size}var n=new ArrayBuffer(this.size*this.dynamicStride*4*4);this.dynamicData=new Float32Array(n),this.dynamicDataUint32=new Uint32Array(n),this.dynamicBuffer=d.default.GLBuffer.createVertexBuffer(t,n,t.STREAM_DRAW);for(var o=0,s=this.staticStride=0;s<this.staticProperties.length;++s){var a=this.staticProperties[s];a.offset=o,o+=a.size,this.staticStride+=a.size}var u=new ArrayBuffer(this.size*this.staticStride*4*4);this.staticData=new Float32Array(u),this.staticDataUint32=new Uint32Array(u),this.staticBuffer=d.default.GLBuffer.createVertexBuffer(t,u,t.STATIC_DRAW),this.vao=new d.default.VertexArrayObject(t).addIndex(this.indexBuffer);for(var h=0;h<this.dynamicProperties.length;++h){var l=this.dynamicProperties[h];l.unsignedByte?this.vao.addAttribute(this.dynamicBuffer,l.attribute,t.UNSIGNED_BYTE,!0,4*this.dynamicStride,4*l.offset):this.vao.addAttribute(this.dynamicBuffer,l.attribute,t.FLOAT,!1,4*this.dynamicStride,4*l.offset)}for(var c=0;c<this.staticProperties.length;++c){var f=this.staticProperties[c];f.unsignedByte?this.vao.addAttribute(this.staticBuffer,f.attribute,t.UNSIGNED_BYTE,!0,4*this.staticStride,4*f.offset):this.vao.addAttribute(this.staticBuffer,f.attribute,t.FLOAT,!1,4*this.staticStride,4*f.offset)}},s.prototype.uploadDynamic=function(t,e,r){for(var i=0;i<this.dynamicProperties.length;i++){var n=this.dynamicProperties[i];n.uploadFunction(t,e,r,n.unsignedByte?this.dynamicDataUint32:this.dynamicData,this.dynamicStride,n.offset)}this.dynamicBuffer.upload()},s.prototype.uploadStatic=function(t,e,r){for(var i=0;i<this.staticProperties.length;i++){var n=this.staticProperties[i];n.uploadFunction(t,e,r,n.unsignedByte?this.staticDataUint32:this.staticData,this.staticStride,n.offset)}this.staticBuffer.upload()},s.prototype.destroy=function(){this.dynamicProperties=null,this.dynamicBuffer.destroy(),this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this.staticProperties=null,this.staticBuffer.destroy(),this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null},s);function s(t,e,r,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this.gl=t,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(var n=0;n<e.length;++n){var o=e[n];o={attribute:o.attribute,size:o.size,uploadFunction:o.uploadFunction,unsignedByte:o.unsignedByte,offset:o.offset},r[n]?this.dynamicProperties.push(o):this.staticProperties.push(o)}this.staticStride=0,this.staticBuffer=null,this.staticData=null,this.staticDataUint32=null,this.dynamicStride=0,this.dynamicBuffer=null,this.dynamicData=null,this.dynamicDataUint32=null,this._updateID=0,this.initBuffers()}r.default=n},{"../../core/utils/createIndicesForQuads":137,"pixi-gl-core":29}],191:[function(t,e,r){"use strict";r.__esModule=!0;var y=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),i=n(t("./ParticleShader")),a=n(t("./ParticleBuffer")),c=t("../../core/utils");function n(t){return t&&t.__esModule?t:{default:t}}var o,s=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,o=y.ObjectRenderer),u.prototype.onContextChange=function(){var t=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.shader=new i.default(t),this.properties=[{attribute:this.shader.attributes.aVertexPosition,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,size:1,unsignedByte:!0,uploadFunction:this.uploadTint,offset:0}]},u.prototype.start=function(){this.renderer.bindShader(this.shader)},u.prototype.render=function(t){var e=t.children,r=t._maxSize,i=t._batchSize,n=this.renderer,o=e.length;if(0!==o){r<o&&(o=r);var s=t._glBuffers[n.CONTEXT_UID];s||(s=t._glBuffers[n.CONTEXT_UID]=this.generateBuffers(t));var a=e[0]._texture.baseTexture;this.renderer.setBlendMode(y.utils.correctBlendMode(t.blendMode,a.premultipliedAlpha));var u=n.gl,h=t.worldTransform.copy(this.tempMatrix);h.prepend(n._activeRenderTarget.projectionMatrix),this.shader.uniforms.projectionMatrix=h.toArray(!0),this.shader.uniforms.uColor=y.utils.premultiplyRgba(t.tintRgb,t.worldAlpha,this.shader.uniforms.uColor,a.premultipliedAlpha),this.shader.uniforms.uSampler=n.bindTexture(a);for(var l=!1,c=0,f=0;c<o;c+=i,f+=1){var d=o-c;if(i<d&&(d=i),f>=s.length){if(!t.autoResize)break;s.push(this._generateOneMoreBuffer(t))}var p=s[f];p.uploadDynamic(e,c,d);var v=t._bufferUpdateIDs[f]||0;(l=l||p._updateID<v)&&(p._updateID=t._updateID,p.uploadStatic(e,c,d)),n.bindVao(p.vao),p.vao.draw(u.TRIANGLES,6*d)}}},u.prototype.generateBuffers=function(t){for(var e=this.renderer.gl,r=[],i=t._maxSize,n=t._batchSize,o=t._properties,s=0;s<i;s+=n)r.push(new a.default(e,this.properties,o,n));return r},u.prototype._generateOneMoreBuffer=function(t){var e=this.renderer.gl,r=t._batchSize,i=t._properties;return new a.default(e,this.properties,i,r)},u.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s=0,a=0,u=0,h=0,l=0;l<r;++l){var c=t[e+l],f=c._texture,d=c.scale.x,p=c.scale.y,v=f.trim,y=f.orig;v?(s=(a=v.x-c.anchor.x*y.width)+v.width,u=(h=v.y-c.anchor.y*y.height)+v.height):(s=y.width*(1-c.anchor.x),a=y.width*-c.anchor.x,u=y.height*(1-c.anchor.y),h=y.height*-c.anchor.y),i[o]=a*d,i[o+1]=h*p,i[o+n]=s*d,i[o+n+1]=h*p,i[o+2*n]=s*d,i[o+2*n+1]=u*p,i[o+3*n]=a*d,i[o+3*n+1]=u*p,o+=4*n}},u.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},u.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;s<r;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},u.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0),o+=4*n}},u.prototype.uploadTint=function(t,e,r,i,n,o){for(var s=0;s<r;++s){var a=t[e+s],u=a._texture.baseTexture.premultipliedAlpha,h=a.alpha,l=h<1&&u?(0,c.premultiplyTint)(a._tintRGB,h):a._tintRGB+(255*h<<24);i[o]=l,i[o+n]=l,i[o+2*n]=l,i[o+3*n]=l,o+=4*n}},u.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),o.prototype.destroy.call(this),this.shader.destroy(),this.indices=null,this.tempMatrix=null},u);function u(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,o.call(this,t));return e.shader=null,e.indexBuffer=null,e.properties=null,e.tempMatrix=new y.Matrix,e.CONTEXT_UID=0,e}r.default=s,y.WebGLRenderer.registerPlugin("particle",s)},{"../../core":79,"../../core/utils":139,"./ParticleBuffer":190,"./ParticleShader":192}],192:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("../../core/Shader"),o=(i=n)&&i.__esModule?i:{default:i};var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.default),u);function u(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","attribute vec2 aPositionCoord;","attribute float aRotation;","uniform mat3 projectionMatrix;","uniform vec4 uColor;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," vec2 v = vec2(x, y);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor * uColor;","}"].join("\n"),["varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor;"," gl_FragColor = color;","}"].join("\n")))}r.default=a},{"../../core/Shader":58}],193:[function(t,e,r){"use strict";Math.sign||(Math.sign=function(t){return 0===(t=Number(t))||isNaN(t)?t:0<t?1:-1})},{}],194:[function(t,e,r){"use strict";Number.isInteger||(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t})},{}],195:[function(t,e,r){"use strict";var i,n=t("object-assign"),o=(i=n)&&i.__esModule?i:{default:i};Object.assign||(Object.assign=o.default)},{"object-assign":9}],196:[function(t,e,r){"use strict";t("./Object.assign"),t("./requestAnimationFrame"),t("./Math.sign"),t("./Number.isInteger"),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array)},{"./Math.sign":193,"./Number.isInteger":194,"./Object.assign":195,"./requestAnimationFrame":197}],197:[function(t,e,r){(function(t){"use strict";if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var i=Date.now(),r=["ms","moz","webkit","o"],n=0;n<r.length&&!t.requestAnimationFrame;++n){var o=r[n];t.requestAnimationFrame=t[o+"RequestAnimationFrame"],t.cancelAnimationFrame=t[o+"CancelAnimationFrame"]||t[o+"CancelRequestAnimationFrame"]}t.requestAnimationFrame||(t.requestAnimationFrame=function(t){if("function"!=typeof t)throw new TypeError(t+"is not a function");var e=Date.now(),r=16+i-e;return r<0&&(r=0),i=e,setTimeout(function(){i=Date.now(),t(performance.now())},r)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){return clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],198:[function(t,e,r){"use strict";r.__esModule=!0;var i,a=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),n=t("./limiters/CountLimiter"),o=(i=n)&&i.__esModule?i:{default:i};var u=a.ticker.shared;a.settings.UPLOADS_PER_FRAME=4;var s=(h.prototype.upload=function(t,e){"function"==typeof t&&(e=t,t=null),t&&this.add(t),this.queue.length?(e&&this.completes.push(e),this.ticking||(this.ticking=!0,u.addOnce(this.tick,this,a.UPDATE_PRIORITY.UTILITY))):e&&e()},h.prototype.tick=function(){setTimeout(this.delayedTick,0)},h.prototype.prepareItems=function(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){var t=this.queue[0],e=!1;if(t&&!t._destroyed)for(var r=0,i=this.uploadHooks.length;r<i;r++)if(this.uploadHooks[r](this.uploadHookHelper,t)){this.queue.shift(),e=!0;break}e||this.queue.shift()}if(this.queue.length)u.addOnce(this.tick,this,a.UPDATE_PRIORITY.UTILITY);else{this.ticking=!1;for(var n=this.completes.slice(0),o=this.completes.length=0,s=n.length;o<s;o++)n[o]()}},h.prototype.registerFindHook=function(t){return t&&this.addHooks.push(t),this},h.prototype.registerUploadHook=function(t){return t&&this.uploadHooks.push(t),this},h.prototype.add=function(t){for(var e=0,r=this.addHooks.length;e<r&&!this.addHooks[e](t,this.queue);e++);if(t instanceof a.Container)for(var i=t.children.length-1;0<=i;i--)this.add(t.children[i]);return this},h.prototype.destroy=function(){this.ticking&&u.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},h);function h(t){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),this.limiter=new o.default(a.settings.UPLOADS_PER_FRAME),this.renderer=t,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=function(){e.queue&&e.prepareItems()},this.registerFindHook(v),this.registerFindHook(y),this.registerFindHook(l),this.registerFindHook(c),this.registerFindHook(f),this.registerUploadHook(d),this.registerUploadHook(p)}function l(t,e){var r=!1;if(t&&t._textures&&t._textures.length)for(var i=0;i<t._textures.length;i++)if(t._textures[i]instanceof a.Texture){var n=t._textures[i].baseTexture;-1===e.indexOf(n)&&(e.push(n),r=!0)}return r}function c(t,e){return t instanceof a.BaseTexture&&(-1===e.indexOf(t)&&e.push(t),!0)}function f(t,e){if(t._texture&&t._texture instanceof a.Texture){var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function d(t,e){return e instanceof a.Text&&(e.updateText(!0),!0)}function p(t,e){if(e instanceof a.TextStyle){var r=e.toFontString();return a.TextMetrics.measureFont(r),!0}return!1}function v(t,e){if(t instanceof a.Text){-1===e.indexOf(t.style)&&e.push(t.style),-1===e.indexOf(t)&&e.push(t);var r=t._texture.baseTexture;return-1===e.indexOf(r)&&e.push(r),!0}return!1}function y(t,e){return t instanceof a.TextStyle&&(-1===e.indexOf(t)&&e.push(t),!0)}r.default=s},{"../core":79,"./limiters/CountLimiter":201}],199:[function(t,e,r){"use strict";r.__esModule=!0;var i,o=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),n=t("../BasePrepare"),s=(i=n)&&i.__esModule?i:{default:i};var a,u=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,a=s.default),h.prototype.destroy=function(){a.prototype.destroy.call(this),this.ctx=null,this.canvas=null},h);function h(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,a.call(this,t));return(e.uploadHookHelper=e).canvas=document.createElement("canvas"),e.canvas.width=16,e.canvas.height=16,e.ctx=e.canvas.getContext("2d"),e.registerUploadHook(l),e}function l(t,e){if(e instanceof o.BaseTexture){var r=e.source,i=0===r.width?t.canvas.width:Math.min(t.canvas.width,r.width),n=0===r.height?t.canvas.height:Math.min(t.canvas.height,r.height);return t.ctx.drawImage(r,0,0,i,n,0,0,t.canvas.width,t.canvas.height),!0}return!1}r.default=u,o.CanvasRenderer.registerPlugin("prepare",u)},{"../../core":79,"../BasePrepare":198}],200:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./webgl/WebGLPrepare");Object.defineProperty(r,"webgl",{enumerable:!0,get:function(){return u(i).default}});var n=t("./canvas/CanvasPrepare");Object.defineProperty(r,"canvas",{enumerable:!0,get:function(){return u(n).default}});var o=t("./BasePrepare");Object.defineProperty(r,"BasePrepare",{enumerable:!0,get:function(){return u(o).default}});var s=t("./limiters/CountLimiter");Object.defineProperty(r,"CountLimiter",{enumerable:!0,get:function(){return u(s).default}});var a=t("./limiters/TimeLimiter");function u(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"TimeLimiter",{enumerable:!0,get:function(){return u(a).default}})},{"./BasePrepare":198,"./canvas/CanvasPrepare":199,"./limiters/CountLimiter":201,"./limiters/TimeLimiter":202,"./webgl/WebGLPrepare":203}],201:[function(t,e,r){"use strict";r.__esModule=!0;var i=(n.prototype.beginFrame=function(){this.itemsLeft=this.maxItemsPerFrame},n.prototype.allowedToUpload=function(){return 0<this.itemsLeft--},n);function n(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.maxItemsPerFrame=t,this.itemsLeft=0}r.default=i},{}],202:[function(t,e,r){"use strict";r.__esModule=!0;var i=(n.prototype.beginFrame=function(){this.frameStart=Date.now()},n.prototype.allowedToUpload=function(){return Date.now()-this.frameStart<this.maxMilliseconds},n);function n(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),this.maxMilliseconds=t,this.frameStart=0}r.default=i},{}],203:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../../core")),o=t("../BasePrepare"),s=(i=o)&&i.__esModule?i:{default:i};var a,u=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,a=s.default),h);function h(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,a.call(this,t));return e.uploadHookHelper=e.renderer,e.registerFindHook(f),e.registerUploadHook(l),e.registerUploadHook(c),e}function l(t,e){return e instanceof n.BaseTexture&&(e._glTextures[t.CONTEXT_UID]||t.textureManager.updateTexture(e),!0)}function c(t,e){return e instanceof n.Graphics&&(!e.dirty&&!e.clearDirty&&e._webGL[t.plugins.graphics.CONTEXT_UID]||t.plugins.graphics.updateGraphics(e),!0)}function f(t,e){return t instanceof n.Graphics&&(e.push(t),!0)}r.default=u,n.WebGLRenderer.registerPlugin("prepare",u)},{"../../core":79,"../BasePrepare":198}],204:[function(t,e,r){"use strict";var i=Object.prototype.hasOwnProperty,d="~";function h(){}function o(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(){this._events=new h,this._eventsCount=0}Object.create&&(h.prototype=Object.create(null),(new h).__proto__||(d=!1)),n.prototype.eventNames=function(){var t,e,r=[];if(0===this._eventsCount)return r;for(e in t=this._events)i.call(t,e)&&r.push(d?e.slice(1):e);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},n.prototype.listeners=function(t,e){var r=d?d+t:t,i=this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n<o;n++)s[n]=i[n].fn;return s},n.prototype.emit=function(t,e,r,i,n,o){var s=d?d+t:t;if(!this._events[s])return!1;var a,u,h=this._events[s],l=arguments.length;if(h.fn){switch(h.once&&this.removeListener(t,h.fn,void 0,!0),l){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,e),!0;case 3:return h.fn.call(h.context,e,r),!0;case 4:return h.fn.call(h.context,e,r,i),!0;case 5:return h.fn.call(h.context,e,r,i,n),!0;case 6:return h.fn.call(h.context,e,r,i,n,o),!0}for(u=1,a=new Array(l-1);u<l;u++)a[u-1]=arguments[u];h.fn.apply(h.context,a)}else{var c,f=h.length;for(u=0;u<f;u++)switch(h[u].once&&this.removeListener(t,h[u].fn,void 0,!0),l){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,e);break;case 3:h[u].fn.call(h[u].context,e,r);break;case 4:h[u].fn.call(h[u].context,e,r,i);break;default:if(!a)for(c=1,a=new Array(l-1);c<l;c++)a[c-1]=arguments[c];h[u].fn.apply(h[u].context,a)}}return!0},n.prototype.on=function(t,e,r){var i=new o(e,r||this),n=d?d+t:t;return this._events[n]?this._events[n].fn?this._events[n]=[this._events[n],i]:this._events[n].push(i):(this._events[n]=i,this._eventsCount++),this},n.prototype.once=function(t,e,r){var i=new o(e,r||this,!0),n=d?d+t:t;return this._events[n]?this._events[n].fn?this._events[n]=[this._events[n],i]:this._events[n].push(i):(this._events[n]=i,this._eventsCount++),this},n.prototype.removeListener=function(t,e,r,i){var n=d?d+t:t;if(!this._events[n])return this;if(!e)return 0==--this._eventsCount?this._events=new h:delete this._events[n],this;var o=this._events[n];if(o.fn)o.fn!==e||i&&!o.once||r&&o.context!==r||(0==--this._eventsCount?this._events=new h:delete this._events[n]);else{for(var s=0,a=[],u=o.length;s<u;s++)(o[s].fn!==e||i&&!o[s].once||r&&o[s].context!==r)&&a.push(o[s]);a.length?this._events[n]=1===a.length?a[0]:a:0==--this._eventsCount?this._events=new h:delete this._events[n]}return this},n.prototype.removeAllListeners=function(t){var e;return t?(e=d?d+t:t,this._events[e]&&(0==--this._eventsCount?this._events=new h:delete this._events[e])):(this._events=new h,this._eventsCount=0),this},n.prototype.off=n.prototype.removeListener,n.prototype.addListener=n.prototype.on,n.prototype.setMaxListeners=function(){return this},n.prefixed=d,n.EventEmitter=n,void 0!==e&&(e.exports=n)},{}],205:[function(t,e,r){"use strict";e.exports=function(t,e,r){var i,n=t.length;if(!(n<=e||0===r)){var o=n-(r=n<e+r?n-e:r);for(i=e;i<o;++i)t[i]=t[i+r];t.length=o}}},{}],206:[function(t,e,r){"use strict";r.__esModule=!0,r.Loader=void 0;var l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=u(t("mini-signals")),s=u(t("parse-uri")),a=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("./async")),c=t("./Resource");function u(t){return t&&t.__esModule?t:{default:t}}var h=/(#[\w-]+)?$/,f=r.Loader=(d.prototype.add=function(t,e,r,i){if(Array.isArray(t)){for(var n=0;n<t.length;++n)this.add(t[n]);return this}if("object"===(void 0===t?"undefined":l(t))&&(i=e||t.callback||t.onComplete,e=(r=t).url,t=t.name||t.key||t.url),"string"!=typeof e&&(i=r,r=e,e=t),"string"!=typeof e)throw new Error("No url passed to add resource to loader.");if("function"==typeof r&&(i=r,r=null),this.loading&&(!r||!r.parentResource))throw new Error("Cannot add resources while the loader is running.");if(this.resources[t])throw new Error('Resource named "'+t+'" already exists.');if(e=this._prepareUrl(e),this.resources[t]=new c.Resource(t,e,r),"function"==typeof i&&this.resources[t].onAfterMiddleware.once(i),this.loading){for(var o=r.parentResource,s=[],a=0;a<o.children.length;++a)o.children[a].isComplete||s.push(o.children[a]);var u=o.progressChunk*(s.length+1)/(s.length+2);o.children.push(this.resources[t]),o.progressChunk=u;for(var h=0;h<s.length;++h)s[h].progressChunk=u;this.resources[t].progressChunk=u}return this._queue.push(this.resources[t]),this},d.prototype.pre=function(t){return this._beforeMiddleware.push(t),this},d.prototype.use=function(t){return this._afterMiddleware.push(t),this},d.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.kill(),this._queue.pause(),this.resources){var e=this.resources[t];e._onLoadBinding&&e._onLoadBinding.detach(),e.isLoading&&e.abort()}return this.resources={},this},d.prototype.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e=100/this._queue._tasks.length,r=0;r<this._queue._tasks.length;++r)this._queue._tasks[r].data.progressChunk=e;this._onStart(),this._queue.resume()}return this},d.prototype._prepareUrl=function(t){var e=(0,s.default)(t,{strictMode:!0}),r=void 0;if(r=e.protocol||!e.path||0===t.indexOf("//")?t:this.baseUrl.length&&this.baseUrl.lastIndexOf("/")!==this.baseUrl.length-1&&"/"!==t.charAt(0)?this.baseUrl+"/"+t:this.baseUrl+t,this.defaultQueryString){var i=h.exec(r)[0];-1!==(r=r.substr(0,r.length-i.length)).indexOf("?")?r+="&"+this.defaultQueryString:r+="?"+this.defaultQueryString,r+=i}return r},d.prototype._loadResource=function(r,t){var i=this;r._dequeue=t,a.eachSeries(this._beforeMiddleware,function(t,e){t.call(i,r,function(){e(r.isComplete?{}:null)})},function(){r.isComplete?i._onLoad(r):(r._onLoadBinding=r.onComplete.once(i._onLoad,i),r.load())},!0)},d.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},d.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},d.prototype._onLoad=function(r){var i=this;r._onLoadBinding=null,this._resourcesParsing.push(r),r._dequeue(),a.eachSeries(this._afterMiddleware,function(t,e){t.call(i,r,e)},function(){r.onAfterMiddleware.dispatch(r),i.progress=Math.min(100,i.progress+r.progressChunk),i.onProgress.dispatch(i,r),r.error?i.onError.dispatch(r.error,i,r):i.onLoad.dispatch(i,r),i._resourcesParsing.splice(i._resourcesParsing.indexOf(r),1),i._queue.idle()&&0===i._resourcesParsing.length&&i._onComplete()},!0)},i(d,[{key:"concurrency",get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t}}]),d);function d(){var r=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,d),this.baseUrl=t,this.progress=0,this.loading=!1,this.defaultQueryString="",this._beforeMiddleware=[],this._afterMiddleware=[],this._resourcesParsing=[],this._boundLoadResource=function(t,e){return r._loadResource(t,e)},this._queue=a.queue(this._boundLoadResource,e),this._queue.pause(),this.resources={},this.onProgress=new o.default,this.onError=new o.default,this.onLoad=new o.default,this.onStart=new o.default,this.onComplete=new o.default;for(var i=0;i<d._defaultBeforeMiddleware.length;++i)this.pre(d._defaultBeforeMiddleware[i]);for(var n=0;n<d._defaultAfterMiddleware.length;++n)this.use(d._defaultAfterMiddleware[n])}f._defaultBeforeMiddleware=[],f._defaultAfterMiddleware=[],f.pre=function(t){return f._defaultBeforeMiddleware.push(t),f},f.use=function(t){return f._defaultAfterMiddleware.push(t),f}},{"./Resource":207,"./async":208,"mini-signals":8,"parse-uri":10}],207:[function(t,e,r){"use strict";r.__esModule=!0,r.Resource=void 0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=a(t("parse-uri")),s=a(t("mini-signals"));function a(t){return t&&t.__esModule?t:{default:t}}var u=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),h=null;function l(){}var c=r.Resource=(f.setExtensionLoadType=function(t,e){d(f._loadTypeMap,t,e)},f.setExtensionXhrType=function(t,e){d(f._xhrTypeMap,t,e)},f.prototype.complete=function(){this._clearEvents(),this._finish()},f.prototype.abort=function(t){if(!this.error){if(this.error=new Error(t),this._clearEvents(),this.xhr)this.xhr.abort();else if(this.xdr)this.xdr.abort();else if(this.data)if(this.data.src)this.data.src=f.EMPTY_GIF;else for(;this.data.firstChild;)this.data.removeChild(this.data.firstChild);this._finish()}},f.prototype.load=function(t){var e=this;if(!this.isLoading)if(this.isComplete)t&&setTimeout(function(){return t(e)},1);else switch(t&&this.onComplete.once(t),this._setFlag(f.STATUS_FLAGS.LOADING,!0),this.onStart.dispatch(this),!1!==this.crossOrigin&&"string"==typeof this.crossOrigin||(this.crossOrigin=this._determineCrossOrigin(this.url)),this.loadType){case f.LOAD_TYPE.IMAGE:this.type=f.TYPE.IMAGE,this._loadElement("image");break;case f.LOAD_TYPE.AUDIO:this.type=f.TYPE.AUDIO,this._loadSourceElement("audio");break;case f.LOAD_TYPE.VIDEO:this.type=f.TYPE.VIDEO,this._loadSourceElement("video");break;case f.LOAD_TYPE.XHR:default:u&&this.crossOrigin?this._loadXdr():this._loadXhr()}},f.prototype._hasFlag=function(t){return 0!=(this._flags&t)},f.prototype._setFlag=function(t,e){this._flags=e?this._flags|t:this._flags&~t},f.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this.data&&this.data.removeEventListener&&(this.data.removeEventListener("error",this._boundOnError,!1),this.data.removeEventListener("load",this._boundComplete,!1),this.data.removeEventListener("progress",this._boundOnProgress,!1),this.data.removeEventListener("canplaythrough",this._boundComplete,!1)),this.xhr&&(this.xhr.removeEventListener?(this.xhr.removeEventListener("error",this._boundXhrOnError,!1),this.xhr.removeEventListener("timeout",this._boundXhrOnTimeout,!1),this.xhr.removeEventListener("abort",this._boundXhrOnAbort,!1),this.xhr.removeEventListener("progress",this._boundOnProgress,!1),this.xhr.removeEventListener("load",this._boundXhrOnLoad,!1)):(this.xhr.onerror=null,this.xhr.ontimeout=null,this.xhr.onprogress=null,this.xhr.onload=null))},f.prototype._finish=function(){if(this.isComplete)throw new Error("Complete called again for an already completed resource.");this._setFlag(f.STATUS_FLAGS.COMPLETE,!0),this._setFlag(f.STATUS_FLAGS.LOADING,!1),this.onComplete.dispatch(this)},f.prototype._loadElement=function(t){this.metadata.loadElement?this.data=this.metadata.loadElement:"image"===t&&void 0!==window.Image?this.data=new Image:this.data=document.createElement(t),this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),this.metadata.skipSource||(this.data.src=this.url),this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))},f.prototype._loadSourceElement=function(t){if(this.metadata.loadElement?this.data=this.metadata.loadElement:"audio"===t&&void 0!==window.Audio?this.data=new Audio:this.data=document.createElement(t),null!==this.data){if(this.crossOrigin&&(this.data.crossOrigin=this.crossOrigin),!this.metadata.skipSource)if(navigator.isCocoonJS)this.data.src=Array.isArray(this.url)?this.url[0]:this.url;else if(Array.isArray(this.url))for(var e=this.metadata.mimeType,r=0;r<this.url.length;++r)this.data.appendChild(this._createSource(t,this.url[r],Array.isArray(e)?e[r]:e));else{var i=this.metadata.mimeType;this.data.appendChild(this._createSource(t,this.url,Array.isArray(i)?i[0]:i))}this.data.addEventListener("error",this._boundOnError,!1),this.data.addEventListener("load",this._boundComplete,!1),this.data.addEventListener("progress",this._boundOnProgress,!1),this.data.addEventListener("canplaythrough",this._boundComplete,!1),this.data.load(),this.timeout&&(this._elementTimer=setTimeout(this._boundOnTimeout,this.timeout))}else this.abort("Unsupported element: "+t)},f.prototype._loadXhr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XMLHttpRequest;t.open("GET",this.url,!0),t.timeout=this.timeout,this.xhrType===f.XHR_RESPONSE_TYPE.JSON||this.xhrType===f.XHR_RESPONSE_TYPE.DOCUMENT?t.responseType=f.XHR_RESPONSE_TYPE.TEXT:t.responseType=this.xhrType,t.addEventListener("error",this._boundXhrOnError,!1),t.addEventListener("timeout",this._boundXhrOnTimeout,!1),t.addEventListener("abort",this._boundXhrOnAbort,!1),t.addEventListener("progress",this._boundOnProgress,!1),t.addEventListener("load",this._boundXhrOnLoad,!1),t.send()},f.prototype._loadXdr=function(){"string"!=typeof this.xhrType&&(this.xhrType=this._determineXhrType());var t=this.xhr=new XDomainRequest;t.timeout=this.timeout||5e3,t.onerror=this._boundXhrOnError,t.ontimeout=this._boundXhrOnTimeout,t.onprogress=this._boundOnProgress,t.onload=this._boundXhrOnLoad,t.open("GET",this.url,!0),setTimeout(function(){return t.send()},1)},f.prototype._createSource=function(t,e,r){r||(r=t+"/"+this._getExtension(e));var i=document.createElement("source");return i.src=e,i.type=r,i},f.prototype._onError=function(t){this.abort("Failed to load element using: "+t.target.nodeName)},f.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(this,t.loaded/t.total)},f.prototype._onTimeout=function(){this.abort("Load timed out.")},f.prototype._xhrOnError=function(){var t=this.xhr;this.abort(p(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},f.prototype._xhrOnTimeout=function(){var t=this.xhr;this.abort(p(t)+" Request timed out.")},f.prototype._xhrOnAbort=function(){var t=this.xhr;this.abort(p(t)+" Request was aborted by the user.")},f.prototype._xhrOnLoad=function(){var t=this.xhr,e="",r=void 0===t.status?200:t.status;if(""!==t.responseType&&"text"!==t.responseType&&void 0!==t.responseType||(e=t.responseText),0===r&&(0<e.length||t.responseType===f.XHR_RESPONSE_TYPE.BUFFER)?r=200:1223===r&&(r=204),2==(r/100|0)){if(this.xhrType===f.XHR_RESPONSE_TYPE.TEXT)this.data=e,this.type=f.TYPE.TEXT;else if(this.xhrType===f.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(e),this.type=f.TYPE.JSON}catch(t){return void this.abort("Error trying to parse loaded json: "+t)}else if(this.xhrType===f.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var i=new DOMParser;this.data=i.parseFromString(e,"text/xml")}else{var n=document.createElement("div");n.innerHTML=e,this.data=n}this.type=f.TYPE.XML}catch(t){return void this.abort("Error trying to parse loaded xml: "+t)}else this.data=t.response||e;this.complete()}else this.abort("["+t.status+"] "+t.statusText+": "+t.responseURL)},f.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";if(window.origin!==window.location.origin)return"anonymous";e=e||window.location,h||(h=document.createElement("a")),h.href=t;var r=!(t=(0,o.default)(h.href,{strictMode:!0})).port&&""===e.port||t.port===e.port,i=t.protocol?t.protocol+":":"";return t.host===e.hostname&&r&&i===e.protocol?"":"anonymous"},f.prototype._determineXhrType=function(){return f._xhrTypeMap[this.extension]||f.XHR_RESPONSE_TYPE.TEXT},f.prototype._determineLoadType=function(){return f._loadTypeMap[this.extension]||f.LOAD_TYPE.XHR},f.prototype._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("?"),n=t.indexOf("#"),o=Math.min(-1<i?i:t.length,-1<n?n:t.length);e=(t=t.substring(0,o)).substring(t.lastIndexOf(".")+1)}return e.toLowerCase()},f.prototype._getMimeFromXhrType=function(t){switch(t){case f.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case f.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case f.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case f.XHR_RESPONSE_TYPE.JSON:return"application/json";case f.XHR_RESPONSE_TYPE.DEFAULT:case f.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i(f,[{key:"isDataUrl",get:function(){return this._hasFlag(f.STATUS_FLAGS.DATA_URL)}},{key:"isComplete",get:function(){return this._hasFlag(f.STATUS_FLAGS.COMPLETE)}},{key:"isLoading",get:function(){return this._hasFlag(f.STATUS_FLAGS.LOADING)}}]),f);function f(t,e,r){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),"string"!=typeof t||"string"!=typeof e)throw new Error("Both name and url are required for constructing a resource.");r=r||{},this._flags=0,this._setFlag(f.STATUS_FLAGS.DATA_URL,0===e.indexOf("data:")),this.name=t,this.url=e,this.extension=this._getExtension(),this.data=null,this.crossOrigin=!0===r.crossOrigin?"anonymous":r.crossOrigin,this.timeout=r.timeout||0,this.loadType=r.loadType||this._determineLoadType(),this.xhrType=r.xhrType,this.metadata=r.metadata||{},this.error=null,this.xhr=null,this.children=[],this.type=f.TYPE.UNKNOWN,this.progressChunk=0,this._dequeue=l,this._onLoadBinding=null,this._elementTimer=0,this._boundComplete=this.complete.bind(this),this._boundOnError=this._onError.bind(this),this._boundOnProgress=this._onProgress.bind(this),this._boundOnTimeout=this._onTimeout.bind(this),this._boundXhrOnError=this._xhrOnError.bind(this),this._boundXhrOnTimeout=this._xhrOnTimeout.bind(this),this._boundXhrOnAbort=this._xhrOnAbort.bind(this),this._boundXhrOnLoad=this._xhrOnLoad.bind(this),this.onStart=new s.default,this.onProgress=new s.default,this.onComplete=new s.default,this.onAfterMiddleware=new s.default}function d(t,e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t[e]=r)}function p(t){return t.toString().replace("object ","")}c.STATUS_FLAGS={NONE:0,DATA_URL:1,COMPLETE:2,LOADING:4},c.TYPE={UNKNOWN:0,JSON:1,XML:2,IMAGE:3,AUDIO:4,VIDEO:5,TEXT:6},c.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},c.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},c._loadTypeMap={gif:c.LOAD_TYPE.IMAGE,png:c.LOAD_TYPE.IMAGE,bmp:c.LOAD_TYPE.IMAGE,jpg:c.LOAD_TYPE.IMAGE,jpeg:c.LOAD_TYPE.IMAGE,tif:c.LOAD_TYPE.IMAGE,tiff:c.LOAD_TYPE.IMAGE,webp:c.LOAD_TYPE.IMAGE,tga:c.LOAD_TYPE.IMAGE,svg:c.LOAD_TYPE.IMAGE,"svg+xml":c.LOAD_TYPE.IMAGE,mp3:c.LOAD_TYPE.AUDIO,ogg:c.LOAD_TYPE.AUDIO,wav:c.LOAD_TYPE.AUDIO,mp4:c.LOAD_TYPE.VIDEO,webm:c.LOAD_TYPE.VIDEO},c._xhrTypeMap={xhtml:c.XHR_RESPONSE_TYPE.DOCUMENT,html:c.XHR_RESPONSE_TYPE.DOCUMENT,htm:c.XHR_RESPONSE_TYPE.DOCUMENT,xml:c.XHR_RESPONSE_TYPE.DOCUMENT,tmx:c.XHR_RESPONSE_TYPE.DOCUMENT,svg:c.XHR_RESPONSE_TYPE.DOCUMENT,tsx:c.XHR_RESPONSE_TYPE.DOCUMENT,gif:c.XHR_RESPONSE_TYPE.BLOB,png:c.XHR_RESPONSE_TYPE.BLOB,bmp:c.XHR_RESPONSE_TYPE.BLOB,jpg:c.XHR_RESPONSE_TYPE.BLOB,jpeg:c.XHR_RESPONSE_TYPE.BLOB,tif:c.XHR_RESPONSE_TYPE.BLOB,tiff:c.XHR_RESPONSE_TYPE.BLOB,webp:c.XHR_RESPONSE_TYPE.BLOB,tga:c.XHR_RESPONSE_TYPE.BLOB,json:c.XHR_RESPONSE_TYPE.JSON,text:c.XHR_RESPONSE_TYPE.TEXT,txt:c.XHR_RESPONSE_TYPE.TEXT,ttf:c.XHR_RESPONSE_TYPE.BUFFER,otf:c.XHR_RESPONSE_TYPE.BUFFER},c.EMPTY_GIF="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",void 0!==e&&(e.exports.default=c)},{"mini-signals":8,"parse-uri":10}],208:[function(t,e,r){"use strict";function s(){}function a(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null,t.apply(this,arguments)}}r.__esModule=!0,r.eachSeries=function(r,i,n,o){var s=0,a=r.length;!function t(e){e||s===a?n&&n(e):o?setTimeout(function(){i(r[s++],t)},1):i(r[s++],t)}()},r.queue=function(e,t){if(null==t)t=1;else if(0===t)throw new Error("Concurrency must not be zero");var r=0,n={_tasks:[],concurrency:t,saturated:s,unsaturated:s,buffer:t/4,empty:s,drain:s,error:s,started:!1,paused:!1,push:function(t,e){i(t,!1,e)},kill:function(){r=0,n.drain=s,n.started=!1,n._tasks=[]},unshift:function(t,e){i(t,!0,e)},process:function(){for(;!n.paused&&r<n.concurrency&&n._tasks.length;){var t=n._tasks.shift();0===n._tasks.length&&n.empty(),(r+=1)===n.concurrency&&n.saturated(),e(t.data,a(o(t)))}},length:function(){return n._tasks.length},running:function(){return r},idle:function(){return n._tasks.length+r===0},pause:function(){!0!==n.paused&&(n.paused=!0)},resume:function(){if(!1!==n.paused){n.paused=!1;for(var t=1;t<=n.concurrency;t++)n.process()}}};function i(t,e,r){if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(n.started=!0,null==t&&n.idle())setTimeout(function(){return n.drain()},1);else{var i={data:t,callback:"function"==typeof r?r:s};e?n._tasks.unshift(i):n._tasks.push(i),setTimeout(function(){return n.process()},1)}}function o(t){return function(){r-=1,t.callback.apply(t,arguments),null!=arguments[0]&&n.error(arguments[0],t.data),r<=n.concurrency-n.buffer&&n.unsaturated(),n.idle()&&n.drain(),n.process()}}return n}},{}],209:[function(t,e,r){"use strict";r.__esModule=!0,r.encodeBinary=i;var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function i(t){for(var e="",r=0;r<t.length;){for(var i=[0,0,0],n=[0,0,0,0],o=0;o<i.length;++o)r<t.length?i[o]=255&t.charCodeAt(r++):i[o]=0;switch(n[0]=i[0]>>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var s=0;s<n.length;++s)e+=a.charAt(n[s])}return e}void 0!==e&&(e.exports.default=i)},{}],210:[function(t,e,r){"use strict";var i=t("./Loader").Loader,n=t("./Resource").Resource,o=t("./async"),s=t("./b64");i.Resource=n,i.async=o,i.encodeBinary=s,i.base64=s,e.exports=i,e.exports.Loader=i,e.exports.default=i},{"./Loader":206,"./Resource":207,"./async":208,"./b64":209}],211:[function(t,e,r){"use strict";r.__esModule=!0,r.blobMiddlewareFactory=function(){return function(t,e){if(t.data){if(t.xhr&&t.xhrType===n.Resource.XHR_RESPONSE_TYPE.BLOB)if(window.Blob&&"string"!=typeof t.data){if(0===t.data.type.indexOf("image")){var r=s.createObjectURL(t.data);return t.blob=t.data,t.data=new Image,t.data.src=r,t.type=n.Resource.TYPE.IMAGE,void(t.data.onload=function(){s.revokeObjectURL(r),t.data.onload=null,e()})}}else{var i=t.xhr.getResponseHeader("content-type");if(i&&0===i.indexOf("image"))return t.data=new Image,t.data.src="data:"+i+";base64,"+(0,o.encodeBinary)(t.xhr.responseText),t.type=n.Resource.TYPE.IMAGE,void(t.data.onload=function(){t.data.onload=null,e()})}e()}else e()}};var n=t("../../Resource"),o=t("../../b64"),s=window.URL||window.webkitURL},{"../../Resource":207,"../../b64":209}],212:[function(t,e,r){var i=t("./lib/alea"),n=t("./lib/xor128"),o=t("./lib/xorwow"),s=t("./lib/xorshift7"),a=t("./lib/xor4096"),u=t("./lib/tychei"),h=t("./seedrandom");h.alea=i,h.xor128=n,h.xorwow=o,h.xorshift7=s,h.xor4096=a,h.tychei=u,e.exports=h},{"./lib/alea":213,"./lib/tychei":214,"./lib/xor128":215,"./lib/xor4096":216,"./lib/xorshift7":217,"./lib/xorwow":218,"./seedrandom":219}],213:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r=function(){var i=4022871197;return function(t){t=String(t);for(var e=0;e<t.length;e++){var r=.02519603282416938*(i+=t.charCodeAt(e));r-=i=r>>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();e.next=function(){var t=2091639*e.s0+2.3283064365386963e-10*e.c;return e.s0=e.s1,e.s1=e.s2,e.s2=t-(e.c=0|t)},e.c=1,e.s0=r(" "),e.s1=r(" "),e.s2=r(" "),e.s0-=r(t),e.s0<0&&(e.s0+=1),e.s1-=r(t),e.s1<0&&(e.s1+=1),e.s2-=r(t),e.s2<0&&(e.s2+=1),r=null}function s(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function i(t,e){var r=new o(t),i=e&&e.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&s(i,r),n.state=function(){return s(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],214:[function(t,e,r){!function(t,e,r){function o(t){var n=this,e="";n.next=function(){var t=n.b,e=n.c,r=n.d,i=n.a;return t=t<<25^t>>>7^e,e=e-r|0,r=r<<24^r>>>8^i,i=i-t|0,n.b=t=t<<20^t>>>12^e,n.c=e=e-r|0,n.d=r<<16^e>>>16^i,n.a=i-t|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,t===Math.floor(t)?(n.a=t/4294967296|0,n.b=0|t):e+=t;for(var r=0;r<e.length+20;r++)n.b^=0|e.charCodeAt(r),n.next()}function s(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function i(t,e){function r(){return(i.next()>>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&("object"==typeof n&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],215:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:r+=t;for(var i=0;i<r.length+64;i++)e.x^=0|r.charCodeAt(i),e.next()}function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function i(t,e){function r(){return(i.next()>>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&("object"==typeof n&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],216:[function(t,e,r){!function(t,e,r){function o(t){var o=this;o.next=function(){var t,e,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,e=i[n+34&127],t=i[n=n+1&127],e^=e<<13,t^=t<<17,e^=e>>>15,t^=t>>>12,e=i[n]=e^t,o.i=n,e+(r^r>>>16)|0},function(t,e){var r,i,n,o,s,a=[],u=128;for(e===(0|e)?(i=e,e=null):(e+="\0",i=0,u=Math.max(u,e.length)),n=0,o=-32;o<u;++o)e&&(i^=e.charCodeAt((o+32)%e.length)),0===o&&(s=i),i^=i<<10,i^=i>>>15,i^=i<<4,i^=i>>>13,0<=o&&(s=s+1640531527|0,n=0==(r=a[127&o]^=i+s)?n+1:0);for(128<=n&&(a[127&(e&&e.length||0)]=-1),n=127,o=512;0<o;--o)i=a[n+34&127],r=a[n=n+1&127],i^=i<<13,r^=r<<17,i^=i>>>15,r^=r>>>12,a[n]=i^r;t.w=s,t.X=a,t.i=n}(o,t)}function s(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function i(t,e){null==t&&(t=+new Date);function r(){return(i.next()>>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&(n.X&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],217:[function(t,e,r){!function(t,e,r){function o(t){var n=this;n.next=function(){var t,e,r=n.x,i=n.i;return t=r[i],e=(t^=t>>>7)^t<<24,e^=(t=r[i+1&7])^t>>>10,e^=(t=r[i+3&7])^t>>>3,e^=(t=r[i+4&7])^t<<7,t=r[i+7&7],e^=(t^=t<<13)^t<<9,r[i]=e,n.i=i+1&7,e},function(t,e){var r,i=[];if(e===(0|e))i[0]=e;else for(e=""+e,r=0;r<e.length;++r)i[7&r]=i[7&r]<<15^e.charCodeAt(r)+i[r+1&7]<<13;for(;i.length<8;)i.push(0);for(r=0;r<8&&0===i[r];++r);for(8==r?i[7]=-1:i[r],t.x=i,t.i=0,r=256;0<r;--r)t.next()}(n,t)}function s(t,e){return e.x=t.x.slice(),e.i=t.i,e}function i(t,e){null==t&&(t=+new Date);function r(){return(i.next()>>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&(n.x&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],218:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,t===((e.v=0)|t)?e.x=t:r+=t;for(var i=0;i<r.length+64;i++)e.x^=0|r.charCodeAt(i),i==r.length&&(e.d=e.x<<10^e.x>>>4),e.next()}function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function i(t,e){function r(){return(i.next()>>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&("object"==typeof n&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],219:[function(WZb,XZb,YZb){!function(ZZb,$Zb){var i$b,_Zb=eval("this"),a$b=256,e$b=$Zb.pow(a$b,6),f$b=$Zb.pow(2,52),g$b=2*f$b,h$b=a$b-1;function j$b(t,e,r){function i(){for(var t=s.g(6),e=e$b,r=0;t<f$b;)t=(t+r)*a$b,e*=a$b,r=s.g(1);for(;g$b<=t;)t/=2,e/=2,r>>>=1;return(t+r)/e}var n=[],o=n$b(function t(e,r){var i,n=[],o=typeof e;if(r&&"object"==o)for(i in e)try{n.push(t(e[i],r-1))}catch(t){}return n.length?n:"string"==o?e:e+"\0"}((e=1==e?{entropy:!0}:e||{}).entropy?[t,p$b(ZZb)]:null==t?function(){try{var t;return i$b&&(t=i$b.randomBytes)?t=t(a$b):(t=new Uint8Array(a$b),(_Zb.crypto||_Zb.msCrypto).getRandomValues(t)),p$b(t)}catch(t){var e=_Zb.navigator,r=e&&e.plugins;return[+new Date,_Zb,r,_Zb.screen,p$b(ZZb)]}}():t,3),n),s=new k$b(n);return i.int32=function(){return 0|s.g(4)},i.quick=function(){return s.g(4)/4294967296},i.double=i,n$b(p$b(s.S),ZZb),(e.pass||r||function(t,e,r,i){return i&&(i.S&&l$b(i,s),t.state=function(){return l$b(s,{})}),r?($Zb.random=t,e):t})(i,o,"global"in e?e.global:this==$Zb,e.state)}function k$b(t){var e,r=t.length,s=this,i=0,n=s.i=s.j=0,o=s.S=[];for(r||(t=[r++]);i<a$b;)o[i]=i++;for(i=0;i<a$b;i++)o[i]=o[n=h$b&n+t[i%r]+(e=o[i])],o[n]=e;(s.g=function(t){for(var e,r=0,i=s.i,n=s.j,o=s.S;t--;)e=o[i=h$b&i+1],r=r*a$b+o[h$b&(o[i]=o[n=h$b&n+e])+(o[n]=e)];return s.i=i,s.j=n,r})(a$b)}function l$b(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function n$b(t,e){for(var r,i=t+"",n=0;n<i.length;)e[h$b&n]=h$b&(r^=19*e[h$b&n])+i.charCodeAt(n++);return p$b(e)}function p$b(t){return String.fromCharCode.apply(0,t)}if(n$b($Zb.random(),ZZb),"object"==typeof XZb&&XZb.exports){XZb.exports=j$b;try{i$b=WZb("crypto")}catch(t){}}else"function"==typeof define&&define.amd?define(function(){return j$b}):$Zb.seedrandom=j$b}([],Math)},{crypto:223}],220:[function(t,e,r){var i=180/Math.PI,n=Math.PI/180,o=Math.PI/2,s=3*Math.PI/2,a=Math.PI,u=o,h=s,l=a,c=2*Math.PI,f=Math.PI/4,d=Math.PI/2;function p(t,e){var r;return 0<((t-e+Math.PI)%(r=c)+r)%r-Math.PI?1:-1}function v(t,e){var r=Math.abs(t-e)%c;return r>Math.PI?c-r:r}function y(t){return t-c*Math.floor(t/c)}e.exports={UP:o,DOWN:s,LEFT:a,RIGHT:0,NORTH:u,SOUTH:h,WEST:l,EAST:0,PI_2:c,PI_QUARTER:f,PI_HALF:d,toDegrees:function(t){return t*i},toRadians:function(t){return t*n},isAngleBetween:function(t,e,r){if(((r-e)%c+c)%c>=Math.PI){var i=e;e=r,r=i}return e<=r?e<=t&&t<=r:e<=t||t<=r},differenceAnglesSign:p,differenceAngles:v,shortestAngle:function(t,e){return v(e,t)*p(e,t)+t},normalize:y,angleTwoPoints:function(){return 4===arguments.length?Math.atan2(arguments[3]-arguments[1],arguments[2]-arguments[0]):Math.atan2(arguments[1].y-arguments[0].y,arguments[1].x-arguments[0].x)},distanceTwoPoints:function(){return 2===arguments.length?Math.sqrt(Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2)):Math.sqrt(Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2))},distanceTwoPointsSquared:function(){return 2===arguments.length?Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2):Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2)},closestAngle:function(t){var e=v(t,a),r=v(t,0),i=v(t,o),n=v(t,s);return e<=r&&e<=i&&e<=n?a:r<=i&&r<=n?0:i<=n?o:s},equals:function(t,e,r){return r?v(t,e)<r:y(t)===y(e)},explain:function(t){switch(t){case o:return"UP";case s:return"DOWN";case a:return"LEFT";case 0:return"RIGHT";default:return"NOT CARDINAL"}}}},{}],221:[function(t,e,r){var a=t("yy-random");e.exports={poundToHex:function(t){return"0x"+parseInt(t.substr(1)).toString(16)},hexToPound:function(t){return"#"+t.substr(2)},valueToPound:function(t){return"#"+t.toString(16)},hexToHsl:function(t){var e,r,i=this.hexToRgb(t),n=i.r,o=i.g,s=i.b,a=Math.max(n,o,s),u=Math.min(n,o,s),h=(a+u)/2;if(a===u)e=r=0;else{var l=a-u;switch(r=.5<h?l/(2-a-u):l/(a+u),a){case n:e=(o-s)/l+(o<s?6:0);break;case o:e=(s-n)/l+2;break;case s:e=(n-o)/l+4}e/=6}return{h:e,s:r,l:h}},hslToHex:function(t){var e,r,i,n,o,s;function a(t,e,r){return r<0&&(r+=1),1<r&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(s=1===arguments.length?(n=t.h,o=t.s,t.l):(n=t,o=arguments[1],arguments[2]),0===o)e=r=i=s;else{var u=s<.5?s*(1+o):s+o-s*o,h=2*s-u;e=a(h,u,n+1/3),r=a(h,u,n),i=a(h,u,n-1/3)}return this.rgbToHex(255*e,255*r,255*i)},hexToRgb:function(t){if(0===t)t="0x000000";else if("string"!=typeof t){var e="000000"+t.toString(16);t="0x"+e.substr(e.length-6)}var r=/^0x?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null},rgbToHex:function(t,e,r){if(1===arguments.length)if(Array.isArray(t)){var i=t;t=i[0],e=i[1],r=i[2]}else{var n=t.replace(/( *rgb *\( *)|( )|(\) *;?)/,"").split(",");t=n[0],e=n[1],r=n[2]}return"0x"+((1<<24)+(parseInt(t)<<16)+(parseInt(e)<<8)+parseInt(r)).toString(16).slice(1)},darken:function(t,e){return this.blend(e,t,0)},saturate:function(t,e){e=0===e?0:e||10;var r=this.hexToHsl(t);return r.s+=e/100,r.s=Math.min(1,Math.max(0,r.s)),this.hslToHex(r)},desaturate:function(t,e){e=0===e?0:e||10;var r=this.hexToHsl(t);return r.s-=e/100,r.s=Math.min(1,Math.max(0,r.s)),this.hslToHex(r)},blend:function(t,e,r){if(0===t)return e;if(1===t)return r;var i=1-t;return i*(e>>16)+t*(r>>16)<<16|i*(e>>8&255)+t*(r>>8&255)<<8|i*(255&e)+t*(255&r)},random:function(t,e){function r(){return a.range(t,e)}var i=a.pick([{r:1,g:1,b:1},{r:1,g:1,b:0},{r:1,g:0,b:1},{r:0,g:1,b:1},{r:1,g:0,b:0},{r:0,g:1,b:0},{r:0,g:0,b:1}]);return t=t||0,e=e||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(t,e,r,i,n,o){var s={h:a.range(t,e),s:a.range(r,i,!0),l:a.range(n,o,!0)};return this.hslToHex(s)},randomGoldenRatioHSL:function(t,e,r){for(var i=a.get(1,!0),n=[],o=0;o<t;o++)n.push(this.hslToHex(i,e,r)),i=(i+.618033988749895)%1;return n}}},{"yy-random":222}],222:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var o=t("seedrandom"),s=(i(a,[{key:"seed",value:function(t,e){e=e||{},this.generator=o[e.PRNG||"alea"](t,{state:e.state}),this.options=e}},{key:"save",value:function(){if(this.generator!==Math.random)return this.generator.state()}},{key:"restore",value:function(t){this.generator=o[this.options.PRNG||"alea"]("",{state:t})}},{key:"seedOld",value:function(e){this.generator=function(){var t=1e4*Math.sin(e++);return t-Math.floor(t)}}},{key:"separateSeed",value:function(t){var e=new a;return e.seed(t),e}},{key:"reset",value:function(){this.generator=Math.random}},{key:"get",value:function(t,e){var r=t<0?-1:1;return t*=r,(e?this.generator()*t:Math.floor(this.generator()*t))*r}},{key:"getHuge",value:function(){return this.get(Number.MAX_SAFE_INTEGER)}},{key:"middle",value:function(t,e,r){var i=e/2;return this.range(t-i,t+i,r)}},{key:"range",value:function(t,e,r){if(e===t)return e;if(r)return this.get(e-t,!0)+t;var i=void 0;return t<0&&0<e?i=-t+e+1:0===t&&0<e?i=e+1:t<0&&0===e?(i=t-1,t=1):i=t<0&&e<0?e-t-1:e-t+1,Math.floor(this.generator()*i)+t}},{key:"rangeMultiple",value:function(t,e,r,i){for(var n=[],o=0;o<r;o++)n.push(this.range(t,e,i));return n}},{key:"middleMultiple",value:function(t,e,r,i){for(var n=[],o=0;o<r;o++)n.push(t(t,e,i));return n}},{key:"sign",value:function(t){return t=t||.5,this.generator()<t?1:-1}},{key:"chance",value:function(t){return this.generator()<(t||.5)}},{key:"angle",value:function(){return this.get(2*Math.PI,!0)}},{key:"shuffle",value:function(t,e){if(e&&(t=t.slice()),0===t.length)return t;for(var r=t.length,i=void 0,n=void 0;0!==r;)n=this.get(r),i=t[r-=1],t[r]=t[n],t[n]=i;return t}},{key:"pick",value:function(t,e){if(e){var r=this.get(t.length),i=t[r];return t.splice(r,1),i}return t[this.get(t.length)]}},{key:"property",value:function(t){var e,r=0;for(var i in t)this.chance(1/++r)&&(e=i);return e}},{key:"set",value:function(t,e,r){var i,n=[],o=[];for(i=t;i<e;i++)o.push(i);for(i=0;i<r;i++){var s=this.get(o.length);n.push(o[s]),o.splice(s,1)}return n}},{key:"distribution",value:function(t,e,r,i,n,o){var s=Math.floor((e-t)/r),a=s/2,u=s/4,h=[];i&&h.push(t);for(var l=0;l<r;l++)h.push(t+l*s+a+this.range(-u,u,o));return n&&h.push(e),h}},{key:"weightedProbabilityInt",value:function(t,e,r,i){function n(){for(var t=void 0,e=void 0,r=void 0;1<=(r=(t=2*this.get(1,!0)-1)*t+(e=2*this.get(1,!0)-1)*e)||0===r;);return t*Math.sqrt(-2*Math.log(r)/r)}if(i=i||1,!(Math.random()<.81546))return this.range(t,e);for(;;){var o=n()*i+r;if(t<=o&&o<=e)return o}}},{key:"color",value:function(){return this.get(16777215)}}]),a);function a(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),this.generator=Math.random}e.exports=new s},{seedrandom:212}],223:[function(t,e,r){},{}],224:[function(t,e,h){(function(n){function o(t,e){for(var r=0,i=t.length-1;0<=i;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function s(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i<t.length;i++)e(t[i],i,t)&&r.push(t[i]);return r}h.resolve=function(){for(var t="",e=!1,r=arguments.length-1;-1<=r&&!e;r--){var i=0<=r?arguments[r]:n.cwd();if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(t=i+"/"+t,e="/"===i.charAt(0))}return(e?"/":"")+(t=o(s(t.split("/"),function(t){return!!t}),!e).join("/"))||"."},h.normalize=function(t){var e=h.isAbsolute(t),r="/"===i(t,-1);return(t=o(s(t.split("/"),function(t){return!!t}),!e).join("/"))||e||(t="."),t&&r&&(t+="/"),(e?"/":"")+t},h.isAbsolute=function(t){return"/"===t.charAt(0)},h.join=function(){var t=Array.prototype.slice.call(arguments,0);return h.normalize(s(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},h.relative=function(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var r=t.length-1;0<=r&&""===t[r];r--);return r<e?[]:t.slice(e,r-e+1)}t=h.resolve(t).substr(1),e=h.resolve(e).substr(1);for(var i=r(t.split("/")),n=r(e.split("/")),o=Math.min(i.length,n.length),s=o,a=0;a<o;a++)if(i[a]!==n[a]){s=a;break}var u=[];for(a=s;a<i.length;a++)u.push("..");return(u=u.concat(n.slice(s))).join("/")},h.sep="/",h.delimiter=":",h.dirname=function(t){if("string"!=typeof t&&(t+=""),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,i=-1,n=!0,o=t.length-1;1<=o;--o)if(47===(e=t.charCodeAt(o))){if(!n){i=o;break}}else n=!1;return-1===i?r?"/":".":r&&1===i?"/":t.slice(0,i)},h.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,i=-1,n=!0;for(e=t.length-1;0<=e;--e)if(47===t.charCodeAt(e)){if(!n){r=e+1;break}}else-1===i&&(n=!1,i=e+1);return-1===i?"":t.slice(r,i)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},h.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,i=-1,n=!0,o=0,s=t.length-1;0<=s;--s){var a=t.charCodeAt(s);if(47===a){if(n)continue;r=s+1;break}-1===i&&(n=!1,i=s+1),46===a?-1===e?e=s:1!==o&&(o=1):-1!==e&&(o=-1)}return-1===e||-1===i||0===o||1===o&&e===i-1&&e===r+1?"":t.slice(e,i)};var i="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:225}],225:[function(t,e,r){var i,n,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(e){if(i===setTimeout)return setTimeout(e,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(e,0);try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var h,l=[],c=!1,f=-1;function d(){c&&h&&(c=!1,h.length?l=h.concat(l):f=-1,l.length&&p())}function p(){if(!c){var t=u(d);c=!0;for(var e=l.length;e;){for(h=l,l=[];++f<e;)h&&h[f].run();f=-1,e=l.length}h=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(t)}}function v(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new v(t,e)),1!==l.length||c||u(p)},v.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],226:[function(t,I,D){(function(R){!function(t){var e="object"==typeof D&&D&&!D.nodeType&&D,r="object"==typeof I&&I&&!I.nodeType&&I,i="object"==typeof R&&R;i.global!==i&&i.window!==i&&i.self!==i||(t=i);var n,o,g=2147483647,m=36,b=1,_=26,s=38,a=700,x=72,w=128,T="-",u=/^xn--/,h=/[^\x20-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=m-b,E=Math.floor,O=String.fromCharCode;function S(t){throw new RangeError(c[t])}function d(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function p(t,e){var r=t.split("@"),i="";return 1<r.length&&(i=r[0]+"@",t=r[1]),i+d((t=t.replace(l,".")).split("."),e).join(".")}function M(t){for(var e,r,i=[],n=0,o=t.length;n<o;)55296<=(e=t.charCodeAt(n++))&&e<=56319&&n<o?56320==(64512&(r=t.charCodeAt(n++)))?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--):i.push(e);return i}function P(t){return d(t,function(t){var e="";return 65535<t&&(e+=O((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=O(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,r){var i=0;for(t=r?E(t/a):t>>1,t+=E(t/e);f*_>>1<t;i+=m)t=E(t/f);return E(i+(f+1)*t/(t+s))}function v(t){var e,r,i,n,o,s,a,u,h,l,c,f=[],d=t.length,p=0,v=w,y=x;for((r=t.lastIndexOf(T))<0&&(r=0),i=0;i<r;++i)128<=t.charCodeAt(i)&&S("not-basic"),f.push(t.charCodeAt(i));for(n=0<r?r+1:0;n<d;){for(o=p,s=1,a=m;d<=n&&S("invalid-input"),c=t.charCodeAt(n++),(m<=(u=c-48<10?c-22:c-65<26?c-65:c-97<26?c-97:m)||u>E((g-p)/s))&&S("overflow"),p+=u*s,!(u<(h=a<=y?b:y+_<=a?_:a-y));a+=m)s>E(g/(l=m-h))&&S("overflow"),s*=l;y=A(p-o,e=f.length+1,0==o),E(p/e)>g-v&&S("overflow"),v+=E(p/e),p%=e,f.splice(p++,0,v)}return P(f)}function y(t){var e,r,i,n,o,s,a,u,h,l,c,f,d,p,v,y=[];for(f=(t=M(t)).length,e=w,o=x,s=r=0;s<f;++s)(c=t[s])<128&&y.push(O(c));for(i=n=y.length,n&&y.push(T);i<f;){for(a=g,s=0;s<f;++s)e<=(c=t[s])&&c<a&&(a=c);for(a-e>E((g-r)/(d=i+1))&&S("overflow"),r+=(a-e)*d,e=a,s=0;s<f;++s)if((c=t[s])<e&&++r>g&&S("overflow"),c==e){for(u=r,h=m;!(u<(l=h<=o?b:o+_<=h?_:h-o));h+=m)v=u-l,p=m-l,y.push(O(C(l+v%p,0))),u=E(v/p);y.push(O(C(u,0))),o=A(r,d,i==n),r=0,++i}++r,++e}return y.join("")}if(n={version:"1.4.1",ucs2:{decode:M,encode:P},decode:v,encode:y,toASCII:function(t){return p(t,function(t){return h.test(t)?"xn--"+y(t):t})},toUnicode:function(t){return p(t,function(t){return u.test(t)?v(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return n});else if(e&&r)if(I.exports==e)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(e[o]=n[o]);else t.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],227:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a,u,h=t.length;0<s&&s<h&&(h=s);for(var l=0;l<h;++l){var c,f,d,p,v=t[l].replace(o,"%20"),y=v.indexOf(r);f=0<=y?(c=v.substr(0,y),v.substr(y+1)):(c=v,""),d=decodeURIComponent(c),p=decodeURIComponent(f),a=n,u=d,Object.prototype.hasOwnProperty.call(a,u)?g(n[d])?n[d].push(p):n[d]=[n[d],p]:n[d]=p}return n};var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],228:[function(t,e,r){"use strict";function o(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}e.exports=function(r,i,n,t){return i=i||"&",n=n||"=",null===r&&(r=void 0),"object"==typeof r?a(u(r),function(t){var e=encodeURIComponent(o(t))+n;return s(r[t])?a(r[t],function(t){return e+encodeURIComponent(o(t))}).join(i):e+encodeURIComponent(o(r[t]))}).join(i):t?encodeURIComponent(o(t))+n+encodeURIComponent(o(r)):""};var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function a(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}var u=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},{}],229:[function(t,e,r){"use strict";r.decode=r.parse=t("./decode"),r.encode=r.stringify=t("./encode")},{"./decode":227,"./encode":228}],230:[function(t,e,r){"use strict";var D=t("punycode"),k=t("./util");function M(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=o,r.resolve=function(t,e){return o(t,!1,!0).resolve(e)},r.resolveObject=function(t,e){return t?o(t,!1,!0).resolveObject(e):e},r.format=function(t){k.isString(t)&&(t=o(t));return t instanceof M?t.format():M.prototype.format.call(t)},r.Url=M;var L=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,j=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,n=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),N=["'"].concat(n),B=["%","/","?",";","#"].concat(N),F=["/","?","#"],U=/^[+a-z0-9A-Z_-]{0,63}$/,W=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,H={javascript:!0,"javascript:":!0},X={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},z=t("querystring");function o(t,e,r){if(t&&k.isObject(t)&&t instanceof M)return t;var i=new M;return i.parse(t,e,r),i}M.prototype.parse=function(t,e,r){if(!k.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i<t.indexOf("#")?"?":"#",o=t.split(n);o[0]=o[0].replace(/\\/g,"/");var s=t=o.join(n);if(s=s.trim(),!r&&1===t.split("#").length){var a=j.exec(s);if(a)return this.path=s,this.href=s,this.pathname=a[1],a[2]?(this.search=a[2],this.query=e?z.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var u=L.exec(s);if(u){var h=(u=u[0]).toLowerCase();this.protocol=h,s=s.substr(u.length)}if(r||u||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var l="//"===s.substr(0,2);!l||u&&X[u]||(s=s.substr(2),this.slashes=!0)}if(!X[u]&&(l||u&&!G[u])){for(var c,f,d=-1,p=0;p<F.length;p++){-1!==(v=s.indexOf(F[p]))&&(-1===d||v<d)&&(d=v)}-1!==(f=-1===d?s.lastIndexOf("@"):s.lastIndexOf("@",d))&&(c=s.slice(0,f),s=s.slice(f+1),this.auth=decodeURIComponent(c)),d=-1;for(p=0;p<B.length;p++){var v;-1!==(v=s.indexOf(B[p]))&&(-1===d||v<d)&&(d=v)}-1===d&&(d=s.length),this.host=s.slice(0,d),s=s.slice(d),this.parseHost(),this.hostname=this.hostname||"";var y="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!y)for(var g=this.hostname.split(/\./),m=(p=0,g.length);p<m;p++){var b=g[p];if(b&&!b.match(U)){for(var _="",x=0,w=b.length;x<w;x++)127<b.charCodeAt(x)?_+="x":_+=b[x];if(!_.match(U)){var T=g.slice(0,p),E=g.slice(p+1),O=b.match(W);O&&(T.push(O[1]),E.unshift(O[2])),E.length&&(s="/"+E.join(".")+s),this.hostname=T.join(".");break}}}255<this.hostname.length?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=D.toASCII(this.hostname));var S=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+S,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!H[h])for(p=0,m=N.length;p<m;p++){var P=N[p];if(-1!==s.indexOf(P)){var C=encodeURIComponent(P);C===P&&(C=escape(P)),s=s.split(P).join(C)}}var A=s.indexOf("#");-1!==A&&(this.hash=s.substr(A),s=s.slice(0,A));var R=s.indexOf("?");if(-1!==R?(this.search=s.substr(R),this.query=s.substr(R+1),e&&(this.query=z.parse(this.query)),s=s.slice(0,R)):e&&(this.search="",this.query={}),s&&(this.pathname=s),G[h]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){S=this.pathname||"";var I=this.search||"";this.path=S+I}return this.href=this.format(),this},M.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&k.isObject(this.query)&&Object.keys(this.query).length&&(o=z.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||G[e])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),e+n+(r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(s=s.replace("#","%23"))+i},M.prototype.resolve=function(t){return this.resolveObject(o(t,!1,!0)).format()},M.prototype.resolveObject=function(t){if(k.isString(t)){var e=new M;e.parse(t,!1,!0),t=e}for(var r=new M,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),a=0;a<s.length;a++){var u=s[a];"protocol"!==u&&(r[u]=t[u])}return G[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!G[t.protocol]){for(var h=Object.keys(t),l=0;l<h.length;l++){var c=h[l];r[c]=t[c]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||X[t.protocol])r.pathname=t.pathname;else{for(var f=(t.pathname||"").split("/");f.length&&!(t.host=f.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),r.pathname=f.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),g=y||v||r.host&&t.pathname,m=g,b=r.pathname&&r.pathname.split("/")||[],_=(f=t.pathname&&t.pathname.split("/")||[],r.protocol&&!G[r.protocol]);if(_&&(r.hostname="",r.port=null,r.host&&(""===b[0]?b[0]=r.host:b.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===f[0]?f[0]=t.host:f.unshift(t.host)),t.host=null),g=g&&(""===f[0]||""===b[0])),y)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,b=f;else if(f.length)b||(b=[]),b.pop(),b=b.concat(f),r.search=t.search,r.query=t.query;else if(!k.isNullOrUndefined(t.search)){if(_)r.hostname=r.host=b.shift(),(O=!!(r.host&&0<r.host.indexOf("@"))&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift());return r.search=t.search,r.query=t.query,k.isNull(r.pathname)&&k.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!b.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var x=b.slice(-1)[0],w=(r.host||t.host||1<b.length)&&("."===x||".."===x)||""===x,T=0,E=b.length;0<=E;E--)"."===(x=b[E])?b.splice(E,1):".."===x?(b.splice(E,1),T++):T&&(b.splice(E,1),T--);if(!g&&!m)for(;T--;T)b.unshift("..");!g||""===b[0]||b[0]&&"/"===b[0].charAt(0)||b.unshift(""),w&&"/"!==b.join("/").substr(-1)&&b.push("");var O,S=""===b[0]||b[0]&&"/"===b[0].charAt(0);_&&(r.hostname=r.host=S?"":b.length?b.shift():"",(O=!!(r.host&&0<r.host.indexOf("@"))&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift()));return(g=g||r.host&&b.length)&&!S&&b.unshift(""),b.length?r.pathname=b.join("/"):(r.pathname=null,r.path=null),k.isNull(r.pathname)&&k.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},M.prototype.parseHost=function(){var t=this.host,e=i.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":231,punycode:226,querystring:229}],231:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}]},{},[3]);