mirror of
https://github.com/photonstorm/phaser
synced 2024-11-29 08:01:04 +00:00
1 line
No EOL
233 KiB
JavaScript
1 line
No EOL
233 KiB
JavaScript
window.SpinePlugin=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e){function n(t,e,n){var i=n?t[e]:Object.getOwnPropertyDescriptor(t,e);return!n&&i.value&&"object"==typeof i.value&&(i=i.value),!(!i||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(i))&&(void 0===i.enumerable&&(i.enumerable=!0),void 0===i.configurable&&(i.configurable=!0),i)}function i(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!!n&&(n.value&&"object"==typeof n.value&&(n=n.value),!1===n.configurable)}function r(t,e,r,s){for(var o in e)if(e.hasOwnProperty(o)){var h=n(e,o,r);if(!1!==h){if(i((s||t).prototype,o)){if(a.ignoreFinals)continue;throw new Error("cannot override final property '"+o+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,o,h)}else t.prototype[o]=e[o]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var n=0;n<e.length;n++)r(t,e[n].prototype||e[n])}}function a(t){var e,n;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var i=t.Extends;e=function(){i.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,n=t.Extends,delete t.Extends):e.prototype.constructor=e;var a=null;return t.Mixins&&(a=t.Mixins,delete t.Mixins),s(e,a),r(e,t,!0,n),e}a.extend=r,a.mixin=s,a.ignoreFinals=!1,t.exports=a},function(t,e){var n={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null};t.exports=n},function(t,e){t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e){t.exports=function(t,e,n){var i=typeof t;return t&&"number"!==i&&"string"!==i&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:n}},function(t,e){t.exports=function(t,e,n){var i=n-e;return e+((t-e)%i+i)%i}},function(t,e,n){var i=new(n(0))({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new i(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,n=t*t+e*e;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this},transformMat3:function(t){var e=this.x,n=this.y,i=t.val;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},transformMat4:function(t){var e=this.x,n=this.y,i=t.val;return this.x=i[0]*e+i[4]*n+i[12],this.y=i[1]*e+i[5]*n+i[13],this},reset:function(){return this.x=0,this.y=0,this}});i.ZERO=new i,i.RIGHT=new i(1,0),i.LEFT=new i(-1,0),i.UP=new i(0,-1),i.DOWN=new i(0,1),i.ONE=new i(1,1),t.exports=i},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,n){var i=n(1);t.exports=function(t){return t>Math.PI&&(t-=i.PI2),Math.abs(((t+i.TAU)%i.PI2-i.PI2)%i.PI2)}},function(t,e){t.exports=function(t,e,n){return Math.max(e,Math.min(n,t))}},function(t,e,n){var i=n(1);t.exports=function(t){return t*i.RAD_TO_DEG}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=n||0)},up:function(){return this.x=0,this.y=1,this.z=0,this},clone:function(){return new i(this.x,this.y,this.z)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0;return Math.sqrt(e*e+n*n+i*i)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0;return e*e+n*n+i*i},length:function(){var t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)},lengthSq:function(){var t=this.x,e=this.y,n=this.z;return t*t+e*e+n*n},normalize:function(){var t=this.x,e=this.y,n=this.z,i=t*t+e*e+n*n;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i,this.z=n*i),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z;return this.x=n*a-i*s,this.y=i*r-e*a,this.z=e*s-n*r,this},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y,r=this.z;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this},transformMat3:function(t){var e=this.x,n=this.y,i=this.z,r=t.val;return this.x=e*r[0]+n*r[3]+i*r[6],this.y=e*r[1]+n*r[4]+i*r[7],this.z=e*r[2]+n*r[5]+i*r[8],this},transformMat4:function(t){var e=this.x,n=this.y,i=this.z,r=t.val;return this.x=r[0]*e+r[4]*n+r[8]*i+r[12],this.y=r[1]*e+r[5]*n+r[9]*i+r[13],this.z=r[2]*e+r[6]*n+r[10]*i+r[14],this},transformCoordinates:function(t){var e=this.x,n=this.y,i=this.z,r=t.val,s=e*r[0]+n*r[4]+i*r[8]+r[12],a=e*r[1]+n*r[5]+i*r[9]+r[13],o=e*r[2]+n*r[6]+i*r[10]+r[14],h=e*r[3]+n*r[7]+i*r[11]+r[15];return this.x=s/h,this.y=a/h,this.z=o/h,this},transformQuat:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*i-a*n,l=o*n+a*e-r*i,u=o*i+r*n-s*e,c=-r*e-s*n-a*i;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},project:function(t){var e=this.x,n=this.y,i=this.z,r=t.val,s=r[0],a=r[1],o=r[2],h=r[3],l=r[4],u=r[5],c=r[6],f=r[7],d=r[8],p=r[9],v=r[10],m=r[11],g=r[12],y=r[13],x=r[14],w=1/(e*h+n*f+i*m+r[15]);return this.x=(e*s+n*l+i*d+g)*w,this.y=(e*a+n*u+i*p+y)*w,this.z=(e*o+n*c+i*v+x)*w,this},unproject:function(t,e){var n=t.x,i=t.y,r=t.z,s=t.w,a=this.x-n,o=s-this.y-1-i,h=this.z;return this.x=2*a/r-1,this.y=2*o/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});i.ZERO=new i,i.RIGHT=new i(1,0,0),i.LEFT=new i(-1,0,0),i.UP=new i(0,-1,0),i.DOWN=new i(0,1,0),i.FORWARD=new i(0,0,1),i.BACK=new i(0,0,-1),i.ONE=new i(1,1,1),t.exports=i},function(t,e){t.exports=function(t,e,n){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var i=e.split("."),r=t,s=n,a=0;a<i.length;a++){if(!r.hasOwnProperty(i[a])){s=n;break}s=r[i[a]],r=r[i[a]]}return s}return n}return n}},function(t,e,n){var i=n(0),r=n(6),s=n(169),a=n(3),o=n(180),h=n(29),l=n(181),u=n(30),c=new i({initialize:function(t,e){this.loader=t,this.cache=a(e,"cache",!1),this.type=a(e,"type",!1),this.key=a(e,"key",!1);var n=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+n),!this.type||!this.key)throw new Error("Error calling 'Loader."+this.type+"' invalid key provided.");this.url=a(e,"url"),void 0===this.url?this.url=t.path+n+"."+a(e,"extension",""):"function"!=typeof this.url&&(this.url=t.path+this.url),this.src="",this.xhrSettings=u(a(e,"responseType",void 0)),a(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,a(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=a(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.src=o(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var n=t.responseURL&&0===t.responseURL.indexOf("file://")&&0===e.target.status,i=!(e.target&&200!==e.target.status)||n;4===t.readyState&&t.status>=400&&t.status<=599&&(i=!1),this.resetXHR(),this.loader.nextFile(this,i)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,n=this.type;this.loader.emit(s.FILE_COMPLETE,e,n,t),this.loader.emit(s.FILE_KEY_COMPLETE+n+"-"+e,e,n,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,n){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var i=new FileReader;i.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||n)+";base64,"+i.result.split(",")[1]},i.onerror=t.onerror,i.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){var n={},i={install:function(t){for(var e in n)t[e]=n[e]},register:function(t,e){n[t]=e},destroy:function(){n={}}};t.exports=i},function(t,e,n){var i=n(2),r=function(){var t,e,n,s,a,o,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l<u;l++)if(null!=(t=arguments[l]))for(e in t)n=h[e],h!==(s=t[e])&&(c&&s&&(i(s)||(a=Array.isArray(s)))?(a?(a=!1,o=n&&Array.isArray(n)?n:[]):o=n&&i(n)?n:{},h[e]=r(c,o,s)):void 0!==s&&(h[e]=s));return h};t.exports=r},function(t,e){t.exports=function(t,e,n,i){return Math.atan2(i-e,n-t)}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e,n){var i=n(4);t.exports=function(t){return i(t,-Math.PI,Math.PI)}},function(t,e,n){var i=n(4);t.exports=function(t){return i(t,-180,180)}},function(t,e,n){var i=n(20);t.exports=function(t,e){return i(t)/i(e)/i(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,n,i,r){var s=.5*(i-e),a=.5*(r-n),o=t*t;return(2*n-2*i+s+a)*(t*o)+(-3*n+3*i-2*s-a)*o+s*t+n}},function(t,e){t.exports=function(t,e,n){return(e-t)*n+t}},function(t,e){t.exports=function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)}},function(t,e){t.exports=function(t,e,n){return(t=Math.max(0,Math.min(1,(t-e)/(n-e))))*t*t*(t*(6*t-15)+10)}},function(t,e,n){var i=n(1);t.exports=function(t){return t*i.DEG_TO_RAD}},function(t,e,n){var i=new(n(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new i(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,n=t.val;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},fromMat4:function(t){var e=t.val,n=this.val;return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[4],n[4]=e[5],n[5]=e[6],n[6]=e[8],n[7]=e[9],n[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],n=t[2],i=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=n,t[7]=i,this},invert:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=l*s-a*h,c=-l*r+a*o,f=h*r-s*o,d=e*u+n*c+i*f;return d?(d=1/d,t[0]=u*d,t[1]=(-l*n+i*h)*d,t[2]=(a*n-i*s)*d,t[3]=c*d,t[4]=(l*e-i*o)*d,t[5]=(-a*e+i*r)*d,t[6]=f*d,t[7]=(-h*e+n*o)*d,t[8]=(s*e-n*r)*d,this):null},adjoint:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return t[0]=s*l-a*h,t[1]=i*h-n*l,t[2]=n*a-i*s,t[3]=a*o-r*l,t[4]=e*l-i*o,t[5]=i*r-e*a,t[6]=r*h-s*o,t[7]=n*o-e*h,t[8]=e*s-n*r,this},determinant:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8];return e*(l*s-a*h)+n*(-l*r+a*o)+i*(h*r-s*o)},multiply:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=t.val,f=c[0],d=c[1],p=c[2],v=c[3],m=c[4],g=c[5],y=c[6],x=c[7],w=c[8];return e[0]=f*n+d*s+p*h,e[1]=f*i+d*a+p*l,e[2]=f*r+d*o+p*u,e[3]=v*n+m*s+g*h,e[4]=v*i+m*a+g*l,e[5]=v*r+m*o+g*u,e[6]=y*n+x*s+w*h,e[7]=y*i+x*a+w*l,e[8]=y*r+x*o+w*u,this},translate:function(t){var e=this.val,n=t.x,i=t.y;return e[6]=n*e[0]+i*e[3]+e[6],e[7]=n*e[1]+i*e[4]+e[7],e[8]=n*e[2]+i*e[5]+e[8],this},rotate:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*n+h*s,e[1]=l*i+h*a,e[2]=l*r+h*o,e[3]=l*s-h*n,e[4]=l*a-h*i,e[5]=l*o-h*r,this},scale:function(t){var e=this.val,n=t.x,i=t.y;return e[0]=n*e[0],e[1]=n*e[1],e[2]=n*e[2],e[3]=i*e[3],e[4]=i*e[4],e[5]=i*e[5],this},fromQuat:function(t){var e=t.x,n=t.y,i=t.z,r=t.w,s=e+e,a=n+n,o=i+i,h=e*s,l=e*a,u=e*o,c=n*a,f=n*o,d=i*o,p=r*s,v=r*a,m=r*o,g=this.val;return g[0]=1-(c+d),g[3]=l+m,g[6]=u-v,g[1]=l-m,g[4]=1-(h+d),g[7]=f+p,g[2]=u+v,g[5]=f-p,g[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,n=this.val,i=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],p=e[11],v=e[12],m=e[13],g=e[14],y=e[15],x=i*h-r*o,w=i*l-s*o,M=i*u-a*o,E=r*l-s*h,T=r*u-a*h,A=s*u-a*l,b=c*m-f*v,R=c*g-d*v,I=c*y-p*v,S=f*g-d*m,C=f*y-p*m,P=d*y-p*g,k=x*P-w*C+M*S+E*I-T*R+A*b;return k?(k=1/k,n[0]=(h*P-l*C+u*S)*k,n[1]=(l*I-o*P-u*R)*k,n[2]=(o*C-h*I+u*b)*k,n[3]=(s*C-r*P-a*S)*k,n[4]=(i*P-s*I+a*R)*k,n[5]=(r*I-i*C-a*b)*k,n[6]=(m*A-g*T+y*E)*k,n[7]=(g*M-v*A-y*w)*k,n[8]=(v*T-m*M+y*x)*k,this):null}});t.exports=i},function(t,e,n){var i=new(n(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new i(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,n=t.val;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,n){this.identity();var i=this.val;return i[12]=t,i[13]=e,i[14]=n,this},scaling:function(t,e,n){this.zero();var i=this.val;return i[0]=t,i[5]=e,i[10]=n,i[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],n=t[2],i=t[3],r=t[6],s=t[7],a=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=n,t[9]=r,t[11]=t[14],t[12]=i,t[13]=s,t[14]=a,this},invert:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15],g=e*a-n*s,y=e*o-i*s,x=e*h-r*s,w=n*o-i*a,M=n*h-r*a,E=i*h-r*o,T=l*p-u*d,A=l*v-c*d,b=l*m-f*d,R=u*v-c*p,I=u*m-f*p,S=c*m-f*v,C=g*S-y*I+x*R+w*b-M*A+E*T;return C?(C=1/C,t[0]=(a*S-o*I+h*R)*C,t[1]=(i*I-n*S-r*R)*C,t[2]=(p*E-v*M+m*w)*C,t[3]=(c*M-u*E-f*w)*C,t[4]=(o*b-s*S-h*A)*C,t[5]=(e*S-i*b+r*A)*C,t[6]=(v*x-d*E-m*y)*C,t[7]=(l*E-c*x+f*y)*C,t[8]=(s*I-a*b+h*T)*C,t[9]=(n*b-e*I-r*T)*C,t[10]=(d*M-p*x+m*g)*C,t[11]=(u*x-l*M-f*g)*C,t[12]=(a*A-s*R-o*T)*C,t[13]=(e*R-n*A+i*T)*C,t[14]=(p*y-d*w-v*g)*C,t[15]=(l*w-u*y+c*g)*C,this):null},adjoint:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];return t[0]=a*(c*m-f*v)-u*(o*m-h*v)+p*(o*f-h*c),t[1]=-(n*(c*m-f*v)-u*(i*m-r*v)+p*(i*f-r*c)),t[2]=n*(o*m-h*v)-a*(i*m-r*v)+p*(i*h-r*o),t[3]=-(n*(o*f-h*c)-a*(i*f-r*c)+u*(i*h-r*o)),t[4]=-(s*(c*m-f*v)-l*(o*m-h*v)+d*(o*f-h*c)),t[5]=e*(c*m-f*v)-l*(i*m-r*v)+d*(i*f-r*c),t[6]=-(e*(o*m-h*v)-s*(i*m-r*v)+d*(i*h-r*o)),t[7]=e*(o*f-h*c)-s*(i*f-r*c)+l*(i*h-r*o),t[8]=s*(u*m-f*p)-l*(a*m-h*p)+d*(a*f-h*u),t[9]=-(e*(u*m-f*p)-l*(n*m-r*p)+d*(n*f-r*u)),t[10]=e*(a*m-h*p)-s*(n*m-r*p)+d*(n*h-r*a),t[11]=-(e*(a*f-h*u)-s*(n*f-r*u)+l*(n*h-r*a)),t[12]=-(s*(u*v-c*p)-l*(a*v-o*p)+d*(a*c-o*u)),t[13]=e*(u*v-c*p)-l*(n*v-i*p)+d*(n*c-i*u),t[14]=-(e*(a*v-o*p)-s*(n*v-i*p)+d*(n*o-i*a)),t[15]=e*(a*c-o*u)-s*(n*c-i*u)+l*(n*o-i*a),this},determinant:function(){var t=this.val,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],h=t[7],l=t[8],u=t[9],c=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];return(e*a-n*s)*(c*m-f*v)-(e*o-i*s)*(u*m-f*p)+(e*h-r*s)*(u*v-c*p)+(n*o-i*a)*(l*m-f*d)-(n*h-r*a)*(l*v-c*d)+(i*h-r*o)*(l*p-u*d)},multiply:function(t){var e=this.val,n=e[0],i=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],u=e[8],c=e[9],f=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],y=t.val,x=y[0],w=y[1],M=y[2],E=y[3];return e[0]=x*n+w*a+M*u+E*p,e[1]=x*i+w*o+M*c+E*v,e[2]=x*r+w*h+M*f+E*m,e[3]=x*s+w*l+M*d+E*g,x=y[4],w=y[5],M=y[6],E=y[7],e[4]=x*n+w*a+M*u+E*p,e[5]=x*i+w*o+M*c+E*v,e[6]=x*r+w*h+M*f+E*m,e[7]=x*s+w*l+M*d+E*g,x=y[8],w=y[9],M=y[10],E=y[11],e[8]=x*n+w*a+M*u+E*p,e[9]=x*i+w*o+M*c+E*v,e[10]=x*r+w*h+M*f+E*m,e[11]=x*s+w*l+M*d+E*g,x=y[12],w=y[13],M=y[14],E=y[15],e[12]=x*n+w*a+M*u+E*p,e[13]=x*i+w*o+M*c+E*v,e[14]=x*r+w*h+M*f+E*m,e[15]=x*s+w*l+M*d+E*g,this},multiplyLocal:function(t){var e=[],n=this.val,i=t.val;return e[0]=n[0]*i[0]+n[1]*i[4]+n[2]*i[8]+n[3]*i[12],e[1]=n[0]*i[1]+n[1]*i[5]+n[2]*i[9]+n[3]*i[13],e[2]=n[0]*i[2]+n[1]*i[6]+n[2]*i[10]+n[3]*i[14],e[3]=n[0]*i[3]+n[1]*i[7]+n[2]*i[11]+n[3]*i[15],e[4]=n[4]*i[0]+n[5]*i[4]+n[6]*i[8]+n[7]*i[12],e[5]=n[4]*i[1]+n[5]*i[5]+n[6]*i[9]+n[7]*i[13],e[6]=n[4]*i[2]+n[5]*i[6]+n[6]*i[10]+n[7]*i[14],e[7]=n[4]*i[3]+n[5]*i[7]+n[6]*i[11]+n[7]*i[15],e[8]=n[8]*i[0]+n[9]*i[4]+n[10]*i[8]+n[11]*i[12],e[9]=n[8]*i[1]+n[9]*i[5]+n[10]*i[9]+n[11]*i[13],e[10]=n[8]*i[2]+n[9]*i[6]+n[10]*i[10]+n[11]*i[14],e[11]=n[8]*i[3]+n[9]*i[7]+n[10]*i[11]+n[11]*i[15],e[12]=n[12]*i[0]+n[13]*i[4]+n[14]*i[8]+n[15]*i[12],e[13]=n[12]*i[1]+n[13]*i[5]+n[14]*i[9]+n[15]*i[13],e[14]=n[12]*i[2]+n[13]*i[6]+n[14]*i[10]+n[15]*i[14],e[15]=n[12]*i[3]+n[13]*i[7]+n[14]*i[11]+n[15]*i[15],this.fromArray(e)},translate:function(t){var e=t.x,n=t.y,i=t.z,r=this.val;return r[12]=r[0]*e+r[4]*n+r[8]*i+r[12],r[13]=r[1]*e+r[5]*n+r[9]*i+r[13],r[14]=r[2]*e+r[6]*n+r[10]*i+r[14],r[15]=r[3]*e+r[7]*n+r[11]*i+r[15],this},translateXYZ:function(t,e,n){var i=this.val;return i[12]=i[0]*t+i[4]*e+i[8]*n+i[12],i[13]=i[1]*t+i[5]*e+i[9]*n+i[13],i[14]=i[2]*t+i[6]*e+i[10]*n+i[14],i[15]=i[3]*t+i[7]*e+i[11]*n+i[15],this},scale:function(t){var e=t.x,n=t.y,i=t.z,r=this.val;return r[0]=r[0]*e,r[1]=r[1]*e,r[2]=r[2]*e,r[3]=r[3]*e,r[4]=r[4]*n,r[5]=r[5]*n,r[6]=r[6]*n,r[7]=r[7]*n,r[8]=r[8]*i,r[9]=r[9]*i,r[10]=r[10]*i,r[11]=r[11]*i,this},scaleXYZ:function(t,e,n){var i=this.val;return i[0]=i[0]*t,i[1]=i[1]*t,i[2]=i[2]*t,i[3]=i[3]*t,i[4]=i[4]*e,i[5]=i[5]*e,i[6]=i[6]*e,i[7]=i[7]*e,i[8]=i[8]*n,i[9]=i[9]*n,i[10]=i[10]*n,i[11]=i[11]*n,this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,h=r*s,l=r*a;return this.fromArray([h*s+n,h*a-i*o,h*o+i*a,0,h*a+i*o,l*a+n,l*o-i*s,0,h*o-i*a,l*o+i*s,r*o*o+n,0,0,0,0,1]),this},rotate:function(t,e){var n=this.val,i=e.x,r=e.y,s=e.z,a=Math.sqrt(i*i+r*r+s*s);if(Math.abs(a)<1e-6)return null;i*=a=1/a,r*=a,s*=a;var o=Math.sin(t),h=Math.cos(t),l=1-h,u=n[0],c=n[1],f=n[2],d=n[3],p=n[4],v=n[5],m=n[6],g=n[7],y=n[8],x=n[9],w=n[10],M=n[11],E=i*i*l+h,T=r*i*l+s*o,A=s*i*l-r*o,b=i*r*l-s*o,R=r*r*l+h,I=s*r*l+i*o,S=i*s*l+r*o,C=r*s*l-i*o,P=s*s*l+h;return n[0]=u*E+p*T+y*A,n[1]=c*E+v*T+x*A,n[2]=f*E+m*T+w*A,n[3]=d*E+g*T+M*A,n[4]=u*b+p*R+y*I,n[5]=c*b+v*R+x*I,n[6]=f*b+m*R+w*I,n[7]=d*b+g*R+M*I,n[8]=u*S+p*C+y*P,n[9]=c*S+v*C+x*P,n[10]=f*S+m*C+w*P,n[11]=d*S+g*C+M*P,this},rotateX:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[4],s=e[5],a=e[6],o=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=r*i+h*n,e[5]=s*i+l*n,e[6]=a*i+u*n,e[7]=o*i+c*n,e[8]=h*i-r*n,e[9]=l*i-s*n,e[10]=u*i-a*n,e[11]=c*i-o*n,this},rotateY:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],a=e[2],o=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=r*i-h*n,e[1]=s*i-l*n,e[2]=a*i-u*n,e[3]=o*i-c*n,e[8]=r*n+h*i,e[9]=s*n+l*i,e[10]=a*n+u*i,e[11]=o*n+c*i,this},rotateZ:function(t){var e=this.val,n=Math.sin(t),i=Math.cos(t),r=e[0],s=e[1],a=e[2],o=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=r*i+h*n,e[1]=s*i+l*n,e[2]=a*i+u*n,e[3]=o*i+c*n,e[4]=h*i-r*n,e[5]=l*i-s*n,e[6]=u*i-a*n,e[7]=c*i-o*n,this},fromRotationTranslation:function(t,e){var n=this.val,i=t.x,r=t.y,s=t.z,a=t.w,o=i+i,h=r+r,l=s+s,u=i*o,c=i*h,f=i*l,d=r*h,p=r*l,v=s*l,m=a*o,g=a*h,y=a*l;return n[0]=1-(d+v),n[1]=c+y,n[2]=f-g,n[3]=0,n[4]=c-y,n[5]=1-(u+v),n[6]=p+m,n[7]=0,n[8]=f+g,n[9]=p-m,n[10]=1-(u+d),n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this},fromQuat:function(t){var e=this.val,n=t.x,i=t.y,r=t.z,s=t.w,a=n+n,o=i+i,h=r+r,l=n*a,u=n*o,c=n*h,f=i*o,d=i*h,p=r*h,v=s*a,m=s*o,g=s*h;return e[0]=1-(f+p),e[1]=u+g,e[2]=c-m,e[3]=0,e[4]=u-g,e[5]=1-(l+p),e[6]=d+v,e[7]=0,e[8]=c+m,e[9]=d-v,e[10]=1-(l+f),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,n,i,r,s){var a=this.val,o=1/(e-t),h=1/(i-n),l=1/(r-s);return a[0]=2*r*o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*r*h,a[6]=0,a[7]=0,a[8]=(e+t)*o,a[9]=(i+n)*h,a[10]=(s+r)*l,a[11]=-1,a[12]=0,a[13]=0,a[14]=s*r*2*l,a[15]=0,this},perspective:function(t,e,n,i){var r=this.val,s=1/Math.tan(t/2),a=1/(n-i);return r[0]=s/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(i+n)*a,r[11]=-1,r[12]=0,r[13]=0,r[14]=2*i*n*a,r[15]=0,this},perspectiveLH:function(t,e,n,i){var r=this.val;return r[0]=2*n/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=2*n/e,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=-i/(n-i),r[11]=1,r[12]=0,r[13]=0,r[14]=n*i/(n-i),r[15]=0,this},ortho:function(t,e,n,i,r,s){var a=this.val,o=t-e,h=n-i,l=r-s;return o=0===o?o:1/o,h=0===h?h:1/h,l=0===l?l:1/l,a[0]=-2*o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*l,a[11]=0,a[12]=(t+e)*o,a[13]=(i+n)*h,a[14]=(s+r)*l,a[15]=1,this},lookAt:function(t,e,n){var i=this.val,r=t.x,s=t.y,a=t.z,o=n.x,h=n.y,l=n.z,u=e.x,c=e.y,f=e.z;if(Math.abs(r-u)<1e-6&&Math.abs(s-c)<1e-6&&Math.abs(a-f)<1e-6)return this.identity();var d=r-u,p=s-c,v=a-f,m=1/Math.sqrt(d*d+p*p+v*v),g=h*(v*=m)-l*(p*=m),y=l*(d*=m)-o*v,x=o*p-h*d;(m=Math.sqrt(g*g+y*y+x*x))?(g*=m=1/m,y*=m,x*=m):(g=0,y=0,x=0);var w=p*x-v*y,M=v*g-d*x,E=d*y-p*g;return(m=Math.sqrt(w*w+M*M+E*E))?(w*=m=1/m,M*=m,E*=m):(w=0,M=0,E=0),i[0]=g,i[1]=w,i[2]=d,i[3]=0,i[4]=y,i[5]=M,i[6]=p,i[7]=0,i[8]=x,i[9]=E,i[10]=v,i[11]=0,i[12]=-(g*r+y*s+x*a),i[13]=-(w*r+M*s+E*a),i[14]=-(d*r+p*s+v*a),i[15]=1,this},yawPitchRoll:function(t,e,n){this.zero(),r.zero(),s.zero();var i=this.val,a=r.val,o=s.val,h=Math.sin(n),l=Math.cos(n);return i[10]=1,i[15]=1,i[0]=l,i[1]=h,i[4]=-h,i[5]=l,h=Math.sin(e),l=Math.cos(e),a[0]=1,a[15]=1,a[5]=l,a[10]=l,a[9]=-h,a[6]=h,h=Math.sin(t),l=Math.cos(t),o[5]=1,o[15]=1,o[0]=l,o[2]=-h,o[8]=h,o[10]=l,this.multiplyLocal(r),this.multiplyLocal(s),this},setWorldMatrix:function(t,e,n,i,a){return this.yawPitchRoll(t.y,t.x,t.z),r.scaling(n.x,n.y,n.z),s.xyz(e.x,e.y,e.z),this.multiplyLocal(r),this.multiplyLocal(s),void 0!==i&&this.multiplyLocal(i),void 0!==a&&this.multiplyLocal(a),this}}),r=new i,s=new i;t.exports=i},function(t,e,n){var i=n(0),r=n(10),s=n(26),a=new Int8Array([1,2,0]),o=new Float32Array([0,0,0]),h=new r(1,0,0),l=new r(0,1,0),u=new r,c=new s,f=new i({initialize:function(t,e,n,i){"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=n||0,this.w=i||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,n,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=n||0,this.w=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return Math.sqrt(t*t+e*e+n*n+i*i)},lengthSq:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return t*t+e*e+n*n+i*i},normalize:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=n*r,this.w=i*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y,r=this.z,s=this.w;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},rotationTo:function(t,e){var n=t.x*e.x+t.y*e.y+t.z*e.z;return n<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):n>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+n,this.normalize())},setAxes:function(t,e,n){var i=c.val;return i[0]=e.x,i[3]=e.y,i[6]=e.z,i[1]=n.x,i[4]=n.y,i[7]=n.z,i[2]=-t.x,i[5]=-t.y,i[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var n=Math.sin(e);return this.x=n*t.x,this.y=n*t.y,this.z=n*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,s=t.x,a=t.y,o=t.z,h=t.w;return this.x=e*h+r*s+n*o-i*a,this.y=n*h+r*a+i*s-e*o,this.z=i*h+r*o+e*a-n*s,this.w=r*h-e*s-n*a-i*o,this},slerp:function(t,e){var n=this.x,i=this.y,r=this.z,s=this.w,a=t.x,o=t.y,h=t.z,l=t.w,u=n*a+i*o+r*h+s*l;u<0&&(u=-u,a=-a,o=-o,h=-h,l=-l);var c=1-e,f=e;if(1-u>1e-6){var d=Math.acos(u),p=Math.sin(d);c=Math.sin((1-e)*d)/p,f=Math.sin(e*d)/p}return this.x=c*n+f*a,this.y=c*i+f*o,this.z=c*r+f*h,this.w=c*s+f*l,this},invert:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i,s=r?1/r:0;return this.x=-t*s,this.y=-e*s,this.z=-n*s,this.w=i*s,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.x=e*a+r*s,this.y=n*a+i*s,this.z=i*a-n*s,this.w=r*a-e*s,this},rotateY:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.x=e*a-i*s,this.y=n*a+r*s,this.z=i*a+e*s,this.w=r*a-n*s,this},rotateZ:function(t){t*=.5;var e=this.x,n=this.y,i=this.z,r=this.w,s=Math.sin(t),a=Math.cos(t);return this.x=e*a+n*s,this.y=n*a-e*s,this.z=i*a+r*s,this.w=r*a-i*s,this},calculateW:function(){var t=this.x,e=this.y,n=this.z;return this.w=-Math.sqrt(1-t*t-e*e-n*n),this},fromMat3:function(t){var e,n=t.val,i=n[0]+n[4]+n[8];if(i>0)e=Math.sqrt(i+1),this.w=.5*e,e=.5/e,this.x=(n[7]-n[5])*e,this.y=(n[2]-n[6])*e,this.z=(n[3]-n[1])*e;else{var r=0;n[4]>n[0]&&(r=1),n[8]>n[3*r+r]&&(r=2);var s=a[r],h=a[s];e=Math.sqrt(n[3*r+r]-n[3*s+s]-n[3*h+h]+1),o[r]=.5*e,e=.5/e,o[s]=(n[3*s+r]+n[3*r+s])*e,o[h]=(n[3*h+r]+n[3*r+h])*e,this.x=o[0],this.y=o[1],this.z=o[2],this.w=(n[3*h+s]-n[3*s+h])*e}return this}});t.exports=f},function(t,e,n){var i=n(14),r=n(30);t.exports=function(t,e){var n=void 0===t?r():i({},t);if(e)for(var s in e)void 0!==e[s]&&(n[s]=e[s]);return n}},function(t,e){t.exports=function(t,e,n,i,r){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===n&&(n=""),void 0===i&&(i=""),void 0===r&&(r=0),{responseType:t,async:e,user:n,password:i,timeout:r,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e){t.exports=function(){}},function(t,e,n){var i=n(33),r=n(0),s=n(11),a=n(143),o=n(144),h=n(166),l=n(167),u=n(185),c=new r({Extends:o,initialize:function(t,e){o.call(this,t,e);var n=e.game;this.isWebGL=2===n.config.renderType,this.cache=n.cache.addCustom("spine"),this.spineTextures=n.cache.addCustom("spineTextures"),this.json=n.cache.json,this.textures=n.textures,this.drawDebug=!1,this.gl,this.renderer,this.sceneRenderer,this.skeletonRenderer,this.skeletonDebugRenderer,this.plugin=h,this.temp1,this.temp2,this.isWebGL?(this.runtime=h.webgl,this.renderer=n.renderer,this.gl=n.renderer.gl,this.getAtlas=this.getAtlasWebGL):(this.runtime=h.canvas,this.renderer=n.renderer,this.getAtlas=this.getAtlasCanvas);var r=this;e.registerFileType("spine",this.spineFileCallback,t),e.registerGameObject("spine",function(t,e,n,i,s){var a=new u(this.scene,r,t,e,n,i,s);return this.displayList.add(a),this.updateList.add(a),a},function(t,e){void 0===t&&(t={});var n=s(t,"key",null),a=s(t,"animationName",null),o=s(t,"loop",!1),h=new u(this.scene,r,0,0,n,a,o);void 0!==e&&(t.add=e),i(this.scene,h,t);var l=s(t,"skinName",!1);l&&h.setSkinByName(l);var c=s(t,"slotName",!1),f=s(t,"attachmentName",null);return c&&h.setAttachment(c,f),h.refresh()})},boot:function(){this.isWebGL?(this.bootWebGL(),this.onResize(),this.game.scale.on(a,this.onResize,this)):this.bootCanvas();var t=this.systems.events;t.once("shutdown",this.shutdown,this),t.once("destroy",this.destroy,this)},bootCanvas:function(){this.skeletonRenderer=new h.canvas.SkeletonRenderer(this.scene.sys.context)},bootWebGL:function(){this.sceneRenderer=new h.webgl.SceneRenderer(this.renderer.canvas,this.gl,!0);var t=function(t,e){if(t!==this.srcBlend||e!==this.dstBlend){var n=this.context.gl;this.srcBlend=t,this.dstBlend=e,this.isDrawing&&(this.flush(),n.blendFunc(this.srcBlend,this.dstBlend))}};this.sceneRenderer.batcher.setBlendMode=t,this.sceneRenderer.shapes.setBlendMode=t,this.skeletonRenderer=this.sceneRenderer.skeletonRenderer,this.skeletonDebugRenderer=this.sceneRenderer.skeletonDebugRenderer,this.temp1=new h.webgl.Vector3(0,0,0),this.temp2=new h.webgl.Vector3(0,0,0)},getAtlasCanvas:function(t){var e=this.cache.get(t);if(e){var n,i=this.spineTextures;if(i.has(t))n=i.get(t);else{var r=this.textures;n=new h.TextureAtlas(e.data,function(t){return new h.canvas.CanvasTexture(r.get(t).getSourceImage())})}return n}console.warn("No atlas data for: "+t)},getAtlasWebGL:function(t){var e=this.cache.get(t);if(e){var n,i=this.spineTextures;if(i.has(t))n=i.get(t);else{var r=this.textures,s=this.sceneRenderer.context.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n=new h.TextureAtlas(e.data,function(t){return new h.webgl.GLTexture(s,r.get(t).getSourceImage(),!1)})}return n}console.warn("No atlas data for: "+t)},spineFileCallback:function(t,e,n,i,r,s){var a;if(Array.isArray(t))for(var o=0;o<t.length;o++)a=new l(this,t[o]),this.addFile(a.files);else a=new l(this,t,e,n,i,r,s),this.addFile(a.files);return this},worldToLocal:function(t,e,n,i){var r=this.temp1,s=this.temp2,a=this.sceneRenderer.camera;r.set(t+n.x,e-n.y,0);var o=a.viewportWidth,l=a.viewportHeight;return a.screenToWorld(r,o,l),i&&null!==i.parent?(i.parent.worldToLocal(s.set(r.x-n.x,r.y-n.y,0)),new h.Vector2(s.x,s.y)):i?new h.Vector2(r.x-n.x,r.y-n.y):new h.Vector2(r.x,r.y)},getVector2:function(t,e){return new h.Vector2(t,e)},getVector3:function(t,e,n){return new h.webgl.Vector3(t,e,n)},setDebugBones:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawBones=t,this},setDebugRegionAttachments:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawRegionAttachments=t,this},setDebugBoundingBoxes:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawBoundingBoxes=t,this},setDebugMeshHull:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawMeshHull=t,this},setDebugMeshTriangles:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawMeshTriangles=t,this},setDebugPaths:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawPaths=t,this},setDebugSkeletonXY:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawSkeletonXY=t,this},setDebugClipping:function(t){return void 0===t&&(t=!0),this.skeletonDebugRenderer.drawClipping=t,this},setEffect:function(t){return this.sceneRenderer.skeletonRenderer.vertexEffect=t,this},createSkeleton:function(t,e){var n=t,i=t,r=-1!==t.indexOf(".");if(r){var a=t.split(".");n=a.shift(),i=a.join(".")}var o=this.cache.get(n),l=this.getAtlas(n);if(!l)return null;this.spineTextures.has(n)||this.spineTextures.add(n,l);var u,c=o.preMultipliedAlpha,f=new h.AtlasAttachmentLoader(l),d=new h.SkeletonJson(f);if(e)u=e;else{var p=this.json.get(n);u=r?s(p,i):p}if(u){var v=d.readSkeletonData(u);return{skeletonData:v,skeleton:new h.Skeleton(v),preMultipliedAlpha:c}}return null},createAnimationState:function(t){var e=new h.AnimationStateData(t.data);return{stateData:e,state:new h.AnimationState(e)}},getBounds:function(t){var e=new h.Vector2,n=new h.Vector2;return t.getBounds(e,n,[]),{offset:e,size:n}},onResize:function(){var t=this.renderer,e=this.sceneRenderer,n=t.width,i=t.height;e.camera.position.x=n/2,e.camera.position.y=i/2,e.camera.viewportWidth=n,e.camera.viewportHeight=i},shutdown:function(){this.systems.events.off("shutdown",this.shutdown,this)},destroy:function(){this.shutdown(),this.sceneRenderer&&this.sceneRenderer.dispose(),this.pluginManager.removeGameObject("spine",!0,!0),this.pluginManager=null,this.game=null,this.scene=null,this.systems=null,this.cache=null,this.spineTextures=null,this.json=null,this.textures=null,this.sceneRenderer=null,this.skeletonRenderer=null,this.gl=null}});t.exports=c},function(t,e,n){var i=n(34),r=n(35);t.exports=function(t,e,n){e.x=r(n,"x",0),e.y=r(n,"y",0),e.depth=r(n,"depth",0),e.flipX=r(n,"flipX",!1),e.flipY=r(n,"flipY",!1);var s=r(n,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var a=r(n,"scrollFactor",null);"number"==typeof a?e.setScrollFactor(a):null!==a&&(e.scrollFactorX=r(a,"x",1),e.scrollFactorY=r(a,"y",1)),e.rotation=r(n,"rotation",0);var o=r(n,"angle",null);null!==o&&(e.angle=o),e.alpha=r(n,"alpha",1);var h=r(n,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),u=r(h,"y",.5);e.setOrigin(l,u)}return e.blendMode=r(n,"blendMode",i.NORMAL),e.visible=r(n,"visible",!0),r(n,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){t.exports={SKIP_CHECK:-1,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,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},function(t,e,n){var i=n(36),r=n(11);t.exports=function(t,e,n){var s=r(t,e,null);if(null===s)return n;if(Array.isArray(s))return i.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return i.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return i.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},function(t,e,n){var i=n(1),r=n(14),s={Angle:n(37),Distance:n(44),Easing:n(48),Fuzzy:n(93),Interpolation:n(99),Pow2:n(107),Snap:n(111),RandomDataGenerator:n(115),Average:n(116),Bernstein:n(19),Between:n(117),CatmullRom:n(21),CeilTo:n(118),Clamp:n(8),DegToRad:n(25),Difference:n(119),Factorial:n(20),FloatBetween:n(120),FloorTo:n(121),FromPercent:n(122),GetSpeed:n(123),IsEven:n(124),IsEvenStrict:n(125),Linear:n(22),MaxAdd:n(126),MinSub:n(127),Percent:n(128),RadToDeg:n(9),RandomXY:n(129),RandomXYZ:n(130),RandomXYZW:n(131),Rotate:n(132),RotateAround:n(133),RotateAroundDistance:n(134),RoundAwayFromZero:n(135),RoundTo:n(136),SinCosTableGenerator:n(137),SmootherStep:n(24),SmoothStep:n(23),ToXY:n(138),TransformXY:n(139),Within:n(140),Wrap:n(4),Vector2:n(5),Vector3:n(10),Vector4:n(141),Matrix3:n(26),Matrix4:n(27),Quaternion:n(28),RotateVec3:n(142)};s=r(!1,s,i),t.exports=s},function(t,e,n){t.exports={Between:n(15),BetweenPoints:n(38),BetweenPointsY:n(39),BetweenY:n(40),CounterClockwise:n(7),Normalize:n(16),Reverse:n(41),RotateTo:n(42),ShortestBetween:n(43),Wrap:n(17),WrapDegrees:n(18)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e,n,i){return Math.atan2(n-t,i-e)}},function(t,e,n){var i=n(16);t.exports=function(t){return i(t+Math.PI)}},function(t,e,n){var i=n(1);t.exports=function(t,e,n){return void 0===n&&(n=.05),t===e?t:(Math.abs(e-t)<=n||Math.abs(e-t)>=i.PI2-n?t=e:(Math.abs(e-t)>Math.PI&&(e<t?e+=i.PI2:e-=i.PI2),e>t?t+=n:e<t&&(t-=n)),t)}},function(t,e){t.exports=function(t,e){var n=e-t;return 0===n?0:n-360*Math.floor((n- -180)/360)}},function(t,e,n){t.exports={Between:n(45),Power:n(46),Squared:n(47)}},function(t,e){t.exports=function(t,e,n,i){var r=t-n,s=e-i;return Math.sqrt(r*r+s*s)}},function(t,e){t.exports=function(t,e,n,i,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(n-t,r)+Math.pow(i-e,r))}},function(t,e){t.exports=function(t,e,n,i){var r=t-n,s=e-i;return r*r+s*s}},function(t,e,n){t.exports={Back:n(49),Bounce:n(53),Circular:n(57),Cubic:n(61),Elastic:n(65),Expo:n(69),Linear:n(73),Quadratic:n(75),Quartic:n(79),Quintic:n(83),Sine:n(87),Stepped:n(91)}},function(t,e,n){t.exports={In:n(50),Out:n(51),InOut:n(52)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var n=1.525*e;return(t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},function(t,e,n){t.exports={In:n(54),Out:n(55),InOut:n(56)}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e,n){t.exports={In:n(58),Out:n(59),InOut:n(60)}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e,n){t.exports={In:n(62),Out:n(63),InOut:n(64)}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e,n){t.exports={In:n(66),Out:n(67),InOut:n(68)}},function(t,e){t.exports=function(t,e,n){if(void 0===e&&(e=.1),void 0===n&&(n=.1),0===t)return 0;if(1===t)return 1;var i=n/4;return e<1?e=1:i=n*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-i)*(2*Math.PI)/n)}},function(t,e){t.exports=function(t,e,n){if(void 0===e&&(e=.1),void 0===n&&(n=.1),0===t)return 0;if(1===t)return 1;var i=n/4;return e<1?e=1:i=n*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-i)*(2*Math.PI)/n)+1}},function(t,e){t.exports=function(t,e,n){if(void 0===e&&(e=.1),void 0===n&&(n=.1),0===t)return 0;if(1===t)return 1;var i=n/4;return e<1?e=1:i=n*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-i)*(2*Math.PI)/n)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-i)*(2*Math.PI)/n)*.5+1}},function(t,e,n){t.exports={In:n(70),Out:n(71),InOut:n(72)}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e,n){t.exports=n(74)},function(t,e){t.exports=function(t){return t}},function(t,e,n){t.exports={In:n(76),Out:n(77),InOut:n(78)}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e,n){t.exports={In:n(80),Out:n(81),InOut:n(82)}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e,n){t.exports={In:n(84),Out:n(85),InOut:n(86)}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e,n){t.exports={In:n(88),Out:n(89),InOut:n(90)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e,n){t.exports=n(92)},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},function(t,e,n){t.exports={Ceil:n(94),Equal:n(95),Floor:n(96),GreaterThan:n(97),LessThan:n(98)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e,n){return void 0===n&&(n=1e-4),Math.abs(t-e)<n}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e){t.exports=function(t,e,n){return void 0===n&&(n=1e-4),t>e-n}},function(t,e){t.exports=function(t,e,n){return void 0===n&&(n=1e-4),t<e+n}},function(t,e,n){t.exports={Bezier:n(100),CatmullRom:n(101),CubicBezier:n(102),Linear:n(103),QuadraticBezier:n(104),SmoothStep:n(105),SmootherStep:n(106)}},function(t,e,n){var i=n(19);t.exports=function(t,e){for(var n=0,r=t.length-1,s=0;s<=r;s++)n+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*i(r,s);return n}},function(t,e,n){var i=n(21);t.exports=function(t,e){var n=t.length-1,r=n*e,s=Math.floor(r);return t[0]===t[n]?(e<0&&(s=Math.floor(r=n*(1+e))),i(r-s,t[(s-1+n)%n],t[s],t[(s+1)%n],t[(s+2)%n])):e<0?t[0]-(i(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[n]-(i(r-n,t[n],t[n],t[n-1],t[n-1])-t[n]):i(r-s,t[s?s-1:0],t[s],t[n<s+1?n:s+1],t[n<s+2?n:s+2])}},function(t,e){t.exports=function(t,e,n,i,r){return function(t,e){var n=1-t;return n*n*n*e}(t,e)+function(t,e){var n=1-t;return 3*n*n*t*e}(t,n)+function(t,e){return 3*(1-t)*t*t*e}(t,i)+function(t,e){return t*t*t*e}(t,r)}},function(t,e,n){var i=n(22);t.exports=function(t,e){var n=t.length-1,r=n*e,s=Math.floor(r);return e<0?i(t[0],t[1],r):e>1?i(t[n],t[n-1],n-r):i(t[s],t[s+1>n?n:s+1],r-s)}},function(t,e){t.exports=function(t,e,n,i){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,i)}},function(t,e,n){var i=n(23);t.exports=function(t,e,n){return e+(n-e)*i(t,0,1)}},function(t,e,n){var i=n(24);t.exports=function(t,e,n){return e+(n-e)*i(t,0,1)}},function(t,e,n){t.exports={GetNext:n(108),IsSize:n(109),IsValue:n(110)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<<Math.ceil(e)}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,n){t.exports={Ceil:n(112),Floor:n(113),To:n(114)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.ceil(t/e),i?(n+t)/e:n+t)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.floor(t/e),i?(n+t)/e:n+t)}},function(t,e){t.exports=function(t,e,n,i){return void 0===n&&(n=0),0===e?t:(t-=n,t=e*Math.round(t/e),i?(n+t)/e:n+t)}},function(t,e,n){var i=new(n(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,n=this.n;t=t.toString();for(var i=0;i<t.length;i++)e=.02519603282416938*(n+=t.charCodeAt(i)),e-=n=e>>>0,n=(e*=n)>>>0,n+=4294967296*(e-=n);return this.n=n,2.3283064365386963e-10*(n>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e<t.length&&null!=t[e];e++){var n=t[e];this.s0-=this.hash(n),this.s0+=~~(this.s0<0),this.s1-=this.hash(n),this.s1+=~~(this.s1<0),this.s2-=this.hash(n),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+1.1102230246251565e-16*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1;e>0;e--){var n=Math.floor(this.frac()*(e+1)),i=t[n];t[n]=t[e],t[e]=i}return t}});t.exports=i},function(t,e){t.exports=function(t){for(var e=0,n=0;n<t.length;n++)e+=+t[n];return e/t.length}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e){t.exports=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=10);var i=Math.pow(n,-e);return Math.ceil(t*i)/i}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e){t.exports=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=10);var i=Math.pow(n,-e);return Math.floor(t*i)/i}},function(t,e,n){var i=n(8);t.exports=function(t,e,n){return(n-e)*(t=i(t,0,1))}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e,n){return Math.min(t+e,n)}},function(t,e){t.exports=function(t,e,n){return Math.max(t-e,n)}},function(t,e){t.exports=function(t,e,n,i){void 0===n&&(n=e+1);var r=(t-e)/(n-e);return r>1?void 0!==i?(r=(i-t)/(i-n))<0&&(r=0):r=1:r<0&&(r=0),r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var n=2*Math.random()*Math.PI;return t.x=Math.cos(n)*e,t.y=Math.sin(n)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var n=2*Math.random()*Math.PI,i=2*Math.random()-1,r=Math.sqrt(1-i*i)*e;return t.x=Math.cos(n)*r,t.y=Math.sin(n)*r,t.z=i*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e){var n=t.x,i=t.y;return t.x=n*Math.cos(e)-i*Math.sin(e),t.y=n*Math.sin(e)+i*Math.cos(e),t}},function(t,e){t.exports=function(t,e,n,i){var r=Math.cos(i),s=Math.sin(i),a=t.x-e,o=t.y-n;return t.x=a*r-o*s+e,t.y=a*s+o*r+n,t}},function(t,e){t.exports=function(t,e,n,i,r){var s=i+Math.atan2(t.y-n,t.x-e);return t.x=e+r*Math.cos(s),t.y=n+r*Math.sin(s),t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e){t.exports=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=10);var i=Math.pow(n,-e);return Math.round(t*i)/i}},function(t,e){t.exports=function(t,e,n,i){void 0===e&&(e=1),void 0===n&&(n=1),void 0===i&&(i=1),i*=Math.PI/t;for(var r=[],s=[],a=0;a<t;a++)e+=(n-=e*i)*i,r[a]=n,s[a]=e;return{sin:s,cos:r,length:t}}},function(t,e,n){var i=n(5);t.exports=function(t,e,n,r){void 0===r&&(r=new i);var s=0,a=0;return t>0&&t<=e*n&&(s=t>e-1?t-(a=Math.floor(t/e))*e:t,r.set(s,a)),r}},function(t,e,n){var i=n(5);t.exports=function(t,e,n,r,s,a,o,h){void 0===h&&(h=new i);var l=Math.sin(s),u=Math.cos(s),c=u*a,f=l*a,d=-l*o,p=u*o,v=1/(c*p+d*-f);return h.x=p*v*t+-d*v*e+(r*d-n*p)*v,h.y=c*v*e+-f*v*t+(-r*c+n*f)*v,h}},function(t,e){t.exports=function(t,e,n){return Math.abs(t-e)<=n}},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n,i){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=n||0,this.w=i||0)},clone:function(){return new i(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,n,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=n||0,this.w=i||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return Math.sqrt(t*t+e*e+n*n+i*i)},lengthSq:function(){var t=this.x,e=this.y,n=this.z,i=this.w;return t*t+e*e+n*n+i*i},normalize:function(){var t=this.x,e=this.y,n=this.z,i=this.w,r=t*t+e*e+n*n+i*i;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=n*r,this.w=i*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var n=this.x,i=this.y,r=this.z,s=this.w;return this.x=n+e*(t.x-n),this.y=i+e*(t.y-i),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+n*n+i*i+r*r)},distanceSq:function(t){var e=t.x-this.x,n=t.y-this.y,i=t.z-this.z||0,r=t.w-this.w||0;return e*e+n*n+i*i+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this},transformQuat:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,h=o*e+s*i-a*n,l=o*n+a*e-r*i,u=o*i+r*n-s*e,c=-r*e-s*n-a*i;return this.x=h*o+c*-r+l*-a-u*-s,this.y=l*o+c*-s+u*-r-h*-a,this.z=u*o+c*-a+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});i.prototype.sub=i.prototype.subtract,i.prototype.mul=i.prototype.multiply,i.prototype.div=i.prototype.divide,i.prototype.dist=i.prototype.distance,i.prototype.distSq=i.prototype.distanceSq,i.prototype.len=i.prototype.length,i.prototype.lenSq=i.prototype.lengthSq,t.exports=i},function(t,e,n){var i=n(10),r=n(27),s=n(28),a=new r,o=new s,h=new i;t.exports=function(t,e,n){return o.setAxisAngle(e,n),a.fromRotationTranslation(o,h.set(0,0,0)),t.transformMat4(a)}},function(t,e){t.exports="resize"},function(t,e,n){var i=n(145),r=n(0),s=n(146),a=new r({Extends:i,initialize:function(t,e){i.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=a},function(t,e,n){var i=new(n(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=i},function(t,e,n){t.exports={BOOT:n(147),CREATE:n(148),DESTROY:n(149),PAUSE:n(150),POST_UPDATE:n(151),PRE_UPDATE:n(152),READY:n(153),RENDER:n(154),RESUME:n(155),SHUTDOWN:n(156),SLEEP:n(157),START:n(158),TRANSITION_COMPLETE:n(159),TRANSITION_INIT:n(160),TRANSITION_OUT:n(161),TRANSITION_START:n(162),TRANSITION_WAKE:n(163),UPDATE:n(164),WAKE:n(165)}},function(t,e){t.exports="boot"},function(t,e){t.exports="create"},function(t,e){t.exports="destroy"},function(t,e){t.exports="pause"},function(t,e){t.exports="postupdate"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="ready"},function(t,e){t.exports="render"},function(t,e){t.exports="resume"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="sleep"},function(t,e){t.exports="start"},function(t,e){t.exports="transitioncomplete"},function(t,e){t.exports="transitioninit"},function(t,e){t.exports="transitionout"},function(t,e){t.exports="transitionstart"},function(t,e){t.exports="transitionwake"},function(t,e){t.exports="update"},function(t,e){t.exports="wake"},function(t,e){(function(){var e,n,i,r=this&&this.__extends||(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,n)},function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)});!function(t){var e,n,i,s=function(){function t(t,e,n){if(null==t)throw new Error("name cannot be null.");if(null==e)throw new Error("timelines cannot be null.");this.name=t,this.timelines=e,this.timelineIds=[];for(var i=0;i<e.length;i++)this.timelineIds[e[i].getPropertyId()]=!0;this.duration=n}return t.prototype.hasTimeline=function(t){return 1==this.timelineIds[t]},t.prototype.apply=function(t,e,n,i,r,s,a,o){if(null==t)throw new Error("skeleton cannot be null.");i&&0!=this.duration&&(n%=this.duration,e>0&&(e%=this.duration));for(var h=this.timelines,l=0,u=h.length;l<u;l++)h[l].apply(t,e,n,r,s,a,o)},t.binarySearch=function(t,e,n){void 0===n&&(n=1);var i=0,r=t.length/n-2;if(0==r)return n;for(var s=r>>>1;;){if(t[(s+1)*n]<=e?i=s+1:r=s,i==r)return(i+1)*n;s=i+r>>>1}},t.linearSearch=function(t,e,n){for(var i=0,r=t.length-n;i<=r;i+=n)if(t[i]>e)return i;return-1},t}();t.Animation=s,function(t){t[t.setup=0]="setup",t[t.first=1]="first",t[t.replace=2]="replace",t[t.add=3]="add"}(e=t.MixBlend||(t.MixBlend={})),function(t){t[t.mixIn=0]="mixIn",t[t.mixOut=1]="mixOut"}(n=t.MixDirection||(t.MixDirection={})),function(t){t[t.rotate=0]="rotate",t[t.translate=1]="translate",t[t.scale=2]="scale",t[t.shear=3]="shear",t[t.attachment=4]="attachment",t[t.color=5]="color",t[t.deform=6]="deform",t[t.event=7]="event",t[t.drawOrder=8]="drawOrder",t[t.ikConstraint=9]="ikConstraint",t[t.transformConstraint=10]="transformConstraint",t[t.pathConstraintPosition=11]="pathConstraintPosition",t[t.pathConstraintSpacing=12]="pathConstraintSpacing",t[t.pathConstraintMix=13]="pathConstraintMix",t[t.twoColor=14]="twoColor"}(i=t.TimelineType||(t.TimelineType={}));var a=function(){function e(n){if(n<=0)throw new Error("frameCount must be > 0: "+n);this.curves=t.Utils.newFloatArray((n-1)*e.BEZIER_SIZE)}return e.prototype.getFrameCount=function(){return this.curves.length/e.BEZIER_SIZE+1},e.prototype.setLinear=function(t){this.curves[t*e.BEZIER_SIZE]=e.LINEAR},e.prototype.setStepped=function(t){this.curves[t*e.BEZIER_SIZE]=e.STEPPED},e.prototype.getCurveType=function(t){var n=t*e.BEZIER_SIZE;if(n==this.curves.length)return e.LINEAR;var i=this.curves[n];return i==e.LINEAR?e.LINEAR:i==e.STEPPED?e.STEPPED:e.BEZIER},e.prototype.setCurve=function(t,n,i,r,s){var a=.03*(2*-n+r),o=.03*(2*-i+s),h=.006*(3*(n-r)+1),l=.006*(3*(i-s)+1),u=2*a+h,c=2*o+l,f=.3*n+a+.16666667*h,d=.3*i+o+.16666667*l,p=t*e.BEZIER_SIZE,v=this.curves;v[p++]=e.BEZIER;for(var m=f,g=d,y=p+e.BEZIER_SIZE-1;p<y;p+=2)v[p]=m,v[p+1]=g,f+=u,d+=c,u+=h,c+=l,m+=f,g+=d},e.prototype.getCurvePercent=function(n,i){i=t.MathUtils.clamp(i,0,1);var r=this.curves,s=n*e.BEZIER_SIZE,a=r[s];if(a==e.LINEAR)return i;if(a==e.STEPPED)return 0;for(var o=0,h=++s,l=s+e.BEZIER_SIZE-1;s<l;s+=2)if((o=r[s])>=i){var u=void 0,c=void 0;return s==h?(u=0,c=0):(u=r[s-2],c=r[s-1]),c+(r[s+1]-c)*(i-u)/(o-u)}var f=r[s-1];return f+(1-f)*(i-o)/(1-o)},e.LINEAR=0,e.STEPPED=1,e.BEZIER=2,e.BEZIER_SIZE=19,e}();t.CurveTimeline=a;var o=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e<<1),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.rotate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n){t<<=1,this.frames[t]=e,this.frames[t+a.ROTATION]=n},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(i<u[0])switch(h){case e.setup:return void(c.rotation=c.data.rotation);case e.first:var f=c.data.rotation-c.rotation;c.rotation+=(f-360*(16384-(16384.499999999996-f/360|0)))*o}else if(i>=u[u.length-a.ENTRIES]){var d=u[u.length+a.PREV_ROTATION];switch(h){case e.setup:c.rotation=c.data.rotation+d*o;break;case e.first:case e.replace:d+=c.data.rotation-c.rotation,d-=360*(16384-(16384.499999999996-d/360|0));case e.add:c.rotation+=d*o}}else{var p=s.binarySearch(u,i,a.ENTRIES),v=u[p+a.PREV_ROTATION],m=u[p],g=this.getCurvePercent((p>>1)-1,1-(i-m)/(u[p+a.PREV_TIME]-m)),y=u[p+a.ROTATION]-v;switch(y=v+(y-360*(16384-(16384.499999999996-y/360|0)))*g,h){case e.setup:c.rotation=c.data.rotation+(y-360*(16384-(16384.499999999996-y/360|0)))*o;break;case e.first:case e.replace:y+=c.data.rotation-c.rotation;case e.add:c.rotation+=(y-360*(16384-(16384.499999999996-y/360|0)))*o}}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_ROTATION=-1,a.ROTATION=1,a}(a);t.RotateTimeline=o;var h=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.translate<<24)+this.boneIndex},a.prototype.setFrame=function(t,e,n,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.X]=n,this.frames[t+a.Y]=i},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(i<u[0])switch(h){case e.setup:return c.x=c.data.x,void(c.y=c.data.y);case e.first:c.x+=(c.data.x-c.x)*o,c.y+=(c.data.y-c.y)*o}else{var f=0,d=0;if(i>=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_X],d=u[u.length+a.PREV_Y];else{var p=s.binarySearch(u,i,a.ENTRIES);f=u[p+a.PREV_X],d=u[p+a.PREV_Y];var v=u[p],m=this.getCurvePercent(p/a.ENTRIES-1,1-(i-v)/(u[p+a.PREV_TIME]-v));f+=(u[p+a.X]-f)*m,d+=(u[p+a.Y]-d)*m}switch(h){case e.setup:c.x=c.data.x+f*o,c.y=c.data.y+d*o;break;case e.first:case e.replace:c.x+=(c.data.x+f-c.x)*o,c.y+=(c.data.y+d-c.y)*o;break;case e.add:c.x+=f*o,c.y+=d*o}}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_X=-2,a.PREV_Y=-1,a.X=1,a.Y=2,a}(a);t.TranslateTimeline=h;var l=function(a){function o(t){return a.call(this,t)||this}return r(o,a),o.prototype.getPropertyId=function(){return(i.scale<<24)+this.boneIndex},o.prototype.apply=function(i,r,a,h,l,u,c){var f=this.frames,d=i.bones[this.boneIndex];if(d.active)if(a<f[0])switch(u){case e.setup:return d.scaleX=d.data.scaleX,void(d.scaleY=d.data.scaleY);case e.first:d.scaleX+=(d.data.scaleX-d.scaleX)*l,d.scaleY+=(d.data.scaleY-d.scaleY)*l}else{var p=0,v=0;if(a>=f[f.length-o.ENTRIES])p=f[f.length+o.PREV_X]*d.data.scaleX,v=f[f.length+o.PREV_Y]*d.data.scaleY;else{var m=s.binarySearch(f,a,o.ENTRIES);p=f[m+o.PREV_X],v=f[m+o.PREV_Y];var g=f[m],y=this.getCurvePercent(m/o.ENTRIES-1,1-(a-g)/(f[m+o.PREV_TIME]-g));p=(p+(f[m+o.X]-p)*y)*d.data.scaleX,v=(v+(f[m+o.Y]-v)*y)*d.data.scaleY}if(1==l)u==e.add?(d.scaleX+=p-d.data.scaleX,d.scaleY+=v-d.data.scaleY):(d.scaleX=p,d.scaleY=v);else{var x=0,w=0;if(c==n.mixOut)switch(u){case e.setup:x=d.data.scaleX,w=d.data.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,d.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-w)*l;break;case e.first:case e.replace:x=d.scaleX,w=d.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-x)*l,d.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-w)*l;break;case e.add:x=d.scaleX,w=d.scaleY,d.scaleX=x+(Math.abs(p)*t.MathUtils.signum(x)-d.data.scaleX)*l,d.scaleY=w+(Math.abs(v)*t.MathUtils.signum(w)-d.data.scaleY)*l}else switch(u){case e.setup:x=Math.abs(d.data.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.data.scaleY)*t.MathUtils.signum(v),d.scaleX=x+(p-x)*l,d.scaleY=w+(v-w)*l;break;case e.first:case e.replace:x=Math.abs(d.scaleX)*t.MathUtils.signum(p),w=Math.abs(d.scaleY)*t.MathUtils.signum(v),d.scaleX=x+(p-x)*l,d.scaleY=w+(v-w)*l;break;case e.add:x=t.MathUtils.signum(p),w=t.MathUtils.signum(v),d.scaleX=Math.abs(d.scaleX)*x+(p-Math.abs(d.data.scaleX)*x)*l,d.scaleY=Math.abs(d.scaleY)*w+(v-Math.abs(d.data.scaleY)*w)*l}}}},o}(h);t.ScaleTimeline=l;var u=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.getPropertyId=function(){return(i.shear<<24)+this.boneIndex},n.prototype.apply=function(t,i,r,a,o,h,l){var u=this.frames,c=t.bones[this.boneIndex];if(c.active)if(r<u[0])switch(h){case e.setup:return c.shearX=c.data.shearX,void(c.shearY=c.data.shearY);case e.first:c.shearX+=(c.data.shearX-c.shearX)*o,c.shearY+=(c.data.shearY-c.shearY)*o}else{var f=0,d=0;if(r>=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_X],d=u[u.length+n.PREV_Y];else{var p=s.binarySearch(u,r,n.ENTRIES);f=u[p+n.PREV_X],d=u[p+n.PREV_Y];var v=u[p],m=this.getCurvePercent(p/n.ENTRIES-1,1-(r-v)/(u[p+n.PREV_TIME]-v));f+=(u[p+n.X]-f)*m,d+=(u[p+n.Y]-d)*m}switch(h){case e.setup:c.shearX=c.data.shearX+f*o,c.shearY=c.data.shearY+d*o;break;case e.first:case e.replace:c.shearX+=(c.data.shearX+f-c.shearX)*o,c.shearY+=(c.data.shearY+d-c.shearY)*o;break;case e.add:c.shearX+=f*o,c.shearY+=d*o}}},n}(h);t.ShearTimeline=u;var c=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.color<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,i,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=i,this.frames[t+a.B]=r,this.frames[t+a.A]=s},a.prototype.apply=function(t,n,i,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(i<c[0])switch(h){case e.setup:return void u.color.setFromColor(u.data.color);case e.first:var f=u.color,d=u.data.color;f.add((d.r-f.r)*o,(d.g-f.g)*o,(d.b-f.b)*o,(d.a-f.a)*o)}else{var p=0,v=0,m=0,g=0;if(i>=c[c.length-a.ENTRIES]){var y=c.length;p=c[y+a.PREV_R],v=c[y+a.PREV_G],m=c[y+a.PREV_B],g=c[y+a.PREV_A]}else{var x=s.binarySearch(c,i,a.ENTRIES);p=c[x+a.PREV_R],v=c[x+a.PREV_G],m=c[x+a.PREV_B],g=c[x+a.PREV_A];var w=c[x],M=this.getCurvePercent(x/a.ENTRIES-1,1-(i-w)/(c[x+a.PREV_TIME]-w));p+=(c[x+a.R]-p)*M,v+=(c[x+a.G]-v)*M,m+=(c[x+a.B]-m)*M,g+=(c[x+a.A]-g)*M}if(1==o)u.color.set(p,v,m,g);else{f=u.color;h==e.setup&&f.setFromColor(u.data.color),f.add((p-f.r)*o,(v-f.g)*o,(m-f.b)*o,(g-f.a)*o)}}}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_R=-4,a.PREV_G=-3,a.PREV_B=-2,a.PREV_A=-1,a.R=1,a.G=2,a.B=3,a.A=4,a}(a);t.ColorTimeline=c;var f=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.twoColor<<24)+this.slotIndex},a.prototype.setFrame=function(t,e,n,i,r,s,o,h,l){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.R]=n,this.frames[t+a.G]=i,this.frames[t+a.B]=r,this.frames[t+a.A]=s,this.frames[t+a.R2]=o,this.frames[t+a.G2]=h,this.frames[t+a.B2]=l},a.prototype.apply=function(t,n,i,r,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active){var c=this.frames;if(i<c[0])switch(h){case e.setup:return u.color.setFromColor(u.data.color),void u.darkColor.setFromColor(u.data.darkColor);case e.first:var f=u.color,d=u.darkColor,p=u.data.color,v=u.data.darkColor;f.add((p.r-f.r)*o,(p.g-f.g)*o,(p.b-f.b)*o,(p.a-f.a)*o),d.add((v.r-d.r)*o,(v.g-d.g)*o,(v.b-d.b)*o,0)}else{var m=0,g=0,y=0,x=0,w=0,M=0,E=0;if(i>=c[c.length-a.ENTRIES]){var T=c.length;m=c[T+a.PREV_R],g=c[T+a.PREV_G],y=c[T+a.PREV_B],x=c[T+a.PREV_A],w=c[T+a.PREV_R2],M=c[T+a.PREV_G2],E=c[T+a.PREV_B2]}else{var A=s.binarySearch(c,i,a.ENTRIES);m=c[A+a.PREV_R],g=c[A+a.PREV_G],y=c[A+a.PREV_B],x=c[A+a.PREV_A],w=c[A+a.PREV_R2],M=c[A+a.PREV_G2],E=c[A+a.PREV_B2];var b=c[A],R=this.getCurvePercent(A/a.ENTRIES-1,1-(i-b)/(c[A+a.PREV_TIME]-b));m+=(c[A+a.R]-m)*R,g+=(c[A+a.G]-g)*R,y+=(c[A+a.B]-y)*R,x+=(c[A+a.A]-x)*R,w+=(c[A+a.R2]-w)*R,M+=(c[A+a.G2]-M)*R,E+=(c[A+a.B2]-E)*R}if(1==o)u.color.set(m,g,y,x),u.darkColor.set(w,M,E,1);else{f=u.color,d=u.darkColor;h==e.setup&&(f.setFromColor(u.data.color),d.setFromColor(u.data.darkColor)),f.add((m-f.r)*o,(g-f.g)*o,(y-f.b)*o,(x-f.a)*o),d.add((w-d.r)*o,(M-d.g)*o,(E-d.b)*o,0)}}}},a.ENTRIES=8,a.PREV_TIME=-8,a.PREV_R=-7,a.PREV_G=-6,a.PREV_B=-5,a.PREV_A=-4,a.PREV_R2=-3,a.PREV_G2=-2,a.PREV_B2=-1,a.R=1,a.G=2,a.B=3,a.A=4,a.R2=5,a.G2=6,a.B2=7,a}(a);t.TwoColorTimeline=f;var d=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.attachmentNames=new Array(e)}return r.prototype.getPropertyId=function(){return(i.attachment<<24)+this.slotIndex},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.attachmentNames[t]=n},r.prototype.apply=function(t,i,r,a,o,h,l){var u=t.slots[this.slotIndex];if(u.bone.active)if(l!=n.mixOut||h!=e.setup){var c=this.frames;if(r<c[0]){if(h==e.setup||h==e.first){var f=u.data.attachmentName;u.setAttachment(null==f?null:t.getAttachment(this.slotIndex,f))}}else{var d=0;d=r>=c[c.length-1]?c.length-1:s.binarySearch(c,r,1)-1;var p=this.attachmentNames[d];t.slots[this.slotIndex].setAttachment(null==p?null:t.getAttachment(this.slotIndex,p))}}else{var v=u.data.attachmentName;u.setAttachment(null==v?null:t.getAttachment(this.slotIndex,v))}},r}();t.AttachmentTimeline=d;var p=null,v=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e),i.frameVertices=new Array(e),null==p&&(p=t.Utils.newFloatArray(64)),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.deform<<27)+ +this.attachment.id+this.slotIndex},a.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.frameVertices[t]=n},a.prototype.apply=function(n,i,r,a,o,h,l){var u=n.slots[this.slotIndex];if(u.bone.active){var c=u.getAttachment();if(c instanceof t.VertexAttachment&&c.deformAttachment==this.attachment){var f=u.deform;0==f.length&&(h=e.setup);var d=this.frameVertices,p=d[0].length,v=this.frames;if(r<v[0]){var m=c;switch(h){case e.setup:return void(f.length=0);case e.first:if(1==o){f.length=0;break}var g=t.Utils.setArraySize(f,p);if(null==m.bones)for(var y=m.vertices,x=0;x<p;x++)g[x]+=(y[x]-g[x])*o;else{o=1-o;for(x=0;x<p;x++)g[x]*=o}}}else{var w=t.Utils.setArraySize(f,p);if(r>=v[v.length-1]){var M=d[v.length-1];if(1==o)if(h==e.add)if(null==(m=c).bones){y=m.vertices;for(var E=0;E<p;E++)w[E]+=M[E]-y[E]}else for(var T=0;T<p;T++)w[T]+=M[T];else t.Utils.arrayCopy(M,0,w,0,p);else switch(h){case e.setup:var A=c;if(null==A.bones){y=A.vertices;for(var b=0;b<p;b++){var R=y[b];w[b]=R+(M[b]-R)*o}}else for(var I=0;I<p;I++)w[I]=M[I]*o;break;case e.first:case e.replace:for(var S=0;S<p;S++)w[S]+=(M[S]-w[S])*o;case e.add:if(null==(m=c).bones){y=m.vertices;for(var C=0;C<p;C++)w[C]+=(M[C]-y[C])*o}else for(var P=0;P<p;P++)w[P]+=M[P]*o}}else{var k=s.binarySearch(v,r),V=d[k-1],F=d[k],O=v[k],L=this.getCurvePercent(k-1,1-(r-O)/(v[k-1]-O));if(1==o)if(h==e.add)if(null==(m=c).bones){y=m.vertices;for(var _=0;_<p;_++){var N=V[_];w[_]+=N+(F[_]-N)*L-y[_]}}else for(var D=0;D<p;D++){N=V[D];w[D]+=N+(F[D]-N)*L}else for(var Y=0;Y<p;Y++){N=V[Y];w[Y]=N+(F[Y]-N)*L}else switch(h){case e.setup:var X=c;if(null==X.bones){y=X.vertices;for(var U=0;U<p;U++){N=V[U],R=y[U];w[U]=R+(N+(F[U]-N)*L-R)*o}}else for(var z=0;z<p;z++){N=V[z];w[z]=(N+(F[z]-N)*L)*o}break;case e.first:case e.replace:for(var B=0;B<p;B++){N=V[B];w[B]+=(N+(F[B]-N)*L-w[B])*o}break;case e.add:if(null==(m=c).bones){y=m.vertices;for(var q=0;q<p;q++){N=V[q];w[q]+=(N+(F[q]-N)*L-y[q])*o}}else for(var W=0;W<p;W++){N=V[W];w[W]+=(N+(F[W]-N)*L)*o}}}}}}},a}(a);t.DeformTimeline=v;var m=function(){function e(e){this.frames=t.Utils.newFloatArray(e),this.events=new Array(e)}return e.prototype.getPropertyId=function(){return i.event<<24},e.prototype.getFrameCount=function(){return this.frames.length},e.prototype.setFrame=function(t,e){this.frames[t]=e.time,this.events[t]=e},e.prototype.apply=function(t,e,n,i,r,a,o){if(null!=i){var h=this.frames,l=this.frames.length;if(e>n)this.apply(t,e,Number.MAX_VALUE,i,r,a,o),e=-1;else if(e>=h[l-1])return;if(!(n<h[0])){var u=0;if(e<h[0])u=0;else for(var c=h[u=s.binarySearch(h,e)];u>0&&h[u-1]==c;)u--;for(;u<l&&n>=h[u];u++)i.push(this.events[u])}}},e}();t.EventTimeline=m;var g=function(){function r(e){this.frames=t.Utils.newFloatArray(e),this.drawOrders=new Array(e)}return r.prototype.getPropertyId=function(){return i.drawOrder<<24},r.prototype.getFrameCount=function(){return this.frames.length},r.prototype.setFrame=function(t,e,n){this.frames[t]=e,this.drawOrders[t]=n},r.prototype.apply=function(i,r,a,o,h,l,u){var c=i.drawOrder,f=i.slots;if(u!=n.mixOut||l!=e.setup){var d=this.frames;if(a<d[0])l!=e.setup&&l!=e.first||t.Utils.arrayCopy(i.slots,0,i.drawOrder,0,i.slots.length);else{var p=0;p=a>=d[d.length-1]?d.length-1:s.binarySearch(d,a)-1;var v=this.drawOrders[p];if(null==v)t.Utils.arrayCopy(f,0,c,0,f.length);else for(var m=0,g=v.length;m<g;m++)c[m]=f[v[m]]}}else t.Utils.arrayCopy(i.slots,0,i.drawOrder,0,i.slots.length)},r}();t.DrawOrderTimeline=g;var y=function(a){function o(e){var n=a.call(this,e)||this;return n.frames=t.Utils.newFloatArray(e*o.ENTRIES),n}return r(o,a),o.prototype.getPropertyId=function(){return(i.ikConstraint<<24)+this.ikConstraintIndex},o.prototype.setFrame=function(t,e,n,i,r,s,a){t*=o.ENTRIES,this.frames[t]=e,this.frames[t+o.MIX]=n,this.frames[t+o.SOFTNESS]=i,this.frames[t+o.BEND_DIRECTION]=r,this.frames[t+o.COMPRESS]=s?1:0,this.frames[t+o.STRETCH]=a?1:0},o.prototype.apply=function(t,i,r,a,h,l,u){var c=this.frames,f=t.ikConstraints[this.ikConstraintIndex];if(f.active)if(r<c[0])switch(l){case e.setup:return f.mix=f.data.mix,f.softness=f.data.softness,f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,void(f.stretch=f.data.stretch);case e.first:f.mix+=(f.data.mix-f.mix)*h,f.softness+=(f.data.softness-f.softness)*h,f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch}else if(r>=c[c.length-o.ENTRIES])l==e.setup?(f.mix=f.data.mix+(c[c.length+o.PREV_MIX]-f.data.mix)*h,f.softness=f.data.softness+(c[c.length+o.PREV_SOFTNESS]-f.data.softness)*h,u==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+o.PREV_COMPRESS],f.stretch=0!=c[c.length+o.PREV_STRETCH])):(f.mix+=(c[c.length+o.PREV_MIX]-f.mix)*h,f.softness+=(c[c.length+o.PREV_SOFTNESS]-f.softness)*h,u==n.mixIn&&(f.bendDirection=c[c.length+o.PREV_BEND_DIRECTION],f.compress=0!=c[c.length+o.PREV_COMPRESS],f.stretch=0!=c[c.length+o.PREV_STRETCH]));else{var d=s.binarySearch(c,r,o.ENTRIES),p=c[d+o.PREV_MIX],v=c[d+o.PREV_SOFTNESS],m=c[d],g=this.getCurvePercent(d/o.ENTRIES-1,1-(r-m)/(c[d+o.PREV_TIME]-m));l==e.setup?(f.mix=f.data.mix+(p+(c[d+o.MIX]-p)*g-f.data.mix)*h,f.softness=f.data.softness+(v+(c[d+o.SOFTNESS]-v)*g-f.data.softness)*h,u==n.mixOut?(f.bendDirection=f.data.bendDirection,f.compress=f.data.compress,f.stretch=f.data.stretch):(f.bendDirection=c[d+o.PREV_BEND_DIRECTION],f.compress=0!=c[d+o.PREV_COMPRESS],f.stretch=0!=c[d+o.PREV_STRETCH])):(f.mix+=(p+(c[d+o.MIX]-p)*g-f.mix)*h,f.softness+=(v+(c[d+o.SOFTNESS]-v)*g-f.softness)*h,u==n.mixIn&&(f.bendDirection=c[d+o.PREV_BEND_DIRECTION],f.compress=0!=c[d+o.PREV_COMPRESS],f.stretch=0!=c[d+o.PREV_STRETCH]))}},o.ENTRIES=6,o.PREV_TIME=-6,o.PREV_MIX=-5,o.PREV_SOFTNESS=-4,o.PREV_BEND_DIRECTION=-3,o.PREV_COMPRESS=-2,o.PREV_STRETCH=-1,o.MIX=1,o.SOFTNESS=2,o.BEND_DIRECTION=3,o.COMPRESS=4,o.STRETCH=5,o}(a);t.IkConstraintTimeline=y;var x=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.transformConstraint<<24)+this.transformConstraintIndex},a.prototype.setFrame=function(t,e,n,i,r,s){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=i,this.frames[t+a.SCALE]=r,this.frames[t+a.SHEAR]=s},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.transformConstraints[this.transformConstraintIndex];if(c.active)if(i<u[0]){var f=c.data;switch(h){case e.setup:return c.rotateMix=f.rotateMix,c.translateMix=f.translateMix,c.scaleMix=f.scaleMix,void(c.shearMix=f.shearMix);case e.first:c.rotateMix+=(f.rotateMix-c.rotateMix)*o,c.translateMix+=(f.translateMix-c.translateMix)*o,c.scaleMix+=(f.scaleMix-c.scaleMix)*o,c.shearMix+=(f.shearMix-c.shearMix)*o}}else{var d=0,p=0,v=0,m=0;if(i>=u[u.length-a.ENTRIES]){var g=u.length;d=u[g+a.PREV_ROTATE],p=u[g+a.PREV_TRANSLATE],v=u[g+a.PREV_SCALE],m=u[g+a.PREV_SHEAR]}else{var y=s.binarySearch(u,i,a.ENTRIES);d=u[y+a.PREV_ROTATE],p=u[y+a.PREV_TRANSLATE],v=u[y+a.PREV_SCALE],m=u[y+a.PREV_SHEAR];var x=u[y],w=this.getCurvePercent(y/a.ENTRIES-1,1-(i-x)/(u[y+a.PREV_TIME]-x));d+=(u[y+a.ROTATE]-d)*w,p+=(u[y+a.TRANSLATE]-p)*w,v+=(u[y+a.SCALE]-v)*w,m+=(u[y+a.SHEAR]-m)*w}if(h==e.setup){f=c.data;c.rotateMix=f.rotateMix+(d-f.rotateMix)*o,c.translateMix=f.translateMix+(p-f.translateMix)*o,c.scaleMix=f.scaleMix+(v-f.scaleMix)*o,c.shearMix=f.shearMix+(m-f.shearMix)*o}else c.rotateMix+=(d-c.rotateMix)*o,c.translateMix+=(p-c.translateMix)*o,c.scaleMix+=(v-c.scaleMix)*o,c.shearMix+=(m-c.shearMix)*o}},a.ENTRIES=5,a.PREV_TIME=-5,a.PREV_ROTATE=-4,a.PREV_TRANSLATE=-3,a.PREV_SCALE=-2,a.PREV_SHEAR=-1,a.ROTATE=1,a.TRANSLATE=2,a.SCALE=3,a.SHEAR=4,a}(a);t.TransformConstraintTimeline=x;var w=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.pathConstraintPosition<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.VALUE]=n},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(i<u[0])switch(h){case e.setup:return void(c.position=c.data.position);case e.first:c.position+=(c.data.position-c.position)*o}else{var f=0;if(i>=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_VALUE];else{var d=s.binarySearch(u,i,a.ENTRIES);f=u[d+a.PREV_VALUE];var p=u[d],v=this.getCurvePercent(d/a.ENTRIES-1,1-(i-p)/(u[d+a.PREV_TIME]-p));f+=(u[d+a.VALUE]-f)*v}h==e.setup?c.position=c.data.position+(f-c.data.position)*o:c.position+=(f-c.position)*o}},a.ENTRIES=2,a.PREV_TIME=-2,a.PREV_VALUE=-1,a.VALUE=1,a}(a);t.PathConstraintPositionTimeline=w;var M=function(t){function n(e){return t.call(this,e)||this}return r(n,t),n.prototype.getPropertyId=function(){return(i.pathConstraintSpacing<<24)+this.pathConstraintIndex},n.prototype.apply=function(t,i,r,a,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(r<u[0])switch(h){case e.setup:return void(c.spacing=c.data.spacing);case e.first:c.spacing+=(c.data.spacing-c.spacing)*o}else{var f=0;if(r>=u[u.length-n.ENTRIES])f=u[u.length+n.PREV_VALUE];else{var d=s.binarySearch(u,r,n.ENTRIES);f=u[d+n.PREV_VALUE];var p=u[d],v=this.getCurvePercent(d/n.ENTRIES-1,1-(r-p)/(u[d+n.PREV_TIME]-p));f+=(u[d+n.VALUE]-f)*v}h==e.setup?c.spacing=c.data.spacing+(f-c.data.spacing)*o:c.spacing+=(f-c.spacing)*o}},n}(w);t.PathConstraintSpacingTimeline=M;var E=function(n){function a(e){var i=n.call(this,e)||this;return i.frames=t.Utils.newFloatArray(e*a.ENTRIES),i}return r(a,n),a.prototype.getPropertyId=function(){return(i.pathConstraintMix<<24)+this.pathConstraintIndex},a.prototype.setFrame=function(t,e,n,i){t*=a.ENTRIES,this.frames[t]=e,this.frames[t+a.ROTATE]=n,this.frames[t+a.TRANSLATE]=i},a.prototype.apply=function(t,n,i,r,o,h,l){var u=this.frames,c=t.pathConstraints[this.pathConstraintIndex];if(c.active)if(i<u[0])switch(h){case e.setup:return c.rotateMix=c.data.rotateMix,void(c.translateMix=c.data.translateMix);case e.first:c.rotateMix+=(c.data.rotateMix-c.rotateMix)*o,c.translateMix+=(c.data.translateMix-c.translateMix)*o}else{var f=0,d=0;if(i>=u[u.length-a.ENTRIES])f=u[u.length+a.PREV_ROTATE],d=u[u.length+a.PREV_TRANSLATE];else{var p=s.binarySearch(u,i,a.ENTRIES);f=u[p+a.PREV_ROTATE],d=u[p+a.PREV_TRANSLATE];var v=u[p],m=this.getCurvePercent(p/a.ENTRIES-1,1-(i-v)/(u[p+a.PREV_TIME]-v));f+=(u[p+a.ROTATE]-f)*m,d+=(u[p+a.TRANSLATE]-d)*m}h==e.setup?(c.rotateMix=c.data.rotateMix+(f-c.data.rotateMix)*o,c.translateMix=c.data.translateMix+(d-c.data.translateMix)*o):(c.rotateMix+=(f-c.rotateMix)*o,c.translateMix+=(d-c.translateMix)*o)}},a.ENTRIES=3,a.PREV_TIME=-3,a.PREV_ROTATE=-2,a.PREV_TRANSLATE=-1,a.ROTATE=1,a.TRANSLATE=2,a}(a);t.PathConstraintMixTimeline=E}(i||(i={})),function(t){var e=function(){function e(e){this.tracks=new Array,this.timeScale=1,this.events=new Array,this.listeners=new Array,this.queue=new r(this),this.propertyIDs=new t.IntSet,this.animationsChanged=!1,this.trackEntryPool=new t.Pool(function(){return new n}),this.data=e}return e.prototype.update=function(t){t*=this.timeScale;for(var e=this.tracks,n=0,i=e.length;n<i;n++){var r=e[n];if(null!=r){r.animationLast=r.nextAnimationLast,r.trackLast=r.nextTrackLast;var s=t*r.timeScale;if(r.delay>0){if(r.delay-=s,r.delay>0)continue;s=-r.delay,r.delay=0}var a=r.next;if(null!=a){var o=r.trackLast-a.delay;if(o>=0){for(a.delay=0,a.trackTime+=0==r.timeScale?0:(o/r.timeScale+t)*a.timeScale,r.trackTime+=s,this.setCurrent(n,a,!0);null!=a.mixingFrom;)a.mixTime+=t,a=a.mixingFrom;continue}}else if(r.trackLast>=r.trackEnd&&null==r.mixingFrom){e[n]=null,this.queue.end(r),this.disposeNext(r);continue}if(null!=r.mixingFrom&&this.updateMixingFrom(r,t)){var h=r.mixingFrom;for(r.mixingFrom=null,null!=h&&(h.mixingTo=null);null!=h;)this.queue.end(h),h=h.mixingFrom}r.trackTime+=s}}this.queue.drain()},e.prototype.updateMixingFrom=function(t,e){var n=t.mixingFrom;if(null==n)return!0;var i=this.updateMixingFrom(n,e);return n.animationLast=n.nextAnimationLast,n.trackLast=n.nextTrackLast,t.mixTime>0&&t.mixTime>=t.mixDuration?(0!=n.totalAlpha&&0!=t.mixDuration||(t.mixingFrom=n.mixingFrom,null!=n.mixingFrom&&(n.mixingFrom.mixingTo=t),t.interruptAlpha=n.interruptAlpha,this.queue.end(n)),i):(n.trackTime+=e*n.timeScale,t.mixTime+=e,!1)},e.prototype.apply=function(n){if(null==n)throw new Error("skeleton cannot be null.");this.animationsChanged&&this._animationsChanged();for(var i=this.events,r=this.tracks,s=!1,a=0,o=r.length;a<o;a++){var h=r[a];if(!(null==h||h.delay>0)){s=!0;var l=0==a?t.MixBlend.first:h.mixBlend,u=h.alpha;null!=h.mixingFrom?u*=this.applyMixingFrom(h,n,l):h.trackTime>=h.trackEnd&&null==h.next&&(u=0);var c=h.animationLast,f=h.getAnimationTime(),d=h.animation.timelines.length,p=h.animation.timelines;if(0==a&&1==u||l==t.MixBlend.add)for(var v=0;v<d;v++)t.Utils.webkit602BugfixHelper(u,l),p[v].apply(n,c,f,i,u,l,t.MixDirection.mixIn);else{var m=h.timelineMode,g=0==h.timelinesRotation.length;g&&t.Utils.setArraySize(h.timelinesRotation,d<<1,null);var y=h.timelinesRotation;for(v=0;v<d;v++){var x=p[v],w=(m[v]&e.NOT_LAST-1)==e.SUBSEQUENT?l:t.MixBlend.setup;x instanceof t.RotateTimeline?this.applyRotateTimeline(x,n,f,u,w,y,v<<1,g):(t.Utils.webkit602BugfixHelper(u,l),x.apply(n,c,f,i,u,w,t.MixDirection.mixIn))}}this.queueEvents(h,f),i.length=0,h.nextAnimationLast=f,h.nextTrackLast=h.trackTime}}return this.queue.drain(),s},e.prototype.applyMixingFrom=function(n,i,r){var s=n.mixingFrom;null!=s.mixingFrom&&this.applyMixingFrom(s,i,r);var a=0;0==n.mixDuration?(a=1,r==t.MixBlend.first&&(r=t.MixBlend.setup)):((a=n.mixTime/n.mixDuration)>1&&(a=1),r!=t.MixBlend.first&&(r=s.mixBlend));var o=a<s.eventThreshold?this.events:null,h=a<s.attachmentThreshold,l=a<s.drawOrderThreshold,u=s.animationLast,c=s.getAnimationTime(),f=s.animation.timelines.length,d=s.animation.timelines,p=s.alpha*n.interruptAlpha,v=p*(1-a);if(r==t.MixBlend.add)for(var m=0;m<f;m++)d[m].apply(i,u,c,o,v,r,t.MixDirection.mixOut);else{var g=s.timelineMode,y=s.timelineHoldMix,x=0==s.timelinesRotation.length;x&&t.Utils.setArraySize(s.timelinesRotation,f<<1,null);var w=s.timelinesRotation;s.totalAlpha=0;for(m=0;m<f;m++){var M=d[m],E=t.MixDirection.mixOut,T=void 0,A=0;switch(g[m]&e.NOT_LAST-1){case e.SUBSEQUENT:if(T=r,!h&&M instanceof t.AttachmentTimeline){if((g[m]&e.NOT_LAST)==e.NOT_LAST)continue;T=t.MixBlend.setup}if(!l&&M instanceof t.DrawOrderTimeline)continue;A=v;break;case e.FIRST:T=t.MixBlend.setup,A=v;break;case e.HOLD:T=t.MixBlend.setup,A=p;break;default:T=t.MixBlend.setup;var b=y[m];A=p*Math.max(0,1-b.mixTime/b.mixDuration)}s.totalAlpha+=A,M instanceof t.RotateTimeline?this.applyRotateTimeline(M,i,c,A,T,w,m<<1,x):(t.Utils.webkit602BugfixHelper(A,r),T==t.MixBlend.setup&&(M instanceof t.AttachmentTimeline?(h||(g[m]&e.NOT_LAST)==e.NOT_LAST)&&(E=t.MixDirection.mixIn):M instanceof t.DrawOrderTimeline&&l&&(E=t.MixDirection.mixIn)),M.apply(i,u,c,o,A,T,E))}}return n.mixDuration>0&&this.queueEvents(s,c),this.events.length=0,s.nextAnimationLast=c,s.nextTrackLast=s.trackTime,a},e.prototype.applyRotateTimeline=function(e,n,i,r,s,a,o,h){if(h&&(a[o]=0),1!=r){var l=e,u=l.frames,c=n.bones[l.boneIndex];if(c.active){var f=0,d=0;if(i<u[0])switch(s){case t.MixBlend.setup:c.rotation=c.data.rotation;default:return;case t.MixBlend.first:f=c.rotation,d=c.data.rotation}else if(f=s==t.MixBlend.setup?c.data.rotation:c.rotation,i>=u[u.length-t.RotateTimeline.ENTRIES])d=c.data.rotation+u[u.length+t.RotateTimeline.PREV_ROTATION];else{var p=t.Animation.binarySearch(u,i,t.RotateTimeline.ENTRIES),v=u[p+t.RotateTimeline.PREV_ROTATION],m=u[p],g=l.getCurvePercent((p>>1)-1,1-(i-m)/(u[p+t.RotateTimeline.PREV_TIME]-m));d=u[p+t.RotateTimeline.ROTATION]-v,d=v+(d-=360*(16384-(16384.499999999996-d/360|0)))*g+c.data.rotation,d-=360*(16384-(16384.499999999996-d/360|0))}var y=0,x=d-f;if(0==(x-=360*(16384-(16384.499999999996-x/360|0))))y=a[o];else{var w=0,M=0;h?(w=0,M=x):(w=a[o],M=a[o+1]);var E=x>0,T=w>=0;t.MathUtils.signum(M)!=t.MathUtils.signum(x)&&Math.abs(M)<=90&&(Math.abs(w)>180&&(w+=360*t.MathUtils.signum(w)),T=E),y=x+w-w%360,T!=E&&(y+=360*t.MathUtils.signum(w)),a[o]=y}a[o+1]=x,f+=y*r,c.rotation=f-360*(16384-(16384.499999999996-f/360|0))}}else e.apply(n,0,i,null,1,s,t.MixDirection.mixIn)},e.prototype.queueEvents=function(t,e){for(var n=t.animationStart,i=t.animationEnd,r=i-n,s=t.trackLast%r,a=this.events,o=0,h=a.length;o<h;o++){var l=a[o];if(l.time<s)break;l.time>i||this.queue.event(t,l)}for((t.loop?0==r||s>t.trackTime%r:e>=i&&t.animationLast<i)&&this.queue.complete(t);o<h;o++){a[o].time<n||this.queue.event(t,a[o])}},e.prototype.clearTracks=function(){var t=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var e=0,n=this.tracks.length;e<n;e++)this.clearTrack(e);this.tracks.length=0,this.queue.drainDisabled=t,this.queue.drain()},e.prototype.clearTrack=function(t){if(!(t>=this.tracks.length)){var e=this.tracks[t];if(null!=e){this.queue.end(e),this.disposeNext(e);for(var n=e;;){var i=n.mixingFrom;if(null==i)break;this.queue.end(i),n.mixingFrom=null,n.mixingTo=null,n=i}this.tracks[e.trackIndex]=null,this.queue.drain()}}},e.prototype.setCurrent=function(t,e,n){var i=this.expandToIndex(t);this.tracks[t]=e,null!=i&&(n&&this.queue.interrupt(i),e.mixingFrom=i,i.mixingTo=e,e.mixTime=0,null!=i.mixingFrom&&i.mixDuration>0&&(e.interruptAlpha*=Math.min(1,i.mixTime/i.mixDuration)),i.timelinesRotation.length=0),this.queue.start(e)},e.prototype.setAnimation=function(t,e,n){var i=this.data.skeletonData.findAnimation(e);if(null==i)throw new Error("Animation not found: "+e);return this.setAnimationWith(t,i,n)},e.prototype.setAnimationWith=function(t,e,n){if(null==e)throw new Error("animation cannot be null.");var i=!0,r=this.expandToIndex(t);null!=r&&(-1==r.nextTrackLast?(this.tracks[t]=r.mixingFrom,this.queue.interrupt(r),this.queue.end(r),this.disposeNext(r),r=r.mixingFrom,i=!1):this.disposeNext(r));var s=this.trackEntry(t,e,n,r);return this.setCurrent(t,s,i),this.queue.drain(),s},e.prototype.addAnimation=function(t,e,n,i){var r=this.data.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);return this.addAnimationWith(t,r,n,i)},e.prototype.addAnimationWith=function(t,e,n,i){if(null==e)throw new Error("animation cannot be null.");var r=this.expandToIndex(t);if(null!=r)for(;null!=r.next;)r=r.next;var s=this.trackEntry(t,e,n,r);if(null==r)this.setCurrent(t,s,!0),this.queue.drain();else if(r.next=s,i<=0){var a=r.animationEnd-r.animationStart;0!=a?(r.loop?i+=a*(1+(r.trackTime/a|0)):i+=Math.max(a,r.trackTime),i-=this.data.getMix(r.animation,e)):i=r.trackTime}return s.delay=i,s},e.prototype.setEmptyAnimation=function(t,n){var i=this.setAnimationWith(t,e.emptyAnimation,!1);return i.mixDuration=n,i.trackEnd=n,i},e.prototype.addEmptyAnimation=function(t,n,i){i<=0&&(i-=n);var r=this.addAnimationWith(t,e.emptyAnimation,!1,i);return r.mixDuration=n,r.trackEnd=n,r},e.prototype.setEmptyAnimations=function(t){var e=this.queue.drainDisabled;this.queue.drainDisabled=!0;for(var n=0,i=this.tracks.length;n<i;n++){var r=this.tracks[n];null!=r&&this.setEmptyAnimation(r.trackIndex,t)}this.queue.drainDisabled=e,this.queue.drain()},e.prototype.expandToIndex=function(e){return e<this.tracks.length?this.tracks[e]:(t.Utils.ensureArrayCapacity(this.tracks,e+1,null),this.tracks.length=e+1,null)},e.prototype.trackEntry=function(t,e,n,i){var r=this.trackEntryPool.obtain();return r.trackIndex=t,r.animation=e,r.loop=n,r.holdPrevious=!1,r.eventThreshold=0,r.attachmentThreshold=0,r.drawOrderThreshold=0,r.animationStart=0,r.animationEnd=e.duration,r.animationLast=-1,r.nextAnimationLast=-1,r.delay=0,r.trackTime=0,r.trackLast=-1,r.nextTrackLast=-1,r.trackEnd=Number.MAX_VALUE,r.timeScale=1,r.alpha=1,r.interruptAlpha=1,r.mixTime=0,r.mixDuration=null==i?0:this.data.getMix(i.animation,e),r},e.prototype.disposeNext=function(t){for(var e=t.next;null!=e;)this.queue.dispose(e),e=e.next;t.next=null},e.prototype._animationsChanged=function(){this.animationsChanged=!1,this.propertyIDs.clear();for(var e=0,n=this.tracks.length;e<n;e++){if(null!=(i=this.tracks[e])){for(;null!=i.mixingFrom;)i=i.mixingFrom;do{null!=i.mixingFrom&&i.mixBlend==t.MixBlend.add||this.computeHold(i),i=i.mixingTo}while(null!=i)}}this.propertyIDs.clear();for(e=this.tracks.length-1;e>=0;e--)for(var i=this.tracks[e];null!=i;)this.computeNotLast(i),i=i.mixingFrom},e.prototype.computeHold=function(n){var i=n.mixingTo,r=n.animation.timelines,s=n.animation.timelines.length,a=t.Utils.setArraySize(n.timelineMode,s);n.timelineHoldMix.length=0;var o=t.Utils.setArraySize(n.timelineHoldMix,s),h=this.propertyIDs;if(null!=i&&i.holdPrevious)for(var l=0;l<s;l++)h.add(r[l].getPropertyId()),a[l]=e.HOLD;else t:for(l=0;l<s;l++){var u=r[l],c=u.getPropertyId();if(h.add(c))if(null==i||u instanceof t.AttachmentTimeline||u instanceof t.DrawOrderTimeline||u instanceof t.EventTimeline||!i.animation.hasTimeline(c))a[l]=e.FIRST;else{for(var f=i.mixingTo;null!=f;f=f.mixingTo)if(!f.animation.hasTimeline(c)){if(n.mixDuration>0){a[l]=e.HOLD_MIX,o[l]=f;continue t}break}a[l]=e.HOLD}else a[l]=e.SUBSEQUENT}},e.prototype.computeNotLast=function(n){for(var i=n.animation.timelines,r=n.animation.timelines.length,s=n.timelineMode,a=this.propertyIDs,o=0;o<r;o++)if(i[o]instanceof t.AttachmentTimeline){var h=i[o];a.add(h.slotIndex)||(s[o]|=e.NOT_LAST)}},e.prototype.getCurrent=function(t){return t>=this.tracks.length?null:this.tracks[t]},e.prototype.addListener=function(t){if(null==t)throw new Error("listener cannot be null.");this.listeners.push(t)},e.prototype.removeListener=function(t){var e=this.listeners.indexOf(t);e>=0&&this.listeners.splice(e,1)},e.prototype.clearListeners=function(){this.listeners.length=0},e.prototype.clearListenerNotifications=function(){this.queue.clear()},e.emptyAnimation=new t.Animation("<empty>",[],0),e.SUBSEQUENT=0,e.FIRST=1,e.HOLD=2,e.HOLD_MIX=3,e.NOT_LAST=4,e}();t.AnimationState=e;var n=function(){function e(){this.mixBlend=t.MixBlend.replace,this.timelineMode=new Array,this.timelineHoldMix=new Array,this.timelinesRotation=new Array}return e.prototype.reset=function(){this.next=null,this.mixingFrom=null,this.mixingTo=null,this.animation=null,this.listener=null,this.timelineMode.length=0,this.timelineHoldMix.length=0,this.timelinesRotation.length=0},e.prototype.getAnimationTime=function(){if(this.loop){var t=this.animationEnd-this.animationStart;return 0==t?this.animationStart:this.trackTime%t+this.animationStart}return Math.min(this.trackTime+this.animationStart,this.animationEnd)},e.prototype.setAnimationLast=function(t){this.animationLast=t,this.nextAnimationLast=t},e.prototype.isComplete=function(){return this.trackTime>=this.animationEnd-this.animationStart},e.prototype.resetRotationDirections=function(){this.timelinesRotation.length=0},e}();t.TrackEntry=n;var i,r=function(){function t(t){this.objects=[],this.drainDisabled=!1,this.animState=t}return t.prototype.start=function(t){this.objects.push(i.start),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.interrupt=function(t){this.objects.push(i.interrupt),this.objects.push(t)},t.prototype.end=function(t){this.objects.push(i.end),this.objects.push(t),this.animState.animationsChanged=!0},t.prototype.dispose=function(t){this.objects.push(i.dispose),this.objects.push(t)},t.prototype.complete=function(t){this.objects.push(i.complete),this.objects.push(t)},t.prototype.event=function(t,e){this.objects.push(i.event),this.objects.push(t),this.objects.push(e)},t.prototype.drain=function(){if(!this.drainDisabled){this.drainDisabled=!0;for(var t=this.objects,e=this.animState.listeners,n=0;n<t.length;n+=2){var r=t[n],s=t[n+1];switch(r){case i.start:null!=s.listener&&s.listener.start&&s.listener.start(s);for(var a=0;a<e.length;a++)e[a].start&&e[a].start(s);break;case i.interrupt:null!=s.listener&&s.listener.interrupt&&s.listener.interrupt(s);for(a=0;a<e.length;a++)e[a].interrupt&&e[a].interrupt(s);break;case i.end:null!=s.listener&&s.listener.end&&s.listener.end(s);for(a=0;a<e.length;a++)e[a].end&&e[a].end(s);case i.dispose:null!=s.listener&&s.listener.dispose&&s.listener.dispose(s);for(a=0;a<e.length;a++)e[a].dispose&&e[a].dispose(s);this.animState.trackEntryPool.free(s);break;case i.complete:null!=s.listener&&s.listener.complete&&s.listener.complete(s);for(a=0;a<e.length;a++)e[a].complete&&e[a].complete(s);break;case i.event:var o=t[2+n++];null!=s.listener&&s.listener.event&&s.listener.event(s,o);for(a=0;a<e.length;a++)e[a].event&&e[a].event(s,o)}}this.clear(),this.drainDisabled=!1}},t.prototype.clear=function(){this.objects.length=0},t}();t.EventQueue=r,function(t){t[t.start=0]="start",t[t.interrupt=1]="interrupt",t[t.end=2]="end",t[t.dispose=3]="dispose",t[t.complete=4]="complete",t[t.event=5]="event"}(i=t.EventType||(t.EventType={}));var s=function(){function t(){}return t.prototype.start=function(t){},t.prototype.interrupt=function(t){},t.prototype.end=function(t){},t.prototype.dispose=function(t){},t.prototype.complete=function(t){},t.prototype.event=function(t,e){},t}();t.AnimationStateAdapter=s}(i||(i={})),function(t){var e=function(){function t(t){if(this.animationToMixTime={},this.defaultMix=0,null==t)throw new Error("skeletonData cannot be null.");this.skeletonData=t}return t.prototype.setMix=function(t,e,n){var i=this.skeletonData.findAnimation(t);if(null==i)throw new Error("Animation not found: "+t);var r=this.skeletonData.findAnimation(e);if(null==r)throw new Error("Animation not found: "+e);this.setMixWith(i,r,n)},t.prototype.setMixWith=function(t,e,n){if(null==t)throw new Error("from cannot be null.");if(null==e)throw new Error("to cannot be null.");var i=t.name+"."+e.name;this.animationToMixTime[i]=n},t.prototype.getMix=function(t,e){var n=t.name+"."+e.name,i=this.animationToMixTime[n];return void 0===i?this.defaultMix:i},t}();t.AnimationStateData=e}(i||(i={})),function(t){var e=function(){function e(t,e){void 0===e&&(e=""),this.assets={},this.errors={},this.toLoad=0,this.loaded=0,this.textureLoader=t,this.pathPrefix=e}return e.downloadText=function(t,e,n){var i=new XMLHttpRequest;i.open("GET",t,!0),i.onload=function(){200==i.status?e(i.responseText):n(i.status,i.responseText)},i.onerror=function(){n(i.status,i.responseText)},i.send()},e.downloadBinary=function(t,e,n){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status?e(new Uint8Array(i.response)):n(i.status,i.responseText)},i.onerror=function(){n(i.status,i.responseText)},i.send()},e.prototype.loadBinary=function(t,n,i){var r=this;void 0===n&&(n=null),void 0===i&&(i=null),t=this.pathPrefix+t,this.toLoad++,e.downloadBinary(t,function(e){r.assets[t]=e,n&&n(t,e),r.toLoad--,r.loaded++},function(e,n){r.errors[t]="Couldn't load binary "+t+": status "+status+", "+n,i&&i(t,"Couldn't load binary "+t+": status "+status+", "+n),r.toLoad--,r.loaded++})},e.prototype.loadText=function(t,n,i){var r=this;void 0===n&&(n=null),void 0===i&&(i=null),t=this.pathPrefix+t,this.toLoad++,e.downloadText(t,function(e){r.assets[t]=e,n&&n(t,e),r.toLoad--,r.loaded++},function(e,n){r.errors[t]="Couldn't load text "+t+": status "+status+", "+n,i&&i(t,"Couldn't load text "+t+": status "+status+", "+n),r.toLoad--,r.loaded++})},e.prototype.loadTexture=function(t,e,n){var i=this;void 0===e&&(e=null),void 0===n&&(n=null),t=this.pathPrefix+t,this.toLoad++;var r=new Image;r.crossOrigin="anonymous",r.onload=function(n){var s=i.textureLoader(r);i.assets[t]=s,i.toLoad--,i.loaded++,e&&e(t,r)},r.onerror=function(e){i.errors[t]="Couldn't load image "+t,i.toLoad--,i.loaded++,n&&n(t,"Couldn't load image "+t)},r.src=t},e.prototype.loadTextureData=function(t,e,n,i){var r=this;void 0===n&&(n=null),void 0===i&&(i=null),t=this.pathPrefix+t,this.toLoad++;var s=new Image;s.onload=function(e){var i=r.textureLoader(s);r.assets[t]=i,r.toLoad--,r.loaded++,n&&n(t,s)},s.onerror=function(e){r.errors[t]="Couldn't load image "+t,r.toLoad--,r.loaded++,i&&i(t,"Couldn't load image "+t)},s.src=e},e.prototype.loadTextureAtlas=function(n,i,r){var s=this;void 0===i&&(i=null),void 0===r&&(r=null);var a=n.lastIndexOf("/")>=0?n.substring(0,n.lastIndexOf("/")):"";n=this.pathPrefix+n,this.toLoad++,e.downloadText(n,function(e){var o={count:0},h=new Array;try{new t.TextureAtlas(e,function(e){h.push(a+"/"+e);var n=document.createElement("img");return n.width=16,n.height=16,new t.FakeTexture(n)})}catch(t){var l=t;return s.errors[n]="Couldn't load texture atlas "+n+": "+l.message,r&&r(n,"Couldn't load texture atlas "+n+": "+l.message),s.toLoad--,void s.loaded++}for(var u=function(l){var u=!1;s.loadTexture(l,function(l,c){if(o.count++,o.count==h.length)if(u)s.errors[n]="Couldn't load texture atlas page "+l+"} of atlas "+n,r&&r(n,"Couldn't load texture atlas page "+l+" of atlas "+n),s.toLoad--,s.loaded++;else try{var f=new t.TextureAtlas(e,function(t){return s.get(a+"/"+t)});s.assets[n]=f,i&&i(n,f),s.toLoad--,s.loaded++}catch(t){var d=t;s.errors[n]="Couldn't load texture atlas "+n+": "+d.message,r&&r(n,"Couldn't load texture atlas "+n+": "+d.message),s.toLoad--,s.loaded++}},function(t,e){u=!0,o.count++,o.count==h.length&&(s.errors[n]="Couldn't load texture atlas page "+t+"} of atlas "+n,r&&r(n,"Couldn't load texture atlas page "+t+" of atlas "+n),s.toLoad--,s.loaded++)})},c=0,f=h;c<f.length;c++){u(f[c])}},function(t,e){s.errors[n]="Couldn't load texture atlas "+n+": status "+status+", "+e,r&&r(n,"Couldn't load texture atlas "+n+": status "+status+", "+e),s.toLoad--,s.loaded++})},e.prototype.get=function(t){return t=this.pathPrefix+t,this.assets[t]},e.prototype.remove=function(t){t=this.pathPrefix+t;var e=this.assets[t];e.dispose&&e.dispose(),this.assets[t]=null},e.prototype.removeAll=function(){for(var t in this.assets){var e=this.assets[t];e.dispose&&e.dispose()}this.assets={}},e.prototype.isLoadingComplete=function(){return 0==this.toLoad},e.prototype.getToLoad=function(){return this.toLoad},e.prototype.getLoaded=function(){return this.loaded},e.prototype.dispose=function(){this.removeAll()},e.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},e.prototype.getErrors=function(){return this.errors},e}();t.AssetManager=e}(i||(i={})),function(t){var e=function(){function e(t){this.atlas=t}return e.prototype.newRegionAttachment=function(e,n,i){var r=this.atlas.findRegion(i);if(null==r)throw new Error("Region not found in atlas: "+i+" (region attachment: "+n+")");r.renderObject=r;var s=new t.RegionAttachment(n);return s.setRegion(r),s},e.prototype.newMeshAttachment=function(e,n,i){var r=this.atlas.findRegion(i);if(null==r)throw new Error("Region not found in atlas: "+i+" (mesh attachment: "+n+")");r.renderObject=r;var s=new t.MeshAttachment(n);return s.region=r,s},e.prototype.newBoundingBoxAttachment=function(e,n){return new t.BoundingBoxAttachment(n)},e.prototype.newPathAttachment=function(e,n){return new t.PathAttachment(n)},e.prototype.newPointAttachment=function(e,n){return new t.PointAttachment(n)},e.prototype.newClippingAttachment=function(e,n){return new t.ClippingAttachment(n)},e}();t.AtlasAttachmentLoader=e}(i||(i={})),function(t){!function(t){t[t.Normal=0]="Normal",t[t.Additive=1]="Additive",t[t.Multiply=2]="Multiply",t[t.Screen=3]="Screen"}(t.BlendMode||(t.BlendMode={}))}(i||(i={})),function(t){var e=function(){function e(t,e,n){if(this.children=new Array,this.x=0,this.y=0,this.rotation=0,this.scaleX=0,this.scaleY=0,this.shearX=0,this.shearY=0,this.ax=0,this.ay=0,this.arotation=0,this.ascaleX=0,this.ascaleY=0,this.ashearX=0,this.ashearY=0,this.appliedValid=!1,this.a=0,this.b=0,this.c=0,this.d=0,this.worldY=0,this.worldX=0,this.sorted=!1,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.skeleton=e,this.parent=n,this.setToSetupPose()}return e.prototype.isActive=function(){return this.active},e.prototype.update=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransform=function(){this.updateWorldTransformWith(this.x,this.y,this.rotation,this.scaleX,this.scaleY,this.shearX,this.shearY)},e.prototype.updateWorldTransformWith=function(e,n,i,r,s,a,o){this.ax=e,this.ay=n,this.arotation=i,this.ascaleX=r,this.ascaleY=s,this.ashearX=a,this.ashearY=o,this.appliedValid=!0;var h=this.parent;if(null==h){var l=this.skeleton,u=i+90+o,c=l.scaleX,f=l.scaleY;return this.a=t.MathUtils.cosDeg(i+a)*r*c,this.b=t.MathUtils.cosDeg(u)*s*c,this.c=t.MathUtils.sinDeg(i+a)*r*f,this.d=t.MathUtils.sinDeg(u)*s*f,this.worldX=e*c+l.x,void(this.worldY=n*f+l.y)}var d=h.a,p=h.b,v=h.c,m=h.d;switch(this.worldX=d*e+p*n+h.worldX,this.worldY=v*e+m*n+h.worldY,this.data.transformMode){case t.TransformMode.Normal:u=i+90+o;var g=t.MathUtils.cosDeg(i+a)*r,y=t.MathUtils.cosDeg(u)*s,x=t.MathUtils.sinDeg(i+a)*r,w=t.MathUtils.sinDeg(u)*s;return this.a=d*g+p*x,this.b=d*y+p*w,this.c=v*g+m*x,void(this.d=v*y+m*w);case t.TransformMode.OnlyTranslation:u=i+90+o;this.a=t.MathUtils.cosDeg(i+a)*r,this.b=t.MathUtils.cosDeg(u)*s,this.c=t.MathUtils.sinDeg(i+a)*r,this.d=t.MathUtils.sinDeg(u)*s;break;case t.TransformMode.NoRotationOrReflection:var M=0;(A=d*d+v*v)>1e-4?(p=v*(A=Math.abs(d*m-p*v)/A),m=d*A,M=Math.atan2(v,d)*t.MathUtils.radDeg):(d=0,v=0,M=90-Math.atan2(m,p)*t.MathUtils.radDeg);var E=i+a-M,T=i+o-M+90;g=t.MathUtils.cosDeg(E)*r,y=t.MathUtils.cosDeg(T)*s,x=t.MathUtils.sinDeg(E)*r,w=t.MathUtils.sinDeg(T)*s;this.a=d*g-p*x,this.b=d*y-p*w,this.c=v*g+m*x,this.d=v*y+m*w;break;case t.TransformMode.NoScale:case t.TransformMode.NoScaleOrReflection:var A,b=t.MathUtils.cosDeg(i),R=t.MathUtils.sinDeg(i),I=(d*b+p*R)/this.skeleton.scaleX,S=(v*b+m*R)/this.skeleton.scaleY;(A=Math.sqrt(I*I+S*S))>1e-5&&(A=1/A),I*=A,S*=A,A=Math.sqrt(I*I+S*S),this.data.transformMode==t.TransformMode.NoScale&&d*m-p*v<0!=(this.skeleton.scaleX<0!=this.skeleton.scaleY<0)&&(A=-A);var C=Math.PI/2+Math.atan2(S,I),P=Math.cos(C)*A,k=Math.sin(C)*A;g=t.MathUtils.cosDeg(a)*r,y=t.MathUtils.cosDeg(90+o)*s,x=t.MathUtils.sinDeg(a)*r,w=t.MathUtils.sinDeg(90+o)*s;this.a=I*g+P*x,this.b=I*y+P*w,this.c=S*g+k*x,this.d=S*y+k*w}this.a*=this.skeleton.scaleX,this.b*=this.skeleton.scaleX,this.c*=this.skeleton.scaleY,this.d*=this.skeleton.scaleY},e.prototype.setToSetupPose=function(){var t=this.data;this.x=t.x,this.y=t.y,this.rotation=t.rotation,this.scaleX=t.scaleX,this.scaleY=t.scaleY,this.shearX=t.shearX,this.shearY=t.shearY},e.prototype.getWorldRotationX=function(){return Math.atan2(this.c,this.a)*t.MathUtils.radDeg},e.prototype.getWorldRotationY=function(){return Math.atan2(this.d,this.b)*t.MathUtils.radDeg},e.prototype.getWorldScaleX=function(){return Math.sqrt(this.a*this.a+this.c*this.c)},e.prototype.getWorldScaleY=function(){return Math.sqrt(this.b*this.b+this.d*this.d)},e.prototype.updateAppliedTransform=function(){this.appliedValid=!0;var e=this.parent;if(null==e)return this.ax=this.worldX,this.ay=this.worldY,this.arotation=Math.atan2(this.c,this.a)*t.MathUtils.radDeg,this.ascaleX=Math.sqrt(this.a*this.a+this.c*this.c),this.ascaleY=Math.sqrt(this.b*this.b+this.d*this.d),this.ashearX=0,void(this.ashearY=Math.atan2(this.a*this.b+this.c*this.d,this.a*this.d-this.b*this.c)*t.MathUtils.radDeg);var n=e.a,i=e.b,r=e.c,s=e.d,a=1/(n*s-i*r),o=this.worldX-e.worldX,h=this.worldY-e.worldY;this.ax=o*s*a-h*i*a,this.ay=h*n*a-o*r*a;var l=a*s,u=a*n,c=a*i,f=a*r,d=l*this.a-c*this.c,p=l*this.b-c*this.d,v=u*this.c-f*this.a,m=u*this.d-f*this.b;if(this.ashearX=0,this.ascaleX=Math.sqrt(d*d+v*v),this.ascaleX>1e-4){var g=d*m-p*v;this.ascaleY=g/this.ascaleX,this.ashearY=Math.atan2(d*p+v*m,g)*t.MathUtils.radDeg,this.arotation=Math.atan2(v,d)*t.MathUtils.radDeg}else this.ascaleX=0,this.ascaleY=Math.sqrt(p*p+m*m),this.ashearY=0,this.arotation=90-Math.atan2(m,p)*t.MathUtils.radDeg},e.prototype.worldToLocal=function(t){var e=this.a,n=this.b,i=this.c,r=this.d,s=1/(e*r-n*i),a=t.x-this.worldX,o=t.y-this.worldY;return t.x=a*r*s-o*n*s,t.y=o*e*s-a*i*s,t},e.prototype.localToWorld=function(t){var e=t.x,n=t.y;return t.x=e*this.a+n*this.b+this.worldX,t.y=e*this.c+n*this.d+this.worldY,t},e.prototype.worldToLocalRotation=function(e){var n=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(this.a*n-this.c*i,this.d*i-this.b*n)*t.MathUtils.radDeg+this.rotation-this.shearX},e.prototype.localToWorldRotation=function(e){e-=this.rotation-this.shearX;var n=t.MathUtils.sinDeg(e),i=t.MathUtils.cosDeg(e);return Math.atan2(i*this.c+n*this.d,i*this.a+n*this.b)*t.MathUtils.radDeg},e.prototype.rotateWorld=function(e){var n=this.a,i=this.b,r=this.c,s=this.d,a=t.MathUtils.cosDeg(e),o=t.MathUtils.sinDeg(e);this.a=a*n-o*r,this.b=a*i-o*s,this.c=o*n+a*r,this.d=o*i+a*s,this.appliedValid=!1},e}();t.Bone=e}(i||(i={})),function(t){var e,n=function(){return function(n,i,r){if(this.x=0,this.y=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.shearX=0,this.shearY=0,this.transformMode=e.Normal,this.skinRequired=!1,this.color=new t.Color,n<0)throw new Error("index must be >= 0.");if(null==i)throw new Error("name cannot be null.");this.index=n,this.name=i,this.parent=r}}();t.BoneData=n,function(t){t[t.Normal=0]="Normal",t[t.OnlyTranslation=1]="OnlyTranslation",t[t.NoRotationOrReflection=2]="NoRotationOrReflection",t[t.NoScale=3]="NoScale",t[t.NoScaleOrReflection=4]="NoScaleOrReflection"}(e=t.TransformMode||(t.TransformMode={}))}(i||(i={})),function(t){var e=function(){return function(t,e,n){this.name=t,this.order=e,this.skinRequired=n}}();t.ConstraintData=e}(i||(i={})),function(t){var e=function(){return function(t,e){if(null==e)throw new Error("data cannot be null.");this.time=t,this.data=e}}();t.Event=e}(i||(i={})),function(t){var e=function(){return function(t){this.name=t}}();t.EventData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.bendDirection=0,this.compress=!1,this.stretch=!1,this.mix=1,this.softness=0,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.mix=t.mix,this.softness=t.softness,this.bendDirection=t.bendDirection,this.compress=t.compress,this.stretch=t.stretch,this.bones=new Array;for(var n=0;n<t.bones.length;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findBone(t.target.name)}return e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){var t=this.target,e=this.bones;switch(e.length){case 1:this.apply1(e[0],t.worldX,t.worldY,this.compress,this.stretch,this.data.uniform,this.mix);break;case 2:this.apply2(e[0],e[1],t.worldX,t.worldY,this.bendDirection,this.stretch,this.softness,this.mix)}},e.prototype.apply1=function(e,n,i,r,s,a,o){e.appliedValid||e.updateAppliedTransform();var h=e.parent,l=1/(h.a*h.d-h.b*h.c),u=n-h.worldX,c=i-h.worldY,f=(u*h.d-c*h.b)*l-e.ax,d=(c*h.a-u*h.c)*l-e.ay,p=Math.atan2(d,f)*t.MathUtils.radDeg-e.ashearX-e.arotation;e.ascaleX<0&&(p+=180),p>180?p-=360:p<-180&&(p+=360);var v=e.ascaleX,m=e.ascaleY;if(r||s){var g=e.data.length*v,y=Math.sqrt(f*f+d*d);if(r&&y<g||s&&y>g&&g>1e-4){var x=(y/g-1)*o+1;v*=x,a&&(m*=x)}}e.updateWorldTransformWith(e.ax,e.ay,e.arotation+p*o,v,m,e.ashearX,e.ashearY)},e.prototype.apply2=function(e,n,i,r,s,a,o,h){if(0!=h){e.appliedValid||e.updateAppliedTransform(),n.appliedValid||n.updateAppliedTransform();var l=e.ax,u=e.ay,c=e.ascaleX,f=c,d=e.ascaleY,p=n.ascaleX,v=0,m=0,g=0;c<0?(c=-c,v=180,g=-1):(v=0,g=1),d<0&&(d=-d,g=-g),p<0?(p=-p,m=180):m=0;var y=n.ax,x=0,w=0,M=0,E=e.a,T=e.b,A=e.c,b=e.d,R=Math.abs(c-d)<=1e-4;R?(w=E*y+T*(x=n.ay)+e.worldX,M=A*y+b*x+e.worldY):(x=0,w=E*y+e.worldX,M=A*y+e.worldY);var I=e.parent;E=I.a,T=I.b,A=I.c;var S,C,P=1/(E*(b=I.d)-T*A),k=w-I.worldX,V=M-I.worldY,F=(k*b-V*T)*P-l,O=(V*E-k*A)*P-u,L=Math.sqrt(F*F+O*O),_=n.data.length*p;if(L<1e-4)return this.apply1(e,i,r,!1,a,!1,h),void n.updateWorldTransformWith(y,x,0,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY);var N=((k=i-I.worldX)*b-(V=r-I.worldY)*T)*P-l,D=(V*E-k*A)*P-u,Y=N*N+D*D;if(0!=o){o*=c*(p+1)/2;var X=Math.sqrt(Y),U=X-L-_*c+o;if(U>0){var z=Math.min(1,U/(2*o))-1;Y=(N-=(z=(U-o*(1-z*z))/X)*N)*N+(D-=z*D)*D}}t:if(R){var B=(Y-L*L-(_*=c)*_)/(2*L*_);B<-1?B=-1:B>1&&(B=1,a&&(f*=(Math.sqrt(Y)/(L+_)-1)*h+1)),C=Math.acos(B)*s,E=L+_*B,T=_*Math.sin(C),S=Math.atan2(D*E-N*T,N*E+D*T)}else{var q=(E=c*_)*E,W=(T=d*_)*T,G=Math.atan2(D,N),j=-2*W*L,H=W-q;if((b=j*j-4*H*(A=W*L*L+q*Y-q*W))>=0){var Z=Math.sqrt(b);j<0&&(Z=-Z);var K=(Z=-(j+Z)/2)/H,Q=A/Z,J=Math.abs(K)<Math.abs(Q)?K:Q;if(J*J<=Y){V=Math.sqrt(Y-J*J)*s,S=G-Math.atan2(V,J),C=Math.atan2(V/d,(J-L)/c);break t}}var $=t.MathUtils.PI,tt=L-E,et=tt*tt,nt=0,it=0,rt=L+E,st=rt*rt,at=0;(A=-E*L/(q-W))>=-1&&A<=1&&(A=Math.acos(A),(b=(k=E*Math.cos(A)+L)*k+(V=T*Math.sin(A))*V)<et&&($=A,et=b,tt=k,nt=V),b>st&&(it=A,st=b,rt=k,at=V)),Y<=(et+st)/2?(S=G-Math.atan2(nt*s,tt),C=$*s):(S=G-Math.atan2(at*s,rt),C=it*s)}var ot=Math.atan2(x,y)*g,ht=e.arotation;(S=(S-ot)*t.MathUtils.radDeg+v-ht)>180?S-=360:S<-180&&(S+=360),e.updateWorldTransformWith(l,u,ht+S*h,f,e.ascaleY,0,0),ht=n.arotation,(C=((C+ot)*t.MathUtils.radDeg-n.ashearX)*g+m-ht)>180?C-=360:C<-180&&(C+=360),n.updateWorldTransformWith(y,x,ht+C*h,n.ascaleX,n.ascaleY,n.ashearX,n.ashearY)}else n.updateWorldTransform()},e}();t.IkConstraint=e}(i||(i={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n.bendDirection=1,n.compress=!1,n.stretch=!1,n.uniform=!1,n.mix=1,n.softness=0,n}return r(e,t),e}(t.ConstraintData);t.IkConstraintData=e}(i||(i={})),function(t){var e=function(){function e(t,e){if(this.position=0,this.spacing=0,this.rotateMix=0,this.translateMix=0,this.spaces=new Array,this.positions=new Array,this.world=new Array,this.curves=new Array,this.lengths=new Array,this.segments=new Array,this.active=!1,null==t)throw new Error("data cannot be null.");if(null==e)throw new Error("skeleton cannot be null.");this.data=t,this.bones=new Array;for(var n=0,i=t.bones.length;n<i;n++)this.bones.push(e.findBone(t.bones[n].name));this.target=e.findSlot(t.target.name),this.position=t.position,this.spacing=t.spacing,this.rotateMix=t.rotateMix,this.translateMix=t.translateMix}return e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){var n=this.target.getAttachment();if(n instanceof t.PathAttachment){var i=this.rotateMix,r=this.translateMix,s=i>0;if(r>0||s){var a=this.data,o=a.spacingMode==t.SpacingMode.Percent,h=a.rotateMode,l=h==t.RotateMode.Tangent,u=h==t.RotateMode.ChainScale,c=this.bones.length,f=l?c:c+1,d=this.bones,p=t.Utils.setArraySize(this.spaces,f),v=null,m=this.spacing;if(u||!o){u&&(v=t.Utils.setArraySize(this.lengths,c));for(var g=a.spacingMode==t.SpacingMode.Length,y=0,x=f-1;y<x;){var w=(k=d[y]).data.length;if(w<e.epsilon)u&&(v[y]=0),p[++y]=0;else if(o){if(u){var M=w*k.a,E=w*k.c,T=Math.sqrt(M*M+E*E);v[y]=T}p[++y]=m}else{M=w*k.a,E=w*k.c;var A=Math.sqrt(M*M+E*E);u&&(v[y]=A),p[++y]=(g?w+m:m)*A/w}}}else for(y=1;y<f;y++)p[y]=m;var b=this.computeWorldPositions(n,f,l,a.positionMode==t.PositionMode.Percent,o),R=b[0],I=b[1],S=a.offsetRotation,C=!1;if(0==S)C=h==t.RotateMode.Chain;else C=!1,S*=(P=this.target.bone).a*P.d-P.b*P.c>0?t.MathUtils.degRad:-t.MathUtils.degRad;y=0;for(var P=3;y<c;y++,P+=3){var k;(k=d[y]).worldX+=(R-k.worldX)*r,k.worldY+=(I-k.worldY)*r;var V=(M=b[P])-R,F=(E=b[P+1])-I;if(u){var O=v[y];if(0!=O){var L=(Math.sqrt(V*V+F*F)/O-1)*i+1;k.a*=L,k.c*=L}}if(R=M,I=E,s){var _=k.a,N=k.b,D=k.c,Y=k.d,X=0,U=0,z=0;if(X=l?b[P-1]:0==p[y+1]?b[P+2]:Math.atan2(F,V),X-=Math.atan2(D,_),C){U=Math.cos(X),z=Math.sin(X);var B=k.data.length;R+=(B*(U*_-z*D)-V)*i,I+=(B*(z*_+U*D)-F)*i}else X+=S;X>t.MathUtils.PI?X-=t.MathUtils.PI2:X<-t.MathUtils.PI&&(X+=t.MathUtils.PI2),X*=i,U=Math.cos(X),z=Math.sin(X),k.a=U*_-z*D,k.b=U*N-z*Y,k.c=z*_+U*D,k.d=z*N+U*Y}k.appliedValid=!1}}}},e.prototype.computeWorldPositions=function(n,i,r,s,a){var o=this.target,h=this.position,l=this.spaces,u=t.Utils.setArraySize(this.positions,3*i+2),c=null,f=n.closed,d=n.worldVerticesLength,p=d/6,v=e.NONE;if(!n.constantSpeed){var m=n.lengths,g=m[p-=f?1:2];if(s&&(h*=g),a)for(var y=1;y<i;y++)l[y]*=g;c=t.Utils.setArraySize(this.world,8);y=0;for(var x=0,w=0;y<i;y++,x+=3){var M=h+=W=l[y];if(f)(M%=g)<0&&(M+=g),w=0;else{if(M<0){v!=e.BEFORE&&(v=e.BEFORE,n.computeWorldVertices(o,2,4,c,0,2)),this.addBeforePosition(M,c,0,u,x);continue}if(M>g){v!=e.AFTER&&(v=e.AFTER,n.computeWorldVertices(o,d-6,4,c,0,2)),this.addAfterPosition(M-g,c,0,u,x);continue}}for(;;w++){var E=m[w];if(!(M>E)){if(0==w)M/=E;else M=(M-(Z=m[w-1]))/(E-Z);break}}w!=v&&(v=w,f&&w==p?(n.computeWorldVertices(o,d-4,4,c,0,2),n.computeWorldVertices(o,0,4,c,4,2)):n.computeWorldVertices(o,6*w+2,8,c,0,2)),this.addCurvePosition(M,c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],u,x,r||y>0&&0==W)}return u}f?(d+=2,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(o,2,d-4,c,0,2),n.computeWorldVertices(o,0,2,c,d-4,2),c[d-2]=c[0],c[d-1]=c[1]):(p--,d-=4,c=t.Utils.setArraySize(this.world,d),n.computeWorldVertices(o,2,d,c,0,2));for(var T=t.Utils.setArraySize(this.curves,p),A=0,b=c[0],R=c[1],I=0,S=0,C=0,P=0,k=0,V=0,F=0,O=0,L=0,_=0,N=0,D=0,Y=0,X=0,U=(y=0,2);y<p;y++,U+=6)I=c[U],S=c[U+1],C=c[U+2],P=c[U+3],k=c[U+4],V=c[U+5],N=2*(F=.1875*(b-2*I+C))+(L=.09375*(3*(I-C)-b+k)),D=2*(O=.1875*(R-2*S+P))+(_=.09375*(3*(S-P)-R+V)),Y=.75*(I-b)+F+.16666667*L,X=.75*(S-R)+O+.16666667*_,A+=Math.sqrt(Y*Y+X*X),Y+=N,X+=D,N+=L,D+=_,A+=Math.sqrt(Y*Y+X*X),Y+=N,X+=D,A+=Math.sqrt(Y*Y+X*X),Y+=N+L,X+=D+_,A+=Math.sqrt(Y*Y+X*X),T[y]=A,b=k,R=V;if(h*=s?A:A/n.lengths[p-1],a)for(y=1;y<i;y++)l[y]*=A;for(var z=this.segments,B=0,q=(y=0,x=0,w=0,0);y<i;y++,x+=3){var W;M=h+=W=l[y];if(f)(M%=A)<0&&(M+=A),w=0;else{if(M<0){this.addBeforePosition(M,c,0,u,x);continue}if(M>A){this.addAfterPosition(M-A,c,d-4,u,x);continue}}for(;;w++){var G=T[w];if(!(M>G)){if(0==w)M/=G;else M=(M-(Z=T[w-1]))/(G-Z);break}}if(w!=v){v=w;var j=6*w;for(b=c[j],R=c[j+1],I=c[j+2],S=c[j+3],C=c[j+4],P=c[j+5],k=c[j+6],V=c[j+7],N=2*(F=.03*(b-2*I+C))+(L=.006*(3*(I-C)-b+k)),D=2*(O=.03*(R-2*S+P))+(_=.006*(3*(S-P)-R+V)),Y=.3*(I-b)+F+.16666667*L,X=.3*(S-R)+O+.16666667*_,B=Math.sqrt(Y*Y+X*X),z[0]=B,j=1;j<8;j++)Y+=N,X+=D,N+=L,D+=_,B+=Math.sqrt(Y*Y+X*X),z[j]=B;Y+=N,X+=D,B+=Math.sqrt(Y*Y+X*X),z[8]=B,Y+=N+L,X+=D+_,B+=Math.sqrt(Y*Y+X*X),z[9]=B,q=0}for(M*=B;;q++){var H=z[q];if(!(M>H)){var Z;if(0==q)M/=H;else M=q+(M-(Z=z[q-1]))/(H-Z);break}}this.addCurvePosition(.1*M,b,R,I,S,C,P,k,V,u,x,r||y>0&&0==W)}return u},e.prototype.addBeforePosition=function(t,e,n,i,r){var s=e[n],a=e[n+1],o=e[n+2]-s,h=e[n+3]-a,l=Math.atan2(h,o);i[r]=s+t*Math.cos(l),i[r+1]=a+t*Math.sin(l),i[r+2]=l},e.prototype.addAfterPosition=function(t,e,n,i,r){var s=e[n+2],a=e[n+3],o=s-e[n],h=a-e[n+1],l=Math.atan2(h,o);i[r]=s+t*Math.cos(l),i[r+1]=a+t*Math.sin(l),i[r+2]=l},e.prototype.addCurvePosition=function(t,e,n,i,r,s,a,o,h,l,u,c){if(0==t||isNaN(t))return l[u]=e,l[u+1]=n,void(l[u+2]=Math.atan2(r-n,i-e));var f=t*t,d=f*t,p=1-t,v=p*p,m=v*p,g=p*t,y=3*g,x=p*y,w=y*t,M=e*m+i*x+s*w+o*d,E=n*m+r*x+a*w+h*d;l[u]=M,l[u+1]=E,c&&(l[u+2]=t<.001?Math.atan2(r-n,i-e):Math.atan2(E-(n*v+r*g*2+a*f),M-(e*v+i*g*2+s*f)))},e.NONE=-1,e.BEFORE=-2,e.AFTER=-3,e.epsilon=1e-5,e}();t.PathConstraint=e}(i||(i={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n}return r(e,t),e}(t.ConstraintData);t.PathConstraintData=e,function(t){t[t.Fixed=0]="Fixed",t[t.Percent=1]="Percent"}(t.PositionMode||(t.PositionMode={})),function(t){t[t.Length=0]="Length",t[t.Fixed=1]="Fixed",t[t.Percent=2]="Percent"}(t.SpacingMode||(t.SpacingMode={})),function(t){t[t.Tangent=0]="Tangent",t[t.Chain=1]="Chain",t[t.ChainScale=2]="ChainScale"}(t.RotateMode||(t.RotateMode={}))}(i||(i={})),function(t){var e=function(){function t(t){this.toLoad=new Array,this.assets={},this.clientId=t}return t.prototype.loaded=function(){var t=0;for(var e in this.assets)t++;return t},t}(),n=function(){function t(t){void 0===t&&(t=""),this.clientAssets={},this.queuedAssets={},this.rawAssets={},this.errors={},this.pathPrefix=t}return t.prototype.queueAsset=function(t,n,i){var r=this.clientAssets[t];return null!==r&&void 0!==r||(r=new e(t),this.clientAssets[t]=r),null!==n&&(r.textureLoader=n),r.toLoad.push(i),this.queuedAssets[i]!==i&&(this.queuedAssets[i]=i,!0)},t.prototype.loadText=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&(i.status>=200&&i.status<300?n.rawAssets[e]=i.responseText:n.errors[e]="Couldn't load text "+e+": status "+i.status+", "+i.responseText)},i.open("GET",e,!0),i.send()}},t.prototype.loadJson=function(t,e){var n=this;if(e=this.pathPrefix+e,this.queueAsset(t,null,e)){var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==XMLHttpRequest.DONE&&(i.status>=200&&i.status<300?n.rawAssets[e]=JSON.parse(i.responseText):n.errors[e]="Couldn't load text "+e+": status "+i.status+", "+i.responseText)},i.open("GET",e,!0),i.send()}},t.prototype.loadTexture=function(t,e,n){var i=this;if(n=this.pathPrefix+n,this.queueAsset(t,e,n)){var r=new Image;r.src=n,r.crossOrigin="anonymous",r.onload=function(t){i.rawAssets[n]=r},r.onerror=function(t){i.errors[n]="Couldn't load image "+n}}},t.prototype.get=function(t,e){e=this.pathPrefix+e;var n=this.clientAssets[t];return null===n||void 0===n||n.assets[e]},t.prototype.updateClientAssets=function(t){for(var e=0;e<t.toLoad.length;e++){var n=t.toLoad[e],i=t.assets[n];if(null===i||void 0===i){var r=this.rawAssets[n];if(null===r||void 0===r)continue;r instanceof HTMLImageElement?t.assets[n]=t.textureLoader(r):t.assets[n]=r}}},t.prototype.isLoadingComplete=function(t){var e=this.clientAssets[t];return null===e||void 0===e||(this.updateClientAssets(e),e.toLoad.length==e.loaded())},t.prototype.dispose=function(){},t.prototype.hasErrors=function(){return Object.keys(this.errors).length>0},t.prototype.getErrors=function(){return this.errors},t}();t.SharedAssetManager=n}(i||(i={})),function(t){var e=function(){function e(e){if(this._updateCache=new Array,this.updateCacheReset=new Array,this.time=0,this.scaleX=1,this.scaleY=1,this.x=0,this.y=0,null==e)throw new Error("data cannot be null.");this.data=e,this.bones=new Array;for(var n=0;n<e.bones.length;n++){var i=e.bones[n],r=void 0;if(null==i.parent)r=new t.Bone(i,this,null);else{var s=this.bones[i.parent.index];r=new t.Bone(i,this,s),s.children.push(r)}this.bones.push(r)}this.slots=new Array,this.drawOrder=new Array;for(n=0;n<e.slots.length;n++){var a=e.slots[n],o=(r=this.bones[a.boneData.index],new t.Slot(a,r));this.slots.push(o),this.drawOrder.push(o)}this.ikConstraints=new Array;for(n=0;n<e.ikConstraints.length;n++){var h=e.ikConstraints[n];this.ikConstraints.push(new t.IkConstraint(h,this))}this.transformConstraints=new Array;for(n=0;n<e.transformConstraints.length;n++){var l=e.transformConstraints[n];this.transformConstraints.push(new t.TransformConstraint(l,this))}this.pathConstraints=new Array;for(n=0;n<e.pathConstraints.length;n++){var u=e.pathConstraints[n];this.pathConstraints.push(new t.PathConstraint(u,this))}this.color=new t.Color(1,1,1,1),this.updateCache()}return e.prototype.updateCache=function(){this._updateCache.length=0,this.updateCacheReset.length=0;for(var t=this.bones,e=0,n=t.length;e<n;e++){(r=t[e]).sorted=r.data.skinRequired,r.active=!r.sorted}if(null!=this.skin){var i=this.skin.bones;for(e=0,n=this.skin.bones.length;e<n;e++){var r=this.bones[i[e].index];do{r.sorted=!1,r.active=!0,r=r.parent}while(null!=r)}}var s=this.ikConstraints,a=this.transformConstraints,o=this.pathConstraints,h=s.length,l=a.length,u=o.length,c=h+l+u;t:for(e=0;e<c;e++){for(var f=0;f<h;f++){if((d=s[f]).data.order==e){this.sortIkConstraint(d);continue t}}for(f=0;f<l;f++){if((d=a[f]).data.order==e){this.sortTransformConstraint(d);continue t}}for(f=0;f<u;f++){var d;if((d=o[f]).data.order==e){this.sortPathConstraint(d);continue t}}}for(e=0,n=t.length;e<n;e++)this.sortBone(t[e])},e.prototype.sortIkConstraint=function(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var n=e.target;this.sortBone(n);var i=e.bones,r=i[0];if(this.sortBone(r),i.length>1){var s=i[i.length-1];this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}this._updateCache.push(e),this.sortReset(r.children),i[i.length-1].sorted=!0}},e.prototype.sortPathConstraint=function(e){if(e.active=e.target.bone.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){var n=e.target,i=n.data.index,r=n.bone;null!=this.skin&&this.sortPathConstraintAttachment(this.skin,i,r),null!=this.data.defaultSkin&&this.data.defaultSkin!=this.skin&&this.sortPathConstraintAttachment(this.data.defaultSkin,i,r);for(var s=0,a=this.data.skins.length;s<a;s++)this.sortPathConstraintAttachment(this.data.skins[s],i,r);var o=n.getAttachment();o instanceof t.PathAttachment&&this.sortPathConstraintAttachmentWith(o,r);var h=e.bones,l=h.length;for(s=0;s<l;s++)this.sortBone(h[s]);this._updateCache.push(e);for(s=0;s<l;s++)this.sortReset(h[s].children);for(s=0;s<l;s++)h[s].sorted=!0}},e.prototype.sortTransformConstraint=function(e){if(e.active=e.target.isActive()&&(!e.data.skinRequired||null!=this.skin&&t.Utils.contains(this.skin.constraints,e.data,!0)),e.active){this.sortBone(e.target);var n=e.bones,i=n.length;if(e.data.local)for(var r=0;r<i;r++){var s=n[r];this.sortBone(s.parent),this._updateCache.indexOf(s)>-1||this.updateCacheReset.push(s)}else for(r=0;r<i;r++)this.sortBone(n[r]);this._updateCache.push(e);for(var a=0;a<i;a++)this.sortReset(n[a].children);for(a=0;a<i;a++)n[a].sorted=!0}},e.prototype.sortPathConstraintAttachment=function(t,e,n){var i=t.attachments[e];if(i)for(var r in i)this.sortPathConstraintAttachmentWith(i[r],n)},e.prototype.sortPathConstraintAttachmentWith=function(e,n){if(e instanceof t.PathAttachment){var i=e.bones;if(null==i)this.sortBone(n);else for(var r=this.bones,s=0;s<i.length;)for(var a=i[s++],o=s+a;s<o;s++){var h=i[s];this.sortBone(r[h])}}},e.prototype.sortBone=function(t){if(!t.sorted){var e=t.parent;null!=e&&this.sortBone(e),t.sorted=!0,this._updateCache.push(t)}},e.prototype.sortReset=function(t){for(var e=0,n=t.length;e<n;e++){var i=t[e];i.active&&(i.sorted&&this.sortReset(i.children),i.sorted=!1)}},e.prototype.updateWorldTransform=function(){for(var t=this.updateCacheReset,e=0,n=t.length;e<n;e++){var i=t[e];i.ax=i.x,i.ay=i.y,i.arotation=i.rotation,i.ascaleX=i.scaleX,i.ascaleY=i.scaleY,i.ashearX=i.shearX,i.ashearY=i.shearY,i.appliedValid=!0}var r=this._updateCache;for(e=0,n=r.length;e<n;e++)r[e].update()},e.prototype.setToSetupPose=function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},e.prototype.setBonesToSetupPose=function(){for(var t=this.bones,e=0,n=t.length;e<n;e++)t[e].setToSetupPose();var i=this.ikConstraints;for(e=0,n=i.length;e<n;e++){(o=i[e]).mix=o.data.mix,o.softness=o.data.softness,o.bendDirection=o.data.bendDirection,o.compress=o.data.compress,o.stretch=o.data.stretch}var r=this.transformConstraints;for(e=0,n=r.length;e<n;e++){var s=(o=r[e]).data;o.rotateMix=s.rotateMix,o.translateMix=s.translateMix,o.scaleMix=s.scaleMix,o.shearMix=s.shearMix}var a=this.pathConstraints;for(e=0,n=a.length;e<n;e++){var o;s=(o=a[e]).data;o.position=s.position,o.spacing=s.spacing,o.rotateMix=s.rotateMix,o.translateMix=s.translateMix}},e.prototype.setSlotsToSetupPose=function(){var e=this.slots;t.Utils.arrayCopy(e,0,this.drawOrder,0,e.length);for(var n=0,i=e.length;n<i;n++)e[n].setToSetupPose()},e.prototype.getRootBone=function(){return 0==this.bones.length?null:this.bones[0]},e.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}return null},e.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,i=e.length;n<i;n++)if(e[n].data.name==t)return n;return-1},e.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}return null},e.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,i=e.length;n<i;n++)if(e[n].data.name==t)return n;return-1},e.prototype.setSkinByName=function(t){var e=this.data.findSkin(t);if(null==e)throw new Error("Skin not found: "+t);this.setSkin(e)},e.prototype.setSkin=function(t){if(t!=this.skin){if(null!=t)if(null!=this.skin)t.attachAll(this,this.skin);else for(var e=this.slots,n=0,i=e.length;n<i;n++){var r=e[n],s=r.data.attachmentName;if(null!=s){var a=t.getAttachment(n,s);null!=a&&r.setAttachment(a)}}this.skin=t,this.updateCache()}},e.prototype.getAttachmentByName=function(t,e){return this.getAttachment(this.data.findSlotIndex(t),e)},e.prototype.getAttachment=function(t,e){if(null==e)throw new Error("attachmentName cannot be null.");if(null!=this.skin){var n=this.skin.getAttachment(t,e);if(null!=n)return n}return null!=this.data.defaultSkin?this.data.defaultSkin.getAttachment(t,e):null},e.prototype.setAttachment=function(t,e){if(null==t)throw new Error("slotName cannot be null.");for(var n=this.slots,i=0,r=n.length;i<r;i++){var s=n[i];if(s.data.name==t){var a=null;if(null!=e&&null==(a=this.getAttachment(i,e)))throw new Error("Attachment not found: "+e+", for slot: "+t);return void s.setAttachment(a)}}throw new Error("Slot not found: "+t)},e.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}return null},e.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}return null},e.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.data.name==t)return r}return null},e.prototype.getBounds=function(e,n,i){if(void 0===i&&(i=new Array(2)),null==e)throw new Error("offset cannot be null.");if(null==n)throw new Error("size cannot be null.");for(var r=this.drawOrder,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY,l=0,u=r.length;l<u;l++){var c=r[l];if(c.bone.active){var f=0,d=null,p=c.getAttachment();if(p instanceof t.RegionAttachment)f=8,d=t.Utils.setArraySize(i,f,0),p.computeWorldVertices(c.bone,d,0,2);else if(p instanceof t.MeshAttachment){var v=p;f=v.worldVerticesLength,d=t.Utils.setArraySize(i,f,0),v.computeWorldVertices(c,0,f,d,0,2)}if(null!=d)for(var m=0,g=d.length;m<g;m+=2){var y=d[m],x=d[m+1];s=Math.min(s,y),a=Math.min(a,x),o=Math.max(o,y),h=Math.max(h,x)}}}e.set(s,a),n.set(o-s,h-a)},e.prototype.update=function(t){this.time+=t},e}();t.Skeleton=e}(i||(i={})),function(t){var e=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(i){var r=this.scale,s=new t.SkeletonData;s.name="";var a=new n(i);s.hash=a.readString(),s.version=a.readString(),s.x=a.readFloat(),s.y=a.readFloat(),s.width=a.readFloat(),s.height=a.readFloat();var o=a.readBoolean();o&&(s.fps=a.readFloat(),s.imagesPath=a.readString(),s.audioPath=a.readString());var h=0;h=a.readInt(!0);for(var l=0;l<h;l++)a.strings.push(a.readString());h=a.readInt(!0);for(l=0;l<h;l++){var u=a.readString(),c=0==l?null:s.bones[a.readInt(!0)];(p=new t.BoneData(l,u,c)).rotation=a.readFloat(),p.x=a.readFloat()*r,p.y=a.readFloat()*r,p.scaleX=a.readFloat(),p.scaleY=a.readFloat(),p.shearX=a.readFloat(),p.shearY=a.readFloat(),p.length=a.readFloat()*r,p.transformMode=e.TransformModeValues[a.readInt(!0)],p.skinRequired=a.readBoolean(),o&&t.Color.rgba8888ToColor(p.color,a.readInt32()),s.bones.push(p)}h=a.readInt(!0);for(l=0;l<h;l++){var f=a.readString(),d=s.bones[a.readInt(!0)],p=new t.SlotData(l,f,d);t.Color.rgba8888ToColor(p.color,a.readInt32());var v=a.readInt32();-1!=v&&t.Color.rgb888ToColor(p.darkColor=new t.Color,v),p.attachmentName=a.readStringRef(),p.blendMode=e.BlendModeValues[a.readInt(!0)],s.slots.push(p)}h=a.readInt(!0);l=0;for(var m=void 0;l<h;l++){(p=new t.IkConstraintData(a.readString())).order=a.readInt(!0),p.skinRequired=a.readBoolean(),m=a.readInt(!0);for(var g=0;g<m;g++)p.bones.push(s.bones[a.readInt(!0)]);p.target=s.bones[a.readInt(!0)],p.mix=a.readFloat(),p.softness=a.readFloat()*r,p.bendDirection=a.readByte(),p.compress=a.readBoolean(),p.stretch=a.readBoolean(),p.uniform=a.readBoolean(),s.ikConstraints.push(p)}h=a.readInt(!0);for(l=0,m=void 0;l<h;l++){(p=new t.TransformConstraintData(a.readString())).order=a.readInt(!0),p.skinRequired=a.readBoolean(),m=a.readInt(!0);for(g=0;g<m;g++)p.bones.push(s.bones[a.readInt(!0)]);p.target=s.bones[a.readInt(!0)],p.local=a.readBoolean(),p.relative=a.readBoolean(),p.offsetRotation=a.readFloat(),p.offsetX=a.readFloat()*r,p.offsetY=a.readFloat()*r,p.offsetScaleX=a.readFloat(),p.offsetScaleY=a.readFloat(),p.offsetShearY=a.readFloat(),p.rotateMix=a.readFloat(),p.translateMix=a.readFloat(),p.scaleMix=a.readFloat(),p.shearMix=a.readFloat(),s.transformConstraints.push(p)}h=a.readInt(!0);for(l=0,m=void 0;l<h;l++){(p=new t.PathConstraintData(a.readString())).order=a.readInt(!0),p.skinRequired=a.readBoolean(),m=a.readInt(!0);for(g=0;g<m;g++)p.bones.push(s.bones[a.readInt(!0)]);p.target=s.slots[a.readInt(!0)],p.positionMode=e.PositionModeValues[a.readInt(!0)],p.spacingMode=e.SpacingModeValues[a.readInt(!0)],p.rotateMode=e.RotateModeValues[a.readInt(!0)],p.offsetRotation=a.readFloat(),p.position=a.readFloat(),p.positionMode==t.PositionMode.Fixed&&(p.position*=r),p.spacing=a.readFloat(),p.spacingMode!=t.SpacingMode.Length&&p.spacingMode!=t.SpacingMode.Fixed||(p.spacing*=r),p.rotateMix=a.readFloat(),p.translateMix=a.readFloat(),s.pathConstraints.push(p)}var y=this.readSkin(a,s,!0,o);null!=y&&(s.defaultSkin=y,s.skins.push(y));l=s.skins.length;for(t.Utils.setArraySize(s.skins,h=l+a.readInt(!0));l<h;l++)s.skins[l]=this.readSkin(a,s,!1,o);h=this.linkedMeshes.length;for(l=0;l<h;l++){var x=this.linkedMeshes[l],w=null==x.skin?s.defaultSkin:s.findSkin(x.skin);if(null==w)throw new Error("Skin not found: "+x.skin);var M=w.getAttachment(x.slotIndex,x.parent);if(null==M)throw new Error("Parent mesh not found: "+x.parent);x.mesh.deformAttachment=x.inheritDeform?M:x.mesh,x.mesh.setParentMesh(M),x.mesh.updateUVs()}this.linkedMeshes.length=0,h=a.readInt(!0);for(l=0;l<h;l++){(p=new t.EventData(a.readStringRef())).intValue=a.readInt(!1),p.floatValue=a.readFloat(),p.stringValue=a.readString(),p.audioPath=a.readString(),null!=p.audioPath&&(p.volume=a.readFloat(),p.balance=a.readFloat()),s.events.push(p)}h=a.readInt(!0);for(l=0;l<h;l++)s.animations.push(this.readAnimation(a,a.readString(),s));return s},e.prototype.readSkin=function(e,n,i,r){var s=null,a=0;if(i){if(0==(a=e.readInt(!0)))return null;s=new t.Skin("default")}else{(s=new t.Skin(e.readStringRef())).bones.length=e.readInt(!0);for(var o=0,h=s.bones.length;o<h;o++)s.bones[o]=n.bones[e.readInt(!0)];for(o=0,h=e.readInt(!0);o<h;o++)s.constraints.push(n.ikConstraints[e.readInt(!0)]);for(o=0,h=e.readInt(!0);o<h;o++)s.constraints.push(n.transformConstraints[e.readInt(!0)]);for(o=0,h=e.readInt(!0);o<h;o++)s.constraints.push(n.pathConstraints[e.readInt(!0)]);a=e.readInt(!0)}for(o=0;o<a;o++)for(var l=e.readInt(!0),u=0,c=e.readInt(!0);u<c;u++){var f=e.readStringRef(),d=this.readAttachment(e,n,s,l,f,r);null!=d&&s.setAttachment(l,f,d)}return s},e.prototype.readAttachment=function(n,r,s,a,o,h){var l=this.scale,u=n.readStringRef();null==u&&(u=o);var c=n.readByte();switch(e.AttachmentTypeValues[c]){case t.AttachmentType.Region:var f=n.readStringRef(),d=n.readFloat(),p=n.readFloat(),v=n.readFloat(),m=n.readFloat(),g=n.readFloat(),y=n.readFloat(),x=n.readFloat(),w=n.readInt32();null==f&&(f=u);var M=this.attachmentLoader.newRegionAttachment(s,u,f);return null==M?null:(M.path=f,M.x=p*l,M.y=v*l,M.scaleX=m,M.scaleY=g,M.rotation=d,M.width=y*l,M.height=x*l,t.Color.rgba8888ToColor(M.color,w),M.updateOffset(),M);case t.AttachmentType.BoundingBox:var E=n.readInt(!0),T=this.readVertices(n,E),A=(w=h?n.readInt32():0,this.attachmentLoader.newBoundingBoxAttachment(s,u));return null==A?null:(A.worldVerticesLength=E<<1,A.vertices=T.vertices,A.bones=T.bones,h&&t.Color.rgba8888ToColor(A.color,w),A);case t.AttachmentType.Mesh:f=n.readStringRef(),w=n.readInt32(),E=n.readInt(!0);var b=this.readFloatArray(n,E<<1,1),R=this.readShortArray(n),I=(T=this.readVertices(n,E),n.readInt(!0)),S=null;y=0,x=0;return h&&(S=this.readShortArray(n),y=n.readFloat(),x=n.readFloat()),null==f&&(f=u),null==(C=this.attachmentLoader.newMeshAttachment(s,u,f))?null:(C.path=f,t.Color.rgba8888ToColor(C.color,w),C.bones=T.bones,C.vertices=T.vertices,C.worldVerticesLength=E<<1,C.triangles=R,C.regionUVs=b,C.updateUVs(),C.hullLength=I<<1,h&&(C.edges=S,C.width=y*l,C.height=x*l),C);case t.AttachmentType.LinkedMesh:f=n.readStringRef(),w=n.readInt32();var C,P=n.readStringRef(),k=n.readStringRef(),V=n.readBoolean();y=0,x=0;return h&&(y=n.readFloat(),x=n.readFloat()),null==f&&(f=u),null==(C=this.attachmentLoader.newMeshAttachment(s,u,f))?null:(C.path=f,t.Color.rgba8888ToColor(C.color,w),h&&(C.width=y*l,C.height=x*l),this.linkedMeshes.push(new i(C,P,a,k,V)),C);case t.AttachmentType.Path:for(var F=n.readBoolean(),O=n.readBoolean(),L=(E=n.readInt(!0),T=this.readVertices(n,E),t.Utils.newArray(E/3,0)),_=0,N=L.length;_<N;_++)L[_]=n.readFloat()*l;w=h?n.readInt32():0;return null==(f=this.attachmentLoader.newPathAttachment(s,u))?null:(f.closed=F,f.constantSpeed=O,f.worldVerticesLength=E<<1,f.vertices=T.vertices,f.bones=T.bones,f.lengths=L,h&&t.Color.rgba8888ToColor(f.color,w),f);case t.AttachmentType.Point:d=n.readFloat(),p=n.readFloat(),v=n.readFloat(),w=h?n.readInt32():0;var D=this.attachmentLoader.newPointAttachment(s,u);return null==D?null:(D.x=p*l,D.y=v*l,D.rotation=d,h&&t.Color.rgba8888ToColor(D.color,w),D);case t.AttachmentType.Clipping:var Y=n.readInt(!0),X=(E=n.readInt(!0),T=this.readVertices(n,E),w=h?n.readInt32():0,this.attachmentLoader.newClippingAttachment(s,u));return null==X?null:(X.endSlot=r.slots[Y],X.worldVerticesLength=E<<1,X.vertices=T.vertices,X.bones=T.bones,h&&t.Color.rgba8888ToColor(X.color,w),X)}return null},e.prototype.readVertices=function(e,n){var i=n<<1,s=new r,a=this.scale;if(!e.readBoolean())return s.vertices=this.readFloatArray(e,i,a),s;for(var o=new Array,h=new Array,l=0;l<n;l++){var u=e.readInt(!0);h.push(u);for(var c=0;c<u;c++)h.push(e.readInt(!0)),o.push(e.readFloat()*a),o.push(e.readFloat()*a),o.push(e.readFloat())}return s.vertices=t.Utils.toFloatArray(o),s.bones=h,s},e.prototype.readFloatArray=function(t,e,n){var i=new Array(e);if(1==n)for(var r=0;r<e;r++)i[r]=t.readFloat();else for(r=0;r<e;r++)i[r]=t.readFloat()*n;return i},e.prototype.readShortArray=function(t){for(var e=t.readInt(!0),n=new Array(e),i=0;i<e;i++)n[i]=t.readShort();return n},e.prototype.readAnimation=function(n,i,r){for(var s=new Array,a=this.scale,o=0,h=new t.Color,l=new t.Color,u=0,c=n.readInt(!0);u<c;u++)for(var f=n.readInt(!0),d=0,p=n.readInt(!0);d<p;d++){var v=n.readByte(),m=n.readInt(!0);switch(v){case e.SLOT_ATTACHMENT:(w=new t.AttachmentTimeline(m)).slotIndex=f;for(var g=0;g<m;g++)w.setFrame(g,n.readFloat(),n.readStringRef());s.push(w),o=Math.max(o,w.frames[m-1]);break;case e.SLOT_COLOR:(w=new t.ColorTimeline(m)).slotIndex=f;for(g=0;g<m;g++){var y=n.readFloat();t.Color.rgba8888ToColor(h,n.readInt32()),w.setFrame(g,y,h.r,h.g,h.b,h.a),g<m-1&&this.readCurve(n,g,w)}s.push(w),o=Math.max(o,w.frames[(m-1)*t.ColorTimeline.ENTRIES]);break;case e.SLOT_TWO_COLOR:(w=new t.TwoColorTimeline(m)).slotIndex=f;for(g=0;g<m;g++){y=n.readFloat();t.Color.rgba8888ToColor(h,n.readInt32()),t.Color.rgb888ToColor(l,n.readInt32()),w.setFrame(g,y,h.r,h.g,h.b,h.a,l.r,l.g,l.b),g<m-1&&this.readCurve(n,g,w)}s.push(w),o=Math.max(o,w.frames[(m-1)*t.TwoColorTimeline.ENTRIES])}}for(u=0,c=n.readInt(!0);u<c;u++){var x=n.readInt(!0);for(d=0,p=n.readInt(!0);d<p;d++){v=n.readByte(),m=n.readInt(!0);switch(v){case e.BONE_ROTATE:(w=new t.RotateTimeline(m)).boneIndex=x;for(g=0;g<m;g++)w.setFrame(g,n.readFloat(),n.readFloat()),g<m-1&&this.readCurve(n,g,w);s.push(w),o=Math.max(o,w.frames[(m-1)*t.RotateTimeline.ENTRIES]);break;case e.BONE_TRANSLATE:case e.BONE_SCALE:case e.BONE_SHEAR:var w=void 0,M=1;v==e.BONE_SCALE?w=new t.ScaleTimeline(m):v==e.BONE_SHEAR?w=new t.ShearTimeline(m):(w=new t.TranslateTimeline(m),M=a),w.boneIndex=x;for(g=0;g<m;g++)w.setFrame(g,n.readFloat(),n.readFloat()*M,n.readFloat()*M),g<m-1&&this.readCurve(n,g,w);s.push(w),o=Math.max(o,w.frames[(m-1)*t.TranslateTimeline.ENTRIES])}}}for(u=0,c=n.readInt(!0);u<c;u++){var E=n.readInt(!0);m=n.readInt(!0);(w=new t.IkConstraintTimeline(m)).ikConstraintIndex=E;for(g=0;g<m;g++)w.setFrame(g,n.readFloat(),n.readFloat(),n.readFloat()*a,n.readByte(),n.readBoolean(),n.readBoolean()),g<m-1&&this.readCurve(n,g,w);s.push(w),o=Math.max(o,w.frames[(m-1)*t.IkConstraintTimeline.ENTRIES])}for(u=0,c=n.readInt(!0);u<c;u++){E=n.readInt(!0),m=n.readInt(!0);(w=new t.TransformConstraintTimeline(m)).transformConstraintIndex=E;for(g=0;g<m;g++)w.setFrame(g,n.readFloat(),n.readFloat(),n.readFloat(),n.readFloat(),n.readFloat()),g<m-1&&this.readCurve(n,g,w);s.push(w),o=Math.max(o,w.frames[(m-1)*t.TransformConstraintTimeline.ENTRIES])}for(u=0,c=n.readInt(!0);u<c;u++){E=n.readInt(!0);var T=r.pathConstraints[E];for(d=0,p=n.readInt(!0);d<p;d++){v=n.readByte(),m=n.readInt(!0);switch(v){case e.PATH_POSITION:case e.PATH_SPACING:w=void 0,M=1;v==e.PATH_SPACING?(w=new t.PathConstraintSpacingTimeline(m),T.spacingMode!=t.SpacingMode.Length&&T.spacingMode!=t.SpacingMode.Fixed||(M=a)):(w=new t.PathConstraintPositionTimeline(m),T.positionMode==t.PositionMode.Fixed&&(M=a)),w.pathConstraintIndex=E;for(g=0;g<m;g++)w.setFrame(g,n.readFloat(),n.readFloat()*M),g<m-1&&this.readCurve(n,g,w);s.push(w),o=Math.max(o,w.frames[(m-1)*t.PathConstraintPositionTimeline.ENTRIES]);break;case e.PATH_MIX:(w=new t.PathConstraintMixTimeline(m)).pathConstraintIndex=E;for(g=0;g<m;g++)w.setFrame(g,n.readFloat(),n.readFloat(),n.readFloat()),g<m-1&&this.readCurve(n,g,w);s.push(w),o=Math.max(o,w.frames[(m-1)*t.PathConstraintMixTimeline.ENTRIES])}}}for(u=0,c=n.readInt(!0);u<c;u++){var A=r.skins[n.readInt(!0)];for(d=0,p=n.readInt(!0);d<p;d++){f=n.readInt(!0);for(var b=0,R=n.readInt(!0);b<R;b++){var I=A.getAttachment(f,n.readStringRef()),S=null!=I.bones,C=I.vertices,P=S?C.length/3*2:C.length;m=n.readInt(!0);(w=new t.DeformTimeline(m)).slotIndex=f,w.attachment=I;for(g=0;g<m;g++){y=n.readFloat();var k=void 0,V=n.readInt(!0);if(0==V)k=S?t.Utils.newFloatArray(P):C;else{k=t.Utils.newFloatArray(P);var F=n.readInt(!0);if(V+=F,1==a)for(var O=F;O<V;O++)k[O]=n.readFloat();else for(O=F;O<V;O++)k[O]=n.readFloat()*a;if(!S){O=0;for(var L=k.length;O<L;O++)k[O]+=C[O]}}w.setFrame(g,y,k),g<m-1&&this.readCurve(n,g,w)}s.push(w),o=Math.max(o,w.frames[m-1])}}}var _=n.readInt(!0);if(_>0){w=new t.DrawOrderTimeline(_);var N=r.slots.length;for(u=0;u<_;u++){y=n.readFloat();var D=n.readInt(!0),Y=t.Utils.newArray(N,0);for(d=N-1;d>=0;d--)Y[d]=-1;var X=t.Utils.newArray(N-D,0),U=0,z=0;for(d=0;d<D;d++){for(f=n.readInt(!0);U!=f;)X[z++]=U++;Y[U+n.readInt(!0)]=U++}for(;U<N;)X[z++]=U++;for(d=N-1;d>=0;d--)-1==Y[d]&&(Y[d]=X[--z]);w.setFrame(u,y,Y)}s.push(w),o=Math.max(o,w.frames[_-1])}var B=n.readInt(!0);if(B>0){for(w=new t.EventTimeline(B),u=0;u<B;u++){y=n.readFloat();var q=r.events[n.readInt(!0)],W=new t.Event(y,q);W.intValue=n.readInt(!1),W.floatValue=n.readFloat(),W.stringValue=n.readBoolean()?n.readString():q.stringValue,null!=W.data.audioPath&&(W.volume=n.readFloat(),W.balance=n.readFloat()),w.setFrame(u,W)}s.push(w),o=Math.max(o,w.frames[B-1])}return new t.Animation(i,s,o)},e.prototype.readCurve=function(t,n,i){switch(t.readByte()){case e.CURVE_STEPPED:i.setStepped(n);break;case e.CURVE_BEZIER:this.setCurve(i,n,t.readFloat(),t.readFloat(),t.readFloat(),t.readFloat())}},e.prototype.setCurve=function(t,e,n,i,r,s){t.setCurve(e,n,i,r,s)},e.AttachmentTypeValues=[0,1,2,3,4,5,6],e.TransformModeValues=[t.TransformMode.Normal,t.TransformMode.OnlyTranslation,t.TransformMode.NoRotationOrReflection,t.TransformMode.NoScale,t.TransformMode.NoScaleOrReflection],e.PositionModeValues=[t.PositionMode.Fixed,t.PositionMode.Percent],e.SpacingModeValues=[t.SpacingMode.Length,t.SpacingMode.Fixed,t.SpacingMode.Percent],e.RotateModeValues=[t.RotateMode.Tangent,t.RotateMode.Chain,t.RotateMode.ChainScale],e.BlendModeValues=[t.BlendMode.Normal,t.BlendMode.Additive,t.BlendMode.Multiply,t.BlendMode.Screen],e.BONE_ROTATE=0,e.BONE_TRANSLATE=1,e.BONE_SCALE=2,e.BONE_SHEAR=3,e.SLOT_ATTACHMENT=0,e.SLOT_COLOR=1,e.SLOT_TWO_COLOR=2,e.PATH_POSITION=0,e.PATH_SPACING=1,e.PATH_MIX=2,e.CURVE_LINEAR=0,e.CURVE_STEPPED=1,e.CURVE_BEZIER=2,e}();t.SkeletonBinary=e;var n=function(){function t(t,e,n,i){void 0===e&&(e=new Array),void 0===n&&(n=0),void 0===i&&(i=new DataView(t.buffer)),this.strings=e,this.index=n,this.buffer=i}return t.prototype.readByte=function(){return this.buffer.getInt8(this.index++)},t.prototype.readShort=function(){var t=this.buffer.getInt16(this.index);return this.index+=2,t},t.prototype.readInt32=function(){var t=this.buffer.getInt32(this.index);return this.index+=4,t},t.prototype.readInt=function(t){var e=this.readByte(),n=127&e;return 0!=(128&e)&&(n|=(127&(e=this.readByte()))<<7,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<14,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<21,0!=(128&e)&&(n|=(127&(e=this.readByte()))<<28)))),t?n:n>>>1^-(1&n)},t.prototype.readStringRef=function(){var t=this.readInt(!0);return 0==t?null:this.strings[t-1]},t.prototype.readString=function(){var t=this.readInt(!0);switch(t){case 0:return null;case 1:return""}t--;for(var e="",n=0;n<t;){var i=this.readByte();switch(i>>4){case 12:case 13:e+=String.fromCharCode((31&i)<<6|63&this.readByte()),n+=2;break;case 14:e+=String.fromCharCode((15&i)<<12|(63&this.readByte())<<6|63&this.readByte()),n+=3;break;default:e+=String.fromCharCode(i),n++}}return e},t.prototype.readFloat=function(){var t=this.buffer.getFloat32(this.index);return this.index+=4,t},t.prototype.readBoolean=function(){return 0!=this.readByte()},t}(),i=function(){return function(t,e,n,i,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i,this.inheritDeform=r}}(),r=function(){return function(t,e){void 0===t&&(t=null),void 0===e&&(e=null),this.bones=t,this.vertices=e}}()}(i||(i={})),function(t){var e=function(){function e(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.boundingBoxes=new Array,this.polygons=new Array,this.polygonPool=new t.Pool(function(){return t.Utils.newFloatArray(16)})}return e.prototype.update=function(e,n){if(null==e)throw new Error("skeleton cannot be null.");var i=this.boundingBoxes,r=this.polygons,s=this.polygonPool,a=e.slots,o=a.length;i.length=0,s.freeAll(r),r.length=0;for(var h=0;h<o;h++){var l=a[h];if(l.bone.active){var u=l.getAttachment();if(u instanceof t.BoundingBoxAttachment){var c=u;i.push(c);var f=s.obtain();f.length!=c.worldVerticesLength&&(f=t.Utils.newFloatArray(c.worldVerticesLength)),r.push(f),c.computeWorldVertices(l,0,c.worldVerticesLength,f,0,2)}}}n?this.aabbCompute():(this.minX=Number.POSITIVE_INFINITY,this.minY=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.maxY=Number.NEGATIVE_INFINITY)},e.prototype.aabbCompute=function(){for(var t=Number.POSITIVE_INFINITY,e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY,r=this.polygons,s=0,a=r.length;s<a;s++)for(var o=r[s],h=o,l=0,u=o.length;l<u;l+=2){var c=h[l],f=h[l+1];t=Math.min(t,c),e=Math.min(e,f),n=Math.max(n,c),i=Math.max(i,f)}this.minX=t,this.minY=e,this.maxX=n,this.maxY=i},e.prototype.aabbContainsPoint=function(t,e){return t>=this.minX&&t<=this.maxX&&e>=this.minY&&e<=this.maxY},e.prototype.aabbIntersectsSegment=function(t,e,n,i){var r=this.minX,s=this.minY,a=this.maxX,o=this.maxY;if(t<=r&&n<=r||e<=s&&i<=s||t>=a&&n>=a||e>=o&&i>=o)return!1;var h=(i-e)/(n-t),l=h*(r-t)+e;if(l>s&&l<o)return!0;if((l=h*(a-t)+e)>s&&l<o)return!0;var u=(s-e)/h+t;return u>r&&u<a||(u=(o-e)/h+t)>r&&u<a},e.prototype.aabbIntersectsSkeleton=function(t){return this.minX<t.maxX&&this.maxX>t.minX&&this.minY<t.maxY&&this.maxY>t.minY},e.prototype.containsPoint=function(t,e){for(var n=this.polygons,i=0,r=n.length;i<r;i++)if(this.containsPointPolygon(n[i],t,e))return this.boundingBoxes[i];return null},e.prototype.containsPointPolygon=function(t,e,n){for(var i=t,r=t.length,s=r-2,a=!1,o=0;o<r;o+=2){var h=i[o+1],l=i[s+1];if(h<n&&l>=n||l<n&&h>=n){var u=i[o];u+(n-h)/(l-h)*(i[s]-u)<e&&(a=!a)}s=o}return a},e.prototype.intersectsSegment=function(t,e,n,i){for(var r=this.polygons,s=0,a=r.length;s<a;s++)if(this.intersectsSegmentPolygon(r[s],t,e,n,i))return this.boundingBoxes[s];return null},e.prototype.intersectsSegmentPolygon=function(t,e,n,i,r){for(var s=t,a=t.length,o=e-i,h=n-r,l=e*r-n*i,u=s[a-2],c=s[a-1],f=0;f<a;f+=2){var d=s[f],p=s[f+1],v=u*p-c*d,m=u-d,g=c-p,y=o*g-h*m,x=(l*m-o*v)/y;if((x>=u&&x<=d||x>=d&&x<=u)&&(x>=e&&x<=i||x>=i&&x<=e)){var w=(l*g-h*v)/y;if((w>=c&&w<=p||w>=p&&w<=c)&&(w>=n&&w<=r||w>=r&&w<=n))return!0}u=d,c=p}return!1},e.prototype.getPolygon=function(t){if(null==t)throw new Error("boundingBox cannot be null.");var e=this.boundingBoxes.indexOf(t);return-1==e?null:this.polygons[e]},e.prototype.getWidth=function(){return this.maxX-this.minX},e.prototype.getHeight=function(){return this.maxY-this.minY},e}();t.SkeletonBounds=e}(i||(i={})),function(t){var e=function(){function e(){this.triangulator=new t.Triangulator,this.clippingPolygon=new Array,this.clipOutput=new Array,this.clippedVertices=new Array,this.clippedTriangles=new Array,this.scratch=new Array}return e.prototype.clipStart=function(n,i){if(null!=this.clipAttachment)return 0;this.clipAttachment=i;var r=i.worldVerticesLength,s=t.Utils.setArraySize(this.clippingPolygon,r);i.computeWorldVertices(n,0,r,s,0,2);var a=this.clippingPolygon;e.makeClockwise(a);for(var o=this.clippingPolygons=this.triangulator.decompose(a,this.triangulator.triangulate(a)),h=0,l=o.length;h<l;h++){var u=o[h];e.makeClockwise(u),u.push(u[0]),u.push(u[1])}return o.length},e.prototype.clipEndWithSlot=function(t){null!=this.clipAttachment&&this.clipAttachment.endSlot==t.data&&this.clipEnd()},e.prototype.clipEnd=function(){null!=this.clipAttachment&&(this.clipAttachment=null,this.clippingPolygons=null,this.clippedVertices.length=0,this.clippedTriangles.length=0,this.clippingPolygon.length=0)},e.prototype.isClipping=function(){return null!=this.clipAttachment},e.prototype.clipTriangles=function(e,n,i,r,s,a,o,h){var l=this.clipOutput,u=this.clippedVertices,c=this.clippedTriangles,f=this.clippingPolygons,d=this.clippingPolygons.length,p=h?12:8,v=0;u.length=0,c.length=0;t:for(var m=0;m<r;m+=3)for(var g=i[m]<<1,y=e[g],x=e[g+1],w=s[g],M=s[g+1],E=e[g=i[m+1]<<1],T=e[g+1],A=s[g],b=s[g+1],R=e[g=i[m+2]<<1],I=e[g+1],S=s[g],C=s[g+1],P=0;P<d;P++){var k=u.length;if(!this.clip(y,x,E,T,R,I,f[P],l)){(X=t.Utils.setArraySize(u,k+3*p))[k]=y,X[k+1]=x,X[k+2]=a.r,X[k+3]=a.g,X[k+4]=a.b,X[k+5]=a.a,h?(X[k+6]=w,X[k+7]=M,X[k+8]=o.r,X[k+9]=o.g,X[k+10]=o.b,X[k+11]=o.a,X[k+12]=E,X[k+13]=T,X[k+14]=a.r,X[k+15]=a.g,X[k+16]=a.b,X[k+17]=a.a,X[k+18]=A,X[k+19]=b,X[k+20]=o.r,X[k+21]=o.g,X[k+22]=o.b,X[k+23]=o.a,X[k+24]=R,X[k+25]=I,X[k+26]=a.r,X[k+27]=a.g,X[k+28]=a.b,X[k+29]=a.a,X[k+30]=S,X[k+31]=C,X[k+32]=o.r,X[k+33]=o.g,X[k+34]=o.b,X[k+35]=o.a):(X[k+6]=w,X[k+7]=M,X[k+8]=E,X[k+9]=T,X[k+10]=a.r,X[k+11]=a.g,X[k+12]=a.b,X[k+13]=a.a,X[k+14]=A,X[k+15]=b,X[k+16]=R,X[k+17]=I,X[k+18]=a.r,X[k+19]=a.g,X[k+20]=a.b,X[k+21]=a.a,X[k+22]=S,X[k+23]=C),k=c.length,(Z=t.Utils.setArraySize(c,k+3))[k]=v,Z[k+1]=v+1,Z[k+2]=v+2,v+=3;continue t}var V=l.length;if(0!=V){for(var F=T-I,O=R-E,L=y-R,_=I-x,N=1/(F*L+O*(x-I)),D=V>>1,Y=this.clipOutput,X=t.Utils.setArraySize(u,k+D*p),U=0;U<V;U+=2){var z=Y[U],B=Y[U+1];X[k]=z,X[k+1]=B,X[k+2]=a.r,X[k+3]=a.g,X[k+4]=a.b,X[k+5]=a.a;var q=z-R,W=B-I,G=(F*q+O*W)*N,j=(_*q+L*W)*N,H=1-G-j;X[k+6]=w*G+A*j+S*H,X[k+7]=M*G+b*j+C*H,h&&(X[k+8]=o.r,X[k+9]=o.g,X[k+10]=o.b,X[k+11]=o.a),k+=p}k=c.length;var Z=t.Utils.setArraySize(c,k+3*(D-2));D--;for(U=1;U<D;U++)Z[k]=v,Z[k+1]=v+U,Z[k+2]=v+U+1,k+=3;v+=D+1}}},e.prototype.clip=function(t,e,n,i,r,s,a,o){var h=o,l=!1,u=null;a.length%4>=2?(u=o,o=this.scratch):u=this.scratch,u.length=0,u.push(t),u.push(e),u.push(n),u.push(i),u.push(r),u.push(s),u.push(t),u.push(e),o.length=0;for(var c=a,f=a.length-4,d=0;;d+=2){for(var p=c[d],v=c[d+1],m=c[d+2],g=c[d+3],y=p-m,x=v-g,w=u,M=u.length-2,E=o.length,T=0;T<M;T+=2){var A=w[T],b=w[T+1],R=w[T+2],I=w[T+3],S=y*(I-g)-x*(R-m)>0;if(y*(b-g)-x*(A-m)>0){if(S){o.push(R),o.push(I);continue}var C=(k=I-b)*(m-p)-(V=R-A)*(g-v);if(Math.abs(C)>1e-6){var P=(V*(v-b)-k*(p-A))/C;o.push(p+(m-p)*P),o.push(v+(g-v)*P)}else o.push(p),o.push(v)}else if(S){var k,V;C=(k=I-b)*(m-p)-(V=R-A)*(g-v);if(Math.abs(C)>1e-6){P=(V*(v-b)-k*(p-A))/C;o.push(p+(m-p)*P),o.push(v+(g-v)*P)}else o.push(p),o.push(v);o.push(R),o.push(I)}l=!0}if(E==o.length)return h.length=0,!0;if(o.push(o[0]),o.push(o[1]),d==f)break;var F=o;(o=u).length=0,u=F}if(h!=o){h.length=0;d=0;for(var O=o.length-2;d<O;d++)h[d]=o[d]}else h.length=h.length-2;return l},e.makeClockwise=function(t){for(var e=t,n=t.length,i=e[n-2]*e[1]-e[0]*e[n-1],r=0,s=0,a=0,o=0,h=n-3;o<h;o+=2)r=e[o],s=e[o+1],a=e[o+2],i+=r*e[o+3]-a*s;if(!(i<0)){o=0;var l=n-2;for(h=n>>1;o<h;o+=2){var u=e[o],c=e[o+1],f=l-o;e[o]=e[f],e[o+1]=e[f+1],e[f]=u,e[f+1]=c}}},e}();t.SkeletonClipping=e}(i||(i={})),function(t){var e=function(){function t(){this.bones=new Array,this.slots=new Array,this.skins=new Array,this.events=new Array,this.animations=new Array,this.ikConstraints=new Array,this.transformConstraints=new Array,this.pathConstraints=new Array,this.fps=0}return t.prototype.findBone=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findBoneIndex=function(t){if(null==t)throw new Error("boneName cannot be null.");for(var e=this.bones,n=0,i=e.length;n<i;n++)if(e[n].name==t)return n;return-1},t.prototype.findSlot=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findSlotIndex=function(t){if(null==t)throw new Error("slotName cannot be null.");for(var e=this.slots,n=0,i=e.length;n<i;n++)if(e[n].name==t)return n;return-1},t.prototype.findSkin=function(t){if(null==t)throw new Error("skinName cannot be null.");for(var e=this.skins,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findEvent=function(t){if(null==t)throw new Error("eventDataName cannot be null.");for(var e=this.events,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findAnimation=function(t){if(null==t)throw new Error("animationName cannot be null.");for(var e=this.animations,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findIkConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.ikConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findTransformConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.transformConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findPathConstraint=function(t){if(null==t)throw new Error("constraintName cannot be null.");for(var e=this.pathConstraints,n=0,i=e.length;n<i;n++){var r=e[n];if(r.name==t)return r}return null},t.prototype.findPathConstraintIndex=function(t){if(null==t)throw new Error("pathConstraintName cannot be null.");for(var e=this.pathConstraints,n=0,i=e.length;n<i;n++)if(e[n].name==t)return n;return-1},t}();t.SkeletonData=e}(i||(i={})),function(t){var e=function(){function e(t){this.scale=1,this.linkedMeshes=new Array,this.attachmentLoader=t}return e.prototype.readSkeletonData=function(n){var i=this.scale,r=new t.SkeletonData,s="string"==typeof n?JSON.parse(n):n,a=s.skeleton;if(null!=a&&(r.hash=a.hash,r.version=a.spine,r.x=a.x,r.y=a.y,r.width=a.width,r.height=a.height,r.fps=a.fps,r.imagesPath=a.images),s.bones)for(var o=0;o<s.bones.length;o++){var h=s.bones[o],l=null,u=this.getValue(h,"parent",null);if(null!=u&&null==(l=r.findBone(u)))throw new Error("Parent bone not found: "+u);(p=new t.BoneData(r.bones.length,h.name,l)).length=this.getValue(h,"length",0)*i,p.x=this.getValue(h,"x",0)*i,p.y=this.getValue(h,"y",0)*i,p.rotation=this.getValue(h,"rotation",0),p.scaleX=this.getValue(h,"scaleX",1),p.scaleY=this.getValue(h,"scaleY",1),p.shearX=this.getValue(h,"shearX",0),p.shearY=this.getValue(h,"shearY",0),p.transformMode=e.transformModeFromString(this.getValue(h,"transform","normal")),p.skinRequired=this.getValue(h,"skin",!1),r.bones.push(p)}if(s.slots)for(o=0;o<s.slots.length;o++){var c=(R=s.slots[o]).name,f=R.bone,d=r.findBone(f);if(null==d)throw new Error("Slot bone not found: "+f);var p=new t.SlotData(r.slots.length,c,d),v=this.getValue(R,"color",null);null!=v&&p.color.setFromString(v);var m=this.getValue(R,"dark",null);null!=m&&(p.darkColor=new t.Color(1,1,1,1),p.darkColor.setFromString(m)),p.attachmentName=this.getValue(R,"attachment",null),p.blendMode=e.blendModeFromString(this.getValue(R,"blend","normal")),r.slots.push(p)}if(s.ik)for(o=0;o<s.ik.length;o++){var g=s.ik[o];(p=new t.IkConstraintData(g.name)).order=this.getValue(g,"order",0),p.skinRequired=this.getValue(g,"skin",!1);for(var y=0;y<g.bones.length;y++){f=g.bones[y];if(null==(T=r.findBone(f)))throw new Error("IK bone not found: "+f);p.bones.push(T)}var x=g.target;if(p.target=r.findBone(x),null==p.target)throw new Error("IK target bone not found: "+x);p.mix=this.getValue(g,"mix",1),p.softness=this.getValue(g,"softness",0)*i,p.bendDirection=this.getValue(g,"bendPositive",!0)?1:-1,p.compress=this.getValue(g,"compress",!1),p.stretch=this.getValue(g,"stretch",!1),p.uniform=this.getValue(g,"uniform",!1),r.ikConstraints.push(p)}if(s.transform)for(o=0;o<s.transform.length;o++){g=s.transform[o];(p=new t.TransformConstraintData(g.name)).order=this.getValue(g,"order",0),p.skinRequired=this.getValue(g,"skin",!1);for(y=0;y<g.bones.length;y++){f=g.bones[y];if(null==(T=r.findBone(f)))throw new Error("Transform constraint bone not found: "+f);p.bones.push(T)}x=g.target;if(p.target=r.findBone(x),null==p.target)throw new Error("Transform constraint target bone not found: "+x);p.local=this.getValue(g,"local",!1),p.relative=this.getValue(g,"relative",!1),p.offsetRotation=this.getValue(g,"rotation",0),p.offsetX=this.getValue(g,"x",0)*i,p.offsetY=this.getValue(g,"y",0)*i,p.offsetScaleX=this.getValue(g,"scaleX",0),p.offsetScaleY=this.getValue(g,"scaleY",0),p.offsetShearY=this.getValue(g,"shearY",0),p.rotateMix=this.getValue(g,"rotateMix",1),p.translateMix=this.getValue(g,"translateMix",1),p.scaleMix=this.getValue(g,"scaleMix",1),p.shearMix=this.getValue(g,"shearMix",1),r.transformConstraints.push(p)}if(s.path)for(o=0;o<s.path.length;o++){g=s.path[o];(p=new t.PathConstraintData(g.name)).order=this.getValue(g,"order",0),p.skinRequired=this.getValue(g,"skin",!1);for(y=0;y<g.bones.length;y++){f=g.bones[y];if(null==(T=r.findBone(f)))throw new Error("Transform constraint bone not found: "+f);p.bones.push(T)}x=g.target;if(p.target=r.findSlot(x),null==p.target)throw new Error("Path target slot not found: "+x);p.positionMode=e.positionModeFromString(this.getValue(g,"positionMode","percent")),p.spacingMode=e.spacingModeFromString(this.getValue(g,"spacingMode","length")),p.rotateMode=e.rotateModeFromString(this.getValue(g,"rotateMode","tangent")),p.offsetRotation=this.getValue(g,"rotation",0),p.position=this.getValue(g,"position",0),p.positionMode==t.PositionMode.Fixed&&(p.position*=i),p.spacing=this.getValue(g,"spacing",0),p.spacingMode!=t.SpacingMode.Length&&p.spacingMode!=t.SpacingMode.Fixed||(p.spacing*=i),p.rotateMix=this.getValue(g,"rotateMix",1),p.translateMix=this.getValue(g,"translateMix",1),r.pathConstraints.push(p)}if(s.skins)for(o=0;o<s.skins.length;o++){var w=s.skins[o],M=new t.Skin(w.name);if(w.bones)for(var E=0;E<w.bones.length;E++){var T;if(null==(T=r.findBone(w.bones[E])))throw new Error("Skin bone not found: "+w.bones[o]);M.bones.push(T)}if(w.ik)for(E=0;E<w.ik.length;E++){if(null==(A=r.findIkConstraint(w.ik[E])))throw new Error("Skin IK constraint not found: "+w.ik[o]);M.constraints.push(A)}if(w.transform)for(E=0;E<w.transform.length;E++){if(null==(A=r.findTransformConstraint(w.transform[E])))throw new Error("Skin transform constraint not found: "+w.transform[o]);M.constraints.push(A)}if(w.path)for(E=0;E<w.path.length;E++){var A;if(null==(A=r.findPathConstraint(w.path[E])))throw new Error("Skin path constraint not found: "+w.path[o]);M.constraints.push(A)}for(var c in w.attachments){var b=r.findSlot(c);if(null==b)throw new Error("Slot not found: "+c);var R=w.attachments[c];for(var I in R){var S=this.readAttachment(R[I],M,b.index,I,r);null!=S&&M.setAttachment(b.index,I,S)}}r.skins.push(M),"default"==M.name&&(r.defaultSkin=M)}o=0;for(var C=this.linkedMeshes.length;o<C;o++){var P=this.linkedMeshes[o];if(null==(M=null==P.skin?r.defaultSkin:r.findSkin(P.skin)))throw new Error("Skin not found: "+P.skin);var k=M.getAttachment(P.slotIndex,P.parent);if(null==k)throw new Error("Parent mesh not found: "+P.parent);P.mesh.deformAttachment=P.inheritDeform?k:P.mesh,P.mesh.setParentMesh(k),P.mesh.updateUVs()}if(this.linkedMeshes.length=0,s.events)for(var V in s.events){var F=s.events[V];(p=new t.EventData(V)).intValue=this.getValue(F,"int",0),p.floatValue=this.getValue(F,"float",0),p.stringValue=this.getValue(F,"string",""),p.audioPath=this.getValue(F,"audio",null),null!=p.audioPath&&(p.volume=this.getValue(F,"volume",1),p.balance=this.getValue(F,"balance",0)),r.events.push(p)}if(s.animations)for(var O in s.animations){var L=s.animations[O];this.readAnimation(L,O,r)}return r},e.prototype.readAttachment=function(e,i,r,s,a){var o=this.scale;switch(s=this.getValue(e,"name",s),this.getValue(e,"type","region")){case"region":var h=this.getValue(e,"path",s),l=this.attachmentLoader.newRegionAttachment(i,s,h);return null==l?null:(l.path=h,l.x=this.getValue(e,"x",0)*o,l.y=this.getValue(e,"y",0)*o,l.scaleX=this.getValue(e,"scaleX",1),l.scaleY=this.getValue(e,"scaleY",1),l.rotation=this.getValue(e,"rotation",0),l.width=e.width*o,l.height=e.height*o,null!=(M=this.getValue(e,"color",null))&&l.color.setFromString(M),l.updateOffset(),l);case"boundingbox":var u=this.attachmentLoader.newBoundingBoxAttachment(i,s);return null==u?null:(this.readVertices(e,u,e.vertexCount<<1),null!=(M=this.getValue(e,"color",null))&&u.color.setFromString(M),u);case"mesh":case"linkedmesh":h=this.getValue(e,"path",s);var c=this.attachmentLoader.newMeshAttachment(i,s,h);if(null==c)return null;c.path=h,null!=(M=this.getValue(e,"color",null))&&c.color.setFromString(M),c.width=this.getValue(e,"width",0)*o,c.height=this.getValue(e,"height",0)*o;var f=this.getValue(e,"parent",null);if(null!=f)return this.linkedMeshes.push(new n(c,this.getValue(e,"skin",null),r,f,this.getValue(e,"deform",!0))),c;var d=e.uvs;return this.readVertices(e,c,d.length),c.triangles=e.triangles,c.regionUVs=d,c.updateUVs(),c.edges=this.getValue(e,"edges",null),c.hullLength=2*this.getValue(e,"hull",0),c;case"path":if(null==(h=this.attachmentLoader.newPathAttachment(i,s)))return null;h.closed=this.getValue(e,"closed",!1),h.constantSpeed=this.getValue(e,"constantSpeed",!0);var p=e.vertexCount;this.readVertices(e,h,p<<1);for(var v=t.Utils.newArray(p/3,0),m=0;m<e.lengths.length;m++)v[m]=e.lengths[m]*o;return h.lengths=v,null!=(M=this.getValue(e,"color",null))&&h.color.setFromString(M),h;case"point":var g=this.attachmentLoader.newPointAttachment(i,s);return null==g?null:(g.x=this.getValue(e,"x",0)*o,g.y=this.getValue(e,"y",0)*o,g.rotation=this.getValue(e,"rotation",0),null!=(M=this.getValue(e,"color",null))&&g.color.setFromString(M),g);case"clipping":var y=this.attachmentLoader.newClippingAttachment(i,s);if(null==y)return null;var x=this.getValue(e,"end",null);if(null!=x){var w=a.findSlot(x);if(null==w)throw new Error("Clipping end slot not found: "+x);y.endSlot=w}var M;p=e.vertexCount;return this.readVertices(e,y,p<<1),null!=(M=this.getValue(e,"color",null))&&y.color.setFromString(M),y}return null},e.prototype.readVertices=function(e,n,i){var r=this.scale;n.worldVerticesLength=i;var s=e.vertices;if(i!=s.length){var a=new Array,o=new Array;for(c=0,f=s.length;c<f;){var h=s[c++];o.push(h);for(var l=c+4*h;c<l;c+=4)o.push(s[c]),a.push(s[c+1]*r),a.push(s[c+2]*r),a.push(s[c+3])}n.bones=o,n.vertices=t.Utils.toFloatArray(a)}else{var u=t.Utils.toFloatArray(s);if(1!=r)for(var c=0,f=s.length;c<f;c++)u[c]*=r;n.vertices=u}},e.prototype.readAnimation=function(e,n,i){var r=this.scale,s=new Array,a=0;if(e.slots)for(var o in e.slots){var h=e.slots[o];if(-1==(K=i.findSlotIndex(o)))throw new Error("Slot not found: "+o);for(var l in h){var u=h[l];if("attachment"==l){(w=new t.AttachmentTimeline(u.length)).slotIndex=K;for(var c=0,f=0;f<u.length;f++){var d=u[f];w.setFrame(c++,this.getValue(d,"time",0),d.name)}s.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}else if("color"==l){(w=new t.ColorTimeline(u.length)).slotIndex=K;for(c=0,f=0;f<u.length;f++){d=u[f];var p=new t.Color;p.setFromString(d.color),w.setFrame(c,this.getValue(d,"time",0),p.r,p.g,p.b,p.a),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*t.ColorTimeline.ENTRIES])}else{if("twoColor"!=l)throw new Error("Invalid timeline type for a slot: "+l+" ("+o+")");(w=new t.TwoColorTimeline(u.length)).slotIndex=K;for(c=0,f=0;f<u.length;f++){d=u[f];var v=new t.Color,m=new t.Color;v.setFromString(d.light),m.setFromString(d.dark),w.setFrame(c,this.getValue(d,"time",0),v.r,v.g,v.b,v.a,m.r,m.g,m.b),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*t.TwoColorTimeline.ENTRIES])}}}if(e.bones)for(var g in e.bones){var y=e.bones[g],x=i.findBoneIndex(g);if(-1==x)throw new Error("Bone not found: "+g);for(var l in y){u=y[l];if("rotate"===l){(w=new t.RotateTimeline(u.length)).boneIndex=x;for(c=0,f=0;f<u.length;f++){d=u[f];w.setFrame(c,this.getValue(d,"time",0),this.getValue(d,"angle",0)),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*t.RotateTimeline.ENTRIES])}else{if("translate"!==l&&"scale"!==l&&"shear"!==l)throw new Error("Invalid timeline type for a bone: "+l+" ("+g+")");var w=null,M=1,E=0;"scale"===l?(w=new t.ScaleTimeline(u.length),E=1):"shear"===l?w=new t.ShearTimeline(u.length):(w=new t.TranslateTimeline(u.length),M=r),w.boneIndex=x;for(c=0,f=0;f<u.length;f++){d=u[f];var T=this.getValue(d,"x",E),A=this.getValue(d,"y",E);w.setFrame(c,this.getValue(d,"time",0),T*M,A*M),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*t.TranslateTimeline.ENTRIES])}}}if(e.ik)for(var b in e.ik){var R=e.ik[b],I=i.findIkConstraint(b);(w=new t.IkConstraintTimeline(R.length)).ikConstraintIndex=i.ikConstraints.indexOf(I);for(c=0,f=0;f<R.length;f++){d=R[f];w.setFrame(c,this.getValue(d,"time",0),this.getValue(d,"mix",1),this.getValue(d,"softness",0)*r,this.getValue(d,"bendPositive",!0)?1:-1,this.getValue(d,"compress",!1),this.getValue(d,"stretch",!1)),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*t.IkConstraintTimeline.ENTRIES])}if(e.transform)for(var b in e.transform){R=e.transform[b],I=i.findTransformConstraint(b);(w=new t.TransformConstraintTimeline(R.length)).transformConstraintIndex=i.transformConstraints.indexOf(I);for(c=0,f=0;f<R.length;f++){d=R[f];w.setFrame(c,this.getValue(d,"time",0),this.getValue(d,"rotateMix",1),this.getValue(d,"translateMix",1),this.getValue(d,"scaleMix",1),this.getValue(d,"shearMix",1)),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*t.TransformConstraintTimeline.ENTRIES])}if(e.path)for(var b in e.path){R=e.path[b];var S=i.findPathConstraintIndex(b);if(-1==S)throw new Error("Path constraint not found: "+b);var C=i.pathConstraints[S];for(var l in R){u=R[l];if("position"===l||"spacing"===l){w=null,M=1;"spacing"===l?(w=new t.PathConstraintSpacingTimeline(u.length),C.spacingMode!=t.SpacingMode.Length&&C.spacingMode!=t.SpacingMode.Fixed||(M=r)):(w=new t.PathConstraintPositionTimeline(u.length),C.positionMode==t.PositionMode.Fixed&&(M=r)),w.pathConstraintIndex=S;for(c=0,f=0;f<u.length;f++){d=u[f];w.setFrame(c,this.getValue(d,"time",0),this.getValue(d,l,0)*M),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*t.PathConstraintPositionTimeline.ENTRIES])}else if("mix"===l){(w=new t.PathConstraintMixTimeline(u.length)).pathConstraintIndex=S;for(c=0,f=0;f<u.length;f++){d=u[f];w.setFrame(c,this.getValue(d,"time",0),this.getValue(d,"rotateMix",1),this.getValue(d,"translateMix",1)),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[(w.getFrameCount()-1)*t.PathConstraintMixTimeline.ENTRIES])}}}if(e.deform)for(var P in e.deform){var k=e.deform[P],V=i.findSkin(P);if(null==V)throw new Error("Skin not found: "+P);for(var o in k){h=k[o];if(-1==(K=i.findSlotIndex(o)))throw new Error("Slot not found: "+h.name);for(var l in h){u=h[l];var F=V.getAttachment(K,l);if(null==F)throw new Error("Deform attachment not found: "+u.name);var O=null!=F.bones,L=F.vertices,_=O?L.length/3*2:L.length;(w=new t.DeformTimeline(u.length)).slotIndex=K,w.attachment=F;c=0;for(var N=0;N<u.length;N++){d=u[N];var D=void 0,Y=this.getValue(d,"vertices",null);if(null==Y)D=O?t.Utils.newFloatArray(_):L;else{D=t.Utils.newFloatArray(_);var X=this.getValue(d,"offset",0);if(t.Utils.arrayCopy(Y,0,D,X,Y.length),1!=r)for(var U=(f=X)+Y.length;f<U;f++)D[f]*=r;if(!O)for(f=0;f<_;f++)D[f]+=L[f]}w.setFrame(c,this.getValue(d,"time",0),D),this.readCurve(d,w,c),c++}s.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}}}var z=e.drawOrder;if(null==z&&(z=e.draworder),null!=z){w=new t.DrawOrderTimeline(z.length);var B=i.slots.length;for(c=0,N=0;N<z.length;N++){var q=z[N],W=null,G=this.getValue(q,"offsets",null);if(null!=G){W=t.Utils.newArray(B,-1);var j=t.Utils.newArray(B-G.length,0),H=0,Z=0;for(f=0;f<G.length;f++){var K,Q=G[f];if(-1==(K=i.findSlotIndex(Q.slot)))throw new Error("Slot not found: "+Q.slot);for(;H!=K;)j[Z++]=H++;W[H+Q.offset]=H++}for(;H<B;)j[Z++]=H++;for(f=B-1;f>=0;f--)-1==W[f]&&(W[f]=j[--Z])}w.setFrame(c++,this.getValue(q,"time",0),W)}s.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}if(e.events){for(w=new t.EventTimeline(e.events.length),c=0,f=0;f<e.events.length;f++){var J=e.events[f],$=i.findEvent(J.name);if(null==$)throw new Error("Event not found: "+J.name);var tt=new t.Event(t.Utils.toSinglePrecision(this.getValue(J,"time",0)),$);tt.intValue=this.getValue(J,"int",$.intValue),tt.floatValue=this.getValue(J,"float",$.floatValue),tt.stringValue=this.getValue(J,"string",$.stringValue),null!=tt.data.audioPath&&(tt.volume=this.getValue(J,"volume",1),tt.balance=this.getValue(J,"balance",0)),w.setFrame(c++,tt)}s.push(w),a=Math.max(a,w.frames[w.getFrameCount()-1])}if(isNaN(a))throw new Error("Error while parsing animation, duration is NaN");i.animations.push(new t.Animation(n,s,a))},e.prototype.readCurve=function(t,e,n){if(t.curve)if("stepped"==t.curve)e.setStepped(n);else{var i=t.curve;e.setCurve(n,i,this.getValue(t,"c2",0),this.getValue(t,"c3",1),this.getValue(t,"c4",1))}},e.prototype.getValue=function(t,e,n){return void 0!==t[e]?t[e]:n},e.blendModeFromString=function(e){if("normal"==(e=e.toLowerCase()))return t.BlendMode.Normal;if("additive"==e)return t.BlendMode.Additive;if("multiply"==e)return t.BlendMode.Multiply;if("screen"==e)return t.BlendMode.Screen;throw new Error("Unknown blend mode: "+e)},e.positionModeFromString=function(e){if("fixed"==(e=e.toLowerCase()))return t.PositionMode.Fixed;if("percent"==e)return t.PositionMode.Percent;throw new Error("Unknown position mode: "+e)},e.spacingModeFromString=function(e){if("length"==(e=e.toLowerCase()))return t.SpacingMode.Length;if("fixed"==e)return t.SpacingMode.Fixed;if("percent"==e)return t.SpacingMode.Percent;throw new Error("Unknown position mode: "+e)},e.rotateModeFromString=function(e){if("tangent"==(e=e.toLowerCase()))return t.RotateMode.Tangent;if("chain"==e)return t.RotateMode.Chain;if("chainscale"==e)return t.RotateMode.ChainScale;throw new Error("Unknown rotate mode: "+e)},e.transformModeFromString=function(e){if("normal"==(e=e.toLowerCase()))return t.TransformMode.Normal;if("onlytranslation"==e)return t.TransformMode.OnlyTranslation;if("norotationorreflection"==e)return t.TransformMode.NoRotationOrReflection;if("noscale"==e)return t.TransformMode.NoScale;if("noscaleorreflection"==e)return t.TransformMode.NoScaleOrReflection;throw new Error("Unknown transform mode: "+e)},e}();t.SkeletonJson=e;var n=function(){return function(t,e,n,i,r){this.mesh=t,this.skin=e,this.slotIndex=n,this.parent=i,this.inheritDeform=r}}()}(i||(i={})),function(t){var e=function(){return function(t,e,n){this.slotIndex=t,this.name=e,this.attachment=n}}();t.SkinEntry=e;var n=function(){function n(t){if(this.attachments=new Array,this.bones=Array(),this.constraints=new Array,null==t)throw new Error("name cannot be null.");this.name=t}return n.prototype.setAttachment=function(t,e,n){if(null==n)throw new Error("attachment cannot be null.");var i=this.attachments;t>=i.length&&(i.length=t+1),i[t]||(i[t]={}),i[t][e]=n},n.prototype.addSkin=function(t){for(var e=0;e<t.bones.length;e++){for(var n=t.bones[e],i=!1,r=0;r<this.bones.length;r++)if(this.bones[r]==n){i=!0;break}i||this.bones.push(n)}for(e=0;e<t.constraints.length;e++){var s=t.constraints[e];for(i=!1,r=0;r<this.constraints.length;r++)if(this.constraints[r]==s){i=!0;break}i||this.constraints.push(s)}var a=t.getAttachments();for(e=0;e<a.length;e++){var o=a[e];this.setAttachment(o.slotIndex,o.name,o.attachment)}},n.prototype.copySkin=function(e){for(var n=0;n<e.bones.length;n++){for(var i=e.bones[n],r=!1,s=0;s<this.bones.length;s++)if(this.bones[s]==i){r=!0;break}r||this.bones.push(i)}for(n=0;n<e.constraints.length;n++){var a=e.constraints[n];for(r=!1,s=0;s<this.constraints.length;s++)if(this.constraints[s]==a){r=!0;break}r||this.constraints.push(a)}var o=e.getAttachments();for(n=0;n<o.length;n++){var h=o[n];null!=h.attachment&&(h.attachment instanceof t.MeshAttachment?(h.attachment=h.attachment.newLinkedMesh(),this.setAttachment(h.slotIndex,h.name,h.attachment)):(h.attachment=h.attachment.copy(),this.setAttachment(h.slotIndex,h.name,h.attachment)))}},n.prototype.getAttachment=function(t,e){var n=this.attachments[t];return n?n[e]:null},n.prototype.removeAttachment=function(t,e){var n=this.attachments[t];n&&(n[e]=null)},n.prototype.getAttachments=function(){for(var t=new Array,n=0;n<this.attachments.length;n++){var i=this.attachments[n];if(i)for(var r in i){var s=i[r];s&&t.push(new e(n,r,s))}}return t},n.prototype.getAttachmentsForSlot=function(t,n){var i=this.attachments[t];if(i)for(var r in i){var s=i[r];s&&n.push(new e(t,r,s))}},n.prototype.clear=function(){this.attachments.length=0,this.bones.length=0,this.constraints.length=0},n.prototype.attachAll=function(t,e){for(var n=0,i=0;i<t.slots.length;i++){var r=t.slots[i],s=r.getAttachment();if(s&&n<e.attachments.length){var a=e.attachments[n];for(var o in a){if(s==a[o]){var h=this.getAttachment(n,o);null!=h&&r.setAttachment(h);break}}}n++}},n}();t.Skin=n}(i||(i={})),function(t){var e=function(){function e(e,n){if(this.deform=new Array,null==e)throw new Error("data cannot be null.");if(null==n)throw new Error("bone cannot be null.");this.data=e,this.bone=n,this.color=new t.Color,this.darkColor=null==e.darkColor?null:new t.Color,this.setToSetupPose()}return e.prototype.getSkeleton=function(){return this.bone.skeleton},e.prototype.getAttachment=function(){return this.attachment},e.prototype.setAttachment=function(t){this.attachment!=t&&(this.attachment=t,this.attachmentTime=this.bone.skeleton.time,this.deform.length=0)},e.prototype.setAttachmentTime=function(t){this.attachmentTime=this.bone.skeleton.time-t},e.prototype.getAttachmentTime=function(){return this.bone.skeleton.time-this.attachmentTime},e.prototype.setToSetupPose=function(){this.color.setFromColor(this.data.color),null!=this.darkColor&&this.darkColor.setFromColor(this.data.darkColor),null==this.data.attachmentName?this.attachment=null:(this.attachment=null,this.setAttachment(this.bone.skeleton.getAttachment(this.data.index,this.data.attachmentName)))},e}();t.Slot=e}(i||(i={})),function(t){var e=function(){return function(e,n,i){if(this.color=new t.Color(1,1,1,1),e<0)throw new Error("index must be >= 0.");if(null==n)throw new Error("name cannot be null.");if(null==i)throw new Error("boneData cannot be null.");this.index=e,this.name=n,this.boneData=i}}();t.SlotData=e}(i||(i={})),function(t){var e,n,i=function(){function t(t){this._image=t}return t.prototype.getImage=function(){return this._image},t.filterFromString=function(t){switch(t.toLowerCase()){case"nearest":return e.Nearest;case"linear":return e.Linear;case"mipmap":return e.MipMap;case"mipmapnearestnearest":return e.MipMapNearestNearest;case"mipmaplinearnearest":return e.MipMapLinearNearest;case"mipmapnearestlinear":return e.MipMapNearestLinear;case"mipmaplinearlinear":return e.MipMapLinearLinear;default:throw new Error("Unknown texture filter "+t)}},t.wrapFromString=function(t){switch(t.toLowerCase()){case"mirroredtepeat":return n.MirroredRepeat;case"clamptoedge":return n.ClampToEdge;case"repeat":return n.Repeat;default:throw new Error("Unknown texture wrap "+t)}},t}();t.Texture=i,function(t){t[t.Nearest=9728]="Nearest",t[t.Linear=9729]="Linear",t[t.MipMap=9987]="MipMap",t[t.MipMapNearestNearest=9984]="MipMapNearestNearest",t[t.MipMapLinearNearest=9985]="MipMapLinearNearest",t[t.MipMapNearestLinear=9986]="MipMapNearestLinear",t[t.MipMapLinearLinear=9987]="MipMapLinearLinear"}(e=t.TextureFilter||(t.TextureFilter={})),function(t){t[t.MirroredRepeat=33648]="MirroredRepeat",t[t.ClampToEdge=33071]="ClampToEdge",t[t.Repeat=10497]="Repeat"}(n=t.TextureWrap||(t.TextureWrap={}));var s=function(){return function(){this.u=0,this.v=0,this.u2=0,this.v2=0,this.width=0,this.height=0,this.rotate=!1,this.offsetX=0,this.offsetY=0,this.originalWidth=0,this.originalHeight=0}}();t.TextureRegion=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(i);t.FakeTexture=a}(i||(i={})),function(t){var e=function(){function e(t,e){this.pages=new Array,this.regions=new Array,this.load(t,e)}return e.prototype.load=function(e,r){if(null==r)throw new Error("textureLoader cannot be null.");for(var a=new n(e),o=new Array(4),h=null;;){var l=a.readLine();if(null==l)break;if(0==(l=l.trim()).length)h=null;else if(h){var u=new s;u.name=l,u.page=h;var c=a.readValue();"true"==c.toLocaleLowerCase()?u.degrees=90:"false"==c.toLocaleLowerCase()?u.degrees=0:u.degrees=parseFloat(c),u.rotate=90==u.degrees,a.readTuple(o);var f=parseInt(o[0]),d=parseInt(o[1]);a.readTuple(o);var p=parseInt(o[0]),v=parseInt(o[1]);u.u=f/h.width,u.v=d/h.height,u.rotate?(u.u2=(f+v)/h.width,u.v2=(d+p)/h.height):(u.u2=(f+p)/h.width,u.v2=(d+v)/h.height),u.x=f,u.y=d,u.width=Math.abs(p),u.height=Math.abs(v),4==a.readTuple(o)&&4==a.readTuple(o)&&a.readTuple(o),u.originalWidth=parseInt(o[0]),u.originalHeight=parseInt(o[1]),a.readTuple(o),u.offsetX=parseInt(o[0]),u.offsetY=parseInt(o[1]),u.index=parseInt(a.readValue()),u.texture=h.texture,this.regions.push(u)}else{(h=new i).name=l,2==a.readTuple(o)&&(h.width=parseInt(o[0]),h.height=parseInt(o[1]),a.readTuple(o)),a.readTuple(o),h.minFilter=t.Texture.filterFromString(o[0]),h.magFilter=t.Texture.filterFromString(o[1]);var m=a.readValue();h.uWrap=t.TextureWrap.ClampToEdge,h.vWrap=t.TextureWrap.ClampToEdge,"x"==m?h.uWrap=t.TextureWrap.Repeat:"y"==m?h.vWrap=t.TextureWrap.Repeat:"xy"==m&&(h.uWrap=h.vWrap=t.TextureWrap.Repeat),h.texture=r(l),h.texture.setFilters(h.minFilter,h.magFilter),h.texture.setWraps(h.uWrap,h.vWrap),h.width=h.texture.getImage().width,h.height=h.texture.getImage().height,this.pages.push(h)}}},e.prototype.findRegion=function(t){for(var e=0;e<this.regions.length;e++)if(this.regions[e].name==t)return this.regions[e];return null},e.prototype.dispose=function(){for(var t=0;t<this.pages.length;t++)this.pages[t].texture.dispose()},e}();t.TextureAtlas=e;var n=function(){function t(t){this.index=0,this.lines=t.split(/\r\n|\r|\n/)}return t.prototype.readLine=function(){return this.index>=this.lines.length?null:this.lines[this.index++]},t.prototype.readValue=function(){var t=this.readLine(),e=t.indexOf(":");if(-1==e)throw new Error("Invalid line: "+t);return t.substring(e+1).trim()},t.prototype.readTuple=function(t){var e=this.readLine(),n=e.indexOf(":");if(-1==n)throw new Error("Invalid line: "+e);for(var i=0,r=n+1;i<3;i++){var s=e.indexOf(",",r);if(-1==s)break;t[i]=e.substr(r,s-r).trim(),r=s+1}return t[i]=e.substring(r).trim(),i+1},t}(),i=function(){return function(){}}();t.TextureAtlasPage=i;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(t.TextureRegion);t.TextureAtlasRegion=s}(i||(i={})),function(t){var e=function(){function e(e,n){if(this.rotateMix=0,this.translateMix=0,this.scaleMix=0,this.shearMix=0,this.temp=new t.Vector2,this.active=!1,null==e)throw new Error("data cannot be null.");if(null==n)throw new Error("skeleton cannot be null.");this.data=e,this.rotateMix=e.rotateMix,this.translateMix=e.translateMix,this.scaleMix=e.scaleMix,this.shearMix=e.shearMix,this.bones=new Array;for(var i=0;i<e.bones.length;i++)this.bones.push(n.findBone(e.bones[i].name));this.target=n.findBone(e.target.name)}return e.prototype.isActive=function(){return this.active},e.prototype.apply=function(){this.update()},e.prototype.update=function(){this.data.local?this.data.relative?this.applyRelativeLocal():this.applyAbsoluteLocal():this.data.relative?this.applyRelativeWorld():this.applyAbsoluteWorld()},e.prototype.applyAbsoluteWorld=function(){for(var e=this.rotateMix,n=this.translateMix,i=this.scaleMix,r=this.shearMix,s=this.target,a=s.a,o=s.b,h=s.c,l=s.d,u=a*l-o*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,v=d.length;p<v;p++){var m=d[p],g=!1;if(0!=e){var y=m.a,x=m.b,w=m.c,M=m.d;(I=Math.atan2(h,a)-Math.atan2(w,y)+c)>t.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2),I*=e;var E=Math.cos(I),T=Math.sin(I);m.a=E*y-T*w,m.b=E*x-T*M,m.c=T*y+E*w,m.d=T*x+E*M,g=!0}if(0!=n){var A=this.temp;s.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),m.worldX+=(A.x-m.worldX)*n,m.worldY+=(A.y-m.worldY)*n,g=!0}if(i>0){var b=Math.sqrt(m.a*m.a+m.c*m.c),R=Math.sqrt(a*a+h*h);b>1e-5&&(b=(b+(R-b+this.data.offsetScaleX)*i)/b),m.a*=b,m.c*=b,b=Math.sqrt(m.b*m.b+m.d*m.d),R=Math.sqrt(o*o+l*l),b>1e-5&&(b=(b+(R-b+this.data.offsetScaleY)*i)/b),m.b*=b,m.d*=b,g=!0}if(r>0){x=m.b,M=m.d;var I,S=Math.atan2(M,x);(I=Math.atan2(l,o)-Math.atan2(h,a)-(S-Math.atan2(m.c,m.a)))>t.MathUtils.PI?I-=t.MathUtils.PI2:I<-t.MathUtils.PI&&(I+=t.MathUtils.PI2),I=S+(I+f)*r;b=Math.sqrt(x*x+M*M);m.b=Math.cos(I)*b,m.d=Math.sin(I)*b,g=!0}g&&(m.appliedValid=!1)}},e.prototype.applyRelativeWorld=function(){for(var e=this.rotateMix,n=this.translateMix,i=this.scaleMix,r=this.shearMix,s=this.target,a=s.a,o=s.b,h=s.c,l=s.d,u=a*l-o*h>0?t.MathUtils.degRad:-t.MathUtils.degRad,c=this.data.offsetRotation*u,f=this.data.offsetShearY*u,d=this.bones,p=0,v=d.length;p<v;p++){var m=d[p],g=!1;if(0!=e){var y=m.a,x=m.b,w=m.c,M=m.d;(R=Math.atan2(h,a)+c)>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2),R*=e;var E=Math.cos(R),T=Math.sin(R);m.a=E*y-T*w,m.b=E*x-T*M,m.c=T*y+E*w,m.d=T*x+E*M,g=!0}if(0!=n){var A=this.temp;s.localToWorld(A.set(this.data.offsetX,this.data.offsetY)),m.worldX+=A.x*n,m.worldY+=A.y*n,g=!0}if(i>0){var b=(Math.sqrt(a*a+h*h)-1+this.data.offsetScaleX)*i+1;m.a*=b,m.c*=b,b=(Math.sqrt(o*o+l*l)-1+this.data.offsetScaleY)*i+1,m.b*=b,m.d*=b,g=!0}if(r>0){var R;(R=Math.atan2(l,o)-Math.atan2(h,a))>t.MathUtils.PI?R-=t.MathUtils.PI2:R<-t.MathUtils.PI&&(R+=t.MathUtils.PI2);x=m.b,M=m.d;R=Math.atan2(M,x)+(R-t.MathUtils.PI/2+f)*r;b=Math.sqrt(x*x+M*M);m.b=Math.cos(R)*b,m.d=Math.sin(R)*b,g=!0}g&&(m.appliedValid=!1)}},e.prototype.applyAbsoluteLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a<o;a++){var h=s[a];h.appliedValid||h.updateAppliedTransform();var l=h.arotation;if(0!=t){var u=r.arotation-l+this.data.offsetRotation;l+=(u-=360*(16384-(16384.499999999996-u/360|0)))*t}var c=h.ax,f=h.ay;0!=e&&(c+=(r.ax-c+this.data.offsetX)*e,f+=(r.ay-f+this.data.offsetY)*e);var d=h.ascaleX,p=h.ascaleY;0!=n&&(d>1e-5&&(d=(d+(r.ascaleX-d+this.data.offsetScaleX)*n)/d),p>1e-5&&(p=(p+(r.ascaleY-p+this.data.offsetScaleY)*n)/p));var v=h.ashearY;if(0!=i){u=r.ashearY-v+this.data.offsetShearY;u-=360*(16384-(16384.499999999996-u/360|0)),h.shearY+=u*i}h.updateWorldTransformWith(c,f,l,d,p,h.ashearX,v)}},e.prototype.applyRelativeLocal=function(){var t=this.rotateMix,e=this.translateMix,n=this.scaleMix,i=this.shearMix,r=this.target;r.appliedValid||r.updateAppliedTransform();for(var s=this.bones,a=0,o=s.length;a<o;a++){var h=s[a];h.appliedValid||h.updateAppliedTransform();var l=h.arotation;0!=t&&(l+=(r.arotation+this.data.offsetRotation)*t);var u=h.ax,c=h.ay;0!=e&&(u+=(r.ax+this.data.offsetX)*e,c+=(r.ay+this.data.offsetY)*e);var f=h.ascaleX,d=h.ascaleY;0!=n&&(f>1e-5&&(f*=(r.ascaleX-1+this.data.offsetScaleX)*n+1),d>1e-5&&(d*=(r.ascaleY-1+this.data.offsetScaleY)*n+1));var p=h.ashearY;0!=i&&(p+=(r.ashearY+this.data.offsetShearY)*i),h.updateWorldTransformWith(u,c,l,f,d,h.ashearX,p)}},e}();t.TransformConstraint=e}(i||(i={})),function(t){var e=function(t){function e(e){var n=t.call(this,e,0,!1)||this;return n.bones=new Array,n.rotateMix=0,n.translateMix=0,n.scaleMix=0,n.shearMix=0,n.offsetRotation=0,n.offsetX=0,n.offsetY=0,n.offsetScaleX=0,n.offsetScaleY=0,n.offsetShearY=0,n.relative=!1,n.local=!1,n}return r(e,t),e}(t.ConstraintData);t.TransformConstraintData=e}(i||(i={})),function(t){var e=function(){function e(){this.convexPolygons=new Array,this.convexPolygonsIndices=new Array,this.indicesArray=new Array,this.isConcaveArray=new Array,this.triangles=new Array,this.polygonPool=new t.Pool(function(){return new Array}),this.polygonIndicesPool=new t.Pool(function(){return new Array})}return e.prototype.triangulate=function(t){var n=t,i=t.length>>1,r=this.indicesArray;r.length=0;for(var s=0;s<i;s++)r[s]=s;var a=this.isConcaveArray;a.length=0;s=0;for(var o=i;s<o;++s)a[s]=e.isConcave(s,i,n,r);var h=this.triangles;for(h.length=0;i>3;){for(var l=i-1,u=(s=0,1);;){t:if(!a[s]){for(var c=r[l]<<1,f=r[s]<<1,d=r[u]<<1,p=n[c],v=n[c+1],m=n[f],g=n[f+1],y=n[d],x=n[d+1],w=(u+1)%i;w!=l;w=(w+1)%i)if(a[w]){var M=r[w]<<1,E=n[M],T=n[M+1];if(e.positiveArea(y,x,p,v,E,T)&&e.positiveArea(p,v,m,g,E,T)&&e.positiveArea(m,g,y,x,E,T))break t}break}if(0==u){do{if(!a[s])break;s--}while(s>0);break}l=s,s=u,u=(u+1)%i}h.push(r[(i+s-1)%i]),h.push(r[s]),h.push(r[(s+1)%i]),r.splice(s,1),a.splice(s,1);var A=(--i+s-1)%i,b=s==i?0:s;a[A]=e.isConcave(A,i,n,r),a[b]=e.isConcave(b,i,n,r)}return 3==i&&(h.push(r[2]),h.push(r[0]),h.push(r[1])),h},e.prototype.decompose=function(t,n){var i=t,r=this.convexPolygons;this.polygonPool.freeAll(r),r.length=0;var s=this.convexPolygonsIndices;this.polygonIndicesPool.freeAll(s),s.length=0;var a=this.polygonIndicesPool.obtain();a.length=0;var o=this.polygonPool.obtain();o.length=0;for(var h=-1,l=0,u=0,c=n.length;u<c;u+=3){var f=n[u]<<1,d=n[u+1]<<1,p=n[u+2]<<1,v=i[f],m=i[f+1],g=i[d],y=i[d+1],x=i[p],w=i[p+1],M=!1;if(h==f){var E=o.length-4,T=e.winding(o[E],o[E+1],o[E+2],o[E+3],x,w),A=e.winding(x,w,o[0],o[1],o[2],o[3]);T==l&&A==l&&(o.push(x),o.push(w),a.push(p),M=!0)}M||(o.length>0?(r.push(o),s.push(a)):(this.polygonPool.free(o),this.polygonIndicesPool.free(a)),(o=this.polygonPool.obtain()).length=0,o.push(v),o.push(m),o.push(g),o.push(y),o.push(x),o.push(w),(a=this.polygonIndicesPool.obtain()).length=0,a.push(f),a.push(d),a.push(p),l=e.winding(v,m,g,y,x,w),h=f)}o.length>0&&(r.push(o),s.push(a));for(u=0,c=r.length;u<c;u++)if(0!=(a=s[u]).length)for(var b=a[0],R=a[a.length-1],I=(o=r[u])[E=o.length-4],S=o[E+1],C=o[E+2],P=o[E+3],k=o[0],V=o[1],F=o[2],O=o[3],L=e.winding(I,S,C,P,k,V),_=0;_<c;_++)if(_!=u){var N=s[_];if(3==N.length){var D=N[0],Y=N[1],X=N[2],U=r[_];x=U[U.length-2],w=U[U.length-1];if(D==b&&Y==R){T=e.winding(I,S,C,P,x,w),A=e.winding(x,w,k,V,F,O);T==L&&A==L&&(U.length=0,N.length=0,o.push(x),o.push(w),a.push(X),I=C,S=P,C=x,P=w,_=0)}}}for(u=r.length-1;u>=0;u--)0==(o=r[u]).length&&(r.splice(u,1),this.polygonPool.free(o),a=s[u],s.splice(u,1),this.polygonIndicesPool.free(a));return r},e.isConcave=function(t,e,n,i){var r=i[(e+t-1)%e]<<1,s=i[t]<<1,a=i[(t+1)%e]<<1;return!this.positiveArea(n[r],n[r+1],n[s],n[s+1],n[a],n[a+1])},e.positiveArea=function(t,e,n,i,r,s){return t*(s-i)+n*(e-s)+r*(i-e)>=0},e.winding=function(t,e,n,i,r,s){var a=n-t,o=i-e;return r*o-s*a+a*e-t*o>=0?1:-1},e}();t.Triangulator=e}(i||(i={})),function(t){var e=function(){function t(){this.array=new Array}return t.prototype.add=function(t){var e=this.contains(t);return this.array[0|t]=0|t,!e},t.prototype.contains=function(t){return void 0!=this.array[0|t]},t.prototype.remove=function(t){this.array[0|t]=void 0},t.prototype.clear=function(){this.array.length=0},t}();t.IntSet=e;var n=function(){function t(t,e,n,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=0),this.r=t,this.g=e,this.b=n,this.a=i}return t.prototype.set=function(t,e,n,i){return this.r=t,this.g=e,this.b=n,this.a=i,this.clamp(),this},t.prototype.setFromColor=function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this},t.prototype.setFromString=function(t){return t="#"==t.charAt(0)?t.substr(1):t,this.r=parseInt(t.substr(0,2),16)/255,this.g=parseInt(t.substr(2,2),16)/255,this.b=parseInt(t.substr(4,2),16)/255,this.a=(8!=t.length?255:parseInt(t.substr(6,2),16))/255,this},t.prototype.add=function(t,e,n,i){return this.r+=t,this.g+=e,this.b+=n,this.a+=i,this.clamp(),this},t.prototype.clamp=function(){return this.r<0?this.r=0:this.r>1&&(this.r=1),this.g<0?this.g=0:this.g>1&&(this.g=1),this.b<0?this.b=0:this.b>1&&(this.b=1),this.a<0?this.a=0:this.a>1&&(this.a=1),this},t.rgba8888ToColor=function(t,e){t.r=((4278190080&e)>>>24)/255,t.g=((16711680&e)>>>16)/255,t.b=((65280&e)>>>8)/255,t.a=(255&e)/255},t.rgb888ToColor=function(t,e){t.r=((16711680&e)>>>16)/255,t.g=((65280&e)>>>8)/255,t.b=(255&e)/255},t.WHITE=new t(1,1,1,1),t.RED=new t(1,0,0,1),t.GREEN=new t(0,1,0,1),t.BLUE=new t(0,0,1,1),t.MAGENTA=new t(1,0,1,1),t}();t.Color=n;var i=function(){function t(){}return t.clamp=function(t,e,n){return t<e?e:t>n?n:t},t.cosDeg=function(e){return Math.cos(e*t.degRad)},t.sinDeg=function(e){return Math.sin(e*t.degRad)},t.signum=function(t){return t>0?1:t<0?-1:0},t.toInt=function(t){return t>0?Math.floor(t):Math.ceil(t)},t.cbrt=function(t){var e=Math.pow(Math.abs(t),1/3);return t<0?-e:e},t.randomTriangular=function(e,n){return t.randomTriangularWith(e,n,.5*(e+n))},t.randomTriangularWith=function(t,e,n){var i=Math.random(),r=e-t;return i<=(n-t)/r?t+Math.sqrt(i*r*(n-t)):e-Math.sqrt((1-i)*r*(e-n))},t.PI=3.1415927,t.PI2=2*t.PI,t.radiansToDegrees=180/t.PI,t.radDeg=t.radiansToDegrees,t.degreesToRadians=t.PI/180,t.degRad=t.degreesToRadians,t}();t.MathUtils=i;var s=function(){function t(){}return t.prototype.apply=function(t,e,n){return t+(e-t)*this.applyInternal(n)},t}();t.Interpolation=s;var a=function(t){function e(e){var n=t.call(this)||this;return n.power=2,n.power=e,n}return r(e,t),e.prototype.applyInternal=function(t){return t<=.5?Math.pow(2*t,this.power)/2:Math.pow(2*(t-1),this.power)/(this.power%2==0?-2:2)+1},e}(s);t.Pow=a;var o=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.applyInternal=function(t){return Math.pow(t-1,this.power)*(this.power%2==0?-1:1)+1},e}(a);t.PowOut=o;var h=function(){function t(){}return t.arrayCopy=function(t,e,n,i,r){for(var s=e,a=i;s<e+r;s++,a++)n[a]=t[s]},t.setArraySize=function(t,e,n){void 0===n&&(n=0);var i=t.length;if(i==e)return t;if(t.length=e,i<e)for(var r=i;r<e;r++)t[r]=n;return t},t.ensureArrayCapacity=function(e,n,i){return void 0===i&&(i=0),e.length>=n?e:t.setArraySize(e,n,i)},t.newArray=function(t,e){for(var n=new Array(t),i=0;i<t;i++)n[i]=e;return n},t.newFloatArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Float32Array(e);for(var n=new Array(e),i=0;i<n.length;i++)n[i]=0;return n},t.newShortArray=function(e){if(t.SUPPORTS_TYPED_ARRAYS)return new Int16Array(e);for(var n=new Array(e),i=0;i<n.length;i++)n[i]=0;return n},t.toFloatArray=function(e){return t.SUPPORTS_TYPED_ARRAYS?new Float32Array(e):e},t.toSinglePrecision=function(e){return t.SUPPORTS_TYPED_ARRAYS?Math.fround(e):e},t.webkit602BugfixHelper=function(t,e){},t.contains=function(t,e,n){void 0===n&&(n=!0);for(var i=0;i<t.length;i++)if(t[i]==e)return!0;return!1},t.SUPPORTS_TYPED_ARRAYS="undefined"!=typeof Float32Array,t}();t.Utils=h;var l=function(){function t(){}return t.logBones=function(t){for(var e=0;e<t.bones.length;e++){var n=t.bones[e];console.log(n.data.name+", "+n.a+", "+n.b+", "+n.c+", "+n.d+", "+n.worldX+", "+n.worldY)}},t}();t.DebugUtils=l;var u=function(){function t(t){this.items=new Array,this.instantiator=t}return t.prototype.obtain=function(){return this.items.length>0?this.items.pop():this.instantiator()},t.prototype.free=function(t){t.reset&&t.reset(),this.items.push(t)},t.prototype.freeAll=function(t){for(var e=0;e<t.length;e++)t[e].reset&&t[e].reset(),this.items[e]=t[e]},t.prototype.clear=function(){this.items.length=0},t}();t.Pool=u;var c=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.set=function(t,e){return this.x=t,this.y=e,this},t.prototype.length=function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},t.prototype.normalize=function(){var t=this.length();return 0!=t&&(this.x/=t,this.y/=t),this},t}();t.Vector2=c;var f=function(){function t(){this.maxDelta=.064,this.framesPerSecond=0,this.delta=0,this.totalTime=0,this.lastTime=Date.now()/1e3,this.frameCount=0,this.frameTime=0}return t.prototype.update=function(){var t=Date.now()/1e3;this.delta=t-this.lastTime,this.frameTime+=this.delta,this.totalTime+=this.delta,this.delta>this.maxDelta&&(this.delta=this.maxDelta),this.lastTime=t,this.frameCount++,this.frameTime>1&&(this.framesPerSecond=this.frameCount/this.frameTime,this.frameTime=0,this.frameCount=0)},t}();t.TimeKeeper=f;var d=function(){function t(t){void 0===t&&(t=32),this.addedValues=0,this.lastValue=0,this.mean=0,this.dirty=!0,this.values=new Array(t)}return t.prototype.hasEnoughData=function(){return this.addedValues>=this.values.length},t.prototype.addValue=function(t){this.addedValues<this.values.length&&this.addedValues++,this.values[this.lastValue++]=t,this.lastValue>this.values.length-1&&(this.lastValue=0),this.dirty=!0},t.prototype.getMean=function(){if(this.hasEnoughData()){if(this.dirty){for(var t=0,e=0;e<this.values.length;e++)t+=this.values[e];this.mean=t/this.values.length,this.dirty=!1}return this.mean}return 0},t}();t.WindowedMean=d}(i||(i={})),Math.fround||(Math.fround=(n=new Float32Array(1),function(t){return n[0]=t,n[0]})),function(t){var e=function(){return function(t){if(null==t)throw new Error("name cannot be null.");this.name=t}}();t.Attachment=e;var n=function(e){function n(t){var i=e.call(this,t)||this;return i.id=(65535&n.nextID++)<<11,i.worldVerticesLength=0,i.deformAttachment=i,i}return r(n,e),n.prototype.computeWorldVertices=function(t,e,n,i,r,s){n=r+(n>>1)*s;var a=t.bone.skeleton,o=t.deform,h=this.vertices,l=this.bones;if(null!=l){for(var u=0,c=0,f=0;f<e;f+=2){u+=(m=l[u])+1,c+=m}var d=a.bones;if(0==o.length)for(S=r,A=3*c;S<n;S+=s){var p=0,v=0,m=l[u++];for(m+=u;u<m;u++,A+=3){w=d[l[u]],C=h[A],P=h[A+1];var g=h[A+2];p+=(C*w.a+P*w.b+w.worldX)*g,v+=(C*w.c+P*w.d+w.worldY)*g}i[S]=p,i[S+1]=v}else for(var y=o,x=(S=r,A=3*c,c<<1);S<n;S+=s){p=0,v=0,m=l[u++];for(m+=u;u<m;u++,A+=3,x+=2){w=d[l[u]],C=h[A]+y[x],P=h[A+1]+y[x+1],g=h[A+2];p+=(C*w.a+P*w.b+w.worldX)*g,v+=(C*w.c+P*w.d+w.worldY)*g}i[S]=p,i[S+1]=v}}else{o.length>0&&(h=o);for(var w,M=(w=t.bone).worldX,E=w.worldY,T=w.a,A=w.b,b=w.c,R=w.d,I=e,S=r;S<n;I+=2,S+=s){var C=h[I],P=h[I+1];i[S]=C*T+P*A+M,i[S+1]=C*b+P*R+E}}},n.prototype.copyTo=function(e){null!=this.bones?(e.bones=new Array(this.bones.length),t.Utils.arrayCopy(this.bones,0,e.bones,0,this.bones.length)):e.bones=null,null!=this.vertices?(e.vertices=t.Utils.newFloatArray(this.vertices.length),t.Utils.arrayCopy(this.vertices,0,e.vertices,0,this.vertices.length)):e.vertices=null,e.worldVerticesLength=this.worldVerticesLength,e.deformAttachment=this.deformAttachment},n.nextID=0,n}(e);t.VertexAttachment=n}(i||(i={})),function(t){!function(t){t[t.Region=0]="Region",t[t.BoundingBox=1]="BoundingBox",t[t.Mesh=2]="Mesh",t[t.LinkedMesh=3]="LinkedMesh",t[t.Path=4]="Path",t[t.Point=5]="Point",t[t.Clipping=6]="Clipping"}(t.AttachmentType||(t.AttachmentType={}))}(i||(i={})),function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.color=new t.Color(1,1,1,1),i}return r(n,e),n.prototype.copy=function(){var t=new n(name);return this.copyTo(t),t.color.setFromColor(this.color),t},n}(t.VertexAttachment);t.BoundingBoxAttachment=e}(i||(i={})),function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.color=new t.Color(.2275,.2275,.8078,1),i}return r(n,e),n.prototype.copy=function(){var t=new n(name);return this.copyTo(t),t.endSlot=this.endSlot,t.color.setFromColor(this.color),t},n}(t.VertexAttachment);t.ClippingAttachment=e}(i||(i={})),function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.color=new t.Color(1,1,1,1),i.tempColor=new t.Color(0,0,0,0),i}return r(n,e),n.prototype.updateUVs=function(){var e=this.regionUVs;null!=this.uvs&&this.uvs.length==e.length||(this.uvs=t.Utils.newFloatArray(e.length));var n=this.uvs,i=this.uvs.length,r=this.region.u,s=this.region.v,a=0,o=0;if(this.region instanceof t.TextureAtlasRegion){var h=this.region,l=h.texture.getImage().width,u=h.texture.getImage().height;switch(h.degrees){case 90:r-=(h.originalHeight-h.offsetY-h.height)/l,s-=(h.originalWidth-h.offsetX-h.width)/u,a=h.originalHeight/l,o=h.originalWidth/u;for(var c=0;c<i;c+=2)n[c]=r+e[c+1]*a,n[c+1]=s+(1-e[c])*o;return;case 180:r-=(h.originalWidth-h.offsetX-h.width)/l,s-=h.offsetY/u,a=h.originalWidth/l,o=h.originalHeight/u;for(c=0;c<i;c+=2)n[c]=r+(1-e[c])*a,n[c+1]=s+(1-e[c+1])*o;return;case 270:r-=h.offsetY/l,s-=h.offsetX/u,a=h.originalHeight/l,o=h.originalWidth/u;for(c=0;c<i;c+=2)n[c]=r+(1-e[c+1])*a,n[c+1]=s+e[c]*o;return}r-=h.offsetX/l,s-=(h.originalHeight-h.offsetY-h.height)/u,a=h.originalWidth/l,o=h.originalHeight/u}else null==this.region?(r=s=0,a=o=1):(a=this.region.u2-r,o=this.region.v2-s);for(c=0;c<i;c+=2)n[c]=r+e[c]*a,n[c+1]=s+e[c+1]*o},n.prototype.getParentMesh=function(){return this.parentMesh},n.prototype.setParentMesh=function(t){this.parentMesh=t,null!=t&&(this.bones=t.bones,this.vertices=t.vertices,this.worldVerticesLength=t.worldVerticesLength,this.regionUVs=t.regionUVs,this.triangles=t.triangles,this.hullLength=t.hullLength,this.worldVerticesLength=t.worldVerticesLength)},n.prototype.copy=function(){if(null!=this.parentMesh)return this.newLinkedMesh();var e=new n(this.name);return e.region=this.region,e.path=this.path,e.color.setFromColor(this.color),this.copyTo(e),e.regionUVs=new Array(this.regionUVs.length),t.Utils.arrayCopy(this.regionUVs,0,e.regionUVs,0,this.regionUVs.length),e.uvs=new Array(this.uvs.length),t.Utils.arrayCopy(this.uvs,0,e.uvs,0,this.uvs.length),e.triangles=new Array(this.triangles.length),t.Utils.arrayCopy(this.triangles,0,e.triangles,0,this.triangles.length),e.hullLength=this.hullLength,null!=this.edges&&(e.edges=new Array(this.edges.length),t.Utils.arrayCopy(this.edges,0,e.edges,0,this.edges.length)),e.width=this.width,e.height=this.height,e},n.prototype.newLinkedMesh=function(){var t=new n(this.name);return t.region=this.region,t.path=this.path,t.color.setFromColor(this.color),t.deformAttachment=this.deformAttachment,t.setParentMesh(null!=this.parentMesh?this.parentMesh:this),t.updateUVs(),t},n}(t.VertexAttachment);t.MeshAttachment=e}(i||(i={})),function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.closed=!1,i.constantSpeed=!1,i.color=new t.Color(1,1,1,1),i}return r(n,e),n.prototype.copy=function(){var e=new n(name);return this.copyTo(e),e.lengths=new Array(this.lengths.length),t.Utils.arrayCopy(this.lengths,0,e.lengths,0,this.lengths.length),e.closed=closed,e.constantSpeed=this.constantSpeed,e.color.setFromColor(this.color),e},n}(t.VertexAttachment);t.PathAttachment=e}(i||(i={})),function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.color=new t.Color(.38,.94,0,1),i}return r(n,e),n.prototype.computeWorldPosition=function(t,e){return e.x=this.x*t.a+this.y*t.b+t.worldX,e.y=this.x*t.c+this.y*t.d+t.worldY,e},n.prototype.computeWorldRotation=function(e){var n=t.MathUtils.cosDeg(this.rotation),i=t.MathUtils.sinDeg(this.rotation),r=n*e.a+i*e.b,s=n*e.c+i*e.d;return Math.atan2(s,r)*t.MathUtils.radDeg},n.prototype.copy=function(){var t=new n(name);return t.x=this.x,t.y=this.y,t.rotation=this.rotation,t.color.setFromColor(this.color),t},n}(t.VertexAttachment);t.PointAttachment=e}(i||(i={})),function(t){var e=function(e){function n(n){var i=e.call(this,n)||this;return i.x=0,i.y=0,i.scaleX=1,i.scaleY=1,i.rotation=0,i.width=0,i.height=0,i.color=new t.Color(1,1,1,1),i.offset=t.Utils.newFloatArray(8),i.uvs=t.Utils.newFloatArray(8),i.tempColor=new t.Color(1,1,1,1),i}return r(n,e),n.prototype.updateOffset=function(){var t=this.width/this.region.originalWidth*this.scaleX,e=this.height/this.region.originalHeight*this.scaleY,i=-this.width/2*this.scaleX+this.region.offsetX*t,r=-this.height/2*this.scaleY+this.region.offsetY*e,s=i+this.region.width*t,a=r+this.region.height*e,o=this.rotation*Math.PI/180,h=Math.cos(o),l=Math.sin(o),u=i*h+this.x,c=i*l,f=r*h+this.y,d=r*l,p=s*h+this.x,v=s*l,m=a*h+this.y,g=a*l,y=this.offset;y[n.OX1]=u-d,y[n.OY1]=f+c,y[n.OX2]=u-g,y[n.OY2]=m+c,y[n.OX3]=p-g,y[n.OY3]=m+v,y[n.OX4]=p-d,y[n.OY4]=f+v},n.prototype.setRegion=function(t){this.region=t;var e=this.uvs;t.rotate?(e[2]=t.u,e[3]=t.v2,e[4]=t.u,e[5]=t.v,e[6]=t.u2,e[7]=t.v,e[0]=t.u2,e[1]=t.v2):(e[0]=t.u,e[1]=t.v2,e[2]=t.u,e[3]=t.v,e[4]=t.u2,e[5]=t.v,e[6]=t.u2,e[7]=t.v2)},n.prototype.computeWorldVertices=function(t,e,i,r){var s=this.offset,a=t.worldX,o=t.worldY,h=t.a,l=t.b,u=t.c,c=t.d,f=0,d=0;f=s[n.OX1],d=s[n.OY1],e[i]=f*h+d*l+a,e[i+1]=f*u+d*c+o,i+=r,f=s[n.OX2],d=s[n.OY2],e[i]=f*h+d*l+a,e[i+1]=f*u+d*c+o,i+=r,f=s[n.OX3],d=s[n.OY3],e[i]=f*h+d*l+a,e[i+1]=f*u+d*c+o,i+=r,f=s[n.OX4],d=s[n.OY4],e[i]=f*h+d*l+a,e[i+1]=f*u+d*c+o},n.prototype.copy=function(){var e=new n(name);return e.region=this.region,e.rendererObject=this.rendererObject,e.path=this.path,e.x=this.x,e.y=this.y,e.scaleX=this.scaleX,e.scaleY=this.scaleY,e.rotation=this.rotation,e.width=this.width,e.height=this.height,t.Utils.arrayCopy(this.uvs,0,e.uvs,0,8),t.Utils.arrayCopy(this.offset,0,e.offset,0,8),e.color.setFromColor(this.color),e},n.OX1=0,n.OY1=1,n.OX2=2,n.OY2=3,n.OX3=4,n.OY3=5,n.OX4=6,n.OY4=7,n.X1=0,n.Y1=1,n.C1R=2,n.C1G=3,n.C1B=4,n.C1A=5,n.U1=6,n.V1=7,n.X2=8,n.Y2=9,n.C2R=10,n.C2G=11,n.C2B=12,n.C2A=13,n.U2=14,n.V2=15,n.X3=16,n.Y3=17,n.C3R=18,n.C3G=19,n.C3B=20,n.C3A=21,n.U3=22,n.V3=23,n.X4=24,n.Y4=25,n.C4R=26,n.C4G=27,n.C4B=28,n.C4A=29,n.U4=30,n.V4=31,n}(t.Attachment);t.RegionAttachment=e}(i||(i={})),function(t){var e=function(){function e(t,e){this.jitterX=0,this.jitterY=0,this.jitterX=t,this.jitterY=e}return e.prototype.begin=function(t){},e.prototype.transform=function(e,n,i,r){e.x+=t.MathUtils.randomTriangular(-this.jitterX,this.jitterY),e.y+=t.MathUtils.randomTriangular(-this.jitterX,this.jitterY)},e.prototype.end=function(){},e}();t.JitterEffect=e}(i||(i={})),function(t){var e=function(){function e(t){this.centerX=0,this.centerY=0,this.radius=0,this.angle=0,this.worldX=0,this.worldY=0,this.radius=t}return e.prototype.begin=function(t){this.worldX=t.x+this.centerX,this.worldY=t.y+this.centerY},e.prototype.transform=function(n,i,r,s){var a=this.angle*t.MathUtils.degreesToRadians,o=n.x-this.worldX,h=n.y-this.worldY,l=Math.sqrt(o*o+h*h);if(l<this.radius){var u=e.interpolation.apply(0,a,(this.radius-l)/this.radius),c=Math.cos(u),f=Math.sin(u);n.x=c*o-f*h+this.worldX,n.y=f*o+c*h+this.worldY}},e.prototype.end=function(){},e.interpolation=new t.PowOut(2),e}();t.SwirlEffect=e}(i||(i={})),function(t){!function(e){var n=function(e){function n(n){return void 0===n&&(n=""),e.call(this,function(e){return new t.canvas.CanvasTexture(e)},n)||this}return r(n,e),n}(t.AssetManager);e.AssetManager=n}(t.canvas||(t.canvas={}))}(i||(i={})),function(t){!function(e){var n=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.setFilters=function(t,e){},e.prototype.setWraps=function(t,e){},e.prototype.dispose=function(){},e}(t.Texture);e.CanvasTexture=n}(t.canvas||(t.canvas={}))}(i||(i={})),function(t){!function(e){var n=function(){function e(e){this.triangleRendering=!1,this.debugRendering=!1,this.vertices=t.Utils.newFloatArray(8192),this.tempColor=new t.Color,this.ctx=e}return e.prototype.draw=function(t){this.triangleRendering?this.drawTriangles(t):this.drawImages(t)},e.prototype.drawImages=function(e){var n=this.ctx,i=e.drawOrder;this.debugRendering&&(n.strokeStyle="green"),n.save();for(var r=0,s=i.length;r<s;r++){var a=i[r];if(a.bone.active){var o=a.getAttachment(),h=null,l=null,u=null;if(o instanceof t.RegionAttachment){u=(l=(h=o).region).texture.getImage();var c=a.bone.skeleton.color,f=a.color,d=h.color,p=c.a*f.a*d.a,v=this.tempColor;v.set(c.r*f.r*d.r,c.g*f.g*d.g,c.b*f.b*d.b,p);var m=o,g=a.bone,y=l.width,x=l.height;n.save(),n.transform(g.a,g.c,g.b,g.d,g.worldX,g.worldY),n.translate(o.offset[0],o.offset[1]),n.rotate(o.rotation*Math.PI/180);var w=m.width/y;if(n.scale(w*o.scaleX,w*o.scaleY),n.translate(y/2,x/2),o.region.rotate){var M=y;y=x,x=M,n.rotate(-Math.PI/2)}n.scale(1,-1),n.translate(-y/2,-x/2),1==v.r&&1==v.g&&1==v.b&&1==v.a||(n.globalAlpha=v.a),n.drawImage(u,l.x,l.y,y,x,0,0,y,x),this.debugRendering&&n.strokeRect(0,0,y,x),n.restore()}}}n.restore()},e.prototype.drawTriangles=function(n){for(var i=null,r=this.vertices,s=null,a=n.drawOrder,o=0,h=a.length;o<h;o++){var l=a[o],u=l.getAttachment(),c=null;if(u instanceof t.RegionAttachment){var f=u;r=this.computeRegionVertices(l,f,!1),s=e.QUAD_TRIANGLES,c=f.region.texture.getImage()}else{if(!(u instanceof t.MeshAttachment))continue;var d=u;r=this.computeMeshVertices(l,d,!1),s=d.triangles,c=d.region.renderObject.texture.getImage()}if(null!=c){var p=l.data.blendMode;p!=i&&(i=p);var v=l.bone.skeleton.color,m=l.color,g=u.color,y=v.a*m.a*g.a,x=this.tempColor;x.set(v.r*m.r*g.r,v.g*m.g*g.g,v.b*m.b*g.b,y);var w=this.ctx;1==x.r&&1==x.g&&1==x.b&&1==x.a||(w.globalAlpha=x.a);for(var M=0;M<s.length;M+=3){var E=8*s[M],T=8*s[M+1],A=8*s[M+2],b=r[E],R=r[E+1],I=r[E+6],S=r[E+7],C=r[T],P=r[T+1],k=r[T+6],V=r[T+7],F=r[A],O=r[A+1],L=r[A+6],_=r[A+7];this.drawTriangle(c,b,R,I,S,C,P,k,V,F,O,L,_),this.debugRendering&&(w.strokeStyle="green",w.beginPath(),w.moveTo(b,R),w.lineTo(C,P),w.lineTo(F,O),w.lineTo(b,R),w.stroke())}}}this.ctx.globalAlpha=1},e.prototype.drawTriangle=function(t,e,n,i,r,s,a,o,h,l,u,c,f){var d=this.ctx;i*=t.width,r*=t.height,o*=t.width,h*=t.height,c*=t.width,f*=t.height,d.beginPath(),d.moveTo(e,n),d.lineTo(s,a),d.lineTo(l,u),d.closePath();var p=1/((o-=i)*(f-=r)-(c-=i)*(h-=r)),v=(f*(s-=e)-h*(l-=e))*p,m=(f*(a-=n)-h*(u-=n))*p,g=(o*l-c*s)*p,y=(o*u-c*a)*p,x=e-v*i-g*r,w=n-m*i-y*r;d.save(),d.transform(v,m,g,y,x,w),d.clip(),d.drawImage(t,0,0),d.restore()},e.prototype.computeRegionVertices=function(n,i,r){var s=n.bone.skeleton.color,a=n.color,o=i.color,h=s.a*a.a*o.a,l=r?h:1,u=this.tempColor;u.set(s.r*a.r*o.r*l,s.g*a.g*o.g*l,s.b*a.b*o.b*l,h),i.computeWorldVertices(n.bone,this.vertices,0,e.VERTEX_SIZE);var c=this.vertices,f=i.uvs;return c[t.RegionAttachment.C1R]=u.r,c[t.RegionAttachment.C1G]=u.g,c[t.RegionAttachment.C1B]=u.b,c[t.RegionAttachment.C1A]=u.a,c[t.RegionAttachment.U1]=f[0],c[t.RegionAttachment.V1]=f[1],c[t.RegionAttachment.C2R]=u.r,c[t.RegionAttachment.C2G]=u.g,c[t.RegionAttachment.C2B]=u.b,c[t.RegionAttachment.C2A]=u.a,c[t.RegionAttachment.U2]=f[2],c[t.RegionAttachment.V2]=f[3],c[t.RegionAttachment.C3R]=u.r,c[t.RegionAttachment.C3G]=u.g,c[t.RegionAttachment.C3B]=u.b,c[t.RegionAttachment.C3A]=u.a,c[t.RegionAttachment.U3]=f[4],c[t.RegionAttachment.V3]=f[5],c[t.RegionAttachment.C4R]=u.r,c[t.RegionAttachment.C4G]=u.g,c[t.RegionAttachment.C4B]=u.b,c[t.RegionAttachment.C4A]=u.a,c[t.RegionAttachment.U4]=f[6],c[t.RegionAttachment.V4]=f[7],c},e.prototype.computeMeshVertices=function(n,i,r){var s=n.bone.skeleton.color,a=n.color,o=i.color,h=s.a*a.a*o.a,l=r?h:1,u=this.tempColor;u.set(s.r*a.r*o.r*l,s.g*a.g*o.g*l,s.b*a.b*o.b*l,h);var c=i.worldVerticesLength/2;this.vertices.length<i.worldVerticesLength&&(this.vertices=t.Utils.newFloatArray(i.worldVerticesLength));var f=this.vertices;i.computeWorldVertices(n,0,i.worldVerticesLength,f,0,e.VERTEX_SIZE);for(var d=i.uvs,p=0,v=c,m=0,g=2;p<v;p++)f[g++]=u.r,f[g++]=u.g,f[g++]=u.b,f[g++]=u.a,f[g++]=d[m++],f[g++]=d[m++],g+=2;return f},e.QUAD_TRIANGLES=[0,1,2,2,3,0],e.VERTEX_SIZE=8,e}();e.SkeletonRenderer=n}(t.canvas||(t.canvas={}))}(i||(i={})),t.exports=i}).call(window)},function(t,e,n){var i=n(0),r=n(3),s=n(168),a=n(2),o=n(182),h=n(183),l=n(184),u=new i({Extends:h,initialize:function(t,e,n,i,s,u,c){var f,d,p,v=[],m=t.cacheManager.custom.spine;if(a(e)){var g=e;for(e=r(g,"key"),d=new o(t,{key:e,url:r(g,"jsonURL"),extension:r(g,"jsonExtension","json"),xhrSettings:r(g,"jsonXhrSettings")}),i=r(g,"atlasURL"),s=r(g,"preMultipliedAlpha"),Array.isArray(i)||(i=[i]),f=0;f<i.length;f++)(p=new l(t,{key:e,url:i[f],extension:r(g,"atlasExtension","atlas"),xhrSettings:r(g,"atlasXhrSettings")})).cache=m,v.push(p)}else for(d=new o(t,e,n,u),Array.isArray(i)||(i=[i]),f=0;f<i.length;f++)(p=new l(t,e+"_"+f,i[f],c)).cache=m,v.push(p);v.unshift(d),h.call(this,t,"spine",e,v),this.config.preMultipliedAlpha=s},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"text"===t.type)){for(var e=t.data.split("\n"),n=[],i=0;i<e.length;i++){var a=e[i];""===a.trim()&&i<e.length-1&&(a=e[i+1],n.push(a))}var o=this.config,h=this.loader,l=h.baseURL,u=h.path,c=h.prefix,f=r(o,"baseURL",this.baseURL),d=r(o,"path",this.path),p=r(o,"prefix",this.prefix),v=r(o,"textureXhrSettings");h.setBaseURL(f),h.setPath(d),h.setPrefix(p);for(var m=0;m<n.length;m++){var g=n[m],y="SP"+this.multiKeyIndex+"_"+g,x=new s(h,y,g,v);this.addToMultiFile(x),h.addFile(x)}h.setBaseURL(l),h.setPath(u),h.setPrefix(c)}},addToCache:function(){if(this.isReadyToProcess()){var t;this.files[0].addToCache();for(var e="",n="",i=!!this.config.preMultipliedAlpha,r=1;r<this.files.length;r++){var s=this.files[r];if("text"===s.type)e=s.key.substr(0,s.key.length-2),t=s.cache,n=n.concat(s.data);else{var a=s.key.trim(),o=a.indexOf("_"),h=a.substr(o+1);this.loader.textureManager.addImage(h,s.data)}s.pendingDestroy()}t.add(e,{preMultipliedAlpha:i,data:n}),this.complete=!0}}});t.exports=u},function(t,e,n){var i=n(0),r=n(6),s=n(12),a=n(13),o=n(3),h=n(2),l=new i({Extends:s,initialize:function t(e,n,i,r,a){var l,u="png";if(h(n)){var c=n;n=o(c,"key"),i=o(c,"url"),l=o(c,"normalMap"),r=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"frameConfig")}Array.isArray(i)&&(l=i[1],i=i[0]);var f={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:n,url:i,xhrSettings:r,config:a};if(s.call(this,e,f),l){var d=new t(e,this.key,l,r,a);d.type="normalMap",this.setLink(d),e.addFile(d)}},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===r.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});a.register("image",function(t,e,n){if(Array.isArray(t))for(var i=0;i<t.length;i++)this.addFile(new l(this,t[i]));else this.addFile(new l(this,t,e,n));return this}),t.exports=l},function(t,e,n){t.exports={ADD:n(170),COMPLETE:n(171),FILE_COMPLETE:n(172),FILE_KEY_COMPLETE:n(173),FILE_LOAD_ERROR:n(174),FILE_LOAD:n(175),FILE_PROGRESS:n(176),POST_PROCESS:n(177),PROGRESS:n(178),START:n(179)}},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e,n){var i=n(29);t.exports=function(t,e){var n=i(e,t.xhrSettings),r=new XMLHttpRequest;return r.open("GET",t.src,n.async,n.user,n.password),r.responseType=t.xhrSettings.responseType,r.timeout=n.timeout,n.header&&n.headerValue&&r.setRequestHeader(n.header,n.headerValue),n.requestedWith&&r.setRequestHeader("X-Requested-With",n.requestedWith),n.overrideMimeType&&r.overrideMimeType(n.overrideMimeType),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},function(t,e,n){var i=n(0),r=n(6),s=n(12),a=n(13),o=n(3),h=n(11),l=n(2),u=new i({Extends:s,initialize:function(t,e,n,i,a){var u="json";if(l(e)){var c=e;e=o(c,"key"),n=o(c,"url"),i=o(c,"xhrSettings"),u=o(c,"extension",u),a=o(c,"dataKey",a)}var f={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:n,xhrSettings:i,config:a};s.call(this,t,f),l(n)&&(this.data=a?h(n,a):n,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});a.register("json",function(t,e,n,i){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,i,n));return this}),t.exports=u},function(t,e,n){var i=new(n(0))({initialize:function(t,e,n,i){this.loader=t,this.type=e,this.key=n,this.multiKeyIndex=t.multiKeyIndex++,this.files=i,this.complete=!1,this.pending=i.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var r=0;r<i.length;r++)i[r].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),t.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&this.failed++}});t.exports=i},function(t,e,n){var i=n(0),r=n(6),s=n(12),a=n(13),o=n(3),h=n(2),l=new i({Extends:s,initialize:function(t,e,n,i){var r="txt";if(h(e)){var a=e;e=o(a,"key"),n=o(a,"url"),i=o(a,"xhrSettings"),r=o(a,"extension",r)}var l={type:"text",cache:t.cacheManager.text,extension:r,responseType:"text",key:e,url:n,xhrSettings:i};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});a.register("text",function(t,e,n){if(Array.isArray(t))for(var i=0;i<t.length;i++)this.addFile(new l(this,t[i]));else this.addFile(new l(this,t,e,n));return this}),t.exports=l},function(t,e,n){var i=n(15),r=n(8),s=n(0),a=n(186),o=n(187),h=n(188),l=n(189),u=n(190),c=n(192),f=n(7),d=n(25),p=n(193),v=n(9),m=n(214),g=n(221),y=new s({Extends:p,Mixins:[a,o,h,l,u,c,g],initialize:function(t,e,n,i,r,s,a){p.call(this,t,"Spine"),this.plugin=e,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null,this.root=null,this.bounds=null,this.drawDebug=!1,this.timeScale=1,this.displayOriginX=0,this.displayOriginY=0,this.preMultipliedAlpha=!1,this.blendMode=0,this.setPosition(n,i),r&&this.setSkeleton(r,s,a)},willRender:function(){return!0},setAlpha:function(t,e){if(void 0===t&&(t=1),e){var n=this.findSlot(e);n&&(n.color.a=r(t,0,1))}else this.alpha=t;return this},alpha:{get:function(){return this.skeleton.color.a},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.a=e),0===e?this.renderFlags&=-3:this.renderFlags|=2}},red:{get:function(){return this.skeleton.color.r},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.r=e)}},green:{get:function(){return this.skeleton.color.g},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.g=e)}},blue:{get:function(){return this.skeleton.color.b},set:function(t){var e=r(t,0,1);this.skeleton&&(this.skeleton.color.b=e)}},setColor:function(t,e){void 0===t&&(t=16777215);var n=(t>>16&255)/255,i=(t>>8&255)/255,r=(255&t)/255,s=t>16777215?(t>>>24)/255:null,a=this.skeleton;if(e){var o=this.findSlot(e);o&&(a=o)}return a.color.r=n,a.color.g=i,a.color.b=r,null!==s&&(a.color.a=s),this},setSkeletonFromJSON:function(t,e,n,i){return this.setSkeleton(t,e,n,i)},setSkeleton:function(t,e,n,i){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications());var r=this.plugin.createSkeleton(t,i);this.skeletonData=r.skeletonData,this.preMultipliedAlpha=r.preMultipliedAlpha;var s=r.skeleton;return s.setSkin(),s.setToSetupPose(),this.skeleton=s,r=this.plugin.createAnimationState(s),this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.state=r.state,this.stateData=r.stateData,this.state.addListener({event:this.onEvent.bind(this),complete:this.onComplete.bind(this),start:this.onStart.bind(this),end:this.onEnd.bind(this),dispose:this.onDispose.bind(this),interrupted:this.onInterrupted.bind(this)}),e&&this.setAnimation(0,e,n),this.root=this.getRootBone(),this.root&&(this.root.rotation=v(f(this.rotation))+90),this.state.apply(s),s.updateCache(),this.updateSize()},onComplete:function(t){this.emit(m.COMPLETE,t)},onDispose:function(t){this.emit(m.DISPOSE,t)},onEnd:function(t){this.emit(m.END,t)},onEvent:function(t,e){this.emit(m.EVENT,t,e)},onInterrupted:function(t){this.emit(m.INTERRUPTED,t)},onStart:function(t){this.emit(m.START,t)},refresh:function(){return this.root&&(this.root.rotation=v(f(this.rotation))+90),this.updateSize(),this.skeleton.updateCache(),this},setSize:function(t,e,n,i){var r=this.skeleton;return void 0===t&&(t=r.data.width),void 0===e&&(e=r.data.height),void 0===n&&(n=0),void 0===i&&(i=0),this.width=t,this.height=e,this.displayOriginX=r.x-n,this.displayOriginY=r.y-i,this},setOffset:function(t,e){var n=this.skeleton;return void 0===t&&(t=0),void 0===e&&(e=0),this.displayOriginX=n.x-t,this.displayOriginY=n.y-e,this},updateSize:function(){var t=this.skeleton,e=this.plugin.renderer.height,n=this.scaleX,i=this.scaleY;t.x=this.x,t.y=e-this.y,t.scaleX=1,t.scaleY=1,t.updateWorldTransform();var r=this.getBounds();return this.width=r.size.x,this.height=r.size.y,this.displayOriginX=this.x-r.offset.x,this.displayOriginY=this.y-(e-(this.height+r.offset.y)),t.scaleX=n,t.scaleY=i,t.updateWorldTransform(),this},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,this.refresh()}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,this.refresh()}},getBoneList:function(){var t=[],e=this.skeletonData;if(e)for(var n=0;n<e.bones.length;n++)t.push(e.bones[n].name);return t},getSkinList:function(){var t=[],e=this.skeletonData;if(e)for(var n=0;n<e.skins.length;n++)t.push(e.skins[n].name);return t},getSlotList:function(){for(var t=[],e=this.skeleton,n=0;n<e.slots.length;n++)t.push(e.slots[n].data.name);return t},getAnimationList:function(){var t=[],e=this.skeletonData;if(e)for(var n=0;n<e.animations.length;n++)t.push(e.animations[n].name);return t},getCurrentAnimation:function(t){void 0===t&&(t=0);var e=this.state.getCurrent(t);if(e)return e.animation},play:function(t,e,n){return this.setAnimation(0,t,e,n),this},setAnimation:function(t,e,n,i){if(void 0===n&&(n=!1),void 0===i&&(i=!1),i&&this.state){var r=this.state.getCurrent(0);if(r&&r.animation.name===e&&!r.isComplete())return}if(this.findAnimation(e))return this.state.setAnimation(t,e,n)},addAnimation:function(t,e,n,i){return this.state.addAnimation(t,e,n,i)},setEmptyAnimation:function(t,e){return this.state.setEmptyAnimation(t,e)},clearTrack:function(t){return this.state.clearTrack(t),this},clearTracks:function(){return this.state.clearTracks(),this},setSkinByName:function(t){var e=this.skeleton;return e.setSkinByName(t),e.setSlotsToSetupPose(),this.state.apply(e),this},setSkin:function(t){var e=this.skeleton;return e.setSkin(t),e.setSlotsToSetupPose(),this.state.apply(e),this},setMix:function(t,e,n){return this.stateData.setMix(t,e,n),this},getAttachment:function(t,e){return this.skeleton.getAttachment(t,e)},getAttachmentByName:function(t,e){return this.skeleton.getAttachmentByName(t,e)},setAttachment:function(t,e){if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length)for(var n=0;n<t.length;n++)this.skeleton.setAttachment(t[n],e[n]);else this.skeleton.setAttachment(t,e);return this},setToSetupPose:function(){return this.skeleton.setToSetupPose(),this},setSlotsToSetupPose:function(){return this.skeleton.setSlotsToSetupPose(),this},setBonesToSetupPose:function(){return this.skeleton.setBonesToSetupPose(),this},getRootBone:function(){return this.skeleton.getRootBone()},angleBoneToXY:function(t,e,n,s,a,o){void 0===s&&(s=0),void 0===a&&(a=0),void 0===o&&(o=360);var h=this.plugin.renderer.height,l=f(i(t.worldX,h-t.worldY,e,n)+d(s));return t.rotation=r(v(l),a,o),this},findBone:function(t){return this.skeleton.findBone(t)},findBoneIndex:function(t){return this.skeleton.findBoneIndex(t)},findSlot:function(t){return this.skeleton.findSlot(t)},findSlotIndex:function(t){return this.skeleton.findSlotIndex(t)},findSkin:function(t){return this.skeletonData.findSkin(t)},findEvent:function(t){return this.skeletonData.findEvent(t)},findAnimation:function(t){return this.skeletonData.findAnimation(t)},findIkConstraint:function(t){return this.skeletonData.findIkConstraint(t)},findTransformConstraint:function(t){return this.skeletonData.findTransformConstraint(t)},findPathConstraint:function(t){return this.skeletonData.findPathConstraint(t)},findPathConstraintIndex:function(t){return this.skeletonData.findPathConstraintIndex(t)},getBounds:function(){return this.plugin.getBounds(this.skeleton)},preUpdate:function(t,e){var n=this.skeleton;this.state.update(e/1e3*this.timeScale),this.state.apply(n)},preDestroy:function(){this.state&&(this.state.clearListeners(),this.state.clearListenerNotifications()),this.plugin=null,this.skeleton=null,this.skeletonData=null,this.state=null,this.stateData=null}});t.exports=y},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){var n={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=n},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e){var n={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=n},function(t,e,n){var i=n(1),r=n(191),s=n(17),a=n(18),o={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*i.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*i.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=s(t)}},setPosition:function(t,e,n,i){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===n&&(n=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=n,this.w=i,this},setRandomPosition:function(t,e,n,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=this.scene.sys.scale.width),void 0===i&&(i=this.scene.sys.scale.height),this.x=t+Math.random()*n,this.y=e+Math.random()*i,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var n=this.parentContainer;if(!n)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);n;)e.applyITRS(n.x,n.y,n._rotation,n._scaleX,n._scaleY),e.multiply(t,t),n=n.parentContainer;return t},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=o},function(t,e,n){var i=n(0),r=n(1),s=n(5),a=new i({initialize:function(t,e,n,i,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===n&&(n=0),void 0===i&&(i=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,n,i,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],n=t[1],i=t[2],s=t[3];return e||n?n>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):i||s?r.TAU-(s>0?Math.acos(-i/this.scaleY):-Math.acos(i/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var n=this.matrix;return n[4]=n[0]*t+n[2]*e+n[4],n[5]=n[1]*t+n[3]*e+n[5],this},scale:function(t,e){var n=this.matrix;return n[0]*=t,n[1]*=t,n[2]*=e,n[3]*=e,this},rotate:function(t){var e=Math.sin(t),n=Math.cos(t),i=this.matrix,r=i[0],s=i[1],a=i[2],o=i[3];return i[0]=r*n+a*e,i[1]=s*n+o*e,i[2]=r*-e+a*n,i[3]=s*-e+o*n,this},multiply:function(t,e){var n=this.matrix,i=t.matrix,r=n[0],s=n[1],a=n[2],o=n[3],h=n[4],l=n[5],u=i[0],c=i[1],f=i[2],d=i[3],p=i[4],v=i[5],m=void 0===e?this:e;return m.a=u*r+c*a,m.b=u*s+c*o,m.c=f*r+d*a,m.d=f*s+d*o,m.e=p*r+v*a+h,m.f=p*s+v*o+l,m},multiplyWithOffset:function(t,e,n){var i=this.matrix,r=t.matrix,s=i[0],a=i[1],o=i[2],h=i[3],l=e*s+n*o+i[4],u=e*a+n*h+i[5],c=r[0],f=r[1],d=r[2],p=r[3],v=r[4],m=r[5];return i[0]=c*s+f*o,i[1]=c*a+f*h,i[2]=d*s+p*o,i[3]=d*a+p*h,i[4]=v*s+m*o+l,i[5]=v*a+m*h+u,this},transform:function(t,e,n,i,r,s){var a=this.matrix,o=a[0],h=a[1],l=a[2],u=a[3],c=a[4],f=a[5];return a[0]=t*o+e*l,a[1]=t*h+e*u,a[2]=n*o+i*l,a[3]=n*h+i*u,a[4]=r*o+s*l+c,a[5]=r*h+s*u+f,this},transformPoint:function(t,e,n){void 0===n&&(n={x:0,y:0});var i=this.matrix,r=i[0],s=i[1],a=i[2],o=i[3],h=i[4],l=i[5];return n.x=t*r+e*a+h,n.y=t*s+e*o+l,n},invert:function(){var t=this.matrix,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=e*r-n*i;return t[0]=r/o,t[1]=-n/o,t[2]=-i/o,t[3]=e/o,t[4]=(i*a-r*s)/o,t[5]=-(e*a-n*s)/o,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,n,i,r,s){var a=this.matrix;return a[0]=t,a[1]=e,a[2]=n,a[3]=i,a[4]=r,a[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,n=e[0],i=e[1],r=e[2],s=e[3],a=n*s-i*r;if(t.translateX=e[4],t.translateY=e[5],n||i){var o=Math.sqrt(n*n+i*i);t.rotation=i>0?Math.acos(n/o):-Math.acos(n/o),t.scaleX=o,t.scaleY=a/o}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=a/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,n,i,r){var s=this.matrix,a=Math.sin(n),o=Math.cos(n);return s[4]=t,s[5]=e,s[0]=o*i,s[1]=a*i,s[2]=-a*r,s[3]=o*r,this},applyInverse:function(t,e,n){void 0===n&&(n=new s);var i=this.matrix,r=i[0],a=i[1],o=i[2],h=i[3],l=i[4],u=i[5],c=1/(r*h+o*-a);return n.x=h*c*t+-o*c*e+(u*o-l*h)*c,n.y=r*c*e+-a*c*t+(-u*r+l*a)*c,n},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=a},function(t,e){var n={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=n},function(t,e,n){var i=n(0),r=n(194),s=n(195),a=n(201),o=n(202),h=new i({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,n){return this.scene.sys.input.enable(this,t,e,n),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,n=[];e&&(n.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return n.unshift(this.scene.sys.displayList.getIndex(t)),n},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(o.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,n){var i=n(0),r=n(196),s=new i({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once("destroy",this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var n=[],i=0;i<t.length;i++)n.push(e[t[i]]);return n}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var n in this.list)this.list.hasOwnProperty(n)&&n.match(t)&&(e[n]=this.list[n]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var n in t)this.setValue(n,t[n]);return this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var n=this,i=this.list,s=this.events,a=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return i[t]},set:function(e){if(!n._frozen){var o=i[t];i[t]=e,s.emit(r.CHANGE_DATA,a,t,e,o),s.emit(r.CHANGE_DATA_KEY+t,a,e,o)}}}),i[t]=e,s.emit(r.SET_DATA,a,t,e)}return this},each:function(t,e){for(var n=[this.parent,null,void 0],i=1;i<arguments.length;i++)n.push(arguments[i]);for(var r in this.list)n[1]=r,n[2]=this.list[r],t.apply(e,n);return this},merge:function(t,e){for(var n in void 0===e&&(e=!0),t)t.hasOwnProperty(n)&&(e||!e&&!this.has(n))&&this.setValue(n,t[n]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(r.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(r.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(r.CHANGE_DATA),this.events.off(r.SET_DATA),this.events.off(r.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=s},function(t,e,n){t.exports={CHANGE_DATA:n(197),CHANGE_DATA_KEY:n(198),REMOVE_DATA:n(199),SET_DATA:n(200)}},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e,n){"use strict";var i=Object.prototype.hasOwnProperty,r="~";function s(){}function a(t,e,n,i,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new function(t,e,n){this.fn=t,this.context=e,this.once=n||!1}(n,i||t,s),o=r?r+e:e;return t._events[o]?t._events[o].fn?t._events[o]=[t._events[o],a]:t._events[o].push(a):(t._events[o]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function h(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),h.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},h.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,a=new Array(s);i<s;i++)a[i]=n[i].fn;return a},h.prototype.listenerCount=function(t){var e=r?r+t:t,n=this._events[e];return n?n.fn?1:n.length:0},h.prototype.emit=function(t,e,n,i,s,a){var o=r?r+t:t;if(!this._events[o])return!1;var h,l,u=this._events[o],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,n),!0;case 4:return u.fn.call(u.context,e,n,i),!0;case 5:return u.fn.call(u.context,e,n,i,s),!0;case 6:return u.fn.call(u.context,e,n,i,s,a),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var f,d=u.length;for(l=0;l<d;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,n);break;case 4:u[l].fn.call(u[l].context,e,n,i);break;default:if(!h)for(f=1,h=new Array(c-1);f<c;f++)h[f-1]=arguments[f];u[l].fn.apply(u[l].context,h)}}return!0},h.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},h.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},h.prototype.removeListener=function(t,e,n,i){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==e||i&&!a.once||n&&a.context!==n||o(this,s);else{for(var h=0,l=[],u=a.length;h<u;h++)(a[h].fn!==e||i&&!a[h].once||n&&a[h].context!==n)&&l.push(a[h]);l.length?this._events[s]=1===l.length?l[0]:l:o(this,s)}return this},h.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&o(this,e)):(this._events=new s,this._eventsCount=0),this},h.prototype.off=h.prototype.removeListener,h.prototype.addListener=h.prototype.on,h.prefixed=r,h.EventEmitter=h,t.exports=h},function(t,e,n){t.exports={DESTROY:n(203),VIDEO_COMPLETE:n(204),VIDEO_CREATED:n(205),VIDEO_ERROR:n(206),VIDEO_LOOP:n(207),VIDEO_PLAY:n(208),VIDEO_SEEKED:n(209),VIDEO_SEEKING:n(210),VIDEO_STOP:n(211),VIDEO_TIMEOUT:n(212),VIDEO_UNLOCKED:n(213)}},function(t,e){t.exports="destroy"},function(t,e){t.exports="complete"},function(t,e){t.exports="created"},function(t,e){t.exports="error"},function(t,e){t.exports="loop"},function(t,e){t.exports="play"},function(t,e){t.exports="seeked"},function(t,e){t.exports="seeking"},function(t,e){t.exports="stop"},function(t,e){t.exports="timeout"},function(t,e){t.exports="unlocked"},function(t,e,n){t.exports={COMPLETE:n(215),DISPOSE:n(216),END:n(217),EVENT:n(218),INTERRUPTED:n(219),START:n(220)}},function(t,e){t.exports="complete"},function(t,e){t.exports="dispose"},function(t,e){t.exports="end"},function(t,e){t.exports="event"},function(t,e){t.exports="interrupted"},function(t,e){t.exports="start"},function(t,e,n){var i=n(31),r=n(31);r=n(222),t.exports={renderWebGL:i,renderCanvas:r}},function(t,e,n){var i=n(7),r=n(9),s=n(4);t.exports=function(t,e,n,a,o){var h=t.currentContext,l=e.plugin,u=e.skeleton,c=l.skeletonRenderer,f=!(15!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&a.id);if(u&&f){var d=t._tempMatrix1,p=t._tempMatrix2,v=t._tempMatrix3;p.applyITRS(e.x,e.y,e.rotation,Math.abs(e.scaleX),Math.abs(e.scaleY)),d.copyFrom(a.matrix),o?(d.multiplyWithOffset(o,-a.scrollX*e.scrollFactorX,-a.scrollY*e.scrollFactorY),p.e=e.x,p.f=e.y,d.multiply(p,v)):(p.e-=a.scrollX*e.scrollFactorX,p.f-=a.scrollY*e.scrollFactorY,d.multiply(p,v)),u.x=v.tx,u.y=v.ty,u.scaleX=v.scaleX,u.scaleY=-1*v.scaleY,e.scaleX<0?(u.scaleX*=-1,e.root.rotation=r(v.rotationNormalized)):e.root.rotation=s(r(i(v.rotationNormalized))+90,0,360),e.scaleY<0&&(u.scaleY*=-1,e.scaleX<0?e.root.rotation-=2*r(v.rotationNormalized):e.root.rotation+=2*r(v.rotationNormalized)),a.renderToTexture&&(u.y=v.ty,u.scaleY*=-1),u.updateWorldTransform(),c.ctx=h,c.debugRendering=l.drawDebug||e.drawDebug,h.save(),c.draw(u),h.restore()}}}]); |